From 1dfd3f3eb12f114e626cc098d3ae7c1f7c5527e6 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Fri, 23 Jun 2023 08:52:33 -0400 Subject: [PATCH] feat: [alloydb] Added new SSL modes ALLOW_UNENCRYPTED_AND_ENCRYPTED, ENCRYPTED_ONLY (#9538) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat: Added new SSL modes ALLOW_UNENCRYPTED_AND_ENCRYPTED, ENCRYPTED_ONLY feat: Added support for continuous backups feat: Added support for cross-region replication (secondary clusters/instances and promotion) feat: Added users API feat: Added fault injection API fix: Deprecated SSL modes SSL_MODE_ALLOW, SSL_MODE_REQUIRE, SSL_MODE_VERIFY_CA PiperOrigin-RevId: 539728978 Source-Link: https://github.com/googleapis/googleapis/commit/cd897429336a508c2410ef810ed6380ec5a4c44a Source-Link: https://github.com/googleapis/googleapis-gen/commit/87e91452dce13c3e176a2093065b3e38e2b0dc90 Copy-Tag: eyJwIjoiamF2YS1hbGxveWRiLy5Pd2xCb3QueWFtbCIsImgiOiI4N2U5MTQ1MmRjZTEzYzNlMTc2YTIwOTMwNjViM2UzOGUyYjBkYzkwIn0= feat: Added ClusterView supporting more granular view of continuous backups feat: Added new SSL modes ALLOW_UNENCRYPTED_AND_ENCRYPTED, ENCRYPTED_ONLY feat: Added users API feat: Added fault injection API feat: Added instance update policy feat: Added cluster network config fix: Deprecated SSL modes SSL_MODE_ALLOW, SSL_MODE_REQUIRE, SSL_MODE_VERIFY_CA PiperOrigin-RevId: 539728897 Source-Link: https://github.com/googleapis/googleapis/commit/3fcf0b3edb1b9444f330242c386277ae67de7121 Source-Link: https://github.com/googleapis/googleapis-gen/commit/8001a897d463c95bbcf6e795dcc93c58180c0622 Copy-Tag: eyJwIjoiamF2YS1hbGxveWRiLy5Pd2xCb3QueWFtbCIsImgiOiI4MDAxYTg5N2Q0NjNjOTViYmNmNmU3OTVkY2M5M2M1ODE4MGMwNjIyIn0= feat: Added ClusterView supporting more granular view of continuous backups feat: Added new SSL modes ALLOW_UNENCRYPTED_AND_ENCRYPTED, ENCRYPTED_ONLY feat: Added users API feat: Added fault injection API feat: Added instance update policy feat: Added cluster network config fix: Deprecated SSL modes SSL_MODE_ALLOW, SSL_MODE_REQUIRE, SSL_MODE_VERIFY_CA PiperOrigin-RevId: 539726243 Source-Link: https://github.com/googleapis/googleapis/commit/277df0ec41d2f78e21998b3241223e148f8b3eb1 Source-Link: https://github.com/googleapis/googleapis-gen/commit/e7ec1f4788e628c686dfe4b5096bd4894c0cc54c Copy-Tag: eyJwIjoiamF2YS1hbGxveWRiLy5Pd2xCb3QueWFtbCIsImgiOiJlN2VjMWY0Nzg4ZTYyOGM2ODZkZmU0YjUwOTZiZDQ4OTRjMGNjNTRjIn0= * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md --------- Co-authored-by: Owl Bot --- java-alloydb/README.md | 2 +- .../cloud/alloydb/v1/AlloyDBAdminClient.java | 1848 ++++++++++++++--- .../alloydb/v1/AlloyDBAdminSettings.java | 147 ++ .../cloud/alloydb/v1/gapic_metadata.json | 27 + .../alloydb/v1/stub/AlloyDBAdminStub.java | 75 + .../v1/stub/AlloyDBAdminStubSettings.java | 463 +++++ .../alloydb/v1/stub/GrpcAlloyDBAdminStub.java | 336 +++ .../v1/stub/HttpJsonAlloyDBAdminStub.java | 627 ++++++ .../alloydb/v1alpha/AlloyDBAdminClient.java | 965 ++++++++- .../alloydb/v1alpha/AlloyDBAdminSettings.java | 75 + .../cloud/alloydb/v1alpha/gapic_metadata.json | 18 + .../v1alpha/stub/AlloyDBAdminStub.java | 42 + .../stub/AlloyDBAdminStubSettings.java | 243 +++ .../v1alpha/stub/GrpcAlloyDBAdminStub.java | 195 ++ .../stub/HttpJsonAlloyDBAdminStub.java | 382 ++++ .../alloydb/v1beta/AlloyDBAdminClient.java | 965 ++++++++- .../alloydb/v1beta/AlloyDBAdminSettings.java | 75 + .../cloud/alloydb/v1beta/gapic_metadata.json | 18 + .../alloydb/v1beta/stub/AlloyDBAdminStub.java | 42 + .../v1beta/stub/AlloyDBAdminStubSettings.java | 243 +++ .../v1beta/stub/GrpcAlloyDBAdminStub.java | 195 ++ .../v1beta/stub/HttpJsonAlloyDBAdminStub.java | 382 ++++ .../v1/AlloyDBAdminClientHttpJsonTest.java | 1119 +++++++++- .../alloydb/v1/AlloyDBAdminClientTest.java | 966 ++++++++- .../alloydb/v1/MockAlloyDBAdminImpl.java | 185 ++ .../AlloyDBAdminClientHttpJsonTest.java | 604 ++++++ .../v1alpha/AlloyDBAdminClientTest.java | 531 +++++ .../alloydb/v1alpha/MockAlloyDBAdminImpl.java | 122 ++ .../AlloyDBAdminClientHttpJsonTest.java | 604 ++++++ .../v1beta/AlloyDBAdminClientTest.java | 531 +++++ .../alloydb/v1beta/MockAlloyDBAdminImpl.java | 122 ++ .../cloud/alloydb/v1/AlloyDBAdminGrpc.java | 1126 +++++++++- .../alloydb/v1alpha/AlloyDBAdminGrpc.java | 686 +++++- .../alloydb/v1beta/AlloyDBAdminGrpc.java | 681 +++++- .../com/google/cloud/alloydb/v1/Backup.java | 14 +- .../cloud/alloydb/v1/BackupOrBuilder.java | 4 +- .../alloydb/v1/BatchCreateInstanceStatus.java | 2 + .../v1/BatchCreateInstancesMetadata.java | 2 + .../com/google/cloud/alloydb/v1/Cluster.java | 700 ++++++- .../cloud/alloydb/v1/ClusterOrBuilder.java | 101 +- .../google/cloud/alloydb/v1/ClusterView.java | 185 ++ .../alloydb/v1/ContinuousBackupConfig.java | 980 +++++++++ .../v1/ContinuousBackupConfigOrBuilder.java | 109 + .../alloydb/v1/ContinuousBackupInfo.java | 1779 ++++++++++++++++ .../v1/ContinuousBackupInfoOrBuilder.java | 232 +++ .../alloydb/v1/ContinuousBackupSource.java | 911 ++++++++ .../v1/ContinuousBackupSourceOrBuilder.java | 92 + .../alloydb/v1/CreateClusterRequest.java | 14 +- .../v1/CreateClusterRequestOrBuilder.java | 4 +- .../v1/CreateSecondaryClusterRequest.java | 1451 +++++++++++++ ...reateSecondaryClusterRequestOrBuilder.java | 183 ++ .../v1/CreateSecondaryInstanceRequest.java | 1481 +++++++++++++ ...eateSecondaryInstanceRequestOrBuilder.java | 183 ++ .../cloud/alloydb/v1/CreateUserRequest.java | 1447 +++++++++++++ .../v1/CreateUserRequestOrBuilder.java | 177 ++ .../cloud/alloydb/v1/DatabaseVersion.java | 2 +- .../cloud/alloydb/v1/DeleteUserRequest.java | 1007 +++++++++ .../v1/DeleteUserRequestOrBuilder.java | 119 ++ .../cloud/alloydb/v1/GetClusterRequest.java | 167 ++ .../v1/GetClusterRequestOrBuilder.java | 29 + .../cloud/alloydb/v1/GetUserRequest.java | 644 ++++++ .../alloydb/v1/GetUserRequestOrBuilder.java | 56 + .../cloud/alloydb/v1/InjectFaultRequest.java | 1317 ++++++++++++ .../v1/InjectFaultRequestOrBuilder.java | 149 ++ .../com/google/cloud/alloydb/v1/Instance.java | 54 +- .../cloud/alloydb/v1/InstanceOrBuilder.java | 14 +- .../google/cloud/alloydb/v1/InstanceView.java | 2 +- .../cloud/alloydb/v1/ListUsersRequest.java | 1280 ++++++++++++ .../alloydb/v1/ListUsersRequestOrBuilder.java | 143 ++ .../cloud/alloydb/v1/ListUsersResponse.java | 1388 +++++++++++++ .../v1/ListUsersResponseOrBuilder.java | 152 ++ .../alloydb/v1/PromoteClusterRequest.java | 1204 +++++++++++ .../v1/PromoteClusterRequestOrBuilder.java | 148 ++ .../cloud/alloydb/v1/ResourcesProto.java | 482 +++-- .../alloydb/v1/RestoreClusterRequest.java | 375 +++- .../v1/RestoreClusterRequestOrBuilder.java | 38 + .../google/cloud/alloydb/v1/ServiceProto.java | 712 ++++--- .../google/cloud/alloydb/v1/SslConfig.java | 73 +- .../cloud/alloydb/v1/UpdateUserRequest.java | 1482 +++++++++++++ .../v1/UpdateUserRequestOrBuilder.java | 186 ++ .../com/google/cloud/alloydb/v1/User.java | 1419 +++++++++++++ .../com/google/cloud/alloydb/v1/UserName.java | 257 +++ .../cloud/alloydb/v1/UserOrBuilder.java | 161 ++ .../google/cloud/alloydb/v1/resources.proto | 175 +- .../google/cloud/alloydb/v1/service.proto | 417 +++- .../google/cloud/alloydb/v1alpha/Backup.java | 14 +- .../alloydb/v1alpha/BackupOrBuilder.java | 4 +- .../v1alpha/BatchCreateInstanceStatus.java | 2 + .../v1alpha/BatchCreateInstancesMetadata.java | 2 + .../google/cloud/alloydb/v1alpha/Cluster.java | 1473 +++++++++++-- .../alloydb/v1alpha/ClusterOrBuilder.java | 42 +- .../cloud/alloydb/v1alpha/ClusterView.java | 185 ++ .../cloud/alloydb/v1alpha/ConnectionInfo.java | 78 +- .../v1alpha/ConnectionInfoOrBuilder.java | 24 +- .../alloydb/v1alpha/ContinuousBackupInfo.java | 306 +++ .../ContinuousBackupInfoOrBuilder.java | 44 + .../alloydb/v1alpha/CreateClusterRequest.java | 14 +- .../CreateClusterRequestOrBuilder.java | 4 +- .../CreateSecondaryClusterRequest.java | 28 +- ...reateSecondaryClusterRequestOrBuilder.java | 8 +- .../alloydb/v1alpha/CreateUserRequest.java | 1451 +++++++++++++ .../v1alpha/CreateUserRequestOrBuilder.java | 180 ++ .../alloydb/v1alpha/DatabaseVersion.java | 2 +- .../alloydb/v1alpha/DeleteUserRequest.java | 1008 +++++++++ .../v1alpha/DeleteUserRequestOrBuilder.java | 119 ++ .../GenerateClientCertificateRequest.java | 217 +- ...rateClientCertificateRequestOrBuilder.java | 35 +- .../GenerateClientCertificateResponse.java | 182 ++ ...ateClientCertificateResponseOrBuilder.java | 25 + .../alloydb/v1alpha/GetClusterRequest.java | 171 ++ .../v1alpha/GetClusterRequestOrBuilder.java | 31 + .../cloud/alloydb/v1alpha/GetUserRequest.java | 645 ++++++ .../v1alpha/GetUserRequestOrBuilder.java | 56 + .../alloydb/v1alpha/InjectFaultRequest.java | 1321 ++++++++++++ .../v1alpha/InjectFaultRequestOrBuilder.java | 149 ++ .../cloud/alloydb/v1alpha/Instance.java | 1306 +++++++++++- .../alloydb/v1alpha/InstanceOrBuilder.java | 58 +- .../cloud/alloydb/v1alpha/InstanceView.java | 2 +- .../alloydb/v1alpha/ListUsersRequest.java | 1281 ++++++++++++ .../v1alpha/ListUsersRequestOrBuilder.java | 143 ++ .../alloydb/v1alpha/ListUsersResponse.java | 1393 +++++++++++++ .../v1alpha/ListUsersResponseOrBuilder.java | 152 ++ .../cloud/alloydb/v1alpha/ResourcesProto.java | 530 ++--- .../cloud/alloydb/v1alpha/ServiceProto.java | 771 ++++--- .../cloud/alloydb/v1alpha/SslConfig.java | 73 +- .../alloydb/v1alpha/UpdateUserRequest.java | 1486 +++++++++++++ .../v1alpha/UpdateUserRequestOrBuilder.java | 189 ++ .../google/cloud/alloydb/v1alpha/User.java | 1423 +++++++++++++ .../cloud/alloydb/v1alpha/UserName.java | 257 +++ .../cloud/alloydb/v1alpha/UserOrBuilder.java | 161 ++ .../cloud/alloydb/v1alpha/resources.proto | 173 +- .../cloud/alloydb/v1alpha/service.proto | 271 ++- .../google/cloud/alloydb/v1beta/Backup.java | 14 +- .../cloud/alloydb/v1beta/BackupOrBuilder.java | 4 +- .../v1beta/BatchCreateInstanceStatus.java | 2 + .../v1beta/BatchCreateInstancesMetadata.java | 2 + .../google/cloud/alloydb/v1beta/Cluster.java | 1471 +++++++++++-- .../alloydb/v1beta/ClusterOrBuilder.java | 42 +- .../cloud/alloydb/v1beta/ClusterView.java | 185 ++ .../cloud/alloydb/v1beta/ConnectionInfo.java | 78 +- .../v1beta/ConnectionInfoOrBuilder.java | 24 +- .../alloydb/v1beta/ContinuousBackupInfo.java | 306 +++ .../v1beta/ContinuousBackupInfoOrBuilder.java | 44 + .../alloydb/v1beta/CreateClusterRequest.java | 14 +- .../v1beta/CreateClusterRequestOrBuilder.java | 4 +- .../v1beta/CreateSecondaryClusterRequest.java | 28 +- ...reateSecondaryClusterRequestOrBuilder.java | 8 +- .../alloydb/v1beta/CreateUserRequest.java | 1451 +++++++++++++ .../v1beta/CreateUserRequestOrBuilder.java | 180 ++ .../cloud/alloydb/v1beta/DatabaseVersion.java | 2 +- .../alloydb/v1beta/DeleteUserRequest.java | 1008 +++++++++ .../v1beta/DeleteUserRequestOrBuilder.java | 119 ++ .../GenerateClientCertificateRequest.java | 217 +- ...rateClientCertificateRequestOrBuilder.java | 35 +- .../GenerateClientCertificateResponse.java | 182 ++ ...ateClientCertificateResponseOrBuilder.java | 25 + .../alloydb/v1beta/GetClusterRequest.java | 169 ++ .../v1beta/GetClusterRequestOrBuilder.java | 31 + .../cloud/alloydb/v1beta/GetUserRequest.java | 644 ++++++ .../v1beta/GetUserRequestOrBuilder.java | 56 + .../alloydb/v1beta/InjectFaultRequest.java | 1321 ++++++++++++ .../v1beta/InjectFaultRequestOrBuilder.java | 149 ++ .../google/cloud/alloydb/v1beta/Instance.java | 1305 +++++++++++- .../alloydb/v1beta/InstanceOrBuilder.java | 58 +- .../cloud/alloydb/v1beta/InstanceView.java | 2 +- .../alloydb/v1beta/ListUsersRequest.java | 1281 ++++++++++++ .../v1beta/ListUsersRequestOrBuilder.java | 143 ++ .../alloydb/v1beta/ListUsersResponse.java | 1393 +++++++++++++ .../v1beta/ListUsersResponseOrBuilder.java | 152 ++ .../cloud/alloydb/v1beta/ResourcesProto.java | 529 ++--- .../cloud/alloydb/v1beta/ServiceProto.java | 763 ++++--- .../cloud/alloydb/v1beta/SslConfig.java | 73 +- .../alloydb/v1beta/UpdateUserRequest.java | 1486 +++++++++++++ .../v1beta/UpdateUserRequestOrBuilder.java | 189 ++ .../com/google/cloud/alloydb/v1beta/User.java | 1422 +++++++++++++ .../google/cloud/alloydb/v1beta/UserName.java | 257 +++ .../cloud/alloydb/v1beta/UserOrBuilder.java | 161 ++ .../cloud/alloydb/v1beta/resources.proto | 173 +- .../google/cloud/alloydb/v1beta/service.proto | 271 ++- .../AsyncCreateSecondaryCluster.java | 55 + .../AsyncCreateSecondaryClusterLRO.java | 55 + .../SyncCreateSecondaryCluster.java | 50 + ...ndaryClusterLocationnameClusterString.java | 45 + ...teSecondaryClusterStringClusterString.java | 45 + .../AsyncCreateSecondaryInstance.java | 55 + .../AsyncCreateSecondaryInstanceLRO.java | 55 + .../SyncCreateSecondaryInstance.java | 50 + ...daryInstanceClusternameInstanceString.java | 45 + ...SecondaryInstanceStringInstanceString.java | 45 + .../createuser/AsyncCreateUser.java | 53 + .../createuser/SyncCreateUser.java | 50 + .../SyncCreateUserClusternameUserString.java | 44 + .../SyncCreateUserStringUserString.java | 44 + .../deleteuser/AsyncDeleteUser.java | 51 + .../deleteuser/SyncDeleteUser.java | 48 + .../deleteuser/SyncDeleteUserString.java | 42 + .../deleteuser/SyncDeleteUserUsername.java | 42 + .../getcluster/AsyncGetCluster.java | 2 + .../getcluster/SyncGetCluster.java | 2 + .../v1/alloydbadmin/getuser/AsyncGetUser.java | 49 + .../v1/alloydbadmin/getuser/SyncGetUser.java | 46 + .../getuser/SyncGetUserString.java | 42 + .../getuser/SyncGetUserUsername.java | 42 + .../injectfault/AsyncInjectFault.java | 52 + .../injectfault/AsyncInjectFaultLRO.java | 54 + .../injectfault/SyncInjectFault.java | 49 + ...jectfaultrequestfaulttypeInstancename.java | 44 + ...aultInjectfaultrequestfaulttypeString.java | 45 + .../listusers/AsyncListUsers.java | 55 + .../listusers/AsyncListUsersPaged.java | 63 + .../alloydbadmin/listusers/SyncListUsers.java | 52 + .../listusers/SyncListUsersClustername.java | 44 + .../listusers/SyncListUsersString.java | 44 + .../promotecluster/AsyncPromoteCluster.java | 52 + .../AsyncPromoteClusterLRO.java | 54 + .../promotecluster/SyncPromoteCluster.java | 49 + .../SyncPromoteClusterClustername.java | 42 + .../SyncPromoteClusterString.java | 42 + .../updateuser/AsyncUpdateUser.java | 53 + .../updateuser/SyncUpdateUser.java | 50 + .../SyncUpdateUserUserFieldmask.java | 43 + .../createuser/AsyncCreateUser.java | 53 + .../createuser/SyncCreateUser.java | 50 + .../SyncCreateUserClusternameUserString.java | 44 + .../SyncCreateUserStringUserString.java | 44 + .../deleteuser/AsyncDeleteUser.java | 51 + .../deleteuser/SyncDeleteUser.java | 48 + .../deleteuser/SyncDeleteUserString.java | 42 + .../deleteuser/SyncDeleteUserUsername.java | 42 + .../AsyncGenerateClientCertificate.java | 1 + .../SyncGenerateClientCertificate.java | 1 + .../getcluster/AsyncGetCluster.java | 2 + .../getcluster/SyncGetCluster.java | 2 + .../alloydbadmin/getuser/AsyncGetUser.java | 49 + .../alloydbadmin/getuser/SyncGetUser.java | 46 + .../getuser/SyncGetUserString.java | 42 + .../getuser/SyncGetUserUsername.java | 42 + .../injectfault/AsyncInjectFault.java | 52 + .../injectfault/AsyncInjectFaultLRO.java | 54 + .../injectfault/SyncInjectFault.java | 49 + ...jectfaultrequestfaulttypeInstancename.java | 44 + ...aultInjectfaultrequestfaulttypeString.java | 45 + .../listusers/AsyncListUsers.java | 55 + .../listusers/AsyncListUsersPaged.java | 63 + .../alloydbadmin/listusers/SyncListUsers.java | 52 + .../listusers/SyncListUsersClustername.java | 44 + .../listusers/SyncListUsersString.java | 44 + .../updateuser/AsyncUpdateUser.java | 53 + .../updateuser/SyncUpdateUser.java | 50 + .../SyncUpdateUserUserFieldmask.java | 43 + .../createuser/AsyncCreateUser.java | 53 + .../createuser/SyncCreateUser.java | 50 + .../SyncCreateUserClusternameUserString.java | 44 + .../SyncCreateUserStringUserString.java | 44 + .../deleteuser/AsyncDeleteUser.java | 51 + .../deleteuser/SyncDeleteUser.java | 48 + .../deleteuser/SyncDeleteUserString.java | 42 + .../deleteuser/SyncDeleteUserUsername.java | 42 + .../AsyncGenerateClientCertificate.java | 1 + .../SyncGenerateClientCertificate.java | 1 + .../getcluster/AsyncGetCluster.java | 2 + .../getcluster/SyncGetCluster.java | 2 + .../alloydbadmin/getuser/AsyncGetUser.java | 49 + .../alloydbadmin/getuser/SyncGetUser.java | 46 + .../getuser/SyncGetUserString.java | 42 + .../getuser/SyncGetUserUsername.java | 42 + .../injectfault/AsyncInjectFault.java | 52 + .../injectfault/AsyncInjectFaultLRO.java | 54 + .../injectfault/SyncInjectFault.java | 49 + ...jectfaultrequestfaulttypeInstancename.java | 44 + ...aultInjectfaultrequestfaulttypeString.java | 45 + .../listusers/AsyncListUsers.java | 55 + .../listusers/AsyncListUsersPaged.java | 63 + .../alloydbadmin/listusers/SyncListUsers.java | 52 + .../listusers/SyncListUsersClustername.java | 44 + .../listusers/SyncListUsersString.java | 44 + .../updateuser/AsyncUpdateUser.java | 53 + .../updateuser/SyncUpdateUser.java | 50 + .../SyncUpdateUserUserFieldmask.java | 43 + 279 files changed, 74767 insertions(+), 2898 deletions(-) create mode 100644 java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/ClusterView.java create mode 100644 java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/ContinuousBackupConfig.java create mode 100644 java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/ContinuousBackupConfigOrBuilder.java create mode 100644 java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/ContinuousBackupInfo.java create mode 100644 java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/ContinuousBackupInfoOrBuilder.java create mode 100644 java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/ContinuousBackupSource.java create mode 100644 java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/ContinuousBackupSourceOrBuilder.java create mode 100644 java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/CreateSecondaryClusterRequest.java create mode 100644 java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/CreateSecondaryClusterRequestOrBuilder.java create mode 100644 java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/CreateSecondaryInstanceRequest.java create mode 100644 java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/CreateSecondaryInstanceRequestOrBuilder.java create mode 100644 java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/CreateUserRequest.java create mode 100644 java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/CreateUserRequestOrBuilder.java create mode 100644 java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/DeleteUserRequest.java create mode 100644 java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/DeleteUserRequestOrBuilder.java create mode 100644 java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/GetUserRequest.java create mode 100644 java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/GetUserRequestOrBuilder.java create mode 100644 java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/InjectFaultRequest.java create mode 100644 java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/InjectFaultRequestOrBuilder.java create mode 100644 java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/ListUsersRequest.java create mode 100644 java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/ListUsersRequestOrBuilder.java create mode 100644 java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/ListUsersResponse.java create mode 100644 java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/ListUsersResponseOrBuilder.java create mode 100644 java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/PromoteClusterRequest.java create mode 100644 java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/PromoteClusterRequestOrBuilder.java create mode 100644 java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/UpdateUserRequest.java create mode 100644 java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/UpdateUserRequestOrBuilder.java create mode 100644 java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/User.java create mode 100644 java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/UserName.java create mode 100644 java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/UserOrBuilder.java create mode 100644 java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/ClusterView.java create mode 100644 java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/CreateUserRequest.java create mode 100644 java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/CreateUserRequestOrBuilder.java create mode 100644 java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/DeleteUserRequest.java create mode 100644 java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/DeleteUserRequestOrBuilder.java create mode 100644 java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/GetUserRequest.java create mode 100644 java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/GetUserRequestOrBuilder.java create mode 100644 java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/InjectFaultRequest.java create mode 100644 java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/InjectFaultRequestOrBuilder.java create mode 100644 java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/ListUsersRequest.java create mode 100644 java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/ListUsersRequestOrBuilder.java create mode 100644 java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/ListUsersResponse.java create mode 100644 java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/ListUsersResponseOrBuilder.java create mode 100644 java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/UpdateUserRequest.java create mode 100644 java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/UpdateUserRequestOrBuilder.java create mode 100644 java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/User.java create mode 100644 java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/UserName.java create mode 100644 java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/UserOrBuilder.java create mode 100644 java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/ClusterView.java create mode 100644 java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/CreateUserRequest.java create mode 100644 java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/CreateUserRequestOrBuilder.java create mode 100644 java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/DeleteUserRequest.java create mode 100644 java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/DeleteUserRequestOrBuilder.java create mode 100644 java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/GetUserRequest.java create mode 100644 java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/GetUserRequestOrBuilder.java create mode 100644 java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/InjectFaultRequest.java create mode 100644 java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/InjectFaultRequestOrBuilder.java create mode 100644 java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/ListUsersRequest.java create mode 100644 java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/ListUsersRequestOrBuilder.java create mode 100644 java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/ListUsersResponse.java create mode 100644 java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/ListUsersResponseOrBuilder.java create mode 100644 java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/UpdateUserRequest.java create mode 100644 java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/UpdateUserRequestOrBuilder.java create mode 100644 java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/User.java create mode 100644 java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/UserName.java create mode 100644 java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/UserOrBuilder.java create mode 100644 java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/createsecondarycluster/AsyncCreateSecondaryCluster.java create mode 100644 java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/createsecondarycluster/AsyncCreateSecondaryClusterLRO.java create mode 100644 java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/createsecondarycluster/SyncCreateSecondaryCluster.java create mode 100644 java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/createsecondarycluster/SyncCreateSecondaryClusterLocationnameClusterString.java create mode 100644 java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/createsecondarycluster/SyncCreateSecondaryClusterStringClusterString.java create mode 100644 java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/createsecondaryinstance/AsyncCreateSecondaryInstance.java create mode 100644 java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/createsecondaryinstance/AsyncCreateSecondaryInstanceLRO.java create mode 100644 java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/createsecondaryinstance/SyncCreateSecondaryInstance.java create mode 100644 java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/createsecondaryinstance/SyncCreateSecondaryInstanceClusternameInstanceString.java create mode 100644 java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/createsecondaryinstance/SyncCreateSecondaryInstanceStringInstanceString.java create mode 100644 java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/createuser/AsyncCreateUser.java create mode 100644 java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/createuser/SyncCreateUser.java create mode 100644 java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/createuser/SyncCreateUserClusternameUserString.java create mode 100644 java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/createuser/SyncCreateUserStringUserString.java create mode 100644 java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/deleteuser/AsyncDeleteUser.java create mode 100644 java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/deleteuser/SyncDeleteUser.java create mode 100644 java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/deleteuser/SyncDeleteUserString.java create mode 100644 java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/deleteuser/SyncDeleteUserUsername.java create mode 100644 java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/getuser/AsyncGetUser.java create mode 100644 java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/getuser/SyncGetUser.java create mode 100644 java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/getuser/SyncGetUserString.java create mode 100644 java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/getuser/SyncGetUserUsername.java create mode 100644 java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/injectfault/AsyncInjectFault.java create mode 100644 java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/injectfault/AsyncInjectFaultLRO.java create mode 100644 java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/injectfault/SyncInjectFault.java create mode 100644 java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/injectfault/SyncInjectFaultInjectfaultrequestfaulttypeInstancename.java create mode 100644 java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/injectfault/SyncInjectFaultInjectfaultrequestfaulttypeString.java create mode 100644 java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/listusers/AsyncListUsers.java create mode 100644 java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/listusers/AsyncListUsersPaged.java create mode 100644 java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/listusers/SyncListUsers.java create mode 100644 java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/listusers/SyncListUsersClustername.java create mode 100644 java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/listusers/SyncListUsersString.java create mode 100644 java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/promotecluster/AsyncPromoteCluster.java create mode 100644 java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/promotecluster/AsyncPromoteClusterLRO.java create mode 100644 java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/promotecluster/SyncPromoteCluster.java create mode 100644 java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/promotecluster/SyncPromoteClusterClustername.java create mode 100644 java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/promotecluster/SyncPromoteClusterString.java create mode 100644 java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/updateuser/AsyncUpdateUser.java create mode 100644 java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/updateuser/SyncUpdateUser.java create mode 100644 java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/updateuser/SyncUpdateUserUserFieldmask.java create mode 100644 java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/createuser/AsyncCreateUser.java create mode 100644 java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/createuser/SyncCreateUser.java create mode 100644 java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/createuser/SyncCreateUserClusternameUserString.java create mode 100644 java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/createuser/SyncCreateUserStringUserString.java create mode 100644 java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/deleteuser/AsyncDeleteUser.java create mode 100644 java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/deleteuser/SyncDeleteUser.java create mode 100644 java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/deleteuser/SyncDeleteUserString.java create mode 100644 java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/deleteuser/SyncDeleteUserUsername.java create mode 100644 java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/getuser/AsyncGetUser.java create mode 100644 java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/getuser/SyncGetUser.java create mode 100644 java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/getuser/SyncGetUserString.java create mode 100644 java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/getuser/SyncGetUserUsername.java create mode 100644 java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/injectfault/AsyncInjectFault.java create mode 100644 java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/injectfault/AsyncInjectFaultLRO.java create mode 100644 java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/injectfault/SyncInjectFault.java create mode 100644 java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/injectfault/SyncInjectFaultInjectfaultrequestfaulttypeInstancename.java create mode 100644 java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/injectfault/SyncInjectFaultInjectfaultrequestfaulttypeString.java create mode 100644 java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/listusers/AsyncListUsers.java create mode 100644 java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/listusers/AsyncListUsersPaged.java create mode 100644 java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/listusers/SyncListUsers.java create mode 100644 java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/listusers/SyncListUsersClustername.java create mode 100644 java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/listusers/SyncListUsersString.java create mode 100644 java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/updateuser/AsyncUpdateUser.java create mode 100644 java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/updateuser/SyncUpdateUser.java create mode 100644 java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/updateuser/SyncUpdateUserUserFieldmask.java create mode 100644 java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/createuser/AsyncCreateUser.java create mode 100644 java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/createuser/SyncCreateUser.java create mode 100644 java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/createuser/SyncCreateUserClusternameUserString.java create mode 100644 java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/createuser/SyncCreateUserStringUserString.java create mode 100644 java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/deleteuser/AsyncDeleteUser.java create mode 100644 java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/deleteuser/SyncDeleteUser.java create mode 100644 java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/deleteuser/SyncDeleteUserString.java create mode 100644 java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/deleteuser/SyncDeleteUserUsername.java create mode 100644 java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/getuser/AsyncGetUser.java create mode 100644 java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/getuser/SyncGetUser.java create mode 100644 java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/getuser/SyncGetUserString.java create mode 100644 java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/getuser/SyncGetUserUsername.java create mode 100644 java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/injectfault/AsyncInjectFault.java create mode 100644 java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/injectfault/AsyncInjectFaultLRO.java create mode 100644 java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/injectfault/SyncInjectFault.java create mode 100644 java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/injectfault/SyncInjectFaultInjectfaultrequestfaulttypeInstancename.java create mode 100644 java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/injectfault/SyncInjectFaultInjectfaultrequestfaulttypeString.java create mode 100644 java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/listusers/AsyncListUsers.java create mode 100644 java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/listusers/AsyncListUsersPaged.java create mode 100644 java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/listusers/SyncListUsers.java create mode 100644 java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/listusers/SyncListUsersClustername.java create mode 100644 java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/listusers/SyncListUsersString.java create mode 100644 java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/updateuser/AsyncUpdateUser.java create mode 100644 java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/updateuser/SyncUpdateUser.java create mode 100644 java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/updateuser/SyncUpdateUserUserFieldmask.java diff --git a/java-alloydb/README.md b/java-alloydb/README.md index d6be7794cd7e..5c899424f894 100644 --- a/java-alloydb/README.md +++ b/java-alloydb/README.md @@ -23,7 +23,7 @@ If you are using Maven with [BOM][libraries-bom], add this to your pom.xml file: com.google.cloud libraries-bom - 26.16.0 + 26.17.0 pom import diff --git a/java-alloydb/google-cloud-alloydb/src/main/java/com/google/cloud/alloydb/v1/AlloyDBAdminClient.java b/java-alloydb/google-cloud-alloydb/src/main/java/com/google/cloud/alloydb/v1/AlloyDBAdminClient.java index 8f33ba93003f..f35eb83a4c97 100644 --- a/java-alloydb/google-cloud-alloydb/src/main/java/com/google/cloud/alloydb/v1/AlloyDBAdminClient.java +++ b/java-alloydb/google-cloud-alloydb/src/main/java/com/google/cloud/alloydb/v1/AlloyDBAdminClient.java @@ -450,6 +450,7 @@ public final Cluster getCluster(String name) { * GetClusterRequest request = * GetClusterRequest.newBuilder() * .setName(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString()) + * .setView(ClusterView.forNumber(0)) * .build(); * Cluster response = alloyDBAdminClient.getCluster(request); * } @@ -478,6 +479,7 @@ public final Cluster getCluster(GetClusterRequest request) { * GetClusterRequest request = * GetClusterRequest.newBuilder() * .setName(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString()) + * .setView(ClusterView.forNumber(0)) * .build(); * ApiFuture future = alloyDBAdminClient.getClusterCallable().futureCall(request); * // Do something. @@ -509,7 +511,7 @@ public final UnaryCallable getClusterCallable() { * } * } * - * @param parent Required. The name of the parent resource. For the required format, see the + * @param parent Required. The location of the new cluster. For the required format, see the * comment on the Cluster.name field. * @param cluster Required. The resource being created * @param clusterId Required. ID of the requesting object. @@ -546,7 +548,7 @@ public final OperationFuture createClusterAsync( * } * } * - * @param parent Required. The name of the parent resource. For the required format, see the + * @param parent Required. The location of the new cluster. For the required format, see the * comment on the Cluster.name field. * @param cluster Required. The resource being created * @param clusterId Required. ID of the requesting object. @@ -942,6 +944,160 @@ public final UnaryCallable deleteClusterCallabl return stub.deleteClusterCallable(); } + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * 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: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   ClusterName name = ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]");
+   *   Cluster response = alloyDBAdminClient.promoteClusterAsync(name).get();
+   * }
+   * }
+ * + * @param name Required. The name of the resource. For the required format, see the comment on the + * Cluster.name field + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture promoteClusterAsync(ClusterName name) { + PromoteClusterRequest request = + PromoteClusterRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + return promoteClusterAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * 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: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   String name = ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString();
+   *   Cluster response = alloyDBAdminClient.promoteClusterAsync(name).get();
+   * }
+   * }
+ * + * @param name Required. The name of the resource. For the required format, see the comment on the + * Cluster.name field + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture promoteClusterAsync(String name) { + PromoteClusterRequest request = PromoteClusterRequest.newBuilder().setName(name).build(); + return promoteClusterAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * 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: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   PromoteClusterRequest request =
+   *       PromoteClusterRequest.newBuilder()
+   *           .setName(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString())
+   *           .setRequestId("requestId693933066")
+   *           .setEtag("etag3123477")
+   *           .setValidateOnly(true)
+   *           .build();
+   *   Cluster response = alloyDBAdminClient.promoteClusterAsync(request).get();
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture promoteClusterAsync( + PromoteClusterRequest request) { + return promoteClusterOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * 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: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   PromoteClusterRequest request =
+   *       PromoteClusterRequest.newBuilder()
+   *           .setName(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString())
+   *           .setRequestId("requestId693933066")
+   *           .setEtag("etag3123477")
+   *           .setValidateOnly(true)
+   *           .build();
+   *   OperationFuture future =
+   *       alloyDBAdminClient.promoteClusterOperationCallable().futureCall(request);
+   *   // Do something.
+   *   Cluster response = future.get();
+   * }
+   * }
+ */ + public final OperationCallable + promoteClusterOperationCallable() { + return stub.promoteClusterOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * 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: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   PromoteClusterRequest request =
+   *       PromoteClusterRequest.newBuilder()
+   *           .setName(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString())
+   *           .setRequestId("requestId693933066")
+   *           .setEtag("etag3123477")
+   *           .setValidateOnly(true)
+   *           .build();
+   *   ApiFuture future = alloyDBAdminClient.promoteClusterCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable promoteClusterCallable() { + return stub.promoteClusterCallable(); + } + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Creates a new Cluster in a given project and location, with a volume restored from the provided @@ -1042,6 +1198,186 @@ public final UnaryCallable restoreClusterCalla return stub.restoreClusterCallable(); } + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a cluster of type SECONDARY in the given location using the primary cluster as the + * source. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+   *   Cluster cluster = Cluster.newBuilder().build();
+   *   String clusterId = "clusterId561939637";
+   *   Cluster response =
+   *       alloyDBAdminClient.createSecondaryClusterAsync(parent, cluster, clusterId).get();
+   * }
+   * }
+ * + * @param parent Required. The location of the new cluster. For the required format, see the + * comment on the Cluster.name field. + * @param cluster Required. Configuration of the requesting object (the secondary cluster). + * @param clusterId Required. ID of the requesting object (the secondary cluster). + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture createSecondaryClusterAsync( + LocationName parent, Cluster cluster, String clusterId) { + CreateSecondaryClusterRequest request = + CreateSecondaryClusterRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .setCluster(cluster) + .setClusterId(clusterId) + .build(); + return createSecondaryClusterAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a cluster of type SECONDARY in the given location using the primary cluster as the + * source. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
+   *   Cluster cluster = Cluster.newBuilder().build();
+   *   String clusterId = "clusterId561939637";
+   *   Cluster response =
+   *       alloyDBAdminClient.createSecondaryClusterAsync(parent, cluster, clusterId).get();
+   * }
+   * }
+ * + * @param parent Required. The location of the new cluster. For the required format, see the + * comment on the Cluster.name field. + * @param cluster Required. Configuration of the requesting object (the secondary cluster). + * @param clusterId Required. ID of the requesting object (the secondary cluster). + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture createSecondaryClusterAsync( + String parent, Cluster cluster, String clusterId) { + CreateSecondaryClusterRequest request = + CreateSecondaryClusterRequest.newBuilder() + .setParent(parent) + .setCluster(cluster) + .setClusterId(clusterId) + .build(); + return createSecondaryClusterAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a cluster of type SECONDARY in the given location using the primary cluster as the + * source. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   CreateSecondaryClusterRequest request =
+   *       CreateSecondaryClusterRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .setClusterId("clusterId561939637")
+   *           .setCluster(Cluster.newBuilder().build())
+   *           .setRequestId("requestId693933066")
+   *           .setValidateOnly(true)
+   *           .build();
+   *   Cluster response = alloyDBAdminClient.createSecondaryClusterAsync(request).get();
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture createSecondaryClusterAsync( + CreateSecondaryClusterRequest request) { + return createSecondaryClusterOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a cluster of type SECONDARY in the given location using the primary cluster as the + * source. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   CreateSecondaryClusterRequest request =
+   *       CreateSecondaryClusterRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .setClusterId("clusterId561939637")
+   *           .setCluster(Cluster.newBuilder().build())
+   *           .setRequestId("requestId693933066")
+   *           .setValidateOnly(true)
+   *           .build();
+   *   OperationFuture future =
+   *       alloyDBAdminClient.createSecondaryClusterOperationCallable().futureCall(request);
+   *   // Do something.
+   *   Cluster response = future.get();
+   * }
+   * }
+ */ + public final OperationCallable + createSecondaryClusterOperationCallable() { + return stub.createSecondaryClusterOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a cluster of type SECONDARY in the given location using the primary cluster as the + * source. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   CreateSecondaryClusterRequest request =
+   *       CreateSecondaryClusterRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .setClusterId("clusterId561939637")
+   *           .setCluster(Cluster.newBuilder().build())
+   *           .setRequestId("requestId693933066")
+   *           .setValidateOnly(true)
+   *           .build();
+   *   ApiFuture future =
+   *       alloyDBAdminClient.createSecondaryClusterCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable + createSecondaryClusterCallable() { + return stub.createSecondaryClusterCallable(); + } + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Lists Instances in a given project and location. @@ -1508,10 +1844,185 @@ public final UnaryCallable createInstanceCalla // AUTO-GENERATED DOCUMENTATION AND METHOD. /** - * 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 + * Creates a new SECONDARY Instance in a given project and location. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   ClusterName parent = ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]");
+   *   Instance instance = Instance.newBuilder().build();
+   *   String instanceId = "instanceId902024336";
+   *   Instance response =
+   *       alloyDBAdminClient.createSecondaryInstanceAsync(parent, instance, instanceId).get();
+   * }
+   * }
+ * + * @param parent Required. The name of the parent resource. For the required format, see the + * comment on the Instance.name field. + * @param instance Required. The resource being created + * @param instanceId Required. ID of the requesting object. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture createSecondaryInstanceAsync( + ClusterName parent, Instance instance, String instanceId) { + CreateSecondaryInstanceRequest request = + CreateSecondaryInstanceRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .setInstance(instance) + .setInstanceId(instanceId) + .build(); + return createSecondaryInstanceAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a new SECONDARY Instance in a given project and location. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   String parent = ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString();
+   *   Instance instance = Instance.newBuilder().build();
+   *   String instanceId = "instanceId902024336";
+   *   Instance response =
+   *       alloyDBAdminClient.createSecondaryInstanceAsync(parent, instance, instanceId).get();
+   * }
+   * }
+ * + * @param parent Required. The name of the parent resource. For the required format, see the + * comment on the Instance.name field. + * @param instance Required. The resource being created + * @param instanceId Required. ID of the requesting object. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture createSecondaryInstanceAsync( + String parent, Instance instance, String instanceId) { + CreateSecondaryInstanceRequest request = + CreateSecondaryInstanceRequest.newBuilder() + .setParent(parent) + .setInstance(instance) + .setInstanceId(instanceId) + .build(); + return createSecondaryInstanceAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a new SECONDARY Instance in a given project and location. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   CreateSecondaryInstanceRequest request =
+   *       CreateSecondaryInstanceRequest.newBuilder()
+   *           .setParent(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString())
+   *           .setInstanceId("instanceId902024336")
+   *           .setInstance(Instance.newBuilder().build())
+   *           .setRequestId("requestId693933066")
+   *           .setValidateOnly(true)
+   *           .build();
+   *   Instance response = alloyDBAdminClient.createSecondaryInstanceAsync(request).get();
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture createSecondaryInstanceAsync( + CreateSecondaryInstanceRequest request) { + return createSecondaryInstanceOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a new SECONDARY Instance in a given project and location. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   CreateSecondaryInstanceRequest request =
+   *       CreateSecondaryInstanceRequest.newBuilder()
+   *           .setParent(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString())
+   *           .setInstanceId("instanceId902024336")
+   *           .setInstance(Instance.newBuilder().build())
+   *           .setRequestId("requestId693933066")
+   *           .setValidateOnly(true)
+   *           .build();
+   *   OperationFuture future =
+   *       alloyDBAdminClient.createSecondaryInstanceOperationCallable().futureCall(request);
+   *   // Do something.
+   *   Instance response = future.get();
+   * }
+   * }
+ */ + public final OperationCallable + createSecondaryInstanceOperationCallable() { + return stub.createSecondaryInstanceOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a new SECONDARY Instance in a given project and location. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   CreateSecondaryInstanceRequest request =
+   *       CreateSecondaryInstanceRequest.newBuilder()
+   *           .setParent(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString())
+   *           .setInstanceId("instanceId902024336")
+   *           .setInstance(Instance.newBuilder().build())
+   *           .setRequestId("requestId693933066")
+   *           .setValidateOnly(true)
+   *           .build();
+   *   ApiFuture future =
+   *       alloyDBAdminClient.createSecondaryInstanceCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable + createSecondaryInstanceCallable() { + return stub.createSecondaryInstanceCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * 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. @@ -2061,7 +2572,7 @@ public final UnaryCallable failoverInstanceC // AUTO-GENERATED DOCUMENTATION AND METHOD. /** - * Restart an Instance in a cluster. Imperative only. + * Injects fault in an instance. Imperative only. * *

Sample code: * @@ -2072,25 +2583,30 @@ public final UnaryCallable failoverInstanceC * // - It may require specifying regional endpoints when creating the service client as shown in * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library * try (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + * InjectFaultRequest.FaultType faultType = InjectFaultRequest.FaultType.forNumber(0); * InstanceName name = InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]"); - * Instance response = alloyDBAdminClient.restartInstanceAsync(name).get(); + * Instance response = alloyDBAdminClient.injectFaultAsync(faultType, name).get(); * } * } * + * @param faultType Required. The type of fault to be injected in an instance. * @param name Required. The name of the resource. For the required format, see the comment on the * Instance.name field. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - public final OperationFuture restartInstanceAsync( - InstanceName name) { - RestartInstanceRequest request = - RestartInstanceRequest.newBuilder().setName(name == null ? null : name.toString()).build(); - return restartInstanceAsync(request); + public final OperationFuture injectFaultAsync( + InjectFaultRequest.FaultType faultType, InstanceName name) { + InjectFaultRequest request = + InjectFaultRequest.newBuilder() + .setFaultType(faultType) + .setName(name == null ? null : name.toString()) + .build(); + return injectFaultAsync(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** - * Restart an Instance in a cluster. Imperative only. + * Injects fault in an instance. Imperative only. * *

Sample code: * @@ -2101,24 +2617,28 @@ public final OperationFuture restartInstanceAsync( * // - It may require specifying regional endpoints when creating the service client as shown in * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library * try (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + * InjectFaultRequest.FaultType faultType = InjectFaultRequest.FaultType.forNumber(0); * String name = * InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]").toString(); - * Instance response = alloyDBAdminClient.restartInstanceAsync(name).get(); + * Instance response = alloyDBAdminClient.injectFaultAsync(faultType, name).get(); * } * } * + * @param faultType Required. The type of fault to be injected in an instance. * @param name Required. The name of the resource. For the required format, see the comment on the * Instance.name field. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - public final OperationFuture restartInstanceAsync(String name) { - RestartInstanceRequest request = RestartInstanceRequest.newBuilder().setName(name).build(); - return restartInstanceAsync(request); + public final OperationFuture injectFaultAsync( + InjectFaultRequest.FaultType faultType, String name) { + InjectFaultRequest request = + InjectFaultRequest.newBuilder().setFaultType(faultType).setName(name).build(); + return injectFaultAsync(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** - * Restart an Instance in a cluster. Imperative only. + * Injects fault in an instance. Imperative only. * *

Sample code: * @@ -2129,28 +2649,28 @@ public final OperationFuture restartInstanceAsync(S * // - It may require specifying regional endpoints when creating the service client as shown in * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library * try (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { - * RestartInstanceRequest request = - * RestartInstanceRequest.newBuilder() + * InjectFaultRequest request = + * InjectFaultRequest.newBuilder() * .setName( * InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]").toString()) * .setRequestId("requestId693933066") * .setValidateOnly(true) * .build(); - * Instance response = alloyDBAdminClient.restartInstanceAsync(request).get(); + * Instance response = alloyDBAdminClient.injectFaultAsync(request).get(); * } * } * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - public final OperationFuture restartInstanceAsync( - RestartInstanceRequest request) { - return restartInstanceOperationCallable().futureCall(request); + public final OperationFuture injectFaultAsync( + InjectFaultRequest request) { + return injectFaultOperationCallable().futureCall(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** - * Restart an Instance in a cluster. Imperative only. + * Injects fault in an instance. Imperative only. * *

Sample code: * @@ -2161,28 +2681,28 @@ public final OperationFuture restartInstanceAsync( * // - It may require specifying regional endpoints when creating the service client as shown in * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library * try (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { - * RestartInstanceRequest request = - * RestartInstanceRequest.newBuilder() + * InjectFaultRequest request = + * InjectFaultRequest.newBuilder() * .setName( * InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]").toString()) * .setRequestId("requestId693933066") * .setValidateOnly(true) * .build(); * OperationFuture future = - * alloyDBAdminClient.restartInstanceOperationCallable().futureCall(request); + * alloyDBAdminClient.injectFaultOperationCallable().futureCall(request); * // Do something. * Instance response = future.get(); * } * } */ - public final OperationCallable - restartInstanceOperationCallable() { - return stub.restartInstanceOperationCallable(); + public final OperationCallable + injectFaultOperationCallable() { + return stub.injectFaultOperationCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** - * Restart an Instance in a cluster. Imperative only. + * Injects fault in an instance. Imperative only. * *

Sample code: * @@ -2193,27 +2713,26 @@ public final OperationFuture restartInstanceAsync( * // - It may require specifying regional endpoints when creating the service client as shown in * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library * try (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { - * RestartInstanceRequest request = - * RestartInstanceRequest.newBuilder() + * InjectFaultRequest request = + * InjectFaultRequest.newBuilder() * .setName( * InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]").toString()) * .setRequestId("requestId693933066") * .setValidateOnly(true) * .build(); - * ApiFuture future = - * alloyDBAdminClient.restartInstanceCallable().futureCall(request); + * ApiFuture future = alloyDBAdminClient.injectFaultCallable().futureCall(request); * // Do something. * Operation response = future.get(); * } * } */ - public final UnaryCallable restartInstanceCallable() { - return stub.restartInstanceCallable(); + public final UnaryCallable injectFaultCallable() { + return stub.injectFaultCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** - * Lists Backups in a given project and location. + * Restart an Instance in a cluster. Imperative only. * *

Sample code: * @@ -2224,27 +2743,25 @@ public final UnaryCallable restartInstanceCal * // - It may require specifying regional endpoints when creating the service client as shown in * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library * try (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { - * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); - * for (Backup element : alloyDBAdminClient.listBackups(parent).iterateAll()) { - * // doThingsWith(element); - * } + * InstanceName name = InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]"); + * Instance response = alloyDBAdminClient.restartInstanceAsync(name).get(); * } * } * - * @param parent Required. Parent value for ListBackupsRequest + * @param name Required. The name of the resource. For the required format, see the comment on the + * Instance.name field. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - public final ListBackupsPagedResponse listBackups(LocationName parent) { - ListBackupsRequest request = - ListBackupsRequest.newBuilder() - .setParent(parent == null ? null : parent.toString()) - .build(); - return listBackups(request); + public final OperationFuture restartInstanceAsync( + InstanceName name) { + RestartInstanceRequest request = + RestartInstanceRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + return restartInstanceAsync(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** - * Lists Backups in a given project and location. + * Restart an Instance in a cluster. Imperative only. * *

Sample code: * @@ -2255,24 +2772,24 @@ public final ListBackupsPagedResponse listBackups(LocationName parent) { * // - It may require specifying regional endpoints when creating the service client as shown in * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library * try (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { - * String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString(); - * for (Backup element : alloyDBAdminClient.listBackups(parent).iterateAll()) { - * // doThingsWith(element); - * } + * String name = + * InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]").toString(); + * Instance response = alloyDBAdminClient.restartInstanceAsync(name).get(); * } * } * - * @param parent Required. Parent value for ListBackupsRequest + * @param name Required. The name of the resource. For the required format, see the comment on the + * Instance.name field. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - public final ListBackupsPagedResponse listBackups(String parent) { - ListBackupsRequest request = ListBackupsRequest.newBuilder().setParent(parent).build(); - return listBackups(request); + public final OperationFuture restartInstanceAsync(String name) { + RestartInstanceRequest request = RestartInstanceRequest.newBuilder().setName(name).build(); + return restartInstanceAsync(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** - * Lists Backups in a given project and location. + * Restart an Instance in a cluster. Imperative only. * *

Sample code: * @@ -2283,30 +2800,28 @@ public final ListBackupsPagedResponse listBackups(String parent) { * // - It may require specifying regional endpoints when creating the service client as shown in * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library * try (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { - * ListBackupsRequest request = - * ListBackupsRequest.newBuilder() - * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) - * .setPageSize(883849137) - * .setPageToken("pageToken873572522") - * .setFilter("filter-1274492040") - * .setOrderBy("orderBy-1207110587") + * RestartInstanceRequest request = + * RestartInstanceRequest.newBuilder() + * .setName( + * InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]").toString()) + * .setRequestId("requestId693933066") + * .setValidateOnly(true) * .build(); - * for (Backup element : alloyDBAdminClient.listBackups(request).iterateAll()) { - * // doThingsWith(element); - * } + * Instance response = alloyDBAdminClient.restartInstanceAsync(request).get(); * } * } * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - public final ListBackupsPagedResponse listBackups(ListBackupsRequest request) { - return listBackupsPagedCallable().call(request); + public final OperationFuture restartInstanceAsync( + RestartInstanceRequest request) { + return restartInstanceOperationCallable().futureCall(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** - * Lists Backups in a given project and location. + * Restart an Instance in a cluster. Imperative only. * *

Sample code: * @@ -2317,16 +2832,172 @@ public final ListBackupsPagedResponse listBackups(ListBackupsRequest request) { * // - It may require specifying regional endpoints when creating the service client as shown in * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library * try (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { - * ListBackupsRequest request = - * ListBackupsRequest.newBuilder() - * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) - * .setPageSize(883849137) - * .setPageToken("pageToken873572522") - * .setFilter("filter-1274492040") - * .setOrderBy("orderBy-1207110587") - * .build(); - * ApiFuture future = alloyDBAdminClient.listBackupsPagedCallable().futureCall(request); - * // Do something. + * RestartInstanceRequest request = + * RestartInstanceRequest.newBuilder() + * .setName( + * InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]").toString()) + * .setRequestId("requestId693933066") + * .setValidateOnly(true) + * .build(); + * OperationFuture future = + * alloyDBAdminClient.restartInstanceOperationCallable().futureCall(request); + * // Do something. + * Instance response = future.get(); + * } + * } + */ + public final OperationCallable + restartInstanceOperationCallable() { + return stub.restartInstanceOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Restart an Instance in a cluster. Imperative only. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   RestartInstanceRequest request =
+   *       RestartInstanceRequest.newBuilder()
+   *           .setName(
+   *               InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]").toString())
+   *           .setRequestId("requestId693933066")
+   *           .setValidateOnly(true)
+   *           .build();
+   *   ApiFuture future =
+   *       alloyDBAdminClient.restartInstanceCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable restartInstanceCallable() { + return stub.restartInstanceCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists Backups in a given project and location. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+   *   for (Backup element : alloyDBAdminClient.listBackups(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param parent Required. Parent value for ListBackupsRequest + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListBackupsPagedResponse listBackups(LocationName parent) { + ListBackupsRequest request = + ListBackupsRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .build(); + return listBackups(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists Backups in a given project and location. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
+   *   for (Backup element : alloyDBAdminClient.listBackups(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param parent Required. Parent value for ListBackupsRequest + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListBackupsPagedResponse listBackups(String parent) { + ListBackupsRequest request = ListBackupsRequest.newBuilder().setParent(parent).build(); + return listBackups(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists Backups in a given project and location. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   ListBackupsRequest request =
+   *       ListBackupsRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .setFilter("filter-1274492040")
+   *           .setOrderBy("orderBy-1207110587")
+   *           .build();
+   *   for (Backup element : alloyDBAdminClient.listBackups(request).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListBackupsPagedResponse listBackups(ListBackupsRequest request) { + return listBackupsPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists Backups in a given project and location. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   ListBackupsRequest request =
+   *       ListBackupsRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .setFilter("filter-1274492040")
+   *           .setOrderBy("orderBy-1207110587")
+   *           .build();
+   *   ApiFuture future = alloyDBAdminClient.listBackupsPagedCallable().futureCall(request);
+   *   // Do something.
    *   for (Backup element : future.get().iterateAll()) {
    *     // doThingsWith(element);
    *   }
@@ -2713,17 +3384,628 @@ public final OperationFuture updateBackupAsync(
    * }
    * }
* - * @param request The request object containing all of the parameters for the API call. + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture updateBackupAsync( + UpdateBackupRequest request) { + return updateBackupOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates the parameters of a single Backup. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   UpdateBackupRequest request =
+   *       UpdateBackupRequest.newBuilder()
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .setBackup(Backup.newBuilder().build())
+   *           .setRequestId("requestId693933066")
+   *           .setValidateOnly(true)
+   *           .setAllowMissing(true)
+   *           .build();
+   *   OperationFuture future =
+   *       alloyDBAdminClient.updateBackupOperationCallable().futureCall(request);
+   *   // Do something.
+   *   Backup response = future.get();
+   * }
+   * }
+ */ + public final OperationCallable + updateBackupOperationCallable() { + return stub.updateBackupOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates the parameters of a single Backup. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   UpdateBackupRequest request =
+   *       UpdateBackupRequest.newBuilder()
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .setBackup(Backup.newBuilder().build())
+   *           .setRequestId("requestId693933066")
+   *           .setValidateOnly(true)
+   *           .setAllowMissing(true)
+   *           .build();
+   *   ApiFuture future = alloyDBAdminClient.updateBackupCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable updateBackupCallable() { + return stub.updateBackupCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a single Backup. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   BackupName name = BackupName.of("[PROJECT]", "[LOCATION]", "[BACKUP]");
+   *   alloyDBAdminClient.deleteBackupAsync(name).get();
+   * }
+   * }
+ * + * @param name Required. Name of the resource. For the required format, see the comment on the + * Backup.name field. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture deleteBackupAsync(BackupName name) { + DeleteBackupRequest request = + DeleteBackupRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + return deleteBackupAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a single Backup. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   String name = BackupName.of("[PROJECT]", "[LOCATION]", "[BACKUP]").toString();
+   *   alloyDBAdminClient.deleteBackupAsync(name).get();
+   * }
+   * }
+ * + * @param name Required. Name of the resource. For the required format, see the comment on the + * Backup.name field. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture deleteBackupAsync(String name) { + DeleteBackupRequest request = DeleteBackupRequest.newBuilder().setName(name).build(); + return deleteBackupAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a single Backup. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   DeleteBackupRequest request =
+   *       DeleteBackupRequest.newBuilder()
+   *           .setName(BackupName.of("[PROJECT]", "[LOCATION]", "[BACKUP]").toString())
+   *           .setRequestId("requestId693933066")
+   *           .setValidateOnly(true)
+   *           .setEtag("etag3123477")
+   *           .build();
+   *   alloyDBAdminClient.deleteBackupAsync(request).get();
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture deleteBackupAsync( + DeleteBackupRequest request) { + return deleteBackupOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a single Backup. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   DeleteBackupRequest request =
+   *       DeleteBackupRequest.newBuilder()
+   *           .setName(BackupName.of("[PROJECT]", "[LOCATION]", "[BACKUP]").toString())
+   *           .setRequestId("requestId693933066")
+   *           .setValidateOnly(true)
+   *           .setEtag("etag3123477")
+   *           .build();
+   *   OperationFuture future =
+   *       alloyDBAdminClient.deleteBackupOperationCallable().futureCall(request);
+   *   // Do something.
+   *   future.get();
+   * }
+   * }
+ */ + public final OperationCallable + deleteBackupOperationCallable() { + return stub.deleteBackupOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a single Backup. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   DeleteBackupRequest request =
+   *       DeleteBackupRequest.newBuilder()
+   *           .setName(BackupName.of("[PROJECT]", "[LOCATION]", "[BACKUP]").toString())
+   *           .setRequestId("requestId693933066")
+   *           .setValidateOnly(true)
+   *           .setEtag("etag3123477")
+   *           .build();
+   *   ApiFuture future = alloyDBAdminClient.deleteBackupCallable().futureCall(request);
+   *   // Do something.
+   *   future.get();
+   * }
+   * }
+ */ + public final UnaryCallable deleteBackupCallable() { + return stub.deleteBackupCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists SupportedDatabaseFlags for a given project and location. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+   *   for (SupportedDatabaseFlag element :
+   *       alloyDBAdminClient.listSupportedDatabaseFlags(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param 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. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListSupportedDatabaseFlagsPagedResponse listSupportedDatabaseFlags( + LocationName parent) { + ListSupportedDatabaseFlagsRequest request = + ListSupportedDatabaseFlagsRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .build(); + return listSupportedDatabaseFlags(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists SupportedDatabaseFlags for a given project and location. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
+   *   for (SupportedDatabaseFlag element :
+   *       alloyDBAdminClient.listSupportedDatabaseFlags(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param 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. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListSupportedDatabaseFlagsPagedResponse listSupportedDatabaseFlags(String parent) { + ListSupportedDatabaseFlagsRequest request = + ListSupportedDatabaseFlagsRequest.newBuilder().setParent(parent).build(); + return listSupportedDatabaseFlags(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists SupportedDatabaseFlags for a given project and location. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   ListSupportedDatabaseFlagsRequest request =
+   *       ListSupportedDatabaseFlagsRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   for (SupportedDatabaseFlag element :
+   *       alloyDBAdminClient.listSupportedDatabaseFlags(request).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListSupportedDatabaseFlagsPagedResponse listSupportedDatabaseFlags( + ListSupportedDatabaseFlagsRequest request) { + return listSupportedDatabaseFlagsPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists SupportedDatabaseFlags for a given project and location. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   ListSupportedDatabaseFlagsRequest request =
+   *       ListSupportedDatabaseFlagsRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   ApiFuture future =
+   *       alloyDBAdminClient.listSupportedDatabaseFlagsPagedCallable().futureCall(request);
+   *   // Do something.
+   *   for (SupportedDatabaseFlag element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable< + ListSupportedDatabaseFlagsRequest, ListSupportedDatabaseFlagsPagedResponse> + listSupportedDatabaseFlagsPagedCallable() { + return stub.listSupportedDatabaseFlagsPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists SupportedDatabaseFlags for a given project and location. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   ListSupportedDatabaseFlagsRequest request =
+   *       ListSupportedDatabaseFlagsRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   while (true) {
+   *     ListSupportedDatabaseFlagsResponse response =
+   *         alloyDBAdminClient.listSupportedDatabaseFlagsCallable().call(request);
+   *     for (SupportedDatabaseFlag element : response.getSupportedDatabaseFlagsList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable + listSupportedDatabaseFlagsCallable() { + return stub.listSupportedDatabaseFlagsCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists Users in a given project and location. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   ClusterName parent = ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]");
+   *   for (User element : alloyDBAdminClient.listUsers(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param parent Required. Parent value for ListUsersRequest + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListUsersPagedResponse listUsers(ClusterName parent) { + ListUsersRequest request = + ListUsersRequest.newBuilder().setParent(parent == null ? null : parent.toString()).build(); + return listUsers(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists Users in a given project and location. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   String parent = ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString();
+   *   for (User element : alloyDBAdminClient.listUsers(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param parent Required. Parent value for ListUsersRequest + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListUsersPagedResponse listUsers(String parent) { + ListUsersRequest request = ListUsersRequest.newBuilder().setParent(parent).build(); + return listUsers(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists Users in a given project and location. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   ListUsersRequest request =
+   *       ListUsersRequest.newBuilder()
+   *           .setParent(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .setFilter("filter-1274492040")
+   *           .setOrderBy("orderBy-1207110587")
+   *           .build();
+   *   for (User element : alloyDBAdminClient.listUsers(request).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListUsersPagedResponse listUsers(ListUsersRequest request) { + return listUsersPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists Users in a given project and location. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   ListUsersRequest request =
+   *       ListUsersRequest.newBuilder()
+   *           .setParent(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .setFilter("filter-1274492040")
+   *           .setOrderBy("orderBy-1207110587")
+   *           .build();
+   *   ApiFuture future = alloyDBAdminClient.listUsersPagedCallable().futureCall(request);
+   *   // Do something.
+   *   for (User element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable listUsersPagedCallable() { + return stub.listUsersPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists Users in a given project and location. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   ListUsersRequest request =
+   *       ListUsersRequest.newBuilder()
+   *           .setParent(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .setFilter("filter-1274492040")
+   *           .setOrderBy("orderBy-1207110587")
+   *           .build();
+   *   while (true) {
+   *     ListUsersResponse response = alloyDBAdminClient.listUsersCallable().call(request);
+   *     for (User element : response.getUsersList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable listUsersCallable() { + return stub.listUsersCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets details of a single User. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   UserName name = UserName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[USER]");
+   *   User response = alloyDBAdminClient.getUser(name);
+   * }
+   * }
+ * + * @param name Required. The name of the resource. For the required format, see the comment on the + * User.name field. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final User getUser(UserName name) { + GetUserRequest request = + GetUserRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + return getUser(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets details of a single User. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   String name = UserName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[USER]").toString();
+   *   User response = alloyDBAdminClient.getUser(name);
+   * }
+   * }
+ * + * @param name Required. The name of the resource. For the required format, see the comment on the + * User.name field. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - public final OperationFuture updateBackupAsync( - UpdateBackupRequest request) { - return updateBackupOperationCallable().futureCall(request); + public final User getUser(String name) { + GetUserRequest request = GetUserRequest.newBuilder().setName(name).build(); + return getUser(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** - * Updates the parameters of a single Backup. + * Gets details of a single User. * *

Sample code: * @@ -2734,29 +4016,24 @@ public final OperationFuture updateBackupAsync( * // - It may require specifying regional endpoints when creating the service client as shown in * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library * try (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { - * UpdateBackupRequest request = - * UpdateBackupRequest.newBuilder() - * .setUpdateMask(FieldMask.newBuilder().build()) - * .setBackup(Backup.newBuilder().build()) - * .setRequestId("requestId693933066") - * .setValidateOnly(true) - * .setAllowMissing(true) + * GetUserRequest request = + * GetUserRequest.newBuilder() + * .setName(UserName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[USER]").toString()) * .build(); - * OperationFuture future = - * alloyDBAdminClient.updateBackupOperationCallable().futureCall(request); - * // Do something. - * Backup response = future.get(); + * User response = alloyDBAdminClient.getUser(request); * } * } + * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - public final OperationCallable - updateBackupOperationCallable() { - return stub.updateBackupOperationCallable(); + public final User getUser(GetUserRequest request) { + return getUserCallable().call(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** - * Updates the parameters of a single Backup. + * Gets details of a single User. * *

Sample code: * @@ -2767,27 +4044,23 @@ public final OperationFuture updateBackupAsync( * // - It may require specifying regional endpoints when creating the service client as shown in * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library * try (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { - * UpdateBackupRequest request = - * UpdateBackupRequest.newBuilder() - * .setUpdateMask(FieldMask.newBuilder().build()) - * .setBackup(Backup.newBuilder().build()) - * .setRequestId("requestId693933066") - * .setValidateOnly(true) - * .setAllowMissing(true) + * GetUserRequest request = + * GetUserRequest.newBuilder() + * .setName(UserName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[USER]").toString()) * .build(); - * ApiFuture future = alloyDBAdminClient.updateBackupCallable().futureCall(request); + * ApiFuture future = alloyDBAdminClient.getUserCallable().futureCall(request); * // Do something. - * Operation response = future.get(); + * User response = future.get(); * } * } */ - public final UnaryCallable updateBackupCallable() { - return stub.updateBackupCallable(); + public final UnaryCallable getUserCallable() { + return stub.getUserCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** - * Deletes a single Backup. + * Creates a new User in a given project, location, and cluster. * *

Sample code: * @@ -2798,24 +4071,31 @@ public final UnaryCallable updateBackupCallable( * // - It may require specifying regional endpoints when creating the service client as shown in * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library * try (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { - * BackupName name = BackupName.of("[PROJECT]", "[LOCATION]", "[BACKUP]"); - * alloyDBAdminClient.deleteBackupAsync(name).get(); + * ClusterName parent = ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]"); + * User user = User.newBuilder().build(); + * String userId = "userId-836030906"; + * User response = alloyDBAdminClient.createUser(parent, user, userId); * } * } * - * @param name Required. Name of the resource. For the required format, see the comment on the - * Backup.name field. + * @param parent Required. Value for parent. + * @param user Required. The resource being created + * @param userId Required. ID of the requesting object. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - public final OperationFuture deleteBackupAsync(BackupName name) { - DeleteBackupRequest request = - DeleteBackupRequest.newBuilder().setName(name == null ? null : name.toString()).build(); - return deleteBackupAsync(request); + public final User createUser(ClusterName parent, User user, String userId) { + CreateUserRequest request = + CreateUserRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .setUser(user) + .setUserId(userId) + .build(); + return createUser(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** - * Deletes a single Backup. + * Creates a new User in a given project, location, and cluster. * *

Sample code: * @@ -2826,23 +4106,27 @@ public final OperationFuture deleteBackupAsync(BackupN * // - It may require specifying regional endpoints when creating the service client as shown in * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library * try (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { - * String name = BackupName.of("[PROJECT]", "[LOCATION]", "[BACKUP]").toString(); - * alloyDBAdminClient.deleteBackupAsync(name).get(); + * String parent = ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString(); + * User user = User.newBuilder().build(); + * String userId = "userId-836030906"; + * User response = alloyDBAdminClient.createUser(parent, user, userId); * } * } * - * @param name Required. Name of the resource. For the required format, see the comment on the - * Backup.name field. + * @param parent Required. Value for parent. + * @param user Required. The resource being created + * @param userId Required. ID of the requesting object. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - public final OperationFuture deleteBackupAsync(String name) { - DeleteBackupRequest request = DeleteBackupRequest.newBuilder().setName(name).build(); - return deleteBackupAsync(request); + public final User createUser(String parent, User user, String userId) { + CreateUserRequest request = + CreateUserRequest.newBuilder().setParent(parent).setUser(user).setUserId(userId).build(); + return createUser(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** - * Deletes a single Backup. + * Creates a new User in a given project, location, and cluster. * *

Sample code: * @@ -2853,28 +4137,28 @@ public final OperationFuture deleteBackupAsync(String * // - It may require specifying regional endpoints when creating the service client as shown in * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library * try (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { - * DeleteBackupRequest request = - * DeleteBackupRequest.newBuilder() - * .setName(BackupName.of("[PROJECT]", "[LOCATION]", "[BACKUP]").toString()) + * CreateUserRequest request = + * CreateUserRequest.newBuilder() + * .setParent(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString()) + * .setUserId("userId-836030906") + * .setUser(User.newBuilder().build()) * .setRequestId("requestId693933066") * .setValidateOnly(true) - * .setEtag("etag3123477") * .build(); - * alloyDBAdminClient.deleteBackupAsync(request).get(); + * User response = alloyDBAdminClient.createUser(request); * } * } * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - public final OperationFuture deleteBackupAsync( - DeleteBackupRequest request) { - return deleteBackupOperationCallable().futureCall(request); + public final User createUser(CreateUserRequest request) { + return createUserCallable().call(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** - * Deletes a single Backup. + * Creates a new User in a given project, location, and cluster. * *

Sample code: * @@ -2885,28 +4169,27 @@ public final OperationFuture deleteBackupAsync( * // - It may require specifying regional endpoints when creating the service client as shown in * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library * try (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { - * DeleteBackupRequest request = - * DeleteBackupRequest.newBuilder() - * .setName(BackupName.of("[PROJECT]", "[LOCATION]", "[BACKUP]").toString()) + * CreateUserRequest request = + * CreateUserRequest.newBuilder() + * .setParent(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString()) + * .setUserId("userId-836030906") + * .setUser(User.newBuilder().build()) * .setRequestId("requestId693933066") * .setValidateOnly(true) - * .setEtag("etag3123477") * .build(); - * OperationFuture future = - * alloyDBAdminClient.deleteBackupOperationCallable().futureCall(request); + * ApiFuture future = alloyDBAdminClient.createUserCallable().futureCall(request); * // Do something. - * future.get(); + * User response = future.get(); * } * } */ - public final OperationCallable - deleteBackupOperationCallable() { - return stub.deleteBackupOperationCallable(); + public final UnaryCallable createUserCallable() { + return stub.createUserCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** - * Deletes a single Backup. + * Updates the parameters of a single User. * *

Sample code: * @@ -2917,26 +4200,60 @@ public final OperationFuture deleteBackupAsync( * // - It may require specifying regional endpoints when creating the service client as shown in * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library * try (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { - * DeleteBackupRequest request = - * DeleteBackupRequest.newBuilder() - * .setName(BackupName.of("[PROJECT]", "[LOCATION]", "[BACKUP]").toString()) + * User user = User.newBuilder().build(); + * FieldMask updateMask = FieldMask.newBuilder().build(); + * User response = alloyDBAdminClient.updateUser(user, updateMask); + * } + * } + * + * @param user Required. The resource being updated + * @param 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. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final User updateUser(User user, FieldMask updateMask) { + UpdateUserRequest request = + UpdateUserRequest.newBuilder().setUser(user).setUpdateMask(updateMask).build(); + return updateUser(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates the parameters of a single User. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   UpdateUserRequest request =
+   *       UpdateUserRequest.newBuilder()
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .setUser(User.newBuilder().build())
    *           .setRequestId("requestId693933066")
    *           .setValidateOnly(true)
-   *           .setEtag("etag3123477")
+   *           .setAllowMissing(true)
    *           .build();
-   *   ApiFuture future = alloyDBAdminClient.deleteBackupCallable().futureCall(request);
-   *   // Do something.
-   *   future.get();
+   *   User response = alloyDBAdminClient.updateUser(request);
    * }
    * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - public final UnaryCallable deleteBackupCallable() { - return stub.deleteBackupCallable(); + public final User updateUser(UpdateUserRequest request) { + return updateUserCallable().call(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** - * Lists SupportedDatabaseFlags for a given project and location. + * Updates the parameters of a single User. * *

Sample code: * @@ -2947,33 +4264,27 @@ public final UnaryCallable deleteBackupCallable( * // - It may require specifying regional endpoints when creating the service client as shown in * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library * try (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { - * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); - * for (SupportedDatabaseFlag element : - * alloyDBAdminClient.listSupportedDatabaseFlags(parent).iterateAll()) { - * // doThingsWith(element); - * } + * UpdateUserRequest request = + * UpdateUserRequest.newBuilder() + * .setUpdateMask(FieldMask.newBuilder().build()) + * .setUser(User.newBuilder().build()) + * .setRequestId("requestId693933066") + * .setValidateOnly(true) + * .setAllowMissing(true) + * .build(); + * ApiFuture future = alloyDBAdminClient.updateUserCallable().futureCall(request); + * // Do something. + * User response = future.get(); * } * } - * - * @param 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. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - public final ListSupportedDatabaseFlagsPagedResponse listSupportedDatabaseFlags( - LocationName parent) { - ListSupportedDatabaseFlagsRequest request = - ListSupportedDatabaseFlagsRequest.newBuilder() - .setParent(parent == null ? null : parent.toString()) - .build(); - return listSupportedDatabaseFlags(request); + public final UnaryCallable updateUserCallable() { + return stub.updateUserCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** - * Lists SupportedDatabaseFlags for a given project and location. + * Deletes a single User. * *

Sample code: * @@ -2984,30 +4295,24 @@ public final ListSupportedDatabaseFlagsPagedResponse listSupportedDatabaseFlags( * // - It may require specifying regional endpoints when creating the service client as shown in * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library * try (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { - * String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString(); - * for (SupportedDatabaseFlag element : - * alloyDBAdminClient.listSupportedDatabaseFlags(parent).iterateAll()) { - * // doThingsWith(element); - * } + * UserName name = UserName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[USER]"); + * alloyDBAdminClient.deleteUser(name); * } * } * - * @param 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 name Required. The name of the resource. For the required format, see the comment on the + * User.name field. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - public final ListSupportedDatabaseFlagsPagedResponse listSupportedDatabaseFlags(String parent) { - ListSupportedDatabaseFlagsRequest request = - ListSupportedDatabaseFlagsRequest.newBuilder().setParent(parent).build(); - return listSupportedDatabaseFlags(request); + public final void deleteUser(UserName name) { + DeleteUserRequest request = + DeleteUserRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + deleteUser(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** - * Lists SupportedDatabaseFlags for a given project and location. + * Deletes a single User. * *

Sample code: * @@ -3018,30 +4323,23 @@ public final ListSupportedDatabaseFlagsPagedResponse listSupportedDatabaseFlags( * // - It may require specifying regional endpoints when creating the service client as shown in * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library * try (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { - * ListSupportedDatabaseFlagsRequest request = - * ListSupportedDatabaseFlagsRequest.newBuilder() - * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) - * .setPageSize(883849137) - * .setPageToken("pageToken873572522") - * .build(); - * for (SupportedDatabaseFlag element : - * alloyDBAdminClient.listSupportedDatabaseFlags(request).iterateAll()) { - * // doThingsWith(element); - * } + * String name = UserName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[USER]").toString(); + * alloyDBAdminClient.deleteUser(name); * } * } * - * @param request The request object containing all of the parameters for the API call. + * @param name Required. The name of the resource. For the required format, see the comment on the + * User.name field. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - public final ListSupportedDatabaseFlagsPagedResponse listSupportedDatabaseFlags( - ListSupportedDatabaseFlagsRequest request) { - return listSupportedDatabaseFlagsPagedCallable().call(request); + public final void deleteUser(String name) { + DeleteUserRequest request = DeleteUserRequest.newBuilder().setName(name).build(); + deleteUser(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** - * Lists SupportedDatabaseFlags for a given project and location. + * Deletes a single User. * *

Sample code: * @@ -3052,30 +4350,26 @@ public final ListSupportedDatabaseFlagsPagedResponse listSupportedDatabaseFlags( * // - It may require specifying regional endpoints when creating the service client as shown in * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library * try (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { - * ListSupportedDatabaseFlagsRequest request = - * ListSupportedDatabaseFlagsRequest.newBuilder() - * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) - * .setPageSize(883849137) - * .setPageToken("pageToken873572522") + * DeleteUserRequest request = + * DeleteUserRequest.newBuilder() + * .setName(UserName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[USER]").toString()) + * .setRequestId("requestId693933066") + * .setValidateOnly(true) * .build(); - * ApiFuture future = - * alloyDBAdminClient.listSupportedDatabaseFlagsPagedCallable().futureCall(request); - * // Do something. - * for (SupportedDatabaseFlag element : future.get().iterateAll()) { - * // doThingsWith(element); - * } + * alloyDBAdminClient.deleteUser(request); * } * } + * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - public final UnaryCallable< - ListSupportedDatabaseFlagsRequest, ListSupportedDatabaseFlagsPagedResponse> - listSupportedDatabaseFlagsPagedCallable() { - return stub.listSupportedDatabaseFlagsPagedCallable(); + public final void deleteUser(DeleteUserRequest request) { + deleteUserCallable().call(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** - * Lists SupportedDatabaseFlags for a given project and location. + * Deletes a single User. * *

Sample code: * @@ -3086,31 +4380,20 @@ public final ListSupportedDatabaseFlagsPagedResponse listSupportedDatabaseFlags( * // - It may require specifying regional endpoints when creating the service client as shown in * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library * try (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { - * ListSupportedDatabaseFlagsRequest request = - * ListSupportedDatabaseFlagsRequest.newBuilder() - * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) - * .setPageSize(883849137) - * .setPageToken("pageToken873572522") + * DeleteUserRequest request = + * DeleteUserRequest.newBuilder() + * .setName(UserName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[USER]").toString()) + * .setRequestId("requestId693933066") + * .setValidateOnly(true) * .build(); - * while (true) { - * ListSupportedDatabaseFlagsResponse response = - * alloyDBAdminClient.listSupportedDatabaseFlagsCallable().call(request); - * for (SupportedDatabaseFlag element : response.getSupportedDatabaseFlagsList()) { - * // doThingsWith(element); - * } - * String nextPageToken = response.getNextPageToken(); - * if (!Strings.isNullOrEmpty(nextPageToken)) { - * request = request.toBuilder().setPageToken(nextPageToken).build(); - * } else { - * break; - * } - * } + * ApiFuture future = alloyDBAdminClient.deleteUserCallable().futureCall(request); + * // Do something. + * future.get(); * } * } */ - public final UnaryCallable - listSupportedDatabaseFlagsCallable() { - return stub.listSupportedDatabaseFlagsCallable(); + public final UnaryCallable deleteUserCallable() { + return stub.deleteUserCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD. @@ -3618,6 +4901,71 @@ protected ListSupportedDatabaseFlagsFixedSizeCollection createCollection( } } + public static class ListUsersPagedResponse + extends AbstractPagedListResponse< + ListUsersRequest, ListUsersResponse, User, ListUsersPage, ListUsersFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListUsersPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, input -> new ListUsersPagedResponse(input), MoreExecutors.directExecutor()); + } + + private ListUsersPagedResponse(ListUsersPage page) { + super(page, ListUsersFixedSizeCollection.createEmptyCollection()); + } + } + + public static class ListUsersPage + extends AbstractPage { + + private ListUsersPage( + PageContext context, + ListUsersResponse response) { + super(context, response); + } + + private static ListUsersPage createEmptyPage() { + return new ListUsersPage(null, null); + } + + @Override + protected ListUsersPage createPage( + PageContext context, + ListUsersResponse response) { + return new ListUsersPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class ListUsersFixedSizeCollection + extends AbstractFixedSizeCollection< + ListUsersRequest, ListUsersResponse, User, ListUsersPage, ListUsersFixedSizeCollection> { + + private ListUsersFixedSizeCollection(List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListUsersFixedSizeCollection createEmptyCollection() { + return new ListUsersFixedSizeCollection(null, 0); + } + + @Override + protected ListUsersFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListUsersFixedSizeCollection(pages, collectionSize); + } + } + public static class ListLocationsPagedResponse extends AbstractPagedListResponse< ListLocationsRequest, diff --git a/java-alloydb/google-cloud-alloydb/src/main/java/com/google/cloud/alloydb/v1/AlloyDBAdminSettings.java b/java-alloydb/google-cloud-alloydb/src/main/java/com/google/cloud/alloydb/v1/AlloyDBAdminSettings.java index e2d135a549b0..04a8ef9d6299 100644 --- a/java-alloydb/google-cloud-alloydb/src/main/java/com/google/cloud/alloydb/v1/AlloyDBAdminSettings.java +++ b/java-alloydb/google-cloud-alloydb/src/main/java/com/google/cloud/alloydb/v1/AlloyDBAdminSettings.java @@ -21,6 +21,7 @@ import static com.google.cloud.alloydb.v1.AlloyDBAdminClient.ListInstancesPagedResponse; import static com.google.cloud.alloydb.v1.AlloyDBAdminClient.ListLocationsPagedResponse; import static com.google.cloud.alloydb.v1.AlloyDBAdminClient.ListSupportedDatabaseFlagsPagedResponse; +import static com.google.cloud.alloydb.v1.AlloyDBAdminClient.ListUsersPagedResponse; import com.google.api.core.ApiFunction; import com.google.api.core.BetaApi; @@ -129,6 +130,17 @@ public UnaryCallSettings deleteClusterSettings( return ((AlloyDBAdminStubSettings) getStubSettings()).deleteClusterOperationSettings(); } + /** Returns the object with the settings used for calls to promoteCluster. */ + public UnaryCallSettings promoteClusterSettings() { + return ((AlloyDBAdminStubSettings) getStubSettings()).promoteClusterSettings(); + } + + /** Returns the object with the settings used for calls to promoteCluster. */ + public OperationCallSettings + promoteClusterOperationSettings() { + return ((AlloyDBAdminStubSettings) getStubSettings()).promoteClusterOperationSettings(); + } + /** Returns the object with the settings used for calls to restoreCluster. */ public UnaryCallSettings restoreClusterSettings() { return ((AlloyDBAdminStubSettings) getStubSettings()).restoreClusterSettings(); @@ -140,6 +152,18 @@ public UnaryCallSettings restoreClusterSetting return ((AlloyDBAdminStubSettings) getStubSettings()).restoreClusterOperationSettings(); } + /** Returns the object with the settings used for calls to createSecondaryCluster. */ + public UnaryCallSettings + createSecondaryClusterSettings() { + return ((AlloyDBAdminStubSettings) getStubSettings()).createSecondaryClusterSettings(); + } + + /** Returns the object with the settings used for calls to createSecondaryCluster. */ + public OperationCallSettings + createSecondaryClusterOperationSettings() { + return ((AlloyDBAdminStubSettings) getStubSettings()).createSecondaryClusterOperationSettings(); + } + /** Returns the object with the settings used for calls to listInstances. */ public PagedCallSettings listInstancesSettings() { @@ -162,6 +186,19 @@ public UnaryCallSettings createInstanceSetting return ((AlloyDBAdminStubSettings) getStubSettings()).createInstanceOperationSettings(); } + /** Returns the object with the settings used for calls to createSecondaryInstance. */ + public UnaryCallSettings + createSecondaryInstanceSettings() { + return ((AlloyDBAdminStubSettings) getStubSettings()).createSecondaryInstanceSettings(); + } + + /** Returns the object with the settings used for calls to createSecondaryInstance. */ + public OperationCallSettings + createSecondaryInstanceOperationSettings() { + return ((AlloyDBAdminStubSettings) getStubSettings()) + .createSecondaryInstanceOperationSettings(); + } + /** Returns the object with the settings used for calls to batchCreateInstances. */ public UnaryCallSettings batchCreateInstancesSettings() { return ((AlloyDBAdminStubSettings) getStubSettings()).batchCreateInstancesSettings(); @@ -207,6 +244,17 @@ public UnaryCallSettings failoverInstanceSet return ((AlloyDBAdminStubSettings) getStubSettings()).failoverInstanceOperationSettings(); } + /** Returns the object with the settings used for calls to injectFault. */ + public UnaryCallSettings injectFaultSettings() { + return ((AlloyDBAdminStubSettings) getStubSettings()).injectFaultSettings(); + } + + /** Returns the object with the settings used for calls to injectFault. */ + public OperationCallSettings + injectFaultOperationSettings() { + return ((AlloyDBAdminStubSettings) getStubSettings()).injectFaultOperationSettings(); + } + /** Returns the object with the settings used for calls to restartInstance. */ public UnaryCallSettings restartInstanceSettings() { return ((AlloyDBAdminStubSettings) getStubSettings()).restartInstanceSettings(); @@ -271,6 +319,32 @@ public UnaryCallSettings deleteBackupSettings() return ((AlloyDBAdminStubSettings) getStubSettings()).listSupportedDatabaseFlagsSettings(); } + /** Returns the object with the settings used for calls to listUsers. */ + public PagedCallSettings + listUsersSettings() { + return ((AlloyDBAdminStubSettings) getStubSettings()).listUsersSettings(); + } + + /** Returns the object with the settings used for calls to getUser. */ + public UnaryCallSettings getUserSettings() { + return ((AlloyDBAdminStubSettings) getStubSettings()).getUserSettings(); + } + + /** Returns the object with the settings used for calls to createUser. */ + public UnaryCallSettings createUserSettings() { + return ((AlloyDBAdminStubSettings) getStubSettings()).createUserSettings(); + } + + /** Returns the object with the settings used for calls to updateUser. */ + public UnaryCallSettings updateUserSettings() { + return ((AlloyDBAdminStubSettings) getStubSettings()).updateUserSettings(); + } + + /** Returns the object with the settings used for calls to deleteUser. */ + public UnaryCallSettings deleteUserSettings() { + return ((AlloyDBAdminStubSettings) getStubSettings()).deleteUserSettings(); + } + /** Returns the object with the settings used for calls to listLocations. */ public PagedCallSettings listLocationsSettings() { @@ -442,6 +516,17 @@ public UnaryCallSettings.Builder deleteClusterS return getStubSettingsBuilder().deleteClusterOperationSettings(); } + /** Returns the builder for the settings used for calls to promoteCluster. */ + public UnaryCallSettings.Builder promoteClusterSettings() { + return getStubSettingsBuilder().promoteClusterSettings(); + } + + /** Returns the builder for the settings used for calls to promoteCluster. */ + public OperationCallSettings.Builder + promoteClusterOperationSettings() { + return getStubSettingsBuilder().promoteClusterOperationSettings(); + } + /** Returns the builder for the settings used for calls to restoreCluster. */ public UnaryCallSettings.Builder restoreClusterSettings() { return getStubSettingsBuilder().restoreClusterSettings(); @@ -453,6 +538,18 @@ public UnaryCallSettings.Builder restoreCluste return getStubSettingsBuilder().restoreClusterOperationSettings(); } + /** Returns the builder for the settings used for calls to createSecondaryCluster. */ + public UnaryCallSettings.Builder + createSecondaryClusterSettings() { + return getStubSettingsBuilder().createSecondaryClusterSettings(); + } + + /** Returns the builder for the settings used for calls to createSecondaryCluster. */ + public OperationCallSettings.Builder + createSecondaryClusterOperationSettings() { + return getStubSettingsBuilder().createSecondaryClusterOperationSettings(); + } + /** Returns the builder for the settings used for calls to listInstances. */ public PagedCallSettings.Builder< ListInstancesRequest, ListInstancesResponse, ListInstancesPagedResponse> @@ -476,6 +573,19 @@ public UnaryCallSettings.Builder createInstanc return getStubSettingsBuilder().createInstanceOperationSettings(); } + /** Returns the builder for the settings used for calls to createSecondaryInstance. */ + public UnaryCallSettings.Builder + createSecondaryInstanceSettings() { + return getStubSettingsBuilder().createSecondaryInstanceSettings(); + } + + /** Returns the builder for the settings used for calls to createSecondaryInstance. */ + public OperationCallSettings.Builder< + CreateSecondaryInstanceRequest, Instance, OperationMetadata> + createSecondaryInstanceOperationSettings() { + return getStubSettingsBuilder().createSecondaryInstanceOperationSettings(); + } + /** Returns the builder for the settings used for calls to batchCreateInstances. */ public UnaryCallSettings.Builder batchCreateInstancesSettings() { @@ -523,6 +633,17 @@ public UnaryCallSettings.Builder deleteInstanc return getStubSettingsBuilder().failoverInstanceOperationSettings(); } + /** Returns the builder for the settings used for calls to injectFault. */ + public UnaryCallSettings.Builder injectFaultSettings() { + return getStubSettingsBuilder().injectFaultSettings(); + } + + /** Returns the builder for the settings used for calls to injectFault. */ + public OperationCallSettings.Builder + injectFaultOperationSettings() { + return getStubSettingsBuilder().injectFaultOperationSettings(); + } + /** Returns the builder for the settings used for calls to restartInstance. */ public UnaryCallSettings.Builder restartInstanceSettings() { return getStubSettingsBuilder().restartInstanceSettings(); @@ -588,6 +709,32 @@ public UnaryCallSettings.Builder deleteBackupSet return getStubSettingsBuilder().listSupportedDatabaseFlagsSettings(); } + /** Returns the builder for the settings used for calls to listUsers. */ + public PagedCallSettings.Builder + listUsersSettings() { + return getStubSettingsBuilder().listUsersSettings(); + } + + /** Returns the builder for the settings used for calls to getUser. */ + public UnaryCallSettings.Builder getUserSettings() { + return getStubSettingsBuilder().getUserSettings(); + } + + /** Returns the builder for the settings used for calls to createUser. */ + public UnaryCallSettings.Builder createUserSettings() { + return getStubSettingsBuilder().createUserSettings(); + } + + /** Returns the builder for the settings used for calls to updateUser. */ + public UnaryCallSettings.Builder updateUserSettings() { + return getStubSettingsBuilder().updateUserSettings(); + } + + /** Returns the builder for the settings used for calls to deleteUser. */ + public UnaryCallSettings.Builder deleteUserSettings() { + return getStubSettingsBuilder().deleteUserSettings(); + } + /** Returns the builder for the settings used for calls to listLocations. */ public PagedCallSettings.Builder< ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse> diff --git a/java-alloydb/google-cloud-alloydb/src/main/java/com/google/cloud/alloydb/v1/gapic_metadata.json b/java-alloydb/google-cloud-alloydb/src/main/java/com/google/cloud/alloydb/v1/gapic_metadata.json index 6c3643d85cf2..33aa11a1edb4 100644 --- a/java-alloydb/google-cloud-alloydb/src/main/java/com/google/cloud/alloydb/v1/gapic_metadata.json +++ b/java-alloydb/google-cloud-alloydb/src/main/java/com/google/cloud/alloydb/v1/gapic_metadata.json @@ -22,6 +22,15 @@ "CreateInstance": { "methods": ["createInstanceAsync", "createInstanceAsync", "createInstanceAsync", "createInstanceOperationCallable", "createInstanceCallable"] }, + "CreateSecondaryCluster": { + "methods": ["createSecondaryClusterAsync", "createSecondaryClusterAsync", "createSecondaryClusterAsync", "createSecondaryClusterOperationCallable", "createSecondaryClusterCallable"] + }, + "CreateSecondaryInstance": { + "methods": ["createSecondaryInstanceAsync", "createSecondaryInstanceAsync", "createSecondaryInstanceAsync", "createSecondaryInstanceOperationCallable", "createSecondaryInstanceCallable"] + }, + "CreateUser": { + "methods": ["createUser", "createUser", "createUser", "createUserCallable"] + }, "DeleteBackup": { "methods": ["deleteBackupAsync", "deleteBackupAsync", "deleteBackupAsync", "deleteBackupOperationCallable", "deleteBackupCallable"] }, @@ -31,6 +40,9 @@ "DeleteInstance": { "methods": ["deleteInstanceAsync", "deleteInstanceAsync", "deleteInstanceAsync", "deleteInstanceOperationCallable", "deleteInstanceCallable"] }, + "DeleteUser": { + "methods": ["deleteUser", "deleteUser", "deleteUser", "deleteUserCallable"] + }, "FailoverInstance": { "methods": ["failoverInstanceAsync", "failoverInstanceAsync", "failoverInstanceAsync", "failoverInstanceOperationCallable", "failoverInstanceCallable"] }, @@ -46,6 +58,12 @@ "GetLocation": { "methods": ["getLocation", "getLocationCallable"] }, + "GetUser": { + "methods": ["getUser", "getUser", "getUser", "getUserCallable"] + }, + "InjectFault": { + "methods": ["injectFaultAsync", "injectFaultAsync", "injectFaultAsync", "injectFaultOperationCallable", "injectFaultCallable"] + }, "ListBackups": { "methods": ["listBackups", "listBackups", "listBackups", "listBackupsPagedCallable", "listBackupsCallable"] }, @@ -61,6 +79,12 @@ "ListSupportedDatabaseFlags": { "methods": ["listSupportedDatabaseFlags", "listSupportedDatabaseFlags", "listSupportedDatabaseFlags", "listSupportedDatabaseFlagsPagedCallable", "listSupportedDatabaseFlagsCallable"] }, + "ListUsers": { + "methods": ["listUsers", "listUsers", "listUsers", "listUsersPagedCallable", "listUsersCallable"] + }, + "PromoteCluster": { + "methods": ["promoteClusterAsync", "promoteClusterAsync", "promoteClusterAsync", "promoteClusterOperationCallable", "promoteClusterCallable"] + }, "RestartInstance": { "methods": ["restartInstanceAsync", "restartInstanceAsync", "restartInstanceAsync", "restartInstanceOperationCallable", "restartInstanceCallable"] }, @@ -75,6 +99,9 @@ }, "UpdateInstance": { "methods": ["updateInstanceAsync", "updateInstanceAsync", "updateInstanceOperationCallable", "updateInstanceCallable"] + }, + "UpdateUser": { + "methods": ["updateUser", "updateUser", "updateUserCallable"] } } } diff --git a/java-alloydb/google-cloud-alloydb/src/main/java/com/google/cloud/alloydb/v1/stub/AlloyDBAdminStub.java b/java-alloydb/google-cloud-alloydb/src/main/java/com/google/cloud/alloydb/v1/stub/AlloyDBAdminStub.java index 5984e331d68a..0f102f863ca1 100644 --- a/java-alloydb/google-cloud-alloydb/src/main/java/com/google/cloud/alloydb/v1/stub/AlloyDBAdminStub.java +++ b/java-alloydb/google-cloud-alloydb/src/main/java/com/google/cloud/alloydb/v1/stub/AlloyDBAdminStub.java @@ -21,6 +21,7 @@ import static com.google.cloud.alloydb.v1.AlloyDBAdminClient.ListInstancesPagedResponse; import static com.google.cloud.alloydb.v1.AlloyDBAdminClient.ListLocationsPagedResponse; import static com.google.cloud.alloydb.v1.AlloyDBAdminClient.ListSupportedDatabaseFlagsPagedResponse; +import static com.google.cloud.alloydb.v1.AlloyDBAdminClient.ListUsersPagedResponse; import com.google.api.gax.core.BackgroundResource; import com.google.api.gax.rpc.OperationCallable; @@ -32,13 +33,19 @@ import com.google.cloud.alloydb.v1.CreateBackupRequest; import com.google.cloud.alloydb.v1.CreateClusterRequest; import com.google.cloud.alloydb.v1.CreateInstanceRequest; +import com.google.cloud.alloydb.v1.CreateSecondaryClusterRequest; +import com.google.cloud.alloydb.v1.CreateSecondaryInstanceRequest; +import com.google.cloud.alloydb.v1.CreateUserRequest; import com.google.cloud.alloydb.v1.DeleteBackupRequest; import com.google.cloud.alloydb.v1.DeleteClusterRequest; import com.google.cloud.alloydb.v1.DeleteInstanceRequest; +import com.google.cloud.alloydb.v1.DeleteUserRequest; import com.google.cloud.alloydb.v1.FailoverInstanceRequest; import com.google.cloud.alloydb.v1.GetBackupRequest; import com.google.cloud.alloydb.v1.GetClusterRequest; import com.google.cloud.alloydb.v1.GetInstanceRequest; +import com.google.cloud.alloydb.v1.GetUserRequest; +import com.google.cloud.alloydb.v1.InjectFaultRequest; import com.google.cloud.alloydb.v1.Instance; import com.google.cloud.alloydb.v1.ListBackupsRequest; import com.google.cloud.alloydb.v1.ListBackupsResponse; @@ -48,12 +55,17 @@ import com.google.cloud.alloydb.v1.ListInstancesResponse; import com.google.cloud.alloydb.v1.ListSupportedDatabaseFlagsRequest; import com.google.cloud.alloydb.v1.ListSupportedDatabaseFlagsResponse; +import com.google.cloud.alloydb.v1.ListUsersRequest; +import com.google.cloud.alloydb.v1.ListUsersResponse; import com.google.cloud.alloydb.v1.OperationMetadata; +import com.google.cloud.alloydb.v1.PromoteClusterRequest; import com.google.cloud.alloydb.v1.RestartInstanceRequest; import com.google.cloud.alloydb.v1.RestoreClusterRequest; import com.google.cloud.alloydb.v1.UpdateBackupRequest; import com.google.cloud.alloydb.v1.UpdateClusterRequest; import com.google.cloud.alloydb.v1.UpdateInstanceRequest; +import com.google.cloud.alloydb.v1.UpdateUserRequest; +import com.google.cloud.alloydb.v1.User; import com.google.cloud.location.GetLocationRequest; import com.google.cloud.location.ListLocationsRequest; import com.google.cloud.location.ListLocationsResponse; @@ -119,6 +131,15 @@ public UnaryCallable deleteClusterCallable() { throw new UnsupportedOperationException("Not implemented: deleteClusterCallable()"); } + public OperationCallable + promoteClusterOperationCallable() { + throw new UnsupportedOperationException("Not implemented: promoteClusterOperationCallable()"); + } + + public UnaryCallable promoteClusterCallable() { + throw new UnsupportedOperationException("Not implemented: promoteClusterCallable()"); + } + public OperationCallable restoreClusterOperationCallable() { throw new UnsupportedOperationException("Not implemented: restoreClusterOperationCallable()"); @@ -128,6 +149,16 @@ public UnaryCallable restoreClusterCallable() throw new UnsupportedOperationException("Not implemented: restoreClusterCallable()"); } + public OperationCallable + createSecondaryClusterOperationCallable() { + throw new UnsupportedOperationException( + "Not implemented: createSecondaryClusterOperationCallable()"); + } + + public UnaryCallable createSecondaryClusterCallable() { + throw new UnsupportedOperationException("Not implemented: createSecondaryClusterCallable()"); + } + public UnaryCallable listInstancesPagedCallable() { throw new UnsupportedOperationException("Not implemented: listInstancesPagedCallable()"); @@ -150,6 +181,17 @@ public UnaryCallable createInstanceCallable() throw new UnsupportedOperationException("Not implemented: createInstanceCallable()"); } + public OperationCallable + createSecondaryInstanceOperationCallable() { + throw new UnsupportedOperationException( + "Not implemented: createSecondaryInstanceOperationCallable()"); + } + + public UnaryCallable + createSecondaryInstanceCallable() { + throw new UnsupportedOperationException("Not implemented: createSecondaryInstanceCallable()"); + } + public OperationCallable< BatchCreateInstancesRequest, BatchCreateInstancesResponse, OperationMetadata> batchCreateInstancesOperationCallable() { @@ -188,6 +230,15 @@ public UnaryCallable failoverInstanceCallabl throw new UnsupportedOperationException("Not implemented: failoverInstanceCallable()"); } + public OperationCallable + injectFaultOperationCallable() { + throw new UnsupportedOperationException("Not implemented: injectFaultOperationCallable()"); + } + + public UnaryCallable injectFaultCallable() { + throw new UnsupportedOperationException("Not implemented: injectFaultCallable()"); + } + public OperationCallable restartInstanceOperationCallable() { throw new UnsupportedOperationException("Not implemented: restartInstanceOperationCallable()"); @@ -248,6 +299,30 @@ public UnaryCallable deleteBackupCallable() { "Not implemented: listSupportedDatabaseFlagsCallable()"); } + public UnaryCallable listUsersPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listUsersPagedCallable()"); + } + + public UnaryCallable listUsersCallable() { + throw new UnsupportedOperationException("Not implemented: listUsersCallable()"); + } + + public UnaryCallable getUserCallable() { + throw new UnsupportedOperationException("Not implemented: getUserCallable()"); + } + + public UnaryCallable createUserCallable() { + throw new UnsupportedOperationException("Not implemented: createUserCallable()"); + } + + public UnaryCallable updateUserCallable() { + throw new UnsupportedOperationException("Not implemented: updateUserCallable()"); + } + + public UnaryCallable deleteUserCallable() { + throw new UnsupportedOperationException("Not implemented: deleteUserCallable()"); + } + public UnaryCallable listLocationsPagedCallable() { throw new UnsupportedOperationException("Not implemented: listLocationsPagedCallable()"); diff --git a/java-alloydb/google-cloud-alloydb/src/main/java/com/google/cloud/alloydb/v1/stub/AlloyDBAdminStubSettings.java b/java-alloydb/google-cloud-alloydb/src/main/java/com/google/cloud/alloydb/v1/stub/AlloyDBAdminStubSettings.java index a5691ef8220b..a67c5b900469 100644 --- a/java-alloydb/google-cloud-alloydb/src/main/java/com/google/cloud/alloydb/v1/stub/AlloyDBAdminStubSettings.java +++ b/java-alloydb/google-cloud-alloydb/src/main/java/com/google/cloud/alloydb/v1/stub/AlloyDBAdminStubSettings.java @@ -21,6 +21,7 @@ import static com.google.cloud.alloydb.v1.AlloyDBAdminClient.ListInstancesPagedResponse; import static com.google.cloud.alloydb.v1.AlloyDBAdminClient.ListLocationsPagedResponse; import static com.google.cloud.alloydb.v1.AlloyDBAdminClient.ListSupportedDatabaseFlagsPagedResponse; +import static com.google.cloud.alloydb.v1.AlloyDBAdminClient.ListUsersPagedResponse; import com.google.api.core.ApiFunction; import com.google.api.core.ApiFuture; @@ -58,13 +59,19 @@ import com.google.cloud.alloydb.v1.CreateBackupRequest; import com.google.cloud.alloydb.v1.CreateClusterRequest; import com.google.cloud.alloydb.v1.CreateInstanceRequest; +import com.google.cloud.alloydb.v1.CreateSecondaryClusterRequest; +import com.google.cloud.alloydb.v1.CreateSecondaryInstanceRequest; +import com.google.cloud.alloydb.v1.CreateUserRequest; import com.google.cloud.alloydb.v1.DeleteBackupRequest; import com.google.cloud.alloydb.v1.DeleteClusterRequest; import com.google.cloud.alloydb.v1.DeleteInstanceRequest; +import com.google.cloud.alloydb.v1.DeleteUserRequest; import com.google.cloud.alloydb.v1.FailoverInstanceRequest; import com.google.cloud.alloydb.v1.GetBackupRequest; import com.google.cloud.alloydb.v1.GetClusterRequest; import com.google.cloud.alloydb.v1.GetInstanceRequest; +import com.google.cloud.alloydb.v1.GetUserRequest; +import com.google.cloud.alloydb.v1.InjectFaultRequest; import com.google.cloud.alloydb.v1.Instance; import com.google.cloud.alloydb.v1.ListBackupsRequest; import com.google.cloud.alloydb.v1.ListBackupsResponse; @@ -74,13 +81,18 @@ import com.google.cloud.alloydb.v1.ListInstancesResponse; import com.google.cloud.alloydb.v1.ListSupportedDatabaseFlagsRequest; import com.google.cloud.alloydb.v1.ListSupportedDatabaseFlagsResponse; +import com.google.cloud.alloydb.v1.ListUsersRequest; +import com.google.cloud.alloydb.v1.ListUsersResponse; import com.google.cloud.alloydb.v1.OperationMetadata; +import com.google.cloud.alloydb.v1.PromoteClusterRequest; import com.google.cloud.alloydb.v1.RestartInstanceRequest; import com.google.cloud.alloydb.v1.RestoreClusterRequest; import com.google.cloud.alloydb.v1.SupportedDatabaseFlag; import com.google.cloud.alloydb.v1.UpdateBackupRequest; import com.google.cloud.alloydb.v1.UpdateClusterRequest; import com.google.cloud.alloydb.v1.UpdateInstanceRequest; +import com.google.cloud.alloydb.v1.UpdateUserRequest; +import com.google.cloud.alloydb.v1.User; import com.google.cloud.location.GetLocationRequest; import com.google.cloud.location.ListLocationsRequest; import com.google.cloud.location.ListLocationsResponse; @@ -152,9 +164,16 @@ public class AlloyDBAdminStubSettings extends StubSettings deleteClusterSettings; private final OperationCallSettings deleteClusterOperationSettings; + private final UnaryCallSettings promoteClusterSettings; + private final OperationCallSettings + promoteClusterOperationSettings; private final UnaryCallSettings restoreClusterSettings; private final OperationCallSettings restoreClusterOperationSettings; + private final UnaryCallSettings + createSecondaryClusterSettings; + private final OperationCallSettings + createSecondaryClusterOperationSettings; private final PagedCallSettings< ListInstancesRequest, ListInstancesResponse, ListInstancesPagedResponse> listInstancesSettings; @@ -162,6 +181,10 @@ public class AlloyDBAdminStubSettings extends StubSettings createInstanceSettings; private final OperationCallSettings createInstanceOperationSettings; + private final UnaryCallSettings + createSecondaryInstanceSettings; + private final OperationCallSettings + createSecondaryInstanceOperationSettings; private final UnaryCallSettings batchCreateInstancesSettings; private final OperationCallSettings< @@ -176,6 +199,9 @@ public class AlloyDBAdminStubSettings extends StubSettings failoverInstanceSettings; private final OperationCallSettings failoverInstanceOperationSettings; + private final UnaryCallSettings injectFaultSettings; + private final OperationCallSettings + injectFaultOperationSettings; private final UnaryCallSettings restartInstanceSettings; private final OperationCallSettings restartInstanceOperationSettings; @@ -196,6 +222,12 @@ public class AlloyDBAdminStubSettings extends StubSettings listSupportedDatabaseFlagsSettings; + private final PagedCallSettings + listUsersSettings; + private final UnaryCallSettings getUserSettings; + private final UnaryCallSettings createUserSettings; + private final UnaryCallSettings updateUserSettings; + private final UnaryCallSettings deleteUserSettings; private final PagedCallSettings< ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse> listLocationsSettings; @@ -358,6 +390,42 @@ public Iterable extractResources( } }; + private static final PagedListDescriptor + LIST_USERS_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListUsersRequest injectToken(ListUsersRequest payload, String token) { + return ListUsersRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListUsersRequest injectPageSize(ListUsersRequest payload, int pageSize) { + return ListUsersRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(ListUsersRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListUsersResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources(ListUsersResponse payload) { + return payload.getUsersList() == null + ? ImmutableList.of() + : payload.getUsersList(); + } + }; + private static final PagedListDescriptor LIST_LOCATIONS_PAGE_STR_DESC = new PagedListDescriptor() { @@ -473,6 +541,23 @@ public ApiFuture getFuturePagedResponse } }; + private static final PagedListResponseFactory< + ListUsersRequest, ListUsersResponse, ListUsersPagedResponse> + LIST_USERS_PAGE_STR_FACT = + new PagedListResponseFactory< + ListUsersRequest, ListUsersResponse, ListUsersPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListUsersRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, LIST_USERS_PAGE_STR_DESC, request, context); + return ListUsersPagedResponse.createAsync(pageContext, futureResponse); + } + }; + private static final PagedListResponseFactory< ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse> LIST_LOCATIONS_PAGE_STR_FACT = @@ -534,6 +619,17 @@ public UnaryCallSettings deleteClusterSettings( return deleteClusterOperationSettings; } + /** Returns the object with the settings used for calls to promoteCluster. */ + public UnaryCallSettings promoteClusterSettings() { + return promoteClusterSettings; + } + + /** Returns the object with the settings used for calls to promoteCluster. */ + public OperationCallSettings + promoteClusterOperationSettings() { + return promoteClusterOperationSettings; + } + /** Returns the object with the settings used for calls to restoreCluster. */ public UnaryCallSettings restoreClusterSettings() { return restoreClusterSettings; @@ -545,6 +641,18 @@ public UnaryCallSettings restoreClusterSetting return restoreClusterOperationSettings; } + /** Returns the object with the settings used for calls to createSecondaryCluster. */ + public UnaryCallSettings + createSecondaryClusterSettings() { + return createSecondaryClusterSettings; + } + + /** Returns the object with the settings used for calls to createSecondaryCluster. */ + public OperationCallSettings + createSecondaryClusterOperationSettings() { + return createSecondaryClusterOperationSettings; + } + /** Returns the object with the settings used for calls to listInstances. */ public PagedCallSettings listInstancesSettings() { @@ -567,6 +675,18 @@ public UnaryCallSettings createInstanceSetting return createInstanceOperationSettings; } + /** Returns the object with the settings used for calls to createSecondaryInstance. */ + public UnaryCallSettings + createSecondaryInstanceSettings() { + return createSecondaryInstanceSettings; + } + + /** Returns the object with the settings used for calls to createSecondaryInstance. */ + public OperationCallSettings + createSecondaryInstanceOperationSettings() { + return createSecondaryInstanceOperationSettings; + } + /** Returns the object with the settings used for calls to batchCreateInstances. */ public UnaryCallSettings batchCreateInstancesSettings() { return batchCreateInstancesSettings; @@ -612,6 +732,17 @@ public UnaryCallSettings failoverInstanceSet return failoverInstanceOperationSettings; } + /** Returns the object with the settings used for calls to injectFault. */ + public UnaryCallSettings injectFaultSettings() { + return injectFaultSettings; + } + + /** Returns the object with the settings used for calls to injectFault. */ + public OperationCallSettings + injectFaultOperationSettings() { + return injectFaultOperationSettings; + } + /** Returns the object with the settings used for calls to restartInstance. */ public UnaryCallSettings restartInstanceSettings() { return restartInstanceSettings; @@ -676,6 +807,32 @@ public UnaryCallSettings deleteBackupSettings() return listSupportedDatabaseFlagsSettings; } + /** Returns the object with the settings used for calls to listUsers. */ + public PagedCallSettings + listUsersSettings() { + return listUsersSettings; + } + + /** Returns the object with the settings used for calls to getUser. */ + public UnaryCallSettings getUserSettings() { + return getUserSettings; + } + + /** Returns the object with the settings used for calls to createUser. */ + public UnaryCallSettings createUserSettings() { + return createUserSettings; + } + + /** Returns the object with the settings used for calls to updateUser. */ + public UnaryCallSettings updateUserSettings() { + return updateUserSettings; + } + + /** Returns the object with the settings used for calls to deleteUser. */ + public UnaryCallSettings deleteUserSettings() { + return deleteUserSettings; + } + /** Returns the object with the settings used for calls to listLocations. */ public PagedCallSettings listLocationsSettings() { @@ -801,12 +958,20 @@ protected AlloyDBAdminStubSettings(Builder settingsBuilder) throws IOException { updateClusterOperationSettings = settingsBuilder.updateClusterOperationSettings().build(); deleteClusterSettings = settingsBuilder.deleteClusterSettings().build(); deleteClusterOperationSettings = settingsBuilder.deleteClusterOperationSettings().build(); + promoteClusterSettings = settingsBuilder.promoteClusterSettings().build(); + promoteClusterOperationSettings = settingsBuilder.promoteClusterOperationSettings().build(); restoreClusterSettings = settingsBuilder.restoreClusterSettings().build(); restoreClusterOperationSettings = settingsBuilder.restoreClusterOperationSettings().build(); + createSecondaryClusterSettings = settingsBuilder.createSecondaryClusterSettings().build(); + createSecondaryClusterOperationSettings = + settingsBuilder.createSecondaryClusterOperationSettings().build(); listInstancesSettings = settingsBuilder.listInstancesSettings().build(); getInstanceSettings = settingsBuilder.getInstanceSettings().build(); createInstanceSettings = settingsBuilder.createInstanceSettings().build(); createInstanceOperationSettings = settingsBuilder.createInstanceOperationSettings().build(); + createSecondaryInstanceSettings = settingsBuilder.createSecondaryInstanceSettings().build(); + createSecondaryInstanceOperationSettings = + settingsBuilder.createSecondaryInstanceOperationSettings().build(); batchCreateInstancesSettings = settingsBuilder.batchCreateInstancesSettings().build(); batchCreateInstancesOperationSettings = settingsBuilder.batchCreateInstancesOperationSettings().build(); @@ -816,6 +981,8 @@ protected AlloyDBAdminStubSettings(Builder settingsBuilder) throws IOException { deleteInstanceOperationSettings = settingsBuilder.deleteInstanceOperationSettings().build(); failoverInstanceSettings = settingsBuilder.failoverInstanceSettings().build(); failoverInstanceOperationSettings = settingsBuilder.failoverInstanceOperationSettings().build(); + injectFaultSettings = settingsBuilder.injectFaultSettings().build(); + injectFaultOperationSettings = settingsBuilder.injectFaultOperationSettings().build(); restartInstanceSettings = settingsBuilder.restartInstanceSettings().build(); restartInstanceOperationSettings = settingsBuilder.restartInstanceOperationSettings().build(); listBackupsSettings = settingsBuilder.listBackupsSettings().build(); @@ -828,6 +995,11 @@ protected AlloyDBAdminStubSettings(Builder settingsBuilder) throws IOException { deleteBackupOperationSettings = settingsBuilder.deleteBackupOperationSettings().build(); listSupportedDatabaseFlagsSettings = settingsBuilder.listSupportedDatabaseFlagsSettings().build(); + listUsersSettings = settingsBuilder.listUsersSettings().build(); + getUserSettings = settingsBuilder.getUserSettings().build(); + createUserSettings = settingsBuilder.createUserSettings().build(); + updateUserSettings = settingsBuilder.updateUserSettings().build(); + deleteUserSettings = settingsBuilder.deleteUserSettings().build(); listLocationsSettings = settingsBuilder.listLocationsSettings().build(); getLocationSettings = settingsBuilder.getLocationSettings().build(); } @@ -848,10 +1020,19 @@ public static class Builder extends StubSettings.Builder deleteClusterSettings; private final OperationCallSettings.Builder deleteClusterOperationSettings; + private final UnaryCallSettings.Builder + promoteClusterSettings; + private final OperationCallSettings.Builder + promoteClusterOperationSettings; private final UnaryCallSettings.Builder restoreClusterSettings; private final OperationCallSettings.Builder restoreClusterOperationSettings; + private final UnaryCallSettings.Builder + createSecondaryClusterSettings; + private final OperationCallSettings.Builder< + CreateSecondaryClusterRequest, Cluster, OperationMetadata> + createSecondaryClusterOperationSettings; private final PagedCallSettings.Builder< ListInstancesRequest, ListInstancesResponse, ListInstancesPagedResponse> listInstancesSettings; @@ -860,6 +1041,11 @@ public static class Builder extends StubSettings.Builder createInstanceOperationSettings; + private final UnaryCallSettings.Builder + createSecondaryInstanceSettings; + private final OperationCallSettings.Builder< + CreateSecondaryInstanceRequest, Instance, OperationMetadata> + createSecondaryInstanceOperationSettings; private final UnaryCallSettings.Builder batchCreateInstancesSettings; private final OperationCallSettings.Builder< @@ -878,6 +1064,9 @@ public static class Builder extends StubSettings.Builder failoverInstanceOperationSettings; + private final UnaryCallSettings.Builder injectFaultSettings; + private final OperationCallSettings.Builder + injectFaultOperationSettings; private final UnaryCallSettings.Builder restartInstanceSettings; private final OperationCallSettings.Builder @@ -900,6 +1089,13 @@ public static class Builder extends StubSettings.Builder listSupportedDatabaseFlagsSettings; + private final PagedCallSettings.Builder< + ListUsersRequest, ListUsersResponse, ListUsersPagedResponse> + listUsersSettings; + private final UnaryCallSettings.Builder getUserSettings; + private final UnaryCallSettings.Builder createUserSettings; + private final UnaryCallSettings.Builder updateUserSettings; + private final UnaryCallSettings.Builder deleteUserSettings; private final PagedCallSettings.Builder< ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse> listLocationsSettings; @@ -960,12 +1156,18 @@ protected Builder(ClientContext clientContext) { updateClusterOperationSettings = OperationCallSettings.newBuilder(); deleteClusterSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); deleteClusterOperationSettings = OperationCallSettings.newBuilder(); + promoteClusterSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + promoteClusterOperationSettings = OperationCallSettings.newBuilder(); restoreClusterSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); restoreClusterOperationSettings = OperationCallSettings.newBuilder(); + createSecondaryClusterSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + createSecondaryClusterOperationSettings = OperationCallSettings.newBuilder(); listInstancesSettings = PagedCallSettings.newBuilder(LIST_INSTANCES_PAGE_STR_FACT); getInstanceSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); createInstanceSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); createInstanceOperationSettings = OperationCallSettings.newBuilder(); + createSecondaryInstanceSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + createSecondaryInstanceOperationSettings = OperationCallSettings.newBuilder(); batchCreateInstancesSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); batchCreateInstancesOperationSettings = OperationCallSettings.newBuilder(); updateInstanceSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); @@ -974,6 +1176,8 @@ protected Builder(ClientContext clientContext) { deleteInstanceOperationSettings = OperationCallSettings.newBuilder(); failoverInstanceSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); failoverInstanceOperationSettings = OperationCallSettings.newBuilder(); + injectFaultSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + injectFaultOperationSettings = OperationCallSettings.newBuilder(); restartInstanceSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); restartInstanceOperationSettings = OperationCallSettings.newBuilder(); listBackupsSettings = PagedCallSettings.newBuilder(LIST_BACKUPS_PAGE_STR_FACT); @@ -986,6 +1190,11 @@ protected Builder(ClientContext clientContext) { deleteBackupOperationSettings = OperationCallSettings.newBuilder(); listSupportedDatabaseFlagsSettings = PagedCallSettings.newBuilder(LIST_SUPPORTED_DATABASE_FLAGS_PAGE_STR_FACT); + listUsersSettings = PagedCallSettings.newBuilder(LIST_USERS_PAGE_STR_FACT); + getUserSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + createUserSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + updateUserSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + deleteUserSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); listLocationsSettings = PagedCallSettings.newBuilder(LIST_LOCATIONS_PAGE_STR_FACT); getLocationSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); @@ -996,14 +1205,18 @@ protected Builder(ClientContext clientContext) { createClusterSettings, updateClusterSettings, deleteClusterSettings, + promoteClusterSettings, restoreClusterSettings, + createSecondaryClusterSettings, listInstancesSettings, getInstanceSettings, createInstanceSettings, + createSecondaryInstanceSettings, batchCreateInstancesSettings, updateInstanceSettings, deleteInstanceSettings, failoverInstanceSettings, + injectFaultSettings, restartInstanceSettings, listBackupsSettings, getBackupSettings, @@ -1011,6 +1224,11 @@ protected Builder(ClientContext clientContext) { updateBackupSettings, deleteBackupSettings, listSupportedDatabaseFlagsSettings, + listUsersSettings, + getUserSettings, + createUserSettings, + updateUserSettings, + deleteUserSettings, listLocationsSettings, getLocationSettings); initDefaults(this); @@ -1027,12 +1245,20 @@ protected Builder(AlloyDBAdminStubSettings settings) { updateClusterOperationSettings = settings.updateClusterOperationSettings.toBuilder(); deleteClusterSettings = settings.deleteClusterSettings.toBuilder(); deleteClusterOperationSettings = settings.deleteClusterOperationSettings.toBuilder(); + promoteClusterSettings = settings.promoteClusterSettings.toBuilder(); + promoteClusterOperationSettings = settings.promoteClusterOperationSettings.toBuilder(); restoreClusterSettings = settings.restoreClusterSettings.toBuilder(); restoreClusterOperationSettings = settings.restoreClusterOperationSettings.toBuilder(); + createSecondaryClusterSettings = settings.createSecondaryClusterSettings.toBuilder(); + createSecondaryClusterOperationSettings = + settings.createSecondaryClusterOperationSettings.toBuilder(); listInstancesSettings = settings.listInstancesSettings.toBuilder(); getInstanceSettings = settings.getInstanceSettings.toBuilder(); createInstanceSettings = settings.createInstanceSettings.toBuilder(); createInstanceOperationSettings = settings.createInstanceOperationSettings.toBuilder(); + createSecondaryInstanceSettings = settings.createSecondaryInstanceSettings.toBuilder(); + createSecondaryInstanceOperationSettings = + settings.createSecondaryInstanceOperationSettings.toBuilder(); batchCreateInstancesSettings = settings.batchCreateInstancesSettings.toBuilder(); batchCreateInstancesOperationSettings = settings.batchCreateInstancesOperationSettings.toBuilder(); @@ -1042,6 +1268,8 @@ protected Builder(AlloyDBAdminStubSettings settings) { deleteInstanceOperationSettings = settings.deleteInstanceOperationSettings.toBuilder(); failoverInstanceSettings = settings.failoverInstanceSettings.toBuilder(); failoverInstanceOperationSettings = settings.failoverInstanceOperationSettings.toBuilder(); + injectFaultSettings = settings.injectFaultSettings.toBuilder(); + injectFaultOperationSettings = settings.injectFaultOperationSettings.toBuilder(); restartInstanceSettings = settings.restartInstanceSettings.toBuilder(); restartInstanceOperationSettings = settings.restartInstanceOperationSettings.toBuilder(); listBackupsSettings = settings.listBackupsSettings.toBuilder(); @@ -1053,6 +1281,11 @@ protected Builder(AlloyDBAdminStubSettings settings) { deleteBackupSettings = settings.deleteBackupSettings.toBuilder(); deleteBackupOperationSettings = settings.deleteBackupOperationSettings.toBuilder(); listSupportedDatabaseFlagsSettings = settings.listSupportedDatabaseFlagsSettings.toBuilder(); + listUsersSettings = settings.listUsersSettings.toBuilder(); + getUserSettings = settings.getUserSettings.toBuilder(); + createUserSettings = settings.createUserSettings.toBuilder(); + updateUserSettings = settings.updateUserSettings.toBuilder(); + deleteUserSettings = settings.deleteUserSettings.toBuilder(); listLocationsSettings = settings.listLocationsSettings.toBuilder(); getLocationSettings = settings.getLocationSettings.toBuilder(); @@ -1063,14 +1296,18 @@ protected Builder(AlloyDBAdminStubSettings settings) { createClusterSettings, updateClusterSettings, deleteClusterSettings, + promoteClusterSettings, restoreClusterSettings, + createSecondaryClusterSettings, listInstancesSettings, getInstanceSettings, createInstanceSettings, + createSecondaryInstanceSettings, batchCreateInstancesSettings, updateInstanceSettings, deleteInstanceSettings, failoverInstanceSettings, + injectFaultSettings, restartInstanceSettings, listBackupsSettings, getBackupSettings, @@ -1078,6 +1315,11 @@ protected Builder(AlloyDBAdminStubSettings settings) { updateBackupSettings, deleteBackupSettings, listSupportedDatabaseFlagsSettings, + listUsersSettings, + getUserSettings, + createUserSettings, + updateUserSettings, + deleteUserSettings, listLocationsSettings, getLocationSettings); } @@ -1134,11 +1376,21 @@ private static Builder initDefaults(Builder builder) { .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")); + builder + .promoteClusterSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")); + builder .restoreClusterSettings() .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")); + builder + .createSecondaryClusterSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")); + builder .listInstancesSettings() .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) @@ -1154,6 +1406,11 @@ private static Builder initDefaults(Builder builder) { .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")); + builder + .createSecondaryInstanceSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")); + builder .batchCreateInstancesSettings() .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) @@ -1174,6 +1431,11 @@ private static Builder initDefaults(Builder builder) { .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")); + builder + .injectFaultSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")); + builder .restartInstanceSettings() .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) @@ -1209,6 +1471,31 @@ private static Builder initDefaults(Builder builder) { .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + builder + .listUsersSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")); + + builder + .getUserSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")); + + builder + .createUserSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")); + + builder + .updateUserSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")); + + builder + .deleteUserSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")); + builder .listLocationsSettings() .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) @@ -1291,6 +1578,30 @@ private static Builder initDefaults(Builder builder) { .setTotalTimeout(Duration.ofMillis(300000L)) .build())); + builder + .promoteClusterOperationSettings() + .setInitialCallSettings( + UnaryCallSettings + .newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")) + .build()) + .setResponseTransformer( + ProtoOperationTransformers.ResponseTransformer.create(Cluster.class)) + .setMetadataTransformer( + ProtoOperationTransformers.MetadataTransformer.create(OperationMetadata.class)) + .setPollingAlgorithm( + OperationTimedPollAlgorithm.create( + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(5000L)) + .setRetryDelayMultiplier(1.5) + .setMaxRetryDelay(Duration.ofMillis(45000L)) + .setInitialRpcTimeout(Duration.ZERO) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ZERO) + .setTotalTimeout(Duration.ofMillis(300000L)) + .build())); + builder .restoreClusterOperationSettings() .setInitialCallSettings( @@ -1315,6 +1626,30 @@ private static Builder initDefaults(Builder builder) { .setTotalTimeout(Duration.ofMillis(300000L)) .build())); + builder + .createSecondaryClusterOperationSettings() + .setInitialCallSettings( + UnaryCallSettings + .newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")) + .build()) + .setResponseTransformer( + ProtoOperationTransformers.ResponseTransformer.create(Cluster.class)) + .setMetadataTransformer( + ProtoOperationTransformers.MetadataTransformer.create(OperationMetadata.class)) + .setPollingAlgorithm( + OperationTimedPollAlgorithm.create( + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(5000L)) + .setRetryDelayMultiplier(1.5) + .setMaxRetryDelay(Duration.ofMillis(45000L)) + .setInitialRpcTimeout(Duration.ZERO) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ZERO) + .setTotalTimeout(Duration.ofMillis(300000L)) + .build())); + builder .createInstanceOperationSettings() .setInitialCallSettings( @@ -1339,6 +1674,30 @@ private static Builder initDefaults(Builder builder) { .setTotalTimeout(Duration.ofMillis(300000L)) .build())); + builder + .createSecondaryInstanceOperationSettings() + .setInitialCallSettings( + UnaryCallSettings + .newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")) + .build()) + .setResponseTransformer( + ProtoOperationTransformers.ResponseTransformer.create(Instance.class)) + .setMetadataTransformer( + ProtoOperationTransformers.MetadataTransformer.create(OperationMetadata.class)) + .setPollingAlgorithm( + OperationTimedPollAlgorithm.create( + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(5000L)) + .setRetryDelayMultiplier(1.5) + .setMaxRetryDelay(Duration.ofMillis(45000L)) + .setInitialRpcTimeout(Duration.ZERO) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ZERO) + .setTotalTimeout(Duration.ofMillis(300000L)) + .build())); + builder .batchCreateInstancesOperationSettings() .setInitialCallSettings( @@ -1436,6 +1795,29 @@ private static Builder initDefaults(Builder builder) { .setTotalTimeout(Duration.ofMillis(300000L)) .build())); + builder + .injectFaultOperationSettings() + .setInitialCallSettings( + UnaryCallSettings.newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")) + .build()) + .setResponseTransformer( + ProtoOperationTransformers.ResponseTransformer.create(Instance.class)) + .setMetadataTransformer( + ProtoOperationTransformers.MetadataTransformer.create(OperationMetadata.class)) + .setPollingAlgorithm( + OperationTimedPollAlgorithm.create( + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(5000L)) + .setRetryDelayMultiplier(1.5) + .setMaxRetryDelay(Duration.ofMillis(45000L)) + .setInitialRpcTimeout(Duration.ZERO) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ZERO) + .setTotalTimeout(Duration.ofMillis(300000L)) + .build())); + builder .restartInstanceOperationSettings() .setInitialCallSettings( @@ -1601,6 +1983,19 @@ public UnaryCallSettings.Builder deleteClusterS return deleteClusterOperationSettings; } + /** Returns the builder for the settings used for calls to promoteCluster. */ + public UnaryCallSettings.Builder promoteClusterSettings() { + return promoteClusterSettings; + } + + /** Returns the builder for the settings used for calls to promoteCluster. */ + @BetaApi( + "The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings.Builder + promoteClusterOperationSettings() { + return promoteClusterOperationSettings; + } + /** Returns the builder for the settings used for calls to restoreCluster. */ public UnaryCallSettings.Builder restoreClusterSettings() { return restoreClusterSettings; @@ -1614,6 +2009,20 @@ public UnaryCallSettings.Builder restoreCluste return restoreClusterOperationSettings; } + /** Returns the builder for the settings used for calls to createSecondaryCluster. */ + public UnaryCallSettings.Builder + createSecondaryClusterSettings() { + return createSecondaryClusterSettings; + } + + /** Returns the builder for the settings used for calls to createSecondaryCluster. */ + @BetaApi( + "The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings.Builder + createSecondaryClusterOperationSettings() { + return createSecondaryClusterOperationSettings; + } + /** Returns the builder for the settings used for calls to listInstances. */ public PagedCallSettings.Builder< ListInstancesRequest, ListInstancesResponse, ListInstancesPagedResponse> @@ -1639,6 +2048,21 @@ public UnaryCallSettings.Builder createInstanc return createInstanceOperationSettings; } + /** Returns the builder for the settings used for calls to createSecondaryInstance. */ + public UnaryCallSettings.Builder + createSecondaryInstanceSettings() { + return createSecondaryInstanceSettings; + } + + /** Returns the builder for the settings used for calls to createSecondaryInstance. */ + @BetaApi( + "The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings.Builder< + CreateSecondaryInstanceRequest, Instance, OperationMetadata> + createSecondaryInstanceOperationSettings() { + return createSecondaryInstanceOperationSettings; + } + /** Returns the builder for the settings used for calls to batchCreateInstances. */ public UnaryCallSettings.Builder batchCreateInstancesSettings() { @@ -1694,6 +2118,19 @@ public UnaryCallSettings.Builder deleteInstanc return failoverInstanceOperationSettings; } + /** Returns the builder for the settings used for calls to injectFault. */ + public UnaryCallSettings.Builder injectFaultSettings() { + return injectFaultSettings; + } + + /** Returns the builder for the settings used for calls to injectFault. */ + @BetaApi( + "The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings.Builder + injectFaultOperationSettings() { + return injectFaultOperationSettings; + } + /** Returns the builder for the settings used for calls to restartInstance. */ public UnaryCallSettings.Builder restartInstanceSettings() { return restartInstanceSettings; @@ -1767,6 +2204,32 @@ public UnaryCallSettings.Builder deleteBackupSet return listSupportedDatabaseFlagsSettings; } + /** Returns the builder for the settings used for calls to listUsers. */ + public PagedCallSettings.Builder + listUsersSettings() { + return listUsersSettings; + } + + /** Returns the builder for the settings used for calls to getUser. */ + public UnaryCallSettings.Builder getUserSettings() { + return getUserSettings; + } + + /** Returns the builder for the settings used for calls to createUser. */ + public UnaryCallSettings.Builder createUserSettings() { + return createUserSettings; + } + + /** Returns the builder for the settings used for calls to updateUser. */ + public UnaryCallSettings.Builder updateUserSettings() { + return updateUserSettings; + } + + /** Returns the builder for the settings used for calls to deleteUser. */ + public UnaryCallSettings.Builder deleteUserSettings() { + return deleteUserSettings; + } + /** Returns the builder for the settings used for calls to listLocations. */ public PagedCallSettings.Builder< ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse> diff --git a/java-alloydb/google-cloud-alloydb/src/main/java/com/google/cloud/alloydb/v1/stub/GrpcAlloyDBAdminStub.java b/java-alloydb/google-cloud-alloydb/src/main/java/com/google/cloud/alloydb/v1/stub/GrpcAlloyDBAdminStub.java index 4946c93a9d85..1cf9ad14f841 100644 --- a/java-alloydb/google-cloud-alloydb/src/main/java/com/google/cloud/alloydb/v1/stub/GrpcAlloyDBAdminStub.java +++ b/java-alloydb/google-cloud-alloydb/src/main/java/com/google/cloud/alloydb/v1/stub/GrpcAlloyDBAdminStub.java @@ -21,6 +21,7 @@ import static com.google.cloud.alloydb.v1.AlloyDBAdminClient.ListInstancesPagedResponse; import static com.google.cloud.alloydb.v1.AlloyDBAdminClient.ListLocationsPagedResponse; import static com.google.cloud.alloydb.v1.AlloyDBAdminClient.ListSupportedDatabaseFlagsPagedResponse; +import static com.google.cloud.alloydb.v1.AlloyDBAdminClient.ListUsersPagedResponse; import com.google.api.gax.core.BackgroundResource; import com.google.api.gax.core.BackgroundResourceAggregation; @@ -37,13 +38,19 @@ import com.google.cloud.alloydb.v1.CreateBackupRequest; import com.google.cloud.alloydb.v1.CreateClusterRequest; import com.google.cloud.alloydb.v1.CreateInstanceRequest; +import com.google.cloud.alloydb.v1.CreateSecondaryClusterRequest; +import com.google.cloud.alloydb.v1.CreateSecondaryInstanceRequest; +import com.google.cloud.alloydb.v1.CreateUserRequest; import com.google.cloud.alloydb.v1.DeleteBackupRequest; import com.google.cloud.alloydb.v1.DeleteClusterRequest; import com.google.cloud.alloydb.v1.DeleteInstanceRequest; +import com.google.cloud.alloydb.v1.DeleteUserRequest; import com.google.cloud.alloydb.v1.FailoverInstanceRequest; import com.google.cloud.alloydb.v1.GetBackupRequest; import com.google.cloud.alloydb.v1.GetClusterRequest; import com.google.cloud.alloydb.v1.GetInstanceRequest; +import com.google.cloud.alloydb.v1.GetUserRequest; +import com.google.cloud.alloydb.v1.InjectFaultRequest; import com.google.cloud.alloydb.v1.Instance; import com.google.cloud.alloydb.v1.ListBackupsRequest; import com.google.cloud.alloydb.v1.ListBackupsResponse; @@ -53,12 +60,17 @@ import com.google.cloud.alloydb.v1.ListInstancesResponse; import com.google.cloud.alloydb.v1.ListSupportedDatabaseFlagsRequest; import com.google.cloud.alloydb.v1.ListSupportedDatabaseFlagsResponse; +import com.google.cloud.alloydb.v1.ListUsersRequest; +import com.google.cloud.alloydb.v1.ListUsersResponse; import com.google.cloud.alloydb.v1.OperationMetadata; +import com.google.cloud.alloydb.v1.PromoteClusterRequest; import com.google.cloud.alloydb.v1.RestartInstanceRequest; import com.google.cloud.alloydb.v1.RestoreClusterRequest; import com.google.cloud.alloydb.v1.UpdateBackupRequest; import com.google.cloud.alloydb.v1.UpdateClusterRequest; import com.google.cloud.alloydb.v1.UpdateInstanceRequest; +import com.google.cloud.alloydb.v1.UpdateUserRequest; +import com.google.cloud.alloydb.v1.User; import com.google.cloud.location.GetLocationRequest; import com.google.cloud.location.ListLocationsRequest; import com.google.cloud.location.ListLocationsResponse; @@ -128,6 +140,16 @@ public class GrpcAlloyDBAdminStub extends AlloyDBAdminStub { .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) .build(); + private static final MethodDescriptor + promoteClusterMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.alloydb.v1.AlloyDBAdmin/PromoteCluster") + .setRequestMarshaller( + ProtoUtils.marshaller(PromoteClusterRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + private static final MethodDescriptor restoreClusterMethodDescriptor = MethodDescriptor.newBuilder() @@ -138,6 +160,16 @@ public class GrpcAlloyDBAdminStub extends AlloyDBAdminStub { .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) .build(); + private static final MethodDescriptor + createSecondaryClusterMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.alloydb.v1.AlloyDBAdmin/CreateSecondaryCluster") + .setRequestMarshaller( + ProtoUtils.marshaller(CreateSecondaryClusterRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + private static final MethodDescriptor listInstancesMethodDescriptor = MethodDescriptor.newBuilder() @@ -167,6 +199,16 @@ public class GrpcAlloyDBAdminStub extends AlloyDBAdminStub { .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) .build(); + private static final MethodDescriptor + createSecondaryInstanceMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.alloydb.v1.AlloyDBAdmin/CreateSecondaryInstance") + .setRequestMarshaller( + ProtoUtils.marshaller(CreateSecondaryInstanceRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + private static final MethodDescriptor batchCreateInstancesMethodDescriptor = MethodDescriptor.newBuilder() @@ -207,6 +249,14 @@ public class GrpcAlloyDBAdminStub extends AlloyDBAdminStub { .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) .build(); + private static final MethodDescriptor injectFaultMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.alloydb.v1.AlloyDBAdmin/InjectFault") + .setRequestMarshaller(ProtoUtils.marshaller(InjectFaultRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + private static final MethodDescriptor restartInstanceMethodDescriptor = MethodDescriptor.newBuilder() @@ -275,6 +325,47 @@ public class GrpcAlloyDBAdminStub extends AlloyDBAdminStub { ProtoUtils.marshaller(ListSupportedDatabaseFlagsResponse.getDefaultInstance())) .build(); + private static final MethodDescriptor + listUsersMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.alloydb.v1.AlloyDBAdmin/ListUsers") + .setRequestMarshaller(ProtoUtils.marshaller(ListUsersRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(ListUsersResponse.getDefaultInstance())) + .build(); + + private static final MethodDescriptor getUserMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.alloydb.v1.AlloyDBAdmin/GetUser") + .setRequestMarshaller(ProtoUtils.marshaller(GetUserRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(User.getDefaultInstance())) + .build(); + + private static final MethodDescriptor createUserMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.alloydb.v1.AlloyDBAdmin/CreateUser") + .setRequestMarshaller(ProtoUtils.marshaller(CreateUserRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(User.getDefaultInstance())) + .build(); + + private static final MethodDescriptor updateUserMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.alloydb.v1.AlloyDBAdmin/UpdateUser") + .setRequestMarshaller(ProtoUtils.marshaller(UpdateUserRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(User.getDefaultInstance())) + .build(); + + private static final MethodDescriptor deleteUserMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.alloydb.v1.AlloyDBAdmin/DeleteUser") + .setRequestMarshaller(ProtoUtils.marshaller(DeleteUserRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance())) + .build(); + private static final MethodDescriptor listLocationsMethodDescriptor = MethodDescriptor.newBuilder() @@ -307,9 +398,16 @@ public class GrpcAlloyDBAdminStub extends AlloyDBAdminStub { private final UnaryCallable deleteClusterCallable; private final OperationCallable deleteClusterOperationCallable; + private final UnaryCallable promoteClusterCallable; + private final OperationCallable + promoteClusterOperationCallable; private final UnaryCallable restoreClusterCallable; private final OperationCallable restoreClusterOperationCallable; + private final UnaryCallable + createSecondaryClusterCallable; + private final OperationCallable + createSecondaryClusterOperationCallable; private final UnaryCallable listInstancesCallable; private final UnaryCallable listInstancesPagedCallable; @@ -317,6 +415,10 @@ public class GrpcAlloyDBAdminStub extends AlloyDBAdminStub { private final UnaryCallable createInstanceCallable; private final OperationCallable createInstanceOperationCallable; + private final UnaryCallable + createSecondaryInstanceCallable; + private final OperationCallable + createSecondaryInstanceOperationCallable; private final UnaryCallable batchCreateInstancesCallable; private final OperationCallable< BatchCreateInstancesRequest, BatchCreateInstancesResponse, OperationMetadata> @@ -330,6 +432,9 @@ public class GrpcAlloyDBAdminStub extends AlloyDBAdminStub { private final UnaryCallable failoverInstanceCallable; private final OperationCallable failoverInstanceOperationCallable; + private final UnaryCallable injectFaultCallable; + private final OperationCallable + injectFaultOperationCallable; private final UnaryCallable restartInstanceCallable; private final OperationCallable restartInstanceOperationCallable; @@ -351,6 +456,12 @@ public class GrpcAlloyDBAdminStub extends AlloyDBAdminStub { private final UnaryCallable< ListSupportedDatabaseFlagsRequest, ListSupportedDatabaseFlagsPagedResponse> listSupportedDatabaseFlagsPagedCallable; + private final UnaryCallable listUsersCallable; + private final UnaryCallable listUsersPagedCallable; + private final UnaryCallable getUserCallable; + private final UnaryCallable createUserCallable; + private final UnaryCallable updateUserCallable; + private final UnaryCallable deleteUserCallable; private final UnaryCallable listLocationsCallable; private final UnaryCallable listLocationsPagedCallable; @@ -448,6 +559,16 @@ protected GrpcAlloyDBAdminStub( return builder.build(); }) .build(); + GrpcCallSettings promoteClusterTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(promoteClusterMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); GrpcCallSettings restoreClusterTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(restoreClusterMethodDescriptor) @@ -458,6 +579,17 @@ protected GrpcAlloyDBAdminStub( return builder.build(); }) .build(); + GrpcCallSettings + createSecondaryClusterTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(createSecondaryClusterMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .build(); GrpcCallSettings listInstancesTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(listInstancesMethodDescriptor) @@ -488,6 +620,17 @@ protected GrpcAlloyDBAdminStub( return builder.build(); }) .build(); + GrpcCallSettings + createSecondaryInstanceTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(createSecondaryInstanceMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .build(); GrpcCallSettings batchCreateInstancesTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(batchCreateInstancesMethodDescriptor) @@ -528,6 +671,16 @@ protected GrpcAlloyDBAdminStub( return builder.build(); }) .build(); + GrpcCallSettings injectFaultTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(injectFaultMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); GrpcCallSettings restartInstanceTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(restartInstanceMethodDescriptor) @@ -600,6 +753,56 @@ protected GrpcAlloyDBAdminStub( return builder.build(); }) .build(); + GrpcCallSettings listUsersTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listUsersMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .build(); + GrpcCallSettings getUserTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getUserMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + GrpcCallSettings createUserTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(createUserMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .build(); + GrpcCallSettings updateUserTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(updateUserMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("user.name", String.valueOf(request.getUser().getName())); + return builder.build(); + }) + .build(); + GrpcCallSettings deleteUserTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(deleteUserMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); GrpcCallSettings listLocationsTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(listLocationsMethodDescriptor) @@ -657,6 +860,15 @@ protected GrpcAlloyDBAdminStub( settings.deleteClusterOperationSettings(), clientContext, operationsStub); + this.promoteClusterCallable = + callableFactory.createUnaryCallable( + promoteClusterTransportSettings, settings.promoteClusterSettings(), clientContext); + this.promoteClusterOperationCallable = + callableFactory.createOperationCallable( + promoteClusterTransportSettings, + settings.promoteClusterOperationSettings(), + clientContext, + operationsStub); this.restoreClusterCallable = callableFactory.createUnaryCallable( restoreClusterTransportSettings, settings.restoreClusterSettings(), clientContext); @@ -666,6 +878,17 @@ protected GrpcAlloyDBAdminStub( settings.restoreClusterOperationSettings(), clientContext, operationsStub); + this.createSecondaryClusterCallable = + callableFactory.createUnaryCallable( + createSecondaryClusterTransportSettings, + settings.createSecondaryClusterSettings(), + clientContext); + this.createSecondaryClusterOperationCallable = + callableFactory.createOperationCallable( + createSecondaryClusterTransportSettings, + settings.createSecondaryClusterOperationSettings(), + clientContext, + operationsStub); this.listInstancesCallable = callableFactory.createUnaryCallable( listInstancesTransportSettings, settings.listInstancesSettings(), clientContext); @@ -684,6 +907,17 @@ protected GrpcAlloyDBAdminStub( settings.createInstanceOperationSettings(), clientContext, operationsStub); + this.createSecondaryInstanceCallable = + callableFactory.createUnaryCallable( + createSecondaryInstanceTransportSettings, + settings.createSecondaryInstanceSettings(), + clientContext); + this.createSecondaryInstanceOperationCallable = + callableFactory.createOperationCallable( + createSecondaryInstanceTransportSettings, + settings.createSecondaryInstanceOperationSettings(), + clientContext, + operationsStub); this.batchCreateInstancesCallable = callableFactory.createUnaryCallable( batchCreateInstancesTransportSettings, @@ -722,6 +956,15 @@ protected GrpcAlloyDBAdminStub( settings.failoverInstanceOperationSettings(), clientContext, operationsStub); + this.injectFaultCallable = + callableFactory.createUnaryCallable( + injectFaultTransportSettings, settings.injectFaultSettings(), clientContext); + this.injectFaultOperationCallable = + callableFactory.createOperationCallable( + injectFaultTransportSettings, + settings.injectFaultOperationSettings(), + clientContext, + operationsStub); this.restartInstanceCallable = callableFactory.createUnaryCallable( restartInstanceTransportSettings, settings.restartInstanceSettings(), clientContext); @@ -777,6 +1020,24 @@ protected GrpcAlloyDBAdminStub( listSupportedDatabaseFlagsTransportSettings, settings.listSupportedDatabaseFlagsSettings(), clientContext); + this.listUsersCallable = + callableFactory.createUnaryCallable( + listUsersTransportSettings, settings.listUsersSettings(), clientContext); + this.listUsersPagedCallable = + callableFactory.createPagedCallable( + listUsersTransportSettings, settings.listUsersSettings(), clientContext); + this.getUserCallable = + callableFactory.createUnaryCallable( + getUserTransportSettings, settings.getUserSettings(), clientContext); + this.createUserCallable = + callableFactory.createUnaryCallable( + createUserTransportSettings, settings.createUserSettings(), clientContext); + this.updateUserCallable = + callableFactory.createUnaryCallable( + updateUserTransportSettings, settings.updateUserSettings(), clientContext); + this.deleteUserCallable = + callableFactory.createUnaryCallable( + deleteUserTransportSettings, settings.deleteUserSettings(), clientContext); this.listLocationsCallable = callableFactory.createUnaryCallable( listLocationsTransportSettings, settings.listLocationsSettings(), clientContext); @@ -843,6 +1104,17 @@ public UnaryCallable deleteClusterCallable() { return deleteClusterOperationCallable; } + @Override + public UnaryCallable promoteClusterCallable() { + return promoteClusterCallable; + } + + @Override + public OperationCallable + promoteClusterOperationCallable() { + return promoteClusterOperationCallable; + } + @Override public UnaryCallable restoreClusterCallable() { return restoreClusterCallable; @@ -854,6 +1126,17 @@ public UnaryCallable restoreClusterCallable() return restoreClusterOperationCallable; } + @Override + public UnaryCallable createSecondaryClusterCallable() { + return createSecondaryClusterCallable; + } + + @Override + public OperationCallable + createSecondaryClusterOperationCallable() { + return createSecondaryClusterOperationCallable; + } + @Override public UnaryCallable listInstancesCallable() { return listInstancesCallable; @@ -881,6 +1164,18 @@ public UnaryCallable createInstanceCallable() return createInstanceOperationCallable; } + @Override + public UnaryCallable + createSecondaryInstanceCallable() { + return createSecondaryInstanceCallable; + } + + @Override + public OperationCallable + createSecondaryInstanceOperationCallable() { + return createSecondaryInstanceOperationCallable; + } + @Override public UnaryCallable batchCreateInstancesCallable() { return batchCreateInstancesCallable; @@ -926,6 +1221,17 @@ public UnaryCallable failoverInstanceCallabl return failoverInstanceOperationCallable; } + @Override + public UnaryCallable injectFaultCallable() { + return injectFaultCallable; + } + + @Override + public OperationCallable + injectFaultOperationCallable() { + return injectFaultOperationCallable; + } + @Override public UnaryCallable restartInstanceCallable() { return restartInstanceCallable; @@ -997,6 +1303,36 @@ public UnaryCallable deleteBackupCallable() { return listSupportedDatabaseFlagsPagedCallable; } + @Override + public UnaryCallable listUsersCallable() { + return listUsersCallable; + } + + @Override + public UnaryCallable listUsersPagedCallable() { + return listUsersPagedCallable; + } + + @Override + public UnaryCallable getUserCallable() { + return getUserCallable; + } + + @Override + public UnaryCallable createUserCallable() { + return createUserCallable; + } + + @Override + public UnaryCallable updateUserCallable() { + return updateUserCallable; + } + + @Override + public UnaryCallable deleteUserCallable() { + return deleteUserCallable; + } + @Override public UnaryCallable listLocationsCallable() { return listLocationsCallable; diff --git a/java-alloydb/google-cloud-alloydb/src/main/java/com/google/cloud/alloydb/v1/stub/HttpJsonAlloyDBAdminStub.java b/java-alloydb/google-cloud-alloydb/src/main/java/com/google/cloud/alloydb/v1/stub/HttpJsonAlloyDBAdminStub.java index cf516307dd93..bf594deb0665 100644 --- a/java-alloydb/google-cloud-alloydb/src/main/java/com/google/cloud/alloydb/v1/stub/HttpJsonAlloyDBAdminStub.java +++ b/java-alloydb/google-cloud-alloydb/src/main/java/com/google/cloud/alloydb/v1/stub/HttpJsonAlloyDBAdminStub.java @@ -21,6 +21,7 @@ import static com.google.cloud.alloydb.v1.AlloyDBAdminClient.ListInstancesPagedResponse; import static com.google.cloud.alloydb.v1.AlloyDBAdminClient.ListLocationsPagedResponse; import static com.google.cloud.alloydb.v1.AlloyDBAdminClient.ListSupportedDatabaseFlagsPagedResponse; +import static com.google.cloud.alloydb.v1.AlloyDBAdminClient.ListUsersPagedResponse; import com.google.api.HttpRule; import com.google.api.core.BetaApi; @@ -46,13 +47,19 @@ import com.google.cloud.alloydb.v1.CreateBackupRequest; import com.google.cloud.alloydb.v1.CreateClusterRequest; import com.google.cloud.alloydb.v1.CreateInstanceRequest; +import com.google.cloud.alloydb.v1.CreateSecondaryClusterRequest; +import com.google.cloud.alloydb.v1.CreateSecondaryInstanceRequest; +import com.google.cloud.alloydb.v1.CreateUserRequest; import com.google.cloud.alloydb.v1.DeleteBackupRequest; import com.google.cloud.alloydb.v1.DeleteClusterRequest; import com.google.cloud.alloydb.v1.DeleteInstanceRequest; +import com.google.cloud.alloydb.v1.DeleteUserRequest; import com.google.cloud.alloydb.v1.FailoverInstanceRequest; import com.google.cloud.alloydb.v1.GetBackupRequest; import com.google.cloud.alloydb.v1.GetClusterRequest; import com.google.cloud.alloydb.v1.GetInstanceRequest; +import com.google.cloud.alloydb.v1.GetUserRequest; +import com.google.cloud.alloydb.v1.InjectFaultRequest; import com.google.cloud.alloydb.v1.Instance; import com.google.cloud.alloydb.v1.ListBackupsRequest; import com.google.cloud.alloydb.v1.ListBackupsResponse; @@ -62,12 +69,17 @@ import com.google.cloud.alloydb.v1.ListInstancesResponse; import com.google.cloud.alloydb.v1.ListSupportedDatabaseFlagsRequest; import com.google.cloud.alloydb.v1.ListSupportedDatabaseFlagsResponse; +import com.google.cloud.alloydb.v1.ListUsersRequest; +import com.google.cloud.alloydb.v1.ListUsersResponse; import com.google.cloud.alloydb.v1.OperationMetadata; +import com.google.cloud.alloydb.v1.PromoteClusterRequest; import com.google.cloud.alloydb.v1.RestartInstanceRequest; import com.google.cloud.alloydb.v1.RestoreClusterRequest; import com.google.cloud.alloydb.v1.UpdateBackupRequest; import com.google.cloud.alloydb.v1.UpdateClusterRequest; import com.google.cloud.alloydb.v1.UpdateInstanceRequest; +import com.google.cloud.alloydb.v1.UpdateUserRequest; +import com.google.cloud.alloydb.v1.User; import com.google.cloud.location.GetLocationRequest; import com.google.cloud.location.ListLocationsRequest; import com.google.cloud.location.ListLocationsResponse; @@ -162,6 +174,7 @@ public class HttpJsonAlloyDBAdminStub extends AlloyDBAdminStub { Map> fields = new HashMap<>(); ProtoRestSerializer serializer = ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "view", request.getViewValue()); serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); return fields; }) @@ -307,6 +320,46 @@ public class HttpJsonAlloyDBAdminStub extends AlloyDBAdminStub { HttpJsonOperationSnapshot.create(response)) .build(); + private static final ApiMethodDescriptor + promoteClusterMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.alloydb.v1.AlloyDBAdmin/PromoteCluster") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{name=projects/*/locations/*/clusters/*}:promote", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("*", request.toBuilder().clearName().build(), true)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .setOperationSnapshotFactory( + (PromoteClusterRequest request, Operation response) -> + HttpJsonOperationSnapshot.create(response)) + .build(); + private static final ApiMethodDescriptor restoreClusterMethodDescriptor = ApiMethodDescriptor.newBuilder() @@ -347,6 +400,50 @@ public class HttpJsonAlloyDBAdminStub extends AlloyDBAdminStub { HttpJsonOperationSnapshot.create(response)) .build(); + private static final ApiMethodDescriptor + createSecondaryClusterMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.alloydb.v1.AlloyDBAdmin/CreateSecondaryCluster") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{parent=projects/*/locations/*}/clusters:createsecondary", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "parent", request.getParent()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "clusterId", request.getClusterId()); + serializer.putQueryParam(fields, "requestId", request.getRequestId()); + serializer.putQueryParam( + fields, "validateOnly", request.getValidateOnly()); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("cluster", request.getCluster(), true)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .setOperationSnapshotFactory( + (CreateSecondaryClusterRequest request, Operation response) -> + HttpJsonOperationSnapshot.create(response)) + .build(); + private static final ApiMethodDescriptor listInstancesMethodDescriptor = ApiMethodDescriptor.newBuilder() @@ -464,6 +561,50 @@ public class HttpJsonAlloyDBAdminStub extends AlloyDBAdminStub { HttpJsonOperationSnapshot.create(response)) .build(); + private static final ApiMethodDescriptor + createSecondaryInstanceMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.alloydb.v1.AlloyDBAdmin/CreateSecondaryInstance") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{parent=projects/*/locations/*/clusters/*}/instances:createsecondary", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "parent", request.getParent()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "instanceId", request.getInstanceId()); + serializer.putQueryParam(fields, "requestId", request.getRequestId()); + serializer.putQueryParam( + fields, "validateOnly", request.getValidateOnly()); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("instance", request.getInstance(), true)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .setOperationSnapshotFactory( + (CreateSecondaryInstanceRequest request, Operation response) -> + HttpJsonOperationSnapshot.create(response)) + .build(); + private static final ApiMethodDescriptor batchCreateInstancesMethodDescriptor = ApiMethodDescriptor.newBuilder() @@ -633,6 +774,46 @@ public class HttpJsonAlloyDBAdminStub extends AlloyDBAdminStub { HttpJsonOperationSnapshot.create(response)) .build(); + private static final ApiMethodDescriptor + injectFaultMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.alloydb.v1.AlloyDBAdmin/InjectFault") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{name=projects/*/locations/*/clusters/*/instances/*}:injectFault", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("*", request.toBuilder().clearName().build(), true)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .setOperationSnapshotFactory( + (InjectFaultRequest request, Operation response) -> + HttpJsonOperationSnapshot.create(response)) + .build(); + private static final ApiMethodDescriptor restartInstanceMethodDescriptor = ApiMethodDescriptor.newBuilder() @@ -914,6 +1095,189 @@ public class HttpJsonAlloyDBAdminStub extends AlloyDBAdminStub { .build()) .build(); + private static final ApiMethodDescriptor + listUsersMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.alloydb.v1.AlloyDBAdmin/ListUsers") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{parent=projects/*/locations/*/clusters/*}/users", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "parent", request.getParent()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "filter", request.getFilter()); + serializer.putQueryParam(fields, "orderBy", request.getOrderBy()); + serializer.putQueryParam(fields, "pageSize", request.getPageSize()); + serializer.putQueryParam(fields, "pageToken", request.getPageToken()); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(ListUsersResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor getUserMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.alloydb.v1.AlloyDBAdmin/GetUser") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{name=projects/*/locations/*/clusters/*/users/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(User.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor createUserMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.alloydb.v1.AlloyDBAdmin/CreateUser") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{parent=projects/*/locations/*/clusters/*}/users", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "parent", request.getParent()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "requestId", request.getRequestId()); + serializer.putQueryParam(fields, "userId", request.getUserId()); + serializer.putQueryParam(fields, "validateOnly", request.getValidateOnly()); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create().toBody("user", request.getUser(), true)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(User.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor updateUserMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.alloydb.v1.AlloyDBAdmin/UpdateUser") + .setHttpMethod("PATCH") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{user.name=projects/*/locations/*/clusters/*/users/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "user.name", request.getUser().getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "allowMissing", request.getAllowMissing()); + serializer.putQueryParam(fields, "requestId", request.getRequestId()); + serializer.putQueryParam(fields, "updateMask", request.getUpdateMask()); + serializer.putQueryParam(fields, "validateOnly", request.getValidateOnly()); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create().toBody("user", request.getUser(), true)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(User.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor deleteUserMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.alloydb.v1.AlloyDBAdmin/DeleteUser") + .setHttpMethod("DELETE") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{name=projects/*/locations/*/clusters/*/users/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "requestId", request.getRequestId()); + serializer.putQueryParam(fields, "validateOnly", request.getValidateOnly()); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Empty.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + private static final ApiMethodDescriptor listLocationsMethodDescriptor = ApiMethodDescriptor.newBuilder() @@ -995,9 +1359,16 @@ public class HttpJsonAlloyDBAdminStub extends AlloyDBAdminStub { private final UnaryCallable deleteClusterCallable; private final OperationCallable deleteClusterOperationCallable; + private final UnaryCallable promoteClusterCallable; + private final OperationCallable + promoteClusterOperationCallable; private final UnaryCallable restoreClusterCallable; private final OperationCallable restoreClusterOperationCallable; + private final UnaryCallable + createSecondaryClusterCallable; + private final OperationCallable + createSecondaryClusterOperationCallable; private final UnaryCallable listInstancesCallable; private final UnaryCallable listInstancesPagedCallable; @@ -1005,6 +1376,10 @@ public class HttpJsonAlloyDBAdminStub extends AlloyDBAdminStub { private final UnaryCallable createInstanceCallable; private final OperationCallable createInstanceOperationCallable; + private final UnaryCallable + createSecondaryInstanceCallable; + private final OperationCallable + createSecondaryInstanceOperationCallable; private final UnaryCallable batchCreateInstancesCallable; private final OperationCallable< BatchCreateInstancesRequest, BatchCreateInstancesResponse, OperationMetadata> @@ -1018,6 +1393,9 @@ public class HttpJsonAlloyDBAdminStub extends AlloyDBAdminStub { private final UnaryCallable failoverInstanceCallable; private final OperationCallable failoverInstanceOperationCallable; + private final UnaryCallable injectFaultCallable; + private final OperationCallable + injectFaultOperationCallable; private final UnaryCallable restartInstanceCallable; private final OperationCallable restartInstanceOperationCallable; @@ -1039,6 +1417,12 @@ public class HttpJsonAlloyDBAdminStub extends AlloyDBAdminStub { private final UnaryCallable< ListSupportedDatabaseFlagsRequest, ListSupportedDatabaseFlagsPagedResponse> listSupportedDatabaseFlagsPagedCallable; + private final UnaryCallable listUsersCallable; + private final UnaryCallable listUsersPagedCallable; + private final UnaryCallable getUserCallable; + private final UnaryCallable createUserCallable; + private final UnaryCallable updateUserCallable; + private final UnaryCallable deleteUserCallable; private final UnaryCallable listLocationsCallable; private final UnaryCallable listLocationsPagedCallable; @@ -1169,6 +1553,17 @@ protected HttpJsonAlloyDBAdminStub( return builder.build(); }) .build(); + HttpJsonCallSettings promoteClusterTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(promoteClusterMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); HttpJsonCallSettings restoreClusterTransportSettings = HttpJsonCallSettings.newBuilder() .setMethodDescriptor(restoreClusterMethodDescriptor) @@ -1180,6 +1575,18 @@ protected HttpJsonAlloyDBAdminStub( return builder.build(); }) .build(); + HttpJsonCallSettings + createSecondaryClusterTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(createSecondaryClusterMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .build(); HttpJsonCallSettings listInstancesTransportSettings = HttpJsonCallSettings.newBuilder() @@ -1214,6 +1621,18 @@ protected HttpJsonAlloyDBAdminStub( return builder.build(); }) .build(); + HttpJsonCallSettings + createSecondaryInstanceTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(createSecondaryInstanceMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .build(); HttpJsonCallSettings batchCreateInstancesTransportSettings = HttpJsonCallSettings.newBuilder() @@ -1259,6 +1678,17 @@ protected HttpJsonAlloyDBAdminStub( return builder.build(); }) .build(); + HttpJsonCallSettings injectFaultTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(injectFaultMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); HttpJsonCallSettings restartInstanceTransportSettings = HttpJsonCallSettings.newBuilder() .setMethodDescriptor(restartInstanceMethodDescriptor) @@ -1338,6 +1768,61 @@ protected HttpJsonAlloyDBAdminStub( return builder.build(); }) .build(); + HttpJsonCallSettings listUsersTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(listUsersMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings getUserTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getUserMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings createUserTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(createUserMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings updateUserTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(updateUserMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("user.name", String.valueOf(request.getUser().getName())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings deleteUserTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(deleteUserMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); HttpJsonCallSettings listLocationsTransportSettings = HttpJsonCallSettings.newBuilder() @@ -1398,6 +1883,15 @@ protected HttpJsonAlloyDBAdminStub( settings.deleteClusterOperationSettings(), clientContext, httpJsonOperationsStub); + this.promoteClusterCallable = + callableFactory.createUnaryCallable( + promoteClusterTransportSettings, settings.promoteClusterSettings(), clientContext); + this.promoteClusterOperationCallable = + callableFactory.createOperationCallable( + promoteClusterTransportSettings, + settings.promoteClusterOperationSettings(), + clientContext, + httpJsonOperationsStub); this.restoreClusterCallable = callableFactory.createUnaryCallable( restoreClusterTransportSettings, settings.restoreClusterSettings(), clientContext); @@ -1407,6 +1901,17 @@ protected HttpJsonAlloyDBAdminStub( settings.restoreClusterOperationSettings(), clientContext, httpJsonOperationsStub); + this.createSecondaryClusterCallable = + callableFactory.createUnaryCallable( + createSecondaryClusterTransportSettings, + settings.createSecondaryClusterSettings(), + clientContext); + this.createSecondaryClusterOperationCallable = + callableFactory.createOperationCallable( + createSecondaryClusterTransportSettings, + settings.createSecondaryClusterOperationSettings(), + clientContext, + httpJsonOperationsStub); this.listInstancesCallable = callableFactory.createUnaryCallable( listInstancesTransportSettings, settings.listInstancesSettings(), clientContext); @@ -1425,6 +1930,17 @@ protected HttpJsonAlloyDBAdminStub( settings.createInstanceOperationSettings(), clientContext, httpJsonOperationsStub); + this.createSecondaryInstanceCallable = + callableFactory.createUnaryCallable( + createSecondaryInstanceTransportSettings, + settings.createSecondaryInstanceSettings(), + clientContext); + this.createSecondaryInstanceOperationCallable = + callableFactory.createOperationCallable( + createSecondaryInstanceTransportSettings, + settings.createSecondaryInstanceOperationSettings(), + clientContext, + httpJsonOperationsStub); this.batchCreateInstancesCallable = callableFactory.createUnaryCallable( batchCreateInstancesTransportSettings, @@ -1463,6 +1979,15 @@ protected HttpJsonAlloyDBAdminStub( settings.failoverInstanceOperationSettings(), clientContext, httpJsonOperationsStub); + this.injectFaultCallable = + callableFactory.createUnaryCallable( + injectFaultTransportSettings, settings.injectFaultSettings(), clientContext); + this.injectFaultOperationCallable = + callableFactory.createOperationCallable( + injectFaultTransportSettings, + settings.injectFaultOperationSettings(), + clientContext, + httpJsonOperationsStub); this.restartInstanceCallable = callableFactory.createUnaryCallable( restartInstanceTransportSettings, settings.restartInstanceSettings(), clientContext); @@ -1518,6 +2043,24 @@ protected HttpJsonAlloyDBAdminStub( listSupportedDatabaseFlagsTransportSettings, settings.listSupportedDatabaseFlagsSettings(), clientContext); + this.listUsersCallable = + callableFactory.createUnaryCallable( + listUsersTransportSettings, settings.listUsersSettings(), clientContext); + this.listUsersPagedCallable = + callableFactory.createPagedCallable( + listUsersTransportSettings, settings.listUsersSettings(), clientContext); + this.getUserCallable = + callableFactory.createUnaryCallable( + getUserTransportSettings, settings.getUserSettings(), clientContext); + this.createUserCallable = + callableFactory.createUnaryCallable( + createUserTransportSettings, settings.createUserSettings(), clientContext); + this.updateUserCallable = + callableFactory.createUnaryCallable( + updateUserTransportSettings, settings.updateUserSettings(), clientContext); + this.deleteUserCallable = + callableFactory.createUnaryCallable( + deleteUserTransportSettings, settings.deleteUserSettings(), clientContext); this.listLocationsCallable = callableFactory.createUnaryCallable( listLocationsTransportSettings, settings.listLocationsSettings(), clientContext); @@ -1540,14 +2083,18 @@ public static List getMethodDescriptors() { methodDescriptors.add(createClusterMethodDescriptor); methodDescriptors.add(updateClusterMethodDescriptor); methodDescriptors.add(deleteClusterMethodDescriptor); + methodDescriptors.add(promoteClusterMethodDescriptor); methodDescriptors.add(restoreClusterMethodDescriptor); + methodDescriptors.add(createSecondaryClusterMethodDescriptor); methodDescriptors.add(listInstancesMethodDescriptor); methodDescriptors.add(getInstanceMethodDescriptor); methodDescriptors.add(createInstanceMethodDescriptor); + methodDescriptors.add(createSecondaryInstanceMethodDescriptor); methodDescriptors.add(batchCreateInstancesMethodDescriptor); methodDescriptors.add(updateInstanceMethodDescriptor); methodDescriptors.add(deleteInstanceMethodDescriptor); methodDescriptors.add(failoverInstanceMethodDescriptor); + methodDescriptors.add(injectFaultMethodDescriptor); methodDescriptors.add(restartInstanceMethodDescriptor); methodDescriptors.add(listBackupsMethodDescriptor); methodDescriptors.add(getBackupMethodDescriptor); @@ -1555,6 +2102,11 @@ public static List getMethodDescriptors() { methodDescriptors.add(updateBackupMethodDescriptor); methodDescriptors.add(deleteBackupMethodDescriptor); methodDescriptors.add(listSupportedDatabaseFlagsMethodDescriptor); + methodDescriptors.add(listUsersMethodDescriptor); + methodDescriptors.add(getUserMethodDescriptor); + methodDescriptors.add(createUserMethodDescriptor); + methodDescriptors.add(updateUserMethodDescriptor); + methodDescriptors.add(deleteUserMethodDescriptor); methodDescriptors.add(listLocationsMethodDescriptor); methodDescriptors.add(getLocationMethodDescriptor); return methodDescriptors; @@ -1612,6 +2164,17 @@ public UnaryCallable deleteClusterCallable() { return deleteClusterOperationCallable; } + @Override + public UnaryCallable promoteClusterCallable() { + return promoteClusterCallable; + } + + @Override + public OperationCallable + promoteClusterOperationCallable() { + return promoteClusterOperationCallable; + } + @Override public UnaryCallable restoreClusterCallable() { return restoreClusterCallable; @@ -1623,6 +2186,17 @@ public UnaryCallable restoreClusterCallable() return restoreClusterOperationCallable; } + @Override + public UnaryCallable createSecondaryClusterCallable() { + return createSecondaryClusterCallable; + } + + @Override + public OperationCallable + createSecondaryClusterOperationCallable() { + return createSecondaryClusterOperationCallable; + } + @Override public UnaryCallable listInstancesCallable() { return listInstancesCallable; @@ -1650,6 +2224,18 @@ public UnaryCallable createInstanceCallable() return createInstanceOperationCallable; } + @Override + public UnaryCallable + createSecondaryInstanceCallable() { + return createSecondaryInstanceCallable; + } + + @Override + public OperationCallable + createSecondaryInstanceOperationCallable() { + return createSecondaryInstanceOperationCallable; + } + @Override public UnaryCallable batchCreateInstancesCallable() { return batchCreateInstancesCallable; @@ -1695,6 +2281,17 @@ public UnaryCallable failoverInstanceCallabl return failoverInstanceOperationCallable; } + @Override + public UnaryCallable injectFaultCallable() { + return injectFaultCallable; + } + + @Override + public OperationCallable + injectFaultOperationCallable() { + return injectFaultOperationCallable; + } + @Override public UnaryCallable restartInstanceCallable() { return restartInstanceCallable; @@ -1766,6 +2363,36 @@ public UnaryCallable deleteBackupCallable() { return listSupportedDatabaseFlagsPagedCallable; } + @Override + public UnaryCallable listUsersCallable() { + return listUsersCallable; + } + + @Override + public UnaryCallable listUsersPagedCallable() { + return listUsersPagedCallable; + } + + @Override + public UnaryCallable getUserCallable() { + return getUserCallable; + } + + @Override + public UnaryCallable createUserCallable() { + return createUserCallable; + } + + @Override + public UnaryCallable updateUserCallable() { + return updateUserCallable; + } + + @Override + public UnaryCallable deleteUserCallable() { + return deleteUserCallable; + } + @Override public UnaryCallable listLocationsCallable() { return listLocationsCallable; diff --git a/java-alloydb/google-cloud-alloydb/src/main/java/com/google/cloud/alloydb/v1alpha/AlloyDBAdminClient.java b/java-alloydb/google-cloud-alloydb/src/main/java/com/google/cloud/alloydb/v1alpha/AlloyDBAdminClient.java index b641152e9726..086db9f185d9 100644 --- a/java-alloydb/google-cloud-alloydb/src/main/java/com/google/cloud/alloydb/v1alpha/AlloyDBAdminClient.java +++ b/java-alloydb/google-cloud-alloydb/src/main/java/com/google/cloud/alloydb/v1alpha/AlloyDBAdminClient.java @@ -451,6 +451,7 @@ public final Cluster getCluster(String name) { * GetClusterRequest request = * GetClusterRequest.newBuilder() * .setName(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString()) + * .setView(ClusterView.forNumber(0)) * .build(); * Cluster response = alloyDBAdminClient.getCluster(request); * } @@ -479,6 +480,7 @@ public final Cluster getCluster(GetClusterRequest request) { * GetClusterRequest request = * GetClusterRequest.newBuilder() * .setName(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString()) + * .setView(ClusterView.forNumber(0)) * .build(); * ApiFuture future = alloyDBAdminClient.getClusterCallable().futureCall(request); * // Do something. @@ -510,7 +512,7 @@ public final UnaryCallable getClusterCallable() { * } * } * - * @param parent Required. The name of the parent resource. For the required format, see the + * @param parent Required. The location of the new cluster. For the required format, see the * comment on the Cluster.name field. * @param cluster Required. The resource being created * @param clusterId Required. ID of the requesting object. @@ -547,7 +549,7 @@ public final OperationFuture createClusterAsync( * } * } * - * @param parent Required. The name of the parent resource. For the required format, see the + * @param parent Required. The location of the new cluster. For the required format, see the * comment on the Cluster.name field. * @param cluster Required. The resource being created * @param clusterId Required. ID of the requesting object. @@ -1219,8 +1221,8 @@ public final UnaryCallable restoreClusterCalla * } * } * - * @param parent Required. The name of the parent resource (the primary cluster). For the required - * format, see the comment on the Cluster.name field. + * @param parent Required. The location of the new cluster. For the required format, see the + * comment on the Cluster.name field. * @param cluster Required. Configuration of the requesting object (the secondary cluster). * @param clusterId Required. ID of the requesting object (the secondary cluster). * @throws com.google.api.gax.rpc.ApiException if the remote call fails @@ -1258,8 +1260,8 @@ public final OperationFuture createSecondaryClusterA * } * } * - * @param parent Required. The name of the parent resource (the primary cluster). For the required - * format, see the comment on the Cluster.name field. + * @param parent Required. The location of the new cluster. For the required format, see the + * comment on the Cluster.name field. * @param cluster Required. Configuration of the requesting object (the secondary cluster). * @param clusterId Required. ID of the requesting object (the secondary cluster). * @throws com.google.api.gax.rpc.ApiException if the remote call fails @@ -2569,6 +2571,166 @@ public final UnaryCallable failoverInstanceC return stub.failoverInstanceCallable(); } + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Injects fault in an instance. Imperative only. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   InjectFaultRequest.FaultType faultType = InjectFaultRequest.FaultType.forNumber(0);
+   *   InstanceName name = InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]");
+   *   Instance response = alloyDBAdminClient.injectFaultAsync(faultType, name).get();
+   * }
+   * }
+ * + * @param faultType Required. The type of fault to be injected in an instance. + * @param name Required. The name of the resource. For the required format, see the comment on the + * Instance.name field. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture injectFaultAsync( + InjectFaultRequest.FaultType faultType, InstanceName name) { + InjectFaultRequest request = + InjectFaultRequest.newBuilder() + .setFaultType(faultType) + .setName(name == null ? null : name.toString()) + .build(); + return injectFaultAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Injects fault in an instance. Imperative only. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   InjectFaultRequest.FaultType faultType = InjectFaultRequest.FaultType.forNumber(0);
+   *   String name =
+   *       InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]").toString();
+   *   Instance response = alloyDBAdminClient.injectFaultAsync(faultType, name).get();
+   * }
+   * }
+ * + * @param faultType Required. The type of fault to be injected in an instance. + * @param name Required. The name of the resource. For the required format, see the comment on the + * Instance.name field. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture injectFaultAsync( + InjectFaultRequest.FaultType faultType, String name) { + InjectFaultRequest request = + InjectFaultRequest.newBuilder().setFaultType(faultType).setName(name).build(); + return injectFaultAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Injects fault in an instance. Imperative only. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   InjectFaultRequest request =
+   *       InjectFaultRequest.newBuilder()
+   *           .setName(
+   *               InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]").toString())
+   *           .setRequestId("requestId693933066")
+   *           .setValidateOnly(true)
+   *           .build();
+   *   Instance response = alloyDBAdminClient.injectFaultAsync(request).get();
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture injectFaultAsync( + InjectFaultRequest request) { + return injectFaultOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Injects fault in an instance. Imperative only. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   InjectFaultRequest request =
+   *       InjectFaultRequest.newBuilder()
+   *           .setName(
+   *               InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]").toString())
+   *           .setRequestId("requestId693933066")
+   *           .setValidateOnly(true)
+   *           .build();
+   *   OperationFuture future =
+   *       alloyDBAdminClient.injectFaultOperationCallable().futureCall(request);
+   *   // Do something.
+   *   Instance response = future.get();
+   * }
+   * }
+ */ + public final OperationCallable + injectFaultOperationCallable() { + return stub.injectFaultOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Injects fault in an instance. Imperative only. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   InjectFaultRequest request =
+   *       InjectFaultRequest.newBuilder()
+   *           .setName(
+   *               InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]").toString())
+   *           .setRequestId("requestId693933066")
+   *           .setValidateOnly(true)
+   *           .build();
+   *   ApiFuture future = alloyDBAdminClient.injectFaultCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable injectFaultCallable() { + return stub.injectFaultCallable(); + } + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Restart an Instance in a cluster. Imperative only. @@ -3711,6 +3873,7 @@ public final GenerateClientCertificateResponse generateClientCertificate(String * .setRequestId("requestId693933066") * .setPemCsr("pemCsr-991911478") * .setCertDuration(Duration.newBuilder().build()) + * .setPublicKey("publicKey1446899510") * .build(); * GenerateClientCertificateResponse response = * alloyDBAdminClient.generateClientCertificate(request); @@ -3747,6 +3910,7 @@ public final GenerateClientCertificateResponse generateClientCertificate( * .setRequestId("requestId693933066") * .setPemCsr("pemCsr-991911478") * .setCertDuration(Duration.newBuilder().build()) + * .setPublicKey("publicKey1446899510") * .build(); * ApiFuture future = * alloyDBAdminClient.generateClientCertificateCallable().futureCall(request); @@ -3881,7 +4045,7 @@ public final UnaryCallable getConnecti // AUTO-GENERATED DOCUMENTATION AND METHOD. /** - * Lists information about the supported locations for this service. + * Lists Users in a given project and location. * *

Sample code: * @@ -3892,14 +4056,72 @@ public final UnaryCallable getConnecti * // - It may require specifying regional endpoints when creating the service client as shown in * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library * try (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { - * ListLocationsRequest request = - * ListLocationsRequest.newBuilder() - * .setName("name3373707") - * .setFilter("filter-1274492040") + * ClusterName parent = ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]"); + * for (User element : alloyDBAdminClient.listUsers(parent).iterateAll()) { + * // doThingsWith(element); + * } + * } + * } + * + * @param parent Required. Parent value for ListUsersRequest + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListUsersPagedResponse listUsers(ClusterName parent) { + ListUsersRequest request = + ListUsersRequest.newBuilder().setParent(parent == null ? null : parent.toString()).build(); + return listUsers(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists Users in a given project and location. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   String parent = ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString();
+   *   for (User element : alloyDBAdminClient.listUsers(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param parent Required. Parent value for ListUsersRequest + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListUsersPagedResponse listUsers(String parent) { + ListUsersRequest request = ListUsersRequest.newBuilder().setParent(parent).build(); + return listUsers(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists Users in a given project and location. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   ListUsersRequest request =
+   *       ListUsersRequest.newBuilder()
+   *           .setParent(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString())
    *           .setPageSize(883849137)
    *           .setPageToken("pageToken873572522")
+   *           .setFilter("filter-1274492040")
+   *           .setOrderBy("orderBy-1207110587")
    *           .build();
-   *   for (Location element : alloyDBAdminClient.listLocations(request).iterateAll()) {
+   *   for (User element : alloyDBAdminClient.listUsers(request).iterateAll()) {
    *     // doThingsWith(element);
    *   }
    * }
@@ -3908,13 +4130,13 @@ public final UnaryCallable getConnecti
    * @param request The request object containing all of the parameters for the API call.
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
-  public final ListLocationsPagedResponse listLocations(ListLocationsRequest request) {
-    return listLocationsPagedCallable().call(request);
+  public final ListUsersPagedResponse listUsers(ListUsersRequest request) {
+    return listUsersPagedCallable().call(request);
   }
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD.
   /**
-   * Lists information about the supported locations for this service.
+   * Lists Users in a given project and location.
    *
    * 

Sample code: * @@ -3925,30 +4147,29 @@ public final ListLocationsPagedResponse listLocations(ListLocationsRequest reque * // - It may require specifying regional endpoints when creating the service client as shown in * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library * try (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { - * ListLocationsRequest request = - * ListLocationsRequest.newBuilder() - * .setName("name3373707") - * .setFilter("filter-1274492040") + * ListUsersRequest request = + * ListUsersRequest.newBuilder() + * .setParent(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString()) * .setPageSize(883849137) * .setPageToken("pageToken873572522") + * .setFilter("filter-1274492040") + * .setOrderBy("orderBy-1207110587") * .build(); - * ApiFuture future = - * alloyDBAdminClient.listLocationsPagedCallable().futureCall(request); + * ApiFuture future = alloyDBAdminClient.listUsersPagedCallable().futureCall(request); * // Do something. - * for (Location element : future.get().iterateAll()) { + * for (User element : future.get().iterateAll()) { * // doThingsWith(element); * } * } * }

*/ - public final UnaryCallable - listLocationsPagedCallable() { - return stub.listLocationsPagedCallable(); + public final UnaryCallable listUsersPagedCallable() { + return stub.listUsersPagedCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** - * Lists information about the supported locations for this service. + * Lists Users in a given project and location. * *

Sample code: * @@ -3959,16 +4180,17 @@ public final ListLocationsPagedResponse listLocations(ListLocationsRequest reque * // - It may require specifying regional endpoints when creating the service client as shown in * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library * try (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { - * ListLocationsRequest request = - * ListLocationsRequest.newBuilder() - * .setName("name3373707") - * .setFilter("filter-1274492040") + * ListUsersRequest request = + * ListUsersRequest.newBuilder() + * .setParent(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString()) * .setPageSize(883849137) * .setPageToken("pageToken873572522") + * .setFilter("filter-1274492040") + * .setOrderBy("orderBy-1207110587") * .build(); * while (true) { - * ListLocationsResponse response = alloyDBAdminClient.listLocationsCallable().call(request); - * for (Location element : response.getLocationsList()) { + * ListUsersResponse response = alloyDBAdminClient.listUsersCallable().call(request); + * for (User element : response.getUsersList()) { * // doThingsWith(element); * } * String nextPageToken = response.getNextPageToken(); @@ -3981,13 +4203,13 @@ public final ListLocationsPagedResponse listLocations(ListLocationsRequest reque * } * } */ - public final UnaryCallable listLocationsCallable() { - return stub.listLocationsCallable(); + public final UnaryCallable listUsersCallable() { + return stub.listUsersCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** - * Gets information about a location. + * Gets details of a single User. * *

Sample code: * @@ -3998,21 +4220,24 @@ public final UnaryCallable listLoca * // - It may require specifying regional endpoints when creating the service client as shown in * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library * try (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { - * GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build(); - * Location response = alloyDBAdminClient.getLocation(request); + * UserName name = UserName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[USER]"); + * User response = alloyDBAdminClient.getUser(name); * } * } * - * @param request The request object containing all of the parameters for the API call. + * @param name Required. The name of the resource. For the required format, see the comment on the + * User.name field. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - public final Location getLocation(GetLocationRequest request) { - return getLocationCallable().call(request); + public final User getUser(UserName name) { + GetUserRequest request = + GetUserRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + return getUser(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** - * Gets information about a location. + * Gets details of a single User. * *

Sample code: * @@ -4023,34 +4248,585 @@ public final Location getLocation(GetLocationRequest request) { * // - It may require specifying regional endpoints when creating the service client as shown in * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library * try (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { - * GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build(); - * ApiFuture future = alloyDBAdminClient.getLocationCallable().futureCall(request); - * // Do something. - * Location response = future.get(); + * String name = UserName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[USER]").toString(); + * User response = alloyDBAdminClient.getUser(name); * } * } + * + * @param name Required. The name of the resource. For the required format, see the comment on the + * User.name field. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - public final UnaryCallable getLocationCallable() { - return stub.getLocationCallable(); - } - - @Override - public final void close() { - stub.close(); - } - - @Override - public void shutdown() { - stub.shutdown(); + public final User getUser(String name) { + GetUserRequest request = GetUserRequest.newBuilder().setName(name).build(); + return getUser(request); } - @Override - public boolean isShutdown() { - return stub.isShutdown(); + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets details of a single User. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   GetUserRequest request =
+   *       GetUserRequest.newBuilder()
+   *           .setName(UserName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[USER]").toString())
+   *           .build();
+   *   User response = alloyDBAdminClient.getUser(request);
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final User getUser(GetUserRequest request) { + return getUserCallable().call(request); } - @Override - public boolean isTerminated() { + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets details of a single User. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   GetUserRequest request =
+   *       GetUserRequest.newBuilder()
+   *           .setName(UserName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[USER]").toString())
+   *           .build();
+   *   ApiFuture future = alloyDBAdminClient.getUserCallable().futureCall(request);
+   *   // Do something.
+   *   User response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable getUserCallable() { + return stub.getUserCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a new User in a given project, location, and cluster. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   ClusterName parent = ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]");
+   *   User user = User.newBuilder().build();
+   *   String userId = "userId-836030906";
+   *   User response = alloyDBAdminClient.createUser(parent, user, userId);
+   * }
+   * }
+ * + * @param parent Required. Value for parent. + * @param user Required. The resource being created + * @param userId Required. ID of the requesting object. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final User createUser(ClusterName parent, User user, String userId) { + CreateUserRequest request = + CreateUserRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .setUser(user) + .setUserId(userId) + .build(); + return createUser(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a new User in a given project, location, and cluster. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   String parent = ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString();
+   *   User user = User.newBuilder().build();
+   *   String userId = "userId-836030906";
+   *   User response = alloyDBAdminClient.createUser(parent, user, userId);
+   * }
+   * }
+ * + * @param parent Required. Value for parent. + * @param user Required. The resource being created + * @param userId Required. ID of the requesting object. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final User createUser(String parent, User user, String userId) { + CreateUserRequest request = + CreateUserRequest.newBuilder().setParent(parent).setUser(user).setUserId(userId).build(); + return createUser(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a new User in a given project, location, and cluster. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   CreateUserRequest request =
+   *       CreateUserRequest.newBuilder()
+   *           .setParent(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString())
+   *           .setUserId("userId-836030906")
+   *           .setUser(User.newBuilder().build())
+   *           .setRequestId("requestId693933066")
+   *           .setValidateOnly(true)
+   *           .build();
+   *   User response = alloyDBAdminClient.createUser(request);
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final User createUser(CreateUserRequest request) { + return createUserCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a new User in a given project, location, and cluster. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   CreateUserRequest request =
+   *       CreateUserRequest.newBuilder()
+   *           .setParent(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString())
+   *           .setUserId("userId-836030906")
+   *           .setUser(User.newBuilder().build())
+   *           .setRequestId("requestId693933066")
+   *           .setValidateOnly(true)
+   *           .build();
+   *   ApiFuture future = alloyDBAdminClient.createUserCallable().futureCall(request);
+   *   // Do something.
+   *   User response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable createUserCallable() { + return stub.createUserCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates the parameters of a single User. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   User user = User.newBuilder().build();
+   *   FieldMask updateMask = FieldMask.newBuilder().build();
+   *   User response = alloyDBAdminClient.updateUser(user, updateMask);
+   * }
+   * }
+ * + * @param user Required. The resource being updated + * @param 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. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final User updateUser(User user, FieldMask updateMask) { + UpdateUserRequest request = + UpdateUserRequest.newBuilder().setUser(user).setUpdateMask(updateMask).build(); + return updateUser(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates the parameters of a single User. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   UpdateUserRequest request =
+   *       UpdateUserRequest.newBuilder()
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .setUser(User.newBuilder().build())
+   *           .setRequestId("requestId693933066")
+   *           .setValidateOnly(true)
+   *           .setAllowMissing(true)
+   *           .build();
+   *   User response = alloyDBAdminClient.updateUser(request);
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final User updateUser(UpdateUserRequest request) { + return updateUserCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates the parameters of a single User. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   UpdateUserRequest request =
+   *       UpdateUserRequest.newBuilder()
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .setUser(User.newBuilder().build())
+   *           .setRequestId("requestId693933066")
+   *           .setValidateOnly(true)
+   *           .setAllowMissing(true)
+   *           .build();
+   *   ApiFuture future = alloyDBAdminClient.updateUserCallable().futureCall(request);
+   *   // Do something.
+   *   User response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable updateUserCallable() { + return stub.updateUserCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a single User. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   UserName name = UserName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[USER]");
+   *   alloyDBAdminClient.deleteUser(name);
+   * }
+   * }
+ * + * @param name Required. The name of the resource. For the required format, see the comment on the + * User.name field. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void deleteUser(UserName name) { + DeleteUserRequest request = + DeleteUserRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + deleteUser(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a single User. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   String name = UserName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[USER]").toString();
+   *   alloyDBAdminClient.deleteUser(name);
+   * }
+   * }
+ * + * @param name Required. The name of the resource. For the required format, see the comment on the + * User.name field. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void deleteUser(String name) { + DeleteUserRequest request = DeleteUserRequest.newBuilder().setName(name).build(); + deleteUser(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a single User. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   DeleteUserRequest request =
+   *       DeleteUserRequest.newBuilder()
+   *           .setName(UserName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[USER]").toString())
+   *           .setRequestId("requestId693933066")
+   *           .setValidateOnly(true)
+   *           .build();
+   *   alloyDBAdminClient.deleteUser(request);
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void deleteUser(DeleteUserRequest request) { + deleteUserCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a single User. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   DeleteUserRequest request =
+   *       DeleteUserRequest.newBuilder()
+   *           .setName(UserName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[USER]").toString())
+   *           .setRequestId("requestId693933066")
+   *           .setValidateOnly(true)
+   *           .build();
+   *   ApiFuture future = alloyDBAdminClient.deleteUserCallable().futureCall(request);
+   *   // Do something.
+   *   future.get();
+   * }
+   * }
+ */ + public final UnaryCallable deleteUserCallable() { + return stub.deleteUserCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists information about the supported locations for this service. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   ListLocationsRequest request =
+   *       ListLocationsRequest.newBuilder()
+   *           .setName("name3373707")
+   *           .setFilter("filter-1274492040")
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   for (Location element : alloyDBAdminClient.listLocations(request).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListLocationsPagedResponse listLocations(ListLocationsRequest request) { + return listLocationsPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists information about the supported locations for this service. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   ListLocationsRequest request =
+   *       ListLocationsRequest.newBuilder()
+   *           .setName("name3373707")
+   *           .setFilter("filter-1274492040")
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   ApiFuture future =
+   *       alloyDBAdminClient.listLocationsPagedCallable().futureCall(request);
+   *   // Do something.
+   *   for (Location element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable + listLocationsPagedCallable() { + return stub.listLocationsPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists information about the supported locations for this service. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   ListLocationsRequest request =
+   *       ListLocationsRequest.newBuilder()
+   *           .setName("name3373707")
+   *           .setFilter("filter-1274492040")
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   while (true) {
+   *     ListLocationsResponse response = alloyDBAdminClient.listLocationsCallable().call(request);
+   *     for (Location element : response.getLocationsList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable listLocationsCallable() { + return stub.listLocationsCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets information about a location. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build();
+   *   Location response = alloyDBAdminClient.getLocation(request);
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Location getLocation(GetLocationRequest request) { + return getLocationCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets information about a location. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build();
+   *   ApiFuture future = alloyDBAdminClient.getLocationCallable().futureCall(request);
+   *   // Do something.
+   *   Location response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable getLocationCallable() { + return stub.getLocationCallable(); + } + + @Override + public final void close() { + stub.close(); + } + + @Override + public void shutdown() { + stub.shutdown(); + } + + @Override + public boolean isShutdown() { + return stub.isShutdown(); + } + + @Override + public boolean isTerminated() { return stub.isTerminated(); } @@ -4384,6 +5160,71 @@ protected ListSupportedDatabaseFlagsFixedSizeCollection createCollection( } } + public static class ListUsersPagedResponse + extends AbstractPagedListResponse< + ListUsersRequest, ListUsersResponse, User, ListUsersPage, ListUsersFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListUsersPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, input -> new ListUsersPagedResponse(input), MoreExecutors.directExecutor()); + } + + private ListUsersPagedResponse(ListUsersPage page) { + super(page, ListUsersFixedSizeCollection.createEmptyCollection()); + } + } + + public static class ListUsersPage + extends AbstractPage { + + private ListUsersPage( + PageContext context, + ListUsersResponse response) { + super(context, response); + } + + private static ListUsersPage createEmptyPage() { + return new ListUsersPage(null, null); + } + + @Override + protected ListUsersPage createPage( + PageContext context, + ListUsersResponse response) { + return new ListUsersPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class ListUsersFixedSizeCollection + extends AbstractFixedSizeCollection< + ListUsersRequest, ListUsersResponse, User, ListUsersPage, ListUsersFixedSizeCollection> { + + private ListUsersFixedSizeCollection(List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListUsersFixedSizeCollection createEmptyCollection() { + return new ListUsersFixedSizeCollection(null, 0); + } + + @Override + protected ListUsersFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListUsersFixedSizeCollection(pages, collectionSize); + } + } + public static class ListLocationsPagedResponse extends AbstractPagedListResponse< ListLocationsRequest, diff --git a/java-alloydb/google-cloud-alloydb/src/main/java/com/google/cloud/alloydb/v1alpha/AlloyDBAdminSettings.java b/java-alloydb/google-cloud-alloydb/src/main/java/com/google/cloud/alloydb/v1alpha/AlloyDBAdminSettings.java index b3fb8d18f4f9..e648ff619596 100644 --- a/java-alloydb/google-cloud-alloydb/src/main/java/com/google/cloud/alloydb/v1alpha/AlloyDBAdminSettings.java +++ b/java-alloydb/google-cloud-alloydb/src/main/java/com/google/cloud/alloydb/v1alpha/AlloyDBAdminSettings.java @@ -21,6 +21,7 @@ import static com.google.cloud.alloydb.v1alpha.AlloyDBAdminClient.ListInstancesPagedResponse; import static com.google.cloud.alloydb.v1alpha.AlloyDBAdminClient.ListLocationsPagedResponse; import static com.google.cloud.alloydb.v1alpha.AlloyDBAdminClient.ListSupportedDatabaseFlagsPagedResponse; +import static com.google.cloud.alloydb.v1alpha.AlloyDBAdminClient.ListUsersPagedResponse; import com.google.api.core.ApiFunction; import com.google.api.core.BetaApi; @@ -244,6 +245,17 @@ public UnaryCallSettings failoverInstanceSet return ((AlloyDBAdminStubSettings) getStubSettings()).failoverInstanceOperationSettings(); } + /** Returns the object with the settings used for calls to injectFault. */ + public UnaryCallSettings injectFaultSettings() { + return ((AlloyDBAdminStubSettings) getStubSettings()).injectFaultSettings(); + } + + /** Returns the object with the settings used for calls to injectFault. */ + public OperationCallSettings + injectFaultOperationSettings() { + return ((AlloyDBAdminStubSettings) getStubSettings()).injectFaultOperationSettings(); + } + /** Returns the object with the settings used for calls to restartInstance. */ public UnaryCallSettings restartInstanceSettings() { return ((AlloyDBAdminStubSettings) getStubSettings()).restartInstanceSettings(); @@ -319,6 +331,32 @@ public UnaryCallSettings getConnection return ((AlloyDBAdminStubSettings) getStubSettings()).getConnectionInfoSettings(); } + /** Returns the object with the settings used for calls to listUsers. */ + public PagedCallSettings + listUsersSettings() { + return ((AlloyDBAdminStubSettings) getStubSettings()).listUsersSettings(); + } + + /** Returns the object with the settings used for calls to getUser. */ + public UnaryCallSettings getUserSettings() { + return ((AlloyDBAdminStubSettings) getStubSettings()).getUserSettings(); + } + + /** Returns the object with the settings used for calls to createUser. */ + public UnaryCallSettings createUserSettings() { + return ((AlloyDBAdminStubSettings) getStubSettings()).createUserSettings(); + } + + /** Returns the object with the settings used for calls to updateUser. */ + public UnaryCallSettings updateUserSettings() { + return ((AlloyDBAdminStubSettings) getStubSettings()).updateUserSettings(); + } + + /** Returns the object with the settings used for calls to deleteUser. */ + public UnaryCallSettings deleteUserSettings() { + return ((AlloyDBAdminStubSettings) getStubSettings()).deleteUserSettings(); + } + /** Returns the object with the settings used for calls to listLocations. */ public PagedCallSettings listLocationsSettings() { @@ -607,6 +645,17 @@ public UnaryCallSettings.Builder deleteInstanc return getStubSettingsBuilder().failoverInstanceOperationSettings(); } + /** Returns the builder for the settings used for calls to injectFault. */ + public UnaryCallSettings.Builder injectFaultSettings() { + return getStubSettingsBuilder().injectFaultSettings(); + } + + /** Returns the builder for the settings used for calls to injectFault. */ + public OperationCallSettings.Builder + injectFaultOperationSettings() { + return getStubSettingsBuilder().injectFaultOperationSettings(); + } + /** Returns the builder for the settings used for calls to restartInstance. */ public UnaryCallSettings.Builder restartInstanceSettings() { return getStubSettingsBuilder().restartInstanceSettings(); @@ -685,6 +734,32 @@ public UnaryCallSettings.Builder deleteBackupSet return getStubSettingsBuilder().getConnectionInfoSettings(); } + /** Returns the builder for the settings used for calls to listUsers. */ + public PagedCallSettings.Builder + listUsersSettings() { + return getStubSettingsBuilder().listUsersSettings(); + } + + /** Returns the builder for the settings used for calls to getUser. */ + public UnaryCallSettings.Builder getUserSettings() { + return getStubSettingsBuilder().getUserSettings(); + } + + /** Returns the builder for the settings used for calls to createUser. */ + public UnaryCallSettings.Builder createUserSettings() { + return getStubSettingsBuilder().createUserSettings(); + } + + /** Returns the builder for the settings used for calls to updateUser. */ + public UnaryCallSettings.Builder updateUserSettings() { + return getStubSettingsBuilder().updateUserSettings(); + } + + /** Returns the builder for the settings used for calls to deleteUser. */ + public UnaryCallSettings.Builder deleteUserSettings() { + return getStubSettingsBuilder().deleteUserSettings(); + } + /** Returns the builder for the settings used for calls to listLocations. */ public PagedCallSettings.Builder< ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse> diff --git a/java-alloydb/google-cloud-alloydb/src/main/java/com/google/cloud/alloydb/v1alpha/gapic_metadata.json b/java-alloydb/google-cloud-alloydb/src/main/java/com/google/cloud/alloydb/v1alpha/gapic_metadata.json index 4754f2d844cc..cbe0952c01e8 100644 --- a/java-alloydb/google-cloud-alloydb/src/main/java/com/google/cloud/alloydb/v1alpha/gapic_metadata.json +++ b/java-alloydb/google-cloud-alloydb/src/main/java/com/google/cloud/alloydb/v1alpha/gapic_metadata.json @@ -28,6 +28,9 @@ "CreateSecondaryInstance": { "methods": ["createSecondaryInstanceAsync", "createSecondaryInstanceAsync", "createSecondaryInstanceAsync", "createSecondaryInstanceOperationCallable", "createSecondaryInstanceCallable"] }, + "CreateUser": { + "methods": ["createUser", "createUser", "createUser", "createUserCallable"] + }, "DeleteBackup": { "methods": ["deleteBackupAsync", "deleteBackupAsync", "deleteBackupAsync", "deleteBackupOperationCallable", "deleteBackupCallable"] }, @@ -37,6 +40,9 @@ "DeleteInstance": { "methods": ["deleteInstanceAsync", "deleteInstanceAsync", "deleteInstanceAsync", "deleteInstanceOperationCallable", "deleteInstanceCallable"] }, + "DeleteUser": { + "methods": ["deleteUser", "deleteUser", "deleteUser", "deleteUserCallable"] + }, "FailoverInstance": { "methods": ["failoverInstanceAsync", "failoverInstanceAsync", "failoverInstanceAsync", "failoverInstanceOperationCallable", "failoverInstanceCallable"] }, @@ -58,6 +64,12 @@ "GetLocation": { "methods": ["getLocation", "getLocationCallable"] }, + "GetUser": { + "methods": ["getUser", "getUser", "getUser", "getUserCallable"] + }, + "InjectFault": { + "methods": ["injectFaultAsync", "injectFaultAsync", "injectFaultAsync", "injectFaultOperationCallable", "injectFaultCallable"] + }, "ListBackups": { "methods": ["listBackups", "listBackups", "listBackups", "listBackupsPagedCallable", "listBackupsCallable"] }, @@ -73,6 +85,9 @@ "ListSupportedDatabaseFlags": { "methods": ["listSupportedDatabaseFlags", "listSupportedDatabaseFlags", "listSupportedDatabaseFlags", "listSupportedDatabaseFlagsPagedCallable", "listSupportedDatabaseFlagsCallable"] }, + "ListUsers": { + "methods": ["listUsers", "listUsers", "listUsers", "listUsersPagedCallable", "listUsersCallable"] + }, "PromoteCluster": { "methods": ["promoteClusterAsync", "promoteClusterAsync", "promoteClusterAsync", "promoteClusterOperationCallable", "promoteClusterCallable"] }, @@ -90,6 +105,9 @@ }, "UpdateInstance": { "methods": ["updateInstanceAsync", "updateInstanceAsync", "updateInstanceOperationCallable", "updateInstanceCallable"] + }, + "UpdateUser": { + "methods": ["updateUser", "updateUser", "updateUserCallable"] } } } diff --git a/java-alloydb/google-cloud-alloydb/src/main/java/com/google/cloud/alloydb/v1alpha/stub/AlloyDBAdminStub.java b/java-alloydb/google-cloud-alloydb/src/main/java/com/google/cloud/alloydb/v1alpha/stub/AlloyDBAdminStub.java index cfc83c57ea7c..af9e9fbe5c5e 100644 --- a/java-alloydb/google-cloud-alloydb/src/main/java/com/google/cloud/alloydb/v1alpha/stub/AlloyDBAdminStub.java +++ b/java-alloydb/google-cloud-alloydb/src/main/java/com/google/cloud/alloydb/v1alpha/stub/AlloyDBAdminStub.java @@ -21,6 +21,7 @@ import static com.google.cloud.alloydb.v1alpha.AlloyDBAdminClient.ListInstancesPagedResponse; import static com.google.cloud.alloydb.v1alpha.AlloyDBAdminClient.ListLocationsPagedResponse; import static com.google.cloud.alloydb.v1alpha.AlloyDBAdminClient.ListSupportedDatabaseFlagsPagedResponse; +import static com.google.cloud.alloydb.v1alpha.AlloyDBAdminClient.ListUsersPagedResponse; import com.google.api.core.BetaApi; import com.google.api.gax.core.BackgroundResource; @@ -36,9 +37,11 @@ import com.google.cloud.alloydb.v1alpha.CreateInstanceRequest; import com.google.cloud.alloydb.v1alpha.CreateSecondaryClusterRequest; import com.google.cloud.alloydb.v1alpha.CreateSecondaryInstanceRequest; +import com.google.cloud.alloydb.v1alpha.CreateUserRequest; import com.google.cloud.alloydb.v1alpha.DeleteBackupRequest; import com.google.cloud.alloydb.v1alpha.DeleteClusterRequest; import com.google.cloud.alloydb.v1alpha.DeleteInstanceRequest; +import com.google.cloud.alloydb.v1alpha.DeleteUserRequest; import com.google.cloud.alloydb.v1alpha.FailoverInstanceRequest; import com.google.cloud.alloydb.v1alpha.GenerateClientCertificateRequest; import com.google.cloud.alloydb.v1alpha.GenerateClientCertificateResponse; @@ -46,6 +49,8 @@ import com.google.cloud.alloydb.v1alpha.GetClusterRequest; import com.google.cloud.alloydb.v1alpha.GetConnectionInfoRequest; import com.google.cloud.alloydb.v1alpha.GetInstanceRequest; +import com.google.cloud.alloydb.v1alpha.GetUserRequest; +import com.google.cloud.alloydb.v1alpha.InjectFaultRequest; import com.google.cloud.alloydb.v1alpha.Instance; import com.google.cloud.alloydb.v1alpha.ListBackupsRequest; import com.google.cloud.alloydb.v1alpha.ListBackupsResponse; @@ -55,6 +60,8 @@ import com.google.cloud.alloydb.v1alpha.ListInstancesResponse; import com.google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsRequest; import com.google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsResponse; +import com.google.cloud.alloydb.v1alpha.ListUsersRequest; +import com.google.cloud.alloydb.v1alpha.ListUsersResponse; import com.google.cloud.alloydb.v1alpha.OperationMetadata; import com.google.cloud.alloydb.v1alpha.PromoteClusterRequest; import com.google.cloud.alloydb.v1alpha.RestartInstanceRequest; @@ -62,6 +69,8 @@ import com.google.cloud.alloydb.v1alpha.UpdateBackupRequest; import com.google.cloud.alloydb.v1alpha.UpdateClusterRequest; import com.google.cloud.alloydb.v1alpha.UpdateInstanceRequest; +import com.google.cloud.alloydb.v1alpha.UpdateUserRequest; +import com.google.cloud.alloydb.v1alpha.User; import com.google.cloud.location.GetLocationRequest; import com.google.cloud.location.ListLocationsRequest; import com.google.cloud.location.ListLocationsResponse; @@ -227,6 +236,15 @@ public UnaryCallable failoverInstanceCallabl throw new UnsupportedOperationException("Not implemented: failoverInstanceCallable()"); } + public OperationCallable + injectFaultOperationCallable() { + throw new UnsupportedOperationException("Not implemented: injectFaultOperationCallable()"); + } + + public UnaryCallable injectFaultCallable() { + throw new UnsupportedOperationException("Not implemented: injectFaultCallable()"); + } + public OperationCallable restartInstanceOperationCallable() { throw new UnsupportedOperationException("Not implemented: restartInstanceOperationCallable()"); @@ -296,6 +314,30 @@ public UnaryCallable getConnectionInfo throw new UnsupportedOperationException("Not implemented: getConnectionInfoCallable()"); } + public UnaryCallable listUsersPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listUsersPagedCallable()"); + } + + public UnaryCallable listUsersCallable() { + throw new UnsupportedOperationException("Not implemented: listUsersCallable()"); + } + + public UnaryCallable getUserCallable() { + throw new UnsupportedOperationException("Not implemented: getUserCallable()"); + } + + public UnaryCallable createUserCallable() { + throw new UnsupportedOperationException("Not implemented: createUserCallable()"); + } + + public UnaryCallable updateUserCallable() { + throw new UnsupportedOperationException("Not implemented: updateUserCallable()"); + } + + public UnaryCallable deleteUserCallable() { + throw new UnsupportedOperationException("Not implemented: deleteUserCallable()"); + } + public UnaryCallable listLocationsPagedCallable() { throw new UnsupportedOperationException("Not implemented: listLocationsPagedCallable()"); diff --git a/java-alloydb/google-cloud-alloydb/src/main/java/com/google/cloud/alloydb/v1alpha/stub/AlloyDBAdminStubSettings.java b/java-alloydb/google-cloud-alloydb/src/main/java/com/google/cloud/alloydb/v1alpha/stub/AlloyDBAdminStubSettings.java index 4e23d88575dd..9aa857024625 100644 --- a/java-alloydb/google-cloud-alloydb/src/main/java/com/google/cloud/alloydb/v1alpha/stub/AlloyDBAdminStubSettings.java +++ b/java-alloydb/google-cloud-alloydb/src/main/java/com/google/cloud/alloydb/v1alpha/stub/AlloyDBAdminStubSettings.java @@ -21,6 +21,7 @@ import static com.google.cloud.alloydb.v1alpha.AlloyDBAdminClient.ListInstancesPagedResponse; import static com.google.cloud.alloydb.v1alpha.AlloyDBAdminClient.ListLocationsPagedResponse; import static com.google.cloud.alloydb.v1alpha.AlloyDBAdminClient.ListSupportedDatabaseFlagsPagedResponse; +import static com.google.cloud.alloydb.v1alpha.AlloyDBAdminClient.ListUsersPagedResponse; import com.google.api.core.ApiFunction; import com.google.api.core.ApiFuture; @@ -61,9 +62,11 @@ import com.google.cloud.alloydb.v1alpha.CreateInstanceRequest; import com.google.cloud.alloydb.v1alpha.CreateSecondaryClusterRequest; import com.google.cloud.alloydb.v1alpha.CreateSecondaryInstanceRequest; +import com.google.cloud.alloydb.v1alpha.CreateUserRequest; import com.google.cloud.alloydb.v1alpha.DeleteBackupRequest; import com.google.cloud.alloydb.v1alpha.DeleteClusterRequest; import com.google.cloud.alloydb.v1alpha.DeleteInstanceRequest; +import com.google.cloud.alloydb.v1alpha.DeleteUserRequest; import com.google.cloud.alloydb.v1alpha.FailoverInstanceRequest; import com.google.cloud.alloydb.v1alpha.GenerateClientCertificateRequest; import com.google.cloud.alloydb.v1alpha.GenerateClientCertificateResponse; @@ -71,6 +74,8 @@ import com.google.cloud.alloydb.v1alpha.GetClusterRequest; import com.google.cloud.alloydb.v1alpha.GetConnectionInfoRequest; import com.google.cloud.alloydb.v1alpha.GetInstanceRequest; +import com.google.cloud.alloydb.v1alpha.GetUserRequest; +import com.google.cloud.alloydb.v1alpha.InjectFaultRequest; import com.google.cloud.alloydb.v1alpha.Instance; import com.google.cloud.alloydb.v1alpha.ListBackupsRequest; import com.google.cloud.alloydb.v1alpha.ListBackupsResponse; @@ -80,6 +85,8 @@ import com.google.cloud.alloydb.v1alpha.ListInstancesResponse; import com.google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsRequest; import com.google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsResponse; +import com.google.cloud.alloydb.v1alpha.ListUsersRequest; +import com.google.cloud.alloydb.v1alpha.ListUsersResponse; import com.google.cloud.alloydb.v1alpha.OperationMetadata; import com.google.cloud.alloydb.v1alpha.PromoteClusterRequest; import com.google.cloud.alloydb.v1alpha.RestartInstanceRequest; @@ -88,6 +95,8 @@ import com.google.cloud.alloydb.v1alpha.UpdateBackupRequest; import com.google.cloud.alloydb.v1alpha.UpdateClusterRequest; import com.google.cloud.alloydb.v1alpha.UpdateInstanceRequest; +import com.google.cloud.alloydb.v1alpha.UpdateUserRequest; +import com.google.cloud.alloydb.v1alpha.User; import com.google.cloud.location.GetLocationRequest; import com.google.cloud.location.ListLocationsRequest; import com.google.cloud.location.ListLocationsResponse; @@ -195,6 +204,9 @@ public class AlloyDBAdminStubSettings extends StubSettings failoverInstanceSettings; private final OperationCallSettings failoverInstanceOperationSettings; + private final UnaryCallSettings injectFaultSettings; + private final OperationCallSettings + injectFaultOperationSettings; private final UnaryCallSettings restartInstanceSettings; private final OperationCallSettings restartInstanceOperationSettings; @@ -220,6 +232,12 @@ public class AlloyDBAdminStubSettings extends StubSettings getConnectionInfoSettings; + private final PagedCallSettings + listUsersSettings; + private final UnaryCallSettings getUserSettings; + private final UnaryCallSettings createUserSettings; + private final UnaryCallSettings updateUserSettings; + private final UnaryCallSettings deleteUserSettings; private final PagedCallSettings< ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse> listLocationsSettings; @@ -382,6 +400,42 @@ public Iterable extractResources( } }; + private static final PagedListDescriptor + LIST_USERS_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListUsersRequest injectToken(ListUsersRequest payload, String token) { + return ListUsersRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListUsersRequest injectPageSize(ListUsersRequest payload, int pageSize) { + return ListUsersRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(ListUsersRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListUsersResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources(ListUsersResponse payload) { + return payload.getUsersList() == null + ? ImmutableList.of() + : payload.getUsersList(); + } + }; + private static final PagedListDescriptor LIST_LOCATIONS_PAGE_STR_DESC = new PagedListDescriptor() { @@ -497,6 +551,23 @@ public ApiFuture getFuturePagedResponse } }; + private static final PagedListResponseFactory< + ListUsersRequest, ListUsersResponse, ListUsersPagedResponse> + LIST_USERS_PAGE_STR_FACT = + new PagedListResponseFactory< + ListUsersRequest, ListUsersResponse, ListUsersPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListUsersRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, LIST_USERS_PAGE_STR_DESC, request, context); + return ListUsersPagedResponse.createAsync(pageContext, futureResponse); + } + }; + private static final PagedListResponseFactory< ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse> LIST_LOCATIONS_PAGE_STR_FACT = @@ -671,6 +742,17 @@ public UnaryCallSettings failoverInstanceSet return failoverInstanceOperationSettings; } + /** Returns the object with the settings used for calls to injectFault. */ + public UnaryCallSettings injectFaultSettings() { + return injectFaultSettings; + } + + /** Returns the object with the settings used for calls to injectFault. */ + public OperationCallSettings + injectFaultOperationSettings() { + return injectFaultOperationSettings; + } + /** Returns the object with the settings used for calls to restartInstance. */ public UnaryCallSettings restartInstanceSettings() { return restartInstanceSettings; @@ -746,6 +828,32 @@ public UnaryCallSettings getConnection return getConnectionInfoSettings; } + /** Returns the object with the settings used for calls to listUsers. */ + public PagedCallSettings + listUsersSettings() { + return listUsersSettings; + } + + /** Returns the object with the settings used for calls to getUser. */ + public UnaryCallSettings getUserSettings() { + return getUserSettings; + } + + /** Returns the object with the settings used for calls to createUser. */ + public UnaryCallSettings createUserSettings() { + return createUserSettings; + } + + /** Returns the object with the settings used for calls to updateUser. */ + public UnaryCallSettings updateUserSettings() { + return updateUserSettings; + } + + /** Returns the object with the settings used for calls to deleteUser. */ + public UnaryCallSettings deleteUserSettings() { + return deleteUserSettings; + } + /** Returns the object with the settings used for calls to listLocations. */ public PagedCallSettings listLocationsSettings() { @@ -894,6 +1002,8 @@ protected AlloyDBAdminStubSettings(Builder settingsBuilder) throws IOException { deleteInstanceOperationSettings = settingsBuilder.deleteInstanceOperationSettings().build(); failoverInstanceSettings = settingsBuilder.failoverInstanceSettings().build(); failoverInstanceOperationSettings = settingsBuilder.failoverInstanceOperationSettings().build(); + injectFaultSettings = settingsBuilder.injectFaultSettings().build(); + injectFaultOperationSettings = settingsBuilder.injectFaultOperationSettings().build(); restartInstanceSettings = settingsBuilder.restartInstanceSettings().build(); restartInstanceOperationSettings = settingsBuilder.restartInstanceOperationSettings().build(); listBackupsSettings = settingsBuilder.listBackupsSettings().build(); @@ -908,6 +1018,11 @@ protected AlloyDBAdminStubSettings(Builder settingsBuilder) throws IOException { settingsBuilder.listSupportedDatabaseFlagsSettings().build(); generateClientCertificateSettings = settingsBuilder.generateClientCertificateSettings().build(); getConnectionInfoSettings = settingsBuilder.getConnectionInfoSettings().build(); + listUsersSettings = settingsBuilder.listUsersSettings().build(); + getUserSettings = settingsBuilder.getUserSettings().build(); + createUserSettings = settingsBuilder.createUserSettings().build(); + updateUserSettings = settingsBuilder.updateUserSettings().build(); + deleteUserSettings = settingsBuilder.deleteUserSettings().build(); listLocationsSettings = settingsBuilder.listLocationsSettings().build(); getLocationSettings = settingsBuilder.getLocationSettings().build(); } @@ -972,6 +1087,9 @@ public static class Builder extends StubSettings.Builder failoverInstanceOperationSettings; + private final UnaryCallSettings.Builder injectFaultSettings; + private final OperationCallSettings.Builder + injectFaultOperationSettings; private final UnaryCallSettings.Builder restartInstanceSettings; private final OperationCallSettings.Builder @@ -999,6 +1117,13 @@ public static class Builder extends StubSettings.Builder getConnectionInfoSettings; + private final PagedCallSettings.Builder< + ListUsersRequest, ListUsersResponse, ListUsersPagedResponse> + listUsersSettings; + private final UnaryCallSettings.Builder getUserSettings; + private final UnaryCallSettings.Builder createUserSettings; + private final UnaryCallSettings.Builder updateUserSettings; + private final UnaryCallSettings.Builder deleteUserSettings; private final PagedCallSettings.Builder< ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse> listLocationsSettings; @@ -1079,6 +1204,8 @@ protected Builder(ClientContext clientContext) { deleteInstanceOperationSettings = OperationCallSettings.newBuilder(); failoverInstanceSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); failoverInstanceOperationSettings = OperationCallSettings.newBuilder(); + injectFaultSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + injectFaultOperationSettings = OperationCallSettings.newBuilder(); restartInstanceSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); restartInstanceOperationSettings = OperationCallSettings.newBuilder(); listBackupsSettings = PagedCallSettings.newBuilder(LIST_BACKUPS_PAGE_STR_FACT); @@ -1093,6 +1220,11 @@ protected Builder(ClientContext clientContext) { PagedCallSettings.newBuilder(LIST_SUPPORTED_DATABASE_FLAGS_PAGE_STR_FACT); generateClientCertificateSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); getConnectionInfoSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + listUsersSettings = PagedCallSettings.newBuilder(LIST_USERS_PAGE_STR_FACT); + getUserSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + createUserSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + updateUserSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + deleteUserSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); listLocationsSettings = PagedCallSettings.newBuilder(LIST_LOCATIONS_PAGE_STR_FACT); getLocationSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); @@ -1114,6 +1246,7 @@ protected Builder(ClientContext clientContext) { updateInstanceSettings, deleteInstanceSettings, failoverInstanceSettings, + injectFaultSettings, restartInstanceSettings, listBackupsSettings, getBackupSettings, @@ -1123,6 +1256,11 @@ protected Builder(ClientContext clientContext) { listSupportedDatabaseFlagsSettings, generateClientCertificateSettings, getConnectionInfoSettings, + listUsersSettings, + getUserSettings, + createUserSettings, + updateUserSettings, + deleteUserSettings, listLocationsSettings, getLocationSettings); initDefaults(this); @@ -1162,6 +1300,8 @@ protected Builder(AlloyDBAdminStubSettings settings) { deleteInstanceOperationSettings = settings.deleteInstanceOperationSettings.toBuilder(); failoverInstanceSettings = settings.failoverInstanceSettings.toBuilder(); failoverInstanceOperationSettings = settings.failoverInstanceOperationSettings.toBuilder(); + injectFaultSettings = settings.injectFaultSettings.toBuilder(); + injectFaultOperationSettings = settings.injectFaultOperationSettings.toBuilder(); restartInstanceSettings = settings.restartInstanceSettings.toBuilder(); restartInstanceOperationSettings = settings.restartInstanceOperationSettings.toBuilder(); listBackupsSettings = settings.listBackupsSettings.toBuilder(); @@ -1175,6 +1315,11 @@ protected Builder(AlloyDBAdminStubSettings settings) { listSupportedDatabaseFlagsSettings = settings.listSupportedDatabaseFlagsSettings.toBuilder(); generateClientCertificateSettings = settings.generateClientCertificateSettings.toBuilder(); getConnectionInfoSettings = settings.getConnectionInfoSettings.toBuilder(); + listUsersSettings = settings.listUsersSettings.toBuilder(); + getUserSettings = settings.getUserSettings.toBuilder(); + createUserSettings = settings.createUserSettings.toBuilder(); + updateUserSettings = settings.updateUserSettings.toBuilder(); + deleteUserSettings = settings.deleteUserSettings.toBuilder(); listLocationsSettings = settings.listLocationsSettings.toBuilder(); getLocationSettings = settings.getLocationSettings.toBuilder(); @@ -1196,6 +1341,7 @@ protected Builder(AlloyDBAdminStubSettings settings) { updateInstanceSettings, deleteInstanceSettings, failoverInstanceSettings, + injectFaultSettings, restartInstanceSettings, listBackupsSettings, getBackupSettings, @@ -1205,6 +1351,11 @@ protected Builder(AlloyDBAdminStubSettings settings) { listSupportedDatabaseFlagsSettings, generateClientCertificateSettings, getConnectionInfoSettings, + listUsersSettings, + getUserSettings, + createUserSettings, + updateUserSettings, + deleteUserSettings, listLocationsSettings, getLocationSettings); } @@ -1316,6 +1467,11 @@ private static Builder initDefaults(Builder builder) { .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")); + builder + .injectFaultSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")); + builder .restartInstanceSettings() .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) @@ -1361,6 +1517,31 @@ private static Builder initDefaults(Builder builder) { .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + builder + .listUsersSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + + builder + .getUserSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + + builder + .createUserSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")); + + builder + .updateUserSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")); + + builder + .deleteUserSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")); + builder .listLocationsSettings() .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) @@ -1660,6 +1841,29 @@ private static Builder initDefaults(Builder builder) { .setTotalTimeout(Duration.ofMillis(300000L)) .build())); + builder + .injectFaultOperationSettings() + .setInitialCallSettings( + UnaryCallSettings.newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")) + .build()) + .setResponseTransformer( + ProtoOperationTransformers.ResponseTransformer.create(Instance.class)) + .setMetadataTransformer( + ProtoOperationTransformers.MetadataTransformer.create(OperationMetadata.class)) + .setPollingAlgorithm( + OperationTimedPollAlgorithm.create( + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(5000L)) + .setRetryDelayMultiplier(1.5) + .setMaxRetryDelay(Duration.ofMillis(45000L)) + .setInitialRpcTimeout(Duration.ZERO) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ZERO) + .setTotalTimeout(Duration.ofMillis(300000L)) + .build())); + builder .restartInstanceOperationSettings() .setInitialCallSettings( @@ -1960,6 +2164,19 @@ public UnaryCallSettings.Builder deleteInstanc return failoverInstanceOperationSettings; } + /** Returns the builder for the settings used for calls to injectFault. */ + public UnaryCallSettings.Builder injectFaultSettings() { + return injectFaultSettings; + } + + /** Returns the builder for the settings used for calls to injectFault. */ + @BetaApi( + "The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings.Builder + injectFaultOperationSettings() { + return injectFaultOperationSettings; + } + /** Returns the builder for the settings used for calls to restartInstance. */ public UnaryCallSettings.Builder restartInstanceSettings() { return restartInstanceSettings; @@ -2046,6 +2263,32 @@ public UnaryCallSettings.Builder deleteBackupSet return getConnectionInfoSettings; } + /** Returns the builder for the settings used for calls to listUsers. */ + public PagedCallSettings.Builder + listUsersSettings() { + return listUsersSettings; + } + + /** Returns the builder for the settings used for calls to getUser. */ + public UnaryCallSettings.Builder getUserSettings() { + return getUserSettings; + } + + /** Returns the builder for the settings used for calls to createUser. */ + public UnaryCallSettings.Builder createUserSettings() { + return createUserSettings; + } + + /** Returns the builder for the settings used for calls to updateUser. */ + public UnaryCallSettings.Builder updateUserSettings() { + return updateUserSettings; + } + + /** Returns the builder for the settings used for calls to deleteUser. */ + public UnaryCallSettings.Builder deleteUserSettings() { + return deleteUserSettings; + } + /** Returns the builder for the settings used for calls to listLocations. */ public PagedCallSettings.Builder< ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse> diff --git a/java-alloydb/google-cloud-alloydb/src/main/java/com/google/cloud/alloydb/v1alpha/stub/GrpcAlloyDBAdminStub.java b/java-alloydb/google-cloud-alloydb/src/main/java/com/google/cloud/alloydb/v1alpha/stub/GrpcAlloyDBAdminStub.java index 64d78448dc30..98c25f9487ae 100644 --- a/java-alloydb/google-cloud-alloydb/src/main/java/com/google/cloud/alloydb/v1alpha/stub/GrpcAlloyDBAdminStub.java +++ b/java-alloydb/google-cloud-alloydb/src/main/java/com/google/cloud/alloydb/v1alpha/stub/GrpcAlloyDBAdminStub.java @@ -21,6 +21,7 @@ import static com.google.cloud.alloydb.v1alpha.AlloyDBAdminClient.ListInstancesPagedResponse; import static com.google.cloud.alloydb.v1alpha.AlloyDBAdminClient.ListLocationsPagedResponse; import static com.google.cloud.alloydb.v1alpha.AlloyDBAdminClient.ListSupportedDatabaseFlagsPagedResponse; +import static com.google.cloud.alloydb.v1alpha.AlloyDBAdminClient.ListUsersPagedResponse; import com.google.api.core.BetaApi; import com.google.api.gax.core.BackgroundResource; @@ -41,9 +42,11 @@ import com.google.cloud.alloydb.v1alpha.CreateInstanceRequest; import com.google.cloud.alloydb.v1alpha.CreateSecondaryClusterRequest; import com.google.cloud.alloydb.v1alpha.CreateSecondaryInstanceRequest; +import com.google.cloud.alloydb.v1alpha.CreateUserRequest; import com.google.cloud.alloydb.v1alpha.DeleteBackupRequest; import com.google.cloud.alloydb.v1alpha.DeleteClusterRequest; import com.google.cloud.alloydb.v1alpha.DeleteInstanceRequest; +import com.google.cloud.alloydb.v1alpha.DeleteUserRequest; import com.google.cloud.alloydb.v1alpha.FailoverInstanceRequest; import com.google.cloud.alloydb.v1alpha.GenerateClientCertificateRequest; import com.google.cloud.alloydb.v1alpha.GenerateClientCertificateResponse; @@ -51,6 +54,8 @@ import com.google.cloud.alloydb.v1alpha.GetClusterRequest; import com.google.cloud.alloydb.v1alpha.GetConnectionInfoRequest; import com.google.cloud.alloydb.v1alpha.GetInstanceRequest; +import com.google.cloud.alloydb.v1alpha.GetUserRequest; +import com.google.cloud.alloydb.v1alpha.InjectFaultRequest; import com.google.cloud.alloydb.v1alpha.Instance; import com.google.cloud.alloydb.v1alpha.ListBackupsRequest; import com.google.cloud.alloydb.v1alpha.ListBackupsResponse; @@ -60,6 +65,8 @@ import com.google.cloud.alloydb.v1alpha.ListInstancesResponse; import com.google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsRequest; import com.google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsResponse; +import com.google.cloud.alloydb.v1alpha.ListUsersRequest; +import com.google.cloud.alloydb.v1alpha.ListUsersResponse; import com.google.cloud.alloydb.v1alpha.OperationMetadata; import com.google.cloud.alloydb.v1alpha.PromoteClusterRequest; import com.google.cloud.alloydb.v1alpha.RestartInstanceRequest; @@ -67,6 +74,8 @@ import com.google.cloud.alloydb.v1alpha.UpdateBackupRequest; import com.google.cloud.alloydb.v1alpha.UpdateClusterRequest; import com.google.cloud.alloydb.v1alpha.UpdateInstanceRequest; +import com.google.cloud.alloydb.v1alpha.UpdateUserRequest; +import com.google.cloud.alloydb.v1alpha.User; import com.google.cloud.location.GetLocationRequest; import com.google.cloud.location.ListLocationsRequest; import com.google.cloud.location.ListLocationsResponse; @@ -247,6 +256,14 @@ public class GrpcAlloyDBAdminStub extends AlloyDBAdminStub { .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) .build(); + private static final MethodDescriptor injectFaultMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.alloydb.v1alpha.AlloyDBAdmin/InjectFault") + .setRequestMarshaller(ProtoUtils.marshaller(InjectFaultRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + private static final MethodDescriptor restartInstanceMethodDescriptor = MethodDescriptor.newBuilder() @@ -340,6 +357,47 @@ public class GrpcAlloyDBAdminStub extends AlloyDBAdminStub { .setResponseMarshaller(ProtoUtils.marshaller(ConnectionInfo.getDefaultInstance())) .build(); + private static final MethodDescriptor + listUsersMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.alloydb.v1alpha.AlloyDBAdmin/ListUsers") + .setRequestMarshaller(ProtoUtils.marshaller(ListUsersRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(ListUsersResponse.getDefaultInstance())) + .build(); + + private static final MethodDescriptor getUserMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.alloydb.v1alpha.AlloyDBAdmin/GetUser") + .setRequestMarshaller(ProtoUtils.marshaller(GetUserRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(User.getDefaultInstance())) + .build(); + + private static final MethodDescriptor createUserMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.alloydb.v1alpha.AlloyDBAdmin/CreateUser") + .setRequestMarshaller(ProtoUtils.marshaller(CreateUserRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(User.getDefaultInstance())) + .build(); + + private static final MethodDescriptor updateUserMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.alloydb.v1alpha.AlloyDBAdmin/UpdateUser") + .setRequestMarshaller(ProtoUtils.marshaller(UpdateUserRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(User.getDefaultInstance())) + .build(); + + private static final MethodDescriptor deleteUserMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.alloydb.v1alpha.AlloyDBAdmin/DeleteUser") + .setRequestMarshaller(ProtoUtils.marshaller(DeleteUserRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance())) + .build(); + private static final MethodDescriptor listLocationsMethodDescriptor = MethodDescriptor.newBuilder() @@ -406,6 +464,9 @@ public class GrpcAlloyDBAdminStub extends AlloyDBAdminStub { private final UnaryCallable failoverInstanceCallable; private final OperationCallable failoverInstanceOperationCallable; + private final UnaryCallable injectFaultCallable; + private final OperationCallable + injectFaultOperationCallable; private final UnaryCallable restartInstanceCallable; private final OperationCallable restartInstanceOperationCallable; @@ -430,6 +491,12 @@ public class GrpcAlloyDBAdminStub extends AlloyDBAdminStub { private final UnaryCallable generateClientCertificateCallable; private final UnaryCallable getConnectionInfoCallable; + private final UnaryCallable listUsersCallable; + private final UnaryCallable listUsersPagedCallable; + private final UnaryCallable getUserCallable; + private final UnaryCallable createUserCallable; + private final UnaryCallable updateUserCallable; + private final UnaryCallable deleteUserCallable; private final UnaryCallable listLocationsCallable; private final UnaryCallable listLocationsPagedCallable; @@ -639,6 +706,16 @@ protected GrpcAlloyDBAdminStub( return builder.build(); }) .build(); + GrpcCallSettings injectFaultTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(injectFaultMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); GrpcCallSettings restartInstanceTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(restartInstanceMethodDescriptor) @@ -733,6 +810,56 @@ protected GrpcAlloyDBAdminStub( return builder.build(); }) .build(); + GrpcCallSettings listUsersTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listUsersMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .build(); + GrpcCallSettings getUserTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getUserMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + GrpcCallSettings createUserTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(createUserMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .build(); + GrpcCallSettings updateUserTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(updateUserMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("user.name", String.valueOf(request.getUser().getName())); + return builder.build(); + }) + .build(); + GrpcCallSettings deleteUserTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(deleteUserMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); GrpcCallSettings listLocationsTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(listLocationsMethodDescriptor) @@ -886,6 +1013,15 @@ protected GrpcAlloyDBAdminStub( settings.failoverInstanceOperationSettings(), clientContext, operationsStub); + this.injectFaultCallable = + callableFactory.createUnaryCallable( + injectFaultTransportSettings, settings.injectFaultSettings(), clientContext); + this.injectFaultOperationCallable = + callableFactory.createOperationCallable( + injectFaultTransportSettings, + settings.injectFaultOperationSettings(), + clientContext, + operationsStub); this.restartInstanceCallable = callableFactory.createUnaryCallable( restartInstanceTransportSettings, settings.restartInstanceSettings(), clientContext); @@ -951,6 +1087,24 @@ protected GrpcAlloyDBAdminStub( getConnectionInfoTransportSettings, settings.getConnectionInfoSettings(), clientContext); + this.listUsersCallable = + callableFactory.createUnaryCallable( + listUsersTransportSettings, settings.listUsersSettings(), clientContext); + this.listUsersPagedCallable = + callableFactory.createPagedCallable( + listUsersTransportSettings, settings.listUsersSettings(), clientContext); + this.getUserCallable = + callableFactory.createUnaryCallable( + getUserTransportSettings, settings.getUserSettings(), clientContext); + this.createUserCallable = + callableFactory.createUnaryCallable( + createUserTransportSettings, settings.createUserSettings(), clientContext); + this.updateUserCallable = + callableFactory.createUnaryCallable( + updateUserTransportSettings, settings.updateUserSettings(), clientContext); + this.deleteUserCallable = + callableFactory.createUnaryCallable( + deleteUserTransportSettings, settings.deleteUserSettings(), clientContext); this.listLocationsCallable = callableFactory.createUnaryCallable( listLocationsTransportSettings, settings.listLocationsSettings(), clientContext); @@ -1134,6 +1288,17 @@ public UnaryCallable failoverInstanceCallabl return failoverInstanceOperationCallable; } + @Override + public UnaryCallable injectFaultCallable() { + return injectFaultCallable; + } + + @Override + public OperationCallable + injectFaultOperationCallable() { + return injectFaultOperationCallable; + } + @Override public UnaryCallable restartInstanceCallable() { return restartInstanceCallable; @@ -1216,6 +1381,36 @@ public UnaryCallable getConnectionInfo return getConnectionInfoCallable; } + @Override + public UnaryCallable listUsersCallable() { + return listUsersCallable; + } + + @Override + public UnaryCallable listUsersPagedCallable() { + return listUsersPagedCallable; + } + + @Override + public UnaryCallable getUserCallable() { + return getUserCallable; + } + + @Override + public UnaryCallable createUserCallable() { + return createUserCallable; + } + + @Override + public UnaryCallable updateUserCallable() { + return updateUserCallable; + } + + @Override + public UnaryCallable deleteUserCallable() { + return deleteUserCallable; + } + @Override public UnaryCallable listLocationsCallable() { return listLocationsCallable; diff --git a/java-alloydb/google-cloud-alloydb/src/main/java/com/google/cloud/alloydb/v1alpha/stub/HttpJsonAlloyDBAdminStub.java b/java-alloydb/google-cloud-alloydb/src/main/java/com/google/cloud/alloydb/v1alpha/stub/HttpJsonAlloyDBAdminStub.java index 1c2867686ba4..efb59a833775 100644 --- a/java-alloydb/google-cloud-alloydb/src/main/java/com/google/cloud/alloydb/v1alpha/stub/HttpJsonAlloyDBAdminStub.java +++ b/java-alloydb/google-cloud-alloydb/src/main/java/com/google/cloud/alloydb/v1alpha/stub/HttpJsonAlloyDBAdminStub.java @@ -21,6 +21,7 @@ import static com.google.cloud.alloydb.v1alpha.AlloyDBAdminClient.ListInstancesPagedResponse; import static com.google.cloud.alloydb.v1alpha.AlloyDBAdminClient.ListLocationsPagedResponse; import static com.google.cloud.alloydb.v1alpha.AlloyDBAdminClient.ListSupportedDatabaseFlagsPagedResponse; +import static com.google.cloud.alloydb.v1alpha.AlloyDBAdminClient.ListUsersPagedResponse; import com.google.api.HttpRule; import com.google.api.core.BetaApi; @@ -49,9 +50,11 @@ import com.google.cloud.alloydb.v1alpha.CreateInstanceRequest; import com.google.cloud.alloydb.v1alpha.CreateSecondaryClusterRequest; import com.google.cloud.alloydb.v1alpha.CreateSecondaryInstanceRequest; +import com.google.cloud.alloydb.v1alpha.CreateUserRequest; import com.google.cloud.alloydb.v1alpha.DeleteBackupRequest; import com.google.cloud.alloydb.v1alpha.DeleteClusterRequest; import com.google.cloud.alloydb.v1alpha.DeleteInstanceRequest; +import com.google.cloud.alloydb.v1alpha.DeleteUserRequest; import com.google.cloud.alloydb.v1alpha.FailoverInstanceRequest; import com.google.cloud.alloydb.v1alpha.GenerateClientCertificateRequest; import com.google.cloud.alloydb.v1alpha.GenerateClientCertificateResponse; @@ -59,6 +62,8 @@ import com.google.cloud.alloydb.v1alpha.GetClusterRequest; import com.google.cloud.alloydb.v1alpha.GetConnectionInfoRequest; import com.google.cloud.alloydb.v1alpha.GetInstanceRequest; +import com.google.cloud.alloydb.v1alpha.GetUserRequest; +import com.google.cloud.alloydb.v1alpha.InjectFaultRequest; import com.google.cloud.alloydb.v1alpha.Instance; import com.google.cloud.alloydb.v1alpha.ListBackupsRequest; import com.google.cloud.alloydb.v1alpha.ListBackupsResponse; @@ -68,6 +73,8 @@ import com.google.cloud.alloydb.v1alpha.ListInstancesResponse; import com.google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsRequest; import com.google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsResponse; +import com.google.cloud.alloydb.v1alpha.ListUsersRequest; +import com.google.cloud.alloydb.v1alpha.ListUsersResponse; import com.google.cloud.alloydb.v1alpha.OperationMetadata; import com.google.cloud.alloydb.v1alpha.PromoteClusterRequest; import com.google.cloud.alloydb.v1alpha.RestartInstanceRequest; @@ -75,6 +82,8 @@ import com.google.cloud.alloydb.v1alpha.UpdateBackupRequest; import com.google.cloud.alloydb.v1alpha.UpdateClusterRequest; import com.google.cloud.alloydb.v1alpha.UpdateInstanceRequest; +import com.google.cloud.alloydb.v1alpha.UpdateUserRequest; +import com.google.cloud.alloydb.v1alpha.User; import com.google.cloud.location.GetLocationRequest; import com.google.cloud.location.ListLocationsRequest; import com.google.cloud.location.ListLocationsResponse; @@ -169,6 +178,7 @@ public class HttpJsonAlloyDBAdminStub extends AlloyDBAdminStub { Map> fields = new HashMap<>(); ProtoRestSerializer serializer = ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "view", request.getViewValue()); serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); return fields; }) @@ -769,6 +779,46 @@ public class HttpJsonAlloyDBAdminStub extends AlloyDBAdminStub { HttpJsonOperationSnapshot.create(response)) .build(); + private static final ApiMethodDescriptor + injectFaultMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.alloydb.v1alpha.AlloyDBAdmin/InjectFault") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1alpha/{name=projects/*/locations/*/clusters/*/instances/*}:injectFault", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("*", request.toBuilder().clearName().build(), true)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .setOperationSnapshotFactory( + (InjectFaultRequest request, Operation response) -> + HttpJsonOperationSnapshot.create(response)) + .build(); + private static final ApiMethodDescriptor restartInstanceMethodDescriptor = ApiMethodDescriptor.newBuilder() @@ -1126,6 +1176,189 @@ public class HttpJsonAlloyDBAdminStub extends AlloyDBAdminStub { .build()) .build(); + private static final ApiMethodDescriptor + listUsersMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.alloydb.v1alpha.AlloyDBAdmin/ListUsers") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1alpha/{parent=projects/*/locations/*/clusters/*}/users", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "parent", request.getParent()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "filter", request.getFilter()); + serializer.putQueryParam(fields, "orderBy", request.getOrderBy()); + serializer.putQueryParam(fields, "pageSize", request.getPageSize()); + serializer.putQueryParam(fields, "pageToken", request.getPageToken()); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(ListUsersResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor getUserMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.alloydb.v1alpha.AlloyDBAdmin/GetUser") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1alpha/{name=projects/*/locations/*/clusters/*/users/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(User.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor createUserMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.alloydb.v1alpha.AlloyDBAdmin/CreateUser") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1alpha/{parent=projects/*/locations/*/clusters/*}/users", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "parent", request.getParent()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "requestId", request.getRequestId()); + serializer.putQueryParam(fields, "userId", request.getUserId()); + serializer.putQueryParam(fields, "validateOnly", request.getValidateOnly()); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create().toBody("user", request.getUser(), true)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(User.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor updateUserMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.alloydb.v1alpha.AlloyDBAdmin/UpdateUser") + .setHttpMethod("PATCH") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1alpha/{user.name=projects/*/locations/*/clusters/*/users/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "user.name", request.getUser().getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "allowMissing", request.getAllowMissing()); + serializer.putQueryParam(fields, "requestId", request.getRequestId()); + serializer.putQueryParam(fields, "updateMask", request.getUpdateMask()); + serializer.putQueryParam(fields, "validateOnly", request.getValidateOnly()); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create().toBody("user", request.getUser(), true)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(User.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor deleteUserMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.alloydb.v1alpha.AlloyDBAdmin/DeleteUser") + .setHttpMethod("DELETE") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1alpha/{name=projects/*/locations/*/clusters/*/users/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "requestId", request.getRequestId()); + serializer.putQueryParam(fields, "validateOnly", request.getValidateOnly()); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Empty.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + private static final ApiMethodDescriptor listLocationsMethodDescriptor = ApiMethodDescriptor.newBuilder() @@ -1241,6 +1474,9 @@ public class HttpJsonAlloyDBAdminStub extends AlloyDBAdminStub { private final UnaryCallable failoverInstanceCallable; private final OperationCallable failoverInstanceOperationCallable; + private final UnaryCallable injectFaultCallable; + private final OperationCallable + injectFaultOperationCallable; private final UnaryCallable restartInstanceCallable; private final OperationCallable restartInstanceOperationCallable; @@ -1265,6 +1501,12 @@ public class HttpJsonAlloyDBAdminStub extends AlloyDBAdminStub { private final UnaryCallable generateClientCertificateCallable; private final UnaryCallable getConnectionInfoCallable; + private final UnaryCallable listUsersCallable; + private final UnaryCallable listUsersPagedCallable; + private final UnaryCallable getUserCallable; + private final UnaryCallable createUserCallable; + private final UnaryCallable updateUserCallable; + private final UnaryCallable deleteUserCallable; private final UnaryCallable listLocationsCallable; private final UnaryCallable listLocationsPagedCallable; @@ -1520,6 +1762,17 @@ protected HttpJsonAlloyDBAdminStub( return builder.build(); }) .build(); + HttpJsonCallSettings injectFaultTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(injectFaultMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); HttpJsonCallSettings restartInstanceTransportSettings = HttpJsonCallSettings.newBuilder() .setMethodDescriptor(restartInstanceMethodDescriptor) @@ -1624,6 +1877,61 @@ protected HttpJsonAlloyDBAdminStub( return builder.build(); }) .build(); + HttpJsonCallSettings listUsersTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(listUsersMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings getUserTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getUserMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings createUserTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(createUserMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings updateUserTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(updateUserMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("user.name", String.valueOf(request.getUser().getName())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings deleteUserTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(deleteUserMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); HttpJsonCallSettings listLocationsTransportSettings = HttpJsonCallSettings.newBuilder() @@ -1780,6 +2088,15 @@ protected HttpJsonAlloyDBAdminStub( settings.failoverInstanceOperationSettings(), clientContext, httpJsonOperationsStub); + this.injectFaultCallable = + callableFactory.createUnaryCallable( + injectFaultTransportSettings, settings.injectFaultSettings(), clientContext); + this.injectFaultOperationCallable = + callableFactory.createOperationCallable( + injectFaultTransportSettings, + settings.injectFaultOperationSettings(), + clientContext, + httpJsonOperationsStub); this.restartInstanceCallable = callableFactory.createUnaryCallable( restartInstanceTransportSettings, settings.restartInstanceSettings(), clientContext); @@ -1845,6 +2162,24 @@ protected HttpJsonAlloyDBAdminStub( getConnectionInfoTransportSettings, settings.getConnectionInfoSettings(), clientContext); + this.listUsersCallable = + callableFactory.createUnaryCallable( + listUsersTransportSettings, settings.listUsersSettings(), clientContext); + this.listUsersPagedCallable = + callableFactory.createPagedCallable( + listUsersTransportSettings, settings.listUsersSettings(), clientContext); + this.getUserCallable = + callableFactory.createUnaryCallable( + getUserTransportSettings, settings.getUserSettings(), clientContext); + this.createUserCallable = + callableFactory.createUnaryCallable( + createUserTransportSettings, settings.createUserSettings(), clientContext); + this.updateUserCallable = + callableFactory.createUnaryCallable( + updateUserTransportSettings, settings.updateUserSettings(), clientContext); + this.deleteUserCallable = + callableFactory.createUnaryCallable( + deleteUserTransportSettings, settings.deleteUserSettings(), clientContext); this.listLocationsCallable = callableFactory.createUnaryCallable( listLocationsTransportSettings, settings.listLocationsSettings(), clientContext); @@ -1878,6 +2213,7 @@ public static List getMethodDescriptors() { methodDescriptors.add(updateInstanceMethodDescriptor); methodDescriptors.add(deleteInstanceMethodDescriptor); methodDescriptors.add(failoverInstanceMethodDescriptor); + methodDescriptors.add(injectFaultMethodDescriptor); methodDescriptors.add(restartInstanceMethodDescriptor); methodDescriptors.add(listBackupsMethodDescriptor); methodDescriptors.add(getBackupMethodDescriptor); @@ -1887,6 +2223,11 @@ public static List getMethodDescriptors() { methodDescriptors.add(listSupportedDatabaseFlagsMethodDescriptor); methodDescriptors.add(generateClientCertificateMethodDescriptor); methodDescriptors.add(getConnectionInfoMethodDescriptor); + methodDescriptors.add(listUsersMethodDescriptor); + methodDescriptors.add(getUserMethodDescriptor); + methodDescriptors.add(createUserMethodDescriptor); + methodDescriptors.add(updateUserMethodDescriptor); + methodDescriptors.add(deleteUserMethodDescriptor); methodDescriptors.add(listLocationsMethodDescriptor); methodDescriptors.add(getLocationMethodDescriptor); return methodDescriptors; @@ -2061,6 +2402,17 @@ public UnaryCallable failoverInstanceCallabl return failoverInstanceOperationCallable; } + @Override + public UnaryCallable injectFaultCallable() { + return injectFaultCallable; + } + + @Override + public OperationCallable + injectFaultOperationCallable() { + return injectFaultOperationCallable; + } + @Override public UnaryCallable restartInstanceCallable() { return restartInstanceCallable; @@ -2143,6 +2495,36 @@ public UnaryCallable getConnectionInfo return getConnectionInfoCallable; } + @Override + public UnaryCallable listUsersCallable() { + return listUsersCallable; + } + + @Override + public UnaryCallable listUsersPagedCallable() { + return listUsersPagedCallable; + } + + @Override + public UnaryCallable getUserCallable() { + return getUserCallable; + } + + @Override + public UnaryCallable createUserCallable() { + return createUserCallable; + } + + @Override + public UnaryCallable updateUserCallable() { + return updateUserCallable; + } + + @Override + public UnaryCallable deleteUserCallable() { + return deleteUserCallable; + } + @Override public UnaryCallable listLocationsCallable() { return listLocationsCallable; diff --git a/java-alloydb/google-cloud-alloydb/src/main/java/com/google/cloud/alloydb/v1beta/AlloyDBAdminClient.java b/java-alloydb/google-cloud-alloydb/src/main/java/com/google/cloud/alloydb/v1beta/AlloyDBAdminClient.java index 396980be1260..655f31e96aa4 100644 --- a/java-alloydb/google-cloud-alloydb/src/main/java/com/google/cloud/alloydb/v1beta/AlloyDBAdminClient.java +++ b/java-alloydb/google-cloud-alloydb/src/main/java/com/google/cloud/alloydb/v1beta/AlloyDBAdminClient.java @@ -451,6 +451,7 @@ public final Cluster getCluster(String name) { * GetClusterRequest request = * GetClusterRequest.newBuilder() * .setName(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString()) + * .setView(ClusterView.forNumber(0)) * .build(); * Cluster response = alloyDBAdminClient.getCluster(request); * } @@ -479,6 +480,7 @@ public final Cluster getCluster(GetClusterRequest request) { * GetClusterRequest request = * GetClusterRequest.newBuilder() * .setName(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString()) + * .setView(ClusterView.forNumber(0)) * .build(); * ApiFuture future = alloyDBAdminClient.getClusterCallable().futureCall(request); * // Do something. @@ -510,7 +512,7 @@ public final UnaryCallable getClusterCallable() { * } * } * - * @param parent Required. The name of the parent resource. For the required format, see the + * @param parent Required. The location of the new cluster. For the required format, see the * comment on the Cluster.name field. * @param cluster Required. The resource being created * @param clusterId Required. ID of the requesting object. @@ -547,7 +549,7 @@ public final OperationFuture createClusterAsync( * } * } * - * @param parent Required. The name of the parent resource. For the required format, see the + * @param parent Required. The location of the new cluster. For the required format, see the * comment on the Cluster.name field. * @param cluster Required. The resource being created * @param clusterId Required. ID of the requesting object. @@ -1219,8 +1221,8 @@ public final UnaryCallable restoreClusterCalla * } * } * - * @param parent Required. The name of the parent resource (the primary cluster). For the required - * format, see the comment on the Cluster.name field. + * @param parent Required. The location of the new cluster. For the required format, see the + * comment on the Cluster.name field. * @param cluster Required. Configuration of the requesting object (the secondary cluster). * @param clusterId Required. ID of the requesting object (the secondary cluster). * @throws com.google.api.gax.rpc.ApiException if the remote call fails @@ -1258,8 +1260,8 @@ public final OperationFuture createSecondaryClusterA * } * } * - * @param parent Required. The name of the parent resource (the primary cluster). For the required - * format, see the comment on the Cluster.name field. + * @param parent Required. The location of the new cluster. For the required format, see the + * comment on the Cluster.name field. * @param cluster Required. Configuration of the requesting object (the secondary cluster). * @param clusterId Required. ID of the requesting object (the secondary cluster). * @throws com.google.api.gax.rpc.ApiException if the remote call fails @@ -2569,6 +2571,166 @@ public final UnaryCallable failoverInstanceC return stub.failoverInstanceCallable(); } + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Injects fault in an instance. Imperative only. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   InjectFaultRequest.FaultType faultType = InjectFaultRequest.FaultType.forNumber(0);
+   *   InstanceName name = InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]");
+   *   Instance response = alloyDBAdminClient.injectFaultAsync(faultType, name).get();
+   * }
+   * }
+ * + * @param faultType Required. The type of fault to be injected in an instance. + * @param name Required. The name of the resource. For the required format, see the comment on the + * Instance.name field. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture injectFaultAsync( + InjectFaultRequest.FaultType faultType, InstanceName name) { + InjectFaultRequest request = + InjectFaultRequest.newBuilder() + .setFaultType(faultType) + .setName(name == null ? null : name.toString()) + .build(); + return injectFaultAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Injects fault in an instance. Imperative only. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   InjectFaultRequest.FaultType faultType = InjectFaultRequest.FaultType.forNumber(0);
+   *   String name =
+   *       InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]").toString();
+   *   Instance response = alloyDBAdminClient.injectFaultAsync(faultType, name).get();
+   * }
+   * }
+ * + * @param faultType Required. The type of fault to be injected in an instance. + * @param name Required. The name of the resource. For the required format, see the comment on the + * Instance.name field. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture injectFaultAsync( + InjectFaultRequest.FaultType faultType, String name) { + InjectFaultRequest request = + InjectFaultRequest.newBuilder().setFaultType(faultType).setName(name).build(); + return injectFaultAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Injects fault in an instance. Imperative only. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   InjectFaultRequest request =
+   *       InjectFaultRequest.newBuilder()
+   *           .setName(
+   *               InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]").toString())
+   *           .setRequestId("requestId693933066")
+   *           .setValidateOnly(true)
+   *           .build();
+   *   Instance response = alloyDBAdminClient.injectFaultAsync(request).get();
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture injectFaultAsync( + InjectFaultRequest request) { + return injectFaultOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Injects fault in an instance. Imperative only. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   InjectFaultRequest request =
+   *       InjectFaultRequest.newBuilder()
+   *           .setName(
+   *               InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]").toString())
+   *           .setRequestId("requestId693933066")
+   *           .setValidateOnly(true)
+   *           .build();
+   *   OperationFuture future =
+   *       alloyDBAdminClient.injectFaultOperationCallable().futureCall(request);
+   *   // Do something.
+   *   Instance response = future.get();
+   * }
+   * }
+ */ + public final OperationCallable + injectFaultOperationCallable() { + return stub.injectFaultOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Injects fault in an instance. Imperative only. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   InjectFaultRequest request =
+   *       InjectFaultRequest.newBuilder()
+   *           .setName(
+   *               InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]").toString())
+   *           .setRequestId("requestId693933066")
+   *           .setValidateOnly(true)
+   *           .build();
+   *   ApiFuture future = alloyDBAdminClient.injectFaultCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable injectFaultCallable() { + return stub.injectFaultCallable(); + } + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Restart an Instance in a cluster. Imperative only. @@ -3711,6 +3873,7 @@ public final GenerateClientCertificateResponse generateClientCertificate(String * .setRequestId("requestId693933066") * .setPemCsr("pemCsr-991911478") * .setCertDuration(Duration.newBuilder().build()) + * .setPublicKey("publicKey1446899510") * .build(); * GenerateClientCertificateResponse response = * alloyDBAdminClient.generateClientCertificate(request); @@ -3747,6 +3910,7 @@ public final GenerateClientCertificateResponse generateClientCertificate( * .setRequestId("requestId693933066") * .setPemCsr("pemCsr-991911478") * .setCertDuration(Duration.newBuilder().build()) + * .setPublicKey("publicKey1446899510") * .build(); * ApiFuture future = * alloyDBAdminClient.generateClientCertificateCallable().futureCall(request); @@ -3881,7 +4045,7 @@ public final UnaryCallable getConnecti // AUTO-GENERATED DOCUMENTATION AND METHOD. /** - * Lists information about the supported locations for this service. + * Lists Users in a given project and location. * *

Sample code: * @@ -3892,14 +4056,72 @@ public final UnaryCallable getConnecti * // - It may require specifying regional endpoints when creating the service client as shown in * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library * try (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { - * ListLocationsRequest request = - * ListLocationsRequest.newBuilder() - * .setName("name3373707") - * .setFilter("filter-1274492040") + * ClusterName parent = ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]"); + * for (User element : alloyDBAdminClient.listUsers(parent).iterateAll()) { + * // doThingsWith(element); + * } + * } + * } + * + * @param parent Required. Parent value for ListUsersRequest + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListUsersPagedResponse listUsers(ClusterName parent) { + ListUsersRequest request = + ListUsersRequest.newBuilder().setParent(parent == null ? null : parent.toString()).build(); + return listUsers(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists Users in a given project and location. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   String parent = ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString();
+   *   for (User element : alloyDBAdminClient.listUsers(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param parent Required. Parent value for ListUsersRequest + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListUsersPagedResponse listUsers(String parent) { + ListUsersRequest request = ListUsersRequest.newBuilder().setParent(parent).build(); + return listUsers(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists Users in a given project and location. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   ListUsersRequest request =
+   *       ListUsersRequest.newBuilder()
+   *           .setParent(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString())
    *           .setPageSize(883849137)
    *           .setPageToken("pageToken873572522")
+   *           .setFilter("filter-1274492040")
+   *           .setOrderBy("orderBy-1207110587")
    *           .build();
-   *   for (Location element : alloyDBAdminClient.listLocations(request).iterateAll()) {
+   *   for (User element : alloyDBAdminClient.listUsers(request).iterateAll()) {
    *     // doThingsWith(element);
    *   }
    * }
@@ -3908,13 +4130,13 @@ public final UnaryCallable getConnecti
    * @param request The request object containing all of the parameters for the API call.
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
-  public final ListLocationsPagedResponse listLocations(ListLocationsRequest request) {
-    return listLocationsPagedCallable().call(request);
+  public final ListUsersPagedResponse listUsers(ListUsersRequest request) {
+    return listUsersPagedCallable().call(request);
   }
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD.
   /**
-   * Lists information about the supported locations for this service.
+   * Lists Users in a given project and location.
    *
    * 

Sample code: * @@ -3925,30 +4147,29 @@ public final ListLocationsPagedResponse listLocations(ListLocationsRequest reque * // - It may require specifying regional endpoints when creating the service client as shown in * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library * try (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { - * ListLocationsRequest request = - * ListLocationsRequest.newBuilder() - * .setName("name3373707") - * .setFilter("filter-1274492040") + * ListUsersRequest request = + * ListUsersRequest.newBuilder() + * .setParent(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString()) * .setPageSize(883849137) * .setPageToken("pageToken873572522") + * .setFilter("filter-1274492040") + * .setOrderBy("orderBy-1207110587") * .build(); - * ApiFuture future = - * alloyDBAdminClient.listLocationsPagedCallable().futureCall(request); + * ApiFuture future = alloyDBAdminClient.listUsersPagedCallable().futureCall(request); * // Do something. - * for (Location element : future.get().iterateAll()) { + * for (User element : future.get().iterateAll()) { * // doThingsWith(element); * } * } * }

*/ - public final UnaryCallable - listLocationsPagedCallable() { - return stub.listLocationsPagedCallable(); + public final UnaryCallable listUsersPagedCallable() { + return stub.listUsersPagedCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** - * Lists information about the supported locations for this service. + * Lists Users in a given project and location. * *

Sample code: * @@ -3959,16 +4180,17 @@ public final ListLocationsPagedResponse listLocations(ListLocationsRequest reque * // - It may require specifying regional endpoints when creating the service client as shown in * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library * try (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { - * ListLocationsRequest request = - * ListLocationsRequest.newBuilder() - * .setName("name3373707") - * .setFilter("filter-1274492040") + * ListUsersRequest request = + * ListUsersRequest.newBuilder() + * .setParent(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString()) * .setPageSize(883849137) * .setPageToken("pageToken873572522") + * .setFilter("filter-1274492040") + * .setOrderBy("orderBy-1207110587") * .build(); * while (true) { - * ListLocationsResponse response = alloyDBAdminClient.listLocationsCallable().call(request); - * for (Location element : response.getLocationsList()) { + * ListUsersResponse response = alloyDBAdminClient.listUsersCallable().call(request); + * for (User element : response.getUsersList()) { * // doThingsWith(element); * } * String nextPageToken = response.getNextPageToken(); @@ -3981,13 +4203,13 @@ public final ListLocationsPagedResponse listLocations(ListLocationsRequest reque * } * } */ - public final UnaryCallable listLocationsCallable() { - return stub.listLocationsCallable(); + public final UnaryCallable listUsersCallable() { + return stub.listUsersCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** - * Gets information about a location. + * Gets details of a single User. * *

Sample code: * @@ -3998,21 +4220,24 @@ public final UnaryCallable listLoca * // - It may require specifying regional endpoints when creating the service client as shown in * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library * try (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { - * GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build(); - * Location response = alloyDBAdminClient.getLocation(request); + * UserName name = UserName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[USER]"); + * User response = alloyDBAdminClient.getUser(name); * } * } * - * @param request The request object containing all of the parameters for the API call. + * @param name Required. The name of the resource. For the required format, see the comment on the + * User.name field. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - public final Location getLocation(GetLocationRequest request) { - return getLocationCallable().call(request); + public final User getUser(UserName name) { + GetUserRequest request = + GetUserRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + return getUser(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** - * Gets information about a location. + * Gets details of a single User. * *

Sample code: * @@ -4023,34 +4248,585 @@ public final Location getLocation(GetLocationRequest request) { * // - It may require specifying regional endpoints when creating the service client as shown in * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library * try (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { - * GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build(); - * ApiFuture future = alloyDBAdminClient.getLocationCallable().futureCall(request); - * // Do something. - * Location response = future.get(); + * String name = UserName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[USER]").toString(); + * User response = alloyDBAdminClient.getUser(name); * } * } + * + * @param name Required. The name of the resource. For the required format, see the comment on the + * User.name field. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - public final UnaryCallable getLocationCallable() { - return stub.getLocationCallable(); - } - - @Override - public final void close() { - stub.close(); - } - - @Override - public void shutdown() { - stub.shutdown(); + public final User getUser(String name) { + GetUserRequest request = GetUserRequest.newBuilder().setName(name).build(); + return getUser(request); } - @Override - public boolean isShutdown() { - return stub.isShutdown(); + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets details of a single User. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   GetUserRequest request =
+   *       GetUserRequest.newBuilder()
+   *           .setName(UserName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[USER]").toString())
+   *           .build();
+   *   User response = alloyDBAdminClient.getUser(request);
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final User getUser(GetUserRequest request) { + return getUserCallable().call(request); } - @Override - public boolean isTerminated() { + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets details of a single User. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   GetUserRequest request =
+   *       GetUserRequest.newBuilder()
+   *           .setName(UserName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[USER]").toString())
+   *           .build();
+   *   ApiFuture future = alloyDBAdminClient.getUserCallable().futureCall(request);
+   *   // Do something.
+   *   User response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable getUserCallable() { + return stub.getUserCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a new User in a given project, location, and cluster. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   ClusterName parent = ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]");
+   *   User user = User.newBuilder().build();
+   *   String userId = "userId-836030906";
+   *   User response = alloyDBAdminClient.createUser(parent, user, userId);
+   * }
+   * }
+ * + * @param parent Required. Value for parent. + * @param user Required. The resource being created + * @param userId Required. ID of the requesting object. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final User createUser(ClusterName parent, User user, String userId) { + CreateUserRequest request = + CreateUserRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .setUser(user) + .setUserId(userId) + .build(); + return createUser(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a new User in a given project, location, and cluster. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   String parent = ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString();
+   *   User user = User.newBuilder().build();
+   *   String userId = "userId-836030906";
+   *   User response = alloyDBAdminClient.createUser(parent, user, userId);
+   * }
+   * }
+ * + * @param parent Required. Value for parent. + * @param user Required. The resource being created + * @param userId Required. ID of the requesting object. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final User createUser(String parent, User user, String userId) { + CreateUserRequest request = + CreateUserRequest.newBuilder().setParent(parent).setUser(user).setUserId(userId).build(); + return createUser(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a new User in a given project, location, and cluster. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   CreateUserRequest request =
+   *       CreateUserRequest.newBuilder()
+   *           .setParent(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString())
+   *           .setUserId("userId-836030906")
+   *           .setUser(User.newBuilder().build())
+   *           .setRequestId("requestId693933066")
+   *           .setValidateOnly(true)
+   *           .build();
+   *   User response = alloyDBAdminClient.createUser(request);
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final User createUser(CreateUserRequest request) { + return createUserCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a new User in a given project, location, and cluster. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   CreateUserRequest request =
+   *       CreateUserRequest.newBuilder()
+   *           .setParent(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString())
+   *           .setUserId("userId-836030906")
+   *           .setUser(User.newBuilder().build())
+   *           .setRequestId("requestId693933066")
+   *           .setValidateOnly(true)
+   *           .build();
+   *   ApiFuture future = alloyDBAdminClient.createUserCallable().futureCall(request);
+   *   // Do something.
+   *   User response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable createUserCallable() { + return stub.createUserCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates the parameters of a single User. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   User user = User.newBuilder().build();
+   *   FieldMask updateMask = FieldMask.newBuilder().build();
+   *   User response = alloyDBAdminClient.updateUser(user, updateMask);
+   * }
+   * }
+ * + * @param user Required. The resource being updated + * @param 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. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final User updateUser(User user, FieldMask updateMask) { + UpdateUserRequest request = + UpdateUserRequest.newBuilder().setUser(user).setUpdateMask(updateMask).build(); + return updateUser(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates the parameters of a single User. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   UpdateUserRequest request =
+   *       UpdateUserRequest.newBuilder()
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .setUser(User.newBuilder().build())
+   *           .setRequestId("requestId693933066")
+   *           .setValidateOnly(true)
+   *           .setAllowMissing(true)
+   *           .build();
+   *   User response = alloyDBAdminClient.updateUser(request);
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final User updateUser(UpdateUserRequest request) { + return updateUserCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates the parameters of a single User. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   UpdateUserRequest request =
+   *       UpdateUserRequest.newBuilder()
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .setUser(User.newBuilder().build())
+   *           .setRequestId("requestId693933066")
+   *           .setValidateOnly(true)
+   *           .setAllowMissing(true)
+   *           .build();
+   *   ApiFuture future = alloyDBAdminClient.updateUserCallable().futureCall(request);
+   *   // Do something.
+   *   User response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable updateUserCallable() { + return stub.updateUserCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a single User. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   UserName name = UserName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[USER]");
+   *   alloyDBAdminClient.deleteUser(name);
+   * }
+   * }
+ * + * @param name Required. The name of the resource. For the required format, see the comment on the + * User.name field. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void deleteUser(UserName name) { + DeleteUserRequest request = + DeleteUserRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + deleteUser(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a single User. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   String name = UserName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[USER]").toString();
+   *   alloyDBAdminClient.deleteUser(name);
+   * }
+   * }
+ * + * @param name Required. The name of the resource. For the required format, see the comment on the + * User.name field. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void deleteUser(String name) { + DeleteUserRequest request = DeleteUserRequest.newBuilder().setName(name).build(); + deleteUser(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a single User. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   DeleteUserRequest request =
+   *       DeleteUserRequest.newBuilder()
+   *           .setName(UserName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[USER]").toString())
+   *           .setRequestId("requestId693933066")
+   *           .setValidateOnly(true)
+   *           .build();
+   *   alloyDBAdminClient.deleteUser(request);
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void deleteUser(DeleteUserRequest request) { + deleteUserCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a single User. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   DeleteUserRequest request =
+   *       DeleteUserRequest.newBuilder()
+   *           .setName(UserName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[USER]").toString())
+   *           .setRequestId("requestId693933066")
+   *           .setValidateOnly(true)
+   *           .build();
+   *   ApiFuture future = alloyDBAdminClient.deleteUserCallable().futureCall(request);
+   *   // Do something.
+   *   future.get();
+   * }
+   * }
+ */ + public final UnaryCallable deleteUserCallable() { + return stub.deleteUserCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists information about the supported locations for this service. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   ListLocationsRequest request =
+   *       ListLocationsRequest.newBuilder()
+   *           .setName("name3373707")
+   *           .setFilter("filter-1274492040")
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   for (Location element : alloyDBAdminClient.listLocations(request).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListLocationsPagedResponse listLocations(ListLocationsRequest request) { + return listLocationsPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists information about the supported locations for this service. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   ListLocationsRequest request =
+   *       ListLocationsRequest.newBuilder()
+   *           .setName("name3373707")
+   *           .setFilter("filter-1274492040")
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   ApiFuture future =
+   *       alloyDBAdminClient.listLocationsPagedCallable().futureCall(request);
+   *   // Do something.
+   *   for (Location element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable + listLocationsPagedCallable() { + return stub.listLocationsPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists information about the supported locations for this service. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   ListLocationsRequest request =
+   *       ListLocationsRequest.newBuilder()
+   *           .setName("name3373707")
+   *           .setFilter("filter-1274492040")
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   while (true) {
+   *     ListLocationsResponse response = alloyDBAdminClient.listLocationsCallable().call(request);
+   *     for (Location element : response.getLocationsList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable listLocationsCallable() { + return stub.listLocationsCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets information about a location. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build();
+   *   Location response = alloyDBAdminClient.getLocation(request);
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Location getLocation(GetLocationRequest request) { + return getLocationCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets information about a location. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
+   *   GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build();
+   *   ApiFuture future = alloyDBAdminClient.getLocationCallable().futureCall(request);
+   *   // Do something.
+   *   Location response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable getLocationCallable() { + return stub.getLocationCallable(); + } + + @Override + public final void close() { + stub.close(); + } + + @Override + public void shutdown() { + stub.shutdown(); + } + + @Override + public boolean isShutdown() { + return stub.isShutdown(); + } + + @Override + public boolean isTerminated() { return stub.isTerminated(); } @@ -4384,6 +5160,71 @@ protected ListSupportedDatabaseFlagsFixedSizeCollection createCollection( } } + public static class ListUsersPagedResponse + extends AbstractPagedListResponse< + ListUsersRequest, ListUsersResponse, User, ListUsersPage, ListUsersFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListUsersPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, input -> new ListUsersPagedResponse(input), MoreExecutors.directExecutor()); + } + + private ListUsersPagedResponse(ListUsersPage page) { + super(page, ListUsersFixedSizeCollection.createEmptyCollection()); + } + } + + public static class ListUsersPage + extends AbstractPage { + + private ListUsersPage( + PageContext context, + ListUsersResponse response) { + super(context, response); + } + + private static ListUsersPage createEmptyPage() { + return new ListUsersPage(null, null); + } + + @Override + protected ListUsersPage createPage( + PageContext context, + ListUsersResponse response) { + return new ListUsersPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class ListUsersFixedSizeCollection + extends AbstractFixedSizeCollection< + ListUsersRequest, ListUsersResponse, User, ListUsersPage, ListUsersFixedSizeCollection> { + + private ListUsersFixedSizeCollection(List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListUsersFixedSizeCollection createEmptyCollection() { + return new ListUsersFixedSizeCollection(null, 0); + } + + @Override + protected ListUsersFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListUsersFixedSizeCollection(pages, collectionSize); + } + } + public static class ListLocationsPagedResponse extends AbstractPagedListResponse< ListLocationsRequest, diff --git a/java-alloydb/google-cloud-alloydb/src/main/java/com/google/cloud/alloydb/v1beta/AlloyDBAdminSettings.java b/java-alloydb/google-cloud-alloydb/src/main/java/com/google/cloud/alloydb/v1beta/AlloyDBAdminSettings.java index 4d5174b7e3e2..9b56899d9f78 100644 --- a/java-alloydb/google-cloud-alloydb/src/main/java/com/google/cloud/alloydb/v1beta/AlloyDBAdminSettings.java +++ b/java-alloydb/google-cloud-alloydb/src/main/java/com/google/cloud/alloydb/v1beta/AlloyDBAdminSettings.java @@ -21,6 +21,7 @@ import static com.google.cloud.alloydb.v1beta.AlloyDBAdminClient.ListInstancesPagedResponse; import static com.google.cloud.alloydb.v1beta.AlloyDBAdminClient.ListLocationsPagedResponse; import static com.google.cloud.alloydb.v1beta.AlloyDBAdminClient.ListSupportedDatabaseFlagsPagedResponse; +import static com.google.cloud.alloydb.v1beta.AlloyDBAdminClient.ListUsersPagedResponse; import com.google.api.core.ApiFunction; import com.google.api.core.BetaApi; @@ -244,6 +245,17 @@ public UnaryCallSettings failoverInstanceSet return ((AlloyDBAdminStubSettings) getStubSettings()).failoverInstanceOperationSettings(); } + /** Returns the object with the settings used for calls to injectFault. */ + public UnaryCallSettings injectFaultSettings() { + return ((AlloyDBAdminStubSettings) getStubSettings()).injectFaultSettings(); + } + + /** Returns the object with the settings used for calls to injectFault. */ + public OperationCallSettings + injectFaultOperationSettings() { + return ((AlloyDBAdminStubSettings) getStubSettings()).injectFaultOperationSettings(); + } + /** Returns the object with the settings used for calls to restartInstance. */ public UnaryCallSettings restartInstanceSettings() { return ((AlloyDBAdminStubSettings) getStubSettings()).restartInstanceSettings(); @@ -319,6 +331,32 @@ public UnaryCallSettings getConnection return ((AlloyDBAdminStubSettings) getStubSettings()).getConnectionInfoSettings(); } + /** Returns the object with the settings used for calls to listUsers. */ + public PagedCallSettings + listUsersSettings() { + return ((AlloyDBAdminStubSettings) getStubSettings()).listUsersSettings(); + } + + /** Returns the object with the settings used for calls to getUser. */ + public UnaryCallSettings getUserSettings() { + return ((AlloyDBAdminStubSettings) getStubSettings()).getUserSettings(); + } + + /** Returns the object with the settings used for calls to createUser. */ + public UnaryCallSettings createUserSettings() { + return ((AlloyDBAdminStubSettings) getStubSettings()).createUserSettings(); + } + + /** Returns the object with the settings used for calls to updateUser. */ + public UnaryCallSettings updateUserSettings() { + return ((AlloyDBAdminStubSettings) getStubSettings()).updateUserSettings(); + } + + /** Returns the object with the settings used for calls to deleteUser. */ + public UnaryCallSettings deleteUserSettings() { + return ((AlloyDBAdminStubSettings) getStubSettings()).deleteUserSettings(); + } + /** Returns the object with the settings used for calls to listLocations. */ public PagedCallSettings listLocationsSettings() { @@ -607,6 +645,17 @@ public UnaryCallSettings.Builder deleteInstanc return getStubSettingsBuilder().failoverInstanceOperationSettings(); } + /** Returns the builder for the settings used for calls to injectFault. */ + public UnaryCallSettings.Builder injectFaultSettings() { + return getStubSettingsBuilder().injectFaultSettings(); + } + + /** Returns the builder for the settings used for calls to injectFault. */ + public OperationCallSettings.Builder + injectFaultOperationSettings() { + return getStubSettingsBuilder().injectFaultOperationSettings(); + } + /** Returns the builder for the settings used for calls to restartInstance. */ public UnaryCallSettings.Builder restartInstanceSettings() { return getStubSettingsBuilder().restartInstanceSettings(); @@ -685,6 +734,32 @@ public UnaryCallSettings.Builder deleteBackupSet return getStubSettingsBuilder().getConnectionInfoSettings(); } + /** Returns the builder for the settings used for calls to listUsers. */ + public PagedCallSettings.Builder + listUsersSettings() { + return getStubSettingsBuilder().listUsersSettings(); + } + + /** Returns the builder for the settings used for calls to getUser. */ + public UnaryCallSettings.Builder getUserSettings() { + return getStubSettingsBuilder().getUserSettings(); + } + + /** Returns the builder for the settings used for calls to createUser. */ + public UnaryCallSettings.Builder createUserSettings() { + return getStubSettingsBuilder().createUserSettings(); + } + + /** Returns the builder for the settings used for calls to updateUser. */ + public UnaryCallSettings.Builder updateUserSettings() { + return getStubSettingsBuilder().updateUserSettings(); + } + + /** Returns the builder for the settings used for calls to deleteUser. */ + public UnaryCallSettings.Builder deleteUserSettings() { + return getStubSettingsBuilder().deleteUserSettings(); + } + /** Returns the builder for the settings used for calls to listLocations. */ public PagedCallSettings.Builder< ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse> diff --git a/java-alloydb/google-cloud-alloydb/src/main/java/com/google/cloud/alloydb/v1beta/gapic_metadata.json b/java-alloydb/google-cloud-alloydb/src/main/java/com/google/cloud/alloydb/v1beta/gapic_metadata.json index 9c382fa594ab..d1a5059c22fb 100644 --- a/java-alloydb/google-cloud-alloydb/src/main/java/com/google/cloud/alloydb/v1beta/gapic_metadata.json +++ b/java-alloydb/google-cloud-alloydb/src/main/java/com/google/cloud/alloydb/v1beta/gapic_metadata.json @@ -28,6 +28,9 @@ "CreateSecondaryInstance": { "methods": ["createSecondaryInstanceAsync", "createSecondaryInstanceAsync", "createSecondaryInstanceAsync", "createSecondaryInstanceOperationCallable", "createSecondaryInstanceCallable"] }, + "CreateUser": { + "methods": ["createUser", "createUser", "createUser", "createUserCallable"] + }, "DeleteBackup": { "methods": ["deleteBackupAsync", "deleteBackupAsync", "deleteBackupAsync", "deleteBackupOperationCallable", "deleteBackupCallable"] }, @@ -37,6 +40,9 @@ "DeleteInstance": { "methods": ["deleteInstanceAsync", "deleteInstanceAsync", "deleteInstanceAsync", "deleteInstanceOperationCallable", "deleteInstanceCallable"] }, + "DeleteUser": { + "methods": ["deleteUser", "deleteUser", "deleteUser", "deleteUserCallable"] + }, "FailoverInstance": { "methods": ["failoverInstanceAsync", "failoverInstanceAsync", "failoverInstanceAsync", "failoverInstanceOperationCallable", "failoverInstanceCallable"] }, @@ -58,6 +64,12 @@ "GetLocation": { "methods": ["getLocation", "getLocationCallable"] }, + "GetUser": { + "methods": ["getUser", "getUser", "getUser", "getUserCallable"] + }, + "InjectFault": { + "methods": ["injectFaultAsync", "injectFaultAsync", "injectFaultAsync", "injectFaultOperationCallable", "injectFaultCallable"] + }, "ListBackups": { "methods": ["listBackups", "listBackups", "listBackups", "listBackupsPagedCallable", "listBackupsCallable"] }, @@ -73,6 +85,9 @@ "ListSupportedDatabaseFlags": { "methods": ["listSupportedDatabaseFlags", "listSupportedDatabaseFlags", "listSupportedDatabaseFlags", "listSupportedDatabaseFlagsPagedCallable", "listSupportedDatabaseFlagsCallable"] }, + "ListUsers": { + "methods": ["listUsers", "listUsers", "listUsers", "listUsersPagedCallable", "listUsersCallable"] + }, "PromoteCluster": { "methods": ["promoteClusterAsync", "promoteClusterAsync", "promoteClusterAsync", "promoteClusterOperationCallable", "promoteClusterCallable"] }, @@ -90,6 +105,9 @@ }, "UpdateInstance": { "methods": ["updateInstanceAsync", "updateInstanceAsync", "updateInstanceOperationCallable", "updateInstanceCallable"] + }, + "UpdateUser": { + "methods": ["updateUser", "updateUser", "updateUserCallable"] } } } diff --git a/java-alloydb/google-cloud-alloydb/src/main/java/com/google/cloud/alloydb/v1beta/stub/AlloyDBAdminStub.java b/java-alloydb/google-cloud-alloydb/src/main/java/com/google/cloud/alloydb/v1beta/stub/AlloyDBAdminStub.java index d3137dd198a8..80cc7813f960 100644 --- a/java-alloydb/google-cloud-alloydb/src/main/java/com/google/cloud/alloydb/v1beta/stub/AlloyDBAdminStub.java +++ b/java-alloydb/google-cloud-alloydb/src/main/java/com/google/cloud/alloydb/v1beta/stub/AlloyDBAdminStub.java @@ -21,6 +21,7 @@ import static com.google.cloud.alloydb.v1beta.AlloyDBAdminClient.ListInstancesPagedResponse; import static com.google.cloud.alloydb.v1beta.AlloyDBAdminClient.ListLocationsPagedResponse; import static com.google.cloud.alloydb.v1beta.AlloyDBAdminClient.ListSupportedDatabaseFlagsPagedResponse; +import static com.google.cloud.alloydb.v1beta.AlloyDBAdminClient.ListUsersPagedResponse; import com.google.api.core.BetaApi; import com.google.api.gax.core.BackgroundResource; @@ -36,9 +37,11 @@ import com.google.cloud.alloydb.v1beta.CreateInstanceRequest; import com.google.cloud.alloydb.v1beta.CreateSecondaryClusterRequest; import com.google.cloud.alloydb.v1beta.CreateSecondaryInstanceRequest; +import com.google.cloud.alloydb.v1beta.CreateUserRequest; import com.google.cloud.alloydb.v1beta.DeleteBackupRequest; import com.google.cloud.alloydb.v1beta.DeleteClusterRequest; import com.google.cloud.alloydb.v1beta.DeleteInstanceRequest; +import com.google.cloud.alloydb.v1beta.DeleteUserRequest; import com.google.cloud.alloydb.v1beta.FailoverInstanceRequest; import com.google.cloud.alloydb.v1beta.GenerateClientCertificateRequest; import com.google.cloud.alloydb.v1beta.GenerateClientCertificateResponse; @@ -46,6 +49,8 @@ import com.google.cloud.alloydb.v1beta.GetClusterRequest; import com.google.cloud.alloydb.v1beta.GetConnectionInfoRequest; import com.google.cloud.alloydb.v1beta.GetInstanceRequest; +import com.google.cloud.alloydb.v1beta.GetUserRequest; +import com.google.cloud.alloydb.v1beta.InjectFaultRequest; import com.google.cloud.alloydb.v1beta.Instance; import com.google.cloud.alloydb.v1beta.ListBackupsRequest; import com.google.cloud.alloydb.v1beta.ListBackupsResponse; @@ -55,6 +60,8 @@ import com.google.cloud.alloydb.v1beta.ListInstancesResponse; import com.google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsRequest; import com.google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsResponse; +import com.google.cloud.alloydb.v1beta.ListUsersRequest; +import com.google.cloud.alloydb.v1beta.ListUsersResponse; import com.google.cloud.alloydb.v1beta.OperationMetadata; import com.google.cloud.alloydb.v1beta.PromoteClusterRequest; import com.google.cloud.alloydb.v1beta.RestartInstanceRequest; @@ -62,6 +69,8 @@ import com.google.cloud.alloydb.v1beta.UpdateBackupRequest; import com.google.cloud.alloydb.v1beta.UpdateClusterRequest; import com.google.cloud.alloydb.v1beta.UpdateInstanceRequest; +import com.google.cloud.alloydb.v1beta.UpdateUserRequest; +import com.google.cloud.alloydb.v1beta.User; import com.google.cloud.location.GetLocationRequest; import com.google.cloud.location.ListLocationsRequest; import com.google.cloud.location.ListLocationsResponse; @@ -227,6 +236,15 @@ public UnaryCallable failoverInstanceCallabl throw new UnsupportedOperationException("Not implemented: failoverInstanceCallable()"); } + public OperationCallable + injectFaultOperationCallable() { + throw new UnsupportedOperationException("Not implemented: injectFaultOperationCallable()"); + } + + public UnaryCallable injectFaultCallable() { + throw new UnsupportedOperationException("Not implemented: injectFaultCallable()"); + } + public OperationCallable restartInstanceOperationCallable() { throw new UnsupportedOperationException("Not implemented: restartInstanceOperationCallable()"); @@ -296,6 +314,30 @@ public UnaryCallable getConnectionInfo throw new UnsupportedOperationException("Not implemented: getConnectionInfoCallable()"); } + public UnaryCallable listUsersPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listUsersPagedCallable()"); + } + + public UnaryCallable listUsersCallable() { + throw new UnsupportedOperationException("Not implemented: listUsersCallable()"); + } + + public UnaryCallable getUserCallable() { + throw new UnsupportedOperationException("Not implemented: getUserCallable()"); + } + + public UnaryCallable createUserCallable() { + throw new UnsupportedOperationException("Not implemented: createUserCallable()"); + } + + public UnaryCallable updateUserCallable() { + throw new UnsupportedOperationException("Not implemented: updateUserCallable()"); + } + + public UnaryCallable deleteUserCallable() { + throw new UnsupportedOperationException("Not implemented: deleteUserCallable()"); + } + public UnaryCallable listLocationsPagedCallable() { throw new UnsupportedOperationException("Not implemented: listLocationsPagedCallable()"); diff --git a/java-alloydb/google-cloud-alloydb/src/main/java/com/google/cloud/alloydb/v1beta/stub/AlloyDBAdminStubSettings.java b/java-alloydb/google-cloud-alloydb/src/main/java/com/google/cloud/alloydb/v1beta/stub/AlloyDBAdminStubSettings.java index b4d94db45978..99a333462995 100644 --- a/java-alloydb/google-cloud-alloydb/src/main/java/com/google/cloud/alloydb/v1beta/stub/AlloyDBAdminStubSettings.java +++ b/java-alloydb/google-cloud-alloydb/src/main/java/com/google/cloud/alloydb/v1beta/stub/AlloyDBAdminStubSettings.java @@ -21,6 +21,7 @@ import static com.google.cloud.alloydb.v1beta.AlloyDBAdminClient.ListInstancesPagedResponse; import static com.google.cloud.alloydb.v1beta.AlloyDBAdminClient.ListLocationsPagedResponse; import static com.google.cloud.alloydb.v1beta.AlloyDBAdminClient.ListSupportedDatabaseFlagsPagedResponse; +import static com.google.cloud.alloydb.v1beta.AlloyDBAdminClient.ListUsersPagedResponse; import com.google.api.core.ApiFunction; import com.google.api.core.ApiFuture; @@ -61,9 +62,11 @@ import com.google.cloud.alloydb.v1beta.CreateInstanceRequest; import com.google.cloud.alloydb.v1beta.CreateSecondaryClusterRequest; import com.google.cloud.alloydb.v1beta.CreateSecondaryInstanceRequest; +import com.google.cloud.alloydb.v1beta.CreateUserRequest; import com.google.cloud.alloydb.v1beta.DeleteBackupRequest; import com.google.cloud.alloydb.v1beta.DeleteClusterRequest; import com.google.cloud.alloydb.v1beta.DeleteInstanceRequest; +import com.google.cloud.alloydb.v1beta.DeleteUserRequest; import com.google.cloud.alloydb.v1beta.FailoverInstanceRequest; import com.google.cloud.alloydb.v1beta.GenerateClientCertificateRequest; import com.google.cloud.alloydb.v1beta.GenerateClientCertificateResponse; @@ -71,6 +74,8 @@ import com.google.cloud.alloydb.v1beta.GetClusterRequest; import com.google.cloud.alloydb.v1beta.GetConnectionInfoRequest; import com.google.cloud.alloydb.v1beta.GetInstanceRequest; +import com.google.cloud.alloydb.v1beta.GetUserRequest; +import com.google.cloud.alloydb.v1beta.InjectFaultRequest; import com.google.cloud.alloydb.v1beta.Instance; import com.google.cloud.alloydb.v1beta.ListBackupsRequest; import com.google.cloud.alloydb.v1beta.ListBackupsResponse; @@ -80,6 +85,8 @@ import com.google.cloud.alloydb.v1beta.ListInstancesResponse; import com.google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsRequest; import com.google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsResponse; +import com.google.cloud.alloydb.v1beta.ListUsersRequest; +import com.google.cloud.alloydb.v1beta.ListUsersResponse; import com.google.cloud.alloydb.v1beta.OperationMetadata; import com.google.cloud.alloydb.v1beta.PromoteClusterRequest; import com.google.cloud.alloydb.v1beta.RestartInstanceRequest; @@ -88,6 +95,8 @@ import com.google.cloud.alloydb.v1beta.UpdateBackupRequest; import com.google.cloud.alloydb.v1beta.UpdateClusterRequest; import com.google.cloud.alloydb.v1beta.UpdateInstanceRequest; +import com.google.cloud.alloydb.v1beta.UpdateUserRequest; +import com.google.cloud.alloydb.v1beta.User; import com.google.cloud.location.GetLocationRequest; import com.google.cloud.location.ListLocationsRequest; import com.google.cloud.location.ListLocationsResponse; @@ -195,6 +204,9 @@ public class AlloyDBAdminStubSettings extends StubSettings failoverInstanceSettings; private final OperationCallSettings failoverInstanceOperationSettings; + private final UnaryCallSettings injectFaultSettings; + private final OperationCallSettings + injectFaultOperationSettings; private final UnaryCallSettings restartInstanceSettings; private final OperationCallSettings restartInstanceOperationSettings; @@ -220,6 +232,12 @@ public class AlloyDBAdminStubSettings extends StubSettings getConnectionInfoSettings; + private final PagedCallSettings + listUsersSettings; + private final UnaryCallSettings getUserSettings; + private final UnaryCallSettings createUserSettings; + private final UnaryCallSettings updateUserSettings; + private final UnaryCallSettings deleteUserSettings; private final PagedCallSettings< ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse> listLocationsSettings; @@ -382,6 +400,42 @@ public Iterable extractResources( } }; + private static final PagedListDescriptor + LIST_USERS_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListUsersRequest injectToken(ListUsersRequest payload, String token) { + return ListUsersRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListUsersRequest injectPageSize(ListUsersRequest payload, int pageSize) { + return ListUsersRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(ListUsersRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListUsersResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources(ListUsersResponse payload) { + return payload.getUsersList() == null + ? ImmutableList.of() + : payload.getUsersList(); + } + }; + private static final PagedListDescriptor LIST_LOCATIONS_PAGE_STR_DESC = new PagedListDescriptor() { @@ -497,6 +551,23 @@ public ApiFuture getFuturePagedResponse } }; + private static final PagedListResponseFactory< + ListUsersRequest, ListUsersResponse, ListUsersPagedResponse> + LIST_USERS_PAGE_STR_FACT = + new PagedListResponseFactory< + ListUsersRequest, ListUsersResponse, ListUsersPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListUsersRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, LIST_USERS_PAGE_STR_DESC, request, context); + return ListUsersPagedResponse.createAsync(pageContext, futureResponse); + } + }; + private static final PagedListResponseFactory< ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse> LIST_LOCATIONS_PAGE_STR_FACT = @@ -671,6 +742,17 @@ public UnaryCallSettings failoverInstanceSet return failoverInstanceOperationSettings; } + /** Returns the object with the settings used for calls to injectFault. */ + public UnaryCallSettings injectFaultSettings() { + return injectFaultSettings; + } + + /** Returns the object with the settings used for calls to injectFault. */ + public OperationCallSettings + injectFaultOperationSettings() { + return injectFaultOperationSettings; + } + /** Returns the object with the settings used for calls to restartInstance. */ public UnaryCallSettings restartInstanceSettings() { return restartInstanceSettings; @@ -746,6 +828,32 @@ public UnaryCallSettings getConnection return getConnectionInfoSettings; } + /** Returns the object with the settings used for calls to listUsers. */ + public PagedCallSettings + listUsersSettings() { + return listUsersSettings; + } + + /** Returns the object with the settings used for calls to getUser. */ + public UnaryCallSettings getUserSettings() { + return getUserSettings; + } + + /** Returns the object with the settings used for calls to createUser. */ + public UnaryCallSettings createUserSettings() { + return createUserSettings; + } + + /** Returns the object with the settings used for calls to updateUser. */ + public UnaryCallSettings updateUserSettings() { + return updateUserSettings; + } + + /** Returns the object with the settings used for calls to deleteUser. */ + public UnaryCallSettings deleteUserSettings() { + return deleteUserSettings; + } + /** Returns the object with the settings used for calls to listLocations. */ public PagedCallSettings listLocationsSettings() { @@ -894,6 +1002,8 @@ protected AlloyDBAdminStubSettings(Builder settingsBuilder) throws IOException { deleteInstanceOperationSettings = settingsBuilder.deleteInstanceOperationSettings().build(); failoverInstanceSettings = settingsBuilder.failoverInstanceSettings().build(); failoverInstanceOperationSettings = settingsBuilder.failoverInstanceOperationSettings().build(); + injectFaultSettings = settingsBuilder.injectFaultSettings().build(); + injectFaultOperationSettings = settingsBuilder.injectFaultOperationSettings().build(); restartInstanceSettings = settingsBuilder.restartInstanceSettings().build(); restartInstanceOperationSettings = settingsBuilder.restartInstanceOperationSettings().build(); listBackupsSettings = settingsBuilder.listBackupsSettings().build(); @@ -908,6 +1018,11 @@ protected AlloyDBAdminStubSettings(Builder settingsBuilder) throws IOException { settingsBuilder.listSupportedDatabaseFlagsSettings().build(); generateClientCertificateSettings = settingsBuilder.generateClientCertificateSettings().build(); getConnectionInfoSettings = settingsBuilder.getConnectionInfoSettings().build(); + listUsersSettings = settingsBuilder.listUsersSettings().build(); + getUserSettings = settingsBuilder.getUserSettings().build(); + createUserSettings = settingsBuilder.createUserSettings().build(); + updateUserSettings = settingsBuilder.updateUserSettings().build(); + deleteUserSettings = settingsBuilder.deleteUserSettings().build(); listLocationsSettings = settingsBuilder.listLocationsSettings().build(); getLocationSettings = settingsBuilder.getLocationSettings().build(); } @@ -972,6 +1087,9 @@ public static class Builder extends StubSettings.Builder failoverInstanceOperationSettings; + private final UnaryCallSettings.Builder injectFaultSettings; + private final OperationCallSettings.Builder + injectFaultOperationSettings; private final UnaryCallSettings.Builder restartInstanceSettings; private final OperationCallSettings.Builder @@ -999,6 +1117,13 @@ public static class Builder extends StubSettings.Builder getConnectionInfoSettings; + private final PagedCallSettings.Builder< + ListUsersRequest, ListUsersResponse, ListUsersPagedResponse> + listUsersSettings; + private final UnaryCallSettings.Builder getUserSettings; + private final UnaryCallSettings.Builder createUserSettings; + private final UnaryCallSettings.Builder updateUserSettings; + private final UnaryCallSettings.Builder deleteUserSettings; private final PagedCallSettings.Builder< ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse> listLocationsSettings; @@ -1079,6 +1204,8 @@ protected Builder(ClientContext clientContext) { deleteInstanceOperationSettings = OperationCallSettings.newBuilder(); failoverInstanceSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); failoverInstanceOperationSettings = OperationCallSettings.newBuilder(); + injectFaultSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + injectFaultOperationSettings = OperationCallSettings.newBuilder(); restartInstanceSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); restartInstanceOperationSettings = OperationCallSettings.newBuilder(); listBackupsSettings = PagedCallSettings.newBuilder(LIST_BACKUPS_PAGE_STR_FACT); @@ -1093,6 +1220,11 @@ protected Builder(ClientContext clientContext) { PagedCallSettings.newBuilder(LIST_SUPPORTED_DATABASE_FLAGS_PAGE_STR_FACT); generateClientCertificateSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); getConnectionInfoSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + listUsersSettings = PagedCallSettings.newBuilder(LIST_USERS_PAGE_STR_FACT); + getUserSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + createUserSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + updateUserSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + deleteUserSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); listLocationsSettings = PagedCallSettings.newBuilder(LIST_LOCATIONS_PAGE_STR_FACT); getLocationSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); @@ -1114,6 +1246,7 @@ protected Builder(ClientContext clientContext) { updateInstanceSettings, deleteInstanceSettings, failoverInstanceSettings, + injectFaultSettings, restartInstanceSettings, listBackupsSettings, getBackupSettings, @@ -1123,6 +1256,11 @@ protected Builder(ClientContext clientContext) { listSupportedDatabaseFlagsSettings, generateClientCertificateSettings, getConnectionInfoSettings, + listUsersSettings, + getUserSettings, + createUserSettings, + updateUserSettings, + deleteUserSettings, listLocationsSettings, getLocationSettings); initDefaults(this); @@ -1162,6 +1300,8 @@ protected Builder(AlloyDBAdminStubSettings settings) { deleteInstanceOperationSettings = settings.deleteInstanceOperationSettings.toBuilder(); failoverInstanceSettings = settings.failoverInstanceSettings.toBuilder(); failoverInstanceOperationSettings = settings.failoverInstanceOperationSettings.toBuilder(); + injectFaultSettings = settings.injectFaultSettings.toBuilder(); + injectFaultOperationSettings = settings.injectFaultOperationSettings.toBuilder(); restartInstanceSettings = settings.restartInstanceSettings.toBuilder(); restartInstanceOperationSettings = settings.restartInstanceOperationSettings.toBuilder(); listBackupsSettings = settings.listBackupsSettings.toBuilder(); @@ -1175,6 +1315,11 @@ protected Builder(AlloyDBAdminStubSettings settings) { listSupportedDatabaseFlagsSettings = settings.listSupportedDatabaseFlagsSettings.toBuilder(); generateClientCertificateSettings = settings.generateClientCertificateSettings.toBuilder(); getConnectionInfoSettings = settings.getConnectionInfoSettings.toBuilder(); + listUsersSettings = settings.listUsersSettings.toBuilder(); + getUserSettings = settings.getUserSettings.toBuilder(); + createUserSettings = settings.createUserSettings.toBuilder(); + updateUserSettings = settings.updateUserSettings.toBuilder(); + deleteUserSettings = settings.deleteUserSettings.toBuilder(); listLocationsSettings = settings.listLocationsSettings.toBuilder(); getLocationSettings = settings.getLocationSettings.toBuilder(); @@ -1196,6 +1341,7 @@ protected Builder(AlloyDBAdminStubSettings settings) { updateInstanceSettings, deleteInstanceSettings, failoverInstanceSettings, + injectFaultSettings, restartInstanceSettings, listBackupsSettings, getBackupSettings, @@ -1205,6 +1351,11 @@ protected Builder(AlloyDBAdminStubSettings settings) { listSupportedDatabaseFlagsSettings, generateClientCertificateSettings, getConnectionInfoSettings, + listUsersSettings, + getUserSettings, + createUserSettings, + updateUserSettings, + deleteUserSettings, listLocationsSettings, getLocationSettings); } @@ -1316,6 +1467,11 @@ private static Builder initDefaults(Builder builder) { .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")); + builder + .injectFaultSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")); + builder .restartInstanceSettings() .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) @@ -1361,6 +1517,31 @@ private static Builder initDefaults(Builder builder) { .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + builder + .listUsersSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + + builder + .getUserSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + + builder + .createUserSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")); + + builder + .updateUserSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")); + + builder + .deleteUserSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")); + builder .listLocationsSettings() .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) @@ -1660,6 +1841,29 @@ private static Builder initDefaults(Builder builder) { .setTotalTimeout(Duration.ofMillis(300000L)) .build())); + builder + .injectFaultOperationSettings() + .setInitialCallSettings( + UnaryCallSettings.newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")) + .build()) + .setResponseTransformer( + ProtoOperationTransformers.ResponseTransformer.create(Instance.class)) + .setMetadataTransformer( + ProtoOperationTransformers.MetadataTransformer.create(OperationMetadata.class)) + .setPollingAlgorithm( + OperationTimedPollAlgorithm.create( + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(5000L)) + .setRetryDelayMultiplier(1.5) + .setMaxRetryDelay(Duration.ofMillis(45000L)) + .setInitialRpcTimeout(Duration.ZERO) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ZERO) + .setTotalTimeout(Duration.ofMillis(300000L)) + .build())); + builder .restartInstanceOperationSettings() .setInitialCallSettings( @@ -1960,6 +2164,19 @@ public UnaryCallSettings.Builder deleteInstanc return failoverInstanceOperationSettings; } + /** Returns the builder for the settings used for calls to injectFault. */ + public UnaryCallSettings.Builder injectFaultSettings() { + return injectFaultSettings; + } + + /** Returns the builder for the settings used for calls to injectFault. */ + @BetaApi( + "The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings.Builder + injectFaultOperationSettings() { + return injectFaultOperationSettings; + } + /** Returns the builder for the settings used for calls to restartInstance. */ public UnaryCallSettings.Builder restartInstanceSettings() { return restartInstanceSettings; @@ -2046,6 +2263,32 @@ public UnaryCallSettings.Builder deleteBackupSet return getConnectionInfoSettings; } + /** Returns the builder for the settings used for calls to listUsers. */ + public PagedCallSettings.Builder + listUsersSettings() { + return listUsersSettings; + } + + /** Returns the builder for the settings used for calls to getUser. */ + public UnaryCallSettings.Builder getUserSettings() { + return getUserSettings; + } + + /** Returns the builder for the settings used for calls to createUser. */ + public UnaryCallSettings.Builder createUserSettings() { + return createUserSettings; + } + + /** Returns the builder for the settings used for calls to updateUser. */ + public UnaryCallSettings.Builder updateUserSettings() { + return updateUserSettings; + } + + /** Returns the builder for the settings used for calls to deleteUser. */ + public UnaryCallSettings.Builder deleteUserSettings() { + return deleteUserSettings; + } + /** Returns the builder for the settings used for calls to listLocations. */ public PagedCallSettings.Builder< ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse> diff --git a/java-alloydb/google-cloud-alloydb/src/main/java/com/google/cloud/alloydb/v1beta/stub/GrpcAlloyDBAdminStub.java b/java-alloydb/google-cloud-alloydb/src/main/java/com/google/cloud/alloydb/v1beta/stub/GrpcAlloyDBAdminStub.java index d10f66079eab..162ccc518448 100644 --- a/java-alloydb/google-cloud-alloydb/src/main/java/com/google/cloud/alloydb/v1beta/stub/GrpcAlloyDBAdminStub.java +++ b/java-alloydb/google-cloud-alloydb/src/main/java/com/google/cloud/alloydb/v1beta/stub/GrpcAlloyDBAdminStub.java @@ -21,6 +21,7 @@ import static com.google.cloud.alloydb.v1beta.AlloyDBAdminClient.ListInstancesPagedResponse; import static com.google.cloud.alloydb.v1beta.AlloyDBAdminClient.ListLocationsPagedResponse; import static com.google.cloud.alloydb.v1beta.AlloyDBAdminClient.ListSupportedDatabaseFlagsPagedResponse; +import static com.google.cloud.alloydb.v1beta.AlloyDBAdminClient.ListUsersPagedResponse; import com.google.api.core.BetaApi; import com.google.api.gax.core.BackgroundResource; @@ -41,9 +42,11 @@ import com.google.cloud.alloydb.v1beta.CreateInstanceRequest; import com.google.cloud.alloydb.v1beta.CreateSecondaryClusterRequest; import com.google.cloud.alloydb.v1beta.CreateSecondaryInstanceRequest; +import com.google.cloud.alloydb.v1beta.CreateUserRequest; import com.google.cloud.alloydb.v1beta.DeleteBackupRequest; import com.google.cloud.alloydb.v1beta.DeleteClusterRequest; import com.google.cloud.alloydb.v1beta.DeleteInstanceRequest; +import com.google.cloud.alloydb.v1beta.DeleteUserRequest; import com.google.cloud.alloydb.v1beta.FailoverInstanceRequest; import com.google.cloud.alloydb.v1beta.GenerateClientCertificateRequest; import com.google.cloud.alloydb.v1beta.GenerateClientCertificateResponse; @@ -51,6 +54,8 @@ import com.google.cloud.alloydb.v1beta.GetClusterRequest; import com.google.cloud.alloydb.v1beta.GetConnectionInfoRequest; import com.google.cloud.alloydb.v1beta.GetInstanceRequest; +import com.google.cloud.alloydb.v1beta.GetUserRequest; +import com.google.cloud.alloydb.v1beta.InjectFaultRequest; import com.google.cloud.alloydb.v1beta.Instance; import com.google.cloud.alloydb.v1beta.ListBackupsRequest; import com.google.cloud.alloydb.v1beta.ListBackupsResponse; @@ -60,6 +65,8 @@ import com.google.cloud.alloydb.v1beta.ListInstancesResponse; import com.google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsRequest; import com.google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsResponse; +import com.google.cloud.alloydb.v1beta.ListUsersRequest; +import com.google.cloud.alloydb.v1beta.ListUsersResponse; import com.google.cloud.alloydb.v1beta.OperationMetadata; import com.google.cloud.alloydb.v1beta.PromoteClusterRequest; import com.google.cloud.alloydb.v1beta.RestartInstanceRequest; @@ -67,6 +74,8 @@ import com.google.cloud.alloydb.v1beta.UpdateBackupRequest; import com.google.cloud.alloydb.v1beta.UpdateClusterRequest; import com.google.cloud.alloydb.v1beta.UpdateInstanceRequest; +import com.google.cloud.alloydb.v1beta.UpdateUserRequest; +import com.google.cloud.alloydb.v1beta.User; import com.google.cloud.location.GetLocationRequest; import com.google.cloud.location.ListLocationsRequest; import com.google.cloud.location.ListLocationsResponse; @@ -246,6 +255,14 @@ public class GrpcAlloyDBAdminStub extends AlloyDBAdminStub { .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) .build(); + private static final MethodDescriptor injectFaultMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.alloydb.v1beta.AlloyDBAdmin/InjectFault") + .setRequestMarshaller(ProtoUtils.marshaller(InjectFaultRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + private static final MethodDescriptor restartInstanceMethodDescriptor = MethodDescriptor.newBuilder() @@ -339,6 +356,47 @@ public class GrpcAlloyDBAdminStub extends AlloyDBAdminStub { .setResponseMarshaller(ProtoUtils.marshaller(ConnectionInfo.getDefaultInstance())) .build(); + private static final MethodDescriptor + listUsersMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.alloydb.v1beta.AlloyDBAdmin/ListUsers") + .setRequestMarshaller(ProtoUtils.marshaller(ListUsersRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(ListUsersResponse.getDefaultInstance())) + .build(); + + private static final MethodDescriptor getUserMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.alloydb.v1beta.AlloyDBAdmin/GetUser") + .setRequestMarshaller(ProtoUtils.marshaller(GetUserRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(User.getDefaultInstance())) + .build(); + + private static final MethodDescriptor createUserMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.alloydb.v1beta.AlloyDBAdmin/CreateUser") + .setRequestMarshaller(ProtoUtils.marshaller(CreateUserRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(User.getDefaultInstance())) + .build(); + + private static final MethodDescriptor updateUserMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.alloydb.v1beta.AlloyDBAdmin/UpdateUser") + .setRequestMarshaller(ProtoUtils.marshaller(UpdateUserRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(User.getDefaultInstance())) + .build(); + + private static final MethodDescriptor deleteUserMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.alloydb.v1beta.AlloyDBAdmin/DeleteUser") + .setRequestMarshaller(ProtoUtils.marshaller(DeleteUserRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance())) + .build(); + private static final MethodDescriptor listLocationsMethodDescriptor = MethodDescriptor.newBuilder() @@ -405,6 +463,9 @@ public class GrpcAlloyDBAdminStub extends AlloyDBAdminStub { private final UnaryCallable failoverInstanceCallable; private final OperationCallable failoverInstanceOperationCallable; + private final UnaryCallable injectFaultCallable; + private final OperationCallable + injectFaultOperationCallable; private final UnaryCallable restartInstanceCallable; private final OperationCallable restartInstanceOperationCallable; @@ -429,6 +490,12 @@ public class GrpcAlloyDBAdminStub extends AlloyDBAdminStub { private final UnaryCallable generateClientCertificateCallable; private final UnaryCallable getConnectionInfoCallable; + private final UnaryCallable listUsersCallable; + private final UnaryCallable listUsersPagedCallable; + private final UnaryCallable getUserCallable; + private final UnaryCallable createUserCallable; + private final UnaryCallable updateUserCallable; + private final UnaryCallable deleteUserCallable; private final UnaryCallable listLocationsCallable; private final UnaryCallable listLocationsPagedCallable; @@ -638,6 +705,16 @@ protected GrpcAlloyDBAdminStub( return builder.build(); }) .build(); + GrpcCallSettings injectFaultTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(injectFaultMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); GrpcCallSettings restartInstanceTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(restartInstanceMethodDescriptor) @@ -732,6 +809,56 @@ protected GrpcAlloyDBAdminStub( return builder.build(); }) .build(); + GrpcCallSettings listUsersTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listUsersMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .build(); + GrpcCallSettings getUserTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getUserMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + GrpcCallSettings createUserTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(createUserMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .build(); + GrpcCallSettings updateUserTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(updateUserMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("user.name", String.valueOf(request.getUser().getName())); + return builder.build(); + }) + .build(); + GrpcCallSettings deleteUserTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(deleteUserMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); GrpcCallSettings listLocationsTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(listLocationsMethodDescriptor) @@ -885,6 +1012,15 @@ protected GrpcAlloyDBAdminStub( settings.failoverInstanceOperationSettings(), clientContext, operationsStub); + this.injectFaultCallable = + callableFactory.createUnaryCallable( + injectFaultTransportSettings, settings.injectFaultSettings(), clientContext); + this.injectFaultOperationCallable = + callableFactory.createOperationCallable( + injectFaultTransportSettings, + settings.injectFaultOperationSettings(), + clientContext, + operationsStub); this.restartInstanceCallable = callableFactory.createUnaryCallable( restartInstanceTransportSettings, settings.restartInstanceSettings(), clientContext); @@ -950,6 +1086,24 @@ protected GrpcAlloyDBAdminStub( getConnectionInfoTransportSettings, settings.getConnectionInfoSettings(), clientContext); + this.listUsersCallable = + callableFactory.createUnaryCallable( + listUsersTransportSettings, settings.listUsersSettings(), clientContext); + this.listUsersPagedCallable = + callableFactory.createPagedCallable( + listUsersTransportSettings, settings.listUsersSettings(), clientContext); + this.getUserCallable = + callableFactory.createUnaryCallable( + getUserTransportSettings, settings.getUserSettings(), clientContext); + this.createUserCallable = + callableFactory.createUnaryCallable( + createUserTransportSettings, settings.createUserSettings(), clientContext); + this.updateUserCallable = + callableFactory.createUnaryCallable( + updateUserTransportSettings, settings.updateUserSettings(), clientContext); + this.deleteUserCallable = + callableFactory.createUnaryCallable( + deleteUserTransportSettings, settings.deleteUserSettings(), clientContext); this.listLocationsCallable = callableFactory.createUnaryCallable( listLocationsTransportSettings, settings.listLocationsSettings(), clientContext); @@ -1133,6 +1287,17 @@ public UnaryCallable failoverInstanceCallabl return failoverInstanceOperationCallable; } + @Override + public UnaryCallable injectFaultCallable() { + return injectFaultCallable; + } + + @Override + public OperationCallable + injectFaultOperationCallable() { + return injectFaultOperationCallable; + } + @Override public UnaryCallable restartInstanceCallable() { return restartInstanceCallable; @@ -1215,6 +1380,36 @@ public UnaryCallable getConnectionInfo return getConnectionInfoCallable; } + @Override + public UnaryCallable listUsersCallable() { + return listUsersCallable; + } + + @Override + public UnaryCallable listUsersPagedCallable() { + return listUsersPagedCallable; + } + + @Override + public UnaryCallable getUserCallable() { + return getUserCallable; + } + + @Override + public UnaryCallable createUserCallable() { + return createUserCallable; + } + + @Override + public UnaryCallable updateUserCallable() { + return updateUserCallable; + } + + @Override + public UnaryCallable deleteUserCallable() { + return deleteUserCallable; + } + @Override public UnaryCallable listLocationsCallable() { return listLocationsCallable; diff --git a/java-alloydb/google-cloud-alloydb/src/main/java/com/google/cloud/alloydb/v1beta/stub/HttpJsonAlloyDBAdminStub.java b/java-alloydb/google-cloud-alloydb/src/main/java/com/google/cloud/alloydb/v1beta/stub/HttpJsonAlloyDBAdminStub.java index b86b123ef482..fe6c0757be14 100644 --- a/java-alloydb/google-cloud-alloydb/src/main/java/com/google/cloud/alloydb/v1beta/stub/HttpJsonAlloyDBAdminStub.java +++ b/java-alloydb/google-cloud-alloydb/src/main/java/com/google/cloud/alloydb/v1beta/stub/HttpJsonAlloyDBAdminStub.java @@ -21,6 +21,7 @@ import static com.google.cloud.alloydb.v1beta.AlloyDBAdminClient.ListInstancesPagedResponse; import static com.google.cloud.alloydb.v1beta.AlloyDBAdminClient.ListLocationsPagedResponse; import static com.google.cloud.alloydb.v1beta.AlloyDBAdminClient.ListSupportedDatabaseFlagsPagedResponse; +import static com.google.cloud.alloydb.v1beta.AlloyDBAdminClient.ListUsersPagedResponse; import com.google.api.HttpRule; import com.google.api.core.BetaApi; @@ -49,9 +50,11 @@ import com.google.cloud.alloydb.v1beta.CreateInstanceRequest; import com.google.cloud.alloydb.v1beta.CreateSecondaryClusterRequest; import com.google.cloud.alloydb.v1beta.CreateSecondaryInstanceRequest; +import com.google.cloud.alloydb.v1beta.CreateUserRequest; import com.google.cloud.alloydb.v1beta.DeleteBackupRequest; import com.google.cloud.alloydb.v1beta.DeleteClusterRequest; import com.google.cloud.alloydb.v1beta.DeleteInstanceRequest; +import com.google.cloud.alloydb.v1beta.DeleteUserRequest; import com.google.cloud.alloydb.v1beta.FailoverInstanceRequest; import com.google.cloud.alloydb.v1beta.GenerateClientCertificateRequest; import com.google.cloud.alloydb.v1beta.GenerateClientCertificateResponse; @@ -59,6 +62,8 @@ import com.google.cloud.alloydb.v1beta.GetClusterRequest; import com.google.cloud.alloydb.v1beta.GetConnectionInfoRequest; import com.google.cloud.alloydb.v1beta.GetInstanceRequest; +import com.google.cloud.alloydb.v1beta.GetUserRequest; +import com.google.cloud.alloydb.v1beta.InjectFaultRequest; import com.google.cloud.alloydb.v1beta.Instance; import com.google.cloud.alloydb.v1beta.ListBackupsRequest; import com.google.cloud.alloydb.v1beta.ListBackupsResponse; @@ -68,6 +73,8 @@ import com.google.cloud.alloydb.v1beta.ListInstancesResponse; import com.google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsRequest; import com.google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsResponse; +import com.google.cloud.alloydb.v1beta.ListUsersRequest; +import com.google.cloud.alloydb.v1beta.ListUsersResponse; import com.google.cloud.alloydb.v1beta.OperationMetadata; import com.google.cloud.alloydb.v1beta.PromoteClusterRequest; import com.google.cloud.alloydb.v1beta.RestartInstanceRequest; @@ -75,6 +82,8 @@ import com.google.cloud.alloydb.v1beta.UpdateBackupRequest; import com.google.cloud.alloydb.v1beta.UpdateClusterRequest; import com.google.cloud.alloydb.v1beta.UpdateInstanceRequest; +import com.google.cloud.alloydb.v1beta.UpdateUserRequest; +import com.google.cloud.alloydb.v1beta.User; import com.google.cloud.location.GetLocationRequest; import com.google.cloud.location.ListLocationsRequest; import com.google.cloud.location.ListLocationsResponse; @@ -169,6 +178,7 @@ public class HttpJsonAlloyDBAdminStub extends AlloyDBAdminStub { Map> fields = new HashMap<>(); ProtoRestSerializer serializer = ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "view", request.getViewValue()); serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); return fields; }) @@ -768,6 +778,46 @@ public class HttpJsonAlloyDBAdminStub extends AlloyDBAdminStub { HttpJsonOperationSnapshot.create(response)) .build(); + private static final ApiMethodDescriptor + injectFaultMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.alloydb.v1beta.AlloyDBAdmin/InjectFault") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta/{name=projects/*/locations/*/clusters/*/instances/*}:injectFault", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("*", request.toBuilder().clearName().build(), true)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .setOperationSnapshotFactory( + (InjectFaultRequest request, Operation response) -> + HttpJsonOperationSnapshot.create(response)) + .build(); + private static final ApiMethodDescriptor restartInstanceMethodDescriptor = ApiMethodDescriptor.newBuilder() @@ -1125,6 +1175,189 @@ public class HttpJsonAlloyDBAdminStub extends AlloyDBAdminStub { .build()) .build(); + private static final ApiMethodDescriptor + listUsersMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.alloydb.v1beta.AlloyDBAdmin/ListUsers") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta/{parent=projects/*/locations/*/clusters/*}/users", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "parent", request.getParent()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "filter", request.getFilter()); + serializer.putQueryParam(fields, "orderBy", request.getOrderBy()); + serializer.putQueryParam(fields, "pageSize", request.getPageSize()); + serializer.putQueryParam(fields, "pageToken", request.getPageToken()); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(ListUsersResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor getUserMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.alloydb.v1beta.AlloyDBAdmin/GetUser") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta/{name=projects/*/locations/*/clusters/*/users/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(User.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor createUserMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.alloydb.v1beta.AlloyDBAdmin/CreateUser") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta/{parent=projects/*/locations/*/clusters/*}/users", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "parent", request.getParent()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "requestId", request.getRequestId()); + serializer.putQueryParam(fields, "userId", request.getUserId()); + serializer.putQueryParam(fields, "validateOnly", request.getValidateOnly()); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create().toBody("user", request.getUser(), true)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(User.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor updateUserMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.alloydb.v1beta.AlloyDBAdmin/UpdateUser") + .setHttpMethod("PATCH") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta/{user.name=projects/*/locations/*/clusters/*/users/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "user.name", request.getUser().getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "allowMissing", request.getAllowMissing()); + serializer.putQueryParam(fields, "requestId", request.getRequestId()); + serializer.putQueryParam(fields, "updateMask", request.getUpdateMask()); + serializer.putQueryParam(fields, "validateOnly", request.getValidateOnly()); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create().toBody("user", request.getUser(), true)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(User.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor deleteUserMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.alloydb.v1beta.AlloyDBAdmin/DeleteUser") + .setHttpMethod("DELETE") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta/{name=projects/*/locations/*/clusters/*/users/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "requestId", request.getRequestId()); + serializer.putQueryParam(fields, "validateOnly", request.getValidateOnly()); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Empty.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + private static final ApiMethodDescriptor listLocationsMethodDescriptor = ApiMethodDescriptor.newBuilder() @@ -1240,6 +1473,9 @@ public class HttpJsonAlloyDBAdminStub extends AlloyDBAdminStub { private final UnaryCallable failoverInstanceCallable; private final OperationCallable failoverInstanceOperationCallable; + private final UnaryCallable injectFaultCallable; + private final OperationCallable + injectFaultOperationCallable; private final UnaryCallable restartInstanceCallable; private final OperationCallable restartInstanceOperationCallable; @@ -1264,6 +1500,12 @@ public class HttpJsonAlloyDBAdminStub extends AlloyDBAdminStub { private final UnaryCallable generateClientCertificateCallable; private final UnaryCallable getConnectionInfoCallable; + private final UnaryCallable listUsersCallable; + private final UnaryCallable listUsersPagedCallable; + private final UnaryCallable getUserCallable; + private final UnaryCallable createUserCallable; + private final UnaryCallable updateUserCallable; + private final UnaryCallable deleteUserCallable; private final UnaryCallable listLocationsCallable; private final UnaryCallable listLocationsPagedCallable; @@ -1519,6 +1761,17 @@ protected HttpJsonAlloyDBAdminStub( return builder.build(); }) .build(); + HttpJsonCallSettings injectFaultTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(injectFaultMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); HttpJsonCallSettings restartInstanceTransportSettings = HttpJsonCallSettings.newBuilder() .setMethodDescriptor(restartInstanceMethodDescriptor) @@ -1623,6 +1876,61 @@ protected HttpJsonAlloyDBAdminStub( return builder.build(); }) .build(); + HttpJsonCallSettings listUsersTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(listUsersMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings getUserTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getUserMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings createUserTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(createUserMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings updateUserTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(updateUserMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("user.name", String.valueOf(request.getUser().getName())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings deleteUserTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(deleteUserMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); HttpJsonCallSettings listLocationsTransportSettings = HttpJsonCallSettings.newBuilder() @@ -1779,6 +2087,15 @@ protected HttpJsonAlloyDBAdminStub( settings.failoverInstanceOperationSettings(), clientContext, httpJsonOperationsStub); + this.injectFaultCallable = + callableFactory.createUnaryCallable( + injectFaultTransportSettings, settings.injectFaultSettings(), clientContext); + this.injectFaultOperationCallable = + callableFactory.createOperationCallable( + injectFaultTransportSettings, + settings.injectFaultOperationSettings(), + clientContext, + httpJsonOperationsStub); this.restartInstanceCallable = callableFactory.createUnaryCallable( restartInstanceTransportSettings, settings.restartInstanceSettings(), clientContext); @@ -1844,6 +2161,24 @@ protected HttpJsonAlloyDBAdminStub( getConnectionInfoTransportSettings, settings.getConnectionInfoSettings(), clientContext); + this.listUsersCallable = + callableFactory.createUnaryCallable( + listUsersTransportSettings, settings.listUsersSettings(), clientContext); + this.listUsersPagedCallable = + callableFactory.createPagedCallable( + listUsersTransportSettings, settings.listUsersSettings(), clientContext); + this.getUserCallable = + callableFactory.createUnaryCallable( + getUserTransportSettings, settings.getUserSettings(), clientContext); + this.createUserCallable = + callableFactory.createUnaryCallable( + createUserTransportSettings, settings.createUserSettings(), clientContext); + this.updateUserCallable = + callableFactory.createUnaryCallable( + updateUserTransportSettings, settings.updateUserSettings(), clientContext); + this.deleteUserCallable = + callableFactory.createUnaryCallable( + deleteUserTransportSettings, settings.deleteUserSettings(), clientContext); this.listLocationsCallable = callableFactory.createUnaryCallable( listLocationsTransportSettings, settings.listLocationsSettings(), clientContext); @@ -1877,6 +2212,7 @@ public static List getMethodDescriptors() { methodDescriptors.add(updateInstanceMethodDescriptor); methodDescriptors.add(deleteInstanceMethodDescriptor); methodDescriptors.add(failoverInstanceMethodDescriptor); + methodDescriptors.add(injectFaultMethodDescriptor); methodDescriptors.add(restartInstanceMethodDescriptor); methodDescriptors.add(listBackupsMethodDescriptor); methodDescriptors.add(getBackupMethodDescriptor); @@ -1886,6 +2222,11 @@ public static List getMethodDescriptors() { methodDescriptors.add(listSupportedDatabaseFlagsMethodDescriptor); methodDescriptors.add(generateClientCertificateMethodDescriptor); methodDescriptors.add(getConnectionInfoMethodDescriptor); + methodDescriptors.add(listUsersMethodDescriptor); + methodDescriptors.add(getUserMethodDescriptor); + methodDescriptors.add(createUserMethodDescriptor); + methodDescriptors.add(updateUserMethodDescriptor); + methodDescriptors.add(deleteUserMethodDescriptor); methodDescriptors.add(listLocationsMethodDescriptor); methodDescriptors.add(getLocationMethodDescriptor); return methodDescriptors; @@ -2060,6 +2401,17 @@ public UnaryCallable failoverInstanceCallabl return failoverInstanceOperationCallable; } + @Override + public UnaryCallable injectFaultCallable() { + return injectFaultCallable; + } + + @Override + public OperationCallable + injectFaultOperationCallable() { + return injectFaultOperationCallable; + } + @Override public UnaryCallable restartInstanceCallable() { return restartInstanceCallable; @@ -2142,6 +2494,36 @@ public UnaryCallable getConnectionInfo return getConnectionInfoCallable; } + @Override + public UnaryCallable listUsersCallable() { + return listUsersCallable; + } + + @Override + public UnaryCallable listUsersPagedCallable() { + return listUsersPagedCallable; + } + + @Override + public UnaryCallable getUserCallable() { + return getUserCallable; + } + + @Override + public UnaryCallable createUserCallable() { + return createUserCallable; + } + + @Override + public UnaryCallable updateUserCallable() { + return updateUserCallable; + } + + @Override + public UnaryCallable deleteUserCallable() { + return deleteUserCallable; + } + @Override public UnaryCallable listLocationsCallable() { return listLocationsCallable; diff --git a/java-alloydb/google-cloud-alloydb/src/test/java/com/google/cloud/alloydb/v1/AlloyDBAdminClientHttpJsonTest.java b/java-alloydb/google-cloud-alloydb/src/test/java/com/google/cloud/alloydb/v1/AlloyDBAdminClientHttpJsonTest.java index 31a997b21433..01dc34de8785 100644 --- a/java-alloydb/google-cloud-alloydb/src/test/java/com/google/cloud/alloydb/v1/AlloyDBAdminClientHttpJsonTest.java +++ b/java-alloydb/google-cloud-alloydb/src/test/java/com/google/cloud/alloydb/v1/AlloyDBAdminClientHttpJsonTest.java @@ -21,6 +21,7 @@ import static com.google.cloud.alloydb.v1.AlloyDBAdminClient.ListInstancesPagedResponse; import static com.google.cloud.alloydb.v1.AlloyDBAdminClient.ListLocationsPagedResponse; import static com.google.cloud.alloydb.v1.AlloyDBAdminClient.ListSupportedDatabaseFlagsPagedResponse; +import static com.google.cloud.alloydb.v1.AlloyDBAdminClient.ListUsersPagedResponse; import com.google.api.gax.core.NoCredentialsProvider; import com.google.api.gax.httpjson.GaxHttpJsonProperties; @@ -212,6 +213,8 @@ public void getClusterTest() throws Exception { .setSslConfig(SslConfig.newBuilder().build()) .setEncryptionConfig(EncryptionConfig.newBuilder().build()) .setEncryptionInfo(EncryptionInfo.newBuilder().build()) + .setContinuousBackupConfig(ContinuousBackupConfig.newBuilder().build()) + .setContinuousBackupInfo(ContinuousBackupInfo.newBuilder().build()) .setSecondaryConfig(Cluster.SecondaryConfig.newBuilder().build()) .setPrimaryConfig(Cluster.PrimaryConfig.newBuilder().build()) .build(); @@ -274,6 +277,8 @@ public void getClusterTest2() throws Exception { .setSslConfig(SslConfig.newBuilder().build()) .setEncryptionConfig(EncryptionConfig.newBuilder().build()) .setEncryptionInfo(EncryptionInfo.newBuilder().build()) + .setContinuousBackupConfig(ContinuousBackupConfig.newBuilder().build()) + .setContinuousBackupInfo(ContinuousBackupInfo.newBuilder().build()) .setSecondaryConfig(Cluster.SecondaryConfig.newBuilder().build()) .setPrimaryConfig(Cluster.PrimaryConfig.newBuilder().build()) .build(); @@ -336,6 +341,8 @@ public void createClusterTest() throws Exception { .setSslConfig(SslConfig.newBuilder().build()) .setEncryptionConfig(EncryptionConfig.newBuilder().build()) .setEncryptionInfo(EncryptionInfo.newBuilder().build()) + .setContinuousBackupConfig(ContinuousBackupConfig.newBuilder().build()) + .setContinuousBackupInfo(ContinuousBackupInfo.newBuilder().build()) .setSecondaryConfig(Cluster.SecondaryConfig.newBuilder().build()) .setPrimaryConfig(Cluster.PrimaryConfig.newBuilder().build()) .build(); @@ -407,6 +414,8 @@ public void createClusterTest2() throws Exception { .setSslConfig(SslConfig.newBuilder().build()) .setEncryptionConfig(EncryptionConfig.newBuilder().build()) .setEncryptionInfo(EncryptionInfo.newBuilder().build()) + .setContinuousBackupConfig(ContinuousBackupConfig.newBuilder().build()) + .setContinuousBackupInfo(ContinuousBackupInfo.newBuilder().build()) .setSecondaryConfig(Cluster.SecondaryConfig.newBuilder().build()) .setPrimaryConfig(Cluster.PrimaryConfig.newBuilder().build()) .build(); @@ -478,6 +487,8 @@ public void updateClusterTest() throws Exception { .setSslConfig(SslConfig.newBuilder().build()) .setEncryptionConfig(EncryptionConfig.newBuilder().build()) .setEncryptionInfo(EncryptionInfo.newBuilder().build()) + .setContinuousBackupConfig(ContinuousBackupConfig.newBuilder().build()) + .setContinuousBackupInfo(ContinuousBackupInfo.newBuilder().build()) .setSecondaryConfig(Cluster.SecondaryConfig.newBuilder().build()) .setPrimaryConfig(Cluster.PrimaryConfig.newBuilder().build()) .build(); @@ -508,6 +519,8 @@ public void updateClusterTest() throws Exception { .setSslConfig(SslConfig.newBuilder().build()) .setEncryptionConfig(EncryptionConfig.newBuilder().build()) .setEncryptionInfo(EncryptionInfo.newBuilder().build()) + .setContinuousBackupConfig(ContinuousBackupConfig.newBuilder().build()) + .setContinuousBackupInfo(ContinuousBackupInfo.newBuilder().build()) .setSecondaryConfig(Cluster.SecondaryConfig.newBuilder().build()) .setPrimaryConfig(Cluster.PrimaryConfig.newBuilder().build()) .build(); @@ -558,6 +571,8 @@ public void updateClusterExceptionTest() throws Exception { .setSslConfig(SslConfig.newBuilder().build()) .setEncryptionConfig(EncryptionConfig.newBuilder().build()) .setEncryptionInfo(EncryptionInfo.newBuilder().build()) + .setContinuousBackupConfig(ContinuousBackupConfig.newBuilder().build()) + .setContinuousBackupInfo(ContinuousBackupInfo.newBuilder().build()) .setSecondaryConfig(Cluster.SecondaryConfig.newBuilder().build()) .setPrimaryConfig(Cluster.PrimaryConfig.newBuilder().build()) .build(); @@ -658,6 +673,144 @@ public void deleteClusterExceptionTest2() throws Exception { } } + @Test + public void promoteClusterTest() throws Exception { + Cluster expectedResponse = + Cluster.newBuilder() + .setName(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString()) + .setDisplayName("displayName1714148973") + .setUid("uid115792") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setDeleteTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .setDatabaseVersion(DatabaseVersion.forNumber(0)) + .setNetwork("network1843485230") + .setEtag("etag3123477") + .putAllAnnotations(new HashMap()) + .setReconciling(true) + .setInitialUser(UserPassword.newBuilder().build()) + .setAutomatedBackupPolicy(AutomatedBackupPolicy.newBuilder().build()) + .setSslConfig(SslConfig.newBuilder().build()) + .setEncryptionConfig(EncryptionConfig.newBuilder().build()) + .setEncryptionInfo(EncryptionInfo.newBuilder().build()) + .setContinuousBackupConfig(ContinuousBackupConfig.newBuilder().build()) + .setContinuousBackupInfo(ContinuousBackupInfo.newBuilder().build()) + .setSecondaryConfig(Cluster.SecondaryConfig.newBuilder().build()) + .setPrimaryConfig(Cluster.PrimaryConfig.newBuilder().build()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("promoteClusterTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + ClusterName name = ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]"); + + Cluster actualResponse = client.promoteClusterAsync(name).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void promoteClusterExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ClusterName name = ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]"); + client.promoteClusterAsync(name).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @Test + public void promoteClusterTest2() throws Exception { + Cluster expectedResponse = + Cluster.newBuilder() + .setName(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString()) + .setDisplayName("displayName1714148973") + .setUid("uid115792") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setDeleteTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .setDatabaseVersion(DatabaseVersion.forNumber(0)) + .setNetwork("network1843485230") + .setEtag("etag3123477") + .putAllAnnotations(new HashMap()) + .setReconciling(true) + .setInitialUser(UserPassword.newBuilder().build()) + .setAutomatedBackupPolicy(AutomatedBackupPolicy.newBuilder().build()) + .setSslConfig(SslConfig.newBuilder().build()) + .setEncryptionConfig(EncryptionConfig.newBuilder().build()) + .setEncryptionInfo(EncryptionInfo.newBuilder().build()) + .setContinuousBackupConfig(ContinuousBackupConfig.newBuilder().build()) + .setContinuousBackupInfo(ContinuousBackupInfo.newBuilder().build()) + .setSecondaryConfig(Cluster.SecondaryConfig.newBuilder().build()) + .setPrimaryConfig(Cluster.PrimaryConfig.newBuilder().build()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("promoteClusterTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + String name = "projects/project-6537/locations/location-6537/clusters/cluster-6537"; + + Cluster actualResponse = client.promoteClusterAsync(name).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void promoteClusterExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = "projects/project-6537/locations/location-6537/clusters/cluster-6537"; + client.promoteClusterAsync(name).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + @Test public void restoreClusterTest() throws Exception { Cluster expectedResponse = @@ -679,6 +832,8 @@ public void restoreClusterTest() throws Exception { .setSslConfig(SslConfig.newBuilder().build()) .setEncryptionConfig(EncryptionConfig.newBuilder().build()) .setEncryptionInfo(EncryptionInfo.newBuilder().build()) + .setContinuousBackupConfig(ContinuousBackupConfig.newBuilder().build()) + .setContinuousBackupInfo(ContinuousBackupInfo.newBuilder().build()) .setSecondaryConfig(Cluster.SecondaryConfig.newBuilder().build()) .setPrimaryConfig(Cluster.PrimaryConfig.newBuilder().build()) .build(); @@ -739,6 +894,152 @@ public void restoreClusterExceptionTest() throws Exception { } } + @Test + public void createSecondaryClusterTest() throws Exception { + Cluster expectedResponse = + Cluster.newBuilder() + .setName(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString()) + .setDisplayName("displayName1714148973") + .setUid("uid115792") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setDeleteTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .setDatabaseVersion(DatabaseVersion.forNumber(0)) + .setNetwork("network1843485230") + .setEtag("etag3123477") + .putAllAnnotations(new HashMap()) + .setReconciling(true) + .setInitialUser(UserPassword.newBuilder().build()) + .setAutomatedBackupPolicy(AutomatedBackupPolicy.newBuilder().build()) + .setSslConfig(SslConfig.newBuilder().build()) + .setEncryptionConfig(EncryptionConfig.newBuilder().build()) + .setEncryptionInfo(EncryptionInfo.newBuilder().build()) + .setContinuousBackupConfig(ContinuousBackupConfig.newBuilder().build()) + .setContinuousBackupInfo(ContinuousBackupInfo.newBuilder().build()) + .setSecondaryConfig(Cluster.SecondaryConfig.newBuilder().build()) + .setPrimaryConfig(Cluster.PrimaryConfig.newBuilder().build()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("createSecondaryClusterTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + Cluster cluster = Cluster.newBuilder().build(); + String clusterId = "clusterId561939637"; + + Cluster actualResponse = client.createSecondaryClusterAsync(parent, cluster, clusterId).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void createSecondaryClusterExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + Cluster cluster = Cluster.newBuilder().build(); + String clusterId = "clusterId561939637"; + client.createSecondaryClusterAsync(parent, cluster, clusterId).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @Test + public void createSecondaryClusterTest2() throws Exception { + Cluster expectedResponse = + Cluster.newBuilder() + .setName(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString()) + .setDisplayName("displayName1714148973") + .setUid("uid115792") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setDeleteTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .setDatabaseVersion(DatabaseVersion.forNumber(0)) + .setNetwork("network1843485230") + .setEtag("etag3123477") + .putAllAnnotations(new HashMap()) + .setReconciling(true) + .setInitialUser(UserPassword.newBuilder().build()) + .setAutomatedBackupPolicy(AutomatedBackupPolicy.newBuilder().build()) + .setSslConfig(SslConfig.newBuilder().build()) + .setEncryptionConfig(EncryptionConfig.newBuilder().build()) + .setEncryptionInfo(EncryptionInfo.newBuilder().build()) + .setContinuousBackupConfig(ContinuousBackupConfig.newBuilder().build()) + .setContinuousBackupInfo(ContinuousBackupInfo.newBuilder().build()) + .setSecondaryConfig(Cluster.SecondaryConfig.newBuilder().build()) + .setPrimaryConfig(Cluster.PrimaryConfig.newBuilder().build()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("createSecondaryClusterTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + String parent = "projects/project-5833/locations/location-5833"; + Cluster cluster = Cluster.newBuilder().build(); + String clusterId = "clusterId561939637"; + + Cluster actualResponse = client.createSecondaryClusterAsync(parent, cluster, clusterId).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void createSecondaryClusterExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String parent = "projects/project-5833/locations/location-5833"; + Cluster cluster = Cluster.newBuilder().build(); + String clusterId = "clusterId561939637"; + client.createSecondaryClusterAsync(parent, cluster, clusterId).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + @Test public void listInstancesTest() throws Exception { Instance responsesElement = Instance.newBuilder().build(); @@ -1107,6 +1408,150 @@ public void createInstanceExceptionTest2() throws Exception { } } + @Test + public void createSecondaryInstanceTest() throws Exception { + Instance expectedResponse = + Instance.newBuilder() + .setName( + InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]").toString()) + .setDisplayName("displayName1714148973") + .setUid("uid115792") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setDeleteTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .setMachineConfig(Instance.MachineConfig.newBuilder().build()) + .setGceZone("gceZone-146048427") + .putAllDatabaseFlags(new HashMap()) + .setWritableNode(Instance.Node.newBuilder().build()) + .addAllNodes(new ArrayList()) + .setQueryInsightsConfig(Instance.QueryInsightsInstanceConfig.newBuilder().build()) + .setReadPoolConfig(Instance.ReadPoolConfig.newBuilder().build()) + .setIpAddress("ipAddress1634032845") + .setReconciling(true) + .setEtag("etag3123477") + .putAllAnnotations(new HashMap()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("createSecondaryInstanceTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + ClusterName parent = ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]"); + Instance instance = Instance.newBuilder().build(); + String instanceId = "instanceId902024336"; + + Instance actualResponse = + client.createSecondaryInstanceAsync(parent, instance, instanceId).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void createSecondaryInstanceExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ClusterName parent = ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]"); + Instance instance = Instance.newBuilder().build(); + String instanceId = "instanceId902024336"; + client.createSecondaryInstanceAsync(parent, instance, instanceId).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @Test + public void createSecondaryInstanceTest2() throws Exception { + Instance expectedResponse = + Instance.newBuilder() + .setName( + InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]").toString()) + .setDisplayName("displayName1714148973") + .setUid("uid115792") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setDeleteTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .setMachineConfig(Instance.MachineConfig.newBuilder().build()) + .setGceZone("gceZone-146048427") + .putAllDatabaseFlags(new HashMap()) + .setWritableNode(Instance.Node.newBuilder().build()) + .addAllNodes(new ArrayList()) + .setQueryInsightsConfig(Instance.QueryInsightsInstanceConfig.newBuilder().build()) + .setReadPoolConfig(Instance.ReadPoolConfig.newBuilder().build()) + .setIpAddress("ipAddress1634032845") + .setReconciling(true) + .setEtag("etag3123477") + .putAllAnnotations(new HashMap()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("createSecondaryInstanceTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + String parent = "projects/project-9466/locations/location-9466/clusters/cluster-9466"; + Instance instance = Instance.newBuilder().build(); + String instanceId = "instanceId902024336"; + + Instance actualResponse = + client.createSecondaryInstanceAsync(parent, instance, instanceId).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void createSecondaryInstanceExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String parent = "projects/project-9466/locations/location-9466/clusters/cluster-9466"; + Instance instance = Instance.newBuilder().build(); + String instanceId = "instanceId902024336"; + client.createSecondaryInstanceAsync(parent, instance, instanceId).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + @Test public void batchCreateInstancesTest() throws Exception { BatchCreateInstancesResponse expectedResponse = @@ -1506,7 +1951,7 @@ public void failoverInstanceExceptionTest2() throws Exception { } @Test - public void restartInstanceTest() throws Exception { + public void injectFaultTest() throws Exception { Instance expectedResponse = Instance.newBuilder() .setName( @@ -1531,15 +1976,16 @@ public void restartInstanceTest() throws Exception { .build(); Operation resultOperation = Operation.newBuilder() - .setName("restartInstanceTest") + .setName("injectFaultTest") .setDone(true) .setResponse(Any.pack(expectedResponse)) .build(); mockService.addResponse(resultOperation); + InjectFaultRequest.FaultType faultType = InjectFaultRequest.FaultType.forNumber(0); InstanceName name = InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]"); - Instance actualResponse = client.restartInstanceAsync(name).get(); + Instance actualResponse = client.injectFaultAsync(faultType, name).get(); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); @@ -1558,22 +2004,23 @@ public void restartInstanceTest() throws Exception { } @Test - public void restartInstanceExceptionTest() throws Exception { + public void injectFaultExceptionTest() throws Exception { ApiException exception = ApiExceptionFactory.createException( new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { + InjectFaultRequest.FaultType faultType = InjectFaultRequest.FaultType.forNumber(0); InstanceName name = InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]"); - client.restartInstanceAsync(name).get(); + client.injectFaultAsync(faultType, name).get(); Assert.fail("No exception raised"); } catch (ExecutionException e) { } } @Test - public void restartInstanceTest2() throws Exception { + public void injectFaultTest2() throws Exception { Instance expectedResponse = Instance.newBuilder() .setName( @@ -1598,16 +2045,17 @@ public void restartInstanceTest2() throws Exception { .build(); Operation resultOperation = Operation.newBuilder() - .setName("restartInstanceTest") + .setName("injectFaultTest") .setDone(true) .setResponse(Any.pack(expectedResponse)) .build(); mockService.addResponse(resultOperation); + InjectFaultRequest.FaultType faultType = InjectFaultRequest.FaultType.forNumber(0); String name = "projects/project-867/locations/location-867/clusters/cluster-867/instances/instance-867"; - Instance actualResponse = client.restartInstanceAsync(name).get(); + Instance actualResponse = client.injectFaultAsync(faultType, name).get(); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); @@ -1626,39 +2074,58 @@ public void restartInstanceTest2() throws Exception { } @Test - public void restartInstanceExceptionTest2() throws Exception { + public void injectFaultExceptionTest2() throws Exception { ApiException exception = ApiExceptionFactory.createException( new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { + InjectFaultRequest.FaultType faultType = InjectFaultRequest.FaultType.forNumber(0); String name = "projects/project-867/locations/location-867/clusters/cluster-867/instances/instance-867"; - client.restartInstanceAsync(name).get(); + client.injectFaultAsync(faultType, name).get(); Assert.fail("No exception raised"); } catch (ExecutionException e) { } } @Test - public void listBackupsTest() throws Exception { - Backup responsesElement = Backup.newBuilder().build(); - ListBackupsResponse expectedResponse = - ListBackupsResponse.newBuilder() - .setNextPageToken("") - .addAllBackups(Arrays.asList(responsesElement)) + public void restartInstanceTest() throws Exception { + Instance expectedResponse = + Instance.newBuilder() + .setName( + InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]").toString()) + .setDisplayName("displayName1714148973") + .setUid("uid115792") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setDeleteTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .setMachineConfig(Instance.MachineConfig.newBuilder().build()) + .setGceZone("gceZone-146048427") + .putAllDatabaseFlags(new HashMap()) + .setWritableNode(Instance.Node.newBuilder().build()) + .addAllNodes(new ArrayList()) + .setQueryInsightsConfig(Instance.QueryInsightsInstanceConfig.newBuilder().build()) + .setReadPoolConfig(Instance.ReadPoolConfig.newBuilder().build()) + .setIpAddress("ipAddress1634032845") + .setReconciling(true) + .setEtag("etag3123477") + .putAllAnnotations(new HashMap()) .build(); - mockService.addResponse(expectedResponse); - - LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); - - ListBackupsPagedResponse pagedListResponse = client.listBackups(parent); + Operation resultOperation = + Operation.newBuilder() + .setName("restartInstanceTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); - List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + InstanceName name = InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]"); - Assert.assertEquals(1, resources.size()); - Assert.assertEquals(expectedResponse.getBackupsList().get(0), resources.get(0)); + Instance actualResponse = client.restartInstanceAsync(name).get(); + Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); @@ -1676,39 +2143,57 @@ public void listBackupsTest() throws Exception { } @Test - public void listBackupsExceptionTest() throws Exception { + public void restartInstanceExceptionTest() throws Exception { ApiException exception = ApiExceptionFactory.createException( new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { - LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); - client.listBackups(parent); + InstanceName name = InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]"); + client.restartInstanceAsync(name).get(); Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. + } catch (ExecutionException e) { } } @Test - public void listBackupsTest2() throws Exception { - Backup responsesElement = Backup.newBuilder().build(); - ListBackupsResponse expectedResponse = - ListBackupsResponse.newBuilder() - .setNextPageToken("") - .addAllBackups(Arrays.asList(responsesElement)) + public void restartInstanceTest2() throws Exception { + Instance expectedResponse = + Instance.newBuilder() + .setName( + InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]").toString()) + .setDisplayName("displayName1714148973") + .setUid("uid115792") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setDeleteTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .setMachineConfig(Instance.MachineConfig.newBuilder().build()) + .setGceZone("gceZone-146048427") + .putAllDatabaseFlags(new HashMap()) + .setWritableNode(Instance.Node.newBuilder().build()) + .addAllNodes(new ArrayList()) + .setQueryInsightsConfig(Instance.QueryInsightsInstanceConfig.newBuilder().build()) + .setReadPoolConfig(Instance.ReadPoolConfig.newBuilder().build()) + .setIpAddress("ipAddress1634032845") + .setReconciling(true) + .setEtag("etag3123477") + .putAllAnnotations(new HashMap()) .build(); - mockService.addResponse(expectedResponse); - - String parent = "projects/project-5833/locations/location-5833"; - - ListBackupsPagedResponse pagedListResponse = client.listBackups(parent); + Operation resultOperation = + Operation.newBuilder() + .setName("restartInstanceTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); - List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + String name = + "projects/project-867/locations/location-867/clusters/cluster-867/instances/instance-867"; - Assert.assertEquals(1, resources.size()); - Assert.assertEquals(expectedResponse.getBackupsList().get(0), resources.get(0)); + Instance actualResponse = client.restartInstanceAsync(name).get(); + Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); @@ -1726,24 +2211,124 @@ public void listBackupsTest2() throws Exception { } @Test - public void listBackupsExceptionTest2() throws Exception { + public void restartInstanceExceptionTest2() throws Exception { ApiException exception = ApiExceptionFactory.createException( new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { - String parent = "projects/project-5833/locations/location-5833"; - client.listBackups(parent); + String name = + "projects/project-867/locations/location-867/clusters/cluster-867/instances/instance-867"; + client.restartInstanceAsync(name).get(); Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. + } catch (ExecutionException e) { } } @Test - public void getBackupTest() throws Exception { - Backup expectedResponse = + public void listBackupsTest() throws Exception { + Backup responsesElement = Backup.newBuilder().build(); + ListBackupsResponse expectedResponse = + ListBackupsResponse.newBuilder() + .setNextPageToken("") + .addAllBackups(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + + ListBackupsPagedResponse pagedListResponse = client.listBackups(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getBackupsList().get(0), resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void listBackupsExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + client.listBackups(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listBackupsTest2() throws Exception { + Backup responsesElement = Backup.newBuilder().build(); + ListBackupsResponse expectedResponse = + ListBackupsResponse.newBuilder() + .setNextPageToken("") + .addAllBackups(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + String parent = "projects/project-5833/locations/location-5833"; + + ListBackupsPagedResponse pagedListResponse = client.listBackups(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getBackupsList().get(0), resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void listBackupsExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String parent = "projects/project-5833/locations/location-5833"; + client.listBackups(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getBackupTest() throws Exception { + Backup expectedResponse = Backup.newBuilder() .setName(BackupName.of("[PROJECT]", "[LOCATION]", "[BACKUP]").toString()) .setDisplayName("displayName1714148973") @@ -2296,6 +2881,440 @@ public void listSupportedDatabaseFlagsExceptionTest2() throws Exception { } } + @Test + public void listUsersTest() throws Exception { + User responsesElement = User.newBuilder().build(); + ListUsersResponse expectedResponse = + ListUsersResponse.newBuilder() + .setNextPageToken("") + .addAllUsers(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + ClusterName parent = ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]"); + + ListUsersPagedResponse pagedListResponse = client.listUsers(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getUsersList().get(0), resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void listUsersExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ClusterName parent = ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]"); + client.listUsers(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listUsersTest2() throws Exception { + User responsesElement = User.newBuilder().build(); + ListUsersResponse expectedResponse = + ListUsersResponse.newBuilder() + .setNextPageToken("") + .addAllUsers(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + String parent = "projects/project-9466/locations/location-9466/clusters/cluster-9466"; + + ListUsersPagedResponse pagedListResponse = client.listUsers(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getUsersList().get(0), resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void listUsersExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String parent = "projects/project-9466/locations/location-9466/clusters/cluster-9466"; + client.listUsers(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getUserTest() throws Exception { + User expectedResponse = + User.newBuilder() + .setName(UserName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[USER]").toString()) + .setPassword("password1216985755") + .addAllDatabaseRoles(new ArrayList()) + .build(); + mockService.addResponse(expectedResponse); + + UserName name = UserName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[USER]"); + + User actualResponse = client.getUser(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void getUserExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + UserName name = UserName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[USER]"); + client.getUser(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getUserTest2() throws Exception { + User expectedResponse = + User.newBuilder() + .setName(UserName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[USER]").toString()) + .setPassword("password1216985755") + .addAllDatabaseRoles(new ArrayList()) + .build(); + mockService.addResponse(expectedResponse); + + String name = + "projects/project-6835/locations/location-6835/clusters/cluster-6835/users/user-6835"; + + User actualResponse = client.getUser(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void getUserExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = + "projects/project-6835/locations/location-6835/clusters/cluster-6835/users/user-6835"; + client.getUser(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createUserTest() throws Exception { + User expectedResponse = + User.newBuilder() + .setName(UserName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[USER]").toString()) + .setPassword("password1216985755") + .addAllDatabaseRoles(new ArrayList()) + .build(); + mockService.addResponse(expectedResponse); + + ClusterName parent = ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]"); + User user = User.newBuilder().build(); + String userId = "userId-836030906"; + + User actualResponse = client.createUser(parent, user, userId); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void createUserExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ClusterName parent = ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]"); + User user = User.newBuilder().build(); + String userId = "userId-836030906"; + client.createUser(parent, user, userId); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createUserTest2() throws Exception { + User expectedResponse = + User.newBuilder() + .setName(UserName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[USER]").toString()) + .setPassword("password1216985755") + .addAllDatabaseRoles(new ArrayList()) + .build(); + mockService.addResponse(expectedResponse); + + String parent = "projects/project-9466/locations/location-9466/clusters/cluster-9466"; + User user = User.newBuilder().build(); + String userId = "userId-836030906"; + + User actualResponse = client.createUser(parent, user, userId); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void createUserExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String parent = "projects/project-9466/locations/location-9466/clusters/cluster-9466"; + User user = User.newBuilder().build(); + String userId = "userId-836030906"; + client.createUser(parent, user, userId); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void updateUserTest() throws Exception { + User expectedResponse = + User.newBuilder() + .setName(UserName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[USER]").toString()) + .setPassword("password1216985755") + .addAllDatabaseRoles(new ArrayList()) + .build(); + mockService.addResponse(expectedResponse); + + User user = + User.newBuilder() + .setName(UserName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[USER]").toString()) + .setPassword("password1216985755") + .addAllDatabaseRoles(new ArrayList()) + .build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + + User actualResponse = client.updateUser(user, updateMask); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void updateUserExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + User user = + User.newBuilder() + .setName(UserName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[USER]").toString()) + .setPassword("password1216985755") + .addAllDatabaseRoles(new ArrayList()) + .build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + client.updateUser(user, updateMask); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deleteUserTest() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockService.addResponse(expectedResponse); + + UserName name = UserName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[USER]"); + + client.deleteUser(name); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void deleteUserExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + UserName name = UserName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[USER]"); + client.deleteUser(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deleteUserTest2() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockService.addResponse(expectedResponse); + + String name = + "projects/project-6835/locations/location-6835/clusters/cluster-6835/users/user-6835"; + + client.deleteUser(name); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void deleteUserExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = + "projects/project-6835/locations/location-6835/clusters/cluster-6835/users/user-6835"; + client.deleteUser(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + @Test public void listLocationsTest() throws Exception { Location responsesElement = Location.newBuilder().build(); diff --git a/java-alloydb/google-cloud-alloydb/src/test/java/com/google/cloud/alloydb/v1/AlloyDBAdminClientTest.java b/java-alloydb/google-cloud-alloydb/src/test/java/com/google/cloud/alloydb/v1/AlloyDBAdminClientTest.java index cc94b652ad1a..8ed77acf5435 100644 --- a/java-alloydb/google-cloud-alloydb/src/test/java/com/google/cloud/alloydb/v1/AlloyDBAdminClientTest.java +++ b/java-alloydb/google-cloud-alloydb/src/test/java/com/google/cloud/alloydb/v1/AlloyDBAdminClientTest.java @@ -21,6 +21,7 @@ import static com.google.cloud.alloydb.v1.AlloyDBAdminClient.ListInstancesPagedResponse; import static com.google.cloud.alloydb.v1.AlloyDBAdminClient.ListLocationsPagedResponse; import static com.google.cloud.alloydb.v1.AlloyDBAdminClient.ListSupportedDatabaseFlagsPagedResponse; +import static com.google.cloud.alloydb.v1.AlloyDBAdminClient.ListUsersPagedResponse; import com.google.api.gax.core.NoCredentialsProvider; import com.google.api.gax.grpc.GaxGrpcProperties; @@ -209,6 +210,8 @@ public void getClusterTest() throws Exception { .setSslConfig(SslConfig.newBuilder().build()) .setEncryptionConfig(EncryptionConfig.newBuilder().build()) .setEncryptionInfo(EncryptionInfo.newBuilder().build()) + .setContinuousBackupConfig(ContinuousBackupConfig.newBuilder().build()) + .setContinuousBackupInfo(ContinuousBackupInfo.newBuilder().build()) .setSecondaryConfig(Cluster.SecondaryConfig.newBuilder().build()) .setPrimaryConfig(Cluster.PrimaryConfig.newBuilder().build()) .build(); @@ -265,6 +268,8 @@ public void getClusterTest2() throws Exception { .setSslConfig(SslConfig.newBuilder().build()) .setEncryptionConfig(EncryptionConfig.newBuilder().build()) .setEncryptionInfo(EncryptionInfo.newBuilder().build()) + .setContinuousBackupConfig(ContinuousBackupConfig.newBuilder().build()) + .setContinuousBackupInfo(ContinuousBackupInfo.newBuilder().build()) .setSecondaryConfig(Cluster.SecondaryConfig.newBuilder().build()) .setPrimaryConfig(Cluster.PrimaryConfig.newBuilder().build()) .build(); @@ -321,6 +326,8 @@ public void createClusterTest() throws Exception { .setSslConfig(SslConfig.newBuilder().build()) .setEncryptionConfig(EncryptionConfig.newBuilder().build()) .setEncryptionInfo(EncryptionInfo.newBuilder().build()) + .setContinuousBackupConfig(ContinuousBackupConfig.newBuilder().build()) + .setContinuousBackupInfo(ContinuousBackupInfo.newBuilder().build()) .setSecondaryConfig(Cluster.SecondaryConfig.newBuilder().build()) .setPrimaryConfig(Cluster.PrimaryConfig.newBuilder().build()) .build(); @@ -391,6 +398,8 @@ public void createClusterTest2() throws Exception { .setSslConfig(SslConfig.newBuilder().build()) .setEncryptionConfig(EncryptionConfig.newBuilder().build()) .setEncryptionInfo(EncryptionInfo.newBuilder().build()) + .setContinuousBackupConfig(ContinuousBackupConfig.newBuilder().build()) + .setContinuousBackupInfo(ContinuousBackupInfo.newBuilder().build()) .setSecondaryConfig(Cluster.SecondaryConfig.newBuilder().build()) .setPrimaryConfig(Cluster.PrimaryConfig.newBuilder().build()) .build(); @@ -461,6 +470,8 @@ public void updateClusterTest() throws Exception { .setSslConfig(SslConfig.newBuilder().build()) .setEncryptionConfig(EncryptionConfig.newBuilder().build()) .setEncryptionInfo(EncryptionInfo.newBuilder().build()) + .setContinuousBackupConfig(ContinuousBackupConfig.newBuilder().build()) + .setContinuousBackupInfo(ContinuousBackupInfo.newBuilder().build()) .setSecondaryConfig(Cluster.SecondaryConfig.newBuilder().build()) .setPrimaryConfig(Cluster.PrimaryConfig.newBuilder().build()) .build(); @@ -591,6 +602,138 @@ public void deleteClusterExceptionTest2() throws Exception { } } + @Test + public void promoteClusterTest() throws Exception { + Cluster expectedResponse = + Cluster.newBuilder() + .setName(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString()) + .setDisplayName("displayName1714148973") + .setUid("uid115792") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setDeleteTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .setDatabaseVersion(DatabaseVersion.forNumber(0)) + .setNetwork("network1843485230") + .setEtag("etag3123477") + .putAllAnnotations(new HashMap()) + .setReconciling(true) + .setInitialUser(UserPassword.newBuilder().build()) + .setAutomatedBackupPolicy(AutomatedBackupPolicy.newBuilder().build()) + .setSslConfig(SslConfig.newBuilder().build()) + .setEncryptionConfig(EncryptionConfig.newBuilder().build()) + .setEncryptionInfo(EncryptionInfo.newBuilder().build()) + .setContinuousBackupConfig(ContinuousBackupConfig.newBuilder().build()) + .setContinuousBackupInfo(ContinuousBackupInfo.newBuilder().build()) + .setSecondaryConfig(Cluster.SecondaryConfig.newBuilder().build()) + .setPrimaryConfig(Cluster.PrimaryConfig.newBuilder().build()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("promoteClusterTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockAlloyDBAdmin.addResponse(resultOperation); + + ClusterName name = ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]"); + + Cluster actualResponse = client.promoteClusterAsync(name).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockAlloyDBAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + PromoteClusterRequest actualRequest = ((PromoteClusterRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void promoteClusterExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockAlloyDBAdmin.addException(exception); + + try { + ClusterName name = ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]"); + client.promoteClusterAsync(name).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + public void promoteClusterTest2() throws Exception { + Cluster expectedResponse = + Cluster.newBuilder() + .setName(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString()) + .setDisplayName("displayName1714148973") + .setUid("uid115792") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setDeleteTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .setDatabaseVersion(DatabaseVersion.forNumber(0)) + .setNetwork("network1843485230") + .setEtag("etag3123477") + .putAllAnnotations(new HashMap()) + .setReconciling(true) + .setInitialUser(UserPassword.newBuilder().build()) + .setAutomatedBackupPolicy(AutomatedBackupPolicy.newBuilder().build()) + .setSslConfig(SslConfig.newBuilder().build()) + .setEncryptionConfig(EncryptionConfig.newBuilder().build()) + .setEncryptionInfo(EncryptionInfo.newBuilder().build()) + .setContinuousBackupConfig(ContinuousBackupConfig.newBuilder().build()) + .setContinuousBackupInfo(ContinuousBackupInfo.newBuilder().build()) + .setSecondaryConfig(Cluster.SecondaryConfig.newBuilder().build()) + .setPrimaryConfig(Cluster.PrimaryConfig.newBuilder().build()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("promoteClusterTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockAlloyDBAdmin.addResponse(resultOperation); + + String name = "name3373707"; + + Cluster actualResponse = client.promoteClusterAsync(name).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockAlloyDBAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + PromoteClusterRequest actualRequest = ((PromoteClusterRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void promoteClusterExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockAlloyDBAdmin.addException(exception); + + try { + String name = "name3373707"; + client.promoteClusterAsync(name).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + @Test public void restoreClusterTest() throws Exception { Cluster expectedResponse = @@ -612,6 +755,8 @@ public void restoreClusterTest() throws Exception { .setSslConfig(SslConfig.newBuilder().build()) .setEncryptionConfig(EncryptionConfig.newBuilder().build()) .setEncryptionInfo(EncryptionInfo.newBuilder().build()) + .setContinuousBackupConfig(ContinuousBackupConfig.newBuilder().build()) + .setContinuousBackupInfo(ContinuousBackupInfo.newBuilder().build()) .setSecondaryConfig(Cluster.SecondaryConfig.newBuilder().build()) .setPrimaryConfig(Cluster.PrimaryConfig.newBuilder().build()) .build(); @@ -640,6 +785,8 @@ public void restoreClusterTest() throws Exception { RestoreClusterRequest actualRequest = ((RestoreClusterRequest) actualRequests.get(0)); Assert.assertEquals(request.getBackupSource(), actualRequest.getBackupSource()); + Assert.assertEquals( + request.getContinuousBackupSource(), actualRequest.getContinuousBackupSource()); Assert.assertEquals(request.getParent(), actualRequest.getParent()); Assert.assertEquals(request.getClusterId(), actualRequest.getClusterId()); Assert.assertEquals(request.getCluster(), actualRequest.getCluster()); @@ -674,6 +821,152 @@ public void restoreClusterExceptionTest() throws Exception { } } + @Test + public void createSecondaryClusterTest() throws Exception { + Cluster expectedResponse = + Cluster.newBuilder() + .setName(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString()) + .setDisplayName("displayName1714148973") + .setUid("uid115792") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setDeleteTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .setDatabaseVersion(DatabaseVersion.forNumber(0)) + .setNetwork("network1843485230") + .setEtag("etag3123477") + .putAllAnnotations(new HashMap()) + .setReconciling(true) + .setInitialUser(UserPassword.newBuilder().build()) + .setAutomatedBackupPolicy(AutomatedBackupPolicy.newBuilder().build()) + .setSslConfig(SslConfig.newBuilder().build()) + .setEncryptionConfig(EncryptionConfig.newBuilder().build()) + .setEncryptionInfo(EncryptionInfo.newBuilder().build()) + .setContinuousBackupConfig(ContinuousBackupConfig.newBuilder().build()) + .setContinuousBackupInfo(ContinuousBackupInfo.newBuilder().build()) + .setSecondaryConfig(Cluster.SecondaryConfig.newBuilder().build()) + .setPrimaryConfig(Cluster.PrimaryConfig.newBuilder().build()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("createSecondaryClusterTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockAlloyDBAdmin.addResponse(resultOperation); + + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + Cluster cluster = Cluster.newBuilder().build(); + String clusterId = "clusterId561939637"; + + Cluster actualResponse = client.createSecondaryClusterAsync(parent, cluster, clusterId).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockAlloyDBAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateSecondaryClusterRequest actualRequest = + ((CreateSecondaryClusterRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertEquals(cluster, actualRequest.getCluster()); + Assert.assertEquals(clusterId, actualRequest.getClusterId()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createSecondaryClusterExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockAlloyDBAdmin.addException(exception); + + try { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + Cluster cluster = Cluster.newBuilder().build(); + String clusterId = "clusterId561939637"; + client.createSecondaryClusterAsync(parent, cluster, clusterId).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + public void createSecondaryClusterTest2() throws Exception { + Cluster expectedResponse = + Cluster.newBuilder() + .setName(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString()) + .setDisplayName("displayName1714148973") + .setUid("uid115792") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setDeleteTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .setDatabaseVersion(DatabaseVersion.forNumber(0)) + .setNetwork("network1843485230") + .setEtag("etag3123477") + .putAllAnnotations(new HashMap()) + .setReconciling(true) + .setInitialUser(UserPassword.newBuilder().build()) + .setAutomatedBackupPolicy(AutomatedBackupPolicy.newBuilder().build()) + .setSslConfig(SslConfig.newBuilder().build()) + .setEncryptionConfig(EncryptionConfig.newBuilder().build()) + .setEncryptionInfo(EncryptionInfo.newBuilder().build()) + .setContinuousBackupConfig(ContinuousBackupConfig.newBuilder().build()) + .setContinuousBackupInfo(ContinuousBackupInfo.newBuilder().build()) + .setSecondaryConfig(Cluster.SecondaryConfig.newBuilder().build()) + .setPrimaryConfig(Cluster.PrimaryConfig.newBuilder().build()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("createSecondaryClusterTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockAlloyDBAdmin.addResponse(resultOperation); + + String parent = "parent-995424086"; + Cluster cluster = Cluster.newBuilder().build(); + String clusterId = "clusterId561939637"; + + Cluster actualResponse = client.createSecondaryClusterAsync(parent, cluster, clusterId).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockAlloyDBAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateSecondaryClusterRequest actualRequest = + ((CreateSecondaryClusterRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertEquals(cluster, actualRequest.getCluster()); + Assert.assertEquals(clusterId, actualRequest.getClusterId()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createSecondaryClusterExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockAlloyDBAdmin.addException(exception); + + try { + String parent = "parent-995424086"; + Cluster cluster = Cluster.newBuilder().build(); + String clusterId = "clusterId561939637"; + client.createSecondaryClusterAsync(parent, cluster, clusterId).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + @Test public void listInstancesTest() throws Exception { Instance responsesElement = Instance.newBuilder().build(); @@ -1015,18 +1308,162 @@ public void createInstanceExceptionTest2() throws Exception { } @Test - public void batchCreateInstancesTest() throws Exception { - BatchCreateInstancesResponse expectedResponse = - BatchCreateInstancesResponse.newBuilder() - .addAllInstances(new ArrayList()) - .build(); - Operation resultOperation = - Operation.newBuilder() - .setName("batchCreateInstancesTest") - .setDone(true) - .setResponse(Any.pack(expectedResponse)) - .build(); - mockAlloyDBAdmin.addResponse(resultOperation); + public void createSecondaryInstanceTest() throws Exception { + Instance expectedResponse = + Instance.newBuilder() + .setName( + InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]").toString()) + .setDisplayName("displayName1714148973") + .setUid("uid115792") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setDeleteTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .setMachineConfig(Instance.MachineConfig.newBuilder().build()) + .setGceZone("gceZone-146048427") + .putAllDatabaseFlags(new HashMap()) + .setWritableNode(Instance.Node.newBuilder().build()) + .addAllNodes(new ArrayList()) + .setQueryInsightsConfig(Instance.QueryInsightsInstanceConfig.newBuilder().build()) + .setReadPoolConfig(Instance.ReadPoolConfig.newBuilder().build()) + .setIpAddress("ipAddress1634032845") + .setReconciling(true) + .setEtag("etag3123477") + .putAllAnnotations(new HashMap()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("createSecondaryInstanceTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockAlloyDBAdmin.addResponse(resultOperation); + + ClusterName parent = ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]"); + Instance instance = Instance.newBuilder().build(); + String instanceId = "instanceId902024336"; + + Instance actualResponse = + client.createSecondaryInstanceAsync(parent, instance, instanceId).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockAlloyDBAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateSecondaryInstanceRequest actualRequest = + ((CreateSecondaryInstanceRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertEquals(instance, actualRequest.getInstance()); + Assert.assertEquals(instanceId, actualRequest.getInstanceId()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createSecondaryInstanceExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockAlloyDBAdmin.addException(exception); + + try { + ClusterName parent = ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]"); + Instance instance = Instance.newBuilder().build(); + String instanceId = "instanceId902024336"; + client.createSecondaryInstanceAsync(parent, instance, instanceId).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + public void createSecondaryInstanceTest2() throws Exception { + Instance expectedResponse = + Instance.newBuilder() + .setName( + InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]").toString()) + .setDisplayName("displayName1714148973") + .setUid("uid115792") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setDeleteTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .setMachineConfig(Instance.MachineConfig.newBuilder().build()) + .setGceZone("gceZone-146048427") + .putAllDatabaseFlags(new HashMap()) + .setWritableNode(Instance.Node.newBuilder().build()) + .addAllNodes(new ArrayList()) + .setQueryInsightsConfig(Instance.QueryInsightsInstanceConfig.newBuilder().build()) + .setReadPoolConfig(Instance.ReadPoolConfig.newBuilder().build()) + .setIpAddress("ipAddress1634032845") + .setReconciling(true) + .setEtag("etag3123477") + .putAllAnnotations(new HashMap()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("createSecondaryInstanceTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockAlloyDBAdmin.addResponse(resultOperation); + + String parent = "parent-995424086"; + Instance instance = Instance.newBuilder().build(); + String instanceId = "instanceId902024336"; + + Instance actualResponse = + client.createSecondaryInstanceAsync(parent, instance, instanceId).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockAlloyDBAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateSecondaryInstanceRequest actualRequest = + ((CreateSecondaryInstanceRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertEquals(instance, actualRequest.getInstance()); + Assert.assertEquals(instanceId, actualRequest.getInstanceId()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createSecondaryInstanceExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockAlloyDBAdmin.addException(exception); + + try { + String parent = "parent-995424086"; + Instance instance = Instance.newBuilder().build(); + String instanceId = "instanceId902024336"; + client.createSecondaryInstanceAsync(parent, instance, instanceId).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + public void batchCreateInstancesTest() throws Exception { + BatchCreateInstancesResponse expectedResponse = + BatchCreateInstancesResponse.newBuilder() + .addAllInstances(new ArrayList()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("batchCreateInstancesTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockAlloyDBAdmin.addResponse(resultOperation); BatchCreateInstancesRequest request = BatchCreateInstancesRequest.newBuilder() @@ -1352,6 +1789,140 @@ public void failoverInstanceExceptionTest2() throws Exception { } } + @Test + public void injectFaultTest() throws Exception { + Instance expectedResponse = + Instance.newBuilder() + .setName( + InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]").toString()) + .setDisplayName("displayName1714148973") + .setUid("uid115792") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setDeleteTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .setMachineConfig(Instance.MachineConfig.newBuilder().build()) + .setGceZone("gceZone-146048427") + .putAllDatabaseFlags(new HashMap()) + .setWritableNode(Instance.Node.newBuilder().build()) + .addAllNodes(new ArrayList()) + .setQueryInsightsConfig(Instance.QueryInsightsInstanceConfig.newBuilder().build()) + .setReadPoolConfig(Instance.ReadPoolConfig.newBuilder().build()) + .setIpAddress("ipAddress1634032845") + .setReconciling(true) + .setEtag("etag3123477") + .putAllAnnotations(new HashMap()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("injectFaultTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockAlloyDBAdmin.addResponse(resultOperation); + + InjectFaultRequest.FaultType faultType = InjectFaultRequest.FaultType.forNumber(0); + InstanceName name = InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]"); + + Instance actualResponse = client.injectFaultAsync(faultType, name).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockAlloyDBAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + InjectFaultRequest actualRequest = ((InjectFaultRequest) actualRequests.get(0)); + + Assert.assertEquals(faultType, actualRequest.getFaultType()); + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void injectFaultExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockAlloyDBAdmin.addException(exception); + + try { + InjectFaultRequest.FaultType faultType = InjectFaultRequest.FaultType.forNumber(0); + InstanceName name = InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]"); + client.injectFaultAsync(faultType, name).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + public void injectFaultTest2() throws Exception { + Instance expectedResponse = + Instance.newBuilder() + .setName( + InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]").toString()) + .setDisplayName("displayName1714148973") + .setUid("uid115792") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setDeleteTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .setMachineConfig(Instance.MachineConfig.newBuilder().build()) + .setGceZone("gceZone-146048427") + .putAllDatabaseFlags(new HashMap()) + .setWritableNode(Instance.Node.newBuilder().build()) + .addAllNodes(new ArrayList()) + .setQueryInsightsConfig(Instance.QueryInsightsInstanceConfig.newBuilder().build()) + .setReadPoolConfig(Instance.ReadPoolConfig.newBuilder().build()) + .setIpAddress("ipAddress1634032845") + .setReconciling(true) + .setEtag("etag3123477") + .putAllAnnotations(new HashMap()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("injectFaultTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockAlloyDBAdmin.addResponse(resultOperation); + + InjectFaultRequest.FaultType faultType = InjectFaultRequest.FaultType.forNumber(0); + String name = "name3373707"; + + Instance actualResponse = client.injectFaultAsync(faultType, name).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockAlloyDBAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + InjectFaultRequest actualRequest = ((InjectFaultRequest) actualRequests.get(0)); + + Assert.assertEquals(faultType, actualRequest.getFaultType()); + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void injectFaultExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockAlloyDBAdmin.addException(exception); + + try { + InjectFaultRequest.FaultType faultType = InjectFaultRequest.FaultType.forNumber(0); + String name = "name3373707"; + client.injectFaultAsync(faultType, name).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + @Test public void restartInstanceTest() throws Exception { Instance expectedResponse = @@ -2053,6 +2624,377 @@ public void listSupportedDatabaseFlagsExceptionTest2() throws Exception { } } + @Test + public void listUsersTest() throws Exception { + User responsesElement = User.newBuilder().build(); + ListUsersResponse expectedResponse = + ListUsersResponse.newBuilder() + .setNextPageToken("") + .addAllUsers(Arrays.asList(responsesElement)) + .build(); + mockAlloyDBAdmin.addResponse(expectedResponse); + + ClusterName parent = ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]"); + + ListUsersPagedResponse pagedListResponse = client.listUsers(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getUsersList().get(0), resources.get(0)); + + List actualRequests = mockAlloyDBAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListUsersRequest actualRequest = ((ListUsersRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listUsersExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockAlloyDBAdmin.addException(exception); + + try { + ClusterName parent = ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]"); + client.listUsers(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listUsersTest2() throws Exception { + User responsesElement = User.newBuilder().build(); + ListUsersResponse expectedResponse = + ListUsersResponse.newBuilder() + .setNextPageToken("") + .addAllUsers(Arrays.asList(responsesElement)) + .build(); + mockAlloyDBAdmin.addResponse(expectedResponse); + + String parent = "parent-995424086"; + + ListUsersPagedResponse pagedListResponse = client.listUsers(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getUsersList().get(0), resources.get(0)); + + List actualRequests = mockAlloyDBAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListUsersRequest actualRequest = ((ListUsersRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listUsersExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockAlloyDBAdmin.addException(exception); + + try { + String parent = "parent-995424086"; + client.listUsers(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getUserTest() throws Exception { + User expectedResponse = + User.newBuilder() + .setName(UserName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[USER]").toString()) + .setPassword("password1216985755") + .addAllDatabaseRoles(new ArrayList()) + .build(); + mockAlloyDBAdmin.addResponse(expectedResponse); + + UserName name = UserName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[USER]"); + + User actualResponse = client.getUser(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockAlloyDBAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetUserRequest actualRequest = ((GetUserRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getUserExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockAlloyDBAdmin.addException(exception); + + try { + UserName name = UserName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[USER]"); + client.getUser(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getUserTest2() throws Exception { + User expectedResponse = + User.newBuilder() + .setName(UserName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[USER]").toString()) + .setPassword("password1216985755") + .addAllDatabaseRoles(new ArrayList()) + .build(); + mockAlloyDBAdmin.addResponse(expectedResponse); + + String name = "name3373707"; + + User actualResponse = client.getUser(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockAlloyDBAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetUserRequest actualRequest = ((GetUserRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getUserExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockAlloyDBAdmin.addException(exception); + + try { + String name = "name3373707"; + client.getUser(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createUserTest() throws Exception { + User expectedResponse = + User.newBuilder() + .setName(UserName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[USER]").toString()) + .setPassword("password1216985755") + .addAllDatabaseRoles(new ArrayList()) + .build(); + mockAlloyDBAdmin.addResponse(expectedResponse); + + ClusterName parent = ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]"); + User user = User.newBuilder().build(); + String userId = "userId-836030906"; + + User actualResponse = client.createUser(parent, user, userId); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockAlloyDBAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateUserRequest actualRequest = ((CreateUserRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertEquals(user, actualRequest.getUser()); + Assert.assertEquals(userId, actualRequest.getUserId()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createUserExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockAlloyDBAdmin.addException(exception); + + try { + ClusterName parent = ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]"); + User user = User.newBuilder().build(); + String userId = "userId-836030906"; + client.createUser(parent, user, userId); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createUserTest2() throws Exception { + User expectedResponse = + User.newBuilder() + .setName(UserName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[USER]").toString()) + .setPassword("password1216985755") + .addAllDatabaseRoles(new ArrayList()) + .build(); + mockAlloyDBAdmin.addResponse(expectedResponse); + + String parent = "parent-995424086"; + User user = User.newBuilder().build(); + String userId = "userId-836030906"; + + User actualResponse = client.createUser(parent, user, userId); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockAlloyDBAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateUserRequest actualRequest = ((CreateUserRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertEquals(user, actualRequest.getUser()); + Assert.assertEquals(userId, actualRequest.getUserId()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createUserExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockAlloyDBAdmin.addException(exception); + + try { + String parent = "parent-995424086"; + User user = User.newBuilder().build(); + String userId = "userId-836030906"; + client.createUser(parent, user, userId); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void updateUserTest() throws Exception { + User expectedResponse = + User.newBuilder() + .setName(UserName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[USER]").toString()) + .setPassword("password1216985755") + .addAllDatabaseRoles(new ArrayList()) + .build(); + mockAlloyDBAdmin.addResponse(expectedResponse); + + User user = User.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + + User actualResponse = client.updateUser(user, updateMask); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockAlloyDBAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + UpdateUserRequest actualRequest = ((UpdateUserRequest) actualRequests.get(0)); + + Assert.assertEquals(user, actualRequest.getUser()); + Assert.assertEquals(updateMask, actualRequest.getUpdateMask()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void updateUserExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockAlloyDBAdmin.addException(exception); + + try { + User user = User.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + client.updateUser(user, updateMask); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deleteUserTest() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockAlloyDBAdmin.addResponse(expectedResponse); + + UserName name = UserName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[USER]"); + + client.deleteUser(name); + + List actualRequests = mockAlloyDBAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteUserRequest actualRequest = ((DeleteUserRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void deleteUserExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockAlloyDBAdmin.addException(exception); + + try { + UserName name = UserName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[USER]"); + client.deleteUser(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deleteUserTest2() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockAlloyDBAdmin.addResponse(expectedResponse); + + String name = "name3373707"; + + client.deleteUser(name); + + List actualRequests = mockAlloyDBAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteUserRequest actualRequest = ((DeleteUserRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void deleteUserExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockAlloyDBAdmin.addException(exception); + + try { + String name = "name3373707"; + client.deleteUser(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + @Test public void listLocationsTest() throws Exception { Location responsesElement = Location.newBuilder().build(); diff --git a/java-alloydb/google-cloud-alloydb/src/test/java/com/google/cloud/alloydb/v1/MockAlloyDBAdminImpl.java b/java-alloydb/google-cloud-alloydb/src/test/java/com/google/cloud/alloydb/v1/MockAlloyDBAdminImpl.java index 78d49a497a19..22d8a83f7d3d 100644 --- a/java-alloydb/google-cloud-alloydb/src/test/java/com/google/cloud/alloydb/v1/MockAlloyDBAdminImpl.java +++ b/java-alloydb/google-cloud-alloydb/src/test/java/com/google/cloud/alloydb/v1/MockAlloyDBAdminImpl.java @@ -20,6 +20,7 @@ import com.google.cloud.alloydb.v1.AlloyDBAdminGrpc.AlloyDBAdminImplBase; import com.google.longrunning.Operation; import com.google.protobuf.AbstractMessage; +import com.google.protobuf.Empty; import io.grpc.stub.StreamObserver; import java.util.ArrayList; import java.util.LinkedList; @@ -163,6 +164,27 @@ public void deleteCluster( } } + @Override + public void promoteCluster( + PromoteClusterRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Operation) { + requests.add(request); + responseObserver.onNext(((Operation) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method PromoteCluster, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } + @Override public void restoreCluster( RestoreClusterRequest request, StreamObserver responseObserver) { @@ -184,6 +206,27 @@ public void restoreCluster( } } + @Override + public void createSecondaryCluster( + CreateSecondaryClusterRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Operation) { + requests.add(request); + responseObserver.onNext(((Operation) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method CreateSecondaryCluster, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } + @Override public void listInstances( ListInstancesRequest request, StreamObserver responseObserver) { @@ -246,6 +289,27 @@ public void createInstance( } } + @Override + public void createSecondaryInstance( + CreateSecondaryInstanceRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Operation) { + requests.add(request); + responseObserver.onNext(((Operation) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method CreateSecondaryInstance, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } + @Override public void batchCreateInstances( BatchCreateInstancesRequest request, StreamObserver responseObserver) { @@ -330,6 +394,26 @@ public void failoverInstance( } } + @Override + public void injectFault(InjectFaultRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Operation) { + requests.add(request); + responseObserver.onNext(((Operation) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method InjectFault, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } + @Override public void restartInstance( RestartInstanceRequest request, StreamObserver responseObserver) { @@ -476,4 +560,105 @@ public void listSupportedDatabaseFlags( Exception.class.getName()))); } } + + @Override + public void listUsers( + ListUsersRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof ListUsersResponse) { + requests.add(request); + responseObserver.onNext(((ListUsersResponse) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method ListUsers, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + ListUsersResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void getUser(GetUserRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof User) { + requests.add(request); + responseObserver.onNext(((User) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method GetUser, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + User.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void createUser(CreateUserRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof User) { + requests.add(request); + responseObserver.onNext(((User) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method CreateUser, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + User.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void updateUser(UpdateUserRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof User) { + requests.add(request); + responseObserver.onNext(((User) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method UpdateUser, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + User.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void deleteUser(DeleteUserRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Empty) { + requests.add(request); + responseObserver.onNext(((Empty) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method DeleteUser, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Empty.class.getName(), + Exception.class.getName()))); + } + } } diff --git a/java-alloydb/google-cloud-alloydb/src/test/java/com/google/cloud/alloydb/v1alpha/AlloyDBAdminClientHttpJsonTest.java b/java-alloydb/google-cloud-alloydb/src/test/java/com/google/cloud/alloydb/v1alpha/AlloyDBAdminClientHttpJsonTest.java index fbbb51bbff6e..234fbf30d64a 100644 --- a/java-alloydb/google-cloud-alloydb/src/test/java/com/google/cloud/alloydb/v1alpha/AlloyDBAdminClientHttpJsonTest.java +++ b/java-alloydb/google-cloud-alloydb/src/test/java/com/google/cloud/alloydb/v1alpha/AlloyDBAdminClientHttpJsonTest.java @@ -21,6 +21,7 @@ import static com.google.cloud.alloydb.v1alpha.AlloyDBAdminClient.ListInstancesPagedResponse; import static com.google.cloud.alloydb.v1alpha.AlloyDBAdminClient.ListLocationsPagedResponse; import static com.google.cloud.alloydb.v1alpha.AlloyDBAdminClient.ListSupportedDatabaseFlagsPagedResponse; +import static com.google.cloud.alloydb.v1alpha.AlloyDBAdminClient.ListUsersPagedResponse; import com.google.api.gax.core.NoCredentialsProvider; import com.google.api.gax.httpjson.GaxHttpJsonProperties; @@ -203,6 +204,7 @@ public void getClusterTest() throws Exception { .setDeleteTime(Timestamp.newBuilder().build()) .putAllLabels(new HashMap()) .setDatabaseVersion(DatabaseVersion.forNumber(0)) + .setNetworkConfig(Cluster.NetworkConfig.newBuilder().build()) .setNetwork("network1843485230") .setEtag("etag3123477") .putAllAnnotations(new HashMap()) @@ -267,6 +269,7 @@ public void getClusterTest2() throws Exception { .setDeleteTime(Timestamp.newBuilder().build()) .putAllLabels(new HashMap()) .setDatabaseVersion(DatabaseVersion.forNumber(0)) + .setNetworkConfig(Cluster.NetworkConfig.newBuilder().build()) .setNetwork("network1843485230") .setEtag("etag3123477") .putAllAnnotations(new HashMap()) @@ -331,6 +334,7 @@ public void createClusterTest() throws Exception { .setDeleteTime(Timestamp.newBuilder().build()) .putAllLabels(new HashMap()) .setDatabaseVersion(DatabaseVersion.forNumber(0)) + .setNetworkConfig(Cluster.NetworkConfig.newBuilder().build()) .setNetwork("network1843485230") .setEtag("etag3123477") .putAllAnnotations(new HashMap()) @@ -404,6 +408,7 @@ public void createClusterTest2() throws Exception { .setDeleteTime(Timestamp.newBuilder().build()) .putAllLabels(new HashMap()) .setDatabaseVersion(DatabaseVersion.forNumber(0)) + .setNetworkConfig(Cluster.NetworkConfig.newBuilder().build()) .setNetwork("network1843485230") .setEtag("etag3123477") .putAllAnnotations(new HashMap()) @@ -477,6 +482,7 @@ public void updateClusterTest() throws Exception { .setDeleteTime(Timestamp.newBuilder().build()) .putAllLabels(new HashMap()) .setDatabaseVersion(DatabaseVersion.forNumber(0)) + .setNetworkConfig(Cluster.NetworkConfig.newBuilder().build()) .setNetwork("network1843485230") .setEtag("etag3123477") .putAllAnnotations(new HashMap()) @@ -509,6 +515,7 @@ public void updateClusterTest() throws Exception { .setDeleteTime(Timestamp.newBuilder().build()) .putAllLabels(new HashMap()) .setDatabaseVersion(DatabaseVersion.forNumber(0)) + .setNetworkConfig(Cluster.NetworkConfig.newBuilder().build()) .setNetwork("network1843485230") .setEtag("etag3123477") .putAllAnnotations(new HashMap()) @@ -561,6 +568,7 @@ public void updateClusterExceptionTest() throws Exception { .setDeleteTime(Timestamp.newBuilder().build()) .putAllLabels(new HashMap()) .setDatabaseVersion(DatabaseVersion.forNumber(0)) + .setNetworkConfig(Cluster.NetworkConfig.newBuilder().build()) .setNetwork("network1843485230") .setEtag("etag3123477") .putAllAnnotations(new HashMap()) @@ -684,6 +692,7 @@ public void promoteClusterTest() throws Exception { .setDeleteTime(Timestamp.newBuilder().build()) .putAllLabels(new HashMap()) .setDatabaseVersion(DatabaseVersion.forNumber(0)) + .setNetworkConfig(Cluster.NetworkConfig.newBuilder().build()) .setNetwork("network1843485230") .setEtag("etag3123477") .putAllAnnotations(new HashMap()) @@ -753,6 +762,7 @@ public void promoteClusterTest2() throws Exception { .setDeleteTime(Timestamp.newBuilder().build()) .putAllLabels(new HashMap()) .setDatabaseVersion(DatabaseVersion.forNumber(0)) + .setNetworkConfig(Cluster.NetworkConfig.newBuilder().build()) .setNetwork("network1843485230") .setEtag("etag3123477") .putAllAnnotations(new HashMap()) @@ -822,6 +832,7 @@ public void restoreClusterTest() throws Exception { .setDeleteTime(Timestamp.newBuilder().build()) .putAllLabels(new HashMap()) .setDatabaseVersion(DatabaseVersion.forNumber(0)) + .setNetworkConfig(Cluster.NetworkConfig.newBuilder().build()) .setNetwork("network1843485230") .setEtag("etag3123477") .putAllAnnotations(new HashMap()) @@ -905,6 +916,7 @@ public void createSecondaryClusterTest() throws Exception { .setDeleteTime(Timestamp.newBuilder().build()) .putAllLabels(new HashMap()) .setDatabaseVersion(DatabaseVersion.forNumber(0)) + .setNetworkConfig(Cluster.NetworkConfig.newBuilder().build()) .setNetwork("network1843485230") .setEtag("etag3123477") .putAllAnnotations(new HashMap()) @@ -978,6 +990,7 @@ public void createSecondaryClusterTest2() throws Exception { .setDeleteTime(Timestamp.newBuilder().build()) .putAllLabels(new HashMap()) .setDatabaseVersion(DatabaseVersion.forNumber(0)) + .setNetworkConfig(Cluster.NetworkConfig.newBuilder().build()) .setNetwork("network1843485230") .setEtag("etag3123477") .putAllAnnotations(new HashMap()) @@ -1162,6 +1175,7 @@ public void getInstanceTest() throws Exception { .setReconciling(true) .setEtag("etag3123477") .putAllAnnotations(new HashMap()) + .setUpdatePolicy(Instance.UpdatePolicy.newBuilder().build()) .build(); mockService.addResponse(expectedResponse); @@ -1224,6 +1238,7 @@ public void getInstanceTest2() throws Exception { .setReconciling(true) .setEtag("etag3123477") .putAllAnnotations(new HashMap()) + .setUpdatePolicy(Instance.UpdatePolicy.newBuilder().build()) .build(); mockService.addResponse(expectedResponse); @@ -1288,6 +1303,7 @@ public void createInstanceTest() throws Exception { .setReconciling(true) .setEtag("etag3123477") .putAllAnnotations(new HashMap()) + .setUpdatePolicy(Instance.UpdatePolicy.newBuilder().build()) .build(); Operation resultOperation = Operation.newBuilder() @@ -1359,6 +1375,7 @@ public void createInstanceTest2() throws Exception { .setReconciling(true) .setEtag("etag3123477") .putAllAnnotations(new HashMap()) + .setUpdatePolicy(Instance.UpdatePolicy.newBuilder().build()) .build(); Operation resultOperation = Operation.newBuilder() @@ -1430,6 +1447,7 @@ public void createSecondaryInstanceTest() throws Exception { .setReconciling(true) .setEtag("etag3123477") .putAllAnnotations(new HashMap()) + .setUpdatePolicy(Instance.UpdatePolicy.newBuilder().build()) .build(); Operation resultOperation = Operation.newBuilder() @@ -1502,6 +1520,7 @@ public void createSecondaryInstanceTest2() throws Exception { .setReconciling(true) .setEtag("etag3123477") .putAllAnnotations(new HashMap()) + .setUpdatePolicy(Instance.UpdatePolicy.newBuilder().build()) .build(); Operation resultOperation = Operation.newBuilder() @@ -1633,6 +1652,7 @@ public void updateInstanceTest() throws Exception { .setReconciling(true) .setEtag("etag3123477") .putAllAnnotations(new HashMap()) + .setUpdatePolicy(Instance.UpdatePolicy.newBuilder().build()) .build(); Operation resultOperation = Operation.newBuilder() @@ -1663,6 +1683,7 @@ public void updateInstanceTest() throws Exception { .setReconciling(true) .setEtag("etag3123477") .putAllAnnotations(new HashMap()) + .setUpdatePolicy(Instance.UpdatePolicy.newBuilder().build()) .build(); FieldMask updateMask = FieldMask.newBuilder().build(); @@ -1713,6 +1734,7 @@ public void updateInstanceExceptionTest() throws Exception { .setReconciling(true) .setEtag("etag3123477") .putAllAnnotations(new HashMap()) + .setUpdatePolicy(Instance.UpdatePolicy.newBuilder().build()) .build(); FieldMask updateMask = FieldMask.newBuilder().build(); client.updateInstanceAsync(instance, updateMask).get(); @@ -1836,6 +1858,7 @@ public void failoverInstanceTest() throws Exception { .setReconciling(true) .setEtag("etag3123477") .putAllAnnotations(new HashMap()) + .setUpdatePolicy(Instance.UpdatePolicy.newBuilder().build()) .build(); Operation resultOperation = Operation.newBuilder() @@ -1903,6 +1926,7 @@ public void failoverInstanceTest2() throws Exception { .setReconciling(true) .setEtag("etag3123477") .putAllAnnotations(new HashMap()) + .setUpdatePolicy(Instance.UpdatePolicy.newBuilder().build()) .build(); Operation resultOperation = Operation.newBuilder() @@ -1949,6 +1973,148 @@ public void failoverInstanceExceptionTest2() throws Exception { } } + @Test + public void injectFaultTest() throws Exception { + Instance expectedResponse = + Instance.newBuilder() + .setName( + InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]").toString()) + .setDisplayName("displayName1714148973") + .setUid("uid115792") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setDeleteTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .setMachineConfig(Instance.MachineConfig.newBuilder().build()) + .setGceZone("gceZone-146048427") + .putAllDatabaseFlags(new HashMap()) + .setWritableNode(Instance.Node.newBuilder().build()) + .addAllNodes(new ArrayList()) + .setQueryInsightsConfig(Instance.QueryInsightsInstanceConfig.newBuilder().build()) + .setReadPoolConfig(Instance.ReadPoolConfig.newBuilder().build()) + .setIpAddress("ipAddress1634032845") + .setReconciling(true) + .setEtag("etag3123477") + .putAllAnnotations(new HashMap()) + .setUpdatePolicy(Instance.UpdatePolicy.newBuilder().build()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("injectFaultTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + InjectFaultRequest.FaultType faultType = InjectFaultRequest.FaultType.forNumber(0); + InstanceName name = InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]"); + + Instance actualResponse = client.injectFaultAsync(faultType, name).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void injectFaultExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + InjectFaultRequest.FaultType faultType = InjectFaultRequest.FaultType.forNumber(0); + InstanceName name = InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]"); + client.injectFaultAsync(faultType, name).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @Test + public void injectFaultTest2() throws Exception { + Instance expectedResponse = + Instance.newBuilder() + .setName( + InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]").toString()) + .setDisplayName("displayName1714148973") + .setUid("uid115792") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setDeleteTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .setMachineConfig(Instance.MachineConfig.newBuilder().build()) + .setGceZone("gceZone-146048427") + .putAllDatabaseFlags(new HashMap()) + .setWritableNode(Instance.Node.newBuilder().build()) + .addAllNodes(new ArrayList()) + .setQueryInsightsConfig(Instance.QueryInsightsInstanceConfig.newBuilder().build()) + .setReadPoolConfig(Instance.ReadPoolConfig.newBuilder().build()) + .setIpAddress("ipAddress1634032845") + .setReconciling(true) + .setEtag("etag3123477") + .putAllAnnotations(new HashMap()) + .setUpdatePolicy(Instance.UpdatePolicy.newBuilder().build()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("injectFaultTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + InjectFaultRequest.FaultType faultType = InjectFaultRequest.FaultType.forNumber(0); + String name = + "projects/project-867/locations/location-867/clusters/cluster-867/instances/instance-867"; + + Instance actualResponse = client.injectFaultAsync(faultType, name).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void injectFaultExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + InjectFaultRequest.FaultType faultType = InjectFaultRequest.FaultType.forNumber(0); + String name = + "projects/project-867/locations/location-867/clusters/cluster-867/instances/instance-867"; + client.injectFaultAsync(faultType, name).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + @Test public void restartInstanceTest() throws Exception { Instance expectedResponse = @@ -1972,6 +2138,7 @@ public void restartInstanceTest() throws Exception { .setReconciling(true) .setEtag("etag3123477") .putAllAnnotations(new HashMap()) + .setUpdatePolicy(Instance.UpdatePolicy.newBuilder().build()) .build(); Operation resultOperation = Operation.newBuilder() @@ -2039,6 +2206,7 @@ public void restartInstanceTest2() throws Exception { .setReconciling(true) .setEtag("etag3123477") .putAllAnnotations(new HashMap()) + .setUpdatePolicy(Instance.UpdatePolicy.newBuilder().build()) .build(); Operation resultOperation = Operation.newBuilder() @@ -2746,6 +2914,7 @@ public void generateClientCertificateTest() throws Exception { GenerateClientCertificateResponse.newBuilder() .setPemCertificate("pemCertificate153491807") .addAllPemCertificateChain(new ArrayList()) + .setCaCert("caCert-1369003102") .build(); mockService.addResponse(expectedResponse); @@ -2791,6 +2960,7 @@ public void generateClientCertificateTest2() throws Exception { GenerateClientCertificateResponse.newBuilder() .setPemCertificate("pemCertificate153491807") .addAllPemCertificateChain(new ArrayList()) + .setCaCert("caCert-1369003102") .build(); mockService.addResponse(expectedResponse); @@ -2926,6 +3096,440 @@ public void getConnectionInfoExceptionTest2() throws Exception { } } + @Test + public void listUsersTest() throws Exception { + User responsesElement = User.newBuilder().build(); + ListUsersResponse expectedResponse = + ListUsersResponse.newBuilder() + .setNextPageToken("") + .addAllUsers(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + ClusterName parent = ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]"); + + ListUsersPagedResponse pagedListResponse = client.listUsers(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getUsersList().get(0), resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void listUsersExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ClusterName parent = ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]"); + client.listUsers(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listUsersTest2() throws Exception { + User responsesElement = User.newBuilder().build(); + ListUsersResponse expectedResponse = + ListUsersResponse.newBuilder() + .setNextPageToken("") + .addAllUsers(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + String parent = "projects/project-9466/locations/location-9466/clusters/cluster-9466"; + + ListUsersPagedResponse pagedListResponse = client.listUsers(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getUsersList().get(0), resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void listUsersExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String parent = "projects/project-9466/locations/location-9466/clusters/cluster-9466"; + client.listUsers(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getUserTest() throws Exception { + User expectedResponse = + User.newBuilder() + .setName(UserName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[USER]").toString()) + .setPassword("password1216985755") + .addAllDatabaseRoles(new ArrayList()) + .build(); + mockService.addResponse(expectedResponse); + + UserName name = UserName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[USER]"); + + User actualResponse = client.getUser(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void getUserExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + UserName name = UserName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[USER]"); + client.getUser(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getUserTest2() throws Exception { + User expectedResponse = + User.newBuilder() + .setName(UserName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[USER]").toString()) + .setPassword("password1216985755") + .addAllDatabaseRoles(new ArrayList()) + .build(); + mockService.addResponse(expectedResponse); + + String name = + "projects/project-6835/locations/location-6835/clusters/cluster-6835/users/user-6835"; + + User actualResponse = client.getUser(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void getUserExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = + "projects/project-6835/locations/location-6835/clusters/cluster-6835/users/user-6835"; + client.getUser(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createUserTest() throws Exception { + User expectedResponse = + User.newBuilder() + .setName(UserName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[USER]").toString()) + .setPassword("password1216985755") + .addAllDatabaseRoles(new ArrayList()) + .build(); + mockService.addResponse(expectedResponse); + + ClusterName parent = ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]"); + User user = User.newBuilder().build(); + String userId = "userId-836030906"; + + User actualResponse = client.createUser(parent, user, userId); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void createUserExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ClusterName parent = ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]"); + User user = User.newBuilder().build(); + String userId = "userId-836030906"; + client.createUser(parent, user, userId); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createUserTest2() throws Exception { + User expectedResponse = + User.newBuilder() + .setName(UserName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[USER]").toString()) + .setPassword("password1216985755") + .addAllDatabaseRoles(new ArrayList()) + .build(); + mockService.addResponse(expectedResponse); + + String parent = "projects/project-9466/locations/location-9466/clusters/cluster-9466"; + User user = User.newBuilder().build(); + String userId = "userId-836030906"; + + User actualResponse = client.createUser(parent, user, userId); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void createUserExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String parent = "projects/project-9466/locations/location-9466/clusters/cluster-9466"; + User user = User.newBuilder().build(); + String userId = "userId-836030906"; + client.createUser(parent, user, userId); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void updateUserTest() throws Exception { + User expectedResponse = + User.newBuilder() + .setName(UserName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[USER]").toString()) + .setPassword("password1216985755") + .addAllDatabaseRoles(new ArrayList()) + .build(); + mockService.addResponse(expectedResponse); + + User user = + User.newBuilder() + .setName(UserName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[USER]").toString()) + .setPassword("password1216985755") + .addAllDatabaseRoles(new ArrayList()) + .build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + + User actualResponse = client.updateUser(user, updateMask); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void updateUserExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + User user = + User.newBuilder() + .setName(UserName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[USER]").toString()) + .setPassword("password1216985755") + .addAllDatabaseRoles(new ArrayList()) + .build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + client.updateUser(user, updateMask); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deleteUserTest() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockService.addResponse(expectedResponse); + + UserName name = UserName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[USER]"); + + client.deleteUser(name); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void deleteUserExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + UserName name = UserName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[USER]"); + client.deleteUser(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deleteUserTest2() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockService.addResponse(expectedResponse); + + String name = + "projects/project-6835/locations/location-6835/clusters/cluster-6835/users/user-6835"; + + client.deleteUser(name); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void deleteUserExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = + "projects/project-6835/locations/location-6835/clusters/cluster-6835/users/user-6835"; + client.deleteUser(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + @Test public void listLocationsTest() throws Exception { Location responsesElement = Location.newBuilder().build(); diff --git a/java-alloydb/google-cloud-alloydb/src/test/java/com/google/cloud/alloydb/v1alpha/AlloyDBAdminClientTest.java b/java-alloydb/google-cloud-alloydb/src/test/java/com/google/cloud/alloydb/v1alpha/AlloyDBAdminClientTest.java index 534dbd40d13a..0d87885b6f54 100644 --- a/java-alloydb/google-cloud-alloydb/src/test/java/com/google/cloud/alloydb/v1alpha/AlloyDBAdminClientTest.java +++ b/java-alloydb/google-cloud-alloydb/src/test/java/com/google/cloud/alloydb/v1alpha/AlloyDBAdminClientTest.java @@ -21,6 +21,7 @@ import static com.google.cloud.alloydb.v1alpha.AlloyDBAdminClient.ListInstancesPagedResponse; import static com.google.cloud.alloydb.v1alpha.AlloyDBAdminClient.ListLocationsPagedResponse; import static com.google.cloud.alloydb.v1alpha.AlloyDBAdminClient.ListSupportedDatabaseFlagsPagedResponse; +import static com.google.cloud.alloydb.v1alpha.AlloyDBAdminClient.ListUsersPagedResponse; import com.google.api.gax.core.NoCredentialsProvider; import com.google.api.gax.grpc.GaxGrpcProperties; @@ -200,6 +201,7 @@ public void getClusterTest() throws Exception { .setDeleteTime(Timestamp.newBuilder().build()) .putAllLabels(new HashMap()) .setDatabaseVersion(DatabaseVersion.forNumber(0)) + .setNetworkConfig(Cluster.NetworkConfig.newBuilder().build()) .setNetwork("network1843485230") .setEtag("etag3123477") .putAllAnnotations(new HashMap()) @@ -258,6 +260,7 @@ public void getClusterTest2() throws Exception { .setDeleteTime(Timestamp.newBuilder().build()) .putAllLabels(new HashMap()) .setDatabaseVersion(DatabaseVersion.forNumber(0)) + .setNetworkConfig(Cluster.NetworkConfig.newBuilder().build()) .setNetwork("network1843485230") .setEtag("etag3123477") .putAllAnnotations(new HashMap()) @@ -316,6 +319,7 @@ public void createClusterTest() throws Exception { .setDeleteTime(Timestamp.newBuilder().build()) .putAllLabels(new HashMap()) .setDatabaseVersion(DatabaseVersion.forNumber(0)) + .setNetworkConfig(Cluster.NetworkConfig.newBuilder().build()) .setNetwork("network1843485230") .setEtag("etag3123477") .putAllAnnotations(new HashMap()) @@ -388,6 +392,7 @@ public void createClusterTest2() throws Exception { .setDeleteTime(Timestamp.newBuilder().build()) .putAllLabels(new HashMap()) .setDatabaseVersion(DatabaseVersion.forNumber(0)) + .setNetworkConfig(Cluster.NetworkConfig.newBuilder().build()) .setNetwork("network1843485230") .setEtag("etag3123477") .putAllAnnotations(new HashMap()) @@ -460,6 +465,7 @@ public void updateClusterTest() throws Exception { .setDeleteTime(Timestamp.newBuilder().build()) .putAllLabels(new HashMap()) .setDatabaseVersion(DatabaseVersion.forNumber(0)) + .setNetworkConfig(Cluster.NetworkConfig.newBuilder().build()) .setNetwork("network1843485230") .setEtag("etag3123477") .putAllAnnotations(new HashMap()) @@ -613,6 +619,7 @@ public void promoteClusterTest() throws Exception { .setDeleteTime(Timestamp.newBuilder().build()) .putAllLabels(new HashMap()) .setDatabaseVersion(DatabaseVersion.forNumber(0)) + .setNetworkConfig(Cluster.NetworkConfig.newBuilder().build()) .setNetwork("network1843485230") .setEtag("etag3123477") .putAllAnnotations(new HashMap()) @@ -679,6 +686,7 @@ public void promoteClusterTest2() throws Exception { .setDeleteTime(Timestamp.newBuilder().build()) .putAllLabels(new HashMap()) .setDatabaseVersion(DatabaseVersion.forNumber(0)) + .setNetworkConfig(Cluster.NetworkConfig.newBuilder().build()) .setNetwork("network1843485230") .setEtag("etag3123477") .putAllAnnotations(new HashMap()) @@ -745,6 +753,7 @@ public void restoreClusterTest() throws Exception { .setDeleteTime(Timestamp.newBuilder().build()) .putAllLabels(new HashMap()) .setDatabaseVersion(DatabaseVersion.forNumber(0)) + .setNetworkConfig(Cluster.NetworkConfig.newBuilder().build()) .setNetwork("network1843485230") .setEtag("etag3123477") .putAllAnnotations(new HashMap()) @@ -832,6 +841,7 @@ public void createSecondaryClusterTest() throws Exception { .setDeleteTime(Timestamp.newBuilder().build()) .putAllLabels(new HashMap()) .setDatabaseVersion(DatabaseVersion.forNumber(0)) + .setNetworkConfig(Cluster.NetworkConfig.newBuilder().build()) .setNetwork("network1843485230") .setEtag("etag3123477") .putAllAnnotations(new HashMap()) @@ -905,6 +915,7 @@ public void createSecondaryClusterTest2() throws Exception { .setDeleteTime(Timestamp.newBuilder().build()) .putAllLabels(new HashMap()) .setDatabaseVersion(DatabaseVersion.forNumber(0)) + .setNetworkConfig(Cluster.NetworkConfig.newBuilder().build()) .setNetwork("network1843485230") .setEtag("etag3123477") .putAllAnnotations(new HashMap()) @@ -1077,6 +1088,7 @@ public void getInstanceTest() throws Exception { .setReconciling(true) .setEtag("etag3123477") .putAllAnnotations(new HashMap()) + .setUpdatePolicy(Instance.UpdatePolicy.newBuilder().build()) .build(); mockAlloyDBAdmin.addResponse(expectedResponse); @@ -1133,6 +1145,7 @@ public void getInstanceTest2() throws Exception { .setReconciling(true) .setEtag("etag3123477") .putAllAnnotations(new HashMap()) + .setUpdatePolicy(Instance.UpdatePolicy.newBuilder().build()) .build(); mockAlloyDBAdmin.addResponse(expectedResponse); @@ -1189,6 +1202,7 @@ public void createInstanceTest() throws Exception { .setReconciling(true) .setEtag("etag3123477") .putAllAnnotations(new HashMap()) + .setUpdatePolicy(Instance.UpdatePolicy.newBuilder().build()) .build(); Operation resultOperation = Operation.newBuilder() @@ -1259,6 +1273,7 @@ public void createInstanceTest2() throws Exception { .setReconciling(true) .setEtag("etag3123477") .putAllAnnotations(new HashMap()) + .setUpdatePolicy(Instance.UpdatePolicy.newBuilder().build()) .build(); Operation resultOperation = Operation.newBuilder() @@ -1329,6 +1344,7 @@ public void createSecondaryInstanceTest() throws Exception { .setReconciling(true) .setEtag("etag3123477") .putAllAnnotations(new HashMap()) + .setUpdatePolicy(Instance.UpdatePolicy.newBuilder().build()) .build(); Operation resultOperation = Operation.newBuilder() @@ -1401,6 +1417,7 @@ public void createSecondaryInstanceTest2() throws Exception { .setReconciling(true) .setEtag("etag3123477") .putAllAnnotations(new HashMap()) + .setUpdatePolicy(Instance.UpdatePolicy.newBuilder().build()) .build(); Operation resultOperation = Operation.newBuilder() @@ -1532,6 +1549,7 @@ public void updateInstanceTest() throws Exception { .setReconciling(true) .setEtag("etag3123477") .putAllAnnotations(new HashMap()) + .setUpdatePolicy(Instance.UpdatePolicy.newBuilder().build()) .build(); Operation resultOperation = Operation.newBuilder() @@ -1683,6 +1701,7 @@ public void failoverInstanceTest() throws Exception { .setReconciling(true) .setEtag("etag3123477") .putAllAnnotations(new HashMap()) + .setUpdatePolicy(Instance.UpdatePolicy.newBuilder().build()) .build(); Operation resultOperation = Operation.newBuilder() @@ -1747,6 +1766,7 @@ public void failoverInstanceTest2() throws Exception { .setReconciling(true) .setEtag("etag3123477") .putAllAnnotations(new HashMap()) + .setUpdatePolicy(Instance.UpdatePolicy.newBuilder().build()) .build(); Operation resultOperation = Operation.newBuilder() @@ -1788,6 +1808,142 @@ public void failoverInstanceExceptionTest2() throws Exception { } } + @Test + public void injectFaultTest() throws Exception { + Instance expectedResponse = + Instance.newBuilder() + .setName( + InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]").toString()) + .setDisplayName("displayName1714148973") + .setUid("uid115792") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setDeleteTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .setMachineConfig(Instance.MachineConfig.newBuilder().build()) + .setGceZone("gceZone-146048427") + .putAllDatabaseFlags(new HashMap()) + .setWritableNode(Instance.Node.newBuilder().build()) + .addAllNodes(new ArrayList()) + .setQueryInsightsConfig(Instance.QueryInsightsInstanceConfig.newBuilder().build()) + .setReadPoolConfig(Instance.ReadPoolConfig.newBuilder().build()) + .setIpAddress("ipAddress1634032845") + .setReconciling(true) + .setEtag("etag3123477") + .putAllAnnotations(new HashMap()) + .setUpdatePolicy(Instance.UpdatePolicy.newBuilder().build()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("injectFaultTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockAlloyDBAdmin.addResponse(resultOperation); + + InjectFaultRequest.FaultType faultType = InjectFaultRequest.FaultType.forNumber(0); + InstanceName name = InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]"); + + Instance actualResponse = client.injectFaultAsync(faultType, name).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockAlloyDBAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + InjectFaultRequest actualRequest = ((InjectFaultRequest) actualRequests.get(0)); + + Assert.assertEquals(faultType, actualRequest.getFaultType()); + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void injectFaultExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockAlloyDBAdmin.addException(exception); + + try { + InjectFaultRequest.FaultType faultType = InjectFaultRequest.FaultType.forNumber(0); + InstanceName name = InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]"); + client.injectFaultAsync(faultType, name).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + public void injectFaultTest2() throws Exception { + Instance expectedResponse = + Instance.newBuilder() + .setName( + InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]").toString()) + .setDisplayName("displayName1714148973") + .setUid("uid115792") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setDeleteTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .setMachineConfig(Instance.MachineConfig.newBuilder().build()) + .setGceZone("gceZone-146048427") + .putAllDatabaseFlags(new HashMap()) + .setWritableNode(Instance.Node.newBuilder().build()) + .addAllNodes(new ArrayList()) + .setQueryInsightsConfig(Instance.QueryInsightsInstanceConfig.newBuilder().build()) + .setReadPoolConfig(Instance.ReadPoolConfig.newBuilder().build()) + .setIpAddress("ipAddress1634032845") + .setReconciling(true) + .setEtag("etag3123477") + .putAllAnnotations(new HashMap()) + .setUpdatePolicy(Instance.UpdatePolicy.newBuilder().build()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("injectFaultTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockAlloyDBAdmin.addResponse(resultOperation); + + InjectFaultRequest.FaultType faultType = InjectFaultRequest.FaultType.forNumber(0); + String name = "name3373707"; + + Instance actualResponse = client.injectFaultAsync(faultType, name).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockAlloyDBAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + InjectFaultRequest actualRequest = ((InjectFaultRequest) actualRequests.get(0)); + + Assert.assertEquals(faultType, actualRequest.getFaultType()); + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void injectFaultExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockAlloyDBAdmin.addException(exception); + + try { + InjectFaultRequest.FaultType faultType = InjectFaultRequest.FaultType.forNumber(0); + String name = "name3373707"; + client.injectFaultAsync(faultType, name).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + @Test public void restartInstanceTest() throws Exception { Instance expectedResponse = @@ -1811,6 +1967,7 @@ public void restartInstanceTest() throws Exception { .setReconciling(true) .setEtag("etag3123477") .putAllAnnotations(new HashMap()) + .setUpdatePolicy(Instance.UpdatePolicy.newBuilder().build()) .build(); Operation resultOperation = Operation.newBuilder() @@ -1875,6 +2032,7 @@ public void restartInstanceTest2() throws Exception { .setReconciling(true) .setEtag("etag3123477") .putAllAnnotations(new HashMap()) + .setUpdatePolicy(Instance.UpdatePolicy.newBuilder().build()) .build(); Operation resultOperation = Operation.newBuilder() @@ -2495,6 +2653,7 @@ public void generateClientCertificateTest() throws Exception { GenerateClientCertificateResponse.newBuilder() .setPemCertificate("pemCertificate153491807") .addAllPemCertificateChain(new ArrayList()) + .setCaCert("caCert-1369003102") .build(); mockAlloyDBAdmin.addResponse(expectedResponse); @@ -2535,6 +2694,7 @@ public void generateClientCertificateTest2() throws Exception { GenerateClientCertificateResponse.newBuilder() .setPemCertificate("pemCertificate153491807") .addAllPemCertificateChain(new ArrayList()) + .setCaCert("caCert-1369003102") .build(); mockAlloyDBAdmin.addResponse(expectedResponse); @@ -2651,6 +2811,377 @@ public void getConnectionInfoExceptionTest2() throws Exception { } } + @Test + public void listUsersTest() throws Exception { + User responsesElement = User.newBuilder().build(); + ListUsersResponse expectedResponse = + ListUsersResponse.newBuilder() + .setNextPageToken("") + .addAllUsers(Arrays.asList(responsesElement)) + .build(); + mockAlloyDBAdmin.addResponse(expectedResponse); + + ClusterName parent = ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]"); + + ListUsersPagedResponse pagedListResponse = client.listUsers(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getUsersList().get(0), resources.get(0)); + + List actualRequests = mockAlloyDBAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListUsersRequest actualRequest = ((ListUsersRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listUsersExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockAlloyDBAdmin.addException(exception); + + try { + ClusterName parent = ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]"); + client.listUsers(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listUsersTest2() throws Exception { + User responsesElement = User.newBuilder().build(); + ListUsersResponse expectedResponse = + ListUsersResponse.newBuilder() + .setNextPageToken("") + .addAllUsers(Arrays.asList(responsesElement)) + .build(); + mockAlloyDBAdmin.addResponse(expectedResponse); + + String parent = "parent-995424086"; + + ListUsersPagedResponse pagedListResponse = client.listUsers(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getUsersList().get(0), resources.get(0)); + + List actualRequests = mockAlloyDBAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListUsersRequest actualRequest = ((ListUsersRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listUsersExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockAlloyDBAdmin.addException(exception); + + try { + String parent = "parent-995424086"; + client.listUsers(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getUserTest() throws Exception { + User expectedResponse = + User.newBuilder() + .setName(UserName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[USER]").toString()) + .setPassword("password1216985755") + .addAllDatabaseRoles(new ArrayList()) + .build(); + mockAlloyDBAdmin.addResponse(expectedResponse); + + UserName name = UserName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[USER]"); + + User actualResponse = client.getUser(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockAlloyDBAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetUserRequest actualRequest = ((GetUserRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getUserExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockAlloyDBAdmin.addException(exception); + + try { + UserName name = UserName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[USER]"); + client.getUser(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getUserTest2() throws Exception { + User expectedResponse = + User.newBuilder() + .setName(UserName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[USER]").toString()) + .setPassword("password1216985755") + .addAllDatabaseRoles(new ArrayList()) + .build(); + mockAlloyDBAdmin.addResponse(expectedResponse); + + String name = "name3373707"; + + User actualResponse = client.getUser(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockAlloyDBAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetUserRequest actualRequest = ((GetUserRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getUserExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockAlloyDBAdmin.addException(exception); + + try { + String name = "name3373707"; + client.getUser(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createUserTest() throws Exception { + User expectedResponse = + User.newBuilder() + .setName(UserName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[USER]").toString()) + .setPassword("password1216985755") + .addAllDatabaseRoles(new ArrayList()) + .build(); + mockAlloyDBAdmin.addResponse(expectedResponse); + + ClusterName parent = ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]"); + User user = User.newBuilder().build(); + String userId = "userId-836030906"; + + User actualResponse = client.createUser(parent, user, userId); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockAlloyDBAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateUserRequest actualRequest = ((CreateUserRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertEquals(user, actualRequest.getUser()); + Assert.assertEquals(userId, actualRequest.getUserId()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createUserExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockAlloyDBAdmin.addException(exception); + + try { + ClusterName parent = ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]"); + User user = User.newBuilder().build(); + String userId = "userId-836030906"; + client.createUser(parent, user, userId); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createUserTest2() throws Exception { + User expectedResponse = + User.newBuilder() + .setName(UserName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[USER]").toString()) + .setPassword("password1216985755") + .addAllDatabaseRoles(new ArrayList()) + .build(); + mockAlloyDBAdmin.addResponse(expectedResponse); + + String parent = "parent-995424086"; + User user = User.newBuilder().build(); + String userId = "userId-836030906"; + + User actualResponse = client.createUser(parent, user, userId); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockAlloyDBAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateUserRequest actualRequest = ((CreateUserRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertEquals(user, actualRequest.getUser()); + Assert.assertEquals(userId, actualRequest.getUserId()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createUserExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockAlloyDBAdmin.addException(exception); + + try { + String parent = "parent-995424086"; + User user = User.newBuilder().build(); + String userId = "userId-836030906"; + client.createUser(parent, user, userId); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void updateUserTest() throws Exception { + User expectedResponse = + User.newBuilder() + .setName(UserName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[USER]").toString()) + .setPassword("password1216985755") + .addAllDatabaseRoles(new ArrayList()) + .build(); + mockAlloyDBAdmin.addResponse(expectedResponse); + + User user = User.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + + User actualResponse = client.updateUser(user, updateMask); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockAlloyDBAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + UpdateUserRequest actualRequest = ((UpdateUserRequest) actualRequests.get(0)); + + Assert.assertEquals(user, actualRequest.getUser()); + Assert.assertEquals(updateMask, actualRequest.getUpdateMask()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void updateUserExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockAlloyDBAdmin.addException(exception); + + try { + User user = User.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + client.updateUser(user, updateMask); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deleteUserTest() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockAlloyDBAdmin.addResponse(expectedResponse); + + UserName name = UserName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[USER]"); + + client.deleteUser(name); + + List actualRequests = mockAlloyDBAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteUserRequest actualRequest = ((DeleteUserRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void deleteUserExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockAlloyDBAdmin.addException(exception); + + try { + UserName name = UserName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[USER]"); + client.deleteUser(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deleteUserTest2() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockAlloyDBAdmin.addResponse(expectedResponse); + + String name = "name3373707"; + + client.deleteUser(name); + + List actualRequests = mockAlloyDBAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteUserRequest actualRequest = ((DeleteUserRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void deleteUserExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockAlloyDBAdmin.addException(exception); + + try { + String name = "name3373707"; + client.deleteUser(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + @Test public void listLocationsTest() throws Exception { Location responsesElement = Location.newBuilder().build(); diff --git a/java-alloydb/google-cloud-alloydb/src/test/java/com/google/cloud/alloydb/v1alpha/MockAlloyDBAdminImpl.java b/java-alloydb/google-cloud-alloydb/src/test/java/com/google/cloud/alloydb/v1alpha/MockAlloyDBAdminImpl.java index 5ed581091d0a..62811727dae0 100644 --- a/java-alloydb/google-cloud-alloydb/src/test/java/com/google/cloud/alloydb/v1alpha/MockAlloyDBAdminImpl.java +++ b/java-alloydb/google-cloud-alloydb/src/test/java/com/google/cloud/alloydb/v1alpha/MockAlloyDBAdminImpl.java @@ -20,6 +20,7 @@ import com.google.cloud.alloydb.v1alpha.AlloyDBAdminGrpc.AlloyDBAdminImplBase; import com.google.longrunning.Operation; import com.google.protobuf.AbstractMessage; +import com.google.protobuf.Empty; import io.grpc.stub.StreamObserver; import java.util.ArrayList; import java.util.LinkedList; @@ -393,6 +394,26 @@ public void failoverInstance( } } + @Override + public void injectFault(InjectFaultRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Operation) { + requests.add(request); + responseObserver.onNext(((Operation) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method InjectFault, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } + @Override public void restartInstance( RestartInstanceRequest request, StreamObserver responseObserver) { @@ -582,4 +603,105 @@ public void getConnectionInfo( Exception.class.getName()))); } } + + @Override + public void listUsers( + ListUsersRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof ListUsersResponse) { + requests.add(request); + responseObserver.onNext(((ListUsersResponse) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method ListUsers, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + ListUsersResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void getUser(GetUserRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof User) { + requests.add(request); + responseObserver.onNext(((User) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method GetUser, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + User.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void createUser(CreateUserRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof User) { + requests.add(request); + responseObserver.onNext(((User) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method CreateUser, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + User.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void updateUser(UpdateUserRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof User) { + requests.add(request); + responseObserver.onNext(((User) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method UpdateUser, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + User.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void deleteUser(DeleteUserRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Empty) { + requests.add(request); + responseObserver.onNext(((Empty) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method DeleteUser, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Empty.class.getName(), + Exception.class.getName()))); + } + } } diff --git a/java-alloydb/google-cloud-alloydb/src/test/java/com/google/cloud/alloydb/v1beta/AlloyDBAdminClientHttpJsonTest.java b/java-alloydb/google-cloud-alloydb/src/test/java/com/google/cloud/alloydb/v1beta/AlloyDBAdminClientHttpJsonTest.java index 1bc4343fe444..8eaac5196f0d 100644 --- a/java-alloydb/google-cloud-alloydb/src/test/java/com/google/cloud/alloydb/v1beta/AlloyDBAdminClientHttpJsonTest.java +++ b/java-alloydb/google-cloud-alloydb/src/test/java/com/google/cloud/alloydb/v1beta/AlloyDBAdminClientHttpJsonTest.java @@ -21,6 +21,7 @@ import static com.google.cloud.alloydb.v1beta.AlloyDBAdminClient.ListInstancesPagedResponse; import static com.google.cloud.alloydb.v1beta.AlloyDBAdminClient.ListLocationsPagedResponse; import static com.google.cloud.alloydb.v1beta.AlloyDBAdminClient.ListSupportedDatabaseFlagsPagedResponse; +import static com.google.cloud.alloydb.v1beta.AlloyDBAdminClient.ListUsersPagedResponse; import com.google.api.gax.core.NoCredentialsProvider; import com.google.api.gax.httpjson.GaxHttpJsonProperties; @@ -203,6 +204,7 @@ public void getClusterTest() throws Exception { .setDeleteTime(Timestamp.newBuilder().build()) .putAllLabels(new HashMap()) .setDatabaseVersion(DatabaseVersion.forNumber(0)) + .setNetworkConfig(Cluster.NetworkConfig.newBuilder().build()) .setNetwork("network1843485230") .setEtag("etag3123477") .putAllAnnotations(new HashMap()) @@ -267,6 +269,7 @@ public void getClusterTest2() throws Exception { .setDeleteTime(Timestamp.newBuilder().build()) .putAllLabels(new HashMap()) .setDatabaseVersion(DatabaseVersion.forNumber(0)) + .setNetworkConfig(Cluster.NetworkConfig.newBuilder().build()) .setNetwork("network1843485230") .setEtag("etag3123477") .putAllAnnotations(new HashMap()) @@ -331,6 +334,7 @@ public void createClusterTest() throws Exception { .setDeleteTime(Timestamp.newBuilder().build()) .putAllLabels(new HashMap()) .setDatabaseVersion(DatabaseVersion.forNumber(0)) + .setNetworkConfig(Cluster.NetworkConfig.newBuilder().build()) .setNetwork("network1843485230") .setEtag("etag3123477") .putAllAnnotations(new HashMap()) @@ -404,6 +408,7 @@ public void createClusterTest2() throws Exception { .setDeleteTime(Timestamp.newBuilder().build()) .putAllLabels(new HashMap()) .setDatabaseVersion(DatabaseVersion.forNumber(0)) + .setNetworkConfig(Cluster.NetworkConfig.newBuilder().build()) .setNetwork("network1843485230") .setEtag("etag3123477") .putAllAnnotations(new HashMap()) @@ -477,6 +482,7 @@ public void updateClusterTest() throws Exception { .setDeleteTime(Timestamp.newBuilder().build()) .putAllLabels(new HashMap()) .setDatabaseVersion(DatabaseVersion.forNumber(0)) + .setNetworkConfig(Cluster.NetworkConfig.newBuilder().build()) .setNetwork("network1843485230") .setEtag("etag3123477") .putAllAnnotations(new HashMap()) @@ -509,6 +515,7 @@ public void updateClusterTest() throws Exception { .setDeleteTime(Timestamp.newBuilder().build()) .putAllLabels(new HashMap()) .setDatabaseVersion(DatabaseVersion.forNumber(0)) + .setNetworkConfig(Cluster.NetworkConfig.newBuilder().build()) .setNetwork("network1843485230") .setEtag("etag3123477") .putAllAnnotations(new HashMap()) @@ -561,6 +568,7 @@ public void updateClusterExceptionTest() throws Exception { .setDeleteTime(Timestamp.newBuilder().build()) .putAllLabels(new HashMap()) .setDatabaseVersion(DatabaseVersion.forNumber(0)) + .setNetworkConfig(Cluster.NetworkConfig.newBuilder().build()) .setNetwork("network1843485230") .setEtag("etag3123477") .putAllAnnotations(new HashMap()) @@ -684,6 +692,7 @@ public void promoteClusterTest() throws Exception { .setDeleteTime(Timestamp.newBuilder().build()) .putAllLabels(new HashMap()) .setDatabaseVersion(DatabaseVersion.forNumber(0)) + .setNetworkConfig(Cluster.NetworkConfig.newBuilder().build()) .setNetwork("network1843485230") .setEtag("etag3123477") .putAllAnnotations(new HashMap()) @@ -753,6 +762,7 @@ public void promoteClusterTest2() throws Exception { .setDeleteTime(Timestamp.newBuilder().build()) .putAllLabels(new HashMap()) .setDatabaseVersion(DatabaseVersion.forNumber(0)) + .setNetworkConfig(Cluster.NetworkConfig.newBuilder().build()) .setNetwork("network1843485230") .setEtag("etag3123477") .putAllAnnotations(new HashMap()) @@ -822,6 +832,7 @@ public void restoreClusterTest() throws Exception { .setDeleteTime(Timestamp.newBuilder().build()) .putAllLabels(new HashMap()) .setDatabaseVersion(DatabaseVersion.forNumber(0)) + .setNetworkConfig(Cluster.NetworkConfig.newBuilder().build()) .setNetwork("network1843485230") .setEtag("etag3123477") .putAllAnnotations(new HashMap()) @@ -905,6 +916,7 @@ public void createSecondaryClusterTest() throws Exception { .setDeleteTime(Timestamp.newBuilder().build()) .putAllLabels(new HashMap()) .setDatabaseVersion(DatabaseVersion.forNumber(0)) + .setNetworkConfig(Cluster.NetworkConfig.newBuilder().build()) .setNetwork("network1843485230") .setEtag("etag3123477") .putAllAnnotations(new HashMap()) @@ -978,6 +990,7 @@ public void createSecondaryClusterTest2() throws Exception { .setDeleteTime(Timestamp.newBuilder().build()) .putAllLabels(new HashMap()) .setDatabaseVersion(DatabaseVersion.forNumber(0)) + .setNetworkConfig(Cluster.NetworkConfig.newBuilder().build()) .setNetwork("network1843485230") .setEtag("etag3123477") .putAllAnnotations(new HashMap()) @@ -1162,6 +1175,7 @@ public void getInstanceTest() throws Exception { .setReconciling(true) .setEtag("etag3123477") .putAllAnnotations(new HashMap()) + .setUpdatePolicy(Instance.UpdatePolicy.newBuilder().build()) .build(); mockService.addResponse(expectedResponse); @@ -1224,6 +1238,7 @@ public void getInstanceTest2() throws Exception { .setReconciling(true) .setEtag("etag3123477") .putAllAnnotations(new HashMap()) + .setUpdatePolicy(Instance.UpdatePolicy.newBuilder().build()) .build(); mockService.addResponse(expectedResponse); @@ -1288,6 +1303,7 @@ public void createInstanceTest() throws Exception { .setReconciling(true) .setEtag("etag3123477") .putAllAnnotations(new HashMap()) + .setUpdatePolicy(Instance.UpdatePolicy.newBuilder().build()) .build(); Operation resultOperation = Operation.newBuilder() @@ -1359,6 +1375,7 @@ public void createInstanceTest2() throws Exception { .setReconciling(true) .setEtag("etag3123477") .putAllAnnotations(new HashMap()) + .setUpdatePolicy(Instance.UpdatePolicy.newBuilder().build()) .build(); Operation resultOperation = Operation.newBuilder() @@ -1430,6 +1447,7 @@ public void createSecondaryInstanceTest() throws Exception { .setReconciling(true) .setEtag("etag3123477") .putAllAnnotations(new HashMap()) + .setUpdatePolicy(Instance.UpdatePolicy.newBuilder().build()) .build(); Operation resultOperation = Operation.newBuilder() @@ -1502,6 +1520,7 @@ public void createSecondaryInstanceTest2() throws Exception { .setReconciling(true) .setEtag("etag3123477") .putAllAnnotations(new HashMap()) + .setUpdatePolicy(Instance.UpdatePolicy.newBuilder().build()) .build(); Operation resultOperation = Operation.newBuilder() @@ -1633,6 +1652,7 @@ public void updateInstanceTest() throws Exception { .setReconciling(true) .setEtag("etag3123477") .putAllAnnotations(new HashMap()) + .setUpdatePolicy(Instance.UpdatePolicy.newBuilder().build()) .build(); Operation resultOperation = Operation.newBuilder() @@ -1663,6 +1683,7 @@ public void updateInstanceTest() throws Exception { .setReconciling(true) .setEtag("etag3123477") .putAllAnnotations(new HashMap()) + .setUpdatePolicy(Instance.UpdatePolicy.newBuilder().build()) .build(); FieldMask updateMask = FieldMask.newBuilder().build(); @@ -1713,6 +1734,7 @@ public void updateInstanceExceptionTest() throws Exception { .setReconciling(true) .setEtag("etag3123477") .putAllAnnotations(new HashMap()) + .setUpdatePolicy(Instance.UpdatePolicy.newBuilder().build()) .build(); FieldMask updateMask = FieldMask.newBuilder().build(); client.updateInstanceAsync(instance, updateMask).get(); @@ -1836,6 +1858,7 @@ public void failoverInstanceTest() throws Exception { .setReconciling(true) .setEtag("etag3123477") .putAllAnnotations(new HashMap()) + .setUpdatePolicy(Instance.UpdatePolicy.newBuilder().build()) .build(); Operation resultOperation = Operation.newBuilder() @@ -1903,6 +1926,7 @@ public void failoverInstanceTest2() throws Exception { .setReconciling(true) .setEtag("etag3123477") .putAllAnnotations(new HashMap()) + .setUpdatePolicy(Instance.UpdatePolicy.newBuilder().build()) .build(); Operation resultOperation = Operation.newBuilder() @@ -1949,6 +1973,148 @@ public void failoverInstanceExceptionTest2() throws Exception { } } + @Test + public void injectFaultTest() throws Exception { + Instance expectedResponse = + Instance.newBuilder() + .setName( + InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]").toString()) + .setDisplayName("displayName1714148973") + .setUid("uid115792") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setDeleteTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .setMachineConfig(Instance.MachineConfig.newBuilder().build()) + .setGceZone("gceZone-146048427") + .putAllDatabaseFlags(new HashMap()) + .setWritableNode(Instance.Node.newBuilder().build()) + .addAllNodes(new ArrayList()) + .setQueryInsightsConfig(Instance.QueryInsightsInstanceConfig.newBuilder().build()) + .setReadPoolConfig(Instance.ReadPoolConfig.newBuilder().build()) + .setIpAddress("ipAddress1634032845") + .setReconciling(true) + .setEtag("etag3123477") + .putAllAnnotations(new HashMap()) + .setUpdatePolicy(Instance.UpdatePolicy.newBuilder().build()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("injectFaultTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + InjectFaultRequest.FaultType faultType = InjectFaultRequest.FaultType.forNumber(0); + InstanceName name = InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]"); + + Instance actualResponse = client.injectFaultAsync(faultType, name).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void injectFaultExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + InjectFaultRequest.FaultType faultType = InjectFaultRequest.FaultType.forNumber(0); + InstanceName name = InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]"); + client.injectFaultAsync(faultType, name).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @Test + public void injectFaultTest2() throws Exception { + Instance expectedResponse = + Instance.newBuilder() + .setName( + InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]").toString()) + .setDisplayName("displayName1714148973") + .setUid("uid115792") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setDeleteTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .setMachineConfig(Instance.MachineConfig.newBuilder().build()) + .setGceZone("gceZone-146048427") + .putAllDatabaseFlags(new HashMap()) + .setWritableNode(Instance.Node.newBuilder().build()) + .addAllNodes(new ArrayList()) + .setQueryInsightsConfig(Instance.QueryInsightsInstanceConfig.newBuilder().build()) + .setReadPoolConfig(Instance.ReadPoolConfig.newBuilder().build()) + .setIpAddress("ipAddress1634032845") + .setReconciling(true) + .setEtag("etag3123477") + .putAllAnnotations(new HashMap()) + .setUpdatePolicy(Instance.UpdatePolicy.newBuilder().build()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("injectFaultTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + InjectFaultRequest.FaultType faultType = InjectFaultRequest.FaultType.forNumber(0); + String name = + "projects/project-867/locations/location-867/clusters/cluster-867/instances/instance-867"; + + Instance actualResponse = client.injectFaultAsync(faultType, name).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void injectFaultExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + InjectFaultRequest.FaultType faultType = InjectFaultRequest.FaultType.forNumber(0); + String name = + "projects/project-867/locations/location-867/clusters/cluster-867/instances/instance-867"; + client.injectFaultAsync(faultType, name).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + @Test public void restartInstanceTest() throws Exception { Instance expectedResponse = @@ -1972,6 +2138,7 @@ public void restartInstanceTest() throws Exception { .setReconciling(true) .setEtag("etag3123477") .putAllAnnotations(new HashMap()) + .setUpdatePolicy(Instance.UpdatePolicy.newBuilder().build()) .build(); Operation resultOperation = Operation.newBuilder() @@ -2039,6 +2206,7 @@ public void restartInstanceTest2() throws Exception { .setReconciling(true) .setEtag("etag3123477") .putAllAnnotations(new HashMap()) + .setUpdatePolicy(Instance.UpdatePolicy.newBuilder().build()) .build(); Operation resultOperation = Operation.newBuilder() @@ -2746,6 +2914,7 @@ public void generateClientCertificateTest() throws Exception { GenerateClientCertificateResponse.newBuilder() .setPemCertificate("pemCertificate153491807") .addAllPemCertificateChain(new ArrayList()) + .setCaCert("caCert-1369003102") .build(); mockService.addResponse(expectedResponse); @@ -2791,6 +2960,7 @@ public void generateClientCertificateTest2() throws Exception { GenerateClientCertificateResponse.newBuilder() .setPemCertificate("pemCertificate153491807") .addAllPemCertificateChain(new ArrayList()) + .setCaCert("caCert-1369003102") .build(); mockService.addResponse(expectedResponse); @@ -2926,6 +3096,440 @@ public void getConnectionInfoExceptionTest2() throws Exception { } } + @Test + public void listUsersTest() throws Exception { + User responsesElement = User.newBuilder().build(); + ListUsersResponse expectedResponse = + ListUsersResponse.newBuilder() + .setNextPageToken("") + .addAllUsers(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + ClusterName parent = ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]"); + + ListUsersPagedResponse pagedListResponse = client.listUsers(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getUsersList().get(0), resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void listUsersExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ClusterName parent = ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]"); + client.listUsers(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listUsersTest2() throws Exception { + User responsesElement = User.newBuilder().build(); + ListUsersResponse expectedResponse = + ListUsersResponse.newBuilder() + .setNextPageToken("") + .addAllUsers(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + String parent = "projects/project-9466/locations/location-9466/clusters/cluster-9466"; + + ListUsersPagedResponse pagedListResponse = client.listUsers(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getUsersList().get(0), resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void listUsersExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String parent = "projects/project-9466/locations/location-9466/clusters/cluster-9466"; + client.listUsers(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getUserTest() throws Exception { + User expectedResponse = + User.newBuilder() + .setName(UserName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[USER]").toString()) + .setPassword("password1216985755") + .addAllDatabaseRoles(new ArrayList()) + .build(); + mockService.addResponse(expectedResponse); + + UserName name = UserName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[USER]"); + + User actualResponse = client.getUser(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void getUserExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + UserName name = UserName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[USER]"); + client.getUser(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getUserTest2() throws Exception { + User expectedResponse = + User.newBuilder() + .setName(UserName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[USER]").toString()) + .setPassword("password1216985755") + .addAllDatabaseRoles(new ArrayList()) + .build(); + mockService.addResponse(expectedResponse); + + String name = + "projects/project-6835/locations/location-6835/clusters/cluster-6835/users/user-6835"; + + User actualResponse = client.getUser(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void getUserExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = + "projects/project-6835/locations/location-6835/clusters/cluster-6835/users/user-6835"; + client.getUser(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createUserTest() throws Exception { + User expectedResponse = + User.newBuilder() + .setName(UserName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[USER]").toString()) + .setPassword("password1216985755") + .addAllDatabaseRoles(new ArrayList()) + .build(); + mockService.addResponse(expectedResponse); + + ClusterName parent = ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]"); + User user = User.newBuilder().build(); + String userId = "userId-836030906"; + + User actualResponse = client.createUser(parent, user, userId); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void createUserExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ClusterName parent = ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]"); + User user = User.newBuilder().build(); + String userId = "userId-836030906"; + client.createUser(parent, user, userId); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createUserTest2() throws Exception { + User expectedResponse = + User.newBuilder() + .setName(UserName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[USER]").toString()) + .setPassword("password1216985755") + .addAllDatabaseRoles(new ArrayList()) + .build(); + mockService.addResponse(expectedResponse); + + String parent = "projects/project-9466/locations/location-9466/clusters/cluster-9466"; + User user = User.newBuilder().build(); + String userId = "userId-836030906"; + + User actualResponse = client.createUser(parent, user, userId); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void createUserExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String parent = "projects/project-9466/locations/location-9466/clusters/cluster-9466"; + User user = User.newBuilder().build(); + String userId = "userId-836030906"; + client.createUser(parent, user, userId); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void updateUserTest() throws Exception { + User expectedResponse = + User.newBuilder() + .setName(UserName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[USER]").toString()) + .setPassword("password1216985755") + .addAllDatabaseRoles(new ArrayList()) + .build(); + mockService.addResponse(expectedResponse); + + User user = + User.newBuilder() + .setName(UserName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[USER]").toString()) + .setPassword("password1216985755") + .addAllDatabaseRoles(new ArrayList()) + .build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + + User actualResponse = client.updateUser(user, updateMask); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void updateUserExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + User user = + User.newBuilder() + .setName(UserName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[USER]").toString()) + .setPassword("password1216985755") + .addAllDatabaseRoles(new ArrayList()) + .build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + client.updateUser(user, updateMask); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deleteUserTest() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockService.addResponse(expectedResponse); + + UserName name = UserName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[USER]"); + + client.deleteUser(name); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void deleteUserExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + UserName name = UserName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[USER]"); + client.deleteUser(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deleteUserTest2() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockService.addResponse(expectedResponse); + + String name = + "projects/project-6835/locations/location-6835/clusters/cluster-6835/users/user-6835"; + + client.deleteUser(name); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void deleteUserExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = + "projects/project-6835/locations/location-6835/clusters/cluster-6835/users/user-6835"; + client.deleteUser(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + @Test public void listLocationsTest() throws Exception { Location responsesElement = Location.newBuilder().build(); diff --git a/java-alloydb/google-cloud-alloydb/src/test/java/com/google/cloud/alloydb/v1beta/AlloyDBAdminClientTest.java b/java-alloydb/google-cloud-alloydb/src/test/java/com/google/cloud/alloydb/v1beta/AlloyDBAdminClientTest.java index 7c3e5d0471a0..efd342606b28 100644 --- a/java-alloydb/google-cloud-alloydb/src/test/java/com/google/cloud/alloydb/v1beta/AlloyDBAdminClientTest.java +++ b/java-alloydb/google-cloud-alloydb/src/test/java/com/google/cloud/alloydb/v1beta/AlloyDBAdminClientTest.java @@ -21,6 +21,7 @@ import static com.google.cloud.alloydb.v1beta.AlloyDBAdminClient.ListInstancesPagedResponse; import static com.google.cloud.alloydb.v1beta.AlloyDBAdminClient.ListLocationsPagedResponse; import static com.google.cloud.alloydb.v1beta.AlloyDBAdminClient.ListSupportedDatabaseFlagsPagedResponse; +import static com.google.cloud.alloydb.v1beta.AlloyDBAdminClient.ListUsersPagedResponse; import com.google.api.gax.core.NoCredentialsProvider; import com.google.api.gax.grpc.GaxGrpcProperties; @@ -200,6 +201,7 @@ public void getClusterTest() throws Exception { .setDeleteTime(Timestamp.newBuilder().build()) .putAllLabels(new HashMap()) .setDatabaseVersion(DatabaseVersion.forNumber(0)) + .setNetworkConfig(Cluster.NetworkConfig.newBuilder().build()) .setNetwork("network1843485230") .setEtag("etag3123477") .putAllAnnotations(new HashMap()) @@ -258,6 +260,7 @@ public void getClusterTest2() throws Exception { .setDeleteTime(Timestamp.newBuilder().build()) .putAllLabels(new HashMap()) .setDatabaseVersion(DatabaseVersion.forNumber(0)) + .setNetworkConfig(Cluster.NetworkConfig.newBuilder().build()) .setNetwork("network1843485230") .setEtag("etag3123477") .putAllAnnotations(new HashMap()) @@ -316,6 +319,7 @@ public void createClusterTest() throws Exception { .setDeleteTime(Timestamp.newBuilder().build()) .putAllLabels(new HashMap()) .setDatabaseVersion(DatabaseVersion.forNumber(0)) + .setNetworkConfig(Cluster.NetworkConfig.newBuilder().build()) .setNetwork("network1843485230") .setEtag("etag3123477") .putAllAnnotations(new HashMap()) @@ -388,6 +392,7 @@ public void createClusterTest2() throws Exception { .setDeleteTime(Timestamp.newBuilder().build()) .putAllLabels(new HashMap()) .setDatabaseVersion(DatabaseVersion.forNumber(0)) + .setNetworkConfig(Cluster.NetworkConfig.newBuilder().build()) .setNetwork("network1843485230") .setEtag("etag3123477") .putAllAnnotations(new HashMap()) @@ -460,6 +465,7 @@ public void updateClusterTest() throws Exception { .setDeleteTime(Timestamp.newBuilder().build()) .putAllLabels(new HashMap()) .setDatabaseVersion(DatabaseVersion.forNumber(0)) + .setNetworkConfig(Cluster.NetworkConfig.newBuilder().build()) .setNetwork("network1843485230") .setEtag("etag3123477") .putAllAnnotations(new HashMap()) @@ -613,6 +619,7 @@ public void promoteClusterTest() throws Exception { .setDeleteTime(Timestamp.newBuilder().build()) .putAllLabels(new HashMap()) .setDatabaseVersion(DatabaseVersion.forNumber(0)) + .setNetworkConfig(Cluster.NetworkConfig.newBuilder().build()) .setNetwork("network1843485230") .setEtag("etag3123477") .putAllAnnotations(new HashMap()) @@ -679,6 +686,7 @@ public void promoteClusterTest2() throws Exception { .setDeleteTime(Timestamp.newBuilder().build()) .putAllLabels(new HashMap()) .setDatabaseVersion(DatabaseVersion.forNumber(0)) + .setNetworkConfig(Cluster.NetworkConfig.newBuilder().build()) .setNetwork("network1843485230") .setEtag("etag3123477") .putAllAnnotations(new HashMap()) @@ -745,6 +753,7 @@ public void restoreClusterTest() throws Exception { .setDeleteTime(Timestamp.newBuilder().build()) .putAllLabels(new HashMap()) .setDatabaseVersion(DatabaseVersion.forNumber(0)) + .setNetworkConfig(Cluster.NetworkConfig.newBuilder().build()) .setNetwork("network1843485230") .setEtag("etag3123477") .putAllAnnotations(new HashMap()) @@ -832,6 +841,7 @@ public void createSecondaryClusterTest() throws Exception { .setDeleteTime(Timestamp.newBuilder().build()) .putAllLabels(new HashMap()) .setDatabaseVersion(DatabaseVersion.forNumber(0)) + .setNetworkConfig(Cluster.NetworkConfig.newBuilder().build()) .setNetwork("network1843485230") .setEtag("etag3123477") .putAllAnnotations(new HashMap()) @@ -905,6 +915,7 @@ public void createSecondaryClusterTest2() throws Exception { .setDeleteTime(Timestamp.newBuilder().build()) .putAllLabels(new HashMap()) .setDatabaseVersion(DatabaseVersion.forNumber(0)) + .setNetworkConfig(Cluster.NetworkConfig.newBuilder().build()) .setNetwork("network1843485230") .setEtag("etag3123477") .putAllAnnotations(new HashMap()) @@ -1077,6 +1088,7 @@ public void getInstanceTest() throws Exception { .setReconciling(true) .setEtag("etag3123477") .putAllAnnotations(new HashMap()) + .setUpdatePolicy(Instance.UpdatePolicy.newBuilder().build()) .build(); mockAlloyDBAdmin.addResponse(expectedResponse); @@ -1133,6 +1145,7 @@ public void getInstanceTest2() throws Exception { .setReconciling(true) .setEtag("etag3123477") .putAllAnnotations(new HashMap()) + .setUpdatePolicy(Instance.UpdatePolicy.newBuilder().build()) .build(); mockAlloyDBAdmin.addResponse(expectedResponse); @@ -1189,6 +1202,7 @@ public void createInstanceTest() throws Exception { .setReconciling(true) .setEtag("etag3123477") .putAllAnnotations(new HashMap()) + .setUpdatePolicy(Instance.UpdatePolicy.newBuilder().build()) .build(); Operation resultOperation = Operation.newBuilder() @@ -1259,6 +1273,7 @@ public void createInstanceTest2() throws Exception { .setReconciling(true) .setEtag("etag3123477") .putAllAnnotations(new HashMap()) + .setUpdatePolicy(Instance.UpdatePolicy.newBuilder().build()) .build(); Operation resultOperation = Operation.newBuilder() @@ -1329,6 +1344,7 @@ public void createSecondaryInstanceTest() throws Exception { .setReconciling(true) .setEtag("etag3123477") .putAllAnnotations(new HashMap()) + .setUpdatePolicy(Instance.UpdatePolicy.newBuilder().build()) .build(); Operation resultOperation = Operation.newBuilder() @@ -1401,6 +1417,7 @@ public void createSecondaryInstanceTest2() throws Exception { .setReconciling(true) .setEtag("etag3123477") .putAllAnnotations(new HashMap()) + .setUpdatePolicy(Instance.UpdatePolicy.newBuilder().build()) .build(); Operation resultOperation = Operation.newBuilder() @@ -1532,6 +1549,7 @@ public void updateInstanceTest() throws Exception { .setReconciling(true) .setEtag("etag3123477") .putAllAnnotations(new HashMap()) + .setUpdatePolicy(Instance.UpdatePolicy.newBuilder().build()) .build(); Operation resultOperation = Operation.newBuilder() @@ -1683,6 +1701,7 @@ public void failoverInstanceTest() throws Exception { .setReconciling(true) .setEtag("etag3123477") .putAllAnnotations(new HashMap()) + .setUpdatePolicy(Instance.UpdatePolicy.newBuilder().build()) .build(); Operation resultOperation = Operation.newBuilder() @@ -1747,6 +1766,7 @@ public void failoverInstanceTest2() throws Exception { .setReconciling(true) .setEtag("etag3123477") .putAllAnnotations(new HashMap()) + .setUpdatePolicy(Instance.UpdatePolicy.newBuilder().build()) .build(); Operation resultOperation = Operation.newBuilder() @@ -1788,6 +1808,142 @@ public void failoverInstanceExceptionTest2() throws Exception { } } + @Test + public void injectFaultTest() throws Exception { + Instance expectedResponse = + Instance.newBuilder() + .setName( + InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]").toString()) + .setDisplayName("displayName1714148973") + .setUid("uid115792") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setDeleteTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .setMachineConfig(Instance.MachineConfig.newBuilder().build()) + .setGceZone("gceZone-146048427") + .putAllDatabaseFlags(new HashMap()) + .setWritableNode(Instance.Node.newBuilder().build()) + .addAllNodes(new ArrayList()) + .setQueryInsightsConfig(Instance.QueryInsightsInstanceConfig.newBuilder().build()) + .setReadPoolConfig(Instance.ReadPoolConfig.newBuilder().build()) + .setIpAddress("ipAddress1634032845") + .setReconciling(true) + .setEtag("etag3123477") + .putAllAnnotations(new HashMap()) + .setUpdatePolicy(Instance.UpdatePolicy.newBuilder().build()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("injectFaultTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockAlloyDBAdmin.addResponse(resultOperation); + + InjectFaultRequest.FaultType faultType = InjectFaultRequest.FaultType.forNumber(0); + InstanceName name = InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]"); + + Instance actualResponse = client.injectFaultAsync(faultType, name).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockAlloyDBAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + InjectFaultRequest actualRequest = ((InjectFaultRequest) actualRequests.get(0)); + + Assert.assertEquals(faultType, actualRequest.getFaultType()); + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void injectFaultExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockAlloyDBAdmin.addException(exception); + + try { + InjectFaultRequest.FaultType faultType = InjectFaultRequest.FaultType.forNumber(0); + InstanceName name = InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]"); + client.injectFaultAsync(faultType, name).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + public void injectFaultTest2() throws Exception { + Instance expectedResponse = + Instance.newBuilder() + .setName( + InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]").toString()) + .setDisplayName("displayName1714148973") + .setUid("uid115792") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setDeleteTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .setMachineConfig(Instance.MachineConfig.newBuilder().build()) + .setGceZone("gceZone-146048427") + .putAllDatabaseFlags(new HashMap()) + .setWritableNode(Instance.Node.newBuilder().build()) + .addAllNodes(new ArrayList()) + .setQueryInsightsConfig(Instance.QueryInsightsInstanceConfig.newBuilder().build()) + .setReadPoolConfig(Instance.ReadPoolConfig.newBuilder().build()) + .setIpAddress("ipAddress1634032845") + .setReconciling(true) + .setEtag("etag3123477") + .putAllAnnotations(new HashMap()) + .setUpdatePolicy(Instance.UpdatePolicy.newBuilder().build()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("injectFaultTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockAlloyDBAdmin.addResponse(resultOperation); + + InjectFaultRequest.FaultType faultType = InjectFaultRequest.FaultType.forNumber(0); + String name = "name3373707"; + + Instance actualResponse = client.injectFaultAsync(faultType, name).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockAlloyDBAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + InjectFaultRequest actualRequest = ((InjectFaultRequest) actualRequests.get(0)); + + Assert.assertEquals(faultType, actualRequest.getFaultType()); + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void injectFaultExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockAlloyDBAdmin.addException(exception); + + try { + InjectFaultRequest.FaultType faultType = InjectFaultRequest.FaultType.forNumber(0); + String name = "name3373707"; + client.injectFaultAsync(faultType, name).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + @Test public void restartInstanceTest() throws Exception { Instance expectedResponse = @@ -1811,6 +1967,7 @@ public void restartInstanceTest() throws Exception { .setReconciling(true) .setEtag("etag3123477") .putAllAnnotations(new HashMap()) + .setUpdatePolicy(Instance.UpdatePolicy.newBuilder().build()) .build(); Operation resultOperation = Operation.newBuilder() @@ -1875,6 +2032,7 @@ public void restartInstanceTest2() throws Exception { .setReconciling(true) .setEtag("etag3123477") .putAllAnnotations(new HashMap()) + .setUpdatePolicy(Instance.UpdatePolicy.newBuilder().build()) .build(); Operation resultOperation = Operation.newBuilder() @@ -2495,6 +2653,7 @@ public void generateClientCertificateTest() throws Exception { GenerateClientCertificateResponse.newBuilder() .setPemCertificate("pemCertificate153491807") .addAllPemCertificateChain(new ArrayList()) + .setCaCert("caCert-1369003102") .build(); mockAlloyDBAdmin.addResponse(expectedResponse); @@ -2535,6 +2694,7 @@ public void generateClientCertificateTest2() throws Exception { GenerateClientCertificateResponse.newBuilder() .setPemCertificate("pemCertificate153491807") .addAllPemCertificateChain(new ArrayList()) + .setCaCert("caCert-1369003102") .build(); mockAlloyDBAdmin.addResponse(expectedResponse); @@ -2651,6 +2811,377 @@ public void getConnectionInfoExceptionTest2() throws Exception { } } + @Test + public void listUsersTest() throws Exception { + User responsesElement = User.newBuilder().build(); + ListUsersResponse expectedResponse = + ListUsersResponse.newBuilder() + .setNextPageToken("") + .addAllUsers(Arrays.asList(responsesElement)) + .build(); + mockAlloyDBAdmin.addResponse(expectedResponse); + + ClusterName parent = ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]"); + + ListUsersPagedResponse pagedListResponse = client.listUsers(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getUsersList().get(0), resources.get(0)); + + List actualRequests = mockAlloyDBAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListUsersRequest actualRequest = ((ListUsersRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listUsersExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockAlloyDBAdmin.addException(exception); + + try { + ClusterName parent = ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]"); + client.listUsers(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listUsersTest2() throws Exception { + User responsesElement = User.newBuilder().build(); + ListUsersResponse expectedResponse = + ListUsersResponse.newBuilder() + .setNextPageToken("") + .addAllUsers(Arrays.asList(responsesElement)) + .build(); + mockAlloyDBAdmin.addResponse(expectedResponse); + + String parent = "parent-995424086"; + + ListUsersPagedResponse pagedListResponse = client.listUsers(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getUsersList().get(0), resources.get(0)); + + List actualRequests = mockAlloyDBAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListUsersRequest actualRequest = ((ListUsersRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listUsersExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockAlloyDBAdmin.addException(exception); + + try { + String parent = "parent-995424086"; + client.listUsers(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getUserTest() throws Exception { + User expectedResponse = + User.newBuilder() + .setName(UserName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[USER]").toString()) + .setPassword("password1216985755") + .addAllDatabaseRoles(new ArrayList()) + .build(); + mockAlloyDBAdmin.addResponse(expectedResponse); + + UserName name = UserName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[USER]"); + + User actualResponse = client.getUser(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockAlloyDBAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetUserRequest actualRequest = ((GetUserRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getUserExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockAlloyDBAdmin.addException(exception); + + try { + UserName name = UserName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[USER]"); + client.getUser(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getUserTest2() throws Exception { + User expectedResponse = + User.newBuilder() + .setName(UserName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[USER]").toString()) + .setPassword("password1216985755") + .addAllDatabaseRoles(new ArrayList()) + .build(); + mockAlloyDBAdmin.addResponse(expectedResponse); + + String name = "name3373707"; + + User actualResponse = client.getUser(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockAlloyDBAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetUserRequest actualRequest = ((GetUserRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getUserExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockAlloyDBAdmin.addException(exception); + + try { + String name = "name3373707"; + client.getUser(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createUserTest() throws Exception { + User expectedResponse = + User.newBuilder() + .setName(UserName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[USER]").toString()) + .setPassword("password1216985755") + .addAllDatabaseRoles(new ArrayList()) + .build(); + mockAlloyDBAdmin.addResponse(expectedResponse); + + ClusterName parent = ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]"); + User user = User.newBuilder().build(); + String userId = "userId-836030906"; + + User actualResponse = client.createUser(parent, user, userId); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockAlloyDBAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateUserRequest actualRequest = ((CreateUserRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertEquals(user, actualRequest.getUser()); + Assert.assertEquals(userId, actualRequest.getUserId()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createUserExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockAlloyDBAdmin.addException(exception); + + try { + ClusterName parent = ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]"); + User user = User.newBuilder().build(); + String userId = "userId-836030906"; + client.createUser(parent, user, userId); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createUserTest2() throws Exception { + User expectedResponse = + User.newBuilder() + .setName(UserName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[USER]").toString()) + .setPassword("password1216985755") + .addAllDatabaseRoles(new ArrayList()) + .build(); + mockAlloyDBAdmin.addResponse(expectedResponse); + + String parent = "parent-995424086"; + User user = User.newBuilder().build(); + String userId = "userId-836030906"; + + User actualResponse = client.createUser(parent, user, userId); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockAlloyDBAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateUserRequest actualRequest = ((CreateUserRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertEquals(user, actualRequest.getUser()); + Assert.assertEquals(userId, actualRequest.getUserId()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createUserExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockAlloyDBAdmin.addException(exception); + + try { + String parent = "parent-995424086"; + User user = User.newBuilder().build(); + String userId = "userId-836030906"; + client.createUser(parent, user, userId); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void updateUserTest() throws Exception { + User expectedResponse = + User.newBuilder() + .setName(UserName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[USER]").toString()) + .setPassword("password1216985755") + .addAllDatabaseRoles(new ArrayList()) + .build(); + mockAlloyDBAdmin.addResponse(expectedResponse); + + User user = User.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + + User actualResponse = client.updateUser(user, updateMask); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockAlloyDBAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + UpdateUserRequest actualRequest = ((UpdateUserRequest) actualRequests.get(0)); + + Assert.assertEquals(user, actualRequest.getUser()); + Assert.assertEquals(updateMask, actualRequest.getUpdateMask()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void updateUserExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockAlloyDBAdmin.addException(exception); + + try { + User user = User.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + client.updateUser(user, updateMask); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deleteUserTest() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockAlloyDBAdmin.addResponse(expectedResponse); + + UserName name = UserName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[USER]"); + + client.deleteUser(name); + + List actualRequests = mockAlloyDBAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteUserRequest actualRequest = ((DeleteUserRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void deleteUserExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockAlloyDBAdmin.addException(exception); + + try { + UserName name = UserName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[USER]"); + client.deleteUser(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deleteUserTest2() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockAlloyDBAdmin.addResponse(expectedResponse); + + String name = "name3373707"; + + client.deleteUser(name); + + List actualRequests = mockAlloyDBAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteUserRequest actualRequest = ((DeleteUserRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void deleteUserExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockAlloyDBAdmin.addException(exception); + + try { + String name = "name3373707"; + client.deleteUser(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + @Test public void listLocationsTest() throws Exception { Location responsesElement = Location.newBuilder().build(); diff --git a/java-alloydb/google-cloud-alloydb/src/test/java/com/google/cloud/alloydb/v1beta/MockAlloyDBAdminImpl.java b/java-alloydb/google-cloud-alloydb/src/test/java/com/google/cloud/alloydb/v1beta/MockAlloyDBAdminImpl.java index 5e2d41af5e78..aecc6541d9d8 100644 --- a/java-alloydb/google-cloud-alloydb/src/test/java/com/google/cloud/alloydb/v1beta/MockAlloyDBAdminImpl.java +++ b/java-alloydb/google-cloud-alloydb/src/test/java/com/google/cloud/alloydb/v1beta/MockAlloyDBAdminImpl.java @@ -20,6 +20,7 @@ import com.google.cloud.alloydb.v1beta.AlloyDBAdminGrpc.AlloyDBAdminImplBase; import com.google.longrunning.Operation; import com.google.protobuf.AbstractMessage; +import com.google.protobuf.Empty; import io.grpc.stub.StreamObserver; import java.util.ArrayList; import java.util.LinkedList; @@ -393,6 +394,26 @@ public void failoverInstance( } } + @Override + public void injectFault(InjectFaultRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Operation) { + requests.add(request); + responseObserver.onNext(((Operation) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method InjectFault, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } + @Override public void restartInstance( RestartInstanceRequest request, StreamObserver responseObserver) { @@ -582,4 +603,105 @@ public void getConnectionInfo( Exception.class.getName()))); } } + + @Override + public void listUsers( + ListUsersRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof ListUsersResponse) { + requests.add(request); + responseObserver.onNext(((ListUsersResponse) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method ListUsers, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + ListUsersResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void getUser(GetUserRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof User) { + requests.add(request); + responseObserver.onNext(((User) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method GetUser, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + User.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void createUser(CreateUserRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof User) { + requests.add(request); + responseObserver.onNext(((User) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method CreateUser, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + User.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void updateUser(UpdateUserRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof User) { + requests.add(request); + responseObserver.onNext(((User) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method UpdateUser, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + User.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void deleteUser(DeleteUserRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Empty) { + requests.add(request); + responseObserver.onNext(((Empty) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method DeleteUser, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Empty.class.getName(), + Exception.class.getName()))); + } + } } diff --git a/java-alloydb/grpc-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/AlloyDBAdminGrpc.java b/java-alloydb/grpc-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/AlloyDBAdminGrpc.java index 89aa9f682817..aae9a5e72e79 100644 --- a/java-alloydb/grpc-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/AlloyDBAdminGrpc.java +++ b/java-alloydb/grpc-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/AlloyDBAdminGrpc.java @@ -250,6 +250,49 @@ private AlloyDBAdminGrpc() {} return getDeleteClusterMethod; } + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.alloydb.v1.PromoteClusterRequest, com.google.longrunning.Operation> + getPromoteClusterMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "PromoteCluster", + requestType = com.google.cloud.alloydb.v1.PromoteClusterRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.alloydb.v1.PromoteClusterRequest, com.google.longrunning.Operation> + getPromoteClusterMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.alloydb.v1.PromoteClusterRequest, com.google.longrunning.Operation> + getPromoteClusterMethod; + if ((getPromoteClusterMethod = AlloyDBAdminGrpc.getPromoteClusterMethod) == null) { + synchronized (AlloyDBAdminGrpc.class) { + if ((getPromoteClusterMethod = AlloyDBAdminGrpc.getPromoteClusterMethod) == null) { + AlloyDBAdminGrpc.getPromoteClusterMethod = + getPromoteClusterMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "PromoteCluster")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.alloydb.v1.PromoteClusterRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new AlloyDBAdminMethodDescriptorSupplier("PromoteCluster")) + .build(); + } + } + } + return getPromoteClusterMethod; + } + private static volatile io.grpc.MethodDescriptor< com.google.cloud.alloydb.v1.RestoreClusterRequest, com.google.longrunning.Operation> getRestoreClusterMethod; @@ -293,6 +336,55 @@ private AlloyDBAdminGrpc() {} return getRestoreClusterMethod; } + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.alloydb.v1.CreateSecondaryClusterRequest, + com.google.longrunning.Operation> + getCreateSecondaryClusterMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "CreateSecondaryCluster", + requestType = com.google.cloud.alloydb.v1.CreateSecondaryClusterRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.alloydb.v1.CreateSecondaryClusterRequest, + com.google.longrunning.Operation> + getCreateSecondaryClusterMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.alloydb.v1.CreateSecondaryClusterRequest, + com.google.longrunning.Operation> + getCreateSecondaryClusterMethod; + if ((getCreateSecondaryClusterMethod = AlloyDBAdminGrpc.getCreateSecondaryClusterMethod) + == null) { + synchronized (AlloyDBAdminGrpc.class) { + if ((getCreateSecondaryClusterMethod = AlloyDBAdminGrpc.getCreateSecondaryClusterMethod) + == null) { + AlloyDBAdminGrpc.getCreateSecondaryClusterMethod = + getCreateSecondaryClusterMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "CreateSecondaryCluster")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.alloydb.v1.CreateSecondaryClusterRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new AlloyDBAdminMethodDescriptorSupplier("CreateSecondaryCluster")) + .build(); + } + } + } + return getCreateSecondaryClusterMethod; + } + private static volatile io.grpc.MethodDescriptor< com.google.cloud.alloydb.v1.ListInstancesRequest, com.google.cloud.alloydb.v1.ListInstancesResponse> @@ -424,6 +516,55 @@ private AlloyDBAdminGrpc() {} return getCreateInstanceMethod; } + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.alloydb.v1.CreateSecondaryInstanceRequest, + com.google.longrunning.Operation> + getCreateSecondaryInstanceMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "CreateSecondaryInstance", + requestType = com.google.cloud.alloydb.v1.CreateSecondaryInstanceRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.alloydb.v1.CreateSecondaryInstanceRequest, + com.google.longrunning.Operation> + getCreateSecondaryInstanceMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.alloydb.v1.CreateSecondaryInstanceRequest, + com.google.longrunning.Operation> + getCreateSecondaryInstanceMethod; + if ((getCreateSecondaryInstanceMethod = AlloyDBAdminGrpc.getCreateSecondaryInstanceMethod) + == null) { + synchronized (AlloyDBAdminGrpc.class) { + if ((getCreateSecondaryInstanceMethod = AlloyDBAdminGrpc.getCreateSecondaryInstanceMethod) + == null) { + AlloyDBAdminGrpc.getCreateSecondaryInstanceMethod = + getCreateSecondaryInstanceMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "CreateSecondaryInstance")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.alloydb.v1.CreateSecondaryInstanceRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new AlloyDBAdminMethodDescriptorSupplier("CreateSecondaryInstance")) + .build(); + } + } + } + return getCreateSecondaryInstanceMethod; + } + private static volatile io.grpc.MethodDescriptor< com.google.cloud.alloydb.v1.BatchCreateInstancesRequest, com.google.longrunning.Operation> getBatchCreateInstancesMethod; @@ -599,6 +740,47 @@ private AlloyDBAdminGrpc() {} return getFailoverInstanceMethod; } + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.alloydb.v1.InjectFaultRequest, com.google.longrunning.Operation> + getInjectFaultMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "InjectFault", + requestType = com.google.cloud.alloydb.v1.InjectFaultRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.alloydb.v1.InjectFaultRequest, com.google.longrunning.Operation> + getInjectFaultMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.alloydb.v1.InjectFaultRequest, com.google.longrunning.Operation> + getInjectFaultMethod; + if ((getInjectFaultMethod = AlloyDBAdminGrpc.getInjectFaultMethod) == null) { + synchronized (AlloyDBAdminGrpc.class) { + if ((getInjectFaultMethod = AlloyDBAdminGrpc.getInjectFaultMethod) == null) { + AlloyDBAdminGrpc.getInjectFaultMethod = + getInjectFaultMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "InjectFault")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.alloydb.v1.InjectFaultRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor(new AlloyDBAdminMethodDescriptorSupplier("InjectFault")) + .build(); + } + } + } + return getInjectFaultMethod; + } + private static volatile io.grpc.MethodDescriptor< com.google.cloud.alloydb.v1.RestartInstanceRequest, com.google.longrunning.Operation> getRestartInstanceMethod; @@ -901,6 +1083,213 @@ private AlloyDBAdminGrpc() {} return getListSupportedDatabaseFlagsMethod; } + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.alloydb.v1.ListUsersRequest, + com.google.cloud.alloydb.v1.ListUsersResponse> + getListUsersMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ListUsers", + requestType = com.google.cloud.alloydb.v1.ListUsersRequest.class, + responseType = com.google.cloud.alloydb.v1.ListUsersResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.alloydb.v1.ListUsersRequest, + com.google.cloud.alloydb.v1.ListUsersResponse> + getListUsersMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.alloydb.v1.ListUsersRequest, + com.google.cloud.alloydb.v1.ListUsersResponse> + getListUsersMethod; + if ((getListUsersMethod = AlloyDBAdminGrpc.getListUsersMethod) == null) { + synchronized (AlloyDBAdminGrpc.class) { + if ((getListUsersMethod = AlloyDBAdminGrpc.getListUsersMethod) == null) { + AlloyDBAdminGrpc.getListUsersMethod = + getListUsersMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ListUsers")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.alloydb.v1.ListUsersRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.alloydb.v1.ListUsersResponse.getDefaultInstance())) + .setSchemaDescriptor(new AlloyDBAdminMethodDescriptorSupplier("ListUsers")) + .build(); + } + } + } + return getListUsersMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.alloydb.v1.GetUserRequest, com.google.cloud.alloydb.v1.User> + getGetUserMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetUser", + requestType = com.google.cloud.alloydb.v1.GetUserRequest.class, + responseType = com.google.cloud.alloydb.v1.User.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.alloydb.v1.GetUserRequest, com.google.cloud.alloydb.v1.User> + getGetUserMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.alloydb.v1.GetUserRequest, com.google.cloud.alloydb.v1.User> + getGetUserMethod; + if ((getGetUserMethod = AlloyDBAdminGrpc.getGetUserMethod) == null) { + synchronized (AlloyDBAdminGrpc.class) { + if ((getGetUserMethod = AlloyDBAdminGrpc.getGetUserMethod) == null) { + AlloyDBAdminGrpc.getGetUserMethod = + getGetUserMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetUser")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.alloydb.v1.GetUserRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.alloydb.v1.User.getDefaultInstance())) + .setSchemaDescriptor(new AlloyDBAdminMethodDescriptorSupplier("GetUser")) + .build(); + } + } + } + return getGetUserMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.alloydb.v1.CreateUserRequest, com.google.cloud.alloydb.v1.User> + getCreateUserMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "CreateUser", + requestType = com.google.cloud.alloydb.v1.CreateUserRequest.class, + responseType = com.google.cloud.alloydb.v1.User.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.alloydb.v1.CreateUserRequest, com.google.cloud.alloydb.v1.User> + getCreateUserMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.alloydb.v1.CreateUserRequest, com.google.cloud.alloydb.v1.User> + getCreateUserMethod; + if ((getCreateUserMethod = AlloyDBAdminGrpc.getCreateUserMethod) == null) { + synchronized (AlloyDBAdminGrpc.class) { + if ((getCreateUserMethod = AlloyDBAdminGrpc.getCreateUserMethod) == null) { + AlloyDBAdminGrpc.getCreateUserMethod = + getCreateUserMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "CreateUser")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.alloydb.v1.CreateUserRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.alloydb.v1.User.getDefaultInstance())) + .setSchemaDescriptor(new AlloyDBAdminMethodDescriptorSupplier("CreateUser")) + .build(); + } + } + } + return getCreateUserMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.alloydb.v1.UpdateUserRequest, com.google.cloud.alloydb.v1.User> + getUpdateUserMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "UpdateUser", + requestType = com.google.cloud.alloydb.v1.UpdateUserRequest.class, + responseType = com.google.cloud.alloydb.v1.User.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.alloydb.v1.UpdateUserRequest, com.google.cloud.alloydb.v1.User> + getUpdateUserMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.alloydb.v1.UpdateUserRequest, com.google.cloud.alloydb.v1.User> + getUpdateUserMethod; + if ((getUpdateUserMethod = AlloyDBAdminGrpc.getUpdateUserMethod) == null) { + synchronized (AlloyDBAdminGrpc.class) { + if ((getUpdateUserMethod = AlloyDBAdminGrpc.getUpdateUserMethod) == null) { + AlloyDBAdminGrpc.getUpdateUserMethod = + getUpdateUserMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "UpdateUser")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.alloydb.v1.UpdateUserRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.alloydb.v1.User.getDefaultInstance())) + .setSchemaDescriptor(new AlloyDBAdminMethodDescriptorSupplier("UpdateUser")) + .build(); + } + } + } + return getUpdateUserMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.alloydb.v1.DeleteUserRequest, com.google.protobuf.Empty> + getDeleteUserMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "DeleteUser", + requestType = com.google.cloud.alloydb.v1.DeleteUserRequest.class, + responseType = com.google.protobuf.Empty.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.alloydb.v1.DeleteUserRequest, com.google.protobuf.Empty> + getDeleteUserMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.alloydb.v1.DeleteUserRequest, com.google.protobuf.Empty> + getDeleteUserMethod; + if ((getDeleteUserMethod = AlloyDBAdminGrpc.getDeleteUserMethod) == null) { + synchronized (AlloyDBAdminGrpc.class) { + if ((getDeleteUserMethod = AlloyDBAdminGrpc.getDeleteUserMethod) == null) { + AlloyDBAdminGrpc.getDeleteUserMethod = + getDeleteUserMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "DeleteUser")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.alloydb.v1.DeleteUserRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.protobuf.Empty.getDefaultInstance())) + .setSchemaDescriptor(new AlloyDBAdminMethodDescriptorSupplier("DeleteUser")) + .build(); + } + } + } + return getDeleteUserMethod; + } + /** Creates a new async stub that supports all call types for the service */ public static AlloyDBAdminStub newStub(io.grpc.Channel channel) { io.grpc.stub.AbstractStub.StubFactory factory = @@ -1021,6 +1410,23 @@ default void deleteCluster( getDeleteClusterMethod(), responseObserver); } + /** + * + * + *
+     * Promotes a SECONDARY cluster. This turns down replication
+     * from the PRIMARY cluster and promotes a secondary cluster
+     * into its own standalone cluster.
+     * Imperative only.
+     * 
+ */ + default void promoteCluster( + com.google.cloud.alloydb.v1.PromoteClusterRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getPromoteClusterMethod(), responseObserver); + } + /** * * @@ -1037,6 +1443,21 @@ default void restoreCluster( getRestoreClusterMethod(), responseObserver); } + /** + * + * + *
+     * Creates a cluster of type SECONDARY in the given location using
+     * the primary cluster as the source.
+     * 
+ */ + default void createSecondaryCluster( + com.google.cloud.alloydb.v1.CreateSecondaryClusterRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getCreateSecondaryClusterMethod(), responseObserver); + } + /** * * @@ -1080,6 +1501,20 @@ default void createInstance( getCreateInstanceMethod(), responseObserver); } + /** + * + * + *
+     * Creates a new SECONDARY Instance in a given project and location.
+     * 
+ */ + default void createSecondaryInstance( + com.google.cloud.alloydb.v1.CreateSecondaryInstanceRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getCreateSecondaryInstanceMethod(), responseObserver); + } + /** * * @@ -1147,6 +1582,21 @@ default void failoverInstance( getFailoverInstanceMethod(), responseObserver); } + /** + * + * + *
+     * Injects fault in an instance.
+     * Imperative only.
+     * 
+ */ + default void injectFault( + com.google.cloud.alloydb.v1.InjectFaultRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getInjectFaultMethod(), responseObserver); + } + /** * * @@ -1246,6 +1696,72 @@ default void listSupportedDatabaseFlags( io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( getListSupportedDatabaseFlagsMethod(), responseObserver); } + + /** + * + * + *
+     * Lists Users in a given project and location.
+     * 
+ */ + default void listUsers( + com.google.cloud.alloydb.v1.ListUsersRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getListUsersMethod(), responseObserver); + } + + /** + * + * + *
+     * Gets details of a single User.
+     * 
+ */ + default void getUser( + com.google.cloud.alloydb.v1.GetUserRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getGetUserMethod(), responseObserver); + } + + /** + * + * + *
+     * Creates a new User in a given project, location, and cluster.
+     * 
+ */ + default void createUser( + com.google.cloud.alloydb.v1.CreateUserRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getCreateUserMethod(), responseObserver); + } + + /** + * + * + *
+     * Updates the parameters of a single User.
+     * 
+ */ + default void updateUser( + com.google.cloud.alloydb.v1.UpdateUserRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getUpdateUserMethod(), responseObserver); + } + + /** + * + * + *
+     * Deletes a single User.
+     * 
+ */ + default void deleteUser( + com.google.cloud.alloydb.v1.DeleteUserRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getDeleteUserMethod(), responseObserver); + } } /** @@ -1361,6 +1877,25 @@ public void deleteCluster( responseObserver); } + /** + * + * + *
+     * Promotes a SECONDARY cluster. This turns down replication
+     * from the PRIMARY cluster and promotes a secondary cluster
+     * into its own standalone cluster.
+     * Imperative only.
+     * 
+ */ + public void promoteCluster( + com.google.cloud.alloydb.v1.PromoteClusterRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getPromoteClusterMethod(), getCallOptions()), + request, + responseObserver); + } + /** * * @@ -1379,6 +1914,23 @@ public void restoreCluster( responseObserver); } + /** + * + * + *
+     * Creates a cluster of type SECONDARY in the given location using
+     * the primary cluster as the source.
+     * 
+ */ + public void createSecondaryCluster( + com.google.cloud.alloydb.v1.CreateSecondaryClusterRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getCreateSecondaryClusterMethod(), getCallOptions()), + request, + responseObserver); + } + /** * * @@ -1428,6 +1980,22 @@ public void createInstance( responseObserver); } + /** + * + * + *
+     * Creates a new SECONDARY Instance in a given project and location.
+     * 
+ */ + public void createSecondaryInstance( + com.google.cloud.alloydb.v1.CreateSecondaryInstanceRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getCreateSecondaryInstanceMethod(), getCallOptions()), + request, + responseObserver); + } + /** * * @@ -1503,6 +2071,23 @@ public void failoverInstance( responseObserver); } + /** + * + * + *
+     * Injects fault in an instance.
+     * Imperative only.
+     * 
+ */ + public void injectFault( + com.google.cloud.alloydb.v1.InjectFaultRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getInjectFaultMethod(), getCallOptions()), + request, + responseObserver); + } + /** * * @@ -1527,12 +2112,91 @@ public void restartInstance( * Lists Backups in a given project and location. * */ - public void listBackups( - com.google.cloud.alloydb.v1.ListBackupsRequest request, - io.grpc.stub.StreamObserver + public void listBackups( + com.google.cloud.alloydb.v1.ListBackupsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getListBackupsMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Gets details of a single Backup.
+     * 
+ */ + public void getBackup( + com.google.cloud.alloydb.v1.GetBackupRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getGetBackupMethod(), getCallOptions()), request, responseObserver); + } + + /** + * + * + *
+     * Creates a new Backup in a given project and location.
+     * 
+ */ + public void createBackup( + com.google.cloud.alloydb.v1.CreateBackupRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getCreateBackupMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Updates the parameters of a single Backup.
+     * 
+ */ + public void updateBackup( + com.google.cloud.alloydb.v1.UpdateBackupRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getUpdateBackupMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Deletes a single Backup.
+     * 
+ */ + public void deleteBackup( + com.google.cloud.alloydb.v1.DeleteBackupRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getDeleteBackupMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Lists SupportedDatabaseFlags for a given project and location.
+     * 
+ */ + public void listSupportedDatabaseFlags( + com.google.cloud.alloydb.v1.ListSupportedDatabaseFlagsRequest request, + io.grpc.stub.StreamObserver responseObserver) { io.grpc.stub.ClientCalls.asyncUnaryCall( - getChannel().newCall(getListBackupsMethod(), getCallOptions()), + getChannel().newCall(getListSupportedDatabaseFlagsMethod(), getCallOptions()), request, responseObserver); } @@ -1541,79 +2205,71 @@ public void listBackups( * * *
-     * Gets details of a single Backup.
+     * Lists Users in a given project and location.
      * 
*/ - public void getBackup( - com.google.cloud.alloydb.v1.GetBackupRequest request, - io.grpc.stub.StreamObserver responseObserver) { + public void listUsers( + com.google.cloud.alloydb.v1.ListUsersRequest request, + io.grpc.stub.StreamObserver + responseObserver) { io.grpc.stub.ClientCalls.asyncUnaryCall( - getChannel().newCall(getGetBackupMethod(), getCallOptions()), request, responseObserver); + getChannel().newCall(getListUsersMethod(), getCallOptions()), request, responseObserver); } /** * * *
-     * Creates a new Backup in a given project and location.
+     * Gets details of a single User.
      * 
*/ - public void createBackup( - com.google.cloud.alloydb.v1.CreateBackupRequest request, - io.grpc.stub.StreamObserver responseObserver) { + public void getUser( + com.google.cloud.alloydb.v1.GetUserRequest request, + io.grpc.stub.StreamObserver responseObserver) { io.grpc.stub.ClientCalls.asyncUnaryCall( - getChannel().newCall(getCreateBackupMethod(), getCallOptions()), - request, - responseObserver); + getChannel().newCall(getGetUserMethod(), getCallOptions()), request, responseObserver); } /** * * *
-     * Updates the parameters of a single Backup.
+     * Creates a new User in a given project, location, and cluster.
      * 
*/ - public void updateBackup( - com.google.cloud.alloydb.v1.UpdateBackupRequest request, - io.grpc.stub.StreamObserver responseObserver) { + public void createUser( + com.google.cloud.alloydb.v1.CreateUserRequest request, + io.grpc.stub.StreamObserver responseObserver) { io.grpc.stub.ClientCalls.asyncUnaryCall( - getChannel().newCall(getUpdateBackupMethod(), getCallOptions()), - request, - responseObserver); + getChannel().newCall(getCreateUserMethod(), getCallOptions()), request, responseObserver); } /** * * *
-     * Deletes a single Backup.
+     * Updates the parameters of a single User.
      * 
*/ - public void deleteBackup( - com.google.cloud.alloydb.v1.DeleteBackupRequest request, - io.grpc.stub.StreamObserver responseObserver) { + public void updateUser( + com.google.cloud.alloydb.v1.UpdateUserRequest request, + io.grpc.stub.StreamObserver responseObserver) { io.grpc.stub.ClientCalls.asyncUnaryCall( - getChannel().newCall(getDeleteBackupMethod(), getCallOptions()), - request, - responseObserver); + getChannel().newCall(getUpdateUserMethod(), getCallOptions()), request, responseObserver); } /** * * *
-     * Lists SupportedDatabaseFlags for a given project and location.
+     * Deletes a single User.
      * 
*/ - public void listSupportedDatabaseFlags( - com.google.cloud.alloydb.v1.ListSupportedDatabaseFlagsRequest request, - io.grpc.stub.StreamObserver - responseObserver) { + public void deleteUser( + com.google.cloud.alloydb.v1.DeleteUserRequest request, + io.grpc.stub.StreamObserver responseObserver) { io.grpc.stub.ClientCalls.asyncUnaryCall( - getChannel().newCall(getListSupportedDatabaseFlagsMethod(), getCallOptions()), - request, - responseObserver); + getChannel().newCall(getDeleteUserMethod(), getCallOptions()), request, responseObserver); } } @@ -1701,6 +2357,22 @@ public com.google.longrunning.Operation deleteCluster( getChannel(), getDeleteClusterMethod(), getCallOptions(), 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.
+     * 
+ */ + public com.google.longrunning.Operation promoteCluster( + com.google.cloud.alloydb.v1.PromoteClusterRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getPromoteClusterMethod(), getCallOptions(), request); + } + /** * * @@ -1716,6 +2388,20 @@ public com.google.longrunning.Operation restoreCluster( getChannel(), getRestoreClusterMethod(), getCallOptions(), request); } + /** + * + * + *
+     * Creates a cluster of type SECONDARY in the given location using
+     * the primary cluster as the source.
+     * 
+ */ + public com.google.longrunning.Operation createSecondaryCluster( + com.google.cloud.alloydb.v1.CreateSecondaryClusterRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getCreateSecondaryClusterMethod(), getCallOptions(), request); + } + /** * * @@ -1755,6 +2441,19 @@ public com.google.longrunning.Operation createInstance( getChannel(), getCreateInstanceMethod(), getCallOptions(), request); } + /** + * + * + *
+     * Creates a new SECONDARY Instance in a given project and location.
+     * 
+ */ + public com.google.longrunning.Operation createSecondaryInstance( + com.google.cloud.alloydb.v1.CreateSecondaryInstanceRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getCreateSecondaryInstanceMethod(), getCallOptions(), request); + } + /** * * @@ -1818,6 +2517,20 @@ public com.google.longrunning.Operation failoverInstance( getChannel(), getFailoverInstanceMethod(), getCallOptions(), request); } + /** + * + * + *
+     * Injects fault in an instance.
+     * Imperative only.
+     * 
+ */ + public com.google.longrunning.Operation injectFault( + com.google.cloud.alloydb.v1.InjectFaultRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getInjectFaultMethod(), getCallOptions(), request); + } + /** * * @@ -1910,6 +2623,71 @@ public com.google.longrunning.Operation deleteBackup( return io.grpc.stub.ClientCalls.blockingUnaryCall( getChannel(), getListSupportedDatabaseFlagsMethod(), getCallOptions(), request); } + + /** + * + * + *
+     * Lists Users in a given project and location.
+     * 
+ */ + public com.google.cloud.alloydb.v1.ListUsersResponse listUsers( + com.google.cloud.alloydb.v1.ListUsersRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getListUsersMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Gets details of a single User.
+     * 
+ */ + public com.google.cloud.alloydb.v1.User getUser( + com.google.cloud.alloydb.v1.GetUserRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGetUserMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Creates a new User in a given project, location, and cluster.
+     * 
+ */ + public com.google.cloud.alloydb.v1.User createUser( + com.google.cloud.alloydb.v1.CreateUserRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getCreateUserMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Updates the parameters of a single User.
+     * 
+ */ + public com.google.cloud.alloydb.v1.User updateUser( + com.google.cloud.alloydb.v1.UpdateUserRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getUpdateUserMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Deletes a single User.
+     * 
+ */ + public com.google.protobuf.Empty deleteUser( + com.google.cloud.alloydb.v1.DeleteUserRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getDeleteUserMethod(), getCallOptions(), request); + } } /** @@ -1997,6 +2775,22 @@ protected AlloyDBAdminFutureStub build( getChannel().newCall(getDeleteClusterMethod(), getCallOptions()), 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.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + promoteCluster(com.google.cloud.alloydb.v1.PromoteClusterRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getPromoteClusterMethod(), getCallOptions()), request); + } + /** * * @@ -2012,6 +2806,20 @@ protected AlloyDBAdminFutureStub build( getChannel().newCall(getRestoreClusterMethod(), getCallOptions()), request); } + /** + * + * + *
+     * Creates a cluster of type SECONDARY in the given location using
+     * the primary cluster as the source.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + createSecondaryCluster(com.google.cloud.alloydb.v1.CreateSecondaryClusterRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getCreateSecondaryClusterMethod(), getCallOptions()), request); + } + /** * * @@ -2052,6 +2860,20 @@ protected AlloyDBAdminFutureStub build( getChannel().newCall(getCreateInstanceMethod(), getCallOptions()), request); } + /** + * + * + *
+     * Creates a new SECONDARY Instance in a given project and location.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + createSecondaryInstance( + com.google.cloud.alloydb.v1.CreateSecondaryInstanceRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getCreateSecondaryInstanceMethod(), getCallOptions()), request); + } + /** * * @@ -2115,6 +2937,20 @@ protected AlloyDBAdminFutureStub build( getChannel().newCall(getFailoverInstanceMethod(), getCallOptions()), request); } + /** + * + * + *
+     * Injects fault in an instance.
+     * Imperative only.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + injectFault(com.google.cloud.alloydb.v1.InjectFaultRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getInjectFaultMethod(), getCallOptions()), request); + } + /** * * @@ -2209,6 +3045,72 @@ protected AlloyDBAdminFutureStub build( return io.grpc.stub.ClientCalls.futureUnaryCall( getChannel().newCall(getListSupportedDatabaseFlagsMethod(), getCallOptions()), request); } + + /** + * + * + *
+     * Lists Users in a given project and location.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.alloydb.v1.ListUsersResponse> + listUsers(com.google.cloud.alloydb.v1.ListUsersRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getListUsersMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Gets details of a single User.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + getUser(com.google.cloud.alloydb.v1.GetUserRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getGetUserMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Creates a new User in a given project, location, and cluster.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + createUser(com.google.cloud.alloydb.v1.CreateUserRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getCreateUserMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Updates the parameters of a single User.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + updateUser(com.google.cloud.alloydb.v1.UpdateUserRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getUpdateUserMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Deletes a single User.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture deleteUser( + com.google.cloud.alloydb.v1.DeleteUserRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getDeleteUserMethod(), getCallOptions()), request); + } } private static final int METHODID_LIST_CLUSTERS = 0; @@ -2216,21 +3118,30 @@ protected AlloyDBAdminFutureStub build( private static final int METHODID_CREATE_CLUSTER = 2; private static final int METHODID_UPDATE_CLUSTER = 3; private static final int METHODID_DELETE_CLUSTER = 4; - private static final int METHODID_RESTORE_CLUSTER = 5; - private static final int METHODID_LIST_INSTANCES = 6; - private static final int METHODID_GET_INSTANCE = 7; - private static final int METHODID_CREATE_INSTANCE = 8; - private static final int METHODID_BATCH_CREATE_INSTANCES = 9; - private static final int METHODID_UPDATE_INSTANCE = 10; - private static final int METHODID_DELETE_INSTANCE = 11; - private static final int METHODID_FAILOVER_INSTANCE = 12; - private static final int METHODID_RESTART_INSTANCE = 13; - private static final int METHODID_LIST_BACKUPS = 14; - private static final int METHODID_GET_BACKUP = 15; - private static final int METHODID_CREATE_BACKUP = 16; - private static final int METHODID_UPDATE_BACKUP = 17; - private static final int METHODID_DELETE_BACKUP = 18; - private static final int METHODID_LIST_SUPPORTED_DATABASE_FLAGS = 19; + private static final int METHODID_PROMOTE_CLUSTER = 5; + private static final int METHODID_RESTORE_CLUSTER = 6; + private static final int METHODID_CREATE_SECONDARY_CLUSTER = 7; + private static final int METHODID_LIST_INSTANCES = 8; + private static final int METHODID_GET_INSTANCE = 9; + private static final int METHODID_CREATE_INSTANCE = 10; + private static final int METHODID_CREATE_SECONDARY_INSTANCE = 11; + private static final int METHODID_BATCH_CREATE_INSTANCES = 12; + private static final int METHODID_UPDATE_INSTANCE = 13; + private static final int METHODID_DELETE_INSTANCE = 14; + private static final int METHODID_FAILOVER_INSTANCE = 15; + private static final int METHODID_INJECT_FAULT = 16; + private static final int METHODID_RESTART_INSTANCE = 17; + private static final int METHODID_LIST_BACKUPS = 18; + private static final int METHODID_GET_BACKUP = 19; + private static final int METHODID_CREATE_BACKUP = 20; + private static final int METHODID_UPDATE_BACKUP = 21; + private static final int METHODID_DELETE_BACKUP = 22; + private static final int METHODID_LIST_SUPPORTED_DATABASE_FLAGS = 23; + private static final int METHODID_LIST_USERS = 24; + private static final int METHODID_GET_USER = 25; + private static final int METHODID_CREATE_USER = 26; + private static final int METHODID_UPDATE_USER = 27; + private static final int METHODID_DELETE_USER = 28; private static final class MethodHandlers implements io.grpc.stub.ServerCalls.UnaryMethod, @@ -2275,11 +3186,21 @@ public void invoke(Req request, io.grpc.stub.StreamObserver responseObserv (com.google.cloud.alloydb.v1.DeleteClusterRequest) request, (io.grpc.stub.StreamObserver) responseObserver); break; + case METHODID_PROMOTE_CLUSTER: + serviceImpl.promoteCluster( + (com.google.cloud.alloydb.v1.PromoteClusterRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; case METHODID_RESTORE_CLUSTER: serviceImpl.restoreCluster( (com.google.cloud.alloydb.v1.RestoreClusterRequest) request, (io.grpc.stub.StreamObserver) responseObserver); break; + case METHODID_CREATE_SECONDARY_CLUSTER: + serviceImpl.createSecondaryCluster( + (com.google.cloud.alloydb.v1.CreateSecondaryClusterRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; case METHODID_LIST_INSTANCES: serviceImpl.listInstances( (com.google.cloud.alloydb.v1.ListInstancesRequest) request, @@ -2296,6 +3217,11 @@ public void invoke(Req request, io.grpc.stub.StreamObserver responseObserv (com.google.cloud.alloydb.v1.CreateInstanceRequest) request, (io.grpc.stub.StreamObserver) responseObserver); break; + case METHODID_CREATE_SECONDARY_INSTANCE: + serviceImpl.createSecondaryInstance( + (com.google.cloud.alloydb.v1.CreateSecondaryInstanceRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; case METHODID_BATCH_CREATE_INSTANCES: serviceImpl.batchCreateInstances( (com.google.cloud.alloydb.v1.BatchCreateInstancesRequest) request, @@ -2316,6 +3242,11 @@ public void invoke(Req request, io.grpc.stub.StreamObserver responseObserv (com.google.cloud.alloydb.v1.FailoverInstanceRequest) request, (io.grpc.stub.StreamObserver) responseObserver); break; + case METHODID_INJECT_FAULT: + serviceImpl.injectFault( + (com.google.cloud.alloydb.v1.InjectFaultRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; case METHODID_RESTART_INSTANCE: serviceImpl.restartInstance( (com.google.cloud.alloydb.v1.RestartInstanceRequest) request, @@ -2354,6 +3285,32 @@ public void invoke(Req request, io.grpc.stub.StreamObserver responseObserv com.google.cloud.alloydb.v1.ListSupportedDatabaseFlagsResponse>) responseObserver); break; + case METHODID_LIST_USERS: + serviceImpl.listUsers( + (com.google.cloud.alloydb.v1.ListUsersRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_GET_USER: + serviceImpl.getUser( + (com.google.cloud.alloydb.v1.GetUserRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_CREATE_USER: + serviceImpl.createUser( + (com.google.cloud.alloydb.v1.CreateUserRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_UPDATE_USER: + serviceImpl.updateUser( + (com.google.cloud.alloydb.v1.UpdateUserRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_DELETE_USER: + serviceImpl.deleteUser( + (com.google.cloud.alloydb.v1.DeleteUserRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; default: throw new AssertionError(); } @@ -2403,12 +3360,24 @@ public static final io.grpc.ServerServiceDefinition bindService(AsyncService ser new MethodHandlers< com.google.cloud.alloydb.v1.DeleteClusterRequest, com.google.longrunning.Operation>(service, METHODID_DELETE_CLUSTER))) + .addMethod( + getPromoteClusterMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.alloydb.v1.PromoteClusterRequest, + com.google.longrunning.Operation>(service, METHODID_PROMOTE_CLUSTER))) .addMethod( getRestoreClusterMethod(), io.grpc.stub.ServerCalls.asyncUnaryCall( new MethodHandlers< com.google.cloud.alloydb.v1.RestoreClusterRequest, com.google.longrunning.Operation>(service, METHODID_RESTORE_CLUSTER))) + .addMethod( + getCreateSecondaryClusterMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.alloydb.v1.CreateSecondaryClusterRequest, + com.google.longrunning.Operation>(service, METHODID_CREATE_SECONDARY_CLUSTER))) .addMethod( getListInstancesMethod(), io.grpc.stub.ServerCalls.asyncUnaryCall( @@ -2428,6 +3397,12 @@ public static final io.grpc.ServerServiceDefinition bindService(AsyncService ser new MethodHandlers< com.google.cloud.alloydb.v1.CreateInstanceRequest, com.google.longrunning.Operation>(service, METHODID_CREATE_INSTANCE))) + .addMethod( + getCreateSecondaryInstanceMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.alloydb.v1.CreateSecondaryInstanceRequest, + com.google.longrunning.Operation>(service, METHODID_CREATE_SECONDARY_INSTANCE))) .addMethod( getBatchCreateInstancesMethod(), io.grpc.stub.ServerCalls.asyncUnaryCall( @@ -2452,6 +3427,12 @@ public static final io.grpc.ServerServiceDefinition bindService(AsyncService ser new MethodHandlers< com.google.cloud.alloydb.v1.FailoverInstanceRequest, com.google.longrunning.Operation>(service, METHODID_FAILOVER_INSTANCE))) + .addMethod( + getInjectFaultMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.alloydb.v1.InjectFaultRequest, + com.google.longrunning.Operation>(service, METHODID_INJECT_FAULT))) .addMethod( getRestartInstanceMethod(), io.grpc.stub.ServerCalls.asyncUnaryCall( @@ -2496,6 +3477,36 @@ public static final io.grpc.ServerServiceDefinition bindService(AsyncService ser com.google.cloud.alloydb.v1.ListSupportedDatabaseFlagsRequest, com.google.cloud.alloydb.v1.ListSupportedDatabaseFlagsResponse>( service, METHODID_LIST_SUPPORTED_DATABASE_FLAGS))) + .addMethod( + getListUsersMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.alloydb.v1.ListUsersRequest, + com.google.cloud.alloydb.v1.ListUsersResponse>(service, METHODID_LIST_USERS))) + .addMethod( + getGetUserMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.alloydb.v1.GetUserRequest, com.google.cloud.alloydb.v1.User>( + service, METHODID_GET_USER))) + .addMethod( + getCreateUserMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.alloydb.v1.CreateUserRequest, + com.google.cloud.alloydb.v1.User>(service, METHODID_CREATE_USER))) + .addMethod( + getUpdateUserMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.alloydb.v1.UpdateUserRequest, + com.google.cloud.alloydb.v1.User>(service, METHODID_UPDATE_USER))) + .addMethod( + getDeleteUserMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.alloydb.v1.DeleteUserRequest, com.google.protobuf.Empty>( + service, METHODID_DELETE_USER))) .build(); } @@ -2552,14 +3563,18 @@ public static io.grpc.ServiceDescriptor getServiceDescriptor() { .addMethod(getCreateClusterMethod()) .addMethod(getUpdateClusterMethod()) .addMethod(getDeleteClusterMethod()) + .addMethod(getPromoteClusterMethod()) .addMethod(getRestoreClusterMethod()) + .addMethod(getCreateSecondaryClusterMethod()) .addMethod(getListInstancesMethod()) .addMethod(getGetInstanceMethod()) .addMethod(getCreateInstanceMethod()) + .addMethod(getCreateSecondaryInstanceMethod()) .addMethod(getBatchCreateInstancesMethod()) .addMethod(getUpdateInstanceMethod()) .addMethod(getDeleteInstanceMethod()) .addMethod(getFailoverInstanceMethod()) + .addMethod(getInjectFaultMethod()) .addMethod(getRestartInstanceMethod()) .addMethod(getListBackupsMethod()) .addMethod(getGetBackupMethod()) @@ -2567,6 +3582,11 @@ public static io.grpc.ServiceDescriptor getServiceDescriptor() { .addMethod(getUpdateBackupMethod()) .addMethod(getDeleteBackupMethod()) .addMethod(getListSupportedDatabaseFlagsMethod()) + .addMethod(getListUsersMethod()) + .addMethod(getGetUserMethod()) + .addMethod(getCreateUserMethod()) + .addMethod(getUpdateUserMethod()) + .addMethod(getDeleteUserMethod()) .build(); } } diff --git a/java-alloydb/grpc-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/AlloyDBAdminGrpc.java b/java-alloydb/grpc-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/AlloyDBAdminGrpc.java index 32de2b5d3f9e..89e26e31ce04 100644 --- a/java-alloydb/grpc-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/AlloyDBAdminGrpc.java +++ b/java-alloydb/grpc-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/AlloyDBAdminGrpc.java @@ -759,6 +759,48 @@ private AlloyDBAdminGrpc() {} return getFailoverInstanceMethod; } + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.alloydb.v1alpha.InjectFaultRequest, com.google.longrunning.Operation> + getInjectFaultMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "InjectFault", + requestType = com.google.cloud.alloydb.v1alpha.InjectFaultRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.alloydb.v1alpha.InjectFaultRequest, com.google.longrunning.Operation> + getInjectFaultMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.alloydb.v1alpha.InjectFaultRequest, com.google.longrunning.Operation> + getInjectFaultMethod; + if ((getInjectFaultMethod = AlloyDBAdminGrpc.getInjectFaultMethod) == null) { + synchronized (AlloyDBAdminGrpc.class) { + if ((getInjectFaultMethod = AlloyDBAdminGrpc.getInjectFaultMethod) == null) { + AlloyDBAdminGrpc.getInjectFaultMethod = + getInjectFaultMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "InjectFault")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.alloydb.v1alpha.InjectFaultRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor(new AlloyDBAdminMethodDescriptorSupplier("InjectFault")) + .build(); + } + } + } + return getInjectFaultMethod; + } + private static volatile io.grpc.MethodDescriptor< com.google.cloud.alloydb.v1alpha.RestartInstanceRequest, com.google.longrunning.Operation> getRestartInstanceMethod; @@ -1168,6 +1210,221 @@ private AlloyDBAdminGrpc() {} return getGetConnectionInfoMethod; } + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.alloydb.v1alpha.ListUsersRequest, + com.google.cloud.alloydb.v1alpha.ListUsersResponse> + getListUsersMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ListUsers", + requestType = com.google.cloud.alloydb.v1alpha.ListUsersRequest.class, + responseType = com.google.cloud.alloydb.v1alpha.ListUsersResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.alloydb.v1alpha.ListUsersRequest, + com.google.cloud.alloydb.v1alpha.ListUsersResponse> + getListUsersMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.alloydb.v1alpha.ListUsersRequest, + com.google.cloud.alloydb.v1alpha.ListUsersResponse> + getListUsersMethod; + if ((getListUsersMethod = AlloyDBAdminGrpc.getListUsersMethod) == null) { + synchronized (AlloyDBAdminGrpc.class) { + if ((getListUsersMethod = AlloyDBAdminGrpc.getListUsersMethod) == null) { + AlloyDBAdminGrpc.getListUsersMethod = + getListUsersMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ListUsers")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.alloydb.v1alpha.ListUsersRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.alloydb.v1alpha.ListUsersResponse + .getDefaultInstance())) + .setSchemaDescriptor(new AlloyDBAdminMethodDescriptorSupplier("ListUsers")) + .build(); + } + } + } + return getListUsersMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.alloydb.v1alpha.GetUserRequest, com.google.cloud.alloydb.v1alpha.User> + getGetUserMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetUser", + requestType = com.google.cloud.alloydb.v1alpha.GetUserRequest.class, + responseType = com.google.cloud.alloydb.v1alpha.User.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.alloydb.v1alpha.GetUserRequest, com.google.cloud.alloydb.v1alpha.User> + getGetUserMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.alloydb.v1alpha.GetUserRequest, com.google.cloud.alloydb.v1alpha.User> + getGetUserMethod; + if ((getGetUserMethod = AlloyDBAdminGrpc.getGetUserMethod) == null) { + synchronized (AlloyDBAdminGrpc.class) { + if ((getGetUserMethod = AlloyDBAdminGrpc.getGetUserMethod) == null) { + AlloyDBAdminGrpc.getGetUserMethod = + getGetUserMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetUser")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.alloydb.v1alpha.GetUserRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.alloydb.v1alpha.User.getDefaultInstance())) + .setSchemaDescriptor(new AlloyDBAdminMethodDescriptorSupplier("GetUser")) + .build(); + } + } + } + return getGetUserMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.alloydb.v1alpha.CreateUserRequest, com.google.cloud.alloydb.v1alpha.User> + getCreateUserMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "CreateUser", + requestType = com.google.cloud.alloydb.v1alpha.CreateUserRequest.class, + responseType = com.google.cloud.alloydb.v1alpha.User.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.alloydb.v1alpha.CreateUserRequest, com.google.cloud.alloydb.v1alpha.User> + getCreateUserMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.alloydb.v1alpha.CreateUserRequest, + com.google.cloud.alloydb.v1alpha.User> + getCreateUserMethod; + if ((getCreateUserMethod = AlloyDBAdminGrpc.getCreateUserMethod) == null) { + synchronized (AlloyDBAdminGrpc.class) { + if ((getCreateUserMethod = AlloyDBAdminGrpc.getCreateUserMethod) == null) { + AlloyDBAdminGrpc.getCreateUserMethod = + getCreateUserMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "CreateUser")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.alloydb.v1alpha.CreateUserRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.alloydb.v1alpha.User.getDefaultInstance())) + .setSchemaDescriptor(new AlloyDBAdminMethodDescriptorSupplier("CreateUser")) + .build(); + } + } + } + return getCreateUserMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.alloydb.v1alpha.UpdateUserRequest, com.google.cloud.alloydb.v1alpha.User> + getUpdateUserMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "UpdateUser", + requestType = com.google.cloud.alloydb.v1alpha.UpdateUserRequest.class, + responseType = com.google.cloud.alloydb.v1alpha.User.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.alloydb.v1alpha.UpdateUserRequest, com.google.cloud.alloydb.v1alpha.User> + getUpdateUserMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.alloydb.v1alpha.UpdateUserRequest, + com.google.cloud.alloydb.v1alpha.User> + getUpdateUserMethod; + if ((getUpdateUserMethod = AlloyDBAdminGrpc.getUpdateUserMethod) == null) { + synchronized (AlloyDBAdminGrpc.class) { + if ((getUpdateUserMethod = AlloyDBAdminGrpc.getUpdateUserMethod) == null) { + AlloyDBAdminGrpc.getUpdateUserMethod = + getUpdateUserMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "UpdateUser")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.alloydb.v1alpha.UpdateUserRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.alloydb.v1alpha.User.getDefaultInstance())) + .setSchemaDescriptor(new AlloyDBAdminMethodDescriptorSupplier("UpdateUser")) + .build(); + } + } + } + return getUpdateUserMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.alloydb.v1alpha.DeleteUserRequest, com.google.protobuf.Empty> + getDeleteUserMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "DeleteUser", + requestType = com.google.cloud.alloydb.v1alpha.DeleteUserRequest.class, + responseType = com.google.protobuf.Empty.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.alloydb.v1alpha.DeleteUserRequest, com.google.protobuf.Empty> + getDeleteUserMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.alloydb.v1alpha.DeleteUserRequest, com.google.protobuf.Empty> + getDeleteUserMethod; + if ((getDeleteUserMethod = AlloyDBAdminGrpc.getDeleteUserMethod) == null) { + synchronized (AlloyDBAdminGrpc.class) { + if ((getDeleteUserMethod = AlloyDBAdminGrpc.getDeleteUserMethod) == null) { + AlloyDBAdminGrpc.getDeleteUserMethod = + getDeleteUserMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "DeleteUser")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.alloydb.v1alpha.DeleteUserRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.protobuf.Empty.getDefaultInstance())) + .setSchemaDescriptor(new AlloyDBAdminMethodDescriptorSupplier("DeleteUser")) + .build(); + } + } + } + return getDeleteUserMethod; + } + /** Creates a new async stub that supports all call types for the service */ public static AlloyDBAdminStub newStub(io.grpc.Channel channel) { io.grpc.stub.AbstractStub.StubFactory factory = @@ -1460,6 +1717,21 @@ default void failoverInstance( getFailoverInstanceMethod(), responseObserver); } + /** + * + * + *
+     * Injects fault in an instance.
+     * Imperative only.
+     * 
+ */ + default void injectFault( + com.google.cloud.alloydb.v1alpha.InjectFaultRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getInjectFaultMethod(), responseObserver); + } + /** * * @@ -1595,6 +1867,72 @@ default void getConnectionInfo( io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( getGetConnectionInfoMethod(), responseObserver); } + + /** + * + * + *
+     * Lists Users in a given project and location.
+     * 
+ */ + default void listUsers( + com.google.cloud.alloydb.v1alpha.ListUsersRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getListUsersMethod(), responseObserver); + } + + /** + * + * + *
+     * Gets details of a single User.
+     * 
+ */ + default void getUser( + com.google.cloud.alloydb.v1alpha.GetUserRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getGetUserMethod(), responseObserver); + } + + /** + * + * + *
+     * Creates a new User in a given project, location, and cluster.
+     * 
+ */ + default void createUser( + com.google.cloud.alloydb.v1alpha.CreateUserRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getCreateUserMethod(), responseObserver); + } + + /** + * + * + *
+     * Updates the parameters of a single User.
+     * 
+ */ + default void updateUser( + com.google.cloud.alloydb.v1alpha.UpdateUserRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getUpdateUserMethod(), responseObserver); + } + + /** + * + * + *
+     * Deletes a single User.
+     * 
+ */ + default void deleteUser( + com.google.cloud.alloydb.v1alpha.DeleteUserRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getDeleteUserMethod(), responseObserver); + } } /** @@ -1904,6 +2242,23 @@ public void failoverInstance( responseObserver); } + /** + * + * + *
+     * Injects fault in an instance.
+     * Imperative only.
+     * 
+ */ + public void injectFault( + com.google.cloud.alloydb.v1alpha.InjectFaultRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getInjectFaultMethod(), getCallOptions()), + request, + responseObserver); + } + /** * * @@ -2056,6 +2411,77 @@ public void getConnectionInfo( request, responseObserver); } + + /** + * + * + *
+     * Lists Users in a given project and location.
+     * 
+ */ + public void listUsers( + com.google.cloud.alloydb.v1alpha.ListUsersRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getListUsersMethod(), getCallOptions()), request, responseObserver); + } + + /** + * + * + *
+     * Gets details of a single User.
+     * 
+ */ + public void getUser( + com.google.cloud.alloydb.v1alpha.GetUserRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getGetUserMethod(), getCallOptions()), request, responseObserver); + } + + /** + * + * + *
+     * Creates a new User in a given project, location, and cluster.
+     * 
+ */ + public void createUser( + com.google.cloud.alloydb.v1alpha.CreateUserRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getCreateUserMethod(), getCallOptions()), request, responseObserver); + } + + /** + * + * + *
+     * Updates the parameters of a single User.
+     * 
+ */ + public void updateUser( + com.google.cloud.alloydb.v1alpha.UpdateUserRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getUpdateUserMethod(), getCallOptions()), request, responseObserver); + } + + /** + * + * + *
+     * Deletes a single User.
+     * 
+ */ + public void deleteUser( + com.google.cloud.alloydb.v1alpha.DeleteUserRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getDeleteUserMethod(), getCallOptions()), request, responseObserver); + } } /** @@ -2302,6 +2728,20 @@ public com.google.longrunning.Operation failoverInstance( getChannel(), getFailoverInstanceMethod(), getCallOptions(), request); } + /** + * + * + *
+     * Injects fault in an instance.
+     * Imperative only.
+     * 
+ */ + public com.google.longrunning.Operation injectFault( + com.google.cloud.alloydb.v1alpha.InjectFaultRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getInjectFaultMethod(), getCallOptions(), request); + } + /** * * @@ -2425,6 +2865,71 @@ public com.google.cloud.alloydb.v1alpha.ConnectionInfo getConnectionInfo( return io.grpc.stub.ClientCalls.blockingUnaryCall( getChannel(), getGetConnectionInfoMethod(), getCallOptions(), request); } + + /** + * + * + *
+     * Lists Users in a given project and location.
+     * 
+ */ + public com.google.cloud.alloydb.v1alpha.ListUsersResponse listUsers( + com.google.cloud.alloydb.v1alpha.ListUsersRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getListUsersMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Gets details of a single User.
+     * 
+ */ + public com.google.cloud.alloydb.v1alpha.User getUser( + com.google.cloud.alloydb.v1alpha.GetUserRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGetUserMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Creates a new User in a given project, location, and cluster.
+     * 
+ */ + public com.google.cloud.alloydb.v1alpha.User createUser( + com.google.cloud.alloydb.v1alpha.CreateUserRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getCreateUserMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Updates the parameters of a single User.
+     * 
+ */ + public com.google.cloud.alloydb.v1alpha.User updateUser( + com.google.cloud.alloydb.v1alpha.UpdateUserRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getUpdateUserMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Deletes a single User.
+     * 
+ */ + public com.google.protobuf.Empty deleteUser( + com.google.cloud.alloydb.v1alpha.DeleteUserRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getDeleteUserMethod(), getCallOptions(), request); + } } /** @@ -2677,6 +3182,20 @@ protected AlloyDBAdminFutureStub build( getChannel().newCall(getFailoverInstanceMethod(), getCallOptions()), request); } + /** + * + * + *
+     * Injects fault in an instance.
+     * Imperative only.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + injectFault(com.google.cloud.alloydb.v1alpha.InjectFaultRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getInjectFaultMethod(), getCallOptions()), request); + } + /** * * @@ -2805,6 +3324,72 @@ protected AlloyDBAdminFutureStub build( return io.grpc.stub.ClientCalls.futureUnaryCall( getChannel().newCall(getGetConnectionInfoMethod(), getCallOptions()), request); } + + /** + * + * + *
+     * Lists Users in a given project and location.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.alloydb.v1alpha.ListUsersResponse> + listUsers(com.google.cloud.alloydb.v1alpha.ListUsersRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getListUsersMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Gets details of a single User.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + getUser(com.google.cloud.alloydb.v1alpha.GetUserRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getGetUserMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Creates a new User in a given project, location, and cluster.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + createUser(com.google.cloud.alloydb.v1alpha.CreateUserRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getCreateUserMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Updates the parameters of a single User.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + updateUser(com.google.cloud.alloydb.v1alpha.UpdateUserRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getUpdateUserMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Deletes a single User.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture deleteUser( + com.google.cloud.alloydb.v1alpha.DeleteUserRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getDeleteUserMethod(), getCallOptions()), request); + } } private static final int METHODID_LIST_CLUSTERS = 0; @@ -2823,15 +3408,21 @@ protected AlloyDBAdminFutureStub build( private static final int METHODID_UPDATE_INSTANCE = 13; private static final int METHODID_DELETE_INSTANCE = 14; private static final int METHODID_FAILOVER_INSTANCE = 15; - private static final int METHODID_RESTART_INSTANCE = 16; - private static final int METHODID_LIST_BACKUPS = 17; - private static final int METHODID_GET_BACKUP = 18; - private static final int METHODID_CREATE_BACKUP = 19; - private static final int METHODID_UPDATE_BACKUP = 20; - private static final int METHODID_DELETE_BACKUP = 21; - private static final int METHODID_LIST_SUPPORTED_DATABASE_FLAGS = 22; - private static final int METHODID_GENERATE_CLIENT_CERTIFICATE = 23; - private static final int METHODID_GET_CONNECTION_INFO = 24; + private static final int METHODID_INJECT_FAULT = 16; + private static final int METHODID_RESTART_INSTANCE = 17; + private static final int METHODID_LIST_BACKUPS = 18; + private static final int METHODID_GET_BACKUP = 19; + private static final int METHODID_CREATE_BACKUP = 20; + private static final int METHODID_UPDATE_BACKUP = 21; + private static final int METHODID_DELETE_BACKUP = 22; + private static final int METHODID_LIST_SUPPORTED_DATABASE_FLAGS = 23; + private static final int METHODID_GENERATE_CLIENT_CERTIFICATE = 24; + private static final int METHODID_GET_CONNECTION_INFO = 25; + private static final int METHODID_LIST_USERS = 26; + private static final int METHODID_GET_USER = 27; + private static final int METHODID_CREATE_USER = 28; + private static final int METHODID_UPDATE_USER = 29; + private static final int METHODID_DELETE_USER = 30; private static final class MethodHandlers implements io.grpc.stub.ServerCalls.UnaryMethod, @@ -2934,6 +3525,11 @@ public void invoke(Req request, io.grpc.stub.StreamObserver responseObserv (com.google.cloud.alloydb.v1alpha.FailoverInstanceRequest) request, (io.grpc.stub.StreamObserver) responseObserver); break; + case METHODID_INJECT_FAULT: + serviceImpl.injectFault( + (com.google.cloud.alloydb.v1alpha.InjectFaultRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; case METHODID_RESTART_INSTANCE: serviceImpl.restartInstance( (com.google.cloud.alloydb.v1alpha.RestartInstanceRequest) request, @@ -2986,6 +3582,35 @@ public void invoke(Req request, io.grpc.stub.StreamObserver responseObserv (io.grpc.stub.StreamObserver) responseObserver); break; + case METHODID_LIST_USERS: + serviceImpl.listUsers( + (com.google.cloud.alloydb.v1alpha.ListUsersRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_GET_USER: + serviceImpl.getUser( + (com.google.cloud.alloydb.v1alpha.GetUserRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_CREATE_USER: + serviceImpl.createUser( + (com.google.cloud.alloydb.v1alpha.CreateUserRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_UPDATE_USER: + serviceImpl.updateUser( + (com.google.cloud.alloydb.v1alpha.UpdateUserRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_DELETE_USER: + serviceImpl.deleteUser( + (com.google.cloud.alloydb.v1alpha.DeleteUserRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; default: throw new AssertionError(); } @@ -3102,6 +3727,12 @@ public static final io.grpc.ServerServiceDefinition bindService(AsyncService ser new MethodHandlers< com.google.cloud.alloydb.v1alpha.FailoverInstanceRequest, com.google.longrunning.Operation>(service, METHODID_FAILOVER_INSTANCE))) + .addMethod( + getInjectFaultMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.alloydb.v1alpha.InjectFaultRequest, + com.google.longrunning.Operation>(service, METHODID_INJECT_FAULT))) .addMethod( getRestartInstanceMethod(), io.grpc.stub.ServerCalls.asyncUnaryCall( @@ -3160,6 +3791,37 @@ public static final io.grpc.ServerServiceDefinition bindService(AsyncService ser com.google.cloud.alloydb.v1alpha.GetConnectionInfoRequest, com.google.cloud.alloydb.v1alpha.ConnectionInfo>( service, METHODID_GET_CONNECTION_INFO))) + .addMethod( + getListUsersMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.alloydb.v1alpha.ListUsersRequest, + com.google.cloud.alloydb.v1alpha.ListUsersResponse>( + service, METHODID_LIST_USERS))) + .addMethod( + getGetUserMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.alloydb.v1alpha.GetUserRequest, + com.google.cloud.alloydb.v1alpha.User>(service, METHODID_GET_USER))) + .addMethod( + getCreateUserMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.alloydb.v1alpha.CreateUserRequest, + com.google.cloud.alloydb.v1alpha.User>(service, METHODID_CREATE_USER))) + .addMethod( + getUpdateUserMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.alloydb.v1alpha.UpdateUserRequest, + com.google.cloud.alloydb.v1alpha.User>(service, METHODID_UPDATE_USER))) + .addMethod( + getDeleteUserMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.alloydb.v1alpha.DeleteUserRequest, com.google.protobuf.Empty>( + service, METHODID_DELETE_USER))) .build(); } @@ -3227,6 +3889,7 @@ public static io.grpc.ServiceDescriptor getServiceDescriptor() { .addMethod(getUpdateInstanceMethod()) .addMethod(getDeleteInstanceMethod()) .addMethod(getFailoverInstanceMethod()) + .addMethod(getInjectFaultMethod()) .addMethod(getRestartInstanceMethod()) .addMethod(getListBackupsMethod()) .addMethod(getGetBackupMethod()) @@ -3236,6 +3899,11 @@ public static io.grpc.ServiceDescriptor getServiceDescriptor() { .addMethod(getListSupportedDatabaseFlagsMethod()) .addMethod(getGenerateClientCertificateMethod()) .addMethod(getGetConnectionInfoMethod()) + .addMethod(getListUsersMethod()) + .addMethod(getGetUserMethod()) + .addMethod(getCreateUserMethod()) + .addMethod(getUpdateUserMethod()) + .addMethod(getDeleteUserMethod()) .build(); } } diff --git a/java-alloydb/grpc-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/AlloyDBAdminGrpc.java b/java-alloydb/grpc-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/AlloyDBAdminGrpc.java index bed8479c7634..d5a1b494cf17 100644 --- a/java-alloydb/grpc-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/AlloyDBAdminGrpc.java +++ b/java-alloydb/grpc-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/AlloyDBAdminGrpc.java @@ -752,6 +752,48 @@ private AlloyDBAdminGrpc() {} return getFailoverInstanceMethod; } + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.alloydb.v1beta.InjectFaultRequest, com.google.longrunning.Operation> + getInjectFaultMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "InjectFault", + requestType = com.google.cloud.alloydb.v1beta.InjectFaultRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.alloydb.v1beta.InjectFaultRequest, com.google.longrunning.Operation> + getInjectFaultMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.alloydb.v1beta.InjectFaultRequest, com.google.longrunning.Operation> + getInjectFaultMethod; + if ((getInjectFaultMethod = AlloyDBAdminGrpc.getInjectFaultMethod) == null) { + synchronized (AlloyDBAdminGrpc.class) { + if ((getInjectFaultMethod = AlloyDBAdminGrpc.getInjectFaultMethod) == null) { + AlloyDBAdminGrpc.getInjectFaultMethod = + getInjectFaultMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "InjectFault")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.alloydb.v1beta.InjectFaultRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor(new AlloyDBAdminMethodDescriptorSupplier("InjectFault")) + .build(); + } + } + } + return getInjectFaultMethod; + } + private static volatile io.grpc.MethodDescriptor< com.google.cloud.alloydb.v1beta.RestartInstanceRequest, com.google.longrunning.Operation> getRestartInstanceMethod; @@ -1159,6 +1201,219 @@ private AlloyDBAdminGrpc() {} return getGetConnectionInfoMethod; } + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.alloydb.v1beta.ListUsersRequest, + com.google.cloud.alloydb.v1beta.ListUsersResponse> + getListUsersMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ListUsers", + requestType = com.google.cloud.alloydb.v1beta.ListUsersRequest.class, + responseType = com.google.cloud.alloydb.v1beta.ListUsersResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.alloydb.v1beta.ListUsersRequest, + com.google.cloud.alloydb.v1beta.ListUsersResponse> + getListUsersMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.alloydb.v1beta.ListUsersRequest, + com.google.cloud.alloydb.v1beta.ListUsersResponse> + getListUsersMethod; + if ((getListUsersMethod = AlloyDBAdminGrpc.getListUsersMethod) == null) { + synchronized (AlloyDBAdminGrpc.class) { + if ((getListUsersMethod = AlloyDBAdminGrpc.getListUsersMethod) == null) { + AlloyDBAdminGrpc.getListUsersMethod = + getListUsersMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ListUsers")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.alloydb.v1beta.ListUsersRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.alloydb.v1beta.ListUsersResponse + .getDefaultInstance())) + .setSchemaDescriptor(new AlloyDBAdminMethodDescriptorSupplier("ListUsers")) + .build(); + } + } + } + return getListUsersMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.alloydb.v1beta.GetUserRequest, com.google.cloud.alloydb.v1beta.User> + getGetUserMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetUser", + requestType = com.google.cloud.alloydb.v1beta.GetUserRequest.class, + responseType = com.google.cloud.alloydb.v1beta.User.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.alloydb.v1beta.GetUserRequest, com.google.cloud.alloydb.v1beta.User> + getGetUserMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.alloydb.v1beta.GetUserRequest, com.google.cloud.alloydb.v1beta.User> + getGetUserMethod; + if ((getGetUserMethod = AlloyDBAdminGrpc.getGetUserMethod) == null) { + synchronized (AlloyDBAdminGrpc.class) { + if ((getGetUserMethod = AlloyDBAdminGrpc.getGetUserMethod) == null) { + AlloyDBAdminGrpc.getGetUserMethod = + getGetUserMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetUser")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.alloydb.v1beta.GetUserRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.alloydb.v1beta.User.getDefaultInstance())) + .setSchemaDescriptor(new AlloyDBAdminMethodDescriptorSupplier("GetUser")) + .build(); + } + } + } + return getGetUserMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.alloydb.v1beta.CreateUserRequest, com.google.cloud.alloydb.v1beta.User> + getCreateUserMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "CreateUser", + requestType = com.google.cloud.alloydb.v1beta.CreateUserRequest.class, + responseType = com.google.cloud.alloydb.v1beta.User.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.alloydb.v1beta.CreateUserRequest, com.google.cloud.alloydb.v1beta.User> + getCreateUserMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.alloydb.v1beta.CreateUserRequest, com.google.cloud.alloydb.v1beta.User> + getCreateUserMethod; + if ((getCreateUserMethod = AlloyDBAdminGrpc.getCreateUserMethod) == null) { + synchronized (AlloyDBAdminGrpc.class) { + if ((getCreateUserMethod = AlloyDBAdminGrpc.getCreateUserMethod) == null) { + AlloyDBAdminGrpc.getCreateUserMethod = + getCreateUserMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "CreateUser")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.alloydb.v1beta.CreateUserRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.alloydb.v1beta.User.getDefaultInstance())) + .setSchemaDescriptor(new AlloyDBAdminMethodDescriptorSupplier("CreateUser")) + .build(); + } + } + } + return getCreateUserMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.alloydb.v1beta.UpdateUserRequest, com.google.cloud.alloydb.v1beta.User> + getUpdateUserMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "UpdateUser", + requestType = com.google.cloud.alloydb.v1beta.UpdateUserRequest.class, + responseType = com.google.cloud.alloydb.v1beta.User.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.alloydb.v1beta.UpdateUserRequest, com.google.cloud.alloydb.v1beta.User> + getUpdateUserMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.alloydb.v1beta.UpdateUserRequest, com.google.cloud.alloydb.v1beta.User> + getUpdateUserMethod; + if ((getUpdateUserMethod = AlloyDBAdminGrpc.getUpdateUserMethod) == null) { + synchronized (AlloyDBAdminGrpc.class) { + if ((getUpdateUserMethod = AlloyDBAdminGrpc.getUpdateUserMethod) == null) { + AlloyDBAdminGrpc.getUpdateUserMethod = + getUpdateUserMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "UpdateUser")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.alloydb.v1beta.UpdateUserRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.alloydb.v1beta.User.getDefaultInstance())) + .setSchemaDescriptor(new AlloyDBAdminMethodDescriptorSupplier("UpdateUser")) + .build(); + } + } + } + return getUpdateUserMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.alloydb.v1beta.DeleteUserRequest, com.google.protobuf.Empty> + getDeleteUserMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "DeleteUser", + requestType = com.google.cloud.alloydb.v1beta.DeleteUserRequest.class, + responseType = com.google.protobuf.Empty.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.alloydb.v1beta.DeleteUserRequest, com.google.protobuf.Empty> + getDeleteUserMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.alloydb.v1beta.DeleteUserRequest, com.google.protobuf.Empty> + getDeleteUserMethod; + if ((getDeleteUserMethod = AlloyDBAdminGrpc.getDeleteUserMethod) == null) { + synchronized (AlloyDBAdminGrpc.class) { + if ((getDeleteUserMethod = AlloyDBAdminGrpc.getDeleteUserMethod) == null) { + AlloyDBAdminGrpc.getDeleteUserMethod = + getDeleteUserMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "DeleteUser")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.alloydb.v1beta.DeleteUserRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.protobuf.Empty.getDefaultInstance())) + .setSchemaDescriptor(new AlloyDBAdminMethodDescriptorSupplier("DeleteUser")) + .build(); + } + } + } + return getDeleteUserMethod; + } + /** Creates a new async stub that supports all call types for the service */ public static AlloyDBAdminStub newStub(io.grpc.Channel channel) { io.grpc.stub.AbstractStub.StubFactory factory = @@ -1451,6 +1706,21 @@ default void failoverInstance( getFailoverInstanceMethod(), responseObserver); } + /** + * + * + *
+     * Injects fault in an instance.
+     * Imperative only.
+     * 
+ */ + default void injectFault( + com.google.cloud.alloydb.v1beta.InjectFaultRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getInjectFaultMethod(), responseObserver); + } + /** * * @@ -1586,6 +1856,72 @@ default void getConnectionInfo( io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( getGetConnectionInfoMethod(), responseObserver); } + + /** + * + * + *
+     * Lists Users in a given project and location.
+     * 
+ */ + default void listUsers( + com.google.cloud.alloydb.v1beta.ListUsersRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getListUsersMethod(), responseObserver); + } + + /** + * + * + *
+     * Gets details of a single User.
+     * 
+ */ + default void getUser( + com.google.cloud.alloydb.v1beta.GetUserRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getGetUserMethod(), responseObserver); + } + + /** + * + * + *
+     * Creates a new User in a given project, location, and cluster.
+     * 
+ */ + default void createUser( + com.google.cloud.alloydb.v1beta.CreateUserRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getCreateUserMethod(), responseObserver); + } + + /** + * + * + *
+     * Updates the parameters of a single User.
+     * 
+ */ + default void updateUser( + com.google.cloud.alloydb.v1beta.UpdateUserRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getUpdateUserMethod(), responseObserver); + } + + /** + * + * + *
+     * Deletes a single User.
+     * 
+ */ + default void deleteUser( + com.google.cloud.alloydb.v1beta.DeleteUserRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getDeleteUserMethod(), responseObserver); + } } /** @@ -1895,6 +2231,23 @@ public void failoverInstance( responseObserver); } + /** + * + * + *
+     * Injects fault in an instance.
+     * Imperative only.
+     * 
+ */ + public void injectFault( + com.google.cloud.alloydb.v1beta.InjectFaultRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getInjectFaultMethod(), getCallOptions()), + request, + responseObserver); + } + /** * * @@ -2047,6 +2400,77 @@ public void getConnectionInfo( request, responseObserver); } + + /** + * + * + *
+     * Lists Users in a given project and location.
+     * 
+ */ + public void listUsers( + com.google.cloud.alloydb.v1beta.ListUsersRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getListUsersMethod(), getCallOptions()), request, responseObserver); + } + + /** + * + * + *
+     * Gets details of a single User.
+     * 
+ */ + public void getUser( + com.google.cloud.alloydb.v1beta.GetUserRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getGetUserMethod(), getCallOptions()), request, responseObserver); + } + + /** + * + * + *
+     * Creates a new User in a given project, location, and cluster.
+     * 
+ */ + public void createUser( + com.google.cloud.alloydb.v1beta.CreateUserRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getCreateUserMethod(), getCallOptions()), request, responseObserver); + } + + /** + * + * + *
+     * Updates the parameters of a single User.
+     * 
+ */ + public void updateUser( + com.google.cloud.alloydb.v1beta.UpdateUserRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getUpdateUserMethod(), getCallOptions()), request, responseObserver); + } + + /** + * + * + *
+     * Deletes a single User.
+     * 
+ */ + public void deleteUser( + com.google.cloud.alloydb.v1beta.DeleteUserRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getDeleteUserMethod(), getCallOptions()), request, responseObserver); + } } /** @@ -2293,6 +2717,20 @@ public com.google.longrunning.Operation failoverInstance( getChannel(), getFailoverInstanceMethod(), getCallOptions(), request); } + /** + * + * + *
+     * Injects fault in an instance.
+     * Imperative only.
+     * 
+ */ + public com.google.longrunning.Operation injectFault( + com.google.cloud.alloydb.v1beta.InjectFaultRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getInjectFaultMethod(), getCallOptions(), request); + } + /** * * @@ -2416,6 +2854,71 @@ public com.google.cloud.alloydb.v1beta.ConnectionInfo getConnectionInfo( return io.grpc.stub.ClientCalls.blockingUnaryCall( getChannel(), getGetConnectionInfoMethod(), getCallOptions(), request); } + + /** + * + * + *
+     * Lists Users in a given project and location.
+     * 
+ */ + public com.google.cloud.alloydb.v1beta.ListUsersResponse listUsers( + com.google.cloud.alloydb.v1beta.ListUsersRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getListUsersMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Gets details of a single User.
+     * 
+ */ + public com.google.cloud.alloydb.v1beta.User getUser( + com.google.cloud.alloydb.v1beta.GetUserRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGetUserMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Creates a new User in a given project, location, and cluster.
+     * 
+ */ + public com.google.cloud.alloydb.v1beta.User createUser( + com.google.cloud.alloydb.v1beta.CreateUserRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getCreateUserMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Updates the parameters of a single User.
+     * 
+ */ + public com.google.cloud.alloydb.v1beta.User updateUser( + com.google.cloud.alloydb.v1beta.UpdateUserRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getUpdateUserMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Deletes a single User.
+     * 
+ */ + public com.google.protobuf.Empty deleteUser( + com.google.cloud.alloydb.v1beta.DeleteUserRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getDeleteUserMethod(), getCallOptions(), request); + } } /** @@ -2668,6 +3171,20 @@ protected AlloyDBAdminFutureStub build( getChannel().newCall(getFailoverInstanceMethod(), getCallOptions()), request); } + /** + * + * + *
+     * Injects fault in an instance.
+     * Imperative only.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + injectFault(com.google.cloud.alloydb.v1beta.InjectFaultRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getInjectFaultMethod(), getCallOptions()), request); + } + /** * * @@ -2796,6 +3313,72 @@ protected AlloyDBAdminFutureStub build( return io.grpc.stub.ClientCalls.futureUnaryCall( getChannel().newCall(getGetConnectionInfoMethod(), getCallOptions()), request); } + + /** + * + * + *
+     * Lists Users in a given project and location.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.alloydb.v1beta.ListUsersResponse> + listUsers(com.google.cloud.alloydb.v1beta.ListUsersRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getListUsersMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Gets details of a single User.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + getUser(com.google.cloud.alloydb.v1beta.GetUserRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getGetUserMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Creates a new User in a given project, location, and cluster.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + createUser(com.google.cloud.alloydb.v1beta.CreateUserRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getCreateUserMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Updates the parameters of a single User.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + updateUser(com.google.cloud.alloydb.v1beta.UpdateUserRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getUpdateUserMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Deletes a single User.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture deleteUser( + com.google.cloud.alloydb.v1beta.DeleteUserRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getDeleteUserMethod(), getCallOptions()), request); + } } private static final int METHODID_LIST_CLUSTERS = 0; @@ -2814,15 +3397,21 @@ protected AlloyDBAdminFutureStub build( private static final int METHODID_UPDATE_INSTANCE = 13; private static final int METHODID_DELETE_INSTANCE = 14; private static final int METHODID_FAILOVER_INSTANCE = 15; - private static final int METHODID_RESTART_INSTANCE = 16; - private static final int METHODID_LIST_BACKUPS = 17; - private static final int METHODID_GET_BACKUP = 18; - private static final int METHODID_CREATE_BACKUP = 19; - private static final int METHODID_UPDATE_BACKUP = 20; - private static final int METHODID_DELETE_BACKUP = 21; - private static final int METHODID_LIST_SUPPORTED_DATABASE_FLAGS = 22; - private static final int METHODID_GENERATE_CLIENT_CERTIFICATE = 23; - private static final int METHODID_GET_CONNECTION_INFO = 24; + private static final int METHODID_INJECT_FAULT = 16; + private static final int METHODID_RESTART_INSTANCE = 17; + private static final int METHODID_LIST_BACKUPS = 18; + private static final int METHODID_GET_BACKUP = 19; + private static final int METHODID_CREATE_BACKUP = 20; + private static final int METHODID_UPDATE_BACKUP = 21; + private static final int METHODID_DELETE_BACKUP = 22; + private static final int METHODID_LIST_SUPPORTED_DATABASE_FLAGS = 23; + private static final int METHODID_GENERATE_CLIENT_CERTIFICATE = 24; + private static final int METHODID_GET_CONNECTION_INFO = 25; + private static final int METHODID_LIST_USERS = 26; + private static final int METHODID_GET_USER = 27; + private static final int METHODID_CREATE_USER = 28; + private static final int METHODID_UPDATE_USER = 29; + private static final int METHODID_DELETE_USER = 30; private static final class MethodHandlers implements io.grpc.stub.ServerCalls.UnaryMethod, @@ -2925,6 +3514,11 @@ public void invoke(Req request, io.grpc.stub.StreamObserver responseObserv (com.google.cloud.alloydb.v1beta.FailoverInstanceRequest) request, (io.grpc.stub.StreamObserver) responseObserver); break; + case METHODID_INJECT_FAULT: + serviceImpl.injectFault( + (com.google.cloud.alloydb.v1beta.InjectFaultRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; case METHODID_RESTART_INSTANCE: serviceImpl.restartInstance( (com.google.cloud.alloydb.v1beta.RestartInstanceRequest) request, @@ -2977,6 +3571,32 @@ public void invoke(Req request, io.grpc.stub.StreamObserver responseObserv (io.grpc.stub.StreamObserver) responseObserver); break; + case METHODID_LIST_USERS: + serviceImpl.listUsers( + (com.google.cloud.alloydb.v1beta.ListUsersRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_GET_USER: + serviceImpl.getUser( + (com.google.cloud.alloydb.v1beta.GetUserRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_CREATE_USER: + serviceImpl.createUser( + (com.google.cloud.alloydb.v1beta.CreateUserRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_UPDATE_USER: + serviceImpl.updateUser( + (com.google.cloud.alloydb.v1beta.UpdateUserRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_DELETE_USER: + serviceImpl.deleteUser( + (com.google.cloud.alloydb.v1beta.DeleteUserRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; default: throw new AssertionError(); } @@ -3093,6 +3713,12 @@ public static final io.grpc.ServerServiceDefinition bindService(AsyncService ser new MethodHandlers< com.google.cloud.alloydb.v1beta.FailoverInstanceRequest, com.google.longrunning.Operation>(service, METHODID_FAILOVER_INSTANCE))) + .addMethod( + getInjectFaultMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.alloydb.v1beta.InjectFaultRequest, + com.google.longrunning.Operation>(service, METHODID_INJECT_FAULT))) .addMethod( getRestartInstanceMethod(), io.grpc.stub.ServerCalls.asyncUnaryCall( @@ -3151,6 +3777,37 @@ public static final io.grpc.ServerServiceDefinition bindService(AsyncService ser com.google.cloud.alloydb.v1beta.GetConnectionInfoRequest, com.google.cloud.alloydb.v1beta.ConnectionInfo>( service, METHODID_GET_CONNECTION_INFO))) + .addMethod( + getListUsersMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.alloydb.v1beta.ListUsersRequest, + com.google.cloud.alloydb.v1beta.ListUsersResponse>( + service, METHODID_LIST_USERS))) + .addMethod( + getGetUserMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.alloydb.v1beta.GetUserRequest, + com.google.cloud.alloydb.v1beta.User>(service, METHODID_GET_USER))) + .addMethod( + getCreateUserMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.alloydb.v1beta.CreateUserRequest, + com.google.cloud.alloydb.v1beta.User>(service, METHODID_CREATE_USER))) + .addMethod( + getUpdateUserMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.alloydb.v1beta.UpdateUserRequest, + com.google.cloud.alloydb.v1beta.User>(service, METHODID_UPDATE_USER))) + .addMethod( + getDeleteUserMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.alloydb.v1beta.DeleteUserRequest, com.google.protobuf.Empty>( + service, METHODID_DELETE_USER))) .build(); } @@ -3218,6 +3875,7 @@ public static io.grpc.ServiceDescriptor getServiceDescriptor() { .addMethod(getUpdateInstanceMethod()) .addMethod(getDeleteInstanceMethod()) .addMethod(getFailoverInstanceMethod()) + .addMethod(getInjectFaultMethod()) .addMethod(getRestartInstanceMethod()) .addMethod(getListBackupsMethod()) .addMethod(getGetBackupMethod()) @@ -3227,6 +3885,11 @@ public static io.grpc.ServiceDescriptor getServiceDescriptor() { .addMethod(getListSupportedDatabaseFlagsMethod()) .addMethod(getGenerateClientCertificateMethod()) .addMethod(getGetConnectionInfoMethod()) + .addMethod(getListUsersMethod()) + .addMethod(getGetUserMethod()) + .addMethod(getCreateUserMethod()) + .addMethod(getUpdateUserMethod()) + .addMethod(getDeleteUserMethod()) .build(); } } diff --git a/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/Backup.java b/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/Backup.java index 8c5cb2047b44..746c3f9f8504 100644 --- a/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/Backup.java +++ b/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/Backup.java @@ -1076,7 +1076,7 @@ public com.google.protobuf.ByteString getClusterUidBytes() { * *
    * Required. The full resource name of the backup source cluster
-   * (e.g., projects/<project>/locations/<location>/clusters/<cluster_id>).
+   * (e.g., projects/{project}/locations/{region}/clusters/{cluster_id}).
    * 
* * @@ -1102,7 +1102,7 @@ public java.lang.String getClusterName() { * *
    * Required. The full resource name of the backup source cluster
-   * (e.g., projects/<project>/locations/<location>/clusters/<cluster_id>).
+   * (e.g., projects/{project}/locations/{region}/clusters/{cluster_id}).
    * 
* * @@ -3898,7 +3898,7 @@ public Builder setClusterUidBytes(com.google.protobuf.ByteString value) { * *
      * Required. The full resource name of the backup source cluster
-     * (e.g., projects/<project>/locations/<location>/clusters/<cluster_id>).
+     * (e.g., projects/{project}/locations/{region}/clusters/{cluster_id}).
      * 
* * @@ -3923,7 +3923,7 @@ public java.lang.String getClusterName() { * *
      * Required. The full resource name of the backup source cluster
-     * (e.g., projects/<project>/locations/<location>/clusters/<cluster_id>).
+     * (e.g., projects/{project}/locations/{region}/clusters/{cluster_id}).
      * 
* * @@ -3948,7 +3948,7 @@ public com.google.protobuf.ByteString getClusterNameBytes() { * *
      * Required. The full resource name of the backup source cluster
-     * (e.g., projects/<project>/locations/<location>/clusters/<cluster_id>).
+     * (e.g., projects/{project}/locations/{region}/clusters/{cluster_id}).
      * 
* * @@ -3972,7 +3972,7 @@ public Builder setClusterName(java.lang.String value) { * *
      * Required. The full resource name of the backup source cluster
-     * (e.g., projects/<project>/locations/<location>/clusters/<cluster_id>).
+     * (e.g., projects/{project}/locations/{region}/clusters/{cluster_id}).
      * 
* * @@ -3992,7 +3992,7 @@ public Builder clearClusterName() { * *
      * Required. The full resource name of the backup source cluster
-     * (e.g., projects/<project>/locations/<location>/clusters/<cluster_id>).
+     * (e.g., projects/{project}/locations/{region}/clusters/{cluster_id}).
      * 
* * diff --git a/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/BackupOrBuilder.java b/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/BackupOrBuilder.java index bdc041f9ea27..cb514429964c 100644 --- a/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/BackupOrBuilder.java +++ b/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/BackupOrBuilder.java @@ -399,7 +399,7 @@ java.lang.String getLabelsOrDefault( * *
    * Required. The full resource name of the backup source cluster
-   * (e.g., projects/<project>/locations/<location>/clusters/<cluster_id>).
+   * (e.g., projects/{project}/locations/{region}/clusters/{cluster_id}).
    * 
* * @@ -414,7 +414,7 @@ java.lang.String getLabelsOrDefault( * *
    * Required. The full resource name of the backup source cluster
-   * (e.g., projects/<project>/locations/<location>/clusters/<cluster_id>).
+   * (e.g., projects/{project}/locations/{region}/clusters/{cluster_id}).
    * 
* * diff --git a/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/BatchCreateInstanceStatus.java b/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/BatchCreateInstanceStatus.java index 547a094263f8..64942521b2ed 100644 --- a/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/BatchCreateInstanceStatus.java +++ b/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/BatchCreateInstanceStatus.java @@ -33,6 +33,7 @@ * 2. Instance2 = ROLLED_BACK * 3. Instance3 = FAILED * 4. Instance4 = FAILED + * * However, while the operation is running, the instance might be in other * states including PENDING_CREATE, ACTIVE, DELETING and CREATING. The states * / do not get further updated once the operation is done. @@ -723,6 +724,7 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build * 2. Instance2 = ROLLED_BACK * 3. Instance3 = FAILED * 4. Instance4 = FAILED + * * However, while the operation is running, the instance might be in other * states including PENDING_CREATE, ACTIVE, DELETING and CREATING. The states * / do not get further updated once the operation is done. diff --git a/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/BatchCreateInstancesMetadata.java b/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/BatchCreateInstancesMetadata.java index 152af7d3d647..df7bd9cb6cc0 100644 --- a/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/BatchCreateInstancesMetadata.java +++ b/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/BatchCreateInstancesMetadata.java @@ -23,6 +23,7 @@ * *
  * Message for metadata that is specific to BatchCreateInstances API.
+ * NEXT_ID: 3
  * 
* * Protobuf type {@code google.cloud.alloydb.v1.BatchCreateInstancesMetadata} @@ -486,6 +487,7 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build * *
    * Message for metadata that is specific to BatchCreateInstances API.
+   * NEXT_ID: 3
    * 
* * Protobuf type {@code google.cloud.alloydb.v1.BatchCreateInstancesMetadata} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/Cluster.java b/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/Cluster.java index e3855b5ef52a..0f80b0014817 100644 --- a/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/Cluster.java +++ b/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/Cluster.java @@ -3128,14 +3128,17 @@ public com.google.cloud.alloydb.v1.AutomatedBackupPolicy getAutomatedBackupPolic * * *
-   * SSL configuration for this AlloyDB Cluster.
+   * SSL configuration for this AlloyDB cluster.
    * 
* - * .google.cloud.alloydb.v1.SslConfig ssl_config = 18; + * .google.cloud.alloydb.v1.SslConfig ssl_config = 18 [deprecated = true]; * + * @deprecated google.cloud.alloydb.v1.Cluster.ssl_config is deprecated. See + * google/cloud/alloydb/v1/resources.proto;l=550 * @return Whether the sslConfig field is set. */ @java.lang.Override + @java.lang.Deprecated public boolean hasSslConfig() { return sslConfig_ != null; } @@ -3143,14 +3146,17 @@ public boolean hasSslConfig() { * * *
-   * SSL configuration for this AlloyDB Cluster.
+   * SSL configuration for this AlloyDB cluster.
    * 
* - * .google.cloud.alloydb.v1.SslConfig ssl_config = 18; + * .google.cloud.alloydb.v1.SslConfig ssl_config = 18 [deprecated = true]; * + * @deprecated google.cloud.alloydb.v1.Cluster.ssl_config is deprecated. See + * google/cloud/alloydb/v1/resources.proto;l=550 * @return The sslConfig. */ @java.lang.Override + @java.lang.Deprecated public com.google.cloud.alloydb.v1.SslConfig getSslConfig() { return sslConfig_ == null ? com.google.cloud.alloydb.v1.SslConfig.getDefaultInstance() @@ -3160,12 +3166,13 @@ public com.google.cloud.alloydb.v1.SslConfig getSslConfig() { * * *
-   * SSL configuration for this AlloyDB Cluster.
+   * SSL configuration for this AlloyDB cluster.
    * 
* - * .google.cloud.alloydb.v1.SslConfig ssl_config = 18; + * .google.cloud.alloydb.v1.SslConfig ssl_config = 18 [deprecated = true]; */ @java.lang.Override + @java.lang.Deprecated public com.google.cloud.alloydb.v1.SslConfigOrBuilder getSslConfigOrBuilder() { return sslConfig_ == null ? com.google.cloud.alloydb.v1.SslConfig.getDefaultInstance() @@ -3296,6 +3303,120 @@ public com.google.cloud.alloydb.v1.EncryptionInfoOrBuilder getEncryptionInfoOrBu : encryptionInfo_; } + public static final int CONTINUOUS_BACKUP_CONFIG_FIELD_NUMBER = 27; + private com.google.cloud.alloydb.v1.ContinuousBackupConfig continuousBackupConfig_; + /** + * + * + *
+   * Optional. Continuous backup configuration for this cluster.
+   * 
+ * + * + * .google.cloud.alloydb.v1.ContinuousBackupConfig continuous_backup_config = 27 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the continuousBackupConfig field is set. + */ + @java.lang.Override + public boolean hasContinuousBackupConfig() { + return continuousBackupConfig_ != null; + } + /** + * + * + *
+   * Optional. Continuous backup configuration for this cluster.
+   * 
+ * + * + * .google.cloud.alloydb.v1.ContinuousBackupConfig continuous_backup_config = 27 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The continuousBackupConfig. + */ + @java.lang.Override + public com.google.cloud.alloydb.v1.ContinuousBackupConfig getContinuousBackupConfig() { + return continuousBackupConfig_ == null + ? com.google.cloud.alloydb.v1.ContinuousBackupConfig.getDefaultInstance() + : continuousBackupConfig_; + } + /** + * + * + *
+   * Optional. Continuous backup configuration for this cluster.
+   * 
+ * + * + * .google.cloud.alloydb.v1.ContinuousBackupConfig continuous_backup_config = 27 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.cloud.alloydb.v1.ContinuousBackupConfigOrBuilder + getContinuousBackupConfigOrBuilder() { + return continuousBackupConfig_ == null + ? com.google.cloud.alloydb.v1.ContinuousBackupConfig.getDefaultInstance() + : continuousBackupConfig_; + } + + public static final int CONTINUOUS_BACKUP_INFO_FIELD_NUMBER = 28; + private com.google.cloud.alloydb.v1.ContinuousBackupInfo continuousBackupInfo_; + /** + * + * + *
+   * Output only. Continuous backup properties for this cluster.
+   * 
+ * + * + * .google.cloud.alloydb.v1.ContinuousBackupInfo continuous_backup_info = 28 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the continuousBackupInfo field is set. + */ + @java.lang.Override + public boolean hasContinuousBackupInfo() { + return continuousBackupInfo_ != null; + } + /** + * + * + *
+   * Output only. Continuous backup properties for this cluster.
+   * 
+ * + * + * .google.cloud.alloydb.v1.ContinuousBackupInfo continuous_backup_info = 28 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The continuousBackupInfo. + */ + @java.lang.Override + public com.google.cloud.alloydb.v1.ContinuousBackupInfo getContinuousBackupInfo() { + return continuousBackupInfo_ == null + ? com.google.cloud.alloydb.v1.ContinuousBackupInfo.getDefaultInstance() + : continuousBackupInfo_; + } + /** + * + * + *
+   * Output only. Continuous backup properties for this cluster.
+   * 
+ * + * + * .google.cloud.alloydb.v1.ContinuousBackupInfo continuous_backup_info = 28 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.cloud.alloydb.v1.ContinuousBackupInfoOrBuilder + getContinuousBackupInfoOrBuilder() { + return continuousBackupInfo_ == null + ? com.google.cloud.alloydb.v1.ContinuousBackupInfo.getDefaultInstance() + : continuousBackupInfo_; + } + public static final int SECONDARY_CONFIG_FIELD_NUMBER = 22; private com.google.cloud.alloydb.v1.Cluster.SecondaryConfig secondaryConfig_; /** @@ -3486,6 +3607,12 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io != com.google.cloud.alloydb.v1.Cluster.ClusterType.CLUSTER_TYPE_UNSPECIFIED.getNumber()) { output.writeEnum(24, clusterType_); } + if (continuousBackupConfig_ != null) { + output.writeMessage(27, getContinuousBackupConfig()); + } + if (continuousBackupInfo_ != null) { + output.writeMessage(28, getContinuousBackupInfo()); + } getUnknownFields().writeTo(output); } @@ -3585,6 +3712,14 @@ public int getSerializedSize() { != com.google.cloud.alloydb.v1.Cluster.ClusterType.CLUSTER_TYPE_UNSPECIFIED.getNumber()) { size += com.google.protobuf.CodedOutputStream.computeEnumSize(24, clusterType_); } + if (continuousBackupConfig_ != null) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize(27, getContinuousBackupConfig()); + } + if (continuousBackupInfo_ != null) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize(28, getContinuousBackupInfo()); + } size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; @@ -3643,6 +3778,14 @@ public boolean equals(final java.lang.Object obj) { if (hasEncryptionInfo()) { if (!getEncryptionInfo().equals(other.getEncryptionInfo())) return false; } + if (hasContinuousBackupConfig() != other.hasContinuousBackupConfig()) return false; + if (hasContinuousBackupConfig()) { + if (!getContinuousBackupConfig().equals(other.getContinuousBackupConfig())) return false; + } + if (hasContinuousBackupInfo() != other.hasContinuousBackupInfo()) return false; + if (hasContinuousBackupInfo()) { + if (!getContinuousBackupInfo().equals(other.getContinuousBackupInfo())) return false; + } if (hasSecondaryConfig() != other.hasSecondaryConfig()) return false; if (hasSecondaryConfig()) { if (!getSecondaryConfig().equals(other.getSecondaryConfig())) return false; @@ -3731,6 +3874,14 @@ public int hashCode() { hash = (37 * hash) + ENCRYPTION_INFO_FIELD_NUMBER; hash = (53 * hash) + getEncryptionInfo().hashCode(); } + if (hasContinuousBackupConfig()) { + hash = (37 * hash) + CONTINUOUS_BACKUP_CONFIG_FIELD_NUMBER; + hash = (53 * hash) + getContinuousBackupConfig().hashCode(); + } + if (hasContinuousBackupInfo()) { + hash = (37 * hash) + CONTINUOUS_BACKUP_INFO_FIELD_NUMBER; + hash = (53 * hash) + getContinuousBackupInfo().hashCode(); + } if (hasSecondaryConfig()) { hash = (37 * hash) + SECONDARY_CONFIG_FIELD_NUMBER; hash = (53 * hash) + getSecondaryConfig().hashCode(); @@ -3972,6 +4123,16 @@ public Builder clear() { encryptionInfoBuilder_.dispose(); encryptionInfoBuilder_ = null; } + continuousBackupConfig_ = null; + if (continuousBackupConfigBuilder_ != null) { + continuousBackupConfigBuilder_.dispose(); + continuousBackupConfigBuilder_ = null; + } + continuousBackupInfo_ = null; + if (continuousBackupInfoBuilder_ != null) { + continuousBackupInfoBuilder_.dispose(); + continuousBackupInfoBuilder_ = null; + } secondaryConfig_ = null; if (secondaryConfigBuilder_ != null) { secondaryConfigBuilder_.dispose(); @@ -4086,10 +4247,22 @@ private void buildPartial0(com.google.cloud.alloydb.v1.Cluster result) { encryptionInfoBuilder_ == null ? encryptionInfo_ : encryptionInfoBuilder_.build(); } if (((from_bitField0_ & 0x00200000) != 0)) { + result.continuousBackupConfig_ = + continuousBackupConfigBuilder_ == null + ? continuousBackupConfig_ + : continuousBackupConfigBuilder_.build(); + } + if (((from_bitField0_ & 0x00400000) != 0)) { + result.continuousBackupInfo_ = + continuousBackupInfoBuilder_ == null + ? continuousBackupInfo_ + : continuousBackupInfoBuilder_.build(); + } + if (((from_bitField0_ & 0x00800000) != 0)) { result.secondaryConfig_ = secondaryConfigBuilder_ == null ? secondaryConfig_ : secondaryConfigBuilder_.build(); } - if (((from_bitField0_ & 0x00400000) != 0)) { + if (((from_bitField0_ & 0x01000000) != 0)) { result.primaryConfig_ = primaryConfigBuilder_ == null ? primaryConfig_ : primaryConfigBuilder_.build(); } @@ -4216,6 +4389,12 @@ public Builder mergeFrom(com.google.cloud.alloydb.v1.Cluster other) { if (other.hasEncryptionInfo()) { mergeEncryptionInfo(other.getEncryptionInfo()); } + if (other.hasContinuousBackupConfig()) { + mergeContinuousBackupConfig(other.getContinuousBackupConfig()); + } + if (other.hasContinuousBackupInfo()) { + mergeContinuousBackupInfo(other.getContinuousBackupInfo()); + } if (other.hasSecondaryConfig()) { mergeSecondaryConfig(other.getSecondaryConfig()); } @@ -4401,13 +4580,13 @@ public Builder mergeFrom( case 178: { input.readMessage(getSecondaryConfigFieldBuilder().getBuilder(), extensionRegistry); - bitField0_ |= 0x00200000; + bitField0_ |= 0x00800000; break; } // case 178 case 186: { input.readMessage(getPrimaryConfigFieldBuilder().getBuilder(), extensionRegistry); - bitField0_ |= 0x00400000; + bitField0_ |= 0x01000000; break; } // case 186 case 192: @@ -4416,6 +4595,20 @@ public Builder mergeFrom( bitField0_ |= 0x00000400; break; } // case 192 + case 218: + { + input.readMessage( + getContinuousBackupConfigFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00200000; + break; + } // case 218 + case 226: + { + input.readMessage( + getContinuousBackupInfoFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00400000; + break; + } // case 226 default: { if (!super.parseUnknownField(input, extensionRegistry, tag)) { @@ -7293,13 +7486,16 @@ public Builder clearAutomatedBackupPolicy() { * * *
-     * SSL configuration for this AlloyDB Cluster.
+     * SSL configuration for this AlloyDB cluster.
      * 
* - * .google.cloud.alloydb.v1.SslConfig ssl_config = 18; + * .google.cloud.alloydb.v1.SslConfig ssl_config = 18 [deprecated = true]; * + * @deprecated google.cloud.alloydb.v1.Cluster.ssl_config is deprecated. See + * google/cloud/alloydb/v1/resources.proto;l=550 * @return Whether the sslConfig field is set. */ + @java.lang.Deprecated public boolean hasSslConfig() { return ((bitField0_ & 0x00040000) != 0); } @@ -7307,13 +7503,16 @@ public boolean hasSslConfig() { * * *
-     * SSL configuration for this AlloyDB Cluster.
+     * SSL configuration for this AlloyDB cluster.
      * 
* - * .google.cloud.alloydb.v1.SslConfig ssl_config = 18; + * .google.cloud.alloydb.v1.SslConfig ssl_config = 18 [deprecated = true]; * + * @deprecated google.cloud.alloydb.v1.Cluster.ssl_config is deprecated. See + * google/cloud/alloydb/v1/resources.proto;l=550 * @return The sslConfig. */ + @java.lang.Deprecated public com.google.cloud.alloydb.v1.SslConfig getSslConfig() { if (sslConfigBuilder_ == null) { return sslConfig_ == null @@ -7327,11 +7526,12 @@ public com.google.cloud.alloydb.v1.SslConfig getSslConfig() { * * *
-     * SSL configuration for this AlloyDB Cluster.
+     * SSL configuration for this AlloyDB cluster.
      * 
* - * .google.cloud.alloydb.v1.SslConfig ssl_config = 18; + * .google.cloud.alloydb.v1.SslConfig ssl_config = 18 [deprecated = true]; */ + @java.lang.Deprecated public Builder setSslConfig(com.google.cloud.alloydb.v1.SslConfig value) { if (sslConfigBuilder_ == null) { if (value == null) { @@ -7349,11 +7549,12 @@ public Builder setSslConfig(com.google.cloud.alloydb.v1.SslConfig value) { * * *
-     * SSL configuration for this AlloyDB Cluster.
+     * SSL configuration for this AlloyDB cluster.
      * 
* - * .google.cloud.alloydb.v1.SslConfig ssl_config = 18; + * .google.cloud.alloydb.v1.SslConfig ssl_config = 18 [deprecated = true]; */ + @java.lang.Deprecated public Builder setSslConfig(com.google.cloud.alloydb.v1.SslConfig.Builder builderForValue) { if (sslConfigBuilder_ == null) { sslConfig_ = builderForValue.build(); @@ -7368,11 +7569,12 @@ public Builder setSslConfig(com.google.cloud.alloydb.v1.SslConfig.Builder builde * * *
-     * SSL configuration for this AlloyDB Cluster.
+     * SSL configuration for this AlloyDB cluster.
      * 
* - * .google.cloud.alloydb.v1.SslConfig ssl_config = 18; + * .google.cloud.alloydb.v1.SslConfig ssl_config = 18 [deprecated = true]; */ + @java.lang.Deprecated public Builder mergeSslConfig(com.google.cloud.alloydb.v1.SslConfig value) { if (sslConfigBuilder_ == null) { if (((bitField0_ & 0x00040000) != 0) @@ -7393,11 +7595,12 @@ public Builder mergeSslConfig(com.google.cloud.alloydb.v1.SslConfig value) { * * *
-     * SSL configuration for this AlloyDB Cluster.
+     * SSL configuration for this AlloyDB cluster.
      * 
* - * .google.cloud.alloydb.v1.SslConfig ssl_config = 18; + * .google.cloud.alloydb.v1.SslConfig ssl_config = 18 [deprecated = true]; */ + @java.lang.Deprecated public Builder clearSslConfig() { bitField0_ = (bitField0_ & ~0x00040000); sslConfig_ = null; @@ -7412,11 +7615,12 @@ public Builder clearSslConfig() { * * *
-     * SSL configuration for this AlloyDB Cluster.
+     * SSL configuration for this AlloyDB cluster.
      * 
* - * .google.cloud.alloydb.v1.SslConfig ssl_config = 18; + * .google.cloud.alloydb.v1.SslConfig ssl_config = 18 [deprecated = true]; */ + @java.lang.Deprecated public com.google.cloud.alloydb.v1.SslConfig.Builder getSslConfigBuilder() { bitField0_ |= 0x00040000; onChanged(); @@ -7426,11 +7630,12 @@ public com.google.cloud.alloydb.v1.SslConfig.Builder getSslConfigBuilder() { * * *
-     * SSL configuration for this AlloyDB Cluster.
+     * SSL configuration for this AlloyDB cluster.
      * 
* - * .google.cloud.alloydb.v1.SslConfig ssl_config = 18; + * .google.cloud.alloydb.v1.SslConfig ssl_config = 18 [deprecated = true]; */ + @java.lang.Deprecated public com.google.cloud.alloydb.v1.SslConfigOrBuilder getSslConfigOrBuilder() { if (sslConfigBuilder_ != null) { return sslConfigBuilder_.getMessageOrBuilder(); @@ -7444,10 +7649,10 @@ public com.google.cloud.alloydb.v1.SslConfigOrBuilder getSslConfigOrBuilder() { * * *
-     * SSL configuration for this AlloyDB Cluster.
+     * SSL configuration for this AlloyDB cluster.
      * 
* - * .google.cloud.alloydb.v1.SslConfig ssl_config = 18; + * .google.cloud.alloydb.v1.SslConfig ssl_config = 18 [deprecated = true]; */ private com.google.protobuf.SingleFieldBuilderV3< com.google.cloud.alloydb.v1.SslConfig, @@ -7907,6 +8112,419 @@ public com.google.cloud.alloydb.v1.EncryptionInfoOrBuilder getEncryptionInfoOrBu return encryptionInfoBuilder_; } + private com.google.cloud.alloydb.v1.ContinuousBackupConfig continuousBackupConfig_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1.ContinuousBackupConfig, + com.google.cloud.alloydb.v1.ContinuousBackupConfig.Builder, + com.google.cloud.alloydb.v1.ContinuousBackupConfigOrBuilder> + continuousBackupConfigBuilder_; + /** + * + * + *
+     * Optional. Continuous backup configuration for this cluster.
+     * 
+ * + * + * .google.cloud.alloydb.v1.ContinuousBackupConfig continuous_backup_config = 27 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the continuousBackupConfig field is set. + */ + public boolean hasContinuousBackupConfig() { + return ((bitField0_ & 0x00200000) != 0); + } + /** + * + * + *
+     * Optional. Continuous backup configuration for this cluster.
+     * 
+ * + * + * .google.cloud.alloydb.v1.ContinuousBackupConfig continuous_backup_config = 27 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The continuousBackupConfig. + */ + public com.google.cloud.alloydb.v1.ContinuousBackupConfig getContinuousBackupConfig() { + if (continuousBackupConfigBuilder_ == null) { + return continuousBackupConfig_ == null + ? com.google.cloud.alloydb.v1.ContinuousBackupConfig.getDefaultInstance() + : continuousBackupConfig_; + } else { + return continuousBackupConfigBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Optional. Continuous backup configuration for this cluster.
+     * 
+ * + * + * .google.cloud.alloydb.v1.ContinuousBackupConfig continuous_backup_config = 27 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setContinuousBackupConfig( + com.google.cloud.alloydb.v1.ContinuousBackupConfig value) { + if (continuousBackupConfigBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + continuousBackupConfig_ = value; + } else { + continuousBackupConfigBuilder_.setMessage(value); + } + bitField0_ |= 0x00200000; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Continuous backup configuration for this cluster.
+     * 
+ * + * + * .google.cloud.alloydb.v1.ContinuousBackupConfig continuous_backup_config = 27 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setContinuousBackupConfig( + com.google.cloud.alloydb.v1.ContinuousBackupConfig.Builder builderForValue) { + if (continuousBackupConfigBuilder_ == null) { + continuousBackupConfig_ = builderForValue.build(); + } else { + continuousBackupConfigBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00200000; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Continuous backup configuration for this cluster.
+     * 
+ * + * + * .google.cloud.alloydb.v1.ContinuousBackupConfig continuous_backup_config = 27 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder mergeContinuousBackupConfig( + com.google.cloud.alloydb.v1.ContinuousBackupConfig value) { + if (continuousBackupConfigBuilder_ == null) { + if (((bitField0_ & 0x00200000) != 0) + && continuousBackupConfig_ != null + && continuousBackupConfig_ + != com.google.cloud.alloydb.v1.ContinuousBackupConfig.getDefaultInstance()) { + getContinuousBackupConfigBuilder().mergeFrom(value); + } else { + continuousBackupConfig_ = value; + } + } else { + continuousBackupConfigBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00200000; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Continuous backup configuration for this cluster.
+     * 
+ * + * + * .google.cloud.alloydb.v1.ContinuousBackupConfig continuous_backup_config = 27 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder clearContinuousBackupConfig() { + bitField0_ = (bitField0_ & ~0x00200000); + continuousBackupConfig_ = null; + if (continuousBackupConfigBuilder_ != null) { + continuousBackupConfigBuilder_.dispose(); + continuousBackupConfigBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Continuous backup configuration for this cluster.
+     * 
+ * + * + * .google.cloud.alloydb.v1.ContinuousBackupConfig continuous_backup_config = 27 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.alloydb.v1.ContinuousBackupConfig.Builder + getContinuousBackupConfigBuilder() { + bitField0_ |= 0x00200000; + onChanged(); + return getContinuousBackupConfigFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Optional. Continuous backup configuration for this cluster.
+     * 
+ * + * + * .google.cloud.alloydb.v1.ContinuousBackupConfig continuous_backup_config = 27 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.alloydb.v1.ContinuousBackupConfigOrBuilder + getContinuousBackupConfigOrBuilder() { + if (continuousBackupConfigBuilder_ != null) { + return continuousBackupConfigBuilder_.getMessageOrBuilder(); + } else { + return continuousBackupConfig_ == null + ? com.google.cloud.alloydb.v1.ContinuousBackupConfig.getDefaultInstance() + : continuousBackupConfig_; + } + } + /** + * + * + *
+     * Optional. Continuous backup configuration for this cluster.
+     * 
+ * + * + * .google.cloud.alloydb.v1.ContinuousBackupConfig continuous_backup_config = 27 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1.ContinuousBackupConfig, + com.google.cloud.alloydb.v1.ContinuousBackupConfig.Builder, + com.google.cloud.alloydb.v1.ContinuousBackupConfigOrBuilder> + getContinuousBackupConfigFieldBuilder() { + if (continuousBackupConfigBuilder_ == null) { + continuousBackupConfigBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1.ContinuousBackupConfig, + com.google.cloud.alloydb.v1.ContinuousBackupConfig.Builder, + com.google.cloud.alloydb.v1.ContinuousBackupConfigOrBuilder>( + getContinuousBackupConfig(), getParentForChildren(), isClean()); + continuousBackupConfig_ = null; + } + return continuousBackupConfigBuilder_; + } + + private com.google.cloud.alloydb.v1.ContinuousBackupInfo continuousBackupInfo_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1.ContinuousBackupInfo, + com.google.cloud.alloydb.v1.ContinuousBackupInfo.Builder, + com.google.cloud.alloydb.v1.ContinuousBackupInfoOrBuilder> + continuousBackupInfoBuilder_; + /** + * + * + *
+     * Output only. Continuous backup properties for this cluster.
+     * 
+ * + * + * .google.cloud.alloydb.v1.ContinuousBackupInfo continuous_backup_info = 28 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the continuousBackupInfo field is set. + */ + public boolean hasContinuousBackupInfo() { + return ((bitField0_ & 0x00400000) != 0); + } + /** + * + * + *
+     * Output only. Continuous backup properties for this cluster.
+     * 
+ * + * + * .google.cloud.alloydb.v1.ContinuousBackupInfo continuous_backup_info = 28 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The continuousBackupInfo. + */ + public com.google.cloud.alloydb.v1.ContinuousBackupInfo getContinuousBackupInfo() { + if (continuousBackupInfoBuilder_ == null) { + return continuousBackupInfo_ == null + ? com.google.cloud.alloydb.v1.ContinuousBackupInfo.getDefaultInstance() + : continuousBackupInfo_; + } else { + return continuousBackupInfoBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Output only. Continuous backup properties for this cluster.
+     * 
+ * + * + * .google.cloud.alloydb.v1.ContinuousBackupInfo continuous_backup_info = 28 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setContinuousBackupInfo(com.google.cloud.alloydb.v1.ContinuousBackupInfo value) { + if (continuousBackupInfoBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + continuousBackupInfo_ = value; + } else { + continuousBackupInfoBuilder_.setMessage(value); + } + bitField0_ |= 0x00400000; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Continuous backup properties for this cluster.
+     * 
+ * + * + * .google.cloud.alloydb.v1.ContinuousBackupInfo continuous_backup_info = 28 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setContinuousBackupInfo( + com.google.cloud.alloydb.v1.ContinuousBackupInfo.Builder builderForValue) { + if (continuousBackupInfoBuilder_ == null) { + continuousBackupInfo_ = builderForValue.build(); + } else { + continuousBackupInfoBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00400000; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Continuous backup properties for this cluster.
+     * 
+ * + * + * .google.cloud.alloydb.v1.ContinuousBackupInfo continuous_backup_info = 28 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeContinuousBackupInfo( + com.google.cloud.alloydb.v1.ContinuousBackupInfo value) { + if (continuousBackupInfoBuilder_ == null) { + if (((bitField0_ & 0x00400000) != 0) + && continuousBackupInfo_ != null + && continuousBackupInfo_ + != com.google.cloud.alloydb.v1.ContinuousBackupInfo.getDefaultInstance()) { + getContinuousBackupInfoBuilder().mergeFrom(value); + } else { + continuousBackupInfo_ = value; + } + } else { + continuousBackupInfoBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00400000; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Continuous backup properties for this cluster.
+     * 
+ * + * + * .google.cloud.alloydb.v1.ContinuousBackupInfo continuous_backup_info = 28 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearContinuousBackupInfo() { + bitField0_ = (bitField0_ & ~0x00400000); + continuousBackupInfo_ = null; + if (continuousBackupInfoBuilder_ != null) { + continuousBackupInfoBuilder_.dispose(); + continuousBackupInfoBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Continuous backup properties for this cluster.
+     * 
+ * + * + * .google.cloud.alloydb.v1.ContinuousBackupInfo continuous_backup_info = 28 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.alloydb.v1.ContinuousBackupInfo.Builder + getContinuousBackupInfoBuilder() { + bitField0_ |= 0x00400000; + onChanged(); + return getContinuousBackupInfoFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. Continuous backup properties for this cluster.
+     * 
+ * + * + * .google.cloud.alloydb.v1.ContinuousBackupInfo continuous_backup_info = 28 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.alloydb.v1.ContinuousBackupInfoOrBuilder + getContinuousBackupInfoOrBuilder() { + if (continuousBackupInfoBuilder_ != null) { + return continuousBackupInfoBuilder_.getMessageOrBuilder(); + } else { + return continuousBackupInfo_ == null + ? com.google.cloud.alloydb.v1.ContinuousBackupInfo.getDefaultInstance() + : continuousBackupInfo_; + } + } + /** + * + * + *
+     * Output only. Continuous backup properties for this cluster.
+     * 
+ * + * + * .google.cloud.alloydb.v1.ContinuousBackupInfo continuous_backup_info = 28 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1.ContinuousBackupInfo, + com.google.cloud.alloydb.v1.ContinuousBackupInfo.Builder, + com.google.cloud.alloydb.v1.ContinuousBackupInfoOrBuilder> + getContinuousBackupInfoFieldBuilder() { + if (continuousBackupInfoBuilder_ == null) { + continuousBackupInfoBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1.ContinuousBackupInfo, + com.google.cloud.alloydb.v1.ContinuousBackupInfo.Builder, + com.google.cloud.alloydb.v1.ContinuousBackupInfoOrBuilder>( + getContinuousBackupInfo(), getParentForChildren(), isClean()); + continuousBackupInfo_ = null; + } + return continuousBackupInfoBuilder_; + } + private com.google.cloud.alloydb.v1.Cluster.SecondaryConfig secondaryConfig_; private com.google.protobuf.SingleFieldBuilderV3< com.google.cloud.alloydb.v1.Cluster.SecondaryConfig, @@ -7925,7 +8543,7 @@ public com.google.cloud.alloydb.v1.EncryptionInfoOrBuilder getEncryptionInfoOrBu * @return Whether the secondaryConfig field is set. */ public boolean hasSecondaryConfig() { - return ((bitField0_ & 0x00200000) != 0); + return ((bitField0_ & 0x00800000) != 0); } /** * @@ -7965,7 +8583,7 @@ public Builder setSecondaryConfig(com.google.cloud.alloydb.v1.Cluster.SecondaryC } else { secondaryConfigBuilder_.setMessage(value); } - bitField0_ |= 0x00200000; + bitField0_ |= 0x00800000; onChanged(); return this; } @@ -7985,7 +8603,7 @@ public Builder setSecondaryConfig( } else { secondaryConfigBuilder_.setMessage(builderForValue.build()); } - bitField0_ |= 0x00200000; + bitField0_ |= 0x00800000; onChanged(); return this; } @@ -8000,7 +8618,7 @@ public Builder setSecondaryConfig( */ public Builder mergeSecondaryConfig(com.google.cloud.alloydb.v1.Cluster.SecondaryConfig value) { if (secondaryConfigBuilder_ == null) { - if (((bitField0_ & 0x00200000) != 0) + if (((bitField0_ & 0x00800000) != 0) && secondaryConfig_ != null && secondaryConfig_ != com.google.cloud.alloydb.v1.Cluster.SecondaryConfig.getDefaultInstance()) { @@ -8011,7 +8629,7 @@ public Builder mergeSecondaryConfig(com.google.cloud.alloydb.v1.Cluster.Secondar } else { secondaryConfigBuilder_.mergeFrom(value); } - bitField0_ |= 0x00200000; + bitField0_ |= 0x00800000; onChanged(); return this; } @@ -8025,7 +8643,7 @@ public Builder mergeSecondaryConfig(com.google.cloud.alloydb.v1.Cluster.Secondar * .google.cloud.alloydb.v1.Cluster.SecondaryConfig secondary_config = 22; */ public Builder clearSecondaryConfig() { - bitField0_ = (bitField0_ & ~0x00200000); + bitField0_ = (bitField0_ & ~0x00800000); secondaryConfig_ = null; if (secondaryConfigBuilder_ != null) { secondaryConfigBuilder_.dispose(); @@ -8044,7 +8662,7 @@ public Builder clearSecondaryConfig() { * .google.cloud.alloydb.v1.Cluster.SecondaryConfig secondary_config = 22; */ public com.google.cloud.alloydb.v1.Cluster.SecondaryConfig.Builder getSecondaryConfigBuilder() { - bitField0_ |= 0x00200000; + bitField0_ |= 0x00800000; onChanged(); return getSecondaryConfigFieldBuilder().getBuilder(); } @@ -8113,7 +8731,7 @@ public com.google.cloud.alloydb.v1.Cluster.SecondaryConfig.Builder getSecondaryC * @return Whether the primaryConfig field is set. */ public boolean hasPrimaryConfig() { - return ((bitField0_ & 0x00400000) != 0); + return ((bitField0_ & 0x01000000) != 0); } /** * @@ -8157,7 +8775,7 @@ public Builder setPrimaryConfig(com.google.cloud.alloydb.v1.Cluster.PrimaryConfi } else { primaryConfigBuilder_.setMessage(value); } - bitField0_ |= 0x00400000; + bitField0_ |= 0x01000000; onChanged(); return this; } @@ -8179,7 +8797,7 @@ public Builder setPrimaryConfig( } else { primaryConfigBuilder_.setMessage(builderForValue.build()); } - bitField0_ |= 0x00400000; + bitField0_ |= 0x01000000; onChanged(); return this; } @@ -8196,7 +8814,7 @@ public Builder setPrimaryConfig( */ public Builder mergePrimaryConfig(com.google.cloud.alloydb.v1.Cluster.PrimaryConfig value) { if (primaryConfigBuilder_ == null) { - if (((bitField0_ & 0x00400000) != 0) + if (((bitField0_ & 0x01000000) != 0) && primaryConfig_ != null && primaryConfig_ != com.google.cloud.alloydb.v1.Cluster.PrimaryConfig.getDefaultInstance()) { @@ -8207,7 +8825,7 @@ public Builder mergePrimaryConfig(com.google.cloud.alloydb.v1.Cluster.PrimaryCon } else { primaryConfigBuilder_.mergeFrom(value); } - bitField0_ |= 0x00400000; + bitField0_ |= 0x01000000; onChanged(); return this; } @@ -8223,7 +8841,7 @@ public Builder mergePrimaryConfig(com.google.cloud.alloydb.v1.Cluster.PrimaryCon *
*/ public Builder clearPrimaryConfig() { - bitField0_ = (bitField0_ & ~0x00400000); + bitField0_ = (bitField0_ & ~0x01000000); primaryConfig_ = null; if (primaryConfigBuilder_ != null) { primaryConfigBuilder_.dispose(); @@ -8244,7 +8862,7 @@ public Builder clearPrimaryConfig() { *
*/ public com.google.cloud.alloydb.v1.Cluster.PrimaryConfig.Builder getPrimaryConfigBuilder() { - bitField0_ |= 0x00400000; + bitField0_ |= 0x01000000; onChanged(); return getPrimaryConfigFieldBuilder().getBuilder(); } diff --git a/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/ClusterOrBuilder.java b/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/ClusterOrBuilder.java index 84b88942e6d0..2f264471359f 100644 --- a/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/ClusterOrBuilder.java +++ b/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/ClusterOrBuilder.java @@ -709,35 +709,42 @@ java.lang.String getAnnotationsOrDefault( * * *
-   * SSL configuration for this AlloyDB Cluster.
+   * SSL configuration for this AlloyDB cluster.
    * 
* - * .google.cloud.alloydb.v1.SslConfig ssl_config = 18; + * .google.cloud.alloydb.v1.SslConfig ssl_config = 18 [deprecated = true]; * + * @deprecated google.cloud.alloydb.v1.Cluster.ssl_config is deprecated. See + * google/cloud/alloydb/v1/resources.proto;l=550 * @return Whether the sslConfig field is set. */ + @java.lang.Deprecated boolean hasSslConfig(); /** * * *
-   * SSL configuration for this AlloyDB Cluster.
+   * SSL configuration for this AlloyDB cluster.
    * 
* - * .google.cloud.alloydb.v1.SslConfig ssl_config = 18; + * .google.cloud.alloydb.v1.SslConfig ssl_config = 18 [deprecated = true]; * + * @deprecated google.cloud.alloydb.v1.Cluster.ssl_config is deprecated. See + * google/cloud/alloydb/v1/resources.proto;l=550 * @return The sslConfig. */ + @java.lang.Deprecated com.google.cloud.alloydb.v1.SslConfig getSslConfig(); /** * * *
-   * SSL configuration for this AlloyDB Cluster.
+   * SSL configuration for this AlloyDB cluster.
    * 
* - * .google.cloud.alloydb.v1.SslConfig ssl_config = 18; + * .google.cloud.alloydb.v1.SslConfig ssl_config = 18 [deprecated = true]; */ + @java.lang.Deprecated com.google.cloud.alloydb.v1.SslConfigOrBuilder getSslConfigOrBuilder(); /** @@ -834,6 +841,88 @@ java.lang.String getAnnotationsOrDefault( */ com.google.cloud.alloydb.v1.EncryptionInfoOrBuilder getEncryptionInfoOrBuilder(); + /** + * + * + *
+   * Optional. Continuous backup configuration for this cluster.
+   * 
+ * + * + * .google.cloud.alloydb.v1.ContinuousBackupConfig continuous_backup_config = 27 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the continuousBackupConfig field is set. + */ + boolean hasContinuousBackupConfig(); + /** + * + * + *
+   * Optional. Continuous backup configuration for this cluster.
+   * 
+ * + * + * .google.cloud.alloydb.v1.ContinuousBackupConfig continuous_backup_config = 27 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The continuousBackupConfig. + */ + com.google.cloud.alloydb.v1.ContinuousBackupConfig getContinuousBackupConfig(); + /** + * + * + *
+   * Optional. Continuous backup configuration for this cluster.
+   * 
+ * + * + * .google.cloud.alloydb.v1.ContinuousBackupConfig continuous_backup_config = 27 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.cloud.alloydb.v1.ContinuousBackupConfigOrBuilder getContinuousBackupConfigOrBuilder(); + + /** + * + * + *
+   * Output only. Continuous backup properties for this cluster.
+   * 
+ * + * + * .google.cloud.alloydb.v1.ContinuousBackupInfo continuous_backup_info = 28 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the continuousBackupInfo field is set. + */ + boolean hasContinuousBackupInfo(); + /** + * + * + *
+   * Output only. Continuous backup properties for this cluster.
+   * 
+ * + * + * .google.cloud.alloydb.v1.ContinuousBackupInfo continuous_backup_info = 28 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The continuousBackupInfo. + */ + com.google.cloud.alloydb.v1.ContinuousBackupInfo getContinuousBackupInfo(); + /** + * + * + *
+   * Output only. Continuous backup properties for this cluster.
+   * 
+ * + * + * .google.cloud.alloydb.v1.ContinuousBackupInfo continuous_backup_info = 28 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.cloud.alloydb.v1.ContinuousBackupInfoOrBuilder getContinuousBackupInfoOrBuilder(); + /** * * diff --git a/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/ClusterView.java b/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/ClusterView.java new file mode 100644 index 000000000000..540dfbc28ebf --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/ClusterView.java @@ -0,0 +1,185 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/alloydb/v1/resources.proto + +package com.google.cloud.alloydb.v1; + +/** + * + * + *
+ * View on Cluster. Pass this enum to rpcs that returns a cluster message to
+ * control which subsets of fields to get.
+ * 
+ * + * Protobuf enum {@code google.cloud.alloydb.v1.ClusterView} + */ +public enum ClusterView implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+   * CLUSTER_VIEW_UNSPECIFIED Not specified, equivalent to BASIC.
+   * 
+ * + * CLUSTER_VIEW_UNSPECIFIED = 0; + */ + 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.
+   * 
+ * + * CLUSTER_VIEW_BASIC = 1; + */ + 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.
+   * 
+ * + * CLUSTER_VIEW_CONTINUOUS_BACKUP = 2; + */ + CLUSTER_VIEW_CONTINUOUS_BACKUP(2), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+   * CLUSTER_VIEW_UNSPECIFIED Not specified, equivalent to BASIC.
+   * 
+ * + * CLUSTER_VIEW_UNSPECIFIED = 0; + */ + public static final int CLUSTER_VIEW_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+   * BASIC server responses include all the relevant cluster details, excluding
+   * Cluster.ContinuousBackupInfo.EarliestRestorableTime and other view-specific
+   * fields. The default value.
+   * 
+ * + * CLUSTER_VIEW_BASIC = 1; + */ + public static final int CLUSTER_VIEW_BASIC_VALUE = 1; + /** + * + * + *
+   * CONTINUOUS_BACKUP response returns all the fields from BASIC plus
+   * the earliest restorable time if continuous backups are enabled.
+   * May increase latency.
+   * 
+ * + * CLUSTER_VIEW_CONTINUOUS_BACKUP = 2; + */ + public static final int CLUSTER_VIEW_CONTINUOUS_BACKUP_VALUE = 2; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static ClusterView valueOf(int value) { + return forNumber(value); + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + */ + public static ClusterView forNumber(int value) { + switch (value) { + case 0: + return CLUSTER_VIEW_UNSPECIFIED; + case 1: + return CLUSTER_VIEW_BASIC; + case 2: + return CLUSTER_VIEW_CONTINUOUS_BACKUP; + default: + return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap internalGetValueMap() { + return internalValueMap; + } + + private static final com.google.protobuf.Internal.EnumLiteMap internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public ClusterView findValueByNumber(int number) { + return ClusterView.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + return getDescriptor().getValues().get(ordinal()); + } + + public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { + return getDescriptor(); + } + + public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.cloud.alloydb.v1.ResourcesProto.getDescriptor().getEnumTypes().get(1); + } + + private static final ClusterView[] VALUES = values(); + + public static ClusterView valueOf(com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException("EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private ClusterView(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.alloydb.v1.ClusterView) +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/ContinuousBackupConfig.java b/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/ContinuousBackupConfig.java new file mode 100644 index 000000000000..24106e4e4ff6 --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/ContinuousBackupConfig.java @@ -0,0 +1,980 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/alloydb/v1/resources.proto + +package com.google.cloud.alloydb.v1; + +/** + * + * + *
+ * ContinuousBackupConfig describes the continuous backups recovery
+ * configurations of a cluster.
+ * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1.ContinuousBackupConfig} + */ +public final class ContinuousBackupConfig extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.alloydb.v1.ContinuousBackupConfig) + ContinuousBackupConfigOrBuilder { + private static final long serialVersionUID = 0L; + // Use ContinuousBackupConfig.newBuilder() to construct. + private ContinuousBackupConfig(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ContinuousBackupConfig() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ContinuousBackupConfig(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.alloydb.v1.ResourcesProto + .internal_static_google_cloud_alloydb_v1_ContinuousBackupConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1.ResourcesProto + .internal_static_google_cloud_alloydb_v1_ContinuousBackupConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1.ContinuousBackupConfig.class, + com.google.cloud.alloydb.v1.ContinuousBackupConfig.Builder.class); + } + + private int bitField0_; + public static final int ENABLED_FIELD_NUMBER = 1; + private boolean enabled_ = false; + /** + * + * + *
+   * Whether ContinuousBackup is enabled.
+   * 
+ * + * optional bool enabled = 1; + * + * @return Whether the enabled field is set. + */ + @java.lang.Override + public boolean hasEnabled() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+   * Whether ContinuousBackup is enabled.
+   * 
+ * + * optional bool enabled = 1; + * + * @return The enabled. + */ + @java.lang.Override + public boolean getEnabled() { + return enabled_; + } + + public static final int RECOVERY_WINDOW_DAYS_FIELD_NUMBER = 4; + private int recoveryWindowDays_ = 0; + /** + * + * + *
+   * The number of days backups and logs will be retained, which determines the
+   * window of time that data is recoverable for. If not set, it defaults to 14
+   * days.
+   * 
+ * + * int32 recovery_window_days = 4; + * + * @return The recoveryWindowDays. + */ + @java.lang.Override + public int getRecoveryWindowDays() { + return recoveryWindowDays_; + } + + public static final int ENCRYPTION_CONFIG_FIELD_NUMBER = 3; + private com.google.cloud.alloydb.v1.EncryptionConfig encryptionConfig_; + /** + * + * + *
+   * 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.
+   * 
+ * + * .google.cloud.alloydb.v1.EncryptionConfig encryption_config = 3; + * + * @return Whether the encryptionConfig field is set. + */ + @java.lang.Override + public boolean hasEncryptionConfig() { + return encryptionConfig_ != null; + } + /** + * + * + *
+   * 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.
+   * 
+ * + * .google.cloud.alloydb.v1.EncryptionConfig encryption_config = 3; + * + * @return The encryptionConfig. + */ + @java.lang.Override + public com.google.cloud.alloydb.v1.EncryptionConfig getEncryptionConfig() { + return encryptionConfig_ == null + ? com.google.cloud.alloydb.v1.EncryptionConfig.getDefaultInstance() + : encryptionConfig_; + } + /** + * + * + *
+   * 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.
+   * 
+ * + * .google.cloud.alloydb.v1.EncryptionConfig encryption_config = 3; + */ + @java.lang.Override + public com.google.cloud.alloydb.v1.EncryptionConfigOrBuilder getEncryptionConfigOrBuilder() { + return encryptionConfig_ == null + ? com.google.cloud.alloydb.v1.EncryptionConfig.getDefaultInstance() + : encryptionConfig_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (((bitField0_ & 0x00000001) != 0)) { + output.writeBool(1, enabled_); + } + if (encryptionConfig_ != null) { + output.writeMessage(3, getEncryptionConfig()); + } + if (recoveryWindowDays_ != 0) { + output.writeInt32(4, recoveryWindowDays_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(1, enabled_); + } + if (encryptionConfig_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getEncryptionConfig()); + } + if (recoveryWindowDays_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(4, recoveryWindowDays_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.alloydb.v1.ContinuousBackupConfig)) { + return super.equals(obj); + } + com.google.cloud.alloydb.v1.ContinuousBackupConfig other = + (com.google.cloud.alloydb.v1.ContinuousBackupConfig) obj; + + if (hasEnabled() != other.hasEnabled()) return false; + if (hasEnabled()) { + if (getEnabled() != other.getEnabled()) return false; + } + if (getRecoveryWindowDays() != other.getRecoveryWindowDays()) return false; + if (hasEncryptionConfig() != other.hasEncryptionConfig()) return false; + if (hasEncryptionConfig()) { + if (!getEncryptionConfig().equals(other.getEncryptionConfig())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasEnabled()) { + hash = (37 * hash) + ENABLED_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getEnabled()); + } + hash = (37 * hash) + RECOVERY_WINDOW_DAYS_FIELD_NUMBER; + hash = (53 * hash) + getRecoveryWindowDays(); + if (hasEncryptionConfig()) { + hash = (37 * hash) + ENCRYPTION_CONFIG_FIELD_NUMBER; + hash = (53 * hash) + getEncryptionConfig().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.alloydb.v1.ContinuousBackupConfig parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1.ContinuousBackupConfig parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.alloydb.v1.ContinuousBackupConfig parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1.ContinuousBackupConfig parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.alloydb.v1.ContinuousBackupConfig parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1.ContinuousBackupConfig parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.alloydb.v1.ContinuousBackupConfig parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1.ContinuousBackupConfig parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.alloydb.v1.ContinuousBackupConfig parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1.ContinuousBackupConfig parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.alloydb.v1.ContinuousBackupConfig parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1.ContinuousBackupConfig parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.alloydb.v1.ContinuousBackupConfig prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * ContinuousBackupConfig describes the continuous backups recovery
+   * configurations of a cluster.
+   * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1.ContinuousBackupConfig} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.alloydb.v1.ContinuousBackupConfig) + com.google.cloud.alloydb.v1.ContinuousBackupConfigOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.alloydb.v1.ResourcesProto + .internal_static_google_cloud_alloydb_v1_ContinuousBackupConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1.ResourcesProto + .internal_static_google_cloud_alloydb_v1_ContinuousBackupConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1.ContinuousBackupConfig.class, + com.google.cloud.alloydb.v1.ContinuousBackupConfig.Builder.class); + } + + // Construct using com.google.cloud.alloydb.v1.ContinuousBackupConfig.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + enabled_ = false; + recoveryWindowDays_ = 0; + encryptionConfig_ = null; + if (encryptionConfigBuilder_ != null) { + encryptionConfigBuilder_.dispose(); + encryptionConfigBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.alloydb.v1.ResourcesProto + .internal_static_google_cloud_alloydb_v1_ContinuousBackupConfig_descriptor; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1.ContinuousBackupConfig getDefaultInstanceForType() { + return com.google.cloud.alloydb.v1.ContinuousBackupConfig.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.alloydb.v1.ContinuousBackupConfig build() { + com.google.cloud.alloydb.v1.ContinuousBackupConfig result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1.ContinuousBackupConfig buildPartial() { + com.google.cloud.alloydb.v1.ContinuousBackupConfig result = + new com.google.cloud.alloydb.v1.ContinuousBackupConfig(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.alloydb.v1.ContinuousBackupConfig result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.enabled_ = enabled_; + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.recoveryWindowDays_ = recoveryWindowDays_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.encryptionConfig_ = + encryptionConfigBuilder_ == null ? encryptionConfig_ : encryptionConfigBuilder_.build(); + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.alloydb.v1.ContinuousBackupConfig) { + return mergeFrom((com.google.cloud.alloydb.v1.ContinuousBackupConfig) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.alloydb.v1.ContinuousBackupConfig other) { + if (other == com.google.cloud.alloydb.v1.ContinuousBackupConfig.getDefaultInstance()) + return this; + if (other.hasEnabled()) { + setEnabled(other.getEnabled()); + } + if (other.getRecoveryWindowDays() != 0) { + setRecoveryWindowDays(other.getRecoveryWindowDays()); + } + if (other.hasEncryptionConfig()) { + mergeEncryptionConfig(other.getEncryptionConfig()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: + { + enabled_ = input.readBool(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 26: + { + input.readMessage( + getEncryptionConfigFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 32: + { + recoveryWindowDays_ = input.readInt32(); + bitField0_ |= 0x00000002; + break; + } // case 32 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private boolean enabled_; + /** + * + * + *
+     * Whether ContinuousBackup is enabled.
+     * 
+ * + * optional bool enabled = 1; + * + * @return Whether the enabled field is set. + */ + @java.lang.Override + public boolean hasEnabled() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+     * Whether ContinuousBackup is enabled.
+     * 
+ * + * optional bool enabled = 1; + * + * @return The enabled. + */ + @java.lang.Override + public boolean getEnabled() { + return enabled_; + } + /** + * + * + *
+     * Whether ContinuousBackup is enabled.
+     * 
+ * + * optional bool enabled = 1; + * + * @param value The enabled to set. + * @return This builder for chaining. + */ + public Builder setEnabled(boolean value) { + + enabled_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Whether ContinuousBackup is enabled.
+     * 
+ * + * optional bool enabled = 1; + * + * @return This builder for chaining. + */ + public Builder clearEnabled() { + bitField0_ = (bitField0_ & ~0x00000001); + enabled_ = false; + onChanged(); + return this; + } + + private int recoveryWindowDays_; + /** + * + * + *
+     * The number of days backups and logs will be retained, which determines the
+     * window of time that data is recoverable for. If not set, it defaults to 14
+     * days.
+     * 
+ * + * int32 recovery_window_days = 4; + * + * @return The recoveryWindowDays. + */ + @java.lang.Override + public int getRecoveryWindowDays() { + return recoveryWindowDays_; + } + /** + * + * + *
+     * The number of days backups and logs will be retained, which determines the
+     * window of time that data is recoverable for. If not set, it defaults to 14
+     * days.
+     * 
+ * + * int32 recovery_window_days = 4; + * + * @param value The recoveryWindowDays to set. + * @return This builder for chaining. + */ + public Builder setRecoveryWindowDays(int value) { + + recoveryWindowDays_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * The number of days backups and logs will be retained, which determines the
+     * window of time that data is recoverable for. If not set, it defaults to 14
+     * days.
+     * 
+ * + * int32 recovery_window_days = 4; + * + * @return This builder for chaining. + */ + public Builder clearRecoveryWindowDays() { + bitField0_ = (bitField0_ & ~0x00000002); + recoveryWindowDays_ = 0; + onChanged(); + return this; + } + + private com.google.cloud.alloydb.v1.EncryptionConfig encryptionConfig_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1.EncryptionConfig, + com.google.cloud.alloydb.v1.EncryptionConfig.Builder, + com.google.cloud.alloydb.v1.EncryptionConfigOrBuilder> + encryptionConfigBuilder_; + /** + * + * + *
+     * 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.
+     * 
+ * + * .google.cloud.alloydb.v1.EncryptionConfig encryption_config = 3; + * + * @return Whether the encryptionConfig field is set. + */ + public boolean hasEncryptionConfig() { + return ((bitField0_ & 0x00000004) != 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.
+     * 
+ * + * .google.cloud.alloydb.v1.EncryptionConfig encryption_config = 3; + * + * @return The encryptionConfig. + */ + public com.google.cloud.alloydb.v1.EncryptionConfig getEncryptionConfig() { + if (encryptionConfigBuilder_ == null) { + return encryptionConfig_ == null + ? com.google.cloud.alloydb.v1.EncryptionConfig.getDefaultInstance() + : encryptionConfig_; + } else { + return encryptionConfigBuilder_.getMessage(); + } + } + /** + * + * + *
+     * 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.
+     * 
+ * + * .google.cloud.alloydb.v1.EncryptionConfig encryption_config = 3; + */ + public Builder setEncryptionConfig(com.google.cloud.alloydb.v1.EncryptionConfig value) { + if (encryptionConfigBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + encryptionConfig_ = value; + } else { + encryptionConfigBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + onChanged(); + 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.
+     * 
+ * + * .google.cloud.alloydb.v1.EncryptionConfig encryption_config = 3; + */ + public Builder setEncryptionConfig( + com.google.cloud.alloydb.v1.EncryptionConfig.Builder builderForValue) { + if (encryptionConfigBuilder_ == null) { + encryptionConfig_ = builderForValue.build(); + } else { + encryptionConfigBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + onChanged(); + 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.
+     * 
+ * + * .google.cloud.alloydb.v1.EncryptionConfig encryption_config = 3; + */ + public Builder mergeEncryptionConfig(com.google.cloud.alloydb.v1.EncryptionConfig value) { + if (encryptionConfigBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) + && encryptionConfig_ != null + && encryptionConfig_ + != com.google.cloud.alloydb.v1.EncryptionConfig.getDefaultInstance()) { + getEncryptionConfigBuilder().mergeFrom(value); + } else { + encryptionConfig_ = value; + } + } else { + encryptionConfigBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000004; + onChanged(); + 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.
+     * 
+ * + * .google.cloud.alloydb.v1.EncryptionConfig encryption_config = 3; + */ + public Builder clearEncryptionConfig() { + bitField0_ = (bitField0_ & ~0x00000004); + encryptionConfig_ = null; + if (encryptionConfigBuilder_ != null) { + encryptionConfigBuilder_.dispose(); + encryptionConfigBuilder_ = null; + } + onChanged(); + 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.
+     * 
+ * + * .google.cloud.alloydb.v1.EncryptionConfig encryption_config = 3; + */ + public com.google.cloud.alloydb.v1.EncryptionConfig.Builder getEncryptionConfigBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return getEncryptionConfigFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * 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.
+     * 
+ * + * .google.cloud.alloydb.v1.EncryptionConfig encryption_config = 3; + */ + public com.google.cloud.alloydb.v1.EncryptionConfigOrBuilder getEncryptionConfigOrBuilder() { + if (encryptionConfigBuilder_ != null) { + return encryptionConfigBuilder_.getMessageOrBuilder(); + } else { + return encryptionConfig_ == null + ? com.google.cloud.alloydb.v1.EncryptionConfig.getDefaultInstance() + : encryptionConfig_; + } + } + /** + * + * + *
+     * 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.
+     * 
+ * + * .google.cloud.alloydb.v1.EncryptionConfig encryption_config = 3; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1.EncryptionConfig, + com.google.cloud.alloydb.v1.EncryptionConfig.Builder, + com.google.cloud.alloydb.v1.EncryptionConfigOrBuilder> + getEncryptionConfigFieldBuilder() { + if (encryptionConfigBuilder_ == null) { + encryptionConfigBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1.EncryptionConfig, + com.google.cloud.alloydb.v1.EncryptionConfig.Builder, + com.google.cloud.alloydb.v1.EncryptionConfigOrBuilder>( + getEncryptionConfig(), getParentForChildren(), isClean()); + encryptionConfig_ = null; + } + return encryptionConfigBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.alloydb.v1.ContinuousBackupConfig) + } + + // @@protoc_insertion_point(class_scope:google.cloud.alloydb.v1.ContinuousBackupConfig) + private static final com.google.cloud.alloydb.v1.ContinuousBackupConfig DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.alloydb.v1.ContinuousBackupConfig(); + } + + public static com.google.cloud.alloydb.v1.ContinuousBackupConfig getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ContinuousBackupConfig parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1.ContinuousBackupConfig getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/ContinuousBackupConfigOrBuilder.java b/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/ContinuousBackupConfigOrBuilder.java new file mode 100644 index 000000000000..bdacd2a62ae7 --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/ContinuousBackupConfigOrBuilder.java @@ -0,0 +1,109 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/alloydb/v1/resources.proto + +package com.google.cloud.alloydb.v1; + +public interface ContinuousBackupConfigOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.alloydb.v1.ContinuousBackupConfig) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Whether ContinuousBackup is enabled.
+   * 
+ * + * optional bool enabled = 1; + * + * @return Whether the enabled field is set. + */ + boolean hasEnabled(); + /** + * + * + *
+   * Whether ContinuousBackup is enabled.
+   * 
+ * + * optional bool enabled = 1; + * + * @return The enabled. + */ + boolean getEnabled(); + + /** + * + * + *
+   * The number of days backups and logs will be retained, which determines the
+   * window of time that data is recoverable for. If not set, it defaults to 14
+   * days.
+   * 
+ * + * int32 recovery_window_days = 4; + * + * @return The recoveryWindowDays. + */ + int getRecoveryWindowDays(); + + /** + * + * + *
+   * 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.
+   * 
+ * + * .google.cloud.alloydb.v1.EncryptionConfig encryption_config = 3; + * + * @return Whether the encryptionConfig field is set. + */ + boolean hasEncryptionConfig(); + /** + * + * + *
+   * 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.
+   * 
+ * + * .google.cloud.alloydb.v1.EncryptionConfig encryption_config = 3; + * + * @return The encryptionConfig. + */ + com.google.cloud.alloydb.v1.EncryptionConfig getEncryptionConfig(); + /** + * + * + *
+   * 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.
+   * 
+ * + * .google.cloud.alloydb.v1.EncryptionConfig encryption_config = 3; + */ + com.google.cloud.alloydb.v1.EncryptionConfigOrBuilder getEncryptionConfigOrBuilder(); +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/ContinuousBackupInfo.java b/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/ContinuousBackupInfo.java new file mode 100644 index 000000000000..57d4003e83d9 --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/ContinuousBackupInfo.java @@ -0,0 +1,1779 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/alloydb/v1/resources.proto + +package com.google.cloud.alloydb.v1; + +/** + * + * + *
+ * ContinuousBackupInfo describes the continuous backup properties of a
+ * cluster.
+ * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1.ContinuousBackupInfo} + */ +public final class ContinuousBackupInfo extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.alloydb.v1.ContinuousBackupInfo) + ContinuousBackupInfoOrBuilder { + private static final long serialVersionUID = 0L; + // Use ContinuousBackupInfo.newBuilder() to construct. + private ContinuousBackupInfo(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ContinuousBackupInfo() { + schedule_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ContinuousBackupInfo(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.alloydb.v1.ResourcesProto + .internal_static_google_cloud_alloydb_v1_ContinuousBackupInfo_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1.ResourcesProto + .internal_static_google_cloud_alloydb_v1_ContinuousBackupInfo_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1.ContinuousBackupInfo.class, + com.google.cloud.alloydb.v1.ContinuousBackupInfo.Builder.class); + } + + public static final int ENCRYPTION_INFO_FIELD_NUMBER = 1; + private com.google.cloud.alloydb.v1.EncryptionInfo encryptionInfo_; + /** + * + * + *
+   * Output only. The encryption information for the WALs and backups required
+   * for ContinuousBackup.
+   * 
+ * + * + * .google.cloud.alloydb.v1.EncryptionInfo encryption_info = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the encryptionInfo field is set. + */ + @java.lang.Override + public boolean hasEncryptionInfo() { + return encryptionInfo_ != null; + } + /** + * + * + *
+   * Output only. The encryption information for the WALs and backups required
+   * for ContinuousBackup.
+   * 
+ * + * + * .google.cloud.alloydb.v1.EncryptionInfo encryption_info = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The encryptionInfo. + */ + @java.lang.Override + public com.google.cloud.alloydb.v1.EncryptionInfo getEncryptionInfo() { + return encryptionInfo_ == null + ? com.google.cloud.alloydb.v1.EncryptionInfo.getDefaultInstance() + : encryptionInfo_; + } + /** + * + * + *
+   * Output only. The encryption information for the WALs and backups required
+   * for ContinuousBackup.
+   * 
+ * + * + * .google.cloud.alloydb.v1.EncryptionInfo encryption_info = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.cloud.alloydb.v1.EncryptionInfoOrBuilder getEncryptionInfoOrBuilder() { + return encryptionInfo_ == null + ? com.google.cloud.alloydb.v1.EncryptionInfo.getDefaultInstance() + : encryptionInfo_; + } + + public static final int ENABLED_TIME_FIELD_NUMBER = 2; + private com.google.protobuf.Timestamp enabledTime_; + /** + * + * + *
+   * Output only. When ContinuousBackup was most recently enabled. Set to null
+   * if ContinuousBackup is not enabled.
+   * 
+ * + * .google.protobuf.Timestamp enabled_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the enabledTime field is set. + */ + @java.lang.Override + public boolean hasEnabledTime() { + return enabledTime_ != null; + } + /** + * + * + *
+   * Output only. When ContinuousBackup was most recently enabled. Set to null
+   * if ContinuousBackup is not enabled.
+   * 
+ * + * .google.protobuf.Timestamp enabled_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enabledTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getEnabledTime() { + return enabledTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : enabledTime_; + } + /** + * + * + *
+   * Output only. When ContinuousBackup was most recently enabled. Set to null
+   * if ContinuousBackup is not enabled.
+   * 
+ * + * .google.protobuf.Timestamp enabled_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getEnabledTimeOrBuilder() { + return enabledTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : enabledTime_; + } + + public static final int SCHEDULE_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private java.util.List schedule_; + + private static final com.google.protobuf.Internal.ListAdapter.Converter< + java.lang.Integer, com.google.type.DayOfWeek> + schedule_converter_ = + new com.google.protobuf.Internal.ListAdapter.Converter< + java.lang.Integer, com.google.type.DayOfWeek>() { + public com.google.type.DayOfWeek convert(java.lang.Integer from) { + com.google.type.DayOfWeek result = com.google.type.DayOfWeek.forNumber(from); + return result == null ? com.google.type.DayOfWeek.UNRECOGNIZED : result; + } + }; + /** + * + * + *
+   * Output only. Days of the week on which a continuous backup is taken. Output
+   * only field. Ignored if passed into the request.
+   * 
+ * + * + * repeated .google.type.DayOfWeek schedule = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return A list containing the schedule. + */ + @java.lang.Override + public java.util.List getScheduleList() { + return new com.google.protobuf.Internal.ListAdapter< + java.lang.Integer, com.google.type.DayOfWeek>(schedule_, schedule_converter_); + } + /** + * + * + *
+   * Output only. Days of the week on which a continuous backup is taken. Output
+   * only field. Ignored if passed into the request.
+   * 
+ * + * + * repeated .google.type.DayOfWeek schedule = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The count of schedule. + */ + @java.lang.Override + public int getScheduleCount() { + return schedule_.size(); + } + /** + * + * + *
+   * Output only. Days of the week on which a continuous backup is taken. Output
+   * only field. Ignored if passed into the request.
+   * 
+ * + * + * repeated .google.type.DayOfWeek schedule = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param index The index of the element to return. + * @return The schedule at the given index. + */ + @java.lang.Override + public com.google.type.DayOfWeek getSchedule(int index) { + return schedule_converter_.convert(schedule_.get(index)); + } + /** + * + * + *
+   * Output only. Days of the week on which a continuous backup is taken. Output
+   * only field. Ignored if passed into the request.
+   * 
+ * + * + * repeated .google.type.DayOfWeek schedule = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return A list containing the enum numeric values on the wire for schedule. + */ + @java.lang.Override + public java.util.List getScheduleValueList() { + return schedule_; + } + /** + * + * + *
+   * Output only. Days of the week on which a continuous backup is taken. Output
+   * only field. Ignored if passed into the request.
+   * 
+ * + * + * repeated .google.type.DayOfWeek schedule = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param index The index of the value to return. + * @return The enum numeric value on the wire of schedule at the given index. + */ + @java.lang.Override + public int getScheduleValue(int index) { + return schedule_.get(index); + } + + private int scheduleMemoizedSerializedSize; + + public static final int EARLIEST_RESTORABLE_TIME_FIELD_NUMBER = 4; + private com.google.protobuf.Timestamp earliestRestorableTime_; + /** + * + * + *
+   * Output only. The earliest restorable time that can be restored to. Output
+   * only field.
+   * 
+ * + * + * .google.protobuf.Timestamp earliest_restorable_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the earliestRestorableTime field is set. + */ + @java.lang.Override + public boolean hasEarliestRestorableTime() { + return earliestRestorableTime_ != null; + } + /** + * + * + *
+   * Output only. The earliest restorable time that can be restored to. Output
+   * only field.
+   * 
+ * + * + * .google.protobuf.Timestamp earliest_restorable_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The earliestRestorableTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getEarliestRestorableTime() { + return earliestRestorableTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : earliestRestorableTime_; + } + /** + * + * + *
+   * Output only. The earliest restorable time that can be restored to. Output
+   * only field.
+   * 
+ * + * + * .google.protobuf.Timestamp earliest_restorable_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getEarliestRestorableTimeOrBuilder() { + return earliestRestorableTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : earliestRestorableTime_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + getSerializedSize(); + if (encryptionInfo_ != null) { + output.writeMessage(1, getEncryptionInfo()); + } + if (enabledTime_ != null) { + output.writeMessage(2, getEnabledTime()); + } + if (getScheduleList().size() > 0) { + output.writeUInt32NoTag(26); + output.writeUInt32NoTag(scheduleMemoizedSerializedSize); + } + for (int i = 0; i < schedule_.size(); i++) { + output.writeEnumNoTag(schedule_.get(i)); + } + if (earliestRestorableTime_ != null) { + output.writeMessage(4, getEarliestRestorableTime()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (encryptionInfo_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getEncryptionInfo()); + } + if (enabledTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getEnabledTime()); + } + { + int dataSize = 0; + for (int i = 0; i < schedule_.size(); i++) { + dataSize += com.google.protobuf.CodedOutputStream.computeEnumSizeNoTag(schedule_.get(i)); + } + size += dataSize; + if (!getScheduleList().isEmpty()) { + size += 1; + size += com.google.protobuf.CodedOutputStream.computeUInt32SizeNoTag(dataSize); + } + scheduleMemoizedSerializedSize = dataSize; + } + if (earliestRestorableTime_ != null) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize(4, getEarliestRestorableTime()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.alloydb.v1.ContinuousBackupInfo)) { + return super.equals(obj); + } + com.google.cloud.alloydb.v1.ContinuousBackupInfo other = + (com.google.cloud.alloydb.v1.ContinuousBackupInfo) obj; + + if (hasEncryptionInfo() != other.hasEncryptionInfo()) return false; + if (hasEncryptionInfo()) { + if (!getEncryptionInfo().equals(other.getEncryptionInfo())) return false; + } + if (hasEnabledTime() != other.hasEnabledTime()) return false; + if (hasEnabledTime()) { + if (!getEnabledTime().equals(other.getEnabledTime())) return false; + } + if (!schedule_.equals(other.schedule_)) return false; + if (hasEarliestRestorableTime() != other.hasEarliestRestorableTime()) return false; + if (hasEarliestRestorableTime()) { + if (!getEarliestRestorableTime().equals(other.getEarliestRestorableTime())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasEncryptionInfo()) { + hash = (37 * hash) + ENCRYPTION_INFO_FIELD_NUMBER; + hash = (53 * hash) + getEncryptionInfo().hashCode(); + } + if (hasEnabledTime()) { + hash = (37 * hash) + ENABLED_TIME_FIELD_NUMBER; + hash = (53 * hash) + getEnabledTime().hashCode(); + } + if (getScheduleCount() > 0) { + hash = (37 * hash) + SCHEDULE_FIELD_NUMBER; + hash = (53 * hash) + schedule_.hashCode(); + } + if (hasEarliestRestorableTime()) { + hash = (37 * hash) + EARLIEST_RESTORABLE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getEarliestRestorableTime().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.alloydb.v1.ContinuousBackupInfo parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1.ContinuousBackupInfo parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.alloydb.v1.ContinuousBackupInfo parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1.ContinuousBackupInfo parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.alloydb.v1.ContinuousBackupInfo parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1.ContinuousBackupInfo parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.alloydb.v1.ContinuousBackupInfo parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1.ContinuousBackupInfo parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.alloydb.v1.ContinuousBackupInfo parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1.ContinuousBackupInfo parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.alloydb.v1.ContinuousBackupInfo parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1.ContinuousBackupInfo parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.alloydb.v1.ContinuousBackupInfo prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * ContinuousBackupInfo describes the continuous backup properties of a
+   * cluster.
+   * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1.ContinuousBackupInfo} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.alloydb.v1.ContinuousBackupInfo) + com.google.cloud.alloydb.v1.ContinuousBackupInfoOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.alloydb.v1.ResourcesProto + .internal_static_google_cloud_alloydb_v1_ContinuousBackupInfo_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1.ResourcesProto + .internal_static_google_cloud_alloydb_v1_ContinuousBackupInfo_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1.ContinuousBackupInfo.class, + com.google.cloud.alloydb.v1.ContinuousBackupInfo.Builder.class); + } + + // Construct using com.google.cloud.alloydb.v1.ContinuousBackupInfo.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + encryptionInfo_ = null; + if (encryptionInfoBuilder_ != null) { + encryptionInfoBuilder_.dispose(); + encryptionInfoBuilder_ = null; + } + enabledTime_ = null; + if (enabledTimeBuilder_ != null) { + enabledTimeBuilder_.dispose(); + enabledTimeBuilder_ = null; + } + schedule_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000004); + earliestRestorableTime_ = null; + if (earliestRestorableTimeBuilder_ != null) { + earliestRestorableTimeBuilder_.dispose(); + earliestRestorableTimeBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.alloydb.v1.ResourcesProto + .internal_static_google_cloud_alloydb_v1_ContinuousBackupInfo_descriptor; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1.ContinuousBackupInfo getDefaultInstanceForType() { + return com.google.cloud.alloydb.v1.ContinuousBackupInfo.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.alloydb.v1.ContinuousBackupInfo build() { + com.google.cloud.alloydb.v1.ContinuousBackupInfo result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1.ContinuousBackupInfo buildPartial() { + com.google.cloud.alloydb.v1.ContinuousBackupInfo result = + new com.google.cloud.alloydb.v1.ContinuousBackupInfo(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields( + com.google.cloud.alloydb.v1.ContinuousBackupInfo result) { + if (((bitField0_ & 0x00000004) != 0)) { + schedule_ = java.util.Collections.unmodifiableList(schedule_); + bitField0_ = (bitField0_ & ~0x00000004); + } + result.schedule_ = schedule_; + } + + private void buildPartial0(com.google.cloud.alloydb.v1.ContinuousBackupInfo result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.encryptionInfo_ = + encryptionInfoBuilder_ == null ? encryptionInfo_ : encryptionInfoBuilder_.build(); + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.enabledTime_ = + enabledTimeBuilder_ == null ? enabledTime_ : enabledTimeBuilder_.build(); + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.earliestRestorableTime_ = + earliestRestorableTimeBuilder_ == null + ? earliestRestorableTime_ + : earliestRestorableTimeBuilder_.build(); + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.alloydb.v1.ContinuousBackupInfo) { + return mergeFrom((com.google.cloud.alloydb.v1.ContinuousBackupInfo) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.alloydb.v1.ContinuousBackupInfo other) { + if (other == com.google.cloud.alloydb.v1.ContinuousBackupInfo.getDefaultInstance()) + return this; + if (other.hasEncryptionInfo()) { + mergeEncryptionInfo(other.getEncryptionInfo()); + } + if (other.hasEnabledTime()) { + mergeEnabledTime(other.getEnabledTime()); + } + if (!other.schedule_.isEmpty()) { + if (schedule_.isEmpty()) { + schedule_ = other.schedule_; + bitField0_ = (bitField0_ & ~0x00000004); + } else { + ensureScheduleIsMutable(); + schedule_.addAll(other.schedule_); + } + onChanged(); + } + if (other.hasEarliestRestorableTime()) { + mergeEarliestRestorableTime(other.getEarliestRestorableTime()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + input.readMessage(getEncryptionInfoFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + input.readMessage(getEnabledTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 24: + { + int tmpRaw = input.readEnum(); + ensureScheduleIsMutable(); + schedule_.add(tmpRaw); + break; + } // case 24 + case 26: + { + int length = input.readRawVarint32(); + int oldLimit = input.pushLimit(length); + while (input.getBytesUntilLimit() > 0) { + int tmpRaw = input.readEnum(); + ensureScheduleIsMutable(); + schedule_.add(tmpRaw); + } + input.popLimit(oldLimit); + break; + } // case 26 + case 34: + { + input.readMessage( + getEarliestRestorableTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000008; + break; + } // case 34 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private com.google.cloud.alloydb.v1.EncryptionInfo encryptionInfo_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1.EncryptionInfo, + com.google.cloud.alloydb.v1.EncryptionInfo.Builder, + com.google.cloud.alloydb.v1.EncryptionInfoOrBuilder> + encryptionInfoBuilder_; + /** + * + * + *
+     * Output only. The encryption information for the WALs and backups required
+     * for ContinuousBackup.
+     * 
+ * + * + * .google.cloud.alloydb.v1.EncryptionInfo encryption_info = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the encryptionInfo field is set. + */ + public boolean hasEncryptionInfo() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+     * Output only. The encryption information for the WALs and backups required
+     * for ContinuousBackup.
+     * 
+ * + * + * .google.cloud.alloydb.v1.EncryptionInfo encryption_info = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The encryptionInfo. + */ + public com.google.cloud.alloydb.v1.EncryptionInfo getEncryptionInfo() { + if (encryptionInfoBuilder_ == null) { + return encryptionInfo_ == null + ? com.google.cloud.alloydb.v1.EncryptionInfo.getDefaultInstance() + : encryptionInfo_; + } else { + return encryptionInfoBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Output only. The encryption information for the WALs and backups required
+     * for ContinuousBackup.
+     * 
+ * + * + * .google.cloud.alloydb.v1.EncryptionInfo encryption_info = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setEncryptionInfo(com.google.cloud.alloydb.v1.EncryptionInfo value) { + if (encryptionInfoBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + encryptionInfo_ = value; + } else { + encryptionInfoBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The encryption information for the WALs and backups required
+     * for ContinuousBackup.
+     * 
+ * + * + * .google.cloud.alloydb.v1.EncryptionInfo encryption_info = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setEncryptionInfo( + com.google.cloud.alloydb.v1.EncryptionInfo.Builder builderForValue) { + if (encryptionInfoBuilder_ == null) { + encryptionInfo_ = builderForValue.build(); + } else { + encryptionInfoBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The encryption information for the WALs and backups required
+     * for ContinuousBackup.
+     * 
+ * + * + * .google.cloud.alloydb.v1.EncryptionInfo encryption_info = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeEncryptionInfo(com.google.cloud.alloydb.v1.EncryptionInfo value) { + if (encryptionInfoBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && encryptionInfo_ != null + && encryptionInfo_ != com.google.cloud.alloydb.v1.EncryptionInfo.getDefaultInstance()) { + getEncryptionInfoBuilder().mergeFrom(value); + } else { + encryptionInfo_ = value; + } + } else { + encryptionInfoBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The encryption information for the WALs and backups required
+     * for ContinuousBackup.
+     * 
+ * + * + * .google.cloud.alloydb.v1.EncryptionInfo encryption_info = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearEncryptionInfo() { + bitField0_ = (bitField0_ & ~0x00000001); + encryptionInfo_ = null; + if (encryptionInfoBuilder_ != null) { + encryptionInfoBuilder_.dispose(); + encryptionInfoBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The encryption information for the WALs and backups required
+     * for ContinuousBackup.
+     * 
+ * + * + * .google.cloud.alloydb.v1.EncryptionInfo encryption_info = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.alloydb.v1.EncryptionInfo.Builder getEncryptionInfoBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return getEncryptionInfoFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. The encryption information for the WALs and backups required
+     * for ContinuousBackup.
+     * 
+ * + * + * .google.cloud.alloydb.v1.EncryptionInfo encryption_info = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.alloydb.v1.EncryptionInfoOrBuilder getEncryptionInfoOrBuilder() { + if (encryptionInfoBuilder_ != null) { + return encryptionInfoBuilder_.getMessageOrBuilder(); + } else { + return encryptionInfo_ == null + ? com.google.cloud.alloydb.v1.EncryptionInfo.getDefaultInstance() + : encryptionInfo_; + } + } + /** + * + * + *
+     * Output only. The encryption information for the WALs and backups required
+     * for ContinuousBackup.
+     * 
+ * + * + * .google.cloud.alloydb.v1.EncryptionInfo encryption_info = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1.EncryptionInfo, + com.google.cloud.alloydb.v1.EncryptionInfo.Builder, + com.google.cloud.alloydb.v1.EncryptionInfoOrBuilder> + getEncryptionInfoFieldBuilder() { + if (encryptionInfoBuilder_ == null) { + encryptionInfoBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1.EncryptionInfo, + com.google.cloud.alloydb.v1.EncryptionInfo.Builder, + com.google.cloud.alloydb.v1.EncryptionInfoOrBuilder>( + getEncryptionInfo(), getParentForChildren(), isClean()); + encryptionInfo_ = null; + } + return encryptionInfoBuilder_; + } + + private com.google.protobuf.Timestamp enabledTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + enabledTimeBuilder_; + /** + * + * + *
+     * Output only. When ContinuousBackup was most recently enabled. Set to null
+     * if ContinuousBackup is not enabled.
+     * 
+ * + * + * .google.protobuf.Timestamp enabled_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the enabledTime field is set. + */ + public boolean hasEnabledTime() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+     * Output only. When ContinuousBackup was most recently enabled. Set to null
+     * if ContinuousBackup is not enabled.
+     * 
+ * + * + * .google.protobuf.Timestamp enabled_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enabledTime. + */ + public com.google.protobuf.Timestamp getEnabledTime() { + if (enabledTimeBuilder_ == null) { + return enabledTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : enabledTime_; + } else { + return enabledTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Output only. When ContinuousBackup was most recently enabled. Set to null
+     * if ContinuousBackup is not enabled.
+     * 
+ * + * + * .google.protobuf.Timestamp enabled_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setEnabledTime(com.google.protobuf.Timestamp value) { + if (enabledTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + enabledTime_ = value; + } else { + enabledTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. When ContinuousBackup was most recently enabled. Set to null
+     * if ContinuousBackup is not enabled.
+     * 
+ * + * + * .google.protobuf.Timestamp enabled_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setEnabledTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (enabledTimeBuilder_ == null) { + enabledTime_ = builderForValue.build(); + } else { + enabledTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. When ContinuousBackup was most recently enabled. Set to null
+     * if ContinuousBackup is not enabled.
+     * 
+ * + * + * .google.protobuf.Timestamp enabled_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeEnabledTime(com.google.protobuf.Timestamp value) { + if (enabledTimeBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && enabledTime_ != null + && enabledTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getEnabledTimeBuilder().mergeFrom(value); + } else { + enabledTime_ = value; + } + } else { + enabledTimeBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. When ContinuousBackup was most recently enabled. Set to null
+     * if ContinuousBackup is not enabled.
+     * 
+ * + * + * .google.protobuf.Timestamp enabled_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearEnabledTime() { + bitField0_ = (bitField0_ & ~0x00000002); + enabledTime_ = null; + if (enabledTimeBuilder_ != null) { + enabledTimeBuilder_.dispose(); + enabledTimeBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. When ContinuousBackup was most recently enabled. Set to null
+     * if ContinuousBackup is not enabled.
+     * 
+ * + * + * .google.protobuf.Timestamp enabled_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Timestamp.Builder getEnabledTimeBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return getEnabledTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. When ContinuousBackup was most recently enabled. Set to null
+     * if ContinuousBackup is not enabled.
+     * 
+ * + * + * .google.protobuf.Timestamp enabled_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.TimestampOrBuilder getEnabledTimeOrBuilder() { + if (enabledTimeBuilder_ != null) { + return enabledTimeBuilder_.getMessageOrBuilder(); + } else { + return enabledTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : enabledTime_; + } + } + /** + * + * + *
+     * Output only. When ContinuousBackup was most recently enabled. Set to null
+     * if ContinuousBackup is not enabled.
+     * 
+ * + * + * .google.protobuf.Timestamp enabled_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getEnabledTimeFieldBuilder() { + if (enabledTimeBuilder_ == null) { + enabledTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getEnabledTime(), getParentForChildren(), isClean()); + enabledTime_ = null; + } + return enabledTimeBuilder_; + } + + private java.util.List schedule_ = java.util.Collections.emptyList(); + + private void ensureScheduleIsMutable() { + if (!((bitField0_ & 0x00000004) != 0)) { + schedule_ = new java.util.ArrayList(schedule_); + bitField0_ |= 0x00000004; + } + } + /** + * + * + *
+     * Output only. Days of the week on which a continuous backup is taken. Output
+     * only field. Ignored if passed into the request.
+     * 
+ * + * + * repeated .google.type.DayOfWeek schedule = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return A list containing the schedule. + */ + public java.util.List getScheduleList() { + return new com.google.protobuf.Internal.ListAdapter< + java.lang.Integer, com.google.type.DayOfWeek>(schedule_, schedule_converter_); + } + /** + * + * + *
+     * Output only. Days of the week on which a continuous backup is taken. Output
+     * only field. Ignored if passed into the request.
+     * 
+ * + * + * repeated .google.type.DayOfWeek schedule = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The count of schedule. + */ + public int getScheduleCount() { + return schedule_.size(); + } + /** + * + * + *
+     * Output only. Days of the week on which a continuous backup is taken. Output
+     * only field. Ignored if passed into the request.
+     * 
+ * + * + * repeated .google.type.DayOfWeek schedule = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param index The index of the element to return. + * @return The schedule at the given index. + */ + public com.google.type.DayOfWeek getSchedule(int index) { + return schedule_converter_.convert(schedule_.get(index)); + } + /** + * + * + *
+     * Output only. Days of the week on which a continuous backup is taken. Output
+     * only field. Ignored if passed into the request.
+     * 
+ * + * + * repeated .google.type.DayOfWeek schedule = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param index The index to set the value at. + * @param value The schedule to set. + * @return This builder for chaining. + */ + public Builder setSchedule(int index, com.google.type.DayOfWeek value) { + if (value == null) { + throw new NullPointerException(); + } + ensureScheduleIsMutable(); + schedule_.set(index, value.getNumber()); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Days of the week on which a continuous backup is taken. Output
+     * only field. Ignored if passed into the request.
+     * 
+ * + * + * repeated .google.type.DayOfWeek schedule = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The schedule to add. + * @return This builder for chaining. + */ + public Builder addSchedule(com.google.type.DayOfWeek value) { + if (value == null) { + throw new NullPointerException(); + } + ensureScheduleIsMutable(); + schedule_.add(value.getNumber()); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Days of the week on which a continuous backup is taken. Output
+     * only field. Ignored if passed into the request.
+     * 
+ * + * + * repeated .google.type.DayOfWeek schedule = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param values The schedule to add. + * @return This builder for chaining. + */ + public Builder addAllSchedule(java.lang.Iterable values) { + ensureScheduleIsMutable(); + for (com.google.type.DayOfWeek value : values) { + schedule_.add(value.getNumber()); + } + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Days of the week on which a continuous backup is taken. Output
+     * only field. Ignored if passed into the request.
+     * 
+ * + * + * repeated .google.type.DayOfWeek schedule = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return This builder for chaining. + */ + public Builder clearSchedule() { + schedule_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Days of the week on which a continuous backup is taken. Output
+     * only field. Ignored if passed into the request.
+     * 
+ * + * + * repeated .google.type.DayOfWeek schedule = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return A list containing the enum numeric values on the wire for schedule. + */ + public java.util.List getScheduleValueList() { + return java.util.Collections.unmodifiableList(schedule_); + } + /** + * + * + *
+     * Output only. Days of the week on which a continuous backup is taken. Output
+     * only field. Ignored if passed into the request.
+     * 
+ * + * + * repeated .google.type.DayOfWeek schedule = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param index The index of the value to return. + * @return The enum numeric value on the wire of schedule at the given index. + */ + public int getScheduleValue(int index) { + return schedule_.get(index); + } + /** + * + * + *
+     * Output only. Days of the week on which a continuous backup is taken. Output
+     * only field. Ignored if passed into the request.
+     * 
+ * + * + * repeated .google.type.DayOfWeek schedule = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param index The index to set the value at. + * @param value The enum numeric value on the wire for schedule to set. + * @return This builder for chaining. + */ + public Builder setScheduleValue(int index, int value) { + ensureScheduleIsMutable(); + schedule_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Days of the week on which a continuous backup is taken. Output
+     * only field. Ignored if passed into the request.
+     * 
+ * + * + * repeated .google.type.DayOfWeek schedule = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The enum numeric value on the wire for schedule to add. + * @return This builder for chaining. + */ + public Builder addScheduleValue(int value) { + ensureScheduleIsMutable(); + schedule_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Days of the week on which a continuous backup is taken. Output
+     * only field. Ignored if passed into the request.
+     * 
+ * + * + * repeated .google.type.DayOfWeek schedule = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param values The enum numeric values on the wire for schedule to add. + * @return This builder for chaining. + */ + public Builder addAllScheduleValue(java.lang.Iterable values) { + ensureScheduleIsMutable(); + for (int value : values) { + schedule_.add(value); + } + onChanged(); + return this; + } + + private com.google.protobuf.Timestamp earliestRestorableTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + earliestRestorableTimeBuilder_; + /** + * + * + *
+     * Output only. The earliest restorable time that can be restored to. Output
+     * only field.
+     * 
+ * + * + * .google.protobuf.Timestamp earliest_restorable_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the earliestRestorableTime field is set. + */ + public boolean hasEarliestRestorableTime() { + return ((bitField0_ & 0x00000008) != 0); + } + /** + * + * + *
+     * Output only. The earliest restorable time that can be restored to. Output
+     * only field.
+     * 
+ * + * + * .google.protobuf.Timestamp earliest_restorable_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The earliestRestorableTime. + */ + public com.google.protobuf.Timestamp getEarliestRestorableTime() { + if (earliestRestorableTimeBuilder_ == null) { + return earliestRestorableTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : earliestRestorableTime_; + } else { + return earliestRestorableTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Output only. The earliest restorable time that can be restored to. Output
+     * only field.
+     * 
+ * + * + * .google.protobuf.Timestamp earliest_restorable_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setEarliestRestorableTime(com.google.protobuf.Timestamp value) { + if (earliestRestorableTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + earliestRestorableTime_ = value; + } else { + earliestRestorableTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The earliest restorable time that can be restored to. Output
+     * only field.
+     * 
+ * + * + * .google.protobuf.Timestamp earliest_restorable_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setEarliestRestorableTime( + com.google.protobuf.Timestamp.Builder builderForValue) { + if (earliestRestorableTimeBuilder_ == null) { + earliestRestorableTime_ = builderForValue.build(); + } else { + earliestRestorableTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The earliest restorable time that can be restored to. Output
+     * only field.
+     * 
+ * + * + * .google.protobuf.Timestamp earliest_restorable_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeEarliestRestorableTime(com.google.protobuf.Timestamp value) { + if (earliestRestorableTimeBuilder_ == null) { + if (((bitField0_ & 0x00000008) != 0) + && earliestRestorableTime_ != null + && earliestRestorableTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getEarliestRestorableTimeBuilder().mergeFrom(value); + } else { + earliestRestorableTime_ = value; + } + } else { + earliestRestorableTimeBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The earliest restorable time that can be restored to. Output
+     * only field.
+     * 
+ * + * + * .google.protobuf.Timestamp earliest_restorable_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearEarliestRestorableTime() { + bitField0_ = (bitField0_ & ~0x00000008); + earliestRestorableTime_ = null; + if (earliestRestorableTimeBuilder_ != null) { + earliestRestorableTimeBuilder_.dispose(); + earliestRestorableTimeBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The earliest restorable time that can be restored to. Output
+     * only field.
+     * 
+ * + * + * .google.protobuf.Timestamp earliest_restorable_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Timestamp.Builder getEarliestRestorableTimeBuilder() { + bitField0_ |= 0x00000008; + onChanged(); + return getEarliestRestorableTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. The earliest restorable time that can be restored to. Output
+     * only field.
+     * 
+ * + * + * .google.protobuf.Timestamp earliest_restorable_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.TimestampOrBuilder getEarliestRestorableTimeOrBuilder() { + if (earliestRestorableTimeBuilder_ != null) { + return earliestRestorableTimeBuilder_.getMessageOrBuilder(); + } else { + return earliestRestorableTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : earliestRestorableTime_; + } + } + /** + * + * + *
+     * Output only. The earliest restorable time that can be restored to. Output
+     * only field.
+     * 
+ * + * + * .google.protobuf.Timestamp earliest_restorable_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getEarliestRestorableTimeFieldBuilder() { + if (earliestRestorableTimeBuilder_ == null) { + earliestRestorableTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getEarliestRestorableTime(), getParentForChildren(), isClean()); + earliestRestorableTime_ = null; + } + return earliestRestorableTimeBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.alloydb.v1.ContinuousBackupInfo) + } + + // @@protoc_insertion_point(class_scope:google.cloud.alloydb.v1.ContinuousBackupInfo) + private static final com.google.cloud.alloydb.v1.ContinuousBackupInfo DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.alloydb.v1.ContinuousBackupInfo(); + } + + public static com.google.cloud.alloydb.v1.ContinuousBackupInfo getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ContinuousBackupInfo parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1.ContinuousBackupInfo getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/ContinuousBackupInfoOrBuilder.java b/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/ContinuousBackupInfoOrBuilder.java new file mode 100644 index 000000000000..f22f33a370cb --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/ContinuousBackupInfoOrBuilder.java @@ -0,0 +1,232 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/alloydb/v1/resources.proto + +package com.google.cloud.alloydb.v1; + +public interface ContinuousBackupInfoOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.alloydb.v1.ContinuousBackupInfo) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Output only. The encryption information for the WALs and backups required
+   * for ContinuousBackup.
+   * 
+ * + * + * .google.cloud.alloydb.v1.EncryptionInfo encryption_info = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the encryptionInfo field is set. + */ + boolean hasEncryptionInfo(); + /** + * + * + *
+   * Output only. The encryption information for the WALs and backups required
+   * for ContinuousBackup.
+   * 
+ * + * + * .google.cloud.alloydb.v1.EncryptionInfo encryption_info = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The encryptionInfo. + */ + com.google.cloud.alloydb.v1.EncryptionInfo getEncryptionInfo(); + /** + * + * + *
+   * Output only. The encryption information for the WALs and backups required
+   * for ContinuousBackup.
+   * 
+ * + * + * .google.cloud.alloydb.v1.EncryptionInfo encryption_info = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.cloud.alloydb.v1.EncryptionInfoOrBuilder getEncryptionInfoOrBuilder(); + + /** + * + * + *
+   * Output only. When ContinuousBackup was most recently enabled. Set to null
+   * if ContinuousBackup is not enabled.
+   * 
+ * + * .google.protobuf.Timestamp enabled_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the enabledTime field is set. + */ + boolean hasEnabledTime(); + /** + * + * + *
+   * Output only. When ContinuousBackup was most recently enabled. Set to null
+   * if ContinuousBackup is not enabled.
+   * 
+ * + * .google.protobuf.Timestamp enabled_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enabledTime. + */ + com.google.protobuf.Timestamp getEnabledTime(); + /** + * + * + *
+   * Output only. When ContinuousBackup was most recently enabled. Set to null
+   * if ContinuousBackup is not enabled.
+   * 
+ * + * .google.protobuf.Timestamp enabled_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getEnabledTimeOrBuilder(); + + /** + * + * + *
+   * Output only. Days of the week on which a continuous backup is taken. Output
+   * only field. Ignored if passed into the request.
+   * 
+ * + * + * repeated .google.type.DayOfWeek schedule = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return A list containing the schedule. + */ + java.util.List getScheduleList(); + /** + * + * + *
+   * Output only. Days of the week on which a continuous backup is taken. Output
+   * only field. Ignored if passed into the request.
+   * 
+ * + * + * repeated .google.type.DayOfWeek schedule = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The count of schedule. + */ + int getScheduleCount(); + /** + * + * + *
+   * Output only. Days of the week on which a continuous backup is taken. Output
+   * only field. Ignored if passed into the request.
+   * 
+ * + * + * repeated .google.type.DayOfWeek schedule = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param index The index of the element to return. + * @return The schedule at the given index. + */ + com.google.type.DayOfWeek getSchedule(int index); + /** + * + * + *
+   * Output only. Days of the week on which a continuous backup is taken. Output
+   * only field. Ignored if passed into the request.
+   * 
+ * + * + * repeated .google.type.DayOfWeek schedule = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return A list containing the enum numeric values on the wire for schedule. + */ + java.util.List getScheduleValueList(); + /** + * + * + *
+   * Output only. Days of the week on which a continuous backup is taken. Output
+   * only field. Ignored if passed into the request.
+   * 
+ * + * + * repeated .google.type.DayOfWeek schedule = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param index The index of the value to return. + * @return The enum numeric value on the wire of schedule at the given index. + */ + int getScheduleValue(int index); + + /** + * + * + *
+   * Output only. The earliest restorable time that can be restored to. Output
+   * only field.
+   * 
+ * + * + * .google.protobuf.Timestamp earliest_restorable_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the earliestRestorableTime field is set. + */ + boolean hasEarliestRestorableTime(); + /** + * + * + *
+   * Output only. The earliest restorable time that can be restored to. Output
+   * only field.
+   * 
+ * + * + * .google.protobuf.Timestamp earliest_restorable_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The earliestRestorableTime. + */ + com.google.protobuf.Timestamp getEarliestRestorableTime(); + /** + * + * + *
+   * Output only. The earliest restorable time that can be restored to. Output
+   * only field.
+   * 
+ * + * + * .google.protobuf.Timestamp earliest_restorable_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getEarliestRestorableTimeOrBuilder(); +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/ContinuousBackupSource.java b/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/ContinuousBackupSource.java new file mode 100644 index 000000000000..8f245d9ce00e --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/ContinuousBackupSource.java @@ -0,0 +1,911 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/alloydb/v1/resources.proto + +package com.google.cloud.alloydb.v1; + +/** + * + * + *
+ * Message describing a ContinuousBackupSource.
+ * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1.ContinuousBackupSource} + */ +public final class ContinuousBackupSource extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.alloydb.v1.ContinuousBackupSource) + ContinuousBackupSourceOrBuilder { + private static final long serialVersionUID = 0L; + // Use ContinuousBackupSource.newBuilder() to construct. + private ContinuousBackupSource(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ContinuousBackupSource() { + cluster_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ContinuousBackupSource(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.alloydb.v1.ResourcesProto + .internal_static_google_cloud_alloydb_v1_ContinuousBackupSource_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1.ResourcesProto + .internal_static_google_cloud_alloydb_v1_ContinuousBackupSource_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1.ContinuousBackupSource.class, + com.google.cloud.alloydb.v1.ContinuousBackupSource.Builder.class); + } + + public static final int CLUSTER_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object 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.
+   * 
+ * + * string cluster = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The cluster. + */ + @java.lang.Override + public java.lang.String getCluster() { + java.lang.Object ref = cluster_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + cluster_ = s; + return s; + } + } + /** + * + * + *
+   * 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.
+   * 
+ * + * string cluster = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for cluster. + */ + @java.lang.Override + public com.google.protobuf.ByteString getClusterBytes() { + java.lang.Object ref = cluster_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + cluster_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int POINT_IN_TIME_FIELD_NUMBER = 2; + private com.google.protobuf.Timestamp pointInTime_; + /** + * + * + *
+   * Required. The point in time to restore to.
+   * 
+ * + * .google.protobuf.Timestamp point_in_time = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the pointInTime field is set. + */ + @java.lang.Override + public boolean hasPointInTime() { + return pointInTime_ != null; + } + /** + * + * + *
+   * Required. The point in time to restore to.
+   * 
+ * + * .google.protobuf.Timestamp point_in_time = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The pointInTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getPointInTime() { + return pointInTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : pointInTime_; + } + /** + * + * + *
+   * Required. The point in time to restore to.
+   * 
+ * + * .google.protobuf.Timestamp point_in_time = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getPointInTimeOrBuilder() { + return pointInTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : pointInTime_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(cluster_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, cluster_); + } + if (pointInTime_ != null) { + output.writeMessage(2, getPointInTime()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(cluster_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, cluster_); + } + if (pointInTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getPointInTime()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.alloydb.v1.ContinuousBackupSource)) { + return super.equals(obj); + } + com.google.cloud.alloydb.v1.ContinuousBackupSource other = + (com.google.cloud.alloydb.v1.ContinuousBackupSource) obj; + + if (!getCluster().equals(other.getCluster())) return false; + if (hasPointInTime() != other.hasPointInTime()) return false; + if (hasPointInTime()) { + if (!getPointInTime().equals(other.getPointInTime())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + CLUSTER_FIELD_NUMBER; + hash = (53 * hash) + getCluster().hashCode(); + if (hasPointInTime()) { + hash = (37 * hash) + POINT_IN_TIME_FIELD_NUMBER; + hash = (53 * hash) + getPointInTime().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.alloydb.v1.ContinuousBackupSource parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1.ContinuousBackupSource parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.alloydb.v1.ContinuousBackupSource parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1.ContinuousBackupSource parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.alloydb.v1.ContinuousBackupSource parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1.ContinuousBackupSource parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.alloydb.v1.ContinuousBackupSource parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1.ContinuousBackupSource parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.alloydb.v1.ContinuousBackupSource parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1.ContinuousBackupSource parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.alloydb.v1.ContinuousBackupSource parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1.ContinuousBackupSource parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.alloydb.v1.ContinuousBackupSource prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Message describing a ContinuousBackupSource.
+   * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1.ContinuousBackupSource} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.alloydb.v1.ContinuousBackupSource) + com.google.cloud.alloydb.v1.ContinuousBackupSourceOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.alloydb.v1.ResourcesProto + .internal_static_google_cloud_alloydb_v1_ContinuousBackupSource_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1.ResourcesProto + .internal_static_google_cloud_alloydb_v1_ContinuousBackupSource_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1.ContinuousBackupSource.class, + com.google.cloud.alloydb.v1.ContinuousBackupSource.Builder.class); + } + + // Construct using com.google.cloud.alloydb.v1.ContinuousBackupSource.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + cluster_ = ""; + pointInTime_ = null; + if (pointInTimeBuilder_ != null) { + pointInTimeBuilder_.dispose(); + pointInTimeBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.alloydb.v1.ResourcesProto + .internal_static_google_cloud_alloydb_v1_ContinuousBackupSource_descriptor; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1.ContinuousBackupSource getDefaultInstanceForType() { + return com.google.cloud.alloydb.v1.ContinuousBackupSource.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.alloydb.v1.ContinuousBackupSource build() { + com.google.cloud.alloydb.v1.ContinuousBackupSource result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1.ContinuousBackupSource buildPartial() { + com.google.cloud.alloydb.v1.ContinuousBackupSource result = + new com.google.cloud.alloydb.v1.ContinuousBackupSource(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.alloydb.v1.ContinuousBackupSource result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.cluster_ = cluster_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.pointInTime_ = + pointInTimeBuilder_ == null ? pointInTime_ : pointInTimeBuilder_.build(); + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.alloydb.v1.ContinuousBackupSource) { + return mergeFrom((com.google.cloud.alloydb.v1.ContinuousBackupSource) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.alloydb.v1.ContinuousBackupSource other) { + if (other == com.google.cloud.alloydb.v1.ContinuousBackupSource.getDefaultInstance()) + return this; + if (!other.getCluster().isEmpty()) { + cluster_ = other.cluster_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.hasPointInTime()) { + mergePointInTime(other.getPointInTime()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + cluster_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + input.readMessage(getPointInTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object 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.
+     * 
+ * + * string cluster = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The cluster. + */ + public java.lang.String getCluster() { + java.lang.Object ref = cluster_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + cluster_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * 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.
+     * 
+ * + * string cluster = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for cluster. + */ + public com.google.protobuf.ByteString getClusterBytes() { + java.lang.Object ref = cluster_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + cluster_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * 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.
+     * 
+ * + * string cluster = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The cluster to set. + * @return This builder for chaining. + */ + public Builder setCluster(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + cluster_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * 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.
+     * 
+ * + * string cluster = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearCluster() { + cluster_ = getDefaultInstance().getCluster(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * 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.
+     * 
+ * + * string cluster = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for cluster to set. + * @return This builder for chaining. + */ + public Builder setClusterBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + cluster_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private com.google.protobuf.Timestamp pointInTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + pointInTimeBuilder_; + /** + * + * + *
+     * Required. The point in time to restore to.
+     * 
+ * + * .google.protobuf.Timestamp point_in_time = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the pointInTime field is set. + */ + public boolean hasPointInTime() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+     * Required. The point in time to restore to.
+     * 
+ * + * .google.protobuf.Timestamp point_in_time = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The pointInTime. + */ + public com.google.protobuf.Timestamp getPointInTime() { + if (pointInTimeBuilder_ == null) { + return pointInTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : pointInTime_; + } else { + return pointInTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. The point in time to restore to.
+     * 
+ * + * .google.protobuf.Timestamp point_in_time = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setPointInTime(com.google.protobuf.Timestamp value) { + if (pointInTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + pointInTime_ = value; + } else { + pointInTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The point in time to restore to.
+     * 
+ * + * .google.protobuf.Timestamp point_in_time = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setPointInTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (pointInTimeBuilder_ == null) { + pointInTime_ = builderForValue.build(); + } else { + pointInTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The point in time to restore to.
+     * 
+ * + * .google.protobuf.Timestamp point_in_time = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergePointInTime(com.google.protobuf.Timestamp value) { + if (pointInTimeBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && pointInTime_ != null + && pointInTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getPointInTimeBuilder().mergeFrom(value); + } else { + pointInTime_ = value; + } + } else { + pointInTimeBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The point in time to restore to.
+     * 
+ * + * .google.protobuf.Timestamp point_in_time = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearPointInTime() { + bitField0_ = (bitField0_ & ~0x00000002); + pointInTime_ = null; + if (pointInTimeBuilder_ != null) { + pointInTimeBuilder_.dispose(); + pointInTimeBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The point in time to restore to.
+     * 
+ * + * .google.protobuf.Timestamp point_in_time = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.protobuf.Timestamp.Builder getPointInTimeBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return getPointInTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. The point in time to restore to.
+     * 
+ * + * .google.protobuf.Timestamp point_in_time = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.protobuf.TimestampOrBuilder getPointInTimeOrBuilder() { + if (pointInTimeBuilder_ != null) { + return pointInTimeBuilder_.getMessageOrBuilder(); + } else { + return pointInTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : pointInTime_; + } + } + /** + * + * + *
+     * Required. The point in time to restore to.
+     * 
+ * + * .google.protobuf.Timestamp point_in_time = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getPointInTimeFieldBuilder() { + if (pointInTimeBuilder_ == null) { + pointInTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getPointInTime(), getParentForChildren(), isClean()); + pointInTime_ = null; + } + return pointInTimeBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.alloydb.v1.ContinuousBackupSource) + } + + // @@protoc_insertion_point(class_scope:google.cloud.alloydb.v1.ContinuousBackupSource) + private static final com.google.cloud.alloydb.v1.ContinuousBackupSource DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.alloydb.v1.ContinuousBackupSource(); + } + + public static com.google.cloud.alloydb.v1.ContinuousBackupSource getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ContinuousBackupSource parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1.ContinuousBackupSource getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/ContinuousBackupSourceOrBuilder.java b/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/ContinuousBackupSourceOrBuilder.java new file mode 100644 index 000000000000..6d3ee704f1a6 --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/ContinuousBackupSourceOrBuilder.java @@ -0,0 +1,92 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/alloydb/v1/resources.proto + +package com.google.cloud.alloydb.v1; + +public interface ContinuousBackupSourceOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.alloydb.v1.ContinuousBackupSource) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * 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.
+   * 
+ * + * string cluster = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The cluster. + */ + java.lang.String getCluster(); + /** + * + * + *
+   * 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.
+   * 
+ * + * string cluster = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for cluster. + */ + com.google.protobuf.ByteString getClusterBytes(); + + /** + * + * + *
+   * Required. The point in time to restore to.
+   * 
+ * + * .google.protobuf.Timestamp point_in_time = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the pointInTime field is set. + */ + boolean hasPointInTime(); + /** + * + * + *
+   * Required. The point in time to restore to.
+   * 
+ * + * .google.protobuf.Timestamp point_in_time = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The pointInTime. + */ + com.google.protobuf.Timestamp getPointInTime(); + /** + * + * + *
+   * Required. The point in time to restore to.
+   * 
+ * + * .google.protobuf.Timestamp point_in_time = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.protobuf.TimestampOrBuilder getPointInTimeOrBuilder(); +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/CreateClusterRequest.java b/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/CreateClusterRequest.java index ba07fc2bc6db..f6d1feb0f661 100644 --- a/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/CreateClusterRequest.java +++ b/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/CreateClusterRequest.java @@ -72,7 +72,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { * * *
-   * Required. The name of the parent resource. For the required format, see the
+   * Required. The location of the new cluster. For the required format, see the
    * comment on the Cluster.name field.
    * 
* @@ -98,7 +98,7 @@ public java.lang.String getParent() { * * *
-   * Required. The name of the parent resource. For the required format, see the
+   * Required. The location of the new cluster. For the required format, see the
    * comment on the Cluster.name field.
    * 
* @@ -764,7 +764,7 @@ public Builder mergeFrom( * * *
-     * Required. The name of the parent resource. For the required format, see the
+     * Required. The location of the new cluster. For the required format, see the
      * comment on the Cluster.name field.
      * 
* @@ -789,7 +789,7 @@ public java.lang.String getParent() { * * *
-     * Required. The name of the parent resource. For the required format, see the
+     * Required. The location of the new cluster. For the required format, see the
      * comment on the Cluster.name field.
      * 
* @@ -814,7 +814,7 @@ public com.google.protobuf.ByteString getParentBytes() { * * *
-     * Required. The name of the parent resource. For the required format, see the
+     * Required. The location of the new cluster. For the required format, see the
      * comment on the Cluster.name field.
      * 
* @@ -838,7 +838,7 @@ public Builder setParent(java.lang.String value) { * * *
-     * Required. The name of the parent resource. For the required format, see the
+     * Required. The location of the new cluster. For the required format, see the
      * comment on the Cluster.name field.
      * 
* @@ -858,7 +858,7 @@ public Builder clearParent() { * * *
-     * Required. The name of the parent resource. For the required format, see the
+     * Required. The location of the new cluster. For the required format, see the
      * comment on the Cluster.name field.
      * 
* diff --git a/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/CreateClusterRequestOrBuilder.java b/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/CreateClusterRequestOrBuilder.java index 9cf02164c195..12c4a87d2150 100644 --- a/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/CreateClusterRequestOrBuilder.java +++ b/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/CreateClusterRequestOrBuilder.java @@ -27,7 +27,7 @@ public interface CreateClusterRequestOrBuilder * * *
-   * Required. The name of the parent resource. For the required format, see the
+   * Required. The location of the new cluster. For the required format, see the
    * comment on the Cluster.name field.
    * 
* @@ -42,7 +42,7 @@ public interface CreateClusterRequestOrBuilder * * *
-   * Required. The name of the parent resource. For the required format, see the
+   * Required. The location of the new cluster. For the required format, see the
    * comment on the Cluster.name field.
    * 
* diff --git a/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/CreateSecondaryClusterRequest.java b/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/CreateSecondaryClusterRequest.java new file mode 100644 index 000000000000..a54d6019c664 --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/CreateSecondaryClusterRequest.java @@ -0,0 +1,1451 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/alloydb/v1/service.proto + +package com.google.cloud.alloydb.v1; + +/** Protobuf type {@code google.cloud.alloydb.v1.CreateSecondaryClusterRequest} */ +public final class CreateSecondaryClusterRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.alloydb.v1.CreateSecondaryClusterRequest) + CreateSecondaryClusterRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use CreateSecondaryClusterRequest.newBuilder() to construct. + private CreateSecondaryClusterRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private CreateSecondaryClusterRequest() { + parent_ = ""; + clusterId_ = ""; + requestId_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new CreateSecondaryClusterRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.alloydb.v1.ServiceProto + .internal_static_google_cloud_alloydb_v1_CreateSecondaryClusterRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1.ServiceProto + .internal_static_google_cloud_alloydb_v1_CreateSecondaryClusterRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1.CreateSecondaryClusterRequest.class, + com.google.cloud.alloydb.v1.CreateSecondaryClusterRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object parent_ = ""; + /** + * + * + *
+   * Required. The location of the new cluster. For the required
+   * format, see the comment on the Cluster.name field.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + @java.lang.Override + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The location of the new cluster. For the required
+   * format, see the comment on the Cluster.name field.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + @java.lang.Override + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int CLUSTER_ID_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object clusterId_ = ""; + /** + * + * + *
+   * Required. ID of the requesting object (the secondary cluster).
+   * 
+ * + * string cluster_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The clusterId. + */ + @java.lang.Override + public java.lang.String getClusterId() { + java.lang.Object ref = clusterId_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + clusterId_ = s; + return s; + } + } + /** + * + * + *
+   * Required. ID of the requesting object (the secondary cluster).
+   * 
+ * + * string cluster_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for clusterId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getClusterIdBytes() { + java.lang.Object ref = clusterId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + clusterId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int CLUSTER_FIELD_NUMBER = 3; + private com.google.cloud.alloydb.v1.Cluster cluster_; + /** + * + * + *
+   * Required. Configuration of the requesting object (the secondary cluster).
+   * 
+ * + * .google.cloud.alloydb.v1.Cluster cluster = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the cluster field is set. + */ + @java.lang.Override + public boolean hasCluster() { + return cluster_ != null; + } + /** + * + * + *
+   * Required. Configuration of the requesting object (the secondary cluster).
+   * 
+ * + * .google.cloud.alloydb.v1.Cluster cluster = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The cluster. + */ + @java.lang.Override + public com.google.cloud.alloydb.v1.Cluster getCluster() { + return cluster_ == null ? com.google.cloud.alloydb.v1.Cluster.getDefaultInstance() : cluster_; + } + /** + * + * + *
+   * Required. Configuration of the requesting object (the secondary cluster).
+   * 
+ * + * .google.cloud.alloydb.v1.Cluster cluster = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.alloydb.v1.ClusterOrBuilder getClusterOrBuilder() { + return cluster_ == null ? com.google.cloud.alloydb.v1.Cluster.getDefaultInstance() : cluster_; + } + + public static final int REQUEST_ID_FIELD_NUMBER = 5; + + @SuppressWarnings("serial") + private volatile java.lang.Object 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).
+   * 
+ * + * string request_id = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The requestId. + */ + @java.lang.Override + public java.lang.String getRequestId() { + java.lang.Object ref = requestId_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + requestId_ = s; + return s; + } + } + /** + * + * + *
+   * Optional. An optional request ID to identify requests. Specify a unique
+   * request ID so that if you must retry your request, the server will know to
+   * ignore the request if it has already been completed. The server will
+   * guarantee that for at least 60 minutes since the first request.
+   *
+   * For example, consider a situation where you make an initial request and
+   * the request times out. If you make the request again with the same request
+   * ID, the server can check if original operation with the same request ID
+   * was received, and if so, will ignore the second request. This prevents
+   * clients from accidentally creating duplicate commitments.
+   *
+   * The request ID must be a valid UUID with the exception that zero UUID is
+   * not supported (00000000-0000-0000-0000-000000000000).
+   * 
+ * + * string request_id = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for requestId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getRequestIdBytes() { + java.lang.Object ref = requestId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + requestId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int VALIDATE_ONLY_FIELD_NUMBER = 6; + private boolean validateOnly_ = false; + /** + * + * + *
+   * Optional. If set, performs request validation (e.g. permission checks and
+   * any other type of validation), but do not actually execute the create
+   * request.
+   * 
+ * + * bool validate_only = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The validateOnly. + */ + @java.lang.Override + public boolean getValidateOnly() { + return validateOnly_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(clusterId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, clusterId_); + } + if (cluster_ != null) { + output.writeMessage(3, getCluster()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(requestId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 5, requestId_); + } + if (validateOnly_ != false) { + output.writeBool(6, validateOnly_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(clusterId_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, clusterId_); + } + if (cluster_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getCluster()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(requestId_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, requestId_); + } + if (validateOnly_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(6, validateOnly_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.alloydb.v1.CreateSecondaryClusterRequest)) { + return super.equals(obj); + } + com.google.cloud.alloydb.v1.CreateSecondaryClusterRequest other = + (com.google.cloud.alloydb.v1.CreateSecondaryClusterRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (!getClusterId().equals(other.getClusterId())) return false; + if (hasCluster() != other.hasCluster()) return false; + if (hasCluster()) { + if (!getCluster().equals(other.getCluster())) return false; + } + if (!getRequestId().equals(other.getRequestId())) return false; + if (getValidateOnly() != other.getValidateOnly()) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + PARENT_FIELD_NUMBER; + hash = (53 * hash) + getParent().hashCode(); + hash = (37 * hash) + CLUSTER_ID_FIELD_NUMBER; + hash = (53 * hash) + getClusterId().hashCode(); + if (hasCluster()) { + hash = (37 * hash) + CLUSTER_FIELD_NUMBER; + hash = (53 * hash) + getCluster().hashCode(); + } + hash = (37 * hash) + REQUEST_ID_FIELD_NUMBER; + hash = (53 * hash) + getRequestId().hashCode(); + hash = (37 * hash) + VALIDATE_ONLY_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getValidateOnly()); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.alloydb.v1.CreateSecondaryClusterRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1.CreateSecondaryClusterRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.alloydb.v1.CreateSecondaryClusterRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1.CreateSecondaryClusterRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.alloydb.v1.CreateSecondaryClusterRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1.CreateSecondaryClusterRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.alloydb.v1.CreateSecondaryClusterRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1.CreateSecondaryClusterRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.alloydb.v1.CreateSecondaryClusterRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1.CreateSecondaryClusterRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.alloydb.v1.CreateSecondaryClusterRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1.CreateSecondaryClusterRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.alloydb.v1.CreateSecondaryClusterRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** Protobuf type {@code google.cloud.alloydb.v1.CreateSecondaryClusterRequest} */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.alloydb.v1.CreateSecondaryClusterRequest) + com.google.cloud.alloydb.v1.CreateSecondaryClusterRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.alloydb.v1.ServiceProto + .internal_static_google_cloud_alloydb_v1_CreateSecondaryClusterRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1.ServiceProto + .internal_static_google_cloud_alloydb_v1_CreateSecondaryClusterRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1.CreateSecondaryClusterRequest.class, + com.google.cloud.alloydb.v1.CreateSecondaryClusterRequest.Builder.class); + } + + // Construct using com.google.cloud.alloydb.v1.CreateSecondaryClusterRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + parent_ = ""; + clusterId_ = ""; + cluster_ = null; + if (clusterBuilder_ != null) { + clusterBuilder_.dispose(); + clusterBuilder_ = null; + } + requestId_ = ""; + validateOnly_ = false; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.alloydb.v1.ServiceProto + .internal_static_google_cloud_alloydb_v1_CreateSecondaryClusterRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1.CreateSecondaryClusterRequest getDefaultInstanceForType() { + return com.google.cloud.alloydb.v1.CreateSecondaryClusterRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.alloydb.v1.CreateSecondaryClusterRequest build() { + com.google.cloud.alloydb.v1.CreateSecondaryClusterRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1.CreateSecondaryClusterRequest buildPartial() { + com.google.cloud.alloydb.v1.CreateSecondaryClusterRequest result = + new com.google.cloud.alloydb.v1.CreateSecondaryClusterRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.alloydb.v1.CreateSecondaryClusterRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.parent_ = parent_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.clusterId_ = clusterId_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.cluster_ = clusterBuilder_ == null ? cluster_ : clusterBuilder_.build(); + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.requestId_ = requestId_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.validateOnly_ = validateOnly_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.alloydb.v1.CreateSecondaryClusterRequest) { + return mergeFrom((com.google.cloud.alloydb.v1.CreateSecondaryClusterRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.alloydb.v1.CreateSecondaryClusterRequest other) { + if (other == com.google.cloud.alloydb.v1.CreateSecondaryClusterRequest.getDefaultInstance()) + return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getClusterId().isEmpty()) { + clusterId_ = other.clusterId_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (other.hasCluster()) { + mergeCluster(other.getCluster()); + } + if (!other.getRequestId().isEmpty()) { + requestId_ = other.requestId_; + bitField0_ |= 0x00000008; + onChanged(); + } + if (other.getValidateOnly() != false) { + setValidateOnly(other.getValidateOnly()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + parent_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + clusterId_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + input.readMessage(getClusterFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 42: + { + requestId_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000008; + break; + } // case 42 + case 48: + { + validateOnly_ = input.readBool(); + bitField0_ |= 0x00000010; + break; + } // case 48 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * Required. The location of the new cluster. For the required
+     * format, see the comment on the Cluster.name field.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The location of the new cluster. For the required
+     * format, see the comment on the Cluster.name field.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The location of the new cluster. For the required
+     * format, see the comment on the Cluster.name field.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The parent to set. + * @return This builder for chaining. + */ + public Builder setParent(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + parent_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The location of the new cluster. For the required
+     * format, see the comment on the Cluster.name field.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearParent() { + parent_ = getDefaultInstance().getParent(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The location of the new cluster. For the required
+     * format, see the comment on the Cluster.name field.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for parent to set. + * @return This builder for chaining. + */ + public Builder setParentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + parent_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object clusterId_ = ""; + /** + * + * + *
+     * Required. ID of the requesting object (the secondary cluster).
+     * 
+ * + * string cluster_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The clusterId. + */ + public java.lang.String getClusterId() { + java.lang.Object ref = clusterId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + clusterId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. ID of the requesting object (the secondary cluster).
+     * 
+ * + * string cluster_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for clusterId. + */ + public com.google.protobuf.ByteString getClusterIdBytes() { + java.lang.Object ref = clusterId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + clusterId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. ID of the requesting object (the secondary cluster).
+     * 
+ * + * string cluster_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The clusterId to set. + * @return This builder for chaining. + */ + public Builder setClusterId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + clusterId_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. ID of the requesting object (the secondary cluster).
+     * 
+ * + * string cluster_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearClusterId() { + clusterId_ = getDefaultInstance().getClusterId(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. ID of the requesting object (the secondary cluster).
+     * 
+ * + * string cluster_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for clusterId to set. + * @return This builder for chaining. + */ + public Builder setClusterIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + clusterId_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private com.google.cloud.alloydb.v1.Cluster cluster_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1.Cluster, + com.google.cloud.alloydb.v1.Cluster.Builder, + com.google.cloud.alloydb.v1.ClusterOrBuilder> + clusterBuilder_; + /** + * + * + *
+     * Required. Configuration of the requesting object (the secondary cluster).
+     * 
+ * + * .google.cloud.alloydb.v1.Cluster cluster = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the cluster field is set. + */ + public boolean hasCluster() { + return ((bitField0_ & 0x00000004) != 0); + } + /** + * + * + *
+     * Required. Configuration of the requesting object (the secondary cluster).
+     * 
+ * + * .google.cloud.alloydb.v1.Cluster cluster = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The cluster. + */ + public com.google.cloud.alloydb.v1.Cluster getCluster() { + if (clusterBuilder_ == null) { + return cluster_ == null + ? com.google.cloud.alloydb.v1.Cluster.getDefaultInstance() + : cluster_; + } else { + return clusterBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. Configuration of the requesting object (the secondary cluster).
+     * 
+ * + * .google.cloud.alloydb.v1.Cluster cluster = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setCluster(com.google.cloud.alloydb.v1.Cluster value) { + if (clusterBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + cluster_ = value; + } else { + clusterBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Configuration of the requesting object (the secondary cluster).
+     * 
+ * + * .google.cloud.alloydb.v1.Cluster cluster = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setCluster(com.google.cloud.alloydb.v1.Cluster.Builder builderForValue) { + if (clusterBuilder_ == null) { + cluster_ = builderForValue.build(); + } else { + clusterBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Configuration of the requesting object (the secondary cluster).
+     * 
+ * + * .google.cloud.alloydb.v1.Cluster cluster = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeCluster(com.google.cloud.alloydb.v1.Cluster value) { + if (clusterBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) + && cluster_ != null + && cluster_ != com.google.cloud.alloydb.v1.Cluster.getDefaultInstance()) { + getClusterBuilder().mergeFrom(value); + } else { + cluster_ = value; + } + } else { + clusterBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Configuration of the requesting object (the secondary cluster).
+     * 
+ * + * .google.cloud.alloydb.v1.Cluster cluster = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearCluster() { + bitField0_ = (bitField0_ & ~0x00000004); + cluster_ = null; + if (clusterBuilder_ != null) { + clusterBuilder_.dispose(); + clusterBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Configuration of the requesting object (the secondary cluster).
+     * 
+ * + * .google.cloud.alloydb.v1.Cluster cluster = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.alloydb.v1.Cluster.Builder getClusterBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return getClusterFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. Configuration of the requesting object (the secondary cluster).
+     * 
+ * + * .google.cloud.alloydb.v1.Cluster cluster = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.alloydb.v1.ClusterOrBuilder getClusterOrBuilder() { + if (clusterBuilder_ != null) { + return clusterBuilder_.getMessageOrBuilder(); + } else { + return cluster_ == null + ? com.google.cloud.alloydb.v1.Cluster.getDefaultInstance() + : cluster_; + } + } + /** + * + * + *
+     * Required. Configuration of the requesting object (the secondary cluster).
+     * 
+ * + * .google.cloud.alloydb.v1.Cluster cluster = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1.Cluster, + com.google.cloud.alloydb.v1.Cluster.Builder, + com.google.cloud.alloydb.v1.ClusterOrBuilder> + getClusterFieldBuilder() { + if (clusterBuilder_ == null) { + clusterBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1.Cluster, + com.google.cloud.alloydb.v1.Cluster.Builder, + com.google.cloud.alloydb.v1.ClusterOrBuilder>( + getCluster(), getParentForChildren(), isClean()); + cluster_ = null; + } + return clusterBuilder_; + } + + private java.lang.Object 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).
+     * 
+ * + * string request_id = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The requestId. + */ + public java.lang.String getRequestId() { + java.lang.Object ref = requestId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + requestId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes since the first request.
+     *
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     *
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for requestId. + */ + public com.google.protobuf.ByteString getRequestIdBytes() { + java.lang.Object ref = requestId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + requestId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes since the first request.
+     *
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     *
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The requestId to set. + * @return This builder for chaining. + */ + public Builder setRequestId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + requestId_ = value; + bitField0_ |= 0x00000008; + onChanged(); + 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).
+     * 
+ * + * string request_id = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearRequestId() { + requestId_ = getDefaultInstance().getRequestId(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + 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).
+     * 
+ * + * string request_id = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for requestId to set. + * @return This builder for chaining. + */ + public Builder setRequestIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + requestId_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + private boolean 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.
+     * 
+ * + * bool validate_only = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The validateOnly. + */ + @java.lang.Override + public boolean getValidateOnly() { + return 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.
+     * 
+ * + * bool validate_only = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The validateOnly to set. + * @return This builder for chaining. + */ + public Builder setValidateOnly(boolean value) { + + validateOnly_ = value; + bitField0_ |= 0x00000010; + onChanged(); + 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.
+     * 
+ * + * bool validate_only = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearValidateOnly() { + bitField0_ = (bitField0_ & ~0x00000010); + validateOnly_ = false; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.alloydb.v1.CreateSecondaryClusterRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.alloydb.v1.CreateSecondaryClusterRequest) + private static final com.google.cloud.alloydb.v1.CreateSecondaryClusterRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.alloydb.v1.CreateSecondaryClusterRequest(); + } + + public static com.google.cloud.alloydb.v1.CreateSecondaryClusterRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CreateSecondaryClusterRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1.CreateSecondaryClusterRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/CreateSecondaryClusterRequestOrBuilder.java b/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/CreateSecondaryClusterRequestOrBuilder.java new file mode 100644 index 000000000000..268b01419c32 --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/CreateSecondaryClusterRequestOrBuilder.java @@ -0,0 +1,183 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/alloydb/v1/service.proto + +package com.google.cloud.alloydb.v1; + +public interface CreateSecondaryClusterRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.alloydb.v1.CreateSecondaryClusterRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The location of the new cluster. For the required
+   * format, see the comment on the Cluster.name field.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. The location of the new cluster. For the required
+   * format, see the comment on the Cluster.name field.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * Required. ID of the requesting object (the secondary cluster).
+   * 
+ * + * string cluster_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The clusterId. + */ + java.lang.String getClusterId(); + /** + * + * + *
+   * Required. ID of the requesting object (the secondary cluster).
+   * 
+ * + * string cluster_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for clusterId. + */ + com.google.protobuf.ByteString getClusterIdBytes(); + + /** + * + * + *
+   * Required. Configuration of the requesting object (the secondary cluster).
+   * 
+ * + * .google.cloud.alloydb.v1.Cluster cluster = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the cluster field is set. + */ + boolean hasCluster(); + /** + * + * + *
+   * Required. Configuration of the requesting object (the secondary cluster).
+   * 
+ * + * .google.cloud.alloydb.v1.Cluster cluster = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The cluster. + */ + com.google.cloud.alloydb.v1.Cluster getCluster(); + /** + * + * + *
+   * Required. Configuration of the requesting object (the secondary cluster).
+   * 
+ * + * .google.cloud.alloydb.v1.Cluster cluster = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.alloydb.v1.ClusterOrBuilder getClusterOrBuilder(); + + /** + * + * + *
+   * Optional. An optional request ID to identify requests. Specify a unique
+   * request ID so that if you must retry your request, the server will know to
+   * ignore the request if it has already been completed. The server will
+   * guarantee that for at least 60 minutes since the first request.
+   *
+   * For example, consider a situation where you make an initial request and
+   * the request times out. If you make the request again with the same request
+   * ID, the server can check if original operation with the same request ID
+   * was received, and if so, will ignore the second request. This prevents
+   * clients from accidentally creating duplicate commitments.
+   *
+   * The request ID must be a valid UUID with the exception that zero UUID is
+   * not supported (00000000-0000-0000-0000-000000000000).
+   * 
+ * + * string request_id = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The requestId. + */ + java.lang.String getRequestId(); + /** + * + * + *
+   * Optional. An optional request ID to identify requests. Specify a unique
+   * request ID so that if you must retry your request, the server will know to
+   * ignore the request if it has already been completed. The server will
+   * guarantee that for at least 60 minutes since the first request.
+   *
+   * For example, consider a situation where you make an initial request and
+   * the request times out. If you make the request again with the same request
+   * ID, the server can check if original operation with the same request ID
+   * was received, and if so, will ignore the second request. This prevents
+   * clients from accidentally creating duplicate commitments.
+   *
+   * The request ID must be a valid UUID with the exception that zero UUID is
+   * not supported (00000000-0000-0000-0000-000000000000).
+   * 
+ * + * string request_id = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for requestId. + */ + com.google.protobuf.ByteString getRequestIdBytes(); + + /** + * + * + *
+   * Optional. If set, performs request validation (e.g. permission checks and
+   * any other type of validation), but do not actually execute the create
+   * request.
+   * 
+ * + * bool validate_only = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The validateOnly. + */ + boolean getValidateOnly(); +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/CreateSecondaryInstanceRequest.java b/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/CreateSecondaryInstanceRequest.java new file mode 100644 index 000000000000..9ce8b2ba482e --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/CreateSecondaryInstanceRequest.java @@ -0,0 +1,1481 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/alloydb/v1/service.proto + +package com.google.cloud.alloydb.v1; + +/** + * + * + *
+ * Message for creating a Secondary Instance
+ * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1.CreateSecondaryInstanceRequest} + */ +public final class CreateSecondaryInstanceRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.alloydb.v1.CreateSecondaryInstanceRequest) + CreateSecondaryInstanceRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use CreateSecondaryInstanceRequest.newBuilder() to construct. + private CreateSecondaryInstanceRequest( + com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private CreateSecondaryInstanceRequest() { + parent_ = ""; + instanceId_ = ""; + requestId_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new CreateSecondaryInstanceRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.alloydb.v1.ServiceProto + .internal_static_google_cloud_alloydb_v1_CreateSecondaryInstanceRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1.ServiceProto + .internal_static_google_cloud_alloydb_v1_CreateSecondaryInstanceRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1.CreateSecondaryInstanceRequest.class, + com.google.cloud.alloydb.v1.CreateSecondaryInstanceRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object parent_ = ""; + /** + * + * + *
+   * Required. The name of the parent resource. For the required format, see the
+   * comment on the Instance.name field.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + @java.lang.Override + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The name of the parent resource. For the required format, see the
+   * comment on the Instance.name field.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + @java.lang.Override + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int INSTANCE_ID_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object instanceId_ = ""; + /** + * + * + *
+   * Required. ID of the requesting object.
+   * 
+ * + * string instance_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The instanceId. + */ + @java.lang.Override + public java.lang.String getInstanceId() { + java.lang.Object ref = instanceId_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + instanceId_ = s; + return s; + } + } + /** + * + * + *
+   * Required. ID of the requesting object.
+   * 
+ * + * string instance_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for instanceId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getInstanceIdBytes() { + java.lang.Object ref = instanceId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + instanceId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int INSTANCE_FIELD_NUMBER = 3; + private com.google.cloud.alloydb.v1.Instance instance_; + /** + * + * + *
+   * Required. The resource being created
+   * 
+ * + * .google.cloud.alloydb.v1.Instance instance = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the instance field is set. + */ + @java.lang.Override + public boolean hasInstance() { + return instance_ != null; + } + /** + * + * + *
+   * Required. The resource being created
+   * 
+ * + * .google.cloud.alloydb.v1.Instance instance = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The instance. + */ + @java.lang.Override + public com.google.cloud.alloydb.v1.Instance getInstance() { + return instance_ == null + ? com.google.cloud.alloydb.v1.Instance.getDefaultInstance() + : instance_; + } + /** + * + * + *
+   * Required. The resource being created
+   * 
+ * + * .google.cloud.alloydb.v1.Instance instance = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.alloydb.v1.InstanceOrBuilder getInstanceOrBuilder() { + return instance_ == null + ? com.google.cloud.alloydb.v1.Instance.getDefaultInstance() + : instance_; + } + + public static final int REQUEST_ID_FIELD_NUMBER = 4; + + @SuppressWarnings("serial") + private volatile java.lang.Object 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).
+   * 
+ * + * string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The requestId. + */ + @java.lang.Override + public java.lang.String getRequestId() { + java.lang.Object ref = requestId_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + requestId_ = s; + return s; + } + } + /** + * + * + *
+   * Optional. An optional request ID to identify requests. Specify a unique
+   * request ID so that if you must retry your request, the server will know to
+   * ignore the request if it has already been completed. The server will
+   * guarantee that for at least 60 minutes since the first request.
+   *
+   * For example, consider a situation where you make an initial request and
+   * the request times out. If you make the request again with the same request
+   * ID, the server can check if original operation with the same request ID
+   * was received, and if so, will ignore the second request. This prevents
+   * clients from accidentally creating duplicate commitments.
+   *
+   * The request ID must be a valid UUID with the exception that zero UUID is
+   * not supported (00000000-0000-0000-0000-000000000000).
+   * 
+ * + * string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for requestId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getRequestIdBytes() { + java.lang.Object ref = requestId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + requestId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int VALIDATE_ONLY_FIELD_NUMBER = 5; + private boolean validateOnly_ = false; + /** + * + * + *
+   * Optional. If set, performs request validation (e.g. permission checks and
+   * any other type of validation), but do not actually execute the create
+   * request.
+   * 
+ * + * bool validate_only = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The validateOnly. + */ + @java.lang.Override + public boolean getValidateOnly() { + return validateOnly_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(instanceId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, instanceId_); + } + if (instance_ != null) { + output.writeMessage(3, getInstance()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(requestId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, requestId_); + } + if (validateOnly_ != false) { + output.writeBool(5, validateOnly_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(instanceId_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, instanceId_); + } + if (instance_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getInstance()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(requestId_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, requestId_); + } + if (validateOnly_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(5, validateOnly_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.alloydb.v1.CreateSecondaryInstanceRequest)) { + return super.equals(obj); + } + com.google.cloud.alloydb.v1.CreateSecondaryInstanceRequest other = + (com.google.cloud.alloydb.v1.CreateSecondaryInstanceRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (!getInstanceId().equals(other.getInstanceId())) return false; + if (hasInstance() != other.hasInstance()) return false; + if (hasInstance()) { + if (!getInstance().equals(other.getInstance())) return false; + } + if (!getRequestId().equals(other.getRequestId())) return false; + if (getValidateOnly() != other.getValidateOnly()) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + PARENT_FIELD_NUMBER; + hash = (53 * hash) + getParent().hashCode(); + hash = (37 * hash) + INSTANCE_ID_FIELD_NUMBER; + hash = (53 * hash) + getInstanceId().hashCode(); + if (hasInstance()) { + hash = (37 * hash) + INSTANCE_FIELD_NUMBER; + hash = (53 * hash) + getInstance().hashCode(); + } + hash = (37 * hash) + REQUEST_ID_FIELD_NUMBER; + hash = (53 * hash) + getRequestId().hashCode(); + hash = (37 * hash) + VALIDATE_ONLY_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getValidateOnly()); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.alloydb.v1.CreateSecondaryInstanceRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1.CreateSecondaryInstanceRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.alloydb.v1.CreateSecondaryInstanceRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1.CreateSecondaryInstanceRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.alloydb.v1.CreateSecondaryInstanceRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1.CreateSecondaryInstanceRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.alloydb.v1.CreateSecondaryInstanceRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1.CreateSecondaryInstanceRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.alloydb.v1.CreateSecondaryInstanceRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1.CreateSecondaryInstanceRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.alloydb.v1.CreateSecondaryInstanceRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1.CreateSecondaryInstanceRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.alloydb.v1.CreateSecondaryInstanceRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Message for creating a Secondary Instance
+   * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1.CreateSecondaryInstanceRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.alloydb.v1.CreateSecondaryInstanceRequest) + com.google.cloud.alloydb.v1.CreateSecondaryInstanceRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.alloydb.v1.ServiceProto + .internal_static_google_cloud_alloydb_v1_CreateSecondaryInstanceRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1.ServiceProto + .internal_static_google_cloud_alloydb_v1_CreateSecondaryInstanceRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1.CreateSecondaryInstanceRequest.class, + com.google.cloud.alloydb.v1.CreateSecondaryInstanceRequest.Builder.class); + } + + // Construct using com.google.cloud.alloydb.v1.CreateSecondaryInstanceRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + parent_ = ""; + instanceId_ = ""; + instance_ = null; + if (instanceBuilder_ != null) { + instanceBuilder_.dispose(); + instanceBuilder_ = null; + } + requestId_ = ""; + validateOnly_ = false; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.alloydb.v1.ServiceProto + .internal_static_google_cloud_alloydb_v1_CreateSecondaryInstanceRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1.CreateSecondaryInstanceRequest getDefaultInstanceForType() { + return com.google.cloud.alloydb.v1.CreateSecondaryInstanceRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.alloydb.v1.CreateSecondaryInstanceRequest build() { + com.google.cloud.alloydb.v1.CreateSecondaryInstanceRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1.CreateSecondaryInstanceRequest buildPartial() { + com.google.cloud.alloydb.v1.CreateSecondaryInstanceRequest result = + new com.google.cloud.alloydb.v1.CreateSecondaryInstanceRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.alloydb.v1.CreateSecondaryInstanceRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.parent_ = parent_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.instanceId_ = instanceId_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.instance_ = instanceBuilder_ == null ? instance_ : instanceBuilder_.build(); + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.requestId_ = requestId_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.validateOnly_ = validateOnly_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.alloydb.v1.CreateSecondaryInstanceRequest) { + return mergeFrom((com.google.cloud.alloydb.v1.CreateSecondaryInstanceRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.alloydb.v1.CreateSecondaryInstanceRequest other) { + if (other == com.google.cloud.alloydb.v1.CreateSecondaryInstanceRequest.getDefaultInstance()) + return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getInstanceId().isEmpty()) { + instanceId_ = other.instanceId_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (other.hasInstance()) { + mergeInstance(other.getInstance()); + } + if (!other.getRequestId().isEmpty()) { + requestId_ = other.requestId_; + bitField0_ |= 0x00000008; + onChanged(); + } + if (other.getValidateOnly() != false) { + setValidateOnly(other.getValidateOnly()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + parent_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + instanceId_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + input.readMessage(getInstanceFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 34: + { + requestId_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000008; + break; + } // case 34 + case 40: + { + validateOnly_ = input.readBool(); + bitField0_ |= 0x00000010; + break; + } // case 40 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * Required. The name of the parent resource. For the required format, see the
+     * comment on the Instance.name field.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The name of the parent resource. For the required format, see the
+     * comment on the Instance.name field.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The name of the parent resource. For the required format, see the
+     * comment on the Instance.name field.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The parent to set. + * @return This builder for chaining. + */ + public Builder setParent(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + parent_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the parent resource. For the required format, see the
+     * comment on the Instance.name field.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearParent() { + parent_ = getDefaultInstance().getParent(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the parent resource. For the required format, see the
+     * comment on the Instance.name field.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for parent to set. + * @return This builder for chaining. + */ + public Builder setParentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + parent_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object instanceId_ = ""; + /** + * + * + *
+     * Required. ID of the requesting object.
+     * 
+ * + * string instance_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The instanceId. + */ + public java.lang.String getInstanceId() { + java.lang.Object ref = instanceId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + instanceId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. ID of the requesting object.
+     * 
+ * + * string instance_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for instanceId. + */ + public com.google.protobuf.ByteString getInstanceIdBytes() { + java.lang.Object ref = instanceId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + instanceId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. ID of the requesting object.
+     * 
+ * + * string instance_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The instanceId to set. + * @return This builder for chaining. + */ + public Builder setInstanceId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + instanceId_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. ID of the requesting object.
+     * 
+ * + * string instance_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearInstanceId() { + instanceId_ = getDefaultInstance().getInstanceId(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. ID of the requesting object.
+     * 
+ * + * string instance_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for instanceId to set. + * @return This builder for chaining. + */ + public Builder setInstanceIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + instanceId_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private com.google.cloud.alloydb.v1.Instance instance_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1.Instance, + com.google.cloud.alloydb.v1.Instance.Builder, + com.google.cloud.alloydb.v1.InstanceOrBuilder> + instanceBuilder_; + /** + * + * + *
+     * Required. The resource being created
+     * 
+ * + * + * .google.cloud.alloydb.v1.Instance instance = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the instance field is set. + */ + public boolean hasInstance() { + return ((bitField0_ & 0x00000004) != 0); + } + /** + * + * + *
+     * Required. The resource being created
+     * 
+ * + * + * .google.cloud.alloydb.v1.Instance instance = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The instance. + */ + public com.google.cloud.alloydb.v1.Instance getInstance() { + if (instanceBuilder_ == null) { + return instance_ == null + ? com.google.cloud.alloydb.v1.Instance.getDefaultInstance() + : instance_; + } else { + return instanceBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. The resource being created
+     * 
+ * + * + * .google.cloud.alloydb.v1.Instance instance = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setInstance(com.google.cloud.alloydb.v1.Instance value) { + if (instanceBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + instance_ = value; + } else { + instanceBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The resource being created
+     * 
+ * + * + * .google.cloud.alloydb.v1.Instance instance = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setInstance(com.google.cloud.alloydb.v1.Instance.Builder builderForValue) { + if (instanceBuilder_ == null) { + instance_ = builderForValue.build(); + } else { + instanceBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The resource being created
+     * 
+ * + * + * .google.cloud.alloydb.v1.Instance instance = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeInstance(com.google.cloud.alloydb.v1.Instance value) { + if (instanceBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) + && instance_ != null + && instance_ != com.google.cloud.alloydb.v1.Instance.getDefaultInstance()) { + getInstanceBuilder().mergeFrom(value); + } else { + instance_ = value; + } + } else { + instanceBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The resource being created
+     * 
+ * + * + * .google.cloud.alloydb.v1.Instance instance = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearInstance() { + bitField0_ = (bitField0_ & ~0x00000004); + instance_ = null; + if (instanceBuilder_ != null) { + instanceBuilder_.dispose(); + instanceBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The resource being created
+     * 
+ * + * + * .google.cloud.alloydb.v1.Instance instance = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.alloydb.v1.Instance.Builder getInstanceBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return getInstanceFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. The resource being created
+     * 
+ * + * + * .google.cloud.alloydb.v1.Instance instance = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.alloydb.v1.InstanceOrBuilder getInstanceOrBuilder() { + if (instanceBuilder_ != null) { + return instanceBuilder_.getMessageOrBuilder(); + } else { + return instance_ == null + ? com.google.cloud.alloydb.v1.Instance.getDefaultInstance() + : instance_; + } + } + /** + * + * + *
+     * Required. The resource being created
+     * 
+ * + * + * .google.cloud.alloydb.v1.Instance instance = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1.Instance, + com.google.cloud.alloydb.v1.Instance.Builder, + com.google.cloud.alloydb.v1.InstanceOrBuilder> + getInstanceFieldBuilder() { + if (instanceBuilder_ == null) { + instanceBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1.Instance, + com.google.cloud.alloydb.v1.Instance.Builder, + com.google.cloud.alloydb.v1.InstanceOrBuilder>( + getInstance(), getParentForChildren(), isClean()); + instance_ = null; + } + return instanceBuilder_; + } + + private java.lang.Object 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).
+     * 
+ * + * string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The requestId. + */ + public java.lang.String getRequestId() { + java.lang.Object ref = requestId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + requestId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes since the first request.
+     *
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     *
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for requestId. + */ + public com.google.protobuf.ByteString getRequestIdBytes() { + java.lang.Object ref = requestId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + requestId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes since the first request.
+     *
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     *
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The requestId to set. + * @return This builder for chaining. + */ + public Builder setRequestId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + requestId_ = value; + bitField0_ |= 0x00000008; + onChanged(); + 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).
+     * 
+ * + * string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearRequestId() { + requestId_ = getDefaultInstance().getRequestId(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + 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).
+     * 
+ * + * string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for requestId to set. + * @return This builder for chaining. + */ + public Builder setRequestIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + requestId_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + private boolean 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.
+     * 
+ * + * bool validate_only = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The validateOnly. + */ + @java.lang.Override + public boolean getValidateOnly() { + return 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.
+     * 
+ * + * bool validate_only = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The validateOnly to set. + * @return This builder for chaining. + */ + public Builder setValidateOnly(boolean value) { + + validateOnly_ = value; + bitField0_ |= 0x00000010; + onChanged(); + 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.
+     * 
+ * + * bool validate_only = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearValidateOnly() { + bitField0_ = (bitField0_ & ~0x00000010); + validateOnly_ = false; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.alloydb.v1.CreateSecondaryInstanceRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.alloydb.v1.CreateSecondaryInstanceRequest) + private static final com.google.cloud.alloydb.v1.CreateSecondaryInstanceRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.alloydb.v1.CreateSecondaryInstanceRequest(); + } + + public static com.google.cloud.alloydb.v1.CreateSecondaryInstanceRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CreateSecondaryInstanceRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1.CreateSecondaryInstanceRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/CreateSecondaryInstanceRequestOrBuilder.java b/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/CreateSecondaryInstanceRequestOrBuilder.java new file mode 100644 index 000000000000..6022078c5ac0 --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/CreateSecondaryInstanceRequestOrBuilder.java @@ -0,0 +1,183 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/alloydb/v1/service.proto + +package com.google.cloud.alloydb.v1; + +public interface CreateSecondaryInstanceRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.alloydb.v1.CreateSecondaryInstanceRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The name of the parent resource. For the required format, see the
+   * comment on the Instance.name field.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. The name of the parent resource. For the required format, see the
+   * comment on the Instance.name field.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * Required. ID of the requesting object.
+   * 
+ * + * string instance_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The instanceId. + */ + java.lang.String getInstanceId(); + /** + * + * + *
+   * Required. ID of the requesting object.
+   * 
+ * + * string instance_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for instanceId. + */ + com.google.protobuf.ByteString getInstanceIdBytes(); + + /** + * + * + *
+   * Required. The resource being created
+   * 
+ * + * .google.cloud.alloydb.v1.Instance instance = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the instance field is set. + */ + boolean hasInstance(); + /** + * + * + *
+   * Required. The resource being created
+   * 
+ * + * .google.cloud.alloydb.v1.Instance instance = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The instance. + */ + com.google.cloud.alloydb.v1.Instance getInstance(); + /** + * + * + *
+   * Required. The resource being created
+   * 
+ * + * .google.cloud.alloydb.v1.Instance instance = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.alloydb.v1.InstanceOrBuilder getInstanceOrBuilder(); + + /** + * + * + *
+   * Optional. An optional request ID to identify requests. Specify a unique
+   * request ID so that if you must retry your request, the server will know to
+   * ignore the request if it has already been completed. The server will
+   * guarantee that for at least 60 minutes since the first request.
+   *
+   * For example, consider a situation where you make an initial request and
+   * the request times out. If you make the request again with the same request
+   * ID, the server can check if original operation with the same request ID
+   * was received, and if so, will ignore the second request. This prevents
+   * clients from accidentally creating duplicate commitments.
+   *
+   * The request ID must be a valid UUID with the exception that zero UUID is
+   * not supported (00000000-0000-0000-0000-000000000000).
+   * 
+ * + * string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The requestId. + */ + java.lang.String getRequestId(); + /** + * + * + *
+   * Optional. An optional request ID to identify requests. Specify a unique
+   * request ID so that if you must retry your request, the server will know to
+   * ignore the request if it has already been completed. The server will
+   * guarantee that for at least 60 minutes since the first request.
+   *
+   * For example, consider a situation where you make an initial request and
+   * the request times out. If you make the request again with the same request
+   * ID, the server can check if original operation with the same request ID
+   * was received, and if so, will ignore the second request. This prevents
+   * clients from accidentally creating duplicate commitments.
+   *
+   * The request ID must be a valid UUID with the exception that zero UUID is
+   * not supported (00000000-0000-0000-0000-000000000000).
+   * 
+ * + * string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for requestId. + */ + com.google.protobuf.ByteString getRequestIdBytes(); + + /** + * + * + *
+   * Optional. If set, performs request validation (e.g. permission checks and
+   * any other type of validation), but do not actually execute the create
+   * request.
+   * 
+ * + * bool validate_only = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The validateOnly. + */ + boolean getValidateOnly(); +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/CreateUserRequest.java b/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/CreateUserRequest.java new file mode 100644 index 000000000000..cf9e8baabef2 --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/CreateUserRequest.java @@ -0,0 +1,1447 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/alloydb/v1/service.proto + +package com.google.cloud.alloydb.v1; + +/** + * + * + *
+ * Message for creating a User
+ * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1.CreateUserRequest} + */ +public final class CreateUserRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.alloydb.v1.CreateUserRequest) + CreateUserRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use CreateUserRequest.newBuilder() to construct. + private CreateUserRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private CreateUserRequest() { + parent_ = ""; + userId_ = ""; + requestId_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new CreateUserRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.alloydb.v1.ServiceProto + .internal_static_google_cloud_alloydb_v1_CreateUserRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1.ServiceProto + .internal_static_google_cloud_alloydb_v1_CreateUserRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1.CreateUserRequest.class, + com.google.cloud.alloydb.v1.CreateUserRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object parent_ = ""; + /** + * + * + *
+   * Required. Value for parent.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + @java.lang.Override + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } + } + /** + * + * + *
+   * Required. Value for parent.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + @java.lang.Override + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int USER_ID_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object userId_ = ""; + /** + * + * + *
+   * Required. ID of the requesting object.
+   * 
+ * + * string user_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The userId. + */ + @java.lang.Override + public java.lang.String getUserId() { + java.lang.Object ref = userId_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + userId_ = s; + return s; + } + } + /** + * + * + *
+   * Required. ID of the requesting object.
+   * 
+ * + * string user_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for userId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getUserIdBytes() { + java.lang.Object ref = userId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + userId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int USER_FIELD_NUMBER = 3; + private com.google.cloud.alloydb.v1.User user_; + /** + * + * + *
+   * Required. The resource being created
+   * 
+ * + * .google.cloud.alloydb.v1.User user = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return Whether the user field is set. + */ + @java.lang.Override + public boolean hasUser() { + return user_ != null; + } + /** + * + * + *
+   * Required. The resource being created
+   * 
+ * + * .google.cloud.alloydb.v1.User user = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The user. + */ + @java.lang.Override + public com.google.cloud.alloydb.v1.User getUser() { + return user_ == null ? com.google.cloud.alloydb.v1.User.getDefaultInstance() : user_; + } + /** + * + * + *
+   * Required. The resource being created
+   * 
+ * + * .google.cloud.alloydb.v1.User user = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + @java.lang.Override + public com.google.cloud.alloydb.v1.UserOrBuilder getUserOrBuilder() { + return user_ == null ? com.google.cloud.alloydb.v1.User.getDefaultInstance() : user_; + } + + public static final int REQUEST_ID_FIELD_NUMBER = 4; + + @SuppressWarnings("serial") + private volatile java.lang.Object 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).
+   * 
+ * + * string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The requestId. + */ + @java.lang.Override + public java.lang.String getRequestId() { + java.lang.Object ref = requestId_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + requestId_ = s; + return s; + } + } + /** + * + * + *
+   * Optional. An optional request ID to identify requests. Specify a unique
+   * request ID so that if you must retry your request, the server will know to
+   * ignore the request if it has already been completed. The server will
+   * guarantee that for at least 60 minutes since the first request.
+   *
+   * For example, consider a situation where you make an initial request and
+   * the request times out. If you make the request again with the same request
+   * ID, the server can check if original operation with the same request ID
+   * was received, and if so, will ignore the second request. This prevents
+   * clients from accidentally creating duplicate commitments.
+   *
+   * The request ID must be a valid UUID with the exception that zero UUID is
+   * not supported (00000000-0000-0000-0000-000000000000).
+   * 
+ * + * string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for requestId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getRequestIdBytes() { + java.lang.Object ref = requestId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + requestId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int VALIDATE_ONLY_FIELD_NUMBER = 5; + private boolean validateOnly_ = false; + /** + * + * + *
+   * Optional. If set, the backend validates the request, but doesn't actually
+   * execute it.
+   * 
+ * + * bool validate_only = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The validateOnly. + */ + @java.lang.Override + public boolean getValidateOnly() { + return validateOnly_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(userId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, userId_); + } + if (user_ != null) { + output.writeMessage(3, getUser()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(requestId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, requestId_); + } + if (validateOnly_ != false) { + output.writeBool(5, validateOnly_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(userId_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, userId_); + } + if (user_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getUser()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(requestId_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, requestId_); + } + if (validateOnly_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(5, validateOnly_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.alloydb.v1.CreateUserRequest)) { + return super.equals(obj); + } + com.google.cloud.alloydb.v1.CreateUserRequest other = + (com.google.cloud.alloydb.v1.CreateUserRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (!getUserId().equals(other.getUserId())) return false; + if (hasUser() != other.hasUser()) return false; + if (hasUser()) { + if (!getUser().equals(other.getUser())) return false; + } + if (!getRequestId().equals(other.getRequestId())) return false; + if (getValidateOnly() != other.getValidateOnly()) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + PARENT_FIELD_NUMBER; + hash = (53 * hash) + getParent().hashCode(); + hash = (37 * hash) + USER_ID_FIELD_NUMBER; + hash = (53 * hash) + getUserId().hashCode(); + if (hasUser()) { + hash = (37 * hash) + USER_FIELD_NUMBER; + hash = (53 * hash) + getUser().hashCode(); + } + hash = (37 * hash) + REQUEST_ID_FIELD_NUMBER; + hash = (53 * hash) + getRequestId().hashCode(); + hash = (37 * hash) + VALIDATE_ONLY_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getValidateOnly()); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.alloydb.v1.CreateUserRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1.CreateUserRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.alloydb.v1.CreateUserRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1.CreateUserRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.alloydb.v1.CreateUserRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1.CreateUserRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.alloydb.v1.CreateUserRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1.CreateUserRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.alloydb.v1.CreateUserRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1.CreateUserRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.alloydb.v1.CreateUserRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1.CreateUserRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.alloydb.v1.CreateUserRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Message for creating a User
+   * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1.CreateUserRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.alloydb.v1.CreateUserRequest) + com.google.cloud.alloydb.v1.CreateUserRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.alloydb.v1.ServiceProto + .internal_static_google_cloud_alloydb_v1_CreateUserRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1.ServiceProto + .internal_static_google_cloud_alloydb_v1_CreateUserRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1.CreateUserRequest.class, + com.google.cloud.alloydb.v1.CreateUserRequest.Builder.class); + } + + // Construct using com.google.cloud.alloydb.v1.CreateUserRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + parent_ = ""; + userId_ = ""; + user_ = null; + if (userBuilder_ != null) { + userBuilder_.dispose(); + userBuilder_ = null; + } + requestId_ = ""; + validateOnly_ = false; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.alloydb.v1.ServiceProto + .internal_static_google_cloud_alloydb_v1_CreateUserRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1.CreateUserRequest getDefaultInstanceForType() { + return com.google.cloud.alloydb.v1.CreateUserRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.alloydb.v1.CreateUserRequest build() { + com.google.cloud.alloydb.v1.CreateUserRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1.CreateUserRequest buildPartial() { + com.google.cloud.alloydb.v1.CreateUserRequest result = + new com.google.cloud.alloydb.v1.CreateUserRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.alloydb.v1.CreateUserRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.parent_ = parent_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.userId_ = userId_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.user_ = userBuilder_ == null ? user_ : userBuilder_.build(); + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.requestId_ = requestId_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.validateOnly_ = validateOnly_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.alloydb.v1.CreateUserRequest) { + return mergeFrom((com.google.cloud.alloydb.v1.CreateUserRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.alloydb.v1.CreateUserRequest other) { + if (other == com.google.cloud.alloydb.v1.CreateUserRequest.getDefaultInstance()) return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getUserId().isEmpty()) { + userId_ = other.userId_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (other.hasUser()) { + mergeUser(other.getUser()); + } + if (!other.getRequestId().isEmpty()) { + requestId_ = other.requestId_; + bitField0_ |= 0x00000008; + onChanged(); + } + if (other.getValidateOnly() != false) { + setValidateOnly(other.getValidateOnly()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + parent_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + userId_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + input.readMessage(getUserFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 34: + { + requestId_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000008; + break; + } // case 34 + case 40: + { + validateOnly_ = input.readBool(); + bitField0_ |= 0x00000010; + break; + } // case 40 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * Required. Value for parent.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. Value for parent.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. Value for parent.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The parent to set. + * @return This builder for chaining. + */ + public Builder setParent(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + parent_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Value for parent.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearParent() { + parent_ = getDefaultInstance().getParent(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Value for parent.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for parent to set. + * @return This builder for chaining. + */ + public Builder setParentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + parent_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object userId_ = ""; + /** + * + * + *
+     * Required. ID of the requesting object.
+     * 
+ * + * string user_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The userId. + */ + public java.lang.String getUserId() { + java.lang.Object ref = userId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + userId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. ID of the requesting object.
+     * 
+ * + * string user_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for userId. + */ + public com.google.protobuf.ByteString getUserIdBytes() { + java.lang.Object ref = userId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + userId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. ID of the requesting object.
+     * 
+ * + * string user_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The userId to set. + * @return This builder for chaining. + */ + public Builder setUserId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + userId_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. ID of the requesting object.
+     * 
+ * + * string user_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearUserId() { + userId_ = getDefaultInstance().getUserId(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. ID of the requesting object.
+     * 
+ * + * string user_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for userId to set. + * @return This builder for chaining. + */ + public Builder setUserIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + userId_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private com.google.cloud.alloydb.v1.User user_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1.User, + com.google.cloud.alloydb.v1.User.Builder, + com.google.cloud.alloydb.v1.UserOrBuilder> + userBuilder_; + /** + * + * + *
+     * Required. The resource being created
+     * 
+ * + * .google.cloud.alloydb.v1.User user = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the user field is set. + */ + public boolean hasUser() { + return ((bitField0_ & 0x00000004) != 0); + } + /** + * + * + *
+     * Required. The resource being created
+     * 
+ * + * .google.cloud.alloydb.v1.User user = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The user. + */ + public com.google.cloud.alloydb.v1.User getUser() { + if (userBuilder_ == null) { + return user_ == null ? com.google.cloud.alloydb.v1.User.getDefaultInstance() : user_; + } else { + return userBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. The resource being created
+     * 
+ * + * .google.cloud.alloydb.v1.User user = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setUser(com.google.cloud.alloydb.v1.User value) { + if (userBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + user_ = value; + } else { + userBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The resource being created
+     * 
+ * + * .google.cloud.alloydb.v1.User user = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setUser(com.google.cloud.alloydb.v1.User.Builder builderForValue) { + if (userBuilder_ == null) { + user_ = builderForValue.build(); + } else { + userBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The resource being created
+     * 
+ * + * .google.cloud.alloydb.v1.User user = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeUser(com.google.cloud.alloydb.v1.User value) { + if (userBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) + && user_ != null + && user_ != com.google.cloud.alloydb.v1.User.getDefaultInstance()) { + getUserBuilder().mergeFrom(value); + } else { + user_ = value; + } + } else { + userBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The resource being created
+     * 
+ * + * .google.cloud.alloydb.v1.User user = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearUser() { + bitField0_ = (bitField0_ & ~0x00000004); + user_ = null; + if (userBuilder_ != null) { + userBuilder_.dispose(); + userBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The resource being created
+     * 
+ * + * .google.cloud.alloydb.v1.User user = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.alloydb.v1.User.Builder getUserBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return getUserFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. The resource being created
+     * 
+ * + * .google.cloud.alloydb.v1.User user = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.alloydb.v1.UserOrBuilder getUserOrBuilder() { + if (userBuilder_ != null) { + return userBuilder_.getMessageOrBuilder(); + } else { + return user_ == null ? com.google.cloud.alloydb.v1.User.getDefaultInstance() : user_; + } + } + /** + * + * + *
+     * Required. The resource being created
+     * 
+ * + * .google.cloud.alloydb.v1.User user = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1.User, + com.google.cloud.alloydb.v1.User.Builder, + com.google.cloud.alloydb.v1.UserOrBuilder> + getUserFieldBuilder() { + if (userBuilder_ == null) { + userBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1.User, + com.google.cloud.alloydb.v1.User.Builder, + com.google.cloud.alloydb.v1.UserOrBuilder>( + getUser(), getParentForChildren(), isClean()); + user_ = null; + } + return userBuilder_; + } + + private java.lang.Object 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).
+     * 
+ * + * string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The requestId. + */ + public java.lang.String getRequestId() { + java.lang.Object ref = requestId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + requestId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes since the first request.
+     *
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     *
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for requestId. + */ + public com.google.protobuf.ByteString getRequestIdBytes() { + java.lang.Object ref = requestId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + requestId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes since the first request.
+     *
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     *
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The requestId to set. + * @return This builder for chaining. + */ + public Builder setRequestId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + requestId_ = value; + bitField0_ |= 0x00000008; + onChanged(); + 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).
+     * 
+ * + * string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearRequestId() { + requestId_ = getDefaultInstance().getRequestId(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + 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).
+     * 
+ * + * string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for requestId to set. + * @return This builder for chaining. + */ + public Builder setRequestIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + requestId_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + private boolean validateOnly_; + /** + * + * + *
+     * Optional. If set, the backend validates the request, but doesn't actually
+     * execute it.
+     * 
+ * + * bool validate_only = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The validateOnly. + */ + @java.lang.Override + public boolean getValidateOnly() { + return validateOnly_; + } + /** + * + * + *
+     * Optional. If set, the backend validates the request, but doesn't actually
+     * execute it.
+     * 
+ * + * bool validate_only = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The validateOnly to set. + * @return This builder for chaining. + */ + public Builder setValidateOnly(boolean value) { + + validateOnly_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. If set, the backend validates the request, but doesn't actually
+     * execute it.
+     * 
+ * + * bool validate_only = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearValidateOnly() { + bitField0_ = (bitField0_ & ~0x00000010); + validateOnly_ = false; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.alloydb.v1.CreateUserRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.alloydb.v1.CreateUserRequest) + private static final com.google.cloud.alloydb.v1.CreateUserRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.alloydb.v1.CreateUserRequest(); + } + + public static com.google.cloud.alloydb.v1.CreateUserRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CreateUserRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1.CreateUserRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/CreateUserRequestOrBuilder.java b/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/CreateUserRequestOrBuilder.java new file mode 100644 index 000000000000..2f5fb8b2ccc1 --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/CreateUserRequestOrBuilder.java @@ -0,0 +1,177 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/alloydb/v1/service.proto + +package com.google.cloud.alloydb.v1; + +public interface CreateUserRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.alloydb.v1.CreateUserRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Value for parent.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. Value for parent.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * Required. ID of the requesting object.
+   * 
+ * + * string user_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The userId. + */ + java.lang.String getUserId(); + /** + * + * + *
+   * Required. ID of the requesting object.
+   * 
+ * + * string user_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for userId. + */ + com.google.protobuf.ByteString getUserIdBytes(); + + /** + * + * + *
+   * Required. The resource being created
+   * 
+ * + * .google.cloud.alloydb.v1.User user = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return Whether the user field is set. + */ + boolean hasUser(); + /** + * + * + *
+   * Required. The resource being created
+   * 
+ * + * .google.cloud.alloydb.v1.User user = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The user. + */ + com.google.cloud.alloydb.v1.User getUser(); + /** + * + * + *
+   * Required. The resource being created
+   * 
+ * + * .google.cloud.alloydb.v1.User user = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + com.google.cloud.alloydb.v1.UserOrBuilder getUserOrBuilder(); + + /** + * + * + *
+   * Optional. An optional request ID to identify requests. Specify a unique
+   * request ID so that if you must retry your request, the server will know to
+   * ignore the request if it has already been completed. The server will
+   * guarantee that for at least 60 minutes since the first request.
+   *
+   * For example, consider a situation where you make an initial request and
+   * the request times out. If you make the request again with the same request
+   * ID, the server can check if original operation with the same request ID
+   * was received, and if so, will ignore the second request. This prevents
+   * clients from accidentally creating duplicate commitments.
+   *
+   * The request ID must be a valid UUID with the exception that zero UUID is
+   * not supported (00000000-0000-0000-0000-000000000000).
+   * 
+ * + * string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The requestId. + */ + java.lang.String getRequestId(); + /** + * + * + *
+   * Optional. An optional request ID to identify requests. Specify a unique
+   * request ID so that if you must retry your request, the server will know to
+   * ignore the request if it has already been completed. The server will
+   * guarantee that for at least 60 minutes since the first request.
+   *
+   * For example, consider a situation where you make an initial request and
+   * the request times out. If you make the request again with the same request
+   * ID, the server can check if original operation with the same request ID
+   * was received, and if so, will ignore the second request. This prevents
+   * clients from accidentally creating duplicate commitments.
+   *
+   * The request ID must be a valid UUID with the exception that zero UUID is
+   * not supported (00000000-0000-0000-0000-000000000000).
+   * 
+ * + * string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for requestId. + */ + com.google.protobuf.ByteString getRequestIdBytes(); + + /** + * + * + *
+   * Optional. If set, the backend validates the request, but doesn't actually
+   * execute it.
+   * 
+ * + * bool validate_only = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The validateOnly. + */ + boolean getValidateOnly(); +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/DatabaseVersion.java b/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/DatabaseVersion.java index 7bf9fd308a3a..e58efb871140 100644 --- a/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/DatabaseVersion.java +++ b/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/DatabaseVersion.java @@ -152,7 +152,7 @@ public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType } public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { - return com.google.cloud.alloydb.v1.ResourcesProto.getDescriptor().getEnumTypes().get(0); + return com.google.cloud.alloydb.v1.ResourcesProto.getDescriptor().getEnumTypes().get(2); } private static final DatabaseVersion[] VALUES = values(); diff --git a/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/DeleteUserRequest.java b/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/DeleteUserRequest.java new file mode 100644 index 000000000000..814364224246 --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/DeleteUserRequest.java @@ -0,0 +1,1007 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/alloydb/v1/service.proto + +package com.google.cloud.alloydb.v1; + +/** + * + * + *
+ * Message for deleting a User
+ * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1.DeleteUserRequest} + */ +public final class DeleteUserRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.alloydb.v1.DeleteUserRequest) + DeleteUserRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use DeleteUserRequest.newBuilder() to construct. + private DeleteUserRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private DeleteUserRequest() { + name_ = ""; + requestId_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new DeleteUserRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.alloydb.v1.ServiceProto + .internal_static_google_cloud_alloydb_v1_DeleteUserRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1.ServiceProto + .internal_static_google_cloud_alloydb_v1_DeleteUserRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1.DeleteUserRequest.class, + com.google.cloud.alloydb.v1.DeleteUserRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + * + * + *
+   * Required. The name of the resource. For the required format, see the
+   * comment on the User.name field.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The name of the resource. For the required format, see the
+   * comment on the User.name field.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int REQUEST_ID_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object 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).
+   * 
+ * + * string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The requestId. + */ + @java.lang.Override + public java.lang.String getRequestId() { + java.lang.Object ref = requestId_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + requestId_ = s; + return s; + } + } + /** + * + * + *
+   * Optional. An optional request ID to identify requests. Specify a unique
+   * request ID so that if you must retry your request, the server will know to
+   * ignore the request if it has already been completed. The server will
+   * guarantee that for at least 60 minutes after the first request.
+   *
+   * For example, consider a situation where you make an initial request and
+   * the request times out. If you make the request again with the same request
+   * ID, the server can check if original operation with the same request ID
+   * was received, and if so, will ignore the second request. This prevents
+   * clients from accidentally creating duplicate commitments.
+   *
+   * The request ID must be a valid UUID with the exception that zero UUID is
+   * not supported (00000000-0000-0000-0000-000000000000).
+   * 
+ * + * string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for requestId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getRequestIdBytes() { + java.lang.Object ref = requestId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + requestId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int VALIDATE_ONLY_FIELD_NUMBER = 3; + private boolean validateOnly_ = false; + /** + * + * + *
+   * Optional. If set, the backend validates the request, but doesn't actually
+   * execute it.
+   * 
+ * + * bool validate_only = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The validateOnly. + */ + @java.lang.Override + public boolean getValidateOnly() { + return validateOnly_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(requestId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, requestId_); + } + if (validateOnly_ != false) { + output.writeBool(3, validateOnly_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(requestId_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, requestId_); + } + if (validateOnly_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(3, validateOnly_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.alloydb.v1.DeleteUserRequest)) { + return super.equals(obj); + } + com.google.cloud.alloydb.v1.DeleteUserRequest other = + (com.google.cloud.alloydb.v1.DeleteUserRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (!getRequestId().equals(other.getRequestId())) return false; + if (getValidateOnly() != other.getValidateOnly()) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (37 * hash) + REQUEST_ID_FIELD_NUMBER; + hash = (53 * hash) + getRequestId().hashCode(); + hash = (37 * hash) + VALIDATE_ONLY_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getValidateOnly()); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.alloydb.v1.DeleteUserRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1.DeleteUserRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.alloydb.v1.DeleteUserRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1.DeleteUserRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.alloydb.v1.DeleteUserRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1.DeleteUserRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.alloydb.v1.DeleteUserRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1.DeleteUserRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.alloydb.v1.DeleteUserRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1.DeleteUserRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.alloydb.v1.DeleteUserRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1.DeleteUserRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.alloydb.v1.DeleteUserRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Message for deleting a User
+   * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1.DeleteUserRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.alloydb.v1.DeleteUserRequest) + com.google.cloud.alloydb.v1.DeleteUserRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.alloydb.v1.ServiceProto + .internal_static_google_cloud_alloydb_v1_DeleteUserRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1.ServiceProto + .internal_static_google_cloud_alloydb_v1_DeleteUserRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1.DeleteUserRequest.class, + com.google.cloud.alloydb.v1.DeleteUserRequest.Builder.class); + } + + // Construct using com.google.cloud.alloydb.v1.DeleteUserRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + requestId_ = ""; + validateOnly_ = false; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.alloydb.v1.ServiceProto + .internal_static_google_cloud_alloydb_v1_DeleteUserRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1.DeleteUserRequest getDefaultInstanceForType() { + return com.google.cloud.alloydb.v1.DeleteUserRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.alloydb.v1.DeleteUserRequest build() { + com.google.cloud.alloydb.v1.DeleteUserRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1.DeleteUserRequest buildPartial() { + com.google.cloud.alloydb.v1.DeleteUserRequest result = + new com.google.cloud.alloydb.v1.DeleteUserRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.alloydb.v1.DeleteUserRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.requestId_ = requestId_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.validateOnly_ = validateOnly_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.alloydb.v1.DeleteUserRequest) { + return mergeFrom((com.google.cloud.alloydb.v1.DeleteUserRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.alloydb.v1.DeleteUserRequest other) { + if (other == com.google.cloud.alloydb.v1.DeleteUserRequest.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getRequestId().isEmpty()) { + requestId_ = other.requestId_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (other.getValidateOnly() != false) { + setValidateOnly(other.getValidateOnly()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + requestId_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 24: + { + validateOnly_ = input.readBool(); + bitField0_ |= 0x00000004; + break; + } // case 24 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. The name of the resource. For the required format, see the
+     * comment on the User.name field.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The name of the resource. For the required format, see the
+     * comment on the User.name field.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The name of the resource. For the required format, see the
+     * comment on the User.name field.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the resource. For the required format, see the
+     * comment on the User.name field.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the resource. For the required format, see the
+     * comment on the User.name field.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object 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).
+     * 
+ * + * string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The requestId. + */ + public java.lang.String getRequestId() { + java.lang.Object ref = requestId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + requestId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes after the first request.
+     *
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     *
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for requestId. + */ + public com.google.protobuf.ByteString getRequestIdBytes() { + java.lang.Object ref = requestId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + requestId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes after the first request.
+     *
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     *
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The requestId to set. + * @return This builder for chaining. + */ + public Builder setRequestId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + requestId_ = value; + bitField0_ |= 0x00000002; + onChanged(); + 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).
+     * 
+ * + * string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearRequestId() { + requestId_ = getDefaultInstance().getRequestId(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + 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).
+     * 
+ * + * string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for requestId to set. + * @return This builder for chaining. + */ + public Builder setRequestIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + requestId_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private boolean validateOnly_; + /** + * + * + *
+     * Optional. If set, the backend validates the request, but doesn't actually
+     * execute it.
+     * 
+ * + * bool validate_only = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The validateOnly. + */ + @java.lang.Override + public boolean getValidateOnly() { + return validateOnly_; + } + /** + * + * + *
+     * Optional. If set, the backend validates the request, but doesn't actually
+     * execute it.
+     * 
+ * + * bool validate_only = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The validateOnly to set. + * @return This builder for chaining. + */ + public Builder setValidateOnly(boolean value) { + + validateOnly_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. If set, the backend validates the request, but doesn't actually
+     * execute it.
+     * 
+ * + * bool validate_only = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearValidateOnly() { + bitField0_ = (bitField0_ & ~0x00000004); + validateOnly_ = false; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.alloydb.v1.DeleteUserRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.alloydb.v1.DeleteUserRequest) + private static final com.google.cloud.alloydb.v1.DeleteUserRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.alloydb.v1.DeleteUserRequest(); + } + + public static com.google.cloud.alloydb.v1.DeleteUserRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DeleteUserRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1.DeleteUserRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/DeleteUserRequestOrBuilder.java b/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/DeleteUserRequestOrBuilder.java new file mode 100644 index 000000000000..ff78aa8d78bc --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/DeleteUserRequestOrBuilder.java @@ -0,0 +1,119 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/alloydb/v1/service.proto + +package com.google.cloud.alloydb.v1; + +public interface DeleteUserRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.alloydb.v1.DeleteUserRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The name of the resource. For the required format, see the
+   * comment on the User.name field.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. The name of the resource. For the required format, see the
+   * comment on the User.name field.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * Optional. An optional request ID to identify requests. Specify a unique
+   * request ID so that if you must retry your request, the server will know to
+   * ignore the request if it has already been completed. The server will
+   * guarantee that for at least 60 minutes after the first request.
+   *
+   * For example, consider a situation where you make an initial request and
+   * the request times out. If you make the request again with the same request
+   * ID, the server can check if original operation with the same request ID
+   * was received, and if so, will ignore the second request. This prevents
+   * clients from accidentally creating duplicate commitments.
+   *
+   * The request ID must be a valid UUID with the exception that zero UUID is
+   * not supported (00000000-0000-0000-0000-000000000000).
+   * 
+ * + * string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The requestId. + */ + java.lang.String getRequestId(); + /** + * + * + *
+   * Optional. An optional request ID to identify requests. Specify a unique
+   * request ID so that if you must retry your request, the server will know to
+   * ignore the request if it has already been completed. The server will
+   * guarantee that for at least 60 minutes after the first request.
+   *
+   * For example, consider a situation where you make an initial request and
+   * the request times out. If you make the request again with the same request
+   * ID, the server can check if original operation with the same request ID
+   * was received, and if so, will ignore the second request. This prevents
+   * clients from accidentally creating duplicate commitments.
+   *
+   * The request ID must be a valid UUID with the exception that zero UUID is
+   * not supported (00000000-0000-0000-0000-000000000000).
+   * 
+ * + * string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for requestId. + */ + com.google.protobuf.ByteString getRequestIdBytes(); + + /** + * + * + *
+   * Optional. If set, the backend validates the request, but doesn't actually
+   * execute it.
+   * 
+ * + * bool validate_only = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The validateOnly. + */ + boolean getValidateOnly(); +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/GetClusterRequest.java b/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/GetClusterRequest.java index 097d08e7aad6..0bd7dc41e4ae 100644 --- a/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/GetClusterRequest.java +++ b/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/GetClusterRequest.java @@ -39,6 +39,7 @@ private GetClusterRequest(com.google.protobuf.GeneratedMessageV3.Builder buil private GetClusterRequest() { name_ = ""; + view_ = 0; } @java.lang.Override @@ -119,6 +120,45 @@ public com.google.protobuf.ByteString getNameBytes() { } } + public static final int VIEW_FIELD_NUMBER = 2; + private int view_ = 0; + /** + * + * + *
+   * Optional. The view of the cluster to return. Returns all default fields if
+   * not set.
+   * 
+ * + * .google.cloud.alloydb.v1.ClusterView view = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The enum numeric value on the wire for view. + */ + @java.lang.Override + public int getViewValue() { + return view_; + } + /** + * + * + *
+   * Optional. The view of the cluster to return. Returns all default fields if
+   * not set.
+   * 
+ * + * .google.cloud.alloydb.v1.ClusterView view = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The view. + */ + @java.lang.Override + public com.google.cloud.alloydb.v1.ClusterView getView() { + com.google.cloud.alloydb.v1.ClusterView result = + com.google.cloud.alloydb.v1.ClusterView.forNumber(view_); + return result == null ? com.google.cloud.alloydb.v1.ClusterView.UNRECOGNIZED : result; + } + private byte memoizedIsInitialized = -1; @java.lang.Override @@ -136,6 +176,9 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); } + if (view_ != com.google.cloud.alloydb.v1.ClusterView.CLUSTER_VIEW_UNSPECIFIED.getNumber()) { + output.writeEnum(2, view_); + } getUnknownFields().writeTo(output); } @@ -148,6 +191,9 @@ public int getSerializedSize() { if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); } + if (view_ != com.google.cloud.alloydb.v1.ClusterView.CLUSTER_VIEW_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(2, view_); + } size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; @@ -165,6 +211,7 @@ public boolean equals(final java.lang.Object obj) { (com.google.cloud.alloydb.v1.GetClusterRequest) obj; if (!getName().equals(other.getName())) return false; + if (view_ != other.view_) return false; if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -178,6 +225,8 @@ public int hashCode() { hash = (19 * hash) + getDescriptor().hashCode(); hash = (37 * hash) + NAME_FIELD_NUMBER; hash = (53 * hash) + getName().hashCode(); + hash = (37 * hash) + VIEW_FIELD_NUMBER; + hash = (53 * hash) + view_; hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; @@ -318,6 +367,7 @@ public Builder clear() { super.clear(); bitField0_ = 0; name_ = ""; + view_ = 0; return this; } @@ -357,6 +407,9 @@ private void buildPartial0(com.google.cloud.alloydb.v1.GetClusterRequest result) if (((from_bitField0_ & 0x00000001) != 0)) { result.name_ = name_; } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.view_ = view_; + } } @java.lang.Override @@ -409,6 +462,9 @@ public Builder mergeFrom(com.google.cloud.alloydb.v1.GetClusterRequest other) { bitField0_ |= 0x00000001; onChanged(); } + if (other.view_ != 0) { + setViewValue(other.getViewValue()); + } this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; @@ -441,6 +497,12 @@ public Builder mergeFrom( bitField0_ |= 0x00000001; break; } // case 10 + case 16: + { + view_ = input.readEnum(); + bitField0_ |= 0x00000002; + break; + } // case 16 default: { if (!super.parseUnknownField(input, extensionRegistry, tag)) { @@ -581,6 +643,111 @@ public Builder setNameBytes(com.google.protobuf.ByteString value) { return this; } + private int view_ = 0; + /** + * + * + *
+     * Optional. The view of the cluster to return. Returns all default fields if
+     * not set.
+     * 
+ * + * + * .google.cloud.alloydb.v1.ClusterView view = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The enum numeric value on the wire for view. + */ + @java.lang.Override + public int getViewValue() { + return view_; + } + /** + * + * + *
+     * Optional. The view of the cluster to return. Returns all default fields if
+     * not set.
+     * 
+ * + * + * .google.cloud.alloydb.v1.ClusterView view = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param value The enum numeric value on the wire for view to set. + * @return This builder for chaining. + */ + public Builder setViewValue(int value) { + view_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The view of the cluster to return. Returns all default fields if
+     * not set.
+     * 
+ * + * + * .google.cloud.alloydb.v1.ClusterView view = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The view. + */ + @java.lang.Override + public com.google.cloud.alloydb.v1.ClusterView getView() { + com.google.cloud.alloydb.v1.ClusterView result = + com.google.cloud.alloydb.v1.ClusterView.forNumber(view_); + return result == null ? com.google.cloud.alloydb.v1.ClusterView.UNRECOGNIZED : result; + } + /** + * + * + *
+     * Optional. The view of the cluster to return. Returns all default fields if
+     * not set.
+     * 
+ * + * + * .google.cloud.alloydb.v1.ClusterView view = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param value The view to set. + * @return This builder for chaining. + */ + public Builder setView(com.google.cloud.alloydb.v1.ClusterView value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000002; + view_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The view of the cluster to return. Returns all default fields if
+     * not set.
+     * 
+ * + * + * .google.cloud.alloydb.v1.ClusterView view = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return This builder for chaining. + */ + public Builder clearView() { + bitField0_ = (bitField0_ & ~0x00000002); + view_ = 0; + onChanged(); + return this; + } + @java.lang.Override public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { return super.setUnknownFields(unknownFields); diff --git a/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/GetClusterRequestOrBuilder.java b/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/GetClusterRequestOrBuilder.java index 7321fec492b8..6bd6d01b8949 100644 --- a/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/GetClusterRequestOrBuilder.java +++ b/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/GetClusterRequestOrBuilder.java @@ -53,4 +53,33 @@ public interface GetClusterRequestOrBuilder * @return The bytes for name. */ com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * Optional. The view of the cluster to return. Returns all default fields if
+   * not set.
+   * 
+ * + * .google.cloud.alloydb.v1.ClusterView view = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The enum numeric value on the wire for view. + */ + int getViewValue(); + /** + * + * + *
+   * Optional. The view of the cluster to return. Returns all default fields if
+   * not set.
+   * 
+ * + * .google.cloud.alloydb.v1.ClusterView view = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The view. + */ + com.google.cloud.alloydb.v1.ClusterView getView(); } diff --git a/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/GetUserRequest.java b/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/GetUserRequest.java new file mode 100644 index 000000000000..fa8c838000e2 --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/GetUserRequest.java @@ -0,0 +1,644 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/alloydb/v1/service.proto + +package com.google.cloud.alloydb.v1; + +/** + * + * + *
+ * Message for getting a User
+ * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1.GetUserRequest} + */ +public final class GetUserRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.alloydb.v1.GetUserRequest) + GetUserRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use GetUserRequest.newBuilder() to construct. + private GetUserRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private GetUserRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new GetUserRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.alloydb.v1.ServiceProto + .internal_static_google_cloud_alloydb_v1_GetUserRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1.ServiceProto + .internal_static_google_cloud_alloydb_v1_GetUserRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1.GetUserRequest.class, + com.google.cloud.alloydb.v1.GetUserRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + * + * + *
+   * Required. The name of the resource. For the required format, see the
+   * comment on the User.name field.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The name of the resource. For the required format, see the
+   * comment on the User.name field.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.alloydb.v1.GetUserRequest)) { + return super.equals(obj); + } + com.google.cloud.alloydb.v1.GetUserRequest other = + (com.google.cloud.alloydb.v1.GetUserRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.alloydb.v1.GetUserRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1.GetUserRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.alloydb.v1.GetUserRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1.GetUserRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.alloydb.v1.GetUserRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1.GetUserRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.alloydb.v1.GetUserRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1.GetUserRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.alloydb.v1.GetUserRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1.GetUserRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.alloydb.v1.GetUserRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1.GetUserRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.alloydb.v1.GetUserRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Message for getting a User
+   * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1.GetUserRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.alloydb.v1.GetUserRequest) + com.google.cloud.alloydb.v1.GetUserRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.alloydb.v1.ServiceProto + .internal_static_google_cloud_alloydb_v1_GetUserRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1.ServiceProto + .internal_static_google_cloud_alloydb_v1_GetUserRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1.GetUserRequest.class, + com.google.cloud.alloydb.v1.GetUserRequest.Builder.class); + } + + // Construct using com.google.cloud.alloydb.v1.GetUserRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.alloydb.v1.ServiceProto + .internal_static_google_cloud_alloydb_v1_GetUserRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1.GetUserRequest getDefaultInstanceForType() { + return com.google.cloud.alloydb.v1.GetUserRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.alloydb.v1.GetUserRequest build() { + com.google.cloud.alloydb.v1.GetUserRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1.GetUserRequest buildPartial() { + com.google.cloud.alloydb.v1.GetUserRequest result = + new com.google.cloud.alloydb.v1.GetUserRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.alloydb.v1.GetUserRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.alloydb.v1.GetUserRequest) { + return mergeFrom((com.google.cloud.alloydb.v1.GetUserRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.alloydb.v1.GetUserRequest other) { + if (other == com.google.cloud.alloydb.v1.GetUserRequest.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. The name of the resource. For the required format, see the
+     * comment on the User.name field.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The name of the resource. For the required format, see the
+     * comment on the User.name field.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The name of the resource. For the required format, see the
+     * comment on the User.name field.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the resource. For the required format, see the
+     * comment on the User.name field.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the resource. For the required format, see the
+     * comment on the User.name field.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.alloydb.v1.GetUserRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.alloydb.v1.GetUserRequest) + private static final com.google.cloud.alloydb.v1.GetUserRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.alloydb.v1.GetUserRequest(); + } + + public static com.google.cloud.alloydb.v1.GetUserRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GetUserRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1.GetUserRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/GetUserRequestOrBuilder.java b/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/GetUserRequestOrBuilder.java new file mode 100644 index 000000000000..4fa7bcbce764 --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/GetUserRequestOrBuilder.java @@ -0,0 +1,56 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/alloydb/v1/service.proto + +package com.google.cloud.alloydb.v1; + +public interface GetUserRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.alloydb.v1.GetUserRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The name of the resource. For the required format, see the
+   * comment on the User.name field.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. The name of the resource. For the required format, see the
+   * comment on the User.name field.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/InjectFaultRequest.java b/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/InjectFaultRequest.java new file mode 100644 index 000000000000..ba3074460d5c --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/InjectFaultRequest.java @@ -0,0 +1,1317 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/alloydb/v1/service.proto + +package com.google.cloud.alloydb.v1; + +/** + * + * + *
+ * Message for triggering fault injection on an instance
+ * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1.InjectFaultRequest} + */ +public final class InjectFaultRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.alloydb.v1.InjectFaultRequest) + InjectFaultRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use InjectFaultRequest.newBuilder() to construct. + private InjectFaultRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private InjectFaultRequest() { + faultType_ = 0; + name_ = ""; + requestId_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new InjectFaultRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.alloydb.v1.ServiceProto + .internal_static_google_cloud_alloydb_v1_InjectFaultRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1.ServiceProto + .internal_static_google_cloud_alloydb_v1_InjectFaultRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1.InjectFaultRequest.class, + com.google.cloud.alloydb.v1.InjectFaultRequest.Builder.class); + } + + /** + * + * + *
+   * FaultType contains all valid types of faults that can be injected to an
+   * instance.
+   * 
+ * + * Protobuf enum {@code google.cloud.alloydb.v1.InjectFaultRequest.FaultType} + */ + public enum FaultType implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * The fault type is unknown.
+     * 
+ * + * FAULT_TYPE_UNSPECIFIED = 0; + */ + FAULT_TYPE_UNSPECIFIED(0), + /** + * + * + *
+     * Stop the VM
+     * 
+ * + * STOP_VM = 1; + */ + STOP_VM(1), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * The fault type is unknown.
+     * 
+ * + * FAULT_TYPE_UNSPECIFIED = 0; + */ + public static final int FAULT_TYPE_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * Stop the VM
+     * 
+ * + * STOP_VM = 1; + */ + public static final int STOP_VM_VALUE = 1; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static FaultType valueOf(int value) { + return forNumber(value); + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + */ + public static FaultType forNumber(int value) { + switch (value) { + case 0: + return FAULT_TYPE_UNSPECIFIED; + case 1: + return STOP_VM; + default: + return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap internalGetValueMap() { + return internalValueMap; + } + + private static final com.google.protobuf.Internal.EnumLiteMap internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public FaultType findValueByNumber(int number) { + return FaultType.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + return getDescriptor().getValues().get(ordinal()); + } + + public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { + return getDescriptor(); + } + + public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.cloud.alloydb.v1.InjectFaultRequest.getDescriptor().getEnumTypes().get(0); + } + + private static final FaultType[] VALUES = values(); + + public static FaultType valueOf(com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException("EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private FaultType(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.alloydb.v1.InjectFaultRequest.FaultType) + } + + public static final int FAULT_TYPE_FIELD_NUMBER = 1; + private int faultType_ = 0; + /** + * + * + *
+   * Required. The type of fault to be injected in an instance.
+   * 
+ * + * + * .google.cloud.alloydb.v1.InjectFaultRequest.FaultType fault_type = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The enum numeric value on the wire for faultType. + */ + @java.lang.Override + public int getFaultTypeValue() { + return faultType_; + } + /** + * + * + *
+   * Required. The type of fault to be injected in an instance.
+   * 
+ * + * + * .google.cloud.alloydb.v1.InjectFaultRequest.FaultType fault_type = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The faultType. + */ + @java.lang.Override + public com.google.cloud.alloydb.v1.InjectFaultRequest.FaultType getFaultType() { + com.google.cloud.alloydb.v1.InjectFaultRequest.FaultType result = + com.google.cloud.alloydb.v1.InjectFaultRequest.FaultType.forNumber(faultType_); + return result == null + ? com.google.cloud.alloydb.v1.InjectFaultRequest.FaultType.UNRECOGNIZED + : result; + } + + public static final int NAME_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + * + * + *
+   * Required. The name of the resource. For the required format, see the
+   * comment on the Instance.name field.
+   * 
+ * + * + * string name = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The name of the resource. For the required format, see the
+   * comment on the Instance.name field.
+   * 
+ * + * + * string name = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int REQUEST_ID_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object 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).
+   * 
+ * + * string request_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The requestId. + */ + @java.lang.Override + public java.lang.String getRequestId() { + java.lang.Object ref = requestId_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + requestId_ = s; + return s; + } + } + /** + * + * + *
+   * Optional. An optional request ID to identify requests. Specify a unique
+   * request ID so that if you must retry your request, the server will know to
+   * ignore the request if it has already been completed. The server will
+   * guarantee that for at least 60 minutes after the first request.
+   *
+   * For example, consider a situation where you make an initial request and
+   * the request times out. If you make the request again with the same request
+   * ID, the server can check if original operation with the same request ID
+   * was received, and if so, will ignore the second request. This prevents
+   * clients from accidentally creating duplicate commitments.
+   *
+   * The request ID must be a valid UUID with the exception that zero UUID is
+   * not supported (00000000-0000-0000-0000-000000000000).
+   * 
+ * + * string request_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for requestId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getRequestIdBytes() { + java.lang.Object ref = requestId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + requestId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int VALIDATE_ONLY_FIELD_NUMBER = 4; + private boolean validateOnly_ = false; + /** + * + * + *
+   * Optional. If set, performs request validation (e.g. permission checks and
+   * any other type of validation), but do not actually execute the fault
+   * injection.
+   * 
+ * + * bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The validateOnly. + */ + @java.lang.Override + public boolean getValidateOnly() { + return validateOnly_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (faultType_ + != com.google.cloud.alloydb.v1.InjectFaultRequest.FaultType.FAULT_TYPE_UNSPECIFIED + .getNumber()) { + output.writeEnum(1, faultType_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, name_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(requestId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, requestId_); + } + if (validateOnly_ != false) { + output.writeBool(4, validateOnly_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (faultType_ + != com.google.cloud.alloydb.v1.InjectFaultRequest.FaultType.FAULT_TYPE_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(1, faultType_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, name_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(requestId_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, requestId_); + } + if (validateOnly_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(4, validateOnly_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.alloydb.v1.InjectFaultRequest)) { + return super.equals(obj); + } + com.google.cloud.alloydb.v1.InjectFaultRequest other = + (com.google.cloud.alloydb.v1.InjectFaultRequest) obj; + + if (faultType_ != other.faultType_) return false; + if (!getName().equals(other.getName())) return false; + if (!getRequestId().equals(other.getRequestId())) return false; + if (getValidateOnly() != other.getValidateOnly()) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + FAULT_TYPE_FIELD_NUMBER; + hash = (53 * hash) + faultType_; + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (37 * hash) + REQUEST_ID_FIELD_NUMBER; + hash = (53 * hash) + getRequestId().hashCode(); + hash = (37 * hash) + VALIDATE_ONLY_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getValidateOnly()); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.alloydb.v1.InjectFaultRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1.InjectFaultRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.alloydb.v1.InjectFaultRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1.InjectFaultRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.alloydb.v1.InjectFaultRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1.InjectFaultRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.alloydb.v1.InjectFaultRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1.InjectFaultRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.alloydb.v1.InjectFaultRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1.InjectFaultRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.alloydb.v1.InjectFaultRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1.InjectFaultRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.alloydb.v1.InjectFaultRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Message for triggering fault injection on an instance
+   * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1.InjectFaultRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.alloydb.v1.InjectFaultRequest) + com.google.cloud.alloydb.v1.InjectFaultRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.alloydb.v1.ServiceProto + .internal_static_google_cloud_alloydb_v1_InjectFaultRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1.ServiceProto + .internal_static_google_cloud_alloydb_v1_InjectFaultRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1.InjectFaultRequest.class, + com.google.cloud.alloydb.v1.InjectFaultRequest.Builder.class); + } + + // Construct using com.google.cloud.alloydb.v1.InjectFaultRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + faultType_ = 0; + name_ = ""; + requestId_ = ""; + validateOnly_ = false; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.alloydb.v1.ServiceProto + .internal_static_google_cloud_alloydb_v1_InjectFaultRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1.InjectFaultRequest getDefaultInstanceForType() { + return com.google.cloud.alloydb.v1.InjectFaultRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.alloydb.v1.InjectFaultRequest build() { + com.google.cloud.alloydb.v1.InjectFaultRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1.InjectFaultRequest buildPartial() { + com.google.cloud.alloydb.v1.InjectFaultRequest result = + new com.google.cloud.alloydb.v1.InjectFaultRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.alloydb.v1.InjectFaultRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.faultType_ = faultType_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.name_ = name_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.requestId_ = requestId_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.validateOnly_ = validateOnly_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.alloydb.v1.InjectFaultRequest) { + return mergeFrom((com.google.cloud.alloydb.v1.InjectFaultRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.alloydb.v1.InjectFaultRequest other) { + if (other == com.google.cloud.alloydb.v1.InjectFaultRequest.getDefaultInstance()) return this; + if (other.faultType_ != 0) { + setFaultTypeValue(other.getFaultTypeValue()); + } + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (!other.getRequestId().isEmpty()) { + requestId_ = other.requestId_; + bitField0_ |= 0x00000004; + onChanged(); + } + if (other.getValidateOnly() != false) { + setValidateOnly(other.getValidateOnly()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: + { + faultType_ = input.readEnum(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 18: + { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + requestId_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 32: + { + validateOnly_ = input.readBool(); + bitField0_ |= 0x00000008; + break; + } // case 32 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private int faultType_ = 0; + /** + * + * + *
+     * Required. The type of fault to be injected in an instance.
+     * 
+ * + * + * .google.cloud.alloydb.v1.InjectFaultRequest.FaultType fault_type = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The enum numeric value on the wire for faultType. + */ + @java.lang.Override + public int getFaultTypeValue() { + return faultType_; + } + /** + * + * + *
+     * Required. The type of fault to be injected in an instance.
+     * 
+ * + * + * .google.cloud.alloydb.v1.InjectFaultRequest.FaultType fault_type = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @param value The enum numeric value on the wire for faultType to set. + * @return This builder for chaining. + */ + public Builder setFaultTypeValue(int value) { + faultType_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The type of fault to be injected in an instance.
+     * 
+ * + * + * .google.cloud.alloydb.v1.InjectFaultRequest.FaultType fault_type = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The faultType. + */ + @java.lang.Override + public com.google.cloud.alloydb.v1.InjectFaultRequest.FaultType getFaultType() { + com.google.cloud.alloydb.v1.InjectFaultRequest.FaultType result = + com.google.cloud.alloydb.v1.InjectFaultRequest.FaultType.forNumber(faultType_); + return result == null + ? com.google.cloud.alloydb.v1.InjectFaultRequest.FaultType.UNRECOGNIZED + : result; + } + /** + * + * + *
+     * Required. The type of fault to be injected in an instance.
+     * 
+ * + * + * .google.cloud.alloydb.v1.InjectFaultRequest.FaultType fault_type = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @param value The faultType to set. + * @return This builder for chaining. + */ + public Builder setFaultType(com.google.cloud.alloydb.v1.InjectFaultRequest.FaultType value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000001; + faultType_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The type of fault to be injected in an instance.
+     * 
+ * + * + * .google.cloud.alloydb.v1.InjectFaultRequest.FaultType fault_type = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return This builder for chaining. + */ + public Builder clearFaultType() { + bitField0_ = (bitField0_ & ~0x00000001); + faultType_ = 0; + onChanged(); + return this; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. The name of the resource. For the required format, see the
+     * comment on the Instance.name field.
+     * 
+ * + * + * string name = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The name of the resource. For the required format, see the
+     * comment on the Instance.name field.
+     * 
+ * + * + * string name = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The name of the resource. For the required format, see the
+     * comment on the Instance.name field.
+     * 
+ * + * + * string name = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + name_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the resource. For the required format, see the
+     * comment on the Instance.name field.
+     * 
+ * + * + * string name = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the resource. For the required format, see the
+     * comment on the Instance.name field.
+     * 
+ * + * + * string name = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + name_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private java.lang.Object 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).
+     * 
+ * + * string request_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The requestId. + */ + public java.lang.String getRequestId() { + java.lang.Object ref = requestId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + requestId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes after the first request.
+     *
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     *
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for requestId. + */ + public com.google.protobuf.ByteString getRequestIdBytes() { + java.lang.Object ref = requestId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + requestId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes after the first request.
+     *
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     *
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The requestId to set. + * @return This builder for chaining. + */ + public Builder setRequestId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + requestId_ = value; + bitField0_ |= 0x00000004; + onChanged(); + 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).
+     * 
+ * + * string request_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearRequestId() { + requestId_ = getDefaultInstance().getRequestId(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + 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).
+     * 
+ * + * string request_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for requestId to set. + * @return This builder for chaining. + */ + public Builder setRequestIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + requestId_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + private boolean 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.
+     * 
+ * + * bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The validateOnly. + */ + @java.lang.Override + public boolean getValidateOnly() { + return 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.
+     * 
+ * + * bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The validateOnly to set. + * @return This builder for chaining. + */ + public Builder setValidateOnly(boolean value) { + + validateOnly_ = value; + bitField0_ |= 0x00000008; + onChanged(); + 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.
+     * 
+ * + * bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearValidateOnly() { + bitField0_ = (bitField0_ & ~0x00000008); + validateOnly_ = false; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.alloydb.v1.InjectFaultRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.alloydb.v1.InjectFaultRequest) + private static final com.google.cloud.alloydb.v1.InjectFaultRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.alloydb.v1.InjectFaultRequest(); + } + + public static com.google.cloud.alloydb.v1.InjectFaultRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public InjectFaultRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1.InjectFaultRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/InjectFaultRequestOrBuilder.java b/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/InjectFaultRequestOrBuilder.java new file mode 100644 index 000000000000..f5fbcafa828e --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/InjectFaultRequestOrBuilder.java @@ -0,0 +1,149 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/alloydb/v1/service.proto + +package com.google.cloud.alloydb.v1; + +public interface InjectFaultRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.alloydb.v1.InjectFaultRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The type of fault to be injected in an instance.
+   * 
+ * + * + * .google.cloud.alloydb.v1.InjectFaultRequest.FaultType fault_type = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The enum numeric value on the wire for faultType. + */ + int getFaultTypeValue(); + /** + * + * + *
+   * Required. The type of fault to be injected in an instance.
+   * 
+ * + * + * .google.cloud.alloydb.v1.InjectFaultRequest.FaultType fault_type = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The faultType. + */ + com.google.cloud.alloydb.v1.InjectFaultRequest.FaultType getFaultType(); + + /** + * + * + *
+   * Required. The name of the resource. For the required format, see the
+   * comment on the Instance.name field.
+   * 
+ * + * + * string name = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. The name of the resource. For the required format, see the
+   * comment on the Instance.name field.
+   * 
+ * + * + * string name = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * Optional. An optional request ID to identify requests. Specify a unique
+   * request ID so that if you must retry your request, the server will know to
+   * ignore the request if it has already been completed. The server will
+   * guarantee that for at least 60 minutes after the first request.
+   *
+   * For example, consider a situation where you make an initial request and
+   * the request times out. If you make the request again with the same request
+   * ID, the server can check if original operation with the same request ID
+   * was received, and if so, will ignore the second request. This prevents
+   * clients from accidentally creating duplicate commitments.
+   *
+   * The request ID must be a valid UUID with the exception that zero UUID is
+   * not supported (00000000-0000-0000-0000-000000000000).
+   * 
+ * + * string request_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The requestId. + */ + java.lang.String getRequestId(); + /** + * + * + *
+   * Optional. An optional request ID to identify requests. Specify a unique
+   * request ID so that if you must retry your request, the server will know to
+   * ignore the request if it has already been completed. The server will
+   * guarantee that for at least 60 minutes after the first request.
+   *
+   * For example, consider a situation where you make an initial request and
+   * the request times out. If you make the request again with the same request
+   * ID, the server can check if original operation with the same request ID
+   * was received, and if so, will ignore the second request. This prevents
+   * clients from accidentally creating duplicate commitments.
+   *
+   * The request ID must be a valid UUID with the exception that zero UUID is
+   * not supported (00000000-0000-0000-0000-000000000000).
+   * 
+ * + * string request_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for requestId. + */ + com.google.protobuf.ByteString getRequestIdBytes(); + + /** + * + * + *
+   * Optional. If set, performs request validation (e.g. permission checks and
+   * any other type of validation), but do not actually execute the fault
+   * injection.
+   * 
+ * + * bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The validateOnly. + */ + boolean getValidateOnly(); +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/Instance.java b/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/Instance.java index 58919a64db78..3a2e0fe34d79 100644 --- a/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/Instance.java +++ b/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/Instance.java @@ -582,10 +582,11 @@ private InstanceType(int value) { * *
    * The Availability type of an instance. Potential values:
+   *
    * - ZONAL: The instance serves data from only one zone. Outages in that
-   * zone affect instance availability.
+   *     zone affect instance availability.
    * - REGIONAL: The instance can serve data from more than one zone in a
-   * region (it is highly available).
+   *     region (it is highly available).
    * 
* * Protobuf enum {@code google.cloud.alloydb.v1.Instance.AvailabilityType} @@ -4723,8 +4724,11 @@ public com.google.cloud.alloydb.v1.Instance.MachineConfigOrBuilder getMachineCon * *
    * Availability type of an Instance.
-   * Defaults to REGIONAL for both primary and read instances.
-   * Note that primary and read instances can have different availability types.
+   * 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).
    * 
* * .google.cloud.alloydb.v1.Instance.AvailabilityType availability_type = 11; @@ -4740,8 +4744,11 @@ public int getAvailabilityTypeValue() { * *
    * Availability type of an Instance.
-   * Defaults to REGIONAL for both primary and read instances.
-   * Note that primary and read instances can have different availability types.
+   * 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).
    * 
* * .google.cloud.alloydb.v1.Instance.AvailabilityType availability_type = 11; @@ -7978,8 +7985,11 @@ public com.google.cloud.alloydb.v1.Instance.MachineConfigOrBuilder getMachineCon * *
      * Availability type of an Instance.
-     * Defaults to REGIONAL for both primary and read instances.
-     * Note that primary and read instances can have different availability types.
+     * 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).
      * 
* * .google.cloud.alloydb.v1.Instance.AvailabilityType availability_type = 11; @@ -7995,8 +8005,11 @@ public int getAvailabilityTypeValue() { * *
      * Availability type of an Instance.
-     * Defaults to REGIONAL for both primary and read instances.
-     * Note that primary and read instances can have different availability types.
+     * 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).
      * 
* * .google.cloud.alloydb.v1.Instance.AvailabilityType availability_type = 11; @@ -8015,8 +8028,11 @@ public Builder setAvailabilityTypeValue(int value) { * *
      * Availability type of an Instance.
-     * Defaults to REGIONAL for both primary and read instances.
-     * Note that primary and read instances can have different availability types.
+     * 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).
      * 
* * .google.cloud.alloydb.v1.Instance.AvailabilityType availability_type = 11; @@ -8036,8 +8052,11 @@ public com.google.cloud.alloydb.v1.Instance.AvailabilityType getAvailabilityType * *
      * Availability type of an Instance.
-     * Defaults to REGIONAL for both primary and read instances.
-     * Note that primary and read instances can have different availability types.
+     * 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).
      * 
* * .google.cloud.alloydb.v1.Instance.AvailabilityType availability_type = 11; @@ -8060,8 +8079,11 @@ public Builder setAvailabilityType( * *
      * Availability type of an Instance.
-     * Defaults to REGIONAL for both primary and read instances.
-     * Note that primary and read instances can have different availability types.
+     * 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).
      * 
* * .google.cloud.alloydb.v1.Instance.AvailabilityType availability_type = 11; diff --git a/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/InstanceOrBuilder.java b/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/InstanceOrBuilder.java index 4243f7e93427..664f2c177443 100644 --- a/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/InstanceOrBuilder.java +++ b/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/InstanceOrBuilder.java @@ -389,8 +389,11 @@ java.lang.String getLabelsOrDefault( * *
    * Availability type of an Instance.
-   * Defaults to REGIONAL for both primary and read instances.
-   * Note that primary and read instances can have different availability types.
+   * 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).
    * 
* * .google.cloud.alloydb.v1.Instance.AvailabilityType availability_type = 11; @@ -403,8 +406,11 @@ java.lang.String getLabelsOrDefault( * *
    * Availability type of an Instance.
-   * Defaults to REGIONAL for both primary and read instances.
-   * Note that primary and read instances can have different availability types.
+   * 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).
    * 
* * .google.cloud.alloydb.v1.Instance.AvailabilityType availability_type = 11; diff --git a/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/InstanceView.java b/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/InstanceView.java index e72fc438cb5c..bad7e3cb0354 100644 --- a/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/InstanceView.java +++ b/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/InstanceView.java @@ -158,7 +158,7 @@ public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType } public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { - return com.google.cloud.alloydb.v1.ResourcesProto.getDescriptor().getEnumTypes().get(1); + return com.google.cloud.alloydb.v1.ResourcesProto.getDescriptor().getEnumTypes().get(0); } private static final InstanceView[] VALUES = values(); diff --git a/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/ListUsersRequest.java b/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/ListUsersRequest.java new file mode 100644 index 000000000000..fb54c913baa7 --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/ListUsersRequest.java @@ -0,0 +1,1280 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/alloydb/v1/service.proto + +package com.google.cloud.alloydb.v1; + +/** + * + * + *
+ * Message for requesting list of Users
+ * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1.ListUsersRequest} + */ +public final class ListUsersRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.alloydb.v1.ListUsersRequest) + ListUsersRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListUsersRequest.newBuilder() to construct. + private ListUsersRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListUsersRequest() { + parent_ = ""; + pageToken_ = ""; + filter_ = ""; + orderBy_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListUsersRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.alloydb.v1.ServiceProto + .internal_static_google_cloud_alloydb_v1_ListUsersRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1.ServiceProto + .internal_static_google_cloud_alloydb_v1_ListUsersRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1.ListUsersRequest.class, + com.google.cloud.alloydb.v1.ListUsersRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object parent_ = ""; + /** + * + * + *
+   * Required. Parent value for ListUsersRequest
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + @java.lang.Override + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } + } + /** + * + * + *
+   * Required. Parent value for ListUsersRequest
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + @java.lang.Override + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PAGE_SIZE_FIELD_NUMBER = 2; + private int pageSize_ = 0; + /** + * + * + *
+   * Optional. Requested page size. Server may return fewer items than
+   * requested. If unspecified, server will pick an appropriate default.
+   * 
+ * + * int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + + public static final int PAGE_TOKEN_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object pageToken_ = ""; + /** + * + * + *
+   * Optional. A token identifying a page of results the server should return.
+   * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageToken. + */ + @java.lang.Override + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } + } + /** + * + * + *
+   * Optional. A token identifying a page of results the server should return.
+   * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for pageToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int FILTER_FIELD_NUMBER = 4; + + @SuppressWarnings("serial") + private volatile java.lang.Object filter_ = ""; + /** + * + * + *
+   * Optional. Filtering results
+   * 
+ * + * string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The filter. + */ + @java.lang.Override + public java.lang.String getFilter() { + java.lang.Object ref = filter_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + filter_ = s; + return s; + } + } + /** + * + * + *
+   * Optional. Filtering results
+   * 
+ * + * string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for filter. + */ + @java.lang.Override + public com.google.protobuf.ByteString getFilterBytes() { + java.lang.Object ref = filter_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + filter_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ORDER_BY_FIELD_NUMBER = 5; + + @SuppressWarnings("serial") + private volatile java.lang.Object orderBy_ = ""; + /** + * + * + *
+   * Optional. Hint for how to order the results
+   * 
+ * + * string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The orderBy. + */ + @java.lang.Override + public java.lang.String getOrderBy() { + java.lang.Object ref = orderBy_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + orderBy_ = s; + return s; + } + } + /** + * + * + *
+   * Optional. Hint for how to order the results
+   * 
+ * + * string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for orderBy. + */ + @java.lang.Override + public com.google.protobuf.ByteString getOrderByBytes() { + java.lang.Object ref = orderBy_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + orderBy_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); + } + if (pageSize_ != 0) { + output.writeInt32(2, pageSize_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pageToken_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, pageToken_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(filter_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, filter_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(orderBy_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 5, orderBy_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); + } + if (pageSize_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(2, pageSize_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pageToken_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, pageToken_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(filter_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, filter_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(orderBy_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, orderBy_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.alloydb.v1.ListUsersRequest)) { + return super.equals(obj); + } + com.google.cloud.alloydb.v1.ListUsersRequest other = + (com.google.cloud.alloydb.v1.ListUsersRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (getPageSize() != other.getPageSize()) return false; + if (!getPageToken().equals(other.getPageToken())) return false; + if (!getFilter().equals(other.getFilter())) return false; + if (!getOrderBy().equals(other.getOrderBy())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + PARENT_FIELD_NUMBER; + hash = (53 * hash) + getParent().hashCode(); + hash = (37 * hash) + PAGE_SIZE_FIELD_NUMBER; + hash = (53 * hash) + getPageSize(); + hash = (37 * hash) + PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getPageToken().hashCode(); + hash = (37 * hash) + FILTER_FIELD_NUMBER; + hash = (53 * hash) + getFilter().hashCode(); + hash = (37 * hash) + ORDER_BY_FIELD_NUMBER; + hash = (53 * hash) + getOrderBy().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.alloydb.v1.ListUsersRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1.ListUsersRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.alloydb.v1.ListUsersRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1.ListUsersRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.alloydb.v1.ListUsersRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1.ListUsersRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.alloydb.v1.ListUsersRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1.ListUsersRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.alloydb.v1.ListUsersRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1.ListUsersRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.alloydb.v1.ListUsersRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1.ListUsersRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.alloydb.v1.ListUsersRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Message for requesting list of Users
+   * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1.ListUsersRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.alloydb.v1.ListUsersRequest) + com.google.cloud.alloydb.v1.ListUsersRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.alloydb.v1.ServiceProto + .internal_static_google_cloud_alloydb_v1_ListUsersRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1.ServiceProto + .internal_static_google_cloud_alloydb_v1_ListUsersRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1.ListUsersRequest.class, + com.google.cloud.alloydb.v1.ListUsersRequest.Builder.class); + } + + // Construct using com.google.cloud.alloydb.v1.ListUsersRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + parent_ = ""; + pageSize_ = 0; + pageToken_ = ""; + filter_ = ""; + orderBy_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.alloydb.v1.ServiceProto + .internal_static_google_cloud_alloydb_v1_ListUsersRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1.ListUsersRequest getDefaultInstanceForType() { + return com.google.cloud.alloydb.v1.ListUsersRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.alloydb.v1.ListUsersRequest build() { + com.google.cloud.alloydb.v1.ListUsersRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1.ListUsersRequest buildPartial() { + com.google.cloud.alloydb.v1.ListUsersRequest result = + new com.google.cloud.alloydb.v1.ListUsersRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.alloydb.v1.ListUsersRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.parent_ = parent_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.pageSize_ = pageSize_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.pageToken_ = pageToken_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.filter_ = filter_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.orderBy_ = orderBy_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.alloydb.v1.ListUsersRequest) { + return mergeFrom((com.google.cloud.alloydb.v1.ListUsersRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.alloydb.v1.ListUsersRequest other) { + if (other == com.google.cloud.alloydb.v1.ListUsersRequest.getDefaultInstance()) return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.getPageSize() != 0) { + setPageSize(other.getPageSize()); + } + if (!other.getPageToken().isEmpty()) { + pageToken_ = other.pageToken_; + bitField0_ |= 0x00000004; + onChanged(); + } + if (!other.getFilter().isEmpty()) { + filter_ = other.filter_; + bitField0_ |= 0x00000008; + onChanged(); + } + if (!other.getOrderBy().isEmpty()) { + orderBy_ = other.orderBy_; + bitField0_ |= 0x00000010; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + parent_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 16: + { + pageSize_ = input.readInt32(); + bitField0_ |= 0x00000002; + break; + } // case 16 + case 26: + { + pageToken_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 34: + { + filter_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000008; + break; + } // case 34 + case 42: + { + orderBy_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000010; + break; + } // case 42 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * Required. Parent value for ListUsersRequest
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. Parent value for ListUsersRequest
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. Parent value for ListUsersRequest
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The parent to set. + * @return This builder for chaining. + */ + public Builder setParent(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + parent_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Parent value for ListUsersRequest
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearParent() { + parent_ = getDefaultInstance().getParent(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Parent value for ListUsersRequest
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for parent to set. + * @return This builder for chaining. + */ + public Builder setParentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + parent_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private int pageSize_; + /** + * + * + *
+     * Optional. Requested page size. Server may return fewer items than
+     * requested. If unspecified, server will pick an appropriate default.
+     * 
+ * + * int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + /** + * + * + *
+     * Optional. Requested page size. Server may return fewer items than
+     * requested. If unspecified, server will pick an appropriate default.
+     * 
+ * + * int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The pageSize to set. + * @return This builder for chaining. + */ + public Builder setPageSize(int value) { + + pageSize_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Requested page size. Server may return fewer items than
+     * requested. If unspecified, server will pick an appropriate default.
+     * 
+ * + * int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearPageSize() { + bitField0_ = (bitField0_ & ~0x00000002); + pageSize_ = 0; + onChanged(); + return this; + } + + private java.lang.Object pageToken_ = ""; + /** + * + * + *
+     * Optional. A token identifying a page of results the server should return.
+     * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageToken. + */ + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Optional. A token identifying a page of results the server should return.
+     * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for pageToken. + */ + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Optional. A token identifying a page of results the server should return.
+     * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + pageToken_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. A token identifying a page of results the server should return.
+     * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearPageToken() { + pageToken_ = getDefaultInstance().getPageToken(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. A token identifying a page of results the server should return.
+     * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + pageToken_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + private java.lang.Object filter_ = ""; + /** + * + * + *
+     * Optional. Filtering results
+     * 
+ * + * string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The filter. + */ + public java.lang.String getFilter() { + java.lang.Object ref = filter_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + filter_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Optional. Filtering results
+     * 
+ * + * string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for filter. + */ + public com.google.protobuf.ByteString getFilterBytes() { + java.lang.Object ref = filter_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + filter_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Optional. Filtering results
+     * 
+ * + * string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The filter to set. + * @return This builder for chaining. + */ + public Builder setFilter(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + filter_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Filtering results
+     * 
+ * + * string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearFilter() { + filter_ = getDefaultInstance().getFilter(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Filtering results
+     * 
+ * + * string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for filter to set. + * @return This builder for chaining. + */ + public Builder setFilterBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + filter_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + private java.lang.Object orderBy_ = ""; + /** + * + * + *
+     * Optional. Hint for how to order the results
+     * 
+ * + * string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The orderBy. + */ + public java.lang.String getOrderBy() { + java.lang.Object ref = orderBy_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + orderBy_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Optional. Hint for how to order the results
+     * 
+ * + * string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for orderBy. + */ + public com.google.protobuf.ByteString getOrderByBytes() { + java.lang.Object ref = orderBy_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + orderBy_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Optional. Hint for how to order the results
+     * 
+ * + * string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The orderBy to set. + * @return This builder for chaining. + */ + public Builder setOrderBy(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + orderBy_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Hint for how to order the results
+     * 
+ * + * string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearOrderBy() { + orderBy_ = getDefaultInstance().getOrderBy(); + bitField0_ = (bitField0_ & ~0x00000010); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Hint for how to order the results
+     * 
+ * + * string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for orderBy to set. + * @return This builder for chaining. + */ + public Builder setOrderByBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + orderBy_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.alloydb.v1.ListUsersRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.alloydb.v1.ListUsersRequest) + private static final com.google.cloud.alloydb.v1.ListUsersRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.alloydb.v1.ListUsersRequest(); + } + + public static com.google.cloud.alloydb.v1.ListUsersRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListUsersRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1.ListUsersRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/ListUsersRequestOrBuilder.java b/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/ListUsersRequestOrBuilder.java new file mode 100644 index 000000000000..46a4d0ab0f21 --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/ListUsersRequestOrBuilder.java @@ -0,0 +1,143 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/alloydb/v1/service.proto + +package com.google.cloud.alloydb.v1; + +public interface ListUsersRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.alloydb.v1.ListUsersRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Parent value for ListUsersRequest
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. Parent value for ListUsersRequest
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * Optional. Requested page size. Server may return fewer items than
+   * requested. If unspecified, server will pick an appropriate default.
+   * 
+ * + * int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageSize. + */ + int getPageSize(); + + /** + * + * + *
+   * Optional. A token identifying a page of results the server should return.
+   * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageToken. + */ + java.lang.String getPageToken(); + /** + * + * + *
+   * Optional. A token identifying a page of results the server should return.
+   * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for pageToken. + */ + com.google.protobuf.ByteString getPageTokenBytes(); + + /** + * + * + *
+   * Optional. Filtering results
+   * 
+ * + * string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The filter. + */ + java.lang.String getFilter(); + /** + * + * + *
+   * Optional. Filtering results
+   * 
+ * + * string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for filter. + */ + com.google.protobuf.ByteString getFilterBytes(); + + /** + * + * + *
+   * Optional. Hint for how to order the results
+   * 
+ * + * string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The orderBy. + */ + java.lang.String getOrderBy(); + /** + * + * + *
+   * Optional. Hint for how to order the results
+   * 
+ * + * string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for orderBy. + */ + com.google.protobuf.ByteString getOrderByBytes(); +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/ListUsersResponse.java b/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/ListUsersResponse.java new file mode 100644 index 000000000000..df00c67fb628 --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/ListUsersResponse.java @@ -0,0 +1,1388 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/alloydb/v1/service.proto + +package com.google.cloud.alloydb.v1; + +/** + * + * + *
+ * Message for response to listing Users
+ * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1.ListUsersResponse} + */ +public final class ListUsersResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.alloydb.v1.ListUsersResponse) + ListUsersResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListUsersResponse.newBuilder() to construct. + private ListUsersResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListUsersResponse() { + users_ = java.util.Collections.emptyList(); + nextPageToken_ = ""; + unreachable_ = com.google.protobuf.LazyStringArrayList.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListUsersResponse(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.alloydb.v1.ServiceProto + .internal_static_google_cloud_alloydb_v1_ListUsersResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1.ServiceProto + .internal_static_google_cloud_alloydb_v1_ListUsersResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1.ListUsersResponse.class, + com.google.cloud.alloydb.v1.ListUsersResponse.Builder.class); + } + + public static final int USERS_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private java.util.List users_; + /** + * + * + *
+   * The list of User
+   * 
+ * + * repeated .google.cloud.alloydb.v1.User users = 1; + */ + @java.lang.Override + public java.util.List getUsersList() { + return users_; + } + /** + * + * + *
+   * The list of User
+   * 
+ * + * repeated .google.cloud.alloydb.v1.User users = 1; + */ + @java.lang.Override + public java.util.List + getUsersOrBuilderList() { + return users_; + } + /** + * + * + *
+   * The list of User
+   * 
+ * + * repeated .google.cloud.alloydb.v1.User users = 1; + */ + @java.lang.Override + public int getUsersCount() { + return users_.size(); + } + /** + * + * + *
+   * The list of User
+   * 
+ * + * repeated .google.cloud.alloydb.v1.User users = 1; + */ + @java.lang.Override + public com.google.cloud.alloydb.v1.User getUsers(int index) { + return users_.get(index); + } + /** + * + * + *
+   * The list of User
+   * 
+ * + * repeated .google.cloud.alloydb.v1.User users = 1; + */ + @java.lang.Override + public com.google.cloud.alloydb.v1.UserOrBuilder getUsersOrBuilder(int index) { + return users_.get(index); + } + + public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object nextPageToken_ = ""; + /** + * + * + *
+   * A token identifying a page of results the server should return.
+   * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + @java.lang.Override + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } + } + /** + * + * + *
+   * A token identifying a page of results the server should return.
+   * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int UNREACHABLE_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private com.google.protobuf.LazyStringArrayList unreachable_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + /** + * + * + *
+   * Locations that could not be reached.
+   * 
+ * + * repeated string unreachable = 3; + * + * @return A list containing the unreachable. + */ + public com.google.protobuf.ProtocolStringList getUnreachableList() { + return unreachable_; + } + /** + * + * + *
+   * Locations that could not be reached.
+   * 
+ * + * repeated string unreachable = 3; + * + * @return The count of unreachable. + */ + public int getUnreachableCount() { + return unreachable_.size(); + } + /** + * + * + *
+   * Locations that could not be reached.
+   * 
+ * + * repeated string unreachable = 3; + * + * @param index The index of the element to return. + * @return The unreachable at the given index. + */ + public java.lang.String getUnreachable(int index) { + return unreachable_.get(index); + } + /** + * + * + *
+   * Locations that could not be reached.
+   * 
+ * + * repeated string unreachable = 3; + * + * @param index The index of the value to return. + * @return The bytes of the unreachable at the given index. + */ + public com.google.protobuf.ByteString getUnreachableBytes(int index) { + return unreachable_.getByteString(index); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + for (int i = 0; i < users_.size(); i++) { + output.writeMessage(1, users_.get(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, nextPageToken_); + } + for (int i = 0; i < unreachable_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, unreachable_.getRaw(i)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < users_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, users_.get(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, nextPageToken_); + } + { + int dataSize = 0; + for (int i = 0; i < unreachable_.size(); i++) { + dataSize += computeStringSizeNoTag(unreachable_.getRaw(i)); + } + size += dataSize; + size += 1 * getUnreachableList().size(); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.alloydb.v1.ListUsersResponse)) { + return super.equals(obj); + } + com.google.cloud.alloydb.v1.ListUsersResponse other = + (com.google.cloud.alloydb.v1.ListUsersResponse) obj; + + if (!getUsersList().equals(other.getUsersList())) return false; + if (!getNextPageToken().equals(other.getNextPageToken())) return false; + if (!getUnreachableList().equals(other.getUnreachableList())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getUsersCount() > 0) { + hash = (37 * hash) + USERS_FIELD_NUMBER; + hash = (53 * hash) + getUsersList().hashCode(); + } + hash = (37 * hash) + NEXT_PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getNextPageToken().hashCode(); + if (getUnreachableCount() > 0) { + hash = (37 * hash) + UNREACHABLE_FIELD_NUMBER; + hash = (53 * hash) + getUnreachableList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.alloydb.v1.ListUsersResponse parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1.ListUsersResponse parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.alloydb.v1.ListUsersResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1.ListUsersResponse parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.alloydb.v1.ListUsersResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1.ListUsersResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.alloydb.v1.ListUsersResponse parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1.ListUsersResponse parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.alloydb.v1.ListUsersResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1.ListUsersResponse parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.alloydb.v1.ListUsersResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1.ListUsersResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.alloydb.v1.ListUsersResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Message for response to listing Users
+   * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1.ListUsersResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.alloydb.v1.ListUsersResponse) + com.google.cloud.alloydb.v1.ListUsersResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.alloydb.v1.ServiceProto + .internal_static_google_cloud_alloydb_v1_ListUsersResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1.ServiceProto + .internal_static_google_cloud_alloydb_v1_ListUsersResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1.ListUsersResponse.class, + com.google.cloud.alloydb.v1.ListUsersResponse.Builder.class); + } + + // Construct using com.google.cloud.alloydb.v1.ListUsersResponse.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (usersBuilder_ == null) { + users_ = java.util.Collections.emptyList(); + } else { + users_ = null; + usersBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + nextPageToken_ = ""; + unreachable_ = com.google.protobuf.LazyStringArrayList.emptyList(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.alloydb.v1.ServiceProto + .internal_static_google_cloud_alloydb_v1_ListUsersResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1.ListUsersResponse getDefaultInstanceForType() { + return com.google.cloud.alloydb.v1.ListUsersResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.alloydb.v1.ListUsersResponse build() { + com.google.cloud.alloydb.v1.ListUsersResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1.ListUsersResponse buildPartial() { + com.google.cloud.alloydb.v1.ListUsersResponse result = + new com.google.cloud.alloydb.v1.ListUsersResponse(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields(com.google.cloud.alloydb.v1.ListUsersResponse result) { + if (usersBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + users_ = java.util.Collections.unmodifiableList(users_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.users_ = users_; + } else { + result.users_ = usersBuilder_.build(); + } + } + + private void buildPartial0(com.google.cloud.alloydb.v1.ListUsersResponse result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.nextPageToken_ = nextPageToken_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + unreachable_.makeImmutable(); + result.unreachable_ = unreachable_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.alloydb.v1.ListUsersResponse) { + return mergeFrom((com.google.cloud.alloydb.v1.ListUsersResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.alloydb.v1.ListUsersResponse other) { + if (other == com.google.cloud.alloydb.v1.ListUsersResponse.getDefaultInstance()) return this; + if (usersBuilder_ == null) { + if (!other.users_.isEmpty()) { + if (users_.isEmpty()) { + users_ = other.users_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureUsersIsMutable(); + users_.addAll(other.users_); + } + onChanged(); + } + } else { + if (!other.users_.isEmpty()) { + if (usersBuilder_.isEmpty()) { + usersBuilder_.dispose(); + usersBuilder_ = null; + users_ = other.users_; + bitField0_ = (bitField0_ & ~0x00000001); + usersBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getUsersFieldBuilder() + : null; + } else { + usersBuilder_.addAllMessages(other.users_); + } + } + } + if (!other.getNextPageToken().isEmpty()) { + nextPageToken_ = other.nextPageToken_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (!other.unreachable_.isEmpty()) { + if (unreachable_.isEmpty()) { + unreachable_ = other.unreachable_; + bitField0_ |= 0x00000004; + } else { + ensureUnreachableIsMutable(); + unreachable_.addAll(other.unreachable_); + } + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + com.google.cloud.alloydb.v1.User m = + input.readMessage(com.google.cloud.alloydb.v1.User.parser(), extensionRegistry); + if (usersBuilder_ == null) { + ensureUsersIsMutable(); + users_.add(m); + } else { + usersBuilder_.addMessage(m); + } + break; + } // case 10 + case 18: + { + nextPageToken_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + ensureUnreachableIsMutable(); + unreachable_.add(s); + break; + } // case 26 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.util.List users_ = + java.util.Collections.emptyList(); + + private void ensureUsersIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + users_ = new java.util.ArrayList(users_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.alloydb.v1.User, + com.google.cloud.alloydb.v1.User.Builder, + com.google.cloud.alloydb.v1.UserOrBuilder> + usersBuilder_; + + /** + * + * + *
+     * The list of User
+     * 
+ * + * repeated .google.cloud.alloydb.v1.User users = 1; + */ + public java.util.List getUsersList() { + if (usersBuilder_ == null) { + return java.util.Collections.unmodifiableList(users_); + } else { + return usersBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * The list of User
+     * 
+ * + * repeated .google.cloud.alloydb.v1.User users = 1; + */ + public int getUsersCount() { + if (usersBuilder_ == null) { + return users_.size(); + } else { + return usersBuilder_.getCount(); + } + } + /** + * + * + *
+     * The list of User
+     * 
+ * + * repeated .google.cloud.alloydb.v1.User users = 1; + */ + public com.google.cloud.alloydb.v1.User getUsers(int index) { + if (usersBuilder_ == null) { + return users_.get(index); + } else { + return usersBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * The list of User
+     * 
+ * + * repeated .google.cloud.alloydb.v1.User users = 1; + */ + public Builder setUsers(int index, com.google.cloud.alloydb.v1.User value) { + if (usersBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureUsersIsMutable(); + users_.set(index, value); + onChanged(); + } else { + usersBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The list of User
+     * 
+ * + * repeated .google.cloud.alloydb.v1.User users = 1; + */ + public Builder setUsers(int index, com.google.cloud.alloydb.v1.User.Builder builderForValue) { + if (usersBuilder_ == null) { + ensureUsersIsMutable(); + users_.set(index, builderForValue.build()); + onChanged(); + } else { + usersBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The list of User
+     * 
+ * + * repeated .google.cloud.alloydb.v1.User users = 1; + */ + public Builder addUsers(com.google.cloud.alloydb.v1.User value) { + if (usersBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureUsersIsMutable(); + users_.add(value); + onChanged(); + } else { + usersBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * The list of User
+     * 
+ * + * repeated .google.cloud.alloydb.v1.User users = 1; + */ + public Builder addUsers(int index, com.google.cloud.alloydb.v1.User value) { + if (usersBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureUsersIsMutable(); + users_.add(index, value); + onChanged(); + } else { + usersBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The list of User
+     * 
+ * + * repeated .google.cloud.alloydb.v1.User users = 1; + */ + public Builder addUsers(com.google.cloud.alloydb.v1.User.Builder builderForValue) { + if (usersBuilder_ == null) { + ensureUsersIsMutable(); + users_.add(builderForValue.build()); + onChanged(); + } else { + usersBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The list of User
+     * 
+ * + * repeated .google.cloud.alloydb.v1.User users = 1; + */ + public Builder addUsers(int index, com.google.cloud.alloydb.v1.User.Builder builderForValue) { + if (usersBuilder_ == null) { + ensureUsersIsMutable(); + users_.add(index, builderForValue.build()); + onChanged(); + } else { + usersBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The list of User
+     * 
+ * + * repeated .google.cloud.alloydb.v1.User users = 1; + */ + public Builder addAllUsers( + java.lang.Iterable values) { + if (usersBuilder_ == null) { + ensureUsersIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, users_); + onChanged(); + } else { + usersBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * The list of User
+     * 
+ * + * repeated .google.cloud.alloydb.v1.User users = 1; + */ + public Builder clearUsers() { + if (usersBuilder_ == null) { + users_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + usersBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * The list of User
+     * 
+ * + * repeated .google.cloud.alloydb.v1.User users = 1; + */ + public Builder removeUsers(int index) { + if (usersBuilder_ == null) { + ensureUsersIsMutable(); + users_.remove(index); + onChanged(); + } else { + usersBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * The list of User
+     * 
+ * + * repeated .google.cloud.alloydb.v1.User users = 1; + */ + public com.google.cloud.alloydb.v1.User.Builder getUsersBuilder(int index) { + return getUsersFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * The list of User
+     * 
+ * + * repeated .google.cloud.alloydb.v1.User users = 1; + */ + public com.google.cloud.alloydb.v1.UserOrBuilder getUsersOrBuilder(int index) { + if (usersBuilder_ == null) { + return users_.get(index); + } else { + return usersBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * The list of User
+     * 
+ * + * repeated .google.cloud.alloydb.v1.User users = 1; + */ + public java.util.List + getUsersOrBuilderList() { + if (usersBuilder_ != null) { + return usersBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(users_); + } + } + /** + * + * + *
+     * The list of User
+     * 
+ * + * repeated .google.cloud.alloydb.v1.User users = 1; + */ + public com.google.cloud.alloydb.v1.User.Builder addUsersBuilder() { + return getUsersFieldBuilder() + .addBuilder(com.google.cloud.alloydb.v1.User.getDefaultInstance()); + } + /** + * + * + *
+     * The list of User
+     * 
+ * + * repeated .google.cloud.alloydb.v1.User users = 1; + */ + public com.google.cloud.alloydb.v1.User.Builder addUsersBuilder(int index) { + return getUsersFieldBuilder() + .addBuilder(index, com.google.cloud.alloydb.v1.User.getDefaultInstance()); + } + /** + * + * + *
+     * The list of User
+     * 
+ * + * repeated .google.cloud.alloydb.v1.User users = 1; + */ + public java.util.List getUsersBuilderList() { + return getUsersFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.alloydb.v1.User, + com.google.cloud.alloydb.v1.User.Builder, + com.google.cloud.alloydb.v1.UserOrBuilder> + getUsersFieldBuilder() { + if (usersBuilder_ == null) { + usersBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.alloydb.v1.User, + com.google.cloud.alloydb.v1.User.Builder, + com.google.cloud.alloydb.v1.UserOrBuilder>( + users_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + users_ = null; + } + return usersBuilder_; + } + + private java.lang.Object nextPageToken_ = ""; + /** + * + * + *
+     * A token identifying a page of results the server should return.
+     * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * A token identifying a page of results the server should return.
+     * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + public com.google.protobuf.ByteString getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * A token identifying a page of results the server should return.
+     * 
+ * + * string next_page_token = 2; + * + * @param value The nextPageToken to set. + * @return This builder for chaining. + */ + public Builder setNextPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + nextPageToken_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * A token identifying a page of results the server should return.
+     * 
+ * + * string next_page_token = 2; + * + * @return This builder for chaining. + */ + public Builder clearNextPageToken() { + nextPageToken_ = getDefaultInstance().getNextPageToken(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * A token identifying a page of results the server should return.
+     * 
+ * + * string next_page_token = 2; + * + * @param value The bytes for nextPageToken to set. + * @return This builder for chaining. + */ + public Builder setNextPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + nextPageToken_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringArrayList unreachable_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + + private void ensureUnreachableIsMutable() { + if (!unreachable_.isModifiable()) { + unreachable_ = new com.google.protobuf.LazyStringArrayList(unreachable_); + } + bitField0_ |= 0x00000004; + } + /** + * + * + *
+     * Locations that could not be reached.
+     * 
+ * + * repeated string unreachable = 3; + * + * @return A list containing the unreachable. + */ + public com.google.protobuf.ProtocolStringList getUnreachableList() { + unreachable_.makeImmutable(); + return unreachable_; + } + /** + * + * + *
+     * Locations that could not be reached.
+     * 
+ * + * repeated string unreachable = 3; + * + * @return The count of unreachable. + */ + public int getUnreachableCount() { + return unreachable_.size(); + } + /** + * + * + *
+     * Locations that could not be reached.
+     * 
+ * + * repeated string unreachable = 3; + * + * @param index The index of the element to return. + * @return The unreachable at the given index. + */ + public java.lang.String getUnreachable(int index) { + return unreachable_.get(index); + } + /** + * + * + *
+     * Locations that could not be reached.
+     * 
+ * + * repeated string unreachable = 3; + * + * @param index The index of the value to return. + * @return The bytes of the unreachable at the given index. + */ + public com.google.protobuf.ByteString getUnreachableBytes(int index) { + return unreachable_.getByteString(index); + } + /** + * + * + *
+     * Locations that could not be reached.
+     * 
+ * + * repeated string unreachable = 3; + * + * @param index The index to set the value at. + * @param value The unreachable to set. + * @return This builder for chaining. + */ + public Builder setUnreachable(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureUnreachableIsMutable(); + unreachable_.set(index, value); + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Locations that could not be reached.
+     * 
+ * + * repeated string unreachable = 3; + * + * @param value The unreachable to add. + * @return This builder for chaining. + */ + public Builder addUnreachable(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureUnreachableIsMutable(); + unreachable_.add(value); + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Locations that could not be reached.
+     * 
+ * + * repeated string unreachable = 3; + * + * @param values The unreachable to add. + * @return This builder for chaining. + */ + public Builder addAllUnreachable(java.lang.Iterable values) { + ensureUnreachableIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, unreachable_); + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Locations that could not be reached.
+     * 
+ * + * repeated string unreachable = 3; + * + * @return This builder for chaining. + */ + public Builder clearUnreachable() { + unreachable_ = com.google.protobuf.LazyStringArrayList.emptyList(); + bitField0_ = (bitField0_ & ~0x00000004); + ; + onChanged(); + return this; + } + /** + * + * + *
+     * Locations that could not be reached.
+     * 
+ * + * repeated string unreachable = 3; + * + * @param value The bytes of the unreachable to add. + * @return This builder for chaining. + */ + public Builder addUnreachableBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureUnreachableIsMutable(); + unreachable_.add(value); + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.alloydb.v1.ListUsersResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.alloydb.v1.ListUsersResponse) + private static final com.google.cloud.alloydb.v1.ListUsersResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.alloydb.v1.ListUsersResponse(); + } + + public static com.google.cloud.alloydb.v1.ListUsersResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListUsersResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1.ListUsersResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/ListUsersResponseOrBuilder.java b/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/ListUsersResponseOrBuilder.java new file mode 100644 index 000000000000..ba13ade3c95e --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/ListUsersResponseOrBuilder.java @@ -0,0 +1,152 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/alloydb/v1/service.proto + +package com.google.cloud.alloydb.v1; + +public interface ListUsersResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.alloydb.v1.ListUsersResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The list of User
+   * 
+ * + * repeated .google.cloud.alloydb.v1.User users = 1; + */ + java.util.List getUsersList(); + /** + * + * + *
+   * The list of User
+   * 
+ * + * repeated .google.cloud.alloydb.v1.User users = 1; + */ + com.google.cloud.alloydb.v1.User getUsers(int index); + /** + * + * + *
+   * The list of User
+   * 
+ * + * repeated .google.cloud.alloydb.v1.User users = 1; + */ + int getUsersCount(); + /** + * + * + *
+   * The list of User
+   * 
+ * + * repeated .google.cloud.alloydb.v1.User users = 1; + */ + java.util.List getUsersOrBuilderList(); + /** + * + * + *
+   * The list of User
+   * 
+ * + * repeated .google.cloud.alloydb.v1.User users = 1; + */ + com.google.cloud.alloydb.v1.UserOrBuilder getUsersOrBuilder(int index); + + /** + * + * + *
+   * A token identifying a page of results the server should return.
+   * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + java.lang.String getNextPageToken(); + /** + * + * + *
+   * A token identifying a page of results the server should return.
+   * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + com.google.protobuf.ByteString getNextPageTokenBytes(); + + /** + * + * + *
+   * Locations that could not be reached.
+   * 
+ * + * repeated string unreachable = 3; + * + * @return A list containing the unreachable. + */ + java.util.List getUnreachableList(); + /** + * + * + *
+   * Locations that could not be reached.
+   * 
+ * + * repeated string unreachable = 3; + * + * @return The count of unreachable. + */ + int getUnreachableCount(); + /** + * + * + *
+   * Locations that could not be reached.
+   * 
+ * + * repeated string unreachable = 3; + * + * @param index The index of the element to return. + * @return The unreachable at the given index. + */ + java.lang.String getUnreachable(int index); + /** + * + * + *
+   * Locations that could not be reached.
+   * 
+ * + * repeated string unreachable = 3; + * + * @param index The index of the value to return. + * @return The bytes of the unreachable at the given index. + */ + com.google.protobuf.ByteString getUnreachableBytes(int index); +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/PromoteClusterRequest.java b/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/PromoteClusterRequest.java new file mode 100644 index 000000000000..63205a9bd794 --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/PromoteClusterRequest.java @@ -0,0 +1,1204 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/alloydb/v1/service.proto + +package com.google.cloud.alloydb.v1; + +/** + * + * + *
+ * Message for promoting a Cluster
+ * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1.PromoteClusterRequest} + */ +public final class PromoteClusterRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.alloydb.v1.PromoteClusterRequest) + PromoteClusterRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use PromoteClusterRequest.newBuilder() to construct. + private PromoteClusterRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private PromoteClusterRequest() { + name_ = ""; + requestId_ = ""; + etag_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new PromoteClusterRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.alloydb.v1.ServiceProto + .internal_static_google_cloud_alloydb_v1_PromoteClusterRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1.ServiceProto + .internal_static_google_cloud_alloydb_v1_PromoteClusterRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1.PromoteClusterRequest.class, + com.google.cloud.alloydb.v1.PromoteClusterRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + * + * + *
+   * Required. The name of the resource. For the required format, see the
+   * comment on the Cluster.name field
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The name of the resource. For the required format, see the
+   * comment on the Cluster.name field
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int REQUEST_ID_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object 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).
+   * 
+ * + * string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The requestId. + */ + @java.lang.Override + public java.lang.String getRequestId() { + java.lang.Object ref = requestId_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + requestId_ = s; + return s; + } + } + /** + * + * + *
+   * Optional. An optional request ID to identify requests. Specify a unique
+   * request ID so that if you must retry your request, the server will know to
+   * ignore the request if it has already been completed. The server will
+   * guarantee that for at least 60 minutes after the first request.
+   *
+   * For example, consider a situation where you make an initial request and
+   * the request times out. If you make the request again with the same request
+   * ID, the server can check if original operation with the same request ID
+   * was received, and if so, will ignore the second request. This prevents
+   * clients from accidentally creating duplicate commitments.
+   *
+   * The request ID must be a valid UUID with the exception that zero UUID is
+   * not supported (00000000-0000-0000-0000-000000000000).
+   * 
+ * + * string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for requestId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getRequestIdBytes() { + java.lang.Object ref = requestId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + requestId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ETAG_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object 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.
+   * 
+ * + * string etag = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The etag. + */ + @java.lang.Override + public java.lang.String getEtag() { + java.lang.Object ref = etag_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + etag_ = s; + return s; + } + } + /** + * + * + *
+   * 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.
+   * 
+ * + * string etag = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for etag. + */ + @java.lang.Override + public com.google.protobuf.ByteString getEtagBytes() { + java.lang.Object ref = etag_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + etag_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int VALIDATE_ONLY_FIELD_NUMBER = 4; + private boolean validateOnly_ = false; + /** + * + * + *
+   * Optional. If set, performs request validation (e.g. permission checks and
+   * any other type of validation), but do not actually execute the delete.
+   * 
+ * + * bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The validateOnly. + */ + @java.lang.Override + public boolean getValidateOnly() { + return validateOnly_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(requestId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, requestId_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(etag_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, etag_); + } + if (validateOnly_ != false) { + output.writeBool(4, validateOnly_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(requestId_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, requestId_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(etag_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, etag_); + } + if (validateOnly_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(4, validateOnly_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.alloydb.v1.PromoteClusterRequest)) { + return super.equals(obj); + } + com.google.cloud.alloydb.v1.PromoteClusterRequest other = + (com.google.cloud.alloydb.v1.PromoteClusterRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (!getRequestId().equals(other.getRequestId())) return false; + if (!getEtag().equals(other.getEtag())) return false; + if (getValidateOnly() != other.getValidateOnly()) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (37 * hash) + REQUEST_ID_FIELD_NUMBER; + hash = (53 * hash) + getRequestId().hashCode(); + hash = (37 * hash) + ETAG_FIELD_NUMBER; + hash = (53 * hash) + getEtag().hashCode(); + hash = (37 * hash) + VALIDATE_ONLY_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getValidateOnly()); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.alloydb.v1.PromoteClusterRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1.PromoteClusterRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.alloydb.v1.PromoteClusterRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1.PromoteClusterRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.alloydb.v1.PromoteClusterRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1.PromoteClusterRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.alloydb.v1.PromoteClusterRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1.PromoteClusterRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.alloydb.v1.PromoteClusterRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1.PromoteClusterRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.alloydb.v1.PromoteClusterRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1.PromoteClusterRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.alloydb.v1.PromoteClusterRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Message for promoting a Cluster
+   * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1.PromoteClusterRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.alloydb.v1.PromoteClusterRequest) + com.google.cloud.alloydb.v1.PromoteClusterRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.alloydb.v1.ServiceProto + .internal_static_google_cloud_alloydb_v1_PromoteClusterRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1.ServiceProto + .internal_static_google_cloud_alloydb_v1_PromoteClusterRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1.PromoteClusterRequest.class, + com.google.cloud.alloydb.v1.PromoteClusterRequest.Builder.class); + } + + // Construct using com.google.cloud.alloydb.v1.PromoteClusterRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + requestId_ = ""; + etag_ = ""; + validateOnly_ = false; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.alloydb.v1.ServiceProto + .internal_static_google_cloud_alloydb_v1_PromoteClusterRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1.PromoteClusterRequest getDefaultInstanceForType() { + return com.google.cloud.alloydb.v1.PromoteClusterRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.alloydb.v1.PromoteClusterRequest build() { + com.google.cloud.alloydb.v1.PromoteClusterRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1.PromoteClusterRequest buildPartial() { + com.google.cloud.alloydb.v1.PromoteClusterRequest result = + new com.google.cloud.alloydb.v1.PromoteClusterRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.alloydb.v1.PromoteClusterRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.requestId_ = requestId_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.etag_ = etag_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.validateOnly_ = validateOnly_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.alloydb.v1.PromoteClusterRequest) { + return mergeFrom((com.google.cloud.alloydb.v1.PromoteClusterRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.alloydb.v1.PromoteClusterRequest other) { + if (other == com.google.cloud.alloydb.v1.PromoteClusterRequest.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getRequestId().isEmpty()) { + requestId_ = other.requestId_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (!other.getEtag().isEmpty()) { + etag_ = other.etag_; + bitField0_ |= 0x00000004; + onChanged(); + } + if (other.getValidateOnly() != false) { + setValidateOnly(other.getValidateOnly()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + requestId_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + etag_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 32: + { + validateOnly_ = input.readBool(); + bitField0_ |= 0x00000008; + break; + } // case 32 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. The name of the resource. For the required format, see the
+     * comment on the Cluster.name field
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The name of the resource. For the required format, see the
+     * comment on the Cluster.name field
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The name of the resource. For the required format, see the
+     * comment on the Cluster.name field
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the resource. For the required format, see the
+     * comment on the Cluster.name field
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the resource. For the required format, see the
+     * comment on the Cluster.name field
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object 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).
+     * 
+ * + * string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The requestId. + */ + public java.lang.String getRequestId() { + java.lang.Object ref = requestId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + requestId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes after the first request.
+     *
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     *
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for requestId. + */ + public com.google.protobuf.ByteString getRequestIdBytes() { + java.lang.Object ref = requestId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + requestId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes after the first request.
+     *
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     *
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The requestId to set. + * @return This builder for chaining. + */ + public Builder setRequestId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + requestId_ = value; + bitField0_ |= 0x00000002; + onChanged(); + 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).
+     * 
+ * + * string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearRequestId() { + requestId_ = getDefaultInstance().getRequestId(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + 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).
+     * 
+ * + * string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for requestId to set. + * @return This builder for chaining. + */ + public Builder setRequestIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + requestId_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private java.lang.Object 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.
+     * 
+ * + * string etag = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The etag. + */ + public java.lang.String getEtag() { + java.lang.Object ref = etag_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + etag_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * 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.
+     * 
+ * + * string etag = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for etag. + */ + public com.google.protobuf.ByteString getEtagBytes() { + java.lang.Object ref = etag_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + etag_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * 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.
+     * 
+ * + * string etag = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The etag to set. + * @return This builder for chaining. + */ + public Builder setEtag(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + etag_ = value; + bitField0_ |= 0x00000004; + onChanged(); + 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.
+     * 
+ * + * string etag = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearEtag() { + etag_ = getDefaultInstance().getEtag(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + 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.
+     * 
+ * + * string etag = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for etag to set. + * @return This builder for chaining. + */ + public Builder setEtagBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + etag_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + private boolean validateOnly_; + /** + * + * + *
+     * Optional. If set, performs request validation (e.g. permission checks and
+     * any other type of validation), but do not actually execute the delete.
+     * 
+ * + * bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The validateOnly. + */ + @java.lang.Override + public boolean getValidateOnly() { + return validateOnly_; + } + /** + * + * + *
+     * Optional. If set, performs request validation (e.g. permission checks and
+     * any other type of validation), but do not actually execute the delete.
+     * 
+ * + * bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The validateOnly to set. + * @return This builder for chaining. + */ + public Builder setValidateOnly(boolean value) { + + validateOnly_ = value; + bitField0_ |= 0x00000008; + onChanged(); + 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.
+     * 
+ * + * bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearValidateOnly() { + bitField0_ = (bitField0_ & ~0x00000008); + validateOnly_ = false; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.alloydb.v1.PromoteClusterRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.alloydb.v1.PromoteClusterRequest) + private static final com.google.cloud.alloydb.v1.PromoteClusterRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.alloydb.v1.PromoteClusterRequest(); + } + + public static com.google.cloud.alloydb.v1.PromoteClusterRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public PromoteClusterRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1.PromoteClusterRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/PromoteClusterRequestOrBuilder.java b/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/PromoteClusterRequestOrBuilder.java new file mode 100644 index 000000000000..bf59e25434ef --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/PromoteClusterRequestOrBuilder.java @@ -0,0 +1,148 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/alloydb/v1/service.proto + +package com.google.cloud.alloydb.v1; + +public interface PromoteClusterRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.alloydb.v1.PromoteClusterRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The name of the resource. For the required format, see the
+   * comment on the Cluster.name field
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. The name of the resource. For the required format, see the
+   * comment on the Cluster.name field
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * Optional. An optional request ID to identify requests. Specify a unique
+   * request ID so that if you must retry your request, the server will know to
+   * ignore the request if it has already been completed. The server will
+   * guarantee that for at least 60 minutes after the first request.
+   *
+   * For example, consider a situation where you make an initial request and
+   * the request times out. If you make the request again with the same request
+   * ID, the server can check if original operation with the same request ID
+   * was received, and if so, will ignore the second request. This prevents
+   * clients from accidentally creating duplicate commitments.
+   *
+   * The request ID must be a valid UUID with the exception that zero UUID is
+   * not supported (00000000-0000-0000-0000-000000000000).
+   * 
+ * + * string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The requestId. + */ + java.lang.String getRequestId(); + /** + * + * + *
+   * Optional. An optional request ID to identify requests. Specify a unique
+   * request ID so that if you must retry your request, the server will know to
+   * ignore the request if it has already been completed. The server will
+   * guarantee that for at least 60 minutes after the first request.
+   *
+   * For example, consider a situation where you make an initial request and
+   * the request times out. If you make the request again with the same request
+   * ID, the server can check if original operation with the same request ID
+   * was received, and if so, will ignore the second request. This prevents
+   * clients from accidentally creating duplicate commitments.
+   *
+   * The request ID must be a valid UUID with the exception that zero UUID is
+   * not supported (00000000-0000-0000-0000-000000000000).
+   * 
+ * + * string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for requestId. + */ + com.google.protobuf.ByteString getRequestIdBytes(); + + /** + * + * + *
+   * 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.
+   * 
+ * + * string etag = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The etag. + */ + java.lang.String getEtag(); + /** + * + * + *
+   * 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.
+   * 
+ * + * string etag = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for etag. + */ + com.google.protobuf.ByteString getEtagBytes(); + + /** + * + * + *
+   * Optional. If set, performs request validation (e.g. permission checks and
+   * any other type of validation), but do not actually execute the delete.
+   * 
+ * + * bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The validateOnly. + */ + boolean getValidateOnly(); +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/ResourcesProto.java b/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/ResourcesProto.java index a78934d86a9d..6f5d5460a1af 100644 --- a/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/ResourcesProto.java +++ b/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/ResourcesProto.java @@ -67,10 +67,22 @@ public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry r internal_static_google_cloud_alloydb_v1_AutomatedBackupPolicy_LabelsEntry_descriptor; static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_google_cloud_alloydb_v1_AutomatedBackupPolicy_LabelsEntry_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_alloydb_v1_ContinuousBackupConfig_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_alloydb_v1_ContinuousBackupConfig_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_alloydb_v1_ContinuousBackupInfo_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_alloydb_v1_ContinuousBackupInfo_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_google_cloud_alloydb_v1_BackupSource_descriptor; static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_google_cloud_alloydb_v1_BackupSource_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_alloydb_v1_ContinuousBackupSource_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_alloydb_v1_ContinuousBackupSource_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_google_cloud_alloydb_v1_Cluster_descriptor; static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable @@ -147,6 +159,10 @@ public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry r internal_static_google_cloud_alloydb_v1_SupportedDatabaseFlag_IntegerRestrictions_descriptor; static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_google_cloud_alloydb_v1_SupportedDatabaseFlag_IntegerRestrictions_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_alloydb_v1_User_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_alloydb_v1_User_fieldAccessorTable; public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { return descriptor; @@ -177,207 +193,237 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + "\030\002 \003(\tB1\342A\001\003\372A*\n(cloudkms.googleapis.com" + "/CryptoKeyVersion\"\\\n\004Type\022\024\n\020TYPE_UNSPEC" + "IFIED\020\000\022\035\n\031GOOGLE_DEFAULT_ENCRYPTION\020\001\022\037" - + "\n\033CUSTOMER_MANAGED_ENCRYPTION\020\002\"\272\002\n\tSslC" + + "\n\033CUSTOMER_MANAGED_ENCRYPTION\020\002\"\200\003\n\tSslC" + "onfig\022B\n\010ssl_mode\030\001 \001(\0162*.google.cloud.a" + "lloydb.v1.SslConfig.SslModeB\004\342A\001\001\022D\n\tca_" + "source\030\002 \001(\0162+.google.cloud.alloydb.v1.S" - + "slConfig.CaSourceB\004\342A\001\001\"e\n\007SslMode\022\030\n\024SS" - + "L_MODE_UNSPECIFIED\020\000\022\022\n\016SSL_MODE_ALLOW\020\001" - + "\022\024\n\020SSL_MODE_REQUIRE\020\002\022\026\n\022SSL_MODE_VERIF" - + "Y_CA\020\003\"<\n\010CaSource\022\031\n\025CA_SOURCE_UNSPECIF" - + "IED\020\000\022\025\n\021CA_SOURCE_MANAGED\020\001\"\346\006\n\025Automat" - + "edBackupPolicy\022X\n\017weekly_schedule\030\002 \001(\0132" - + "=.google.cloud.alloydb.v1.AutomatedBacku" - + "pPolicy.WeeklyScheduleH\000\022a\n\024time_based_r" - + "etention\030\004 \001(\0132A.google.cloud.alloydb.v1" - + ".AutomatedBackupPolicy.TimeBasedRetentio" - + "nH\001\022i\n\030quantity_based_retention\030\005 \001(\0132E." - + "google.cloud.alloydb.v1.AutomatedBackupP" - + "olicy.QuantityBasedRetentionH\001\022\024\n\007enable" - + "d\030\001 \001(\010H\002\210\001\001\0220\n\rbackup_window\030\003 \001(\0132\031.go" - + "ogle.protobuf.Duration\022J\n\021encryption_con" - + "fig\030\010 \001(\0132).google.cloud.alloydb.v1.Encr" - + "yptionConfigB\004\342A\001\001\022\020\n\010location\030\006 \001(\t\022J\n\006" - + "labels\030\007 \003(\0132:.google.cloud.alloydb.v1.A" - + "utomatedBackupPolicy.LabelsEntry\032k\n\016Week" - + "lySchedule\022+\n\013start_times\030\001 \003(\0132\026.google" - + ".type.TimeOfDay\022,\n\014days_of_week\030\002 \003(\0162\026." - + "google.type.DayOfWeek\032I\n\022TimeBasedRetent" - + "ion\0223\n\020retention_period\030\001 \001(\0132\031.google.p" - + "rotobuf.Duration\032\'\n\026QuantityBasedRetenti" - + "on\022\r\n\005count\030\001 \001(\005\032-\n\013LabelsEntry\022\013\n\003key\030" - + "\001 \001(\t\022\r\n\005value\030\002 \001(\t:\0028\001B\n\n\010scheduleB\013\n\t" - + "retentionB\n\n\010_enabled\"e\n\014BackupSource\022\030\n" - + "\nbackup_uid\030\002 \001(\tB\004\342A\001\003\022;\n\013backup_name\030\001" - + " \001(\tB&\342A\001\002\372A\037\n\035alloydb.googleapis.com/Ba" - + "ckup\"\323\016\n\007Cluster\022D\n\rbackup_source\030\017 \001(\0132" - + "%.google.cloud.alloydb.v1.BackupSourceB\004" - + "\342A\001\003H\000\022J\n\020migration_source\030\020 \001(\0132(.googl" - + "e.cloud.alloydb.v1.MigrationSourceB\004\342A\001\003" - + "H\000\022\022\n\004name\030\001 \001(\tB\004\342A\001\003\022\024\n\014display_name\030\002" - + " \001(\t\022\021\n\003uid\030\003 \001(\tB\004\342A\001\003\0225\n\013create_time\030\004" - + " \001(\0132\032.google.protobuf.TimestampB\004\342A\001\003\0225" - + "\n\013update_time\030\005 \001(\0132\032.google.protobuf.Ti" - + "mestampB\004\342A\001\003\0225\n\013delete_time\030\006 \001(\0132\032.goo" - + "gle.protobuf.TimestampB\004\342A\001\003\022<\n\006labels\030\007" - + " \003(\0132,.google.cloud.alloydb.v1.Cluster.L" - + "abelsEntry\022;\n\005state\030\010 \001(\0162&.google.cloud" - + ".alloydb.v1.Cluster.StateB\004\342A\001\003\022H\n\014clust" - + "er_type\030\030 \001(\0162,.google.cloud.alloydb.v1." - + "Cluster.ClusterTypeB\004\342A\001\003\022H\n\020database_ve" - + "rsion\030\t \001(\0162(.google.cloud.alloydb.v1.Da" - + "tabaseVersionB\004\342A\001\003\0228\n\007network\030\n \001(\tB\'\342A" - + "\001\002\372A \n\036compute.googleapis.com/Network\022\014\n" - + "\004etag\030\013 \001(\t\022F\n\013annotations\030\014 \003(\01321.googl" - + "e.cloud.alloydb.v1.Cluster.AnnotationsEn" - + "try\022\031\n\013reconciling\030\r \001(\010B\004\342A\001\003\022A\n\014initia" - + "l_user\030\016 \001(\0132%.google.cloud.alloydb.v1.U" - + "serPasswordB\004\342A\001\004\022O\n\027automated_backup_po" - + "licy\030\021 \001(\0132..google.cloud.alloydb.v1.Aut" - + "omatedBackupPolicy\0226\n\nssl_config\030\022 \001(\0132\"" - + ".google.cloud.alloydb.v1.SslConfig\022J\n\021en" - + "cryption_config\030\023 \001(\0132).google.cloud.all" - + "oydb.v1.EncryptionConfigB\004\342A\001\001\022F\n\017encryp" - + "tion_info\030\024 \001(\0132\'.google.cloud.alloydb.v" - + "1.EncryptionInfoB\004\342A\001\003\022J\n\020secondary_conf" - + "ig\030\026 \001(\01320.google.cloud.alloydb.v1.Clust" - + "er.SecondaryConfig\022L\n\016primary_config\030\027 \001" - + "(\0132..google.cloud.alloydb.v1.Cluster.Pri" - + "maryConfigB\004\342A\001\003\032/\n\017SecondaryConfig\022\034\n\024p" - + "rimary_cluster_name\030\001 \001(\t\0326\n\rPrimaryConf" - + "ig\022%\n\027secondary_cluster_names\030\001 \003(\tB\004\342A\001" + + "slConfig.CaSourceB\004\342A\001\001\"\252\001\n\007SslMode\022\030\n\024S" + + "SL_MODE_UNSPECIFIED\020\000\022\026\n\016SSL_MODE_ALLOW\020" + + "\001\032\002\010\001\022\030\n\020SSL_MODE_REQUIRE\020\002\032\002\010\001\022\032\n\022SSL_M" + + "ODE_VERIFY_CA\020\003\032\002\010\001\022#\n\037ALLOW_UNENCRYPTED" + + "_AND_ENCRYPTED\020\004\022\022\n\016ENCRYPTED_ONLY\020\005\"<\n\010" + + "CaSource\022\031\n\025CA_SOURCE_UNSPECIFIED\020\000\022\025\n\021C" + + "A_SOURCE_MANAGED\020\001\"\346\006\n\025AutomatedBackupPo" + + "licy\022X\n\017weekly_schedule\030\002 \001(\0132=.google.c" + + "loud.alloydb.v1.AutomatedBackupPolicy.We" + + "eklyScheduleH\000\022a\n\024time_based_retention\030\004" + + " \001(\0132A.google.cloud.alloydb.v1.Automated" + + "BackupPolicy.TimeBasedRetentionH\001\022i\n\030qua" + + "ntity_based_retention\030\005 \001(\0132E.google.clo" + + "ud.alloydb.v1.AutomatedBackupPolicy.Quan" + + "tityBasedRetentionH\001\022\024\n\007enabled\030\001 \001(\010H\002\210" + + "\001\001\0220\n\rbackup_window\030\003 \001(\0132\031.google.proto" + + "buf.Duration\022J\n\021encryption_config\030\010 \001(\0132" + + ").google.cloud.alloydb.v1.EncryptionConf" + + "igB\004\342A\001\001\022\020\n\010location\030\006 \001(\t\022J\n\006labels\030\007 \003" + + "(\0132:.google.cloud.alloydb.v1.AutomatedBa" + + "ckupPolicy.LabelsEntry\032k\n\016WeeklySchedule" + + "\022+\n\013start_times\030\001 \003(\0132\026.google.type.Time" + + "OfDay\022,\n\014days_of_week\030\002 \003(\0162\026.google.typ" + + "e.DayOfWeek\032I\n\022TimeBasedRetention\0223\n\020ret" + + "ention_period\030\001 \001(\0132\031.google.protobuf.Du" + + "ration\032\'\n\026QuantityBasedRetention\022\r\n\005coun" + + "t\030\001 \001(\005\032-\n\013LabelsEntry\022\013\n\003key\030\001 \001(\t\022\r\n\005v" + + "alue\030\002 \001(\t:\0028\001B\n\n\010scheduleB\013\n\tretentionB" + + "\n\n\010_enabled\"\236\001\n\026ContinuousBackupConfig\022\024" + + "\n\007enabled\030\001 \001(\010H\000\210\001\001\022\034\n\024recovery_window_" + + "days\030\004 \001(\005\022D\n\021encryption_config\030\003 \001(\0132)." + + "google.cloud.alloydb.v1.EncryptionConfig" + + "B\n\n\010_enabled\"\212\002\n\024ContinuousBackupInfo\022F\n" + + "\017encryption_info\030\001 \001(\0132\'.google.cloud.al" + + "loydb.v1.EncryptionInfoB\004\342A\001\003\0226\n\014enabled" + + "_time\030\002 \001(\0132\032.google.protobuf.TimestampB" + + "\004\342A\001\003\022.\n\010schedule\030\003 \003(\0162\026.google.type.Da" + + "yOfWeekB\004\342A\001\003\022B\n\030earliest_restorable_tim" + + "e\030\004 \001(\0132\032.google.protobuf.TimestampB\004\342A\001" + + "\003\"e\n\014BackupSource\022\030\n\nbackup_uid\030\002 \001(\tB\004\342" + + "A\001\003\022;\n\013backup_name\030\001 \001(\tB&\342A\001\002\372A\037\n\035alloy" + + "db.googleapis.com/Backup\"h\n\026ContinuousBa" + + "ckupSource\022\025\n\007cluster\030\001 \001(\tB\004\342A\001\002\0227\n\rpoi" + + "nt_in_time\030\002 \001(\0132\032.google.protobuf.Times" + + "tampB\004\342A\001\002\"\205\020\n\007Cluster\022D\n\rbackup_source\030" + + "\017 \001(\0132%.google.cloud.alloydb.v1.BackupSo" + + "urceB\004\342A\001\003H\000\022J\n\020migration_source\030\020 \001(\0132(" + + ".google.cloud.alloydb.v1.MigrationSource" + + "B\004\342A\001\003H\000\022\022\n\004name\030\001 \001(\tB\004\342A\001\003\022\024\n\014display_" + + "name\030\002 \001(\t\022\021\n\003uid\030\003 \001(\tB\004\342A\001\003\0225\n\013create_" + + "time\030\004 \001(\0132\032.google.protobuf.TimestampB\004" + + "\342A\001\003\0225\n\013update_time\030\005 \001(\0132\032.google.proto" + + "buf.TimestampB\004\342A\001\003\0225\n\013delete_time\030\006 \001(\013" + + "2\032.google.protobuf.TimestampB\004\342A\001\003\022<\n\006la" + + "bels\030\007 \003(\0132,.google.cloud.alloydb.v1.Clu" + + "ster.LabelsEntry\022;\n\005state\030\010 \001(\0162&.google" + + ".cloud.alloydb.v1.Cluster.StateB\004\342A\001\003\022H\n" + + "\014cluster_type\030\030 \001(\0162,.google.cloud.alloy" + + "db.v1.Cluster.ClusterTypeB\004\342A\001\003\022H\n\020datab" + + "ase_version\030\t \001(\0162(.google.cloud.alloydb" + + ".v1.DatabaseVersionB\004\342A\001\003\0228\n\007network\030\n \001" + + "(\tB\'\342A\001\002\372A \n\036compute.googleapis.com/Netw" + + "ork\022\014\n\004etag\030\013 \001(\t\022F\n\013annotations\030\014 \003(\01321" + + ".google.cloud.alloydb.v1.Cluster.Annotat" + + "ionsEntry\022\031\n\013reconciling\030\r \001(\010B\004\342A\001\003\022A\n\014" + + "initial_user\030\016 \001(\0132%.google.cloud.alloyd" + + "b.v1.UserPasswordB\004\342A\001\004\022O\n\027automated_bac" + + "kup_policy\030\021 \001(\0132..google.cloud.alloydb." + + "v1.AutomatedBackupPolicy\022:\n\nssl_config\030\022" + + " \001(\0132\".google.cloud.alloydb.v1.SslConfig" + + "B\002\030\001\022J\n\021encryption_config\030\023 \001(\0132).google" + + ".cloud.alloydb.v1.EncryptionConfigB\004\342A\001\001" + + "\022F\n\017encryption_info\030\024 \001(\0132\'.google.cloud" + + ".alloydb.v1.EncryptionInfoB\004\342A\001\003\022W\n\030cont" + + "inuous_backup_config\030\033 \001(\0132/.google.clou" + + "d.alloydb.v1.ContinuousBackupConfigB\004\342A\001" + + "\001\022S\n\026continuous_backup_info\030\034 \001(\0132-.goog" + + "le.cloud.alloydb.v1.ContinuousBackupInfo" + + "B\004\342A\001\003\022J\n\020secondary_config\030\026 \001(\01320.googl" + + "e.cloud.alloydb.v1.Cluster.SecondaryConf" + + "ig\022L\n\016primary_config\030\027 \001(\0132..google.clou" + + "d.alloydb.v1.Cluster.PrimaryConfigB\004\342A\001\003" + + "\032/\n\017SecondaryConfig\022\034\n\024primary_cluster_n" + + "ame\030\001 \001(\t\0326\n\rPrimaryConfig\022%\n\027secondary_" + + "cluster_names\030\001 \003(\tB\004\342A\001\003\032-\n\013LabelsEntry" + + "\022\013\n\003key\030\001 \001(\t\022\r\n\005value\030\002 \001(\t:\0028\001\0322\n\020Anno" + + "tationsEntry\022\013\n\003key\030\001 \001(\t\022\r\n\005value\030\002 \001(\t" + + ":\0028\001\"\234\001\n\005State\022\025\n\021STATE_UNSPECIFIED\020\000\022\t\n" + + "\005READY\020\001\022\013\n\007STOPPED\020\002\022\t\n\005EMPTY\020\003\022\014\n\010CREA" + + "TING\020\004\022\014\n\010DELETING\020\005\022\n\n\006FAILED\020\006\022\021\n\rBOOT" + + "STRAPPING\020\007\022\017\n\013MAINTENANCE\020\010\022\r\n\tPROMOTIN" + + "G\020\t\"G\n\013ClusterType\022\034\n\030CLUSTER_TYPE_UNSPE" + + "CIFIED\020\000\022\013\n\007PRIMARY\020\001\022\r\n\tSECONDARY\020\002:b\352A" + + "_\n\036alloydb.googleapis.com/Cluster\022:proje" + + "cts/{project}/locations/{location}/clust" + + "ers/{cluster}R\001\001B\010\n\006source\"\276\020\n\010Instance\022" + + "\022\n\004name\030\001 \001(\tB\004\342A\001\003\022\024\n\014display_name\030\002 \001(" + + "\t\022\021\n\003uid\030\003 \001(\tB\004\342A\001\003\0225\n\013create_time\030\004 \001(" + + "\0132\032.google.protobuf.TimestampB\004\342A\001\003\0225\n\013u" + + "pdate_time\030\005 \001(\0132\032.google.protobuf.Times" + + "tampB\004\342A\001\003\0225\n\013delete_time\030\006 \001(\0132\032.google" + + ".protobuf.TimestampB\004\342A\001\003\022=\n\006labels\030\007 \003(" + + "\0132-.google.cloud.alloydb.v1.Instance.Lab" + + "elsEntry\022<\n\005state\030\010 \001(\0162\'.google.cloud.a" + + "lloydb.v1.Instance.StateB\004\342A\001\003\022K\n\rinstan" + + "ce_type\030\t \001(\0162..google.cloud.alloydb.v1." + + "Instance.InstanceTypeB\004\342A\001\002\022G\n\016machine_c" + + "onfig\030\n \001(\0132/.google.cloud.alloydb.v1.In" + + "stance.MachineConfig\022M\n\021availability_typ" + + "e\030\013 \001(\01622.google.cloud.alloydb.v1.Instan" + + "ce.AvailabilityType\022\020\n\010gce_zone\030\014 \001(\t\022L\n" + + "\016database_flags\030\r \003(\01324.google.cloud.all" + + "oydb.v1.Instance.DatabaseFlagsEntry\022C\n\rw" + + "ritable_node\030\023 \001(\0132&.google.cloud.alloyd" + + "b.v1.Instance.NodeB\004\342A\001\003\022;\n\005nodes\030\024 \003(\0132" + + "&.google.cloud.alloydb.v1.Instance.NodeB" + + "\004\342A\001\003\022\\\n\025query_insights_config\030\025 \001(\0132=.g" + + "oogle.cloud.alloydb.v1.Instance.QueryIns" + + "ightsInstanceConfig\022J\n\020read_pool_config\030" + + "\016 \001(\01320.google.cloud.alloydb.v1.Instance" + + ".ReadPoolConfig\022\030\n\nip_address\030\017 \001(\tB\004\342A\001" + + "\003\022\031\n\013reconciling\030\020 \001(\010B\004\342A\001\003\022\014\n\004etag\030\021 \001" + + "(\t\022G\n\013annotations\030\022 \003(\01322.google.cloud.a" + + "lloydb.v1.Instance.AnnotationsEntry\032\"\n\rM" + + "achineConfig\022\021\n\tcpu_count\030\001 \001(\005\032>\n\004Node\022" + + "\017\n\007zone_id\030\001 \001(\t\022\n\n\002id\030\002 \001(\t\022\n\n\002ip\030\003 \001(\t" + + "\022\r\n\005state\030\004 \001(\t\032\372\001\n\033QueryInsightsInstanc" + + "eConfig\022$\n\027record_application_tags\030\002 \001(\010" + + "H\000\210\001\001\022\"\n\025record_client_address\030\003 \001(\010H\001\210\001" + + "\001\022\033\n\023query_string_length\030\004 \001(\r\022#\n\026query_" + + "plans_per_minute\030\005 \001(\rH\002\210\001\001B\032\n\030_record_a" + + "pplication_tagsB\030\n\026_record_client_addres" + + "sB\031\n\027_query_plans_per_minute\032$\n\016ReadPool" + + "Config\022\022\n\nnode_count\030\001 \001(\005\032-\n\013LabelsEntr" + + "y\022\013\n\003key\030\001 \001(\t\022\r\n\005value\030\002 \001(\t:\0028\001\0324\n\022Dat" + + "abaseFlagsEntry\022\013\n\003key\030\001 \001(\t\022\r\n\005value\030\002 " + + "\001(\t:\0028\001\0322\n\020AnnotationsEntry\022\013\n\003key\030\001 \001(\t" + + "\022\r\n\005value\030\002 \001(\t:\0028\001\"\221\001\n\005State\022\025\n\021STATE_U" + + "NSPECIFIED\020\000\022\t\n\005READY\020\001\022\013\n\007STOPPED\020\002\022\014\n\010" + + "CREATING\020\003\022\014\n\010DELETING\020\004\022\017\n\013MAINTENANCE\020" + + "\005\022\n\n\006FAILED\020\006\022\021\n\rBOOTSTRAPPING\020\010\022\r\n\tPROM" + + "OTING\020\t\"X\n\014InstanceType\022\035\n\031INSTANCE_TYPE" + + "_UNSPECIFIED\020\000\022\013\n\007PRIMARY\020\001\022\r\n\tREAD_POOL" + + "\020\002\022\r\n\tSECONDARY\020\003\"N\n\020AvailabilityType\022!\n" + + "\035AVAILABILITY_TYPE_UNSPECIFIED\020\000\022\t\n\005ZONA" + + "L\020\001\022\014\n\010REGIONAL\020\002:x\352Au\n\037alloydb.googleap" + + "is.com/Instance\022Oprojects/{project}/loca" + + "tions/{location}/clusters/{cluster}/inst" + + "ances/{instance}R\001\001\"\276\t\n\006Backup\022\022\n\004name\030\001" + + " \001(\tB\004\342A\001\003\022\024\n\014display_name\030\002 \001(\t\022\021\n\003uid\030" + + "\003 \001(\tB\004\342A\001\003\0225\n\013create_time\030\004 \001(\0132\032.googl" + + "e.protobuf.TimestampB\004\342A\001\003\0225\n\013update_tim" + + "e\030\005 \001(\0132\032.google.protobuf.TimestampB\004\342A\001" + + "\003\0225\n\013delete_time\030\017 \001(\0132\032.google.protobuf" + + ".TimestampB\004\342A\001\003\022;\n\006labels\030\006 \003(\0132+.googl" + + "e.cloud.alloydb.v1.Backup.LabelsEntry\022:\n" + + "\005state\030\007 \001(\0162%.google.cloud.alloydb.v1.B" + + "ackup.StateB\004\342A\001\003\0222\n\004type\030\010 \001(\0162$.google" + + ".cloud.alloydb.v1.Backup.Type\022\023\n\013descrip" + + "tion\030\t \001(\t\022\031\n\013cluster_uid\030\022 \001(\tB\004\342A\001\003\022=\n" + + "\014cluster_name\030\n \001(\tB\'\342A\001\002\372A \n\036alloydb.go" + + "ogleapis.com/Cluster\022\031\n\013reconciling\030\013 \001(" + + "\010B\004\342A\001\003\022J\n\021encryption_config\030\014 \001(\0132).goo" + + "gle.cloud.alloydb.v1.EncryptionConfigB\004\342" + + "A\001\001\022F\n\017encryption_info\030\r \001(\0132\'.google.cl" + + "oud.alloydb.v1.EncryptionInfoB\004\342A\001\003\022\014\n\004e" + + "tag\030\016 \001(\t\022E\n\013annotations\030\020 \003(\01320.google." + + "cloud.alloydb.v1.Backup.AnnotationsEntry" + + "\022\030\n\nsize_bytes\030\021 \001(\003B\004\342A\001\003\0225\n\013expiry_tim" + + "e\030\023 \001(\0132\032.google.protobuf.TimestampB\004\342A\001" + "\003\032-\n\013LabelsEntry\022\013\n\003key\030\001 \001(\t\022\r\n\005value\030\002" + " \001(\t:\0028\001\0322\n\020AnnotationsEntry\022\013\n\003key\030\001 \001(" - + "\t\022\r\n\005value\030\002 \001(\t:\0028\001\"\234\001\n\005State\022\025\n\021STATE_" - + "UNSPECIFIED\020\000\022\t\n\005READY\020\001\022\013\n\007STOPPED\020\002\022\t\n" - + "\005EMPTY\020\003\022\014\n\010CREATING\020\004\022\014\n\010DELETING\020\005\022\n\n\006" - + "FAILED\020\006\022\021\n\rBOOTSTRAPPING\020\007\022\017\n\013MAINTENAN" - + "CE\020\010\022\r\n\tPROMOTING\020\t\"G\n\013ClusterType\022\034\n\030CL" - + "USTER_TYPE_UNSPECIFIED\020\000\022\013\n\007PRIMARY\020\001\022\r\n" - + "\tSECONDARY\020\002:b\352A_\n\036alloydb.googleapis.co" - + "m/Cluster\022:projects/{project}/locations/" - + "{location}/clusters/{cluster}R\001\001B\010\n\006sour" - + "ce\"\276\020\n\010Instance\022\022\n\004name\030\001 \001(\tB\004\342A\001\003\022\024\n\014d" - + "isplay_name\030\002 \001(\t\022\021\n\003uid\030\003 \001(\tB\004\342A\001\003\0225\n\013" - + "create_time\030\004 \001(\0132\032.google.protobuf.Time" - + "stampB\004\342A\001\003\0225\n\013update_time\030\005 \001(\0132\032.googl" - + "e.protobuf.TimestampB\004\342A\001\003\0225\n\013delete_tim" - + "e\030\006 \001(\0132\032.google.protobuf.TimestampB\004\342A\001" - + "\003\022=\n\006labels\030\007 \003(\0132-.google.cloud.alloydb" - + ".v1.Instance.LabelsEntry\022<\n\005state\030\010 \001(\0162" - + "\'.google.cloud.alloydb.v1.Instance.State" - + "B\004\342A\001\003\022K\n\rinstance_type\030\t \001(\0162..google.c" - + "loud.alloydb.v1.Instance.InstanceTypeB\004\342" - + "A\001\002\022G\n\016machine_config\030\n \001(\0132/.google.clo" - + "ud.alloydb.v1.Instance.MachineConfig\022M\n\021" - + "availability_type\030\013 \001(\01622.google.cloud.a" - + "lloydb.v1.Instance.AvailabilityType\022\020\n\010g" - + "ce_zone\030\014 \001(\t\022L\n\016database_flags\030\r \003(\01324." - + "google.cloud.alloydb.v1.Instance.Databas" - + "eFlagsEntry\022C\n\rwritable_node\030\023 \001(\0132&.goo" - + "gle.cloud.alloydb.v1.Instance.NodeB\004\342A\001\003" - + "\022;\n\005nodes\030\024 \003(\0132&.google.cloud.alloydb.v" - + "1.Instance.NodeB\004\342A\001\003\022\\\n\025query_insights_" - + "config\030\025 \001(\0132=.google.cloud.alloydb.v1.I" - + "nstance.QueryInsightsInstanceConfig\022J\n\020r" - + "ead_pool_config\030\016 \001(\01320.google.cloud.all" - + "oydb.v1.Instance.ReadPoolConfig\022\030\n\nip_ad" - + "dress\030\017 \001(\tB\004\342A\001\003\022\031\n\013reconciling\030\020 \001(\010B\004" - + "\342A\001\003\022\014\n\004etag\030\021 \001(\t\022G\n\013annotations\030\022 \003(\0132" - + "2.google.cloud.alloydb.v1.Instance.Annot" - + "ationsEntry\032\"\n\rMachineConfig\022\021\n\tcpu_coun" - + "t\030\001 \001(\005\032>\n\004Node\022\017\n\007zone_id\030\001 \001(\t\022\n\n\002id\030\002" - + " \001(\t\022\n\n\002ip\030\003 \001(\t\022\r\n\005state\030\004 \001(\t\032\372\001\n\033Quer" - + "yInsightsInstanceConfig\022$\n\027record_applic" - + "ation_tags\030\002 \001(\010H\000\210\001\001\022\"\n\025record_client_a" - + "ddress\030\003 \001(\010H\001\210\001\001\022\033\n\023query_string_length" - + "\030\004 \001(\r\022#\n\026query_plans_per_minute\030\005 \001(\rH\002" - + "\210\001\001B\032\n\030_record_application_tagsB\030\n\026_reco" - + "rd_client_addressB\031\n\027_query_plans_per_mi" - + "nute\032$\n\016ReadPoolConfig\022\022\n\nnode_count\030\001 \001" - + "(\005\032-\n\013LabelsEntry\022\013\n\003key\030\001 \001(\t\022\r\n\005value\030" - + "\002 \001(\t:\0028\001\0324\n\022DatabaseFlagsEntry\022\013\n\003key\030\001" - + " \001(\t\022\r\n\005value\030\002 \001(\t:\0028\001\0322\n\020AnnotationsEn" - + "try\022\013\n\003key\030\001 \001(\t\022\r\n\005value\030\002 \001(\t:\0028\001\"\221\001\n\005" - + "State\022\025\n\021STATE_UNSPECIFIED\020\000\022\t\n\005READY\020\001\022" - + "\013\n\007STOPPED\020\002\022\014\n\010CREATING\020\003\022\014\n\010DELETING\020\004" - + "\022\017\n\013MAINTENANCE\020\005\022\n\n\006FAILED\020\006\022\021\n\rBOOTSTR" - + "APPING\020\010\022\r\n\tPROMOTING\020\t\"X\n\014InstanceType\022" - + "\035\n\031INSTANCE_TYPE_UNSPECIFIED\020\000\022\013\n\007PRIMAR" - + "Y\020\001\022\r\n\tREAD_POOL\020\002\022\r\n\tSECONDARY\020\003\"N\n\020Ava" - + "ilabilityType\022!\n\035AVAILABILITY_TYPE_UNSPE" - + "CIFIED\020\000\022\t\n\005ZONAL\020\001\022\014\n\010REGIONAL\020\002:x\352Au\n\037" - + "alloydb.googleapis.com/Instance\022Oproject" - + "s/{project}/locations/{location}/cluster" - + "s/{cluster}/instances/{instance}R\001\001\"\276\t\n\006" - + "Backup\022\022\n\004name\030\001 \001(\tB\004\342A\001\003\022\024\n\014display_na" - + "me\030\002 \001(\t\022\021\n\003uid\030\003 \001(\tB\004\342A\001\003\0225\n\013create_ti" - + "me\030\004 \001(\0132\032.google.protobuf.TimestampB\004\342A" - + "\001\003\0225\n\013update_time\030\005 \001(\0132\032.google.protobu" - + "f.TimestampB\004\342A\001\003\0225\n\013delete_time\030\017 \001(\0132\032" - + ".google.protobuf.TimestampB\004\342A\001\003\022;\n\006labe" - + "ls\030\006 \003(\0132+.google.cloud.alloydb.v1.Backu" - + "p.LabelsEntry\022:\n\005state\030\007 \001(\0162%.google.cl" - + "oud.alloydb.v1.Backup.StateB\004\342A\001\003\0222\n\004typ" - + "e\030\010 \001(\0162$.google.cloud.alloydb.v1.Backup" - + ".Type\022\023\n\013description\030\t \001(\t\022\031\n\013cluster_ui" - + "d\030\022 \001(\tB\004\342A\001\003\022=\n\014cluster_name\030\n \001(\tB\'\342A\001" - + "\002\372A \n\036alloydb.googleapis.com/Cluster\022\031\n\013" - + "reconciling\030\013 \001(\010B\004\342A\001\003\022J\n\021encryption_co" - + "nfig\030\014 \001(\0132).google.cloud.alloydb.v1.Enc" - + "ryptionConfigB\004\342A\001\001\022F\n\017encryption_info\030\r" - + " \001(\0132\'.google.cloud.alloydb.v1.Encryptio" - + "nInfoB\004\342A\001\003\022\014\n\004etag\030\016 \001(\t\022E\n\013annotations" - + "\030\020 \003(\01320.google.cloud.alloydb.v1.Backup." - + "AnnotationsEntry\022\030\n\nsize_bytes\030\021 \001(\003B\004\342A" - + "\001\003\0225\n\013expiry_time\030\023 \001(\0132\032.google.protobu" - + "f.TimestampB\004\342A\001\003\032-\n\013LabelsEntry\022\013\n\003key\030" - + "\001 \001(\t\022\r\n\005value\030\002 \001(\t:\0028\001\0322\n\020AnnotationsE" - + "ntry\022\013\n\003key\030\001 \001(\t\022\r\n\005value\030\002 \001(\t:\0028\001\"Q\n\005" - + "State\022\025\n\021STATE_UNSPECIFIED\020\000\022\t\n\005READY\020\001\022" - + "\014\n\010CREATING\020\002\022\n\n\006FAILED\020\003\022\014\n\010DELETING\020\004\"" - + "J\n\004Type\022\024\n\020TYPE_UNSPECIFIED\020\000\022\r\n\tON_DEMA" - + "ND\020\001\022\r\n\tAUTOMATED\020\002\022\016\n\nCONTINUOUS\020\003:_\352A\\" - + "\n\035alloydb.googleapis.com/Backup\0228project" - + "s/{project}/locations/{location}/backups" - + "/{backup}R\001\001\"\310\006\n\025SupportedDatabaseFlag\022`" - + "\n\023string_restrictions\030\007 \001(\0132A.google.clo" - + "ud.alloydb.v1.SupportedDatabaseFlag.Stri" - + "ngRestrictionsH\000\022b\n\024integer_restrictions" - + "\030\010 \001(\0132B.google.cloud.alloydb.v1.Support" - + "edDatabaseFlag.IntegerRestrictionsH\000\022\014\n\004" - + "name\030\001 \001(\t\022\021\n\tflag_name\030\002 \001(\t\022L\n\nvalue_t" - + "ype\030\003 \001(\01628.google.cloud.alloydb.v1.Supp" - + "ortedDatabaseFlag.ValueType\022\037\n\027accepts_m" - + "ultiple_values\030\004 \001(\010\022G\n\025supported_db_ver" - + "sions\030\005 \003(\0162(.google.cloud.alloydb.v1.Da" - + "tabaseVersion\022\033\n\023requires_db_restart\030\006 \001" - + "(\010\032,\n\022StringRestrictions\022\026\n\016allowed_valu" - + "es\030\001 \003(\t\032u\n\023IntegerRestrictions\022.\n\tmin_v" - + "alue\030\001 \001(\0132\033.google.protobuf.Int64Value\022" - + ".\n\tmax_value\030\002 \001(\0132\033.google.protobuf.Int" - + "64Value\"U\n\tValueType\022\032\n\026VALUE_TYPE_UNSPE" - + "CIFIED\020\000\022\n\n\006STRING\020\001\022\013\n\007INTEGER\020\002\022\t\n\005FLO" - + "AT\020\003\022\010\n\004NONE\020\004:g\352Ad\n,alloydb.googleapis." - + "com/SupportedDatabaseFlag\0224projects/{pro" - + "ject}/locations/{location}/flags/{flag}B" - + "\016\n\014restrictions*Y\n\017DatabaseVersion\022 \n\034DA" - + "TABASE_VERSION_UNSPECIFIED\020\000\022\023\n\013POSTGRES" - + "_13\020\001\032\002\010\001\022\017\n\013POSTGRES_14\020\002*^\n\014InstanceVi" - + "ew\022\035\n\031INSTANCE_VIEW_UNSPECIFIED\020\000\022\027\n\023INS" - + "TANCE_VIEW_BASIC\020\001\022\026\n\022INSTANCE_VIEW_FULL" - + "\020\002B\262\003\n\033com.google.cloud.alloydb.v1B\016Reso" - + "urcesProtoP\001Z5cloud.google.com/go/alloyd" - + "b/apiv1/alloydbpb;alloydbpb\252\002\027Google.Clo" - + "ud.AlloyDb.V1\312\002\027Google\\Cloud\\AlloyDb\\V1\352" - + "\002\032Google::Cloud::AlloyDB::V1\352A\246\001\n(cloudk" - + "ms.googleapis.com/CryptoKeyVersion\022zproj" - + "ects/{project}/locations/{location}/keyR" - + "ings/{key_ring}/cryptoKeys/{crypto_key}/" - + "cryptoKeyVersions/{crypto_key_version}\352A" - + "N\n\036compute.googleapis.com/Network\022,proje" - + "cts/{project}/global/networks/{network}b" - + "\006proto3" + + "\t\022\r\n\005value\030\002 \001(\t:\0028\001\"Q\n\005State\022\025\n\021STATE_U" + + "NSPECIFIED\020\000\022\t\n\005READY\020\001\022\014\n\010CREATING\020\002\022\n\n" + + "\006FAILED\020\003\022\014\n\010DELETING\020\004\"J\n\004Type\022\024\n\020TYPE_" + + "UNSPECIFIED\020\000\022\r\n\tON_DEMAND\020\001\022\r\n\tAUTOMATE" + + "D\020\002\022\016\n\nCONTINUOUS\020\003:_\352A\\\n\035alloydb.google" + + "apis.com/Backup\0228projects/{project}/loca" + + "tions/{location}/backups/{backup}R\001\001\"\310\006\n" + + "\025SupportedDatabaseFlag\022`\n\023string_restric" + + "tions\030\007 \001(\0132A.google.cloud.alloydb.v1.Su" + + "pportedDatabaseFlag.StringRestrictionsH\000" + + "\022b\n\024integer_restrictions\030\010 \001(\0132B.google." + + "cloud.alloydb.v1.SupportedDatabaseFlag.I" + + "ntegerRestrictionsH\000\022\014\n\004name\030\001 \001(\t\022\021\n\tfl" + + "ag_name\030\002 \001(\t\022L\n\nvalue_type\030\003 \001(\01628.goog" + + "le.cloud.alloydb.v1.SupportedDatabaseFla" + + "g.ValueType\022\037\n\027accepts_multiple_values\030\004" + + " \001(\010\022G\n\025supported_db_versions\030\005 \003(\0162(.go" + + "ogle.cloud.alloydb.v1.DatabaseVersion\022\033\n" + + "\023requires_db_restart\030\006 \001(\010\032,\n\022StringRest" + + "rictions\022\026\n\016allowed_values\030\001 \003(\t\032u\n\023Inte" + + "gerRestrictions\022.\n\tmin_value\030\001 \001(\0132\033.goo" + + "gle.protobuf.Int64Value\022.\n\tmax_value\030\002 \001" + + "(\0132\033.google.protobuf.Int64Value\"U\n\tValue" + + "Type\022\032\n\026VALUE_TYPE_UNSPECIFIED\020\000\022\n\n\006STRI" + + "NG\020\001\022\013\n\007INTEGER\020\002\022\t\n\005FLOAT\020\003\022\010\n\004NONE\020\004:g" + + "\352Ad\n,alloydb.googleapis.com/SupportedDat" + + "abaseFlag\0224projects/{project}/locations/" + + "{location}/flags/{flag}B\016\n\014restrictions\"" + + "\322\002\n\004User\022\022\n\004name\030\001 \001(\tB\004\342A\001\003\022\026\n\010password" + + "\030\002 \001(\tB\004\342A\001\004\022\034\n\016database_roles\030\004 \003(\tB\004\342A" + + "\001\001\022?\n\tuser_type\030\005 \001(\0162&.google.cloud.all" + + "oydb.v1.User.UserTypeB\004\342A\001\001\"Q\n\010UserType\022" + + "\031\n\025USER_TYPE_UNSPECIFIED\020\000\022\024\n\020ALLOYDB_BU" + + "ILT_IN\020\001\022\024\n\020ALLOYDB_IAM_USER\020\002:l\352Ai\n\033all" + + "oydb.googleapis.com/User\022Gprojects/{proj" + + "ect}/locations/{location}/clusters/{clus" + + "ter}/users/{user}R\001\001*^\n\014InstanceView\022\035\n\031" + + "INSTANCE_VIEW_UNSPECIFIED\020\000\022\027\n\023INSTANCE_" + + "VIEW_BASIC\020\001\022\026\n\022INSTANCE_VIEW_FULL\020\002*g\n\013" + + "ClusterView\022\034\n\030CLUSTER_VIEW_UNSPECIFIED\020" + + "\000\022\026\n\022CLUSTER_VIEW_BASIC\020\001\022\"\n\036CLUSTER_VIE" + + "W_CONTINUOUS_BACKUP\020\002*Y\n\017DatabaseVersion" + + "\022 \n\034DATABASE_VERSION_UNSPECIFIED\020\000\022\023\n\013PO" + + "STGRES_13\020\001\032\002\010\001\022\017\n\013POSTGRES_14\020\002B\262\003\n\033com" + + ".google.cloud.alloydb.v1B\016ResourcesProto" + + "P\001Z5cloud.google.com/go/alloydb/apiv1/al" + + "loydbpb;alloydbpb\252\002\027Google.Cloud.AlloyDb" + + ".V1\312\002\027Google\\Cloud\\AlloyDb\\V1\352\002\032Google::" + + "Cloud::AlloyDB::V1\352A\246\001\n(cloudkms.googlea" + + "pis.com/CryptoKeyVersion\022zprojects/{proj" + + "ect}/locations/{location}/keyRings/{key_" + + "ring}/cryptoKeys/{crypto_key}/cryptoKeyV" + + "ersions/{crypto_key_version}\352AN\n\036compute" + + ".googleapis.com/Network\022,projects/{proje" + + "ct}/global/networks/{network}b\006proto3" }; descriptor = com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( @@ -489,16 +535,40 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { new java.lang.String[] { "Key", "Value", }); - internal_static_google_cloud_alloydb_v1_BackupSource_descriptor = + internal_static_google_cloud_alloydb_v1_ContinuousBackupConfig_descriptor = getDescriptor().getMessageTypes().get(6); + internal_static_google_cloud_alloydb_v1_ContinuousBackupConfig_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_alloydb_v1_ContinuousBackupConfig_descriptor, + new java.lang.String[] { + "Enabled", "RecoveryWindowDays", "EncryptionConfig", "Enabled", + }); + internal_static_google_cloud_alloydb_v1_ContinuousBackupInfo_descriptor = + getDescriptor().getMessageTypes().get(7); + internal_static_google_cloud_alloydb_v1_ContinuousBackupInfo_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_alloydb_v1_ContinuousBackupInfo_descriptor, + new java.lang.String[] { + "EncryptionInfo", "EnabledTime", "Schedule", "EarliestRestorableTime", + }); + internal_static_google_cloud_alloydb_v1_BackupSource_descriptor = + getDescriptor().getMessageTypes().get(8); internal_static_google_cloud_alloydb_v1_BackupSource_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_alloydb_v1_BackupSource_descriptor, new java.lang.String[] { "BackupUid", "BackupName", }); + internal_static_google_cloud_alloydb_v1_ContinuousBackupSource_descriptor = + getDescriptor().getMessageTypes().get(9); + internal_static_google_cloud_alloydb_v1_ContinuousBackupSource_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_alloydb_v1_ContinuousBackupSource_descriptor, + new java.lang.String[] { + "Cluster", "PointInTime", + }); internal_static_google_cloud_alloydb_v1_Cluster_descriptor = - getDescriptor().getMessageTypes().get(7); + getDescriptor().getMessageTypes().get(10); internal_static_google_cloud_alloydb_v1_Cluster_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_alloydb_v1_Cluster_descriptor, @@ -524,6 +594,8 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "SslConfig", "EncryptionConfig", "EncryptionInfo", + "ContinuousBackupConfig", + "ContinuousBackupInfo", "SecondaryConfig", "PrimaryConfig", "Source", @@ -561,7 +633,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "Key", "Value", }); internal_static_google_cloud_alloydb_v1_Instance_descriptor = - getDescriptor().getMessageTypes().get(8); + getDescriptor().getMessageTypes().get(11); internal_static_google_cloud_alloydb_v1_Instance_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_alloydb_v1_Instance_descriptor, @@ -651,7 +723,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "Key", "Value", }); internal_static_google_cloud_alloydb_v1_Backup_descriptor = - getDescriptor().getMessageTypes().get(9); + getDescriptor().getMessageTypes().get(12); internal_static_google_cloud_alloydb_v1_Backup_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_alloydb_v1_Backup_descriptor, @@ -693,7 +765,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "Key", "Value", }); internal_static_google_cloud_alloydb_v1_SupportedDatabaseFlag_descriptor = - getDescriptor().getMessageTypes().get(10); + getDescriptor().getMessageTypes().get(13); internal_static_google_cloud_alloydb_v1_SupportedDatabaseFlag_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_alloydb_v1_SupportedDatabaseFlag_descriptor, @@ -728,6 +800,14 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { new java.lang.String[] { "MinValue", "MaxValue", }); + internal_static_google_cloud_alloydb_v1_User_descriptor = + getDescriptor().getMessageTypes().get(14); + internal_static_google_cloud_alloydb_v1_User_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_alloydb_v1_User_descriptor, + new java.lang.String[] { + "Name", "Password", "DatabaseRoles", "UserType", + }); com.google.protobuf.ExtensionRegistry registry = com.google.protobuf.ExtensionRegistry.newInstance(); registry.add(com.google.api.FieldBehaviorProto.fieldBehavior); diff --git a/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/RestoreClusterRequest.java b/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/RestoreClusterRequest.java index f565c56c584c..d49c20ca96c6 100644 --- a/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/RestoreClusterRequest.java +++ b/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/RestoreClusterRequest.java @@ -75,6 +75,7 @@ public enum SourceCase com.google.protobuf.Internal.EnumLite, com.google.protobuf.AbstractMessage.InternalOneOfEnum { BACKUP_SOURCE(4), + CONTINUOUS_BACKUP_SOURCE(8), SOURCE_NOT_SET(0); private final int value; @@ -95,6 +96,8 @@ public static SourceCase forNumber(int value) { switch (value) { case 4: return BACKUP_SOURCE; + case 8: + return CONTINUOUS_BACKUP_SOURCE; case 0: return SOURCE_NOT_SET; default: @@ -162,6 +165,61 @@ public com.google.cloud.alloydb.v1.BackupSourceOrBuilder getBackupSourceOrBuilde return com.google.cloud.alloydb.v1.BackupSource.getDefaultInstance(); } + public static final int CONTINUOUS_BACKUP_SOURCE_FIELD_NUMBER = 8; + /** + * + * + *
+   * ContinuousBackup source. Continuous backup needs to be enabled in the
+   * source cluster for this operation to succeed.
+   * 
+ * + * .google.cloud.alloydb.v1.ContinuousBackupSource continuous_backup_source = 8; + * + * @return Whether the continuousBackupSource field is set. + */ + @java.lang.Override + public boolean hasContinuousBackupSource() { + return sourceCase_ == 8; + } + /** + * + * + *
+   * ContinuousBackup source. Continuous backup needs to be enabled in the
+   * source cluster for this operation to succeed.
+   * 
+ * + * .google.cloud.alloydb.v1.ContinuousBackupSource continuous_backup_source = 8; + * + * @return The continuousBackupSource. + */ + @java.lang.Override + public com.google.cloud.alloydb.v1.ContinuousBackupSource getContinuousBackupSource() { + if (sourceCase_ == 8) { + return (com.google.cloud.alloydb.v1.ContinuousBackupSource) source_; + } + return com.google.cloud.alloydb.v1.ContinuousBackupSource.getDefaultInstance(); + } + /** + * + * + *
+   * ContinuousBackup source. Continuous backup needs to be enabled in the
+   * source cluster for this operation to succeed.
+   * 
+ * + * .google.cloud.alloydb.v1.ContinuousBackupSource continuous_backup_source = 8; + */ + @java.lang.Override + public com.google.cloud.alloydb.v1.ContinuousBackupSourceOrBuilder + getContinuousBackupSourceOrBuilder() { + if (sourceCase_ == 8) { + return (com.google.cloud.alloydb.v1.ContinuousBackupSource) source_; + } + return com.google.cloud.alloydb.v1.ContinuousBackupSource.getDefaultInstance(); + } + public static final int PARENT_FIELD_NUMBER = 1; @SuppressWarnings("serial") @@ -446,6 +504,9 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (validateOnly_ != false) { output.writeBool(6, validateOnly_); } + if (sourceCase_ == 8) { + output.writeMessage(8, (com.google.cloud.alloydb.v1.ContinuousBackupSource) source_); + } getUnknownFields().writeTo(output); } @@ -475,6 +536,11 @@ public int getSerializedSize() { if (validateOnly_ != false) { size += com.google.protobuf.CodedOutputStream.computeBoolSize(6, validateOnly_); } + if (sourceCase_ == 8) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 8, (com.google.cloud.alloydb.v1.ContinuousBackupSource) source_); + } size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; @@ -504,6 +570,9 @@ public boolean equals(final java.lang.Object obj) { case 4: if (!getBackupSource().equals(other.getBackupSource())) return false; break; + case 8: + if (!getContinuousBackupSource().equals(other.getContinuousBackupSource())) return false; + break; case 0: default: } @@ -535,6 +604,10 @@ public int hashCode() { hash = (37 * hash) + BACKUP_SOURCE_FIELD_NUMBER; hash = (53 * hash) + getBackupSource().hashCode(); break; + case 8: + hash = (37 * hash) + CONTINUOUS_BACKUP_SOURCE_FIELD_NUMBER; + hash = (53 * hash) + getContinuousBackupSource().hashCode(); + break; case 0: default: } @@ -681,6 +754,9 @@ public Builder clear() { if (backupSourceBuilder_ != null) { backupSourceBuilder_.clear(); } + if (continuousBackupSourceBuilder_ != null) { + continuousBackupSourceBuilder_.clear(); + } parent_ = ""; clusterId_ = ""; cluster_ = null; @@ -729,19 +805,19 @@ public com.google.cloud.alloydb.v1.RestoreClusterRequest buildPartial() { private void buildPartial0(com.google.cloud.alloydb.v1.RestoreClusterRequest result) { int from_bitField0_ = bitField0_; - if (((from_bitField0_ & 0x00000002) != 0)) { + if (((from_bitField0_ & 0x00000004) != 0)) { result.parent_ = parent_; } - if (((from_bitField0_ & 0x00000004) != 0)) { + if (((from_bitField0_ & 0x00000008) != 0)) { result.clusterId_ = clusterId_; } - if (((from_bitField0_ & 0x00000008) != 0)) { + if (((from_bitField0_ & 0x00000010) != 0)) { result.cluster_ = clusterBuilder_ == null ? cluster_ : clusterBuilder_.build(); } - if (((from_bitField0_ & 0x00000010) != 0)) { + if (((from_bitField0_ & 0x00000020) != 0)) { result.requestId_ = requestId_; } - if (((from_bitField0_ & 0x00000020) != 0)) { + if (((from_bitField0_ & 0x00000040) != 0)) { result.validateOnly_ = validateOnly_; } } @@ -752,6 +828,9 @@ private void buildPartialOneofs(com.google.cloud.alloydb.v1.RestoreClusterReques if (sourceCase_ == 4 && backupSourceBuilder_ != null) { result.source_ = backupSourceBuilder_.build(); } + if (sourceCase_ == 8 && continuousBackupSourceBuilder_ != null) { + result.source_ = continuousBackupSourceBuilder_.build(); + } } @java.lang.Override @@ -802,12 +881,12 @@ public Builder mergeFrom(com.google.cloud.alloydb.v1.RestoreClusterRequest other return this; if (!other.getParent().isEmpty()) { parent_ = other.parent_; - bitField0_ |= 0x00000002; + bitField0_ |= 0x00000004; onChanged(); } if (!other.getClusterId().isEmpty()) { clusterId_ = other.clusterId_; - bitField0_ |= 0x00000004; + bitField0_ |= 0x00000008; onChanged(); } if (other.hasCluster()) { @@ -815,7 +894,7 @@ public Builder mergeFrom(com.google.cloud.alloydb.v1.RestoreClusterRequest other } if (!other.getRequestId().isEmpty()) { requestId_ = other.requestId_; - bitField0_ |= 0x00000010; + bitField0_ |= 0x00000020; onChanged(); } if (other.getValidateOnly() != false) { @@ -827,6 +906,11 @@ public Builder mergeFrom(com.google.cloud.alloydb.v1.RestoreClusterRequest other mergeBackupSource(other.getBackupSource()); break; } + case CONTINUOUS_BACKUP_SOURCE: + { + mergeContinuousBackupSource(other.getContinuousBackupSource()); + break; + } case SOURCE_NOT_SET: { break; @@ -861,19 +945,19 @@ public Builder mergeFrom( case 10: { parent_ = input.readStringRequireUtf8(); - bitField0_ |= 0x00000002; + bitField0_ |= 0x00000004; break; } // case 10 case 18: { clusterId_ = input.readStringRequireUtf8(); - bitField0_ |= 0x00000004; + bitField0_ |= 0x00000008; break; } // case 18 case 26: { input.readMessage(getClusterFieldBuilder().getBuilder(), extensionRegistry); - bitField0_ |= 0x00000008; + bitField0_ |= 0x00000010; break; } // case 26 case 34: @@ -885,15 +969,22 @@ public Builder mergeFrom( case 42: { requestId_ = input.readStringRequireUtf8(); - bitField0_ |= 0x00000010; + bitField0_ |= 0x00000020; break; } // case 42 case 48: { validateOnly_ = input.readBool(); - bitField0_ |= 0x00000020; + bitField0_ |= 0x00000040; break; } // case 48 + case 66: + { + input.readMessage( + getContinuousBackupSourceFieldBuilder().getBuilder(), extensionRegistry); + sourceCase_ = 8; + break; + } // case 66 default: { if (!super.parseUnknownField(input, extensionRegistry, tag)) { @@ -1136,6 +1227,228 @@ public com.google.cloud.alloydb.v1.BackupSourceOrBuilder getBackupSourceOrBuilde return backupSourceBuilder_; } + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1.ContinuousBackupSource, + com.google.cloud.alloydb.v1.ContinuousBackupSource.Builder, + com.google.cloud.alloydb.v1.ContinuousBackupSourceOrBuilder> + continuousBackupSourceBuilder_; + /** + * + * + *
+     * ContinuousBackup source. Continuous backup needs to be enabled in the
+     * source cluster for this operation to succeed.
+     * 
+ * + * .google.cloud.alloydb.v1.ContinuousBackupSource continuous_backup_source = 8; + * + * @return Whether the continuousBackupSource field is set. + */ + @java.lang.Override + public boolean hasContinuousBackupSource() { + return sourceCase_ == 8; + } + /** + * + * + *
+     * ContinuousBackup source. Continuous backup needs to be enabled in the
+     * source cluster for this operation to succeed.
+     * 
+ * + * .google.cloud.alloydb.v1.ContinuousBackupSource continuous_backup_source = 8; + * + * @return The continuousBackupSource. + */ + @java.lang.Override + public com.google.cloud.alloydb.v1.ContinuousBackupSource getContinuousBackupSource() { + if (continuousBackupSourceBuilder_ == null) { + if (sourceCase_ == 8) { + return (com.google.cloud.alloydb.v1.ContinuousBackupSource) source_; + } + return com.google.cloud.alloydb.v1.ContinuousBackupSource.getDefaultInstance(); + } else { + if (sourceCase_ == 8) { + return continuousBackupSourceBuilder_.getMessage(); + } + return com.google.cloud.alloydb.v1.ContinuousBackupSource.getDefaultInstance(); + } + } + /** + * + * + *
+     * ContinuousBackup source. Continuous backup needs to be enabled in the
+     * source cluster for this operation to succeed.
+     * 
+ * + * .google.cloud.alloydb.v1.ContinuousBackupSource continuous_backup_source = 8; + */ + public Builder setContinuousBackupSource( + com.google.cloud.alloydb.v1.ContinuousBackupSource value) { + if (continuousBackupSourceBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + source_ = value; + onChanged(); + } else { + continuousBackupSourceBuilder_.setMessage(value); + } + sourceCase_ = 8; + return this; + } + /** + * + * + *
+     * ContinuousBackup source. Continuous backup needs to be enabled in the
+     * source cluster for this operation to succeed.
+     * 
+ * + * .google.cloud.alloydb.v1.ContinuousBackupSource continuous_backup_source = 8; + */ + public Builder setContinuousBackupSource( + com.google.cloud.alloydb.v1.ContinuousBackupSource.Builder builderForValue) { + if (continuousBackupSourceBuilder_ == null) { + source_ = builderForValue.build(); + onChanged(); + } else { + continuousBackupSourceBuilder_.setMessage(builderForValue.build()); + } + sourceCase_ = 8; + return this; + } + /** + * + * + *
+     * ContinuousBackup source. Continuous backup needs to be enabled in the
+     * source cluster for this operation to succeed.
+     * 
+ * + * .google.cloud.alloydb.v1.ContinuousBackupSource continuous_backup_source = 8; + */ + public Builder mergeContinuousBackupSource( + com.google.cloud.alloydb.v1.ContinuousBackupSource value) { + if (continuousBackupSourceBuilder_ == null) { + if (sourceCase_ == 8 + && source_ != com.google.cloud.alloydb.v1.ContinuousBackupSource.getDefaultInstance()) { + source_ = + com.google.cloud.alloydb.v1.ContinuousBackupSource.newBuilder( + (com.google.cloud.alloydb.v1.ContinuousBackupSource) source_) + .mergeFrom(value) + .buildPartial(); + } else { + source_ = value; + } + onChanged(); + } else { + if (sourceCase_ == 8) { + continuousBackupSourceBuilder_.mergeFrom(value); + } else { + continuousBackupSourceBuilder_.setMessage(value); + } + } + sourceCase_ = 8; + return this; + } + /** + * + * + *
+     * ContinuousBackup source. Continuous backup needs to be enabled in the
+     * source cluster for this operation to succeed.
+     * 
+ * + * .google.cloud.alloydb.v1.ContinuousBackupSource continuous_backup_source = 8; + */ + public Builder clearContinuousBackupSource() { + if (continuousBackupSourceBuilder_ == null) { + if (sourceCase_ == 8) { + sourceCase_ = 0; + source_ = null; + onChanged(); + } + } else { + if (sourceCase_ == 8) { + sourceCase_ = 0; + source_ = null; + } + continuousBackupSourceBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * ContinuousBackup source. Continuous backup needs to be enabled in the
+     * source cluster for this operation to succeed.
+     * 
+ * + * .google.cloud.alloydb.v1.ContinuousBackupSource continuous_backup_source = 8; + */ + public com.google.cloud.alloydb.v1.ContinuousBackupSource.Builder + getContinuousBackupSourceBuilder() { + return getContinuousBackupSourceFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * ContinuousBackup source. Continuous backup needs to be enabled in the
+     * source cluster for this operation to succeed.
+     * 
+ * + * .google.cloud.alloydb.v1.ContinuousBackupSource continuous_backup_source = 8; + */ + @java.lang.Override + public com.google.cloud.alloydb.v1.ContinuousBackupSourceOrBuilder + getContinuousBackupSourceOrBuilder() { + if ((sourceCase_ == 8) && (continuousBackupSourceBuilder_ != null)) { + return continuousBackupSourceBuilder_.getMessageOrBuilder(); + } else { + if (sourceCase_ == 8) { + return (com.google.cloud.alloydb.v1.ContinuousBackupSource) source_; + } + return com.google.cloud.alloydb.v1.ContinuousBackupSource.getDefaultInstance(); + } + } + /** + * + * + *
+     * ContinuousBackup source. Continuous backup needs to be enabled in the
+     * source cluster for this operation to succeed.
+     * 
+ * + * .google.cloud.alloydb.v1.ContinuousBackupSource continuous_backup_source = 8; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1.ContinuousBackupSource, + com.google.cloud.alloydb.v1.ContinuousBackupSource.Builder, + com.google.cloud.alloydb.v1.ContinuousBackupSourceOrBuilder> + getContinuousBackupSourceFieldBuilder() { + if (continuousBackupSourceBuilder_ == null) { + if (!(sourceCase_ == 8)) { + source_ = com.google.cloud.alloydb.v1.ContinuousBackupSource.getDefaultInstance(); + } + continuousBackupSourceBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1.ContinuousBackupSource, + com.google.cloud.alloydb.v1.ContinuousBackupSource.Builder, + com.google.cloud.alloydb.v1.ContinuousBackupSourceOrBuilder>( + (com.google.cloud.alloydb.v1.ContinuousBackupSource) source_, + getParentForChildren(), + isClean()); + source_ = null; + } + sourceCase_ = 8; + onChanged(); + return continuousBackupSourceBuilder_; + } + private java.lang.Object parent_ = ""; /** * @@ -1207,7 +1520,7 @@ public Builder setParent(java.lang.String value) { throw new NullPointerException(); } parent_ = value; - bitField0_ |= 0x00000002; + bitField0_ |= 0x00000004; onChanged(); return this; } @@ -1227,7 +1540,7 @@ public Builder setParent(java.lang.String value) { */ public Builder clearParent() { parent_ = getDefaultInstance().getParent(); - bitField0_ = (bitField0_ & ~0x00000002); + bitField0_ = (bitField0_ & ~0x00000004); onChanged(); return this; } @@ -1252,7 +1565,7 @@ public Builder setParentBytes(com.google.protobuf.ByteString value) { } checkByteStringIsUtf8(value); parent_ = value; - bitField0_ |= 0x00000002; + bitField0_ |= 0x00000004; onChanged(); return this; } @@ -1319,7 +1632,7 @@ public Builder setClusterId(java.lang.String value) { throw new NullPointerException(); } clusterId_ = value; - bitField0_ |= 0x00000004; + bitField0_ |= 0x00000008; onChanged(); return this; } @@ -1336,7 +1649,7 @@ public Builder setClusterId(java.lang.String value) { */ public Builder clearClusterId() { clusterId_ = getDefaultInstance().getClusterId(); - bitField0_ = (bitField0_ & ~0x00000004); + bitField0_ = (bitField0_ & ~0x00000008); onChanged(); return this; } @@ -1358,7 +1671,7 @@ public Builder setClusterIdBytes(com.google.protobuf.ByteString value) { } checkByteStringIsUtf8(value); clusterId_ = value; - bitField0_ |= 0x00000004; + bitField0_ |= 0x00000008; onChanged(); return this; } @@ -1382,7 +1695,7 @@ public Builder setClusterIdBytes(com.google.protobuf.ByteString value) { * @return Whether the cluster field is set. */ public boolean hasCluster() { - return ((bitField0_ & 0x00000008) != 0); + return ((bitField0_ & 0x00000010) != 0); } /** * @@ -1424,7 +1737,7 @@ public Builder setCluster(com.google.cloud.alloydb.v1.Cluster value) { } else { clusterBuilder_.setMessage(value); } - bitField0_ |= 0x00000008; + bitField0_ |= 0x00000010; onChanged(); return this; } @@ -1444,7 +1757,7 @@ public Builder setCluster(com.google.cloud.alloydb.v1.Cluster.Builder builderFor } else { clusterBuilder_.setMessage(builderForValue.build()); } - bitField0_ |= 0x00000008; + bitField0_ |= 0x00000010; onChanged(); return this; } @@ -1460,7 +1773,7 @@ public Builder setCluster(com.google.cloud.alloydb.v1.Cluster.Builder builderFor */ public Builder mergeCluster(com.google.cloud.alloydb.v1.Cluster value) { if (clusterBuilder_ == null) { - if (((bitField0_ & 0x00000008) != 0) + if (((bitField0_ & 0x00000010) != 0) && cluster_ != null && cluster_ != com.google.cloud.alloydb.v1.Cluster.getDefaultInstance()) { getClusterBuilder().mergeFrom(value); @@ -1470,7 +1783,7 @@ public Builder mergeCluster(com.google.cloud.alloydb.v1.Cluster value) { } else { clusterBuilder_.mergeFrom(value); } - bitField0_ |= 0x00000008; + bitField0_ |= 0x00000010; onChanged(); return this; } @@ -1485,7 +1798,7 @@ public Builder mergeCluster(com.google.cloud.alloydb.v1.Cluster value) { * */ public Builder clearCluster() { - bitField0_ = (bitField0_ & ~0x00000008); + bitField0_ = (bitField0_ & ~0x00000010); cluster_ = null; if (clusterBuilder_ != null) { clusterBuilder_.dispose(); @@ -1505,7 +1818,7 @@ public Builder clearCluster() { * */ public com.google.cloud.alloydb.v1.Cluster.Builder getClusterBuilder() { - bitField0_ |= 0x00000008; + bitField0_ |= 0x00000010; onChanged(); return getClusterFieldBuilder().getBuilder(); } @@ -1653,7 +1966,7 @@ public Builder setRequestId(java.lang.String value) { throw new NullPointerException(); } requestId_ = value; - bitField0_ |= 0x00000010; + bitField0_ |= 0x00000020; onChanged(); return this; } @@ -1682,7 +1995,7 @@ public Builder setRequestId(java.lang.String value) { */ public Builder clearRequestId() { requestId_ = getDefaultInstance().getRequestId(); - bitField0_ = (bitField0_ & ~0x00000010); + bitField0_ = (bitField0_ & ~0x00000020); onChanged(); return this; } @@ -1716,7 +2029,7 @@ public Builder setRequestIdBytes(com.google.protobuf.ByteString value) { } checkByteStringIsUtf8(value); requestId_ = value; - bitField0_ |= 0x00000010; + bitField0_ |= 0x00000020; onChanged(); return this; } @@ -1756,7 +2069,7 @@ public boolean getValidateOnly() { public Builder setValidateOnly(boolean value) { validateOnly_ = value; - bitField0_ |= 0x00000020; + bitField0_ |= 0x00000040; onChanged(); return this; } @@ -1774,7 +2087,7 @@ public Builder setValidateOnly(boolean value) { * @return This builder for chaining. */ public Builder clearValidateOnly() { - bitField0_ = (bitField0_ & ~0x00000020); + bitField0_ = (bitField0_ & ~0x00000040); validateOnly_ = false; onChanged(); return this; diff --git a/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/RestoreClusterRequestOrBuilder.java b/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/RestoreClusterRequestOrBuilder.java index cf53bf229637..23420a25b9d5 100644 --- a/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/RestoreClusterRequestOrBuilder.java +++ b/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/RestoreClusterRequestOrBuilder.java @@ -58,6 +58,44 @@ public interface RestoreClusterRequestOrBuilder */ com.google.cloud.alloydb.v1.BackupSourceOrBuilder getBackupSourceOrBuilder(); + /** + * + * + *
+   * ContinuousBackup source. Continuous backup needs to be enabled in the
+   * source cluster for this operation to succeed.
+   * 
+ * + * .google.cloud.alloydb.v1.ContinuousBackupSource continuous_backup_source = 8; + * + * @return Whether the continuousBackupSource field is set. + */ + boolean hasContinuousBackupSource(); + /** + * + * + *
+   * ContinuousBackup source. Continuous backup needs to be enabled in the
+   * source cluster for this operation to succeed.
+   * 
+ * + * .google.cloud.alloydb.v1.ContinuousBackupSource continuous_backup_source = 8; + * + * @return The continuousBackupSource. + */ + com.google.cloud.alloydb.v1.ContinuousBackupSource getContinuousBackupSource(); + /** + * + * + *
+   * ContinuousBackup source. Continuous backup needs to be enabled in the
+   * source cluster for this operation to succeed.
+   * 
+ * + * .google.cloud.alloydb.v1.ContinuousBackupSource continuous_backup_source = 8; + */ + com.google.cloud.alloydb.v1.ContinuousBackupSourceOrBuilder getContinuousBackupSourceOrBuilder(); + /** * * diff --git a/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/ServiceProto.java b/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/ServiceProto.java index 86b8a3eebc1c..68296bb79a29 100644 --- a/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/ServiceProto.java +++ b/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/ServiceProto.java @@ -39,6 +39,10 @@ public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry r internal_static_google_cloud_alloydb_v1_GetClusterRequest_descriptor; static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_google_cloud_alloydb_v1_GetClusterRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_alloydb_v1_CreateSecondaryClusterRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_alloydb_v1_CreateSecondaryClusterRequest_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_google_cloud_alloydb_v1_CreateClusterRequest_descriptor; static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable @@ -51,6 +55,10 @@ public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry r internal_static_google_cloud_alloydb_v1_DeleteClusterRequest_descriptor; static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_google_cloud_alloydb_v1_DeleteClusterRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_alloydb_v1_PromoteClusterRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_alloydb_v1_PromoteClusterRequest_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_google_cloud_alloydb_v1_RestoreClusterRequest_descriptor; static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable @@ -71,6 +79,10 @@ public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry r internal_static_google_cloud_alloydb_v1_CreateInstanceRequest_descriptor; static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_google_cloud_alloydb_v1_CreateInstanceRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_alloydb_v1_CreateSecondaryInstanceRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_alloydb_v1_CreateSecondaryInstanceRequest_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_google_cloud_alloydb_v1_CreateInstanceRequests_descriptor; static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable @@ -107,6 +119,10 @@ public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry r internal_static_google_cloud_alloydb_v1_FailoverInstanceRequest_descriptor; static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_google_cloud_alloydb_v1_FailoverInstanceRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_alloydb_v1_InjectFaultRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_alloydb_v1_InjectFaultRequest_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_google_cloud_alloydb_v1_RestartInstanceRequest_descriptor; static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable @@ -147,6 +163,30 @@ public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry r internal_static_google_cloud_alloydb_v1_OperationMetadata_descriptor; static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_google_cloud_alloydb_v1_OperationMetadata_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_alloydb_v1_ListUsersRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_alloydb_v1_ListUsersRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_alloydb_v1_ListUsersResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_alloydb_v1_ListUsersResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_alloydb_v1_GetUserRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_alloydb_v1_GetUserRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_alloydb_v1_CreateUserRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_alloydb_v1_CreateUserRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_alloydb_v1_UpdateUserRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_alloydb_v1_UpdateUserRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_alloydb_v1_DeleteUserRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_alloydb_v1_DeleteUserRequest_fieldAccessorTable; public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { return descriptor; @@ -172,232 +212,325 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + "B\004\342A\001\001\022\026\n\010order_by\030\005 \001(\tB\004\342A\001\001\"x\n\024ListCl" + "ustersResponse\0222\n\010clusters\030\001 \003(\0132 .googl" + "e.cloud.alloydb.v1.Cluster\022\027\n\017next_page_" - + "token\030\002 \001(\t\022\023\n\013unreachable\030\003 \003(\t\"J\n\021GetC" - + "lusterRequest\0225\n\004name\030\001 \001(\tB\'\342A\001\002\372A \n\036al" - + "loydb.googleapis.com/Cluster\"\331\001\n\024CreateC" - + "lusterRequest\0227\n\006parent\030\001 \001(\tB\'\342A\001\002\372A \022\036" - + "alloydb.googleapis.com/Cluster\022\030\n\ncluste" - + "r_id\030\002 \001(\tB\004\342A\001\002\0227\n\007cluster\030\003 \001(\0132 .goog" - + "le.cloud.alloydb.v1.ClusterB\004\342A\001\002\022\030\n\nreq" - + "uest_id\030\004 \001(\tB\004\342A\001\001\022\033\n\rvalidate_only\030\005 \001" - + "(\010B\004\342A\001\001\"\332\001\n\024UpdateClusterRequest\0225\n\013upd" - + "ate_mask\030\001 \001(\0132\032.google.protobuf.FieldMa" - + "skB\004\342A\001\001\0227\n\007cluster\030\002 \001(\0132 .google.cloud" - + ".alloydb.v1.ClusterB\004\342A\001\002\022\030\n\nrequest_id\030" - + "\003 \001(\tB\004\342A\001\001\022\033\n\rvalidate_only\030\004 \001(\010B\004\342A\001\001" - + "\022\033\n\rallow_missing\030\005 \001(\010B\004\342A\001\001\"\255\001\n\024Delete" + + "token\030\002 \001(\t\022\023\n\013unreachable\030\003 \003(\t\"\204\001\n\021Get" + "ClusterRequest\0225\n\004name\030\001 \001(\tB\'\342A\001\002\372A \n\036a" - + "lloydb.googleapis.com/Cluster\022\030\n\nrequest" - + "_id\030\002 \001(\tB\004\342A\001\001\022\022\n\004etag\030\003 \001(\tB\004\342A\001\001\022\033\n\rv" - + "alidate_only\030\004 \001(\010B\004\342A\001\001\022\023\n\005force\030\005 \001(\010B" - + "\004\342A\001\001\"\244\002\n\025RestoreClusterRequest\022>\n\rbacku" - + "p_source\030\004 \001(\0132%.google.cloud.alloydb.v1" - + ".BackupSourceH\000\0227\n\006parent\030\001 \001(\tB\'\342A\001\002\372A " - + "\022\036alloydb.googleapis.com/Cluster\022\030\n\nclus" - + "ter_id\030\002 \001(\tB\004\342A\001\002\0227\n\007cluster\030\003 \001(\0132 .go" - + "ogle.cloud.alloydb.v1.ClusterB\004\342A\001\002\022\030\n\nr" - + "equest_id\030\005 \001(\tB\004\342A\001\001\022\033\n\rvalidate_only\030\006" - + " \001(\010B\004\342A\001\001B\010\n\006source\"\253\001\n\024ListInstancesRe" - + "quest\0228\n\006parent\030\001 \001(\tB(\342A\001\002\372A!\022\037alloydb." - + "googleapis.com/Instance\022\027\n\tpage_size\030\002 \001" - + "(\005B\004\342A\001\001\022\022\n\npage_token\030\003 \001(\t\022\024\n\006filter\030\004" - + " \001(\tB\004\342A\001\001\022\026\n\010order_by\030\005 \001(\tB\004\342A\001\001\"{\n\025Li" - + "stInstancesResponse\0224\n\tinstances\030\001 \003(\0132!" - + ".google.cloud.alloydb.v1.Instance\022\027\n\017nex" - + "t_page_token\030\002 \001(\t\022\023\n\013unreachable\030\003 \003(\t\"" - + "\201\001\n\022GetInstanceRequest\0226\n\004name\030\001 \001(\tB(\342A" - + "\001\002\372A!\n\037alloydb.googleapis.com/Instance\0223" - + "\n\004view\030\002 \001(\0162%.google.cloud.alloydb.v1.I" - + "nstanceView\"\336\001\n\025CreateInstanceRequest\0228\n" - + "\006parent\030\001 \001(\tB(\342A\001\002\372A!\022\037alloydb.googleap" - + "is.com/Instance\022\031\n\013instance_id\030\002 \001(\tB\004\342A" - + "\001\002\0229\n\010instance\030\003 \001(\0132!.google.cloud.allo" - + "ydb.v1.InstanceB\004\342A\001\002\022\030\n\nrequest_id\030\004 \001(" - + "\tB\004\342A\001\001\022\033\n\rvalidate_only\030\005 \001(\010B\004\342A\001\001\"p\n\026" - + "CreateInstanceRequests\022V\n\030create_instanc" - + "e_requests\030\001 \003(\0132..google.cloud.alloydb." - + "v1.CreateInstanceRequestB\004\342A\001\002\"\272\001\n\033Batch" - + "CreateInstancesRequest\0228\n\006parent\030\001 \001(\tB(" - + "\342A\001\002\372A!\022\037alloydb.googleapis.com/Instance" - + "\022G\n\010requests\030\002 \001(\0132/.google.cloud.alloyd" - + "b.v1.CreateInstanceRequestsB\004\342A\001\002\022\030\n\nreq" - + "uest_id\030\003 \001(\tB\004\342A\001\001\"T\n\034BatchCreateInstan" - + "cesResponse\0224\n\tinstances\030\001 \003(\0132!.google." - + "cloud.alloydb.v1.Instance\"\215\002\n\034BatchCreat" - + "eInstancesMetadata\022\030\n\020instance_targets\030\001" - + " \003(\t\022f\n\021instance_statuses\030\002 \003(\0132K.google" - + ".cloud.alloydb.v1.BatchCreateInstancesMe" - + "tadata.InstanceStatusesEntry\032k\n\025Instance" - + "StatusesEntry\022\013\n\003key\030\001 \001(\t\022A\n\005value\030\002 \001(" - + "\01322.google.cloud.alloydb.v1.BatchCreateI" - + "nstanceStatus:\0028\001\"\320\002\n\031BatchCreateInstanc" - + "eStatus\022G\n\005state\030\001 \001(\01628.google.cloud.al" - + "loydb.v1.BatchCreateInstanceStatus.State" - + "\022\021\n\terror_msg\030\002 \001(\t\022!\n\005error\030\004 \001(\0132\022.goo" - + "gle.rpc.Status\022<\n\004type\030\003 \001(\0162..google.cl" - + "oud.alloydb.v1.Instance.InstanceType\"v\n\005" - + "State\022\025\n\021STATE_UNSPECIFIED\020\000\022\022\n\016PENDING_" - + "CREATE\020\001\022\t\n\005READY\020\002\022\014\n\010CREATING\020\003\022\014\n\010DEL" - + "ETING\020\004\022\n\n\006FAILED\020\005\022\017\n\013ROLLED_BACK\020\006\"\335\001\n" - + "\025UpdateInstanceRequest\0225\n\013update_mask\030\001 " - + "\001(\0132\032.google.protobuf.FieldMaskB\004\342A\001\001\0229\n" - + "\010instance\030\002 \001(\0132!.google.cloud.alloydb.v" - + "1.InstanceB\004\342A\001\002\022\030\n\nrequest_id\030\003 \001(\tB\004\342A" - + "\001\001\022\033\n\rvalidate_only\030\004 \001(\010B\004\342A\001\001\022\033\n\rallow" - + "_missing\030\005 \001(\010B\004\342A\001\001\"\232\001\n\025DeleteInstanceR" - + "equest\0226\n\004name\030\001 \001(\tB(\342A\001\002\372A!\n\037alloydb.g" - + "oogleapis.com/Instance\022\030\n\nrequest_id\030\002 \001" - + "(\tB\004\342A\001\001\022\022\n\004etag\030\003 \001(\tB\004\342A\001\001\022\033\n\rvalidate" - + "_only\030\004 \001(\010B\004\342A\001\001\"\210\001\n\027FailoverInstanceRe" - + "quest\0226\n\004name\030\001 \001(\tB(\342A\001\002\372A!\n\037alloydb.go" - + "ogleapis.com/Instance\022\030\n\nrequest_id\030\002 \001(" - + "\tB\004\342A\001\001\022\033\n\rvalidate_only\030\003 \001(\010B\004\342A\001\001\"\207\001\n" - + "\026RestartInstanceRequest\0226\n\004name\030\001 \001(\tB(\342" + + "lloydb.googleapis.com/Cluster\0228\n\004view\030\002 " + + "\001(\0162$.google.cloud.alloydb.v1.ClusterVie" + + "wB\004\342A\001\001\"\342\001\n\035CreateSecondaryClusterReques" + + "t\0227\n\006parent\030\001 \001(\tB\'\342A\001\002\372A \022\036alloydb.goog" + + "leapis.com/Cluster\022\030\n\ncluster_id\030\002 \001(\tB\004" + + "\342A\001\002\0227\n\007cluster\030\003 \001(\0132 .google.cloud.all" + + "oydb.v1.ClusterB\004\342A\001\002\022\030\n\nrequest_id\030\005 \001(" + + "\tB\004\342A\001\001\022\033\n\rvalidate_only\030\006 \001(\010B\004\342A\001\001\"\331\001\n" + + "\024CreateClusterRequest\0227\n\006parent\030\001 \001(\tB\'\342" + + "A\001\002\372A \022\036alloydb.googleapis.com/Cluster\022\030" + + "\n\ncluster_id\030\002 \001(\tB\004\342A\001\002\0227\n\007cluster\030\003 \001(" + + "\0132 .google.cloud.alloydb.v1.ClusterB\004\342A\001" + + "\002\022\030\n\nrequest_id\030\004 \001(\tB\004\342A\001\001\022\033\n\rvalidate_" + + "only\030\005 \001(\010B\004\342A\001\001\"\332\001\n\024UpdateClusterReques" + + "t\0225\n\013update_mask\030\001 \001(\0132\032.google.protobuf" + + ".FieldMaskB\004\342A\001\001\0227\n\007cluster\030\002 \001(\0132 .goog" + + "le.cloud.alloydb.v1.ClusterB\004\342A\001\002\022\030\n\nreq" + + "uest_id\030\003 \001(\tB\004\342A\001\001\022\033\n\rvalidate_only\030\004 \001" + + "(\010B\004\342A\001\001\022\033\n\rallow_missing\030\005 \001(\010B\004\342A\001\001\"\255\001" + + "\n\024DeleteClusterRequest\0225\n\004name\030\001 \001(\tB\'\342A" + + "\001\002\372A \n\036alloydb.googleapis.com/Cluster\022\030\n" + + "\nrequest_id\030\002 \001(\tB\004\342A\001\001\022\022\n\004etag\030\003 \001(\tB\004\342" + + "A\001\001\022\033\n\rvalidate_only\030\004 \001(\010B\004\342A\001\001\022\023\n\005forc" + + "e\030\005 \001(\010B\004\342A\001\001\"\231\001\n\025PromoteClusterRequest\022" + + "5\n\004name\030\001 \001(\tB\'\342A\001\002\372A \n\036alloydb.googleap" + + "is.com/Cluster\022\030\n\nrequest_id\030\002 \001(\tB\004\342A\001\001" + + "\022\022\n\004etag\030\003 \001(\tB\004\342A\001\001\022\033\n\rvalidate_only\030\004 " + + "\001(\010B\004\342A\001\001\"\371\002\n\025RestoreClusterRequest\022>\n\rb" + + "ackup_source\030\004 \001(\0132%.google.cloud.alloyd" + + "b.v1.BackupSourceH\000\022S\n\030continuous_backup" + + "_source\030\010 \001(\0132/.google.cloud.alloydb.v1." + + "ContinuousBackupSourceH\000\0227\n\006parent\030\001 \001(\t" + + "B\'\342A\001\002\372A \022\036alloydb.googleapis.com/Cluste" + + "r\022\030\n\ncluster_id\030\002 \001(\tB\004\342A\001\002\0227\n\007cluster\030\003" + + " \001(\0132 .google.cloud.alloydb.v1.ClusterB\004" + + "\342A\001\002\022\030\n\nrequest_id\030\005 \001(\tB\004\342A\001\001\022\033\n\rvalida" + + "te_only\030\006 \001(\010B\004\342A\001\001B\010\n\006source\"\253\001\n\024ListIn" + + "stancesRequest\0228\n\006parent\030\001 \001(\tB(\342A\001\002\372A!\022" + + "\037alloydb.googleapis.com/Instance\022\027\n\tpage" + + "_size\030\002 \001(\005B\004\342A\001\001\022\022\n\npage_token\030\003 \001(\t\022\024\n" + + "\006filter\030\004 \001(\tB\004\342A\001\001\022\026\n\010order_by\030\005 \001(\tB\004\342" + + "A\001\001\"{\n\025ListInstancesResponse\0224\n\tinstance" + + "s\030\001 \003(\0132!.google.cloud.alloydb.v1.Instan" + + "ce\022\027\n\017next_page_token\030\002 \001(\t\022\023\n\013unreachab" + + "le\030\003 \003(\t\"\201\001\n\022GetInstanceRequest\0226\n\004name\030" + + "\001 \001(\tB(\342A\001\002\372A!\n\037alloydb.googleapis.com/I" + + "nstance\0223\n\004view\030\002 \001(\0162%.google.cloud.all" + + "oydb.v1.InstanceView\"\336\001\n\025CreateInstanceR" + + "equest\0228\n\006parent\030\001 \001(\tB(\342A\001\002\372A!\022\037alloydb" + + ".googleapis.com/Instance\022\031\n\013instance_id\030" + + "\002 \001(\tB\004\342A\001\002\0229\n\010instance\030\003 \001(\0132!.google.c" + + "loud.alloydb.v1.InstanceB\004\342A\001\002\022\030\n\nreques" + + "t_id\030\004 \001(\tB\004\342A\001\001\022\033\n\rvalidate_only\030\005 \001(\010B" + + "\004\342A\001\001\"\347\001\n\036CreateSecondaryInstanceRequest" + + "\0228\n\006parent\030\001 \001(\tB(\342A\001\002\372A!\022\037alloydb.googl" + + "eapis.com/Instance\022\031\n\013instance_id\030\002 \001(\tB" + + "\004\342A\001\002\0229\n\010instance\030\003 \001(\0132!.google.cloud.a" + + "lloydb.v1.InstanceB\004\342A\001\002\022\030\n\nrequest_id\030\004" + + " \001(\tB\004\342A\001\001\022\033\n\rvalidate_only\030\005 \001(\010B\004\342A\001\001\"" + + "p\n\026CreateInstanceRequests\022V\n\030create_inst" + + "ance_requests\030\001 \003(\0132..google.cloud.alloy" + + "db.v1.CreateInstanceRequestB\004\342A\001\002\"\272\001\n\033Ba" + + "tchCreateInstancesRequest\0228\n\006parent\030\001 \001(" + + "\tB(\342A\001\002\372A!\022\037alloydb.googleapis.com/Insta" + + "nce\022G\n\010requests\030\002 \001(\0132/.google.cloud.all" + + "oydb.v1.CreateInstanceRequestsB\004\342A\001\002\022\030\n\n" + + "request_id\030\003 \001(\tB\004\342A\001\001\"T\n\034BatchCreateIns" + + "tancesResponse\0224\n\tinstances\030\001 \003(\0132!.goog" + + "le.cloud.alloydb.v1.Instance\"\215\002\n\034BatchCr" + + "eateInstancesMetadata\022\030\n\020instance_target" + + "s\030\001 \003(\t\022f\n\021instance_statuses\030\002 \003(\0132K.goo" + + "gle.cloud.alloydb.v1.BatchCreateInstance" + + "sMetadata.InstanceStatusesEntry\032k\n\025Insta" + + "nceStatusesEntry\022\013\n\003key\030\001 \001(\t\022A\n\005value\030\002" + + " \001(\01322.google.cloud.alloydb.v1.BatchCrea" + + "teInstanceStatus:\0028\001\"\320\002\n\031BatchCreateInst" + + "anceStatus\022G\n\005state\030\001 \001(\01628.google.cloud" + + ".alloydb.v1.BatchCreateInstanceStatus.St" + + "ate\022\021\n\terror_msg\030\002 \001(\t\022!\n\005error\030\004 \001(\0132\022." + + "google.rpc.Status\022<\n\004type\030\003 \001(\0162..google" + + ".cloud.alloydb.v1.Instance.InstanceType\"" + + "v\n\005State\022\025\n\021STATE_UNSPECIFIED\020\000\022\022\n\016PENDI" + + "NG_CREATE\020\001\022\t\n\005READY\020\002\022\014\n\010CREATING\020\003\022\014\n\010" + + "DELETING\020\004\022\n\n\006FAILED\020\005\022\017\n\013ROLLED_BACK\020\006\"" + + "\335\001\n\025UpdateInstanceRequest\0225\n\013update_mask" + + "\030\001 \001(\0132\032.google.protobuf.FieldMaskB\004\342A\001\001" + + "\0229\n\010instance\030\002 \001(\0132!.google.cloud.alloyd" + + "b.v1.InstanceB\004\342A\001\002\022\030\n\nrequest_id\030\003 \001(\tB" + + "\004\342A\001\001\022\033\n\rvalidate_only\030\004 \001(\010B\004\342A\001\001\022\033\n\ral" + + "low_missing\030\005 \001(\010B\004\342A\001\001\"\232\001\n\025DeleteInstan" + + "ceRequest\0226\n\004name\030\001 \001(\tB(\342A\001\002\372A!\n\037alloyd" + + "b.googleapis.com/Instance\022\030\n\nrequest_id\030" + + "\002 \001(\tB\004\342A\001\001\022\022\n\004etag\030\003 \001(\tB\004\342A\001\001\022\033\n\rvalid" + + "ate_only\030\004 \001(\010B\004\342A\001\001\"\210\001\n\027FailoverInstanc" + + "eRequest\0226\n\004name\030\001 \001(\tB(\342A\001\002\372A!\n\037alloydb" + + ".googleapis.com/Instance\022\030\n\nrequest_id\030\002" + + " \001(\tB\004\342A\001\001\022\033\n\rvalidate_only\030\003 \001(\010B\004\342A\001\001\"" + + "\212\002\n\022InjectFaultRequest\022O\n\nfault_type\030\001 \001" + + "(\01625.google.cloud.alloydb.v1.InjectFault" + + "Request.FaultTypeB\004\342A\001\002\0226\n\004name\030\002 \001(\tB(\342" + "A\001\002\372A!\n\037alloydb.googleapis.com/Instance\022" - + "\030\n\nrequest_id\030\002 \001(\tB\004\342A\001\001\022\033\n\rvalidate_on" - + "ly\030\003 \001(\010B\004\342A\001\001\"\225\001\n\022ListBackupsRequest\0226\n" - + "\006parent\030\001 \001(\tB&\342A\001\002\372A\037\022\035alloydb.googleap" - + "is.com/Backup\022\021\n\tpage_size\030\002 \001(\005\022\022\n\npage" - + "_token\030\003 \001(\t\022\016\n\006filter\030\004 \001(\t\022\020\n\010order_by" - + "\030\005 \001(\t\"u\n\023ListBackupsResponse\0220\n\007backups" - + "\030\001 \003(\0132\037.google.cloud.alloydb.v1.Backup\022" - + "\027\n\017next_page_token\030\002 \001(\t\022\023\n\013unreachable\030" - + "\003 \003(\t\"H\n\020GetBackupRequest\0224\n\004name\030\001 \001(\tB" - + "&\342A\001\002\372A\037\n\035alloydb.googleapis.com/Backup\"" - + "\324\001\n\023CreateBackupRequest\0226\n\006parent\030\001 \001(\tB" - + "&\342A\001\002\372A\037\022\035alloydb.googleapis.com/Backup\022" - + "\027\n\tbackup_id\030\002 \001(\tB\004\342A\001\002\0225\n\006backup\030\003 \001(\013" - + "2\037.google.cloud.alloydb.v1.BackupB\004\342A\001\002\022" - + "\030\n\nrequest_id\030\004 \001(\tB\004\342A\001\001\022\033\n\rvalidate_on" - + "ly\030\005 \001(\010B\004\342A\001\001\"\327\001\n\023UpdateBackupRequest\0225" - + "\n\013update_mask\030\001 \001(\0132\032.google.protobuf.Fi" - + "eldMaskB\004\342A\001\001\0225\n\006backup\030\002 \001(\0132\037.google.c" - + "loud.alloydb.v1.BackupB\004\342A\001\002\022\030\n\nrequest_" - + "id\030\003 \001(\tB\004\342A\001\001\022\033\n\rvalidate_only\030\004 \001(\010B\004\342" - + "A\001\001\022\033\n\rallow_missing\030\005 \001(\010B\004\342A\001\001\"\226\001\n\023Del" - + "eteBackupRequest\0224\n\004name\030\001 \001(\tB&\342A\001\002\372A\037\n" - + "\035alloydb.googleapis.com/Backup\022\030\n\nreques" - + "t_id\030\002 \001(\tB\004\342A\001\001\022\033\n\rvalidate_only\030\003 \001(\010B" - + "\004\342A\001\001\022\022\n\004etag\030\004 \001(\tB\004\342A\001\001\"\221\001\n!ListSuppor" - + "tedDatabaseFlagsRequest\022E\n\006parent\030\001 \001(\tB" - + "5\342A\001\002\372A.\022,alloydb.googleapis.com/Support" - + "edDatabaseFlag\022\021\n\tpage_size\030\002 \001(\005\022\022\n\npag" - + "e_token\030\003 \001(\t\"\217\001\n\"ListSupportedDatabaseF" - + "lagsResponse\022P\n\030supported_database_flags" - + "\030\001 \003(\0132..google.cloud.alloydb.v1.Support" - + "edDatabaseFlag\022\027\n\017next_page_token\030\002 \001(\t\"" - + "\203\003\n\021OperationMetadata\022f\n\037batch_create_in" - + "stances_metadata\030\010 \001(\01325.google.cloud.al" - + "loydb.v1.BatchCreateInstancesMetadataB\004\342" - + "A\001\003H\000\0225\n\013create_time\030\001 \001(\0132\032.google.prot" - + "obuf.TimestampB\004\342A\001\003\0222\n\010end_time\030\002 \001(\0132\032" - + ".google.protobuf.TimestampB\004\342A\001\003\022\024\n\006targ" - + "et\030\003 \001(\tB\004\342A\001\003\022\022\n\004verb\030\004 \001(\tB\004\342A\001\003\022\034\n\016st" - + "atus_message\030\005 \001(\tB\004\342A\001\003\022$\n\026requested_ca" - + "ncellation\030\006 \001(\010B\004\342A\001\003\022\031\n\013api_version\030\007 " - + "\001(\tB\004\342A\001\003B\022\n\020request_specific2\275 \n\014AlloyD" - + "BAdmin\022\252\001\n\014ListClusters\022,.google.cloud.a" - + "lloydb.v1.ListClustersRequest\032-.google.c" - + "loud.alloydb.v1.ListClustersResponse\"=\332A" - + "\006parent\202\323\344\223\002.\022,/v1/{parent=projects/*/lo" - + "cations/*}/clusters\022\227\001\n\nGetCluster\022*.goo" - + "gle.cloud.alloydb.v1.GetClusterRequest\032 " - + ".google.cloud.alloydb.v1.Cluster\";\332A\004nam" - + "e\202\323\344\223\002.\022,/v1/{name=projects/*/locations/" - + "*/clusters/*}\022\327\001\n\rCreateCluster\022-.google" - + ".cloud.alloydb.v1.CreateClusterRequest\032\035" - + ".google.longrunning.Operation\"x\312A\034\n\007Clus" - + "ter\022\021OperationMetadata\332A\031parent,cluster," - + "cluster_id\202\323\344\223\0027\",/v1/{parent=projects/*" - + "/locations/*}/clusters:\007cluster\022\331\001\n\rUpda" - + "teCluster\022-.google.cloud.alloydb.v1.Upda" - + "teClusterRequest\032\035.google.longrunning.Op" - + "eration\"z\312A\034\n\007Cluster\022\021OperationMetadata" - + "\332A\023cluster,update_mask\202\323\344\223\002?24/v1/{clust" - + "er.name=projects/*/locations/*/clusters/" - + "*}:\007cluster\022\307\001\n\rDeleteCluster\022-.google.c" - + "loud.alloydb.v1.DeleteClusterRequest\032\035.g" - + "oogle.longrunning.Operation\"h\312A*\n\025google" - + ".protobuf.Empty\022\021OperationMetadata\332A\004nam" - + "e\202\323\344\223\002.*,/v1/{name=projects/*/locations/" - + "*/clusters/*}\022\277\001\n\016RestoreCluster\022..googl" - + "e.cloud.alloydb.v1.RestoreClusterRequest" - + "\032\035.google.longrunning.Operation\"^\312A\034\n\007Cl" - + "uster\022\021OperationMetadata\202\323\344\223\0029\"4/v1/{par" - + "ent=projects/*/locations/*}/clusters:res" - + "tore:\001*\022\271\001\n\rListInstances\022-.google.cloud" - + ".alloydb.v1.ListInstancesRequest\032..googl" - + "e.cloud.alloydb.v1.ListInstancesResponse" - + "\"I\332A\006parent\202\323\344\223\002:\0228/v1/{parent=projects/" - + "*/locations/*/clusters/*}/instances\022\246\001\n\013" - + "GetInstance\022+.google.cloud.alloydb.v1.Ge" - + "tInstanceRequest\032!.google.cloud.alloydb." - + "v1.Instance\"G\332A\004name\202\323\344\223\002:\0228/v1/{name=pr" + + "\030\n\nrequest_id\030\003 \001(\tB\004\342A\001\001\022\033\n\rvalidate_on" + + "ly\030\004 \001(\010B\004\342A\001\001\"4\n\tFaultType\022\032\n\026FAULT_TYP" + + "E_UNSPECIFIED\020\000\022\013\n\007STOP_VM\020\001\"\207\001\n\026Restart" + + "InstanceRequest\0226\n\004name\030\001 \001(\tB(\342A\001\002\372A!\n\037" + + "alloydb.googleapis.com/Instance\022\030\n\nreque" + + "st_id\030\002 \001(\tB\004\342A\001\001\022\033\n\rvalidate_only\030\003 \001(\010" + + "B\004\342A\001\001\"\225\001\n\022ListBackupsRequest\0226\n\006parent\030" + + "\001 \001(\tB&\342A\001\002\372A\037\022\035alloydb.googleapis.com/B" + + "ackup\022\021\n\tpage_size\030\002 \001(\005\022\022\n\npage_token\030\003" + + " \001(\t\022\016\n\006filter\030\004 \001(\t\022\020\n\010order_by\030\005 \001(\t\"u" + + "\n\023ListBackupsResponse\0220\n\007backups\030\001 \003(\0132\037" + + ".google.cloud.alloydb.v1.Backup\022\027\n\017next_" + + "page_token\030\002 \001(\t\022\023\n\013unreachable\030\003 \003(\t\"H\n" + + "\020GetBackupRequest\0224\n\004name\030\001 \001(\tB&\342A\001\002\372A\037" + + "\n\035alloydb.googleapis.com/Backup\"\324\001\n\023Crea" + + "teBackupRequest\0226\n\006parent\030\001 \001(\tB&\342A\001\002\372A\037" + + "\022\035alloydb.googleapis.com/Backup\022\027\n\tbacku" + + "p_id\030\002 \001(\tB\004\342A\001\002\0225\n\006backup\030\003 \001(\0132\037.googl" + + "e.cloud.alloydb.v1.BackupB\004\342A\001\002\022\030\n\nreque" + + "st_id\030\004 \001(\tB\004\342A\001\001\022\033\n\rvalidate_only\030\005 \001(\010" + + "B\004\342A\001\001\"\327\001\n\023UpdateBackupRequest\0225\n\013update" + + "_mask\030\001 \001(\0132\032.google.protobuf.FieldMaskB" + + "\004\342A\001\001\0225\n\006backup\030\002 \001(\0132\037.google.cloud.all" + + "oydb.v1.BackupB\004\342A\001\002\022\030\n\nrequest_id\030\003 \001(\t" + + "B\004\342A\001\001\022\033\n\rvalidate_only\030\004 \001(\010B\004\342A\001\001\022\033\n\ra" + + "llow_missing\030\005 \001(\010B\004\342A\001\001\"\226\001\n\023DeleteBacku" + + "pRequest\0224\n\004name\030\001 \001(\tB&\342A\001\002\372A\037\n\035alloydb" + + ".googleapis.com/Backup\022\030\n\nrequest_id\030\002 \001" + + "(\tB\004\342A\001\001\022\033\n\rvalidate_only\030\003 \001(\010B\004\342A\001\001\022\022\n" + + "\004etag\030\004 \001(\tB\004\342A\001\001\"\221\001\n!ListSupportedDatab" + + "aseFlagsRequest\022E\n\006parent\030\001 \001(\tB5\342A\001\002\372A." + + "\022,alloydb.googleapis.com/SupportedDataba" + + "seFlag\022\021\n\tpage_size\030\002 \001(\005\022\022\n\npage_token\030" + + "\003 \001(\t\"\217\001\n\"ListSupportedDatabaseFlagsResp" + + "onse\022P\n\030supported_database_flags\030\001 \003(\0132." + + ".google.cloud.alloydb.v1.SupportedDataba" + + "seFlag\022\027\n\017next_page_token\030\002 \001(\t\"\203\003\n\021Oper" + + "ationMetadata\022f\n\037batch_create_instances_" + + "metadata\030\010 \001(\01325.google.cloud.alloydb.v1" + + ".BatchCreateInstancesMetadataB\004\342A\001\003H\000\0225\n" + + "\013create_time\030\001 \001(\0132\032.google.protobuf.Tim" + + "estampB\004\342A\001\003\0222\n\010end_time\030\002 \001(\0132\032.google." + + "protobuf.TimestampB\004\342A\001\003\022\024\n\006target\030\003 \001(\t" + + "B\004\342A\001\003\022\022\n\004verb\030\004 \001(\tB\004\342A\001\003\022\034\n\016status_mes" + + "sage\030\005 \001(\tB\004\342A\001\003\022$\n\026requested_cancellati" + + "on\030\006 \001(\010B\004\342A\001\003\022\031\n\013api_version\030\007 \001(\tB\004\342A\001" + + "\003B\022\n\020request_specific\"\251\001\n\020ListUsersReque" + + "st\0224\n\006parent\030\001 \001(\tB$\342A\001\002\372A\035\022\033alloydb.goo" + + "gleapis.com/User\022\027\n\tpage_size\030\002 \001(\005B\004\342A\001" + + "\001\022\030\n\npage_token\030\003 \001(\tB\004\342A\001\001\022\024\n\006filter\030\004 " + + "\001(\tB\004\342A\001\001\022\026\n\010order_by\030\005 \001(\tB\004\342A\001\001\"o\n\021Lis" + + "tUsersResponse\022,\n\005users\030\001 \003(\0132\035.google.c" + + "loud.alloydb.v1.User\022\027\n\017next_page_token\030" + + "\002 \001(\t\022\023\n\013unreachable\030\003 \003(\t\"D\n\016GetUserReq" + + "uest\0222\n\004name\030\001 \001(\tB$\342A\001\002\372A\035\n\033alloydb.goo" + + "gleapis.com/User\"\312\001\n\021CreateUserRequest\0224" + + "\n\006parent\030\001 \001(\tB$\342A\001\002\372A\035\022\033alloydb.googlea" + + "pis.com/User\022\025\n\007user_id\030\002 \001(\tB\004\342A\001\002\0221\n\004u" + + "ser\030\003 \001(\0132\035.google.cloud.alloydb.v1.User" + + "B\004\342A\001\002\022\030\n\nrequest_id\030\004 \001(\tB\004\342A\001\001\022\033\n\rvali" + + "date_only\030\005 \001(\010B\004\342A\001\001\"\321\001\n\021UpdateUserRequ" + + "est\0225\n\013update_mask\030\001 \001(\0132\032.google.protob" + + "uf.FieldMaskB\004\342A\001\001\0221\n\004user\030\002 \001(\0132\035.googl" + + "e.cloud.alloydb.v1.UserB\004\342A\001\002\022\030\n\nrequest" + + "_id\030\003 \001(\tB\004\342A\001\001\022\033\n\rvalidate_only\030\004 \001(\010B\004" + + "\342A\001\001\022\033\n\rallow_missing\030\005 \001(\010B\004\342A\001\001\"~\n\021Del" + + "eteUserRequest\0222\n\004name\030\001 \001(\tB$\342A\001\002\372A\035\n\033a" + + "lloydb.googleapis.com/User\022\030\n\nrequest_id" + + "\030\002 \001(\tB\004\342A\001\001\022\033\n\rvalidate_only\030\003 \001(\010B\004\342A\001" + + "\0012\271.\n\014AlloyDBAdmin\022\252\001\n\014ListClusters\022,.go" + + "ogle.cloud.alloydb.v1.ListClustersReques" + + "t\032-.google.cloud.alloydb.v1.ListClusters" + + "Response\"=\332A\006parent\202\323\344\223\002.\022,/v1/{parent=p" + + "rojects/*/locations/*}/clusters\022\227\001\n\nGetC" + + "luster\022*.google.cloud.alloydb.v1.GetClus" + + "terRequest\032 .google.cloud.alloydb.v1.Clu" + + "ster\";\332A\004name\202\323\344\223\002.\022,/v1/{name=projects/" + + "*/locations/*/clusters/*}\022\327\001\n\rCreateClus" + + "ter\022-.google.cloud.alloydb.v1.CreateClus" + + "terRequest\032\035.google.longrunning.Operatio" + + "n\"x\312A\034\n\007Cluster\022\021OperationMetadata\332A\031par" + + "ent,cluster,cluster_id\202\323\344\223\0027\",/v1/{paren" + + "t=projects/*/locations/*}/clusters:\007clus" + + "ter\022\331\001\n\rUpdateCluster\022-.google.cloud.all" + + "oydb.v1.UpdateClusterRequest\032\035.google.lo" + + "ngrunning.Operation\"z\312A\034\n\007Cluster\022\021Opera" + + "tionMetadata\332A\023cluster,update_mask\202\323\344\223\002?" + + "24/v1/{cluster.name=projects/*/locations" + + "/*/clusters/*}:\007cluster\022\307\001\n\rDeleteCluste" + + "r\022-.google.cloud.alloydb.v1.DeleteCluste" + + "rRequest\032\035.google.longrunning.Operation\"" + + "h\312A*\n\025google.protobuf.Empty\022\021OperationMe" + + "tadata\332A\004name\202\323\344\223\002.*,/v1/{name=projects/" + + "*/locations/*/clusters/*}\022\306\001\n\016PromoteClu" + + "ster\022..google.cloud.alloydb.v1.PromoteCl" + + "usterRequest\032\035.google.longrunning.Operat" + + "ion\"e\312A\034\n\007Cluster\022\021OperationMetadata\332A\004n" + + "ame\202\323\344\223\0029\"4/v1/{name=projects/*/location" + + "s/*/clusters/*}:promote:\001*\022\277\001\n\016RestoreCl" + + "uster\022..google.cloud.alloydb.v1.RestoreC" + + "lusterRequest\032\035.google.longrunning.Opera" + + "tion\"^\312A\034\n\007Cluster\022\021OperationMetadata\202\323\344" + + "\223\0029\"4/v1/{parent=projects/*/locations/*}" + + "/clusters:restore:\001*\022\372\001\n\026CreateSecondary" + + "Cluster\0226.google.cloud.alloydb.v1.Create" + + "SecondaryClusterRequest\032\035.google.longrun" + + "ning.Operation\"\210\001\312A\034\n\007Cluster\022\021Operation" + + "Metadata\332A\031parent,cluster,cluster_id\202\323\344\223" + + "\002G\" - * SSL configuration for an AlloyDB Cluster. + * SSL configuration. * * * Protobuf type {@code google.cloud.alloydb.v1.SslConfig} @@ -77,7 +77,7 @@ public enum SslMode implements com.google.protobuf.ProtocolMessageEnum { * * *
-     * SSL mode not specified. Defaults to SSL_MODE_ALLOW.
+     * SSL mode not specified. Defaults to ENCRYPTED_ONLY.
      * 
* * SSL_MODE_UNSPECIFIED = 0; @@ -90,8 +90,9 @@ public enum SslMode implements com.google.protobuf.ProtocolMessageEnum { * SSL connections are optional. CA verification not enforced. * * - * SSL_MODE_ALLOW = 1; + * SSL_MODE_ALLOW = 1 [deprecated = true]; */ + @java.lang.Deprecated SSL_MODE_ALLOW(1), /** * @@ -102,8 +103,9 @@ public enum SslMode implements com.google.protobuf.ProtocolMessageEnum { * behavior). * * - * SSL_MODE_REQUIRE = 2; + * SSL_MODE_REQUIRE = 2 [deprecated = true]; */ + @java.lang.Deprecated SSL_MODE_REQUIRE(2), /** * @@ -114,9 +116,30 @@ public enum SslMode implements com.google.protobuf.ProtocolMessageEnum { * GenerateClientCertificate. * * - * SSL_MODE_VERIFY_CA = 3; + * SSL_MODE_VERIFY_CA = 3 [deprecated = true]; */ + @java.lang.Deprecated SSL_MODE_VERIFY_CA(3), + /** + * + * + *
+     * SSL connections are optional. CA verification not enforced.
+     * 
+ * + * ALLOW_UNENCRYPTED_AND_ENCRYPTED = 4; + */ + ALLOW_UNENCRYPTED_AND_ENCRYPTED(4), + /** + * + * + *
+     * SSL connections are required. CA verification not enforced.
+     * 
+ * + * ENCRYPTED_ONLY = 5; + */ + ENCRYPTED_ONLY(5), UNRECOGNIZED(-1), ; @@ -124,7 +147,7 @@ public enum SslMode implements com.google.protobuf.ProtocolMessageEnum { * * *
-     * SSL mode not specified. Defaults to SSL_MODE_ALLOW.
+     * SSL mode not specified. Defaults to ENCRYPTED_ONLY.
      * 
* * SSL_MODE_UNSPECIFIED = 0; @@ -137,9 +160,9 @@ public enum SslMode implements com.google.protobuf.ProtocolMessageEnum { * SSL connections are optional. CA verification not enforced. * * - * SSL_MODE_ALLOW = 1; + * SSL_MODE_ALLOW = 1 [deprecated = true]; */ - public static final int SSL_MODE_ALLOW_VALUE = 1; + @java.lang.Deprecated public static final int SSL_MODE_ALLOW_VALUE = 1; /** * * @@ -149,9 +172,9 @@ public enum SslMode implements com.google.protobuf.ProtocolMessageEnum { * behavior). * * - * SSL_MODE_REQUIRE = 2; + * SSL_MODE_REQUIRE = 2 [deprecated = true]; */ - public static final int SSL_MODE_REQUIRE_VALUE = 2; + @java.lang.Deprecated public static final int SSL_MODE_REQUIRE_VALUE = 2; /** * * @@ -161,9 +184,29 @@ public enum SslMode implements com.google.protobuf.ProtocolMessageEnum { * GenerateClientCertificate. * * - * SSL_MODE_VERIFY_CA = 3; + * SSL_MODE_VERIFY_CA = 3 [deprecated = true]; + */ + @java.lang.Deprecated public static final int SSL_MODE_VERIFY_CA_VALUE = 3; + /** + * + * + *
+     * SSL connections are optional. CA verification not enforced.
+     * 
+ * + * ALLOW_UNENCRYPTED_AND_ENCRYPTED = 4; + */ + public static final int ALLOW_UNENCRYPTED_AND_ENCRYPTED_VALUE = 4; + /** + * + * + *
+     * SSL connections are required. CA verification not enforced.
+     * 
+ * + * ENCRYPTED_ONLY = 5; */ - public static final int SSL_MODE_VERIFY_CA_VALUE = 3; + public static final int ENCRYPTED_ONLY_VALUE = 5; public final int getNumber() { if (this == UNRECOGNIZED) { @@ -197,6 +240,10 @@ public static SslMode forNumber(int value) { return SSL_MODE_REQUIRE; case 3: return SSL_MODE_VERIFY_CA; + case 4: + return ALLOW_UNENCRYPTED_AND_ENCRYPTED; + case 5: + return ENCRYPTED_ONLY; default: return null; } @@ -641,7 +688,7 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build * * *
-   * SSL configuration for an AlloyDB Cluster.
+   * SSL configuration.
    * 
* * Protobuf type {@code google.cloud.alloydb.v1.SslConfig} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/UpdateUserRequest.java b/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/UpdateUserRequest.java new file mode 100644 index 000000000000..c8ea1f316f3a --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/UpdateUserRequest.java @@ -0,0 +1,1482 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/alloydb/v1/service.proto + +package com.google.cloud.alloydb.v1; + +/** + * + * + *
+ * Message for updating a User
+ * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1.UpdateUserRequest} + */ +public final class UpdateUserRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.alloydb.v1.UpdateUserRequest) + UpdateUserRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use UpdateUserRequest.newBuilder() to construct. + private UpdateUserRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private UpdateUserRequest() { + requestId_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new UpdateUserRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.alloydb.v1.ServiceProto + .internal_static_google_cloud_alloydb_v1_UpdateUserRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1.ServiceProto + .internal_static_google_cloud_alloydb_v1_UpdateUserRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1.UpdateUserRequest.class, + com.google.cloud.alloydb.v1.UpdateUserRequest.Builder.class); + } + + public static final int UPDATE_MASK_FIELD_NUMBER = 1; + private com.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.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the updateMask field is set. + */ + @java.lang.Override + public boolean hasUpdateMask() { + return updateMask_ != null; + } + /** + * + * + *
+   * 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.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The updateMask. + */ + @java.lang.Override + public com.google.protobuf.FieldMask getUpdateMask() { + return updateMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : 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.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { + return updateMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : updateMask_; + } + + public static final int USER_FIELD_NUMBER = 2; + private com.google.cloud.alloydb.v1.User user_; + /** + * + * + *
+   * Required. The resource being updated
+   * 
+ * + * .google.cloud.alloydb.v1.User user = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return Whether the user field is set. + */ + @java.lang.Override + public boolean hasUser() { + return user_ != null; + } + /** + * + * + *
+   * Required. The resource being updated
+   * 
+ * + * .google.cloud.alloydb.v1.User user = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The user. + */ + @java.lang.Override + public com.google.cloud.alloydb.v1.User getUser() { + return user_ == null ? com.google.cloud.alloydb.v1.User.getDefaultInstance() : user_; + } + /** + * + * + *
+   * Required. The resource being updated
+   * 
+ * + * .google.cloud.alloydb.v1.User user = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + @java.lang.Override + public com.google.cloud.alloydb.v1.UserOrBuilder getUserOrBuilder() { + return user_ == null ? com.google.cloud.alloydb.v1.User.getDefaultInstance() : user_; + } + + public static final int REQUEST_ID_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object 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).
+   * 
+ * + * string request_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The requestId. + */ + @java.lang.Override + public java.lang.String getRequestId() { + java.lang.Object ref = requestId_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + requestId_ = s; + return s; + } + } + /** + * + * + *
+   * Optional. An optional request ID to identify requests. Specify a unique
+   * request ID so that if you must retry your request, the server will know to
+   * ignore the request if it has already been completed. The server will
+   * guarantee that for at least 60 minutes since the first request.
+   *
+   * For example, consider a situation where you make an initial request and
+   * the request times out. If you make the request again with the same request
+   * ID, the server can check if original operation with the same request ID
+   * was received, and if so, will ignore the second request. This prevents
+   * clients from accidentally creating duplicate commitments.
+   *
+   * The request ID must be a valid UUID with the exception that zero UUID is
+   * not supported (00000000-0000-0000-0000-000000000000).
+   * 
+ * + * string request_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for requestId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getRequestIdBytes() { + java.lang.Object ref = requestId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + requestId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int VALIDATE_ONLY_FIELD_NUMBER = 4; + private boolean validateOnly_ = false; + /** + * + * + *
+   * Optional. If set, the backend validates the request, but doesn't actually
+   * execute it.
+   * 
+ * + * bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The validateOnly. + */ + @java.lang.Override + public boolean getValidateOnly() { + return validateOnly_; + } + + public static final int ALLOW_MISSING_FIELD_NUMBER = 5; + private boolean allowMissing_ = false; + /** + * + * + *
+   * Optional. Allow missing fields in the update mask.
+   * 
+ * + * bool allow_missing = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The allowMissing. + */ + @java.lang.Override + public boolean getAllowMissing() { + return allowMissing_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (updateMask_ != null) { + output.writeMessage(1, getUpdateMask()); + } + if (user_ != null) { + output.writeMessage(2, getUser()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(requestId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, requestId_); + } + if (validateOnly_ != false) { + output.writeBool(4, validateOnly_); + } + if (allowMissing_ != false) { + output.writeBool(5, allowMissing_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (updateMask_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getUpdateMask()); + } + if (user_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getUser()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(requestId_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, requestId_); + } + if (validateOnly_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(4, validateOnly_); + } + if (allowMissing_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(5, allowMissing_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.alloydb.v1.UpdateUserRequest)) { + return super.equals(obj); + } + com.google.cloud.alloydb.v1.UpdateUserRequest other = + (com.google.cloud.alloydb.v1.UpdateUserRequest) obj; + + if (hasUpdateMask() != other.hasUpdateMask()) return false; + if (hasUpdateMask()) { + if (!getUpdateMask().equals(other.getUpdateMask())) return false; + } + if (hasUser() != other.hasUser()) return false; + if (hasUser()) { + if (!getUser().equals(other.getUser())) return false; + } + if (!getRequestId().equals(other.getRequestId())) return false; + if (getValidateOnly() != other.getValidateOnly()) return false; + if (getAllowMissing() != other.getAllowMissing()) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasUpdateMask()) { + hash = (37 * hash) + UPDATE_MASK_FIELD_NUMBER; + hash = (53 * hash) + getUpdateMask().hashCode(); + } + if (hasUser()) { + hash = (37 * hash) + USER_FIELD_NUMBER; + hash = (53 * hash) + getUser().hashCode(); + } + hash = (37 * hash) + REQUEST_ID_FIELD_NUMBER; + hash = (53 * hash) + getRequestId().hashCode(); + hash = (37 * hash) + VALIDATE_ONLY_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getValidateOnly()); + hash = (37 * hash) + ALLOW_MISSING_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getAllowMissing()); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.alloydb.v1.UpdateUserRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1.UpdateUserRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.alloydb.v1.UpdateUserRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1.UpdateUserRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.alloydb.v1.UpdateUserRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1.UpdateUserRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.alloydb.v1.UpdateUserRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1.UpdateUserRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.alloydb.v1.UpdateUserRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1.UpdateUserRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.alloydb.v1.UpdateUserRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1.UpdateUserRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.alloydb.v1.UpdateUserRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Message for updating a User
+   * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1.UpdateUserRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.alloydb.v1.UpdateUserRequest) + com.google.cloud.alloydb.v1.UpdateUserRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.alloydb.v1.ServiceProto + .internal_static_google_cloud_alloydb_v1_UpdateUserRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1.ServiceProto + .internal_static_google_cloud_alloydb_v1_UpdateUserRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1.UpdateUserRequest.class, + com.google.cloud.alloydb.v1.UpdateUserRequest.Builder.class); + } + + // Construct using com.google.cloud.alloydb.v1.UpdateUserRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + updateMask_ = null; + if (updateMaskBuilder_ != null) { + updateMaskBuilder_.dispose(); + updateMaskBuilder_ = null; + } + user_ = null; + if (userBuilder_ != null) { + userBuilder_.dispose(); + userBuilder_ = null; + } + requestId_ = ""; + validateOnly_ = false; + allowMissing_ = false; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.alloydb.v1.ServiceProto + .internal_static_google_cloud_alloydb_v1_UpdateUserRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1.UpdateUserRequest getDefaultInstanceForType() { + return com.google.cloud.alloydb.v1.UpdateUserRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.alloydb.v1.UpdateUserRequest build() { + com.google.cloud.alloydb.v1.UpdateUserRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1.UpdateUserRequest buildPartial() { + com.google.cloud.alloydb.v1.UpdateUserRequest result = + new com.google.cloud.alloydb.v1.UpdateUserRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.alloydb.v1.UpdateUserRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.updateMask_ = updateMaskBuilder_ == null ? updateMask_ : updateMaskBuilder_.build(); + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.user_ = userBuilder_ == null ? user_ : userBuilder_.build(); + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.requestId_ = requestId_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.validateOnly_ = validateOnly_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.allowMissing_ = allowMissing_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.alloydb.v1.UpdateUserRequest) { + return mergeFrom((com.google.cloud.alloydb.v1.UpdateUserRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.alloydb.v1.UpdateUserRequest other) { + if (other == com.google.cloud.alloydb.v1.UpdateUserRequest.getDefaultInstance()) return this; + if (other.hasUpdateMask()) { + mergeUpdateMask(other.getUpdateMask()); + } + if (other.hasUser()) { + mergeUser(other.getUser()); + } + if (!other.getRequestId().isEmpty()) { + requestId_ = other.requestId_; + bitField0_ |= 0x00000004; + onChanged(); + } + if (other.getValidateOnly() != false) { + setValidateOnly(other.getValidateOnly()); + } + if (other.getAllowMissing() != false) { + setAllowMissing(other.getAllowMissing()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + input.readMessage(getUpdateMaskFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + input.readMessage(getUserFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + requestId_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 32: + { + validateOnly_ = input.readBool(); + bitField0_ |= 0x00000008; + break; + } // case 32 + case 40: + { + allowMissing_ = input.readBool(); + bitField0_ |= 0x00000010; + break; + } // case 40 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private com.google.protobuf.FieldMask updateMask_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder> + updateMaskBuilder_; + /** + * + * + *
+     * 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.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the updateMask field is set. + */ + public boolean hasUpdateMask() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+     * 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.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The updateMask. + */ + public com.google.protobuf.FieldMask getUpdateMask() { + if (updateMaskBuilder_ == null) { + return updateMask_ == null + ? com.google.protobuf.FieldMask.getDefaultInstance() + : updateMask_; + } else { + return updateMaskBuilder_.getMessage(); + } + } + /** + * + * + *
+     * 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.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setUpdateMask(com.google.protobuf.FieldMask value) { + if (updateMaskBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + updateMask_ = value; + } else { + updateMaskBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * 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.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setUpdateMask(com.google.protobuf.FieldMask.Builder builderForValue) { + if (updateMaskBuilder_ == null) { + updateMask_ = builderForValue.build(); + } else { + updateMaskBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * 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.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder mergeUpdateMask(com.google.protobuf.FieldMask value) { + if (updateMaskBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && updateMask_ != null + && updateMask_ != com.google.protobuf.FieldMask.getDefaultInstance()) { + getUpdateMaskBuilder().mergeFrom(value); + } else { + updateMask_ = value; + } + } else { + updateMaskBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * 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.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder clearUpdateMask() { + bitField0_ = (bitField0_ & ~0x00000001); + updateMask_ = null; + if (updateMaskBuilder_ != null) { + updateMaskBuilder_.dispose(); + updateMaskBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * 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.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.protobuf.FieldMask.Builder getUpdateMaskBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return getUpdateMaskFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * 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.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { + if (updateMaskBuilder_ != null) { + return updateMaskBuilder_.getMessageOrBuilder(); + } else { + return updateMask_ == null + ? com.google.protobuf.FieldMask.getDefaultInstance() + : 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.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder> + getUpdateMaskFieldBuilder() { + if (updateMaskBuilder_ == null) { + updateMaskBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder>( + getUpdateMask(), getParentForChildren(), isClean()); + updateMask_ = null; + } + return updateMaskBuilder_; + } + + private com.google.cloud.alloydb.v1.User user_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1.User, + com.google.cloud.alloydb.v1.User.Builder, + com.google.cloud.alloydb.v1.UserOrBuilder> + userBuilder_; + /** + * + * + *
+     * Required. The resource being updated
+     * 
+ * + * .google.cloud.alloydb.v1.User user = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the user field is set. + */ + public boolean hasUser() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+     * Required. The resource being updated
+     * 
+ * + * .google.cloud.alloydb.v1.User user = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The user. + */ + public com.google.cloud.alloydb.v1.User getUser() { + if (userBuilder_ == null) { + return user_ == null ? com.google.cloud.alloydb.v1.User.getDefaultInstance() : user_; + } else { + return userBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. The resource being updated
+     * 
+ * + * .google.cloud.alloydb.v1.User user = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setUser(com.google.cloud.alloydb.v1.User value) { + if (userBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + user_ = value; + } else { + userBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The resource being updated
+     * 
+ * + * .google.cloud.alloydb.v1.User user = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setUser(com.google.cloud.alloydb.v1.User.Builder builderForValue) { + if (userBuilder_ == null) { + user_ = builderForValue.build(); + } else { + userBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The resource being updated
+     * 
+ * + * .google.cloud.alloydb.v1.User user = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeUser(com.google.cloud.alloydb.v1.User value) { + if (userBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && user_ != null + && user_ != com.google.cloud.alloydb.v1.User.getDefaultInstance()) { + getUserBuilder().mergeFrom(value); + } else { + user_ = value; + } + } else { + userBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The resource being updated
+     * 
+ * + * .google.cloud.alloydb.v1.User user = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearUser() { + bitField0_ = (bitField0_ & ~0x00000002); + user_ = null; + if (userBuilder_ != null) { + userBuilder_.dispose(); + userBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The resource being updated
+     * 
+ * + * .google.cloud.alloydb.v1.User user = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.alloydb.v1.User.Builder getUserBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return getUserFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. The resource being updated
+     * 
+ * + * .google.cloud.alloydb.v1.User user = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.alloydb.v1.UserOrBuilder getUserOrBuilder() { + if (userBuilder_ != null) { + return userBuilder_.getMessageOrBuilder(); + } else { + return user_ == null ? com.google.cloud.alloydb.v1.User.getDefaultInstance() : user_; + } + } + /** + * + * + *
+     * Required. The resource being updated
+     * 
+ * + * .google.cloud.alloydb.v1.User user = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1.User, + com.google.cloud.alloydb.v1.User.Builder, + com.google.cloud.alloydb.v1.UserOrBuilder> + getUserFieldBuilder() { + if (userBuilder_ == null) { + userBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1.User, + com.google.cloud.alloydb.v1.User.Builder, + com.google.cloud.alloydb.v1.UserOrBuilder>( + getUser(), getParentForChildren(), isClean()); + user_ = null; + } + return userBuilder_; + } + + private java.lang.Object 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).
+     * 
+ * + * string request_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The requestId. + */ + public java.lang.String getRequestId() { + java.lang.Object ref = requestId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + requestId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes since the first request.
+     *
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     *
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for requestId. + */ + public com.google.protobuf.ByteString getRequestIdBytes() { + java.lang.Object ref = requestId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + requestId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes since the first request.
+     *
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     *
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The requestId to set. + * @return This builder for chaining. + */ + public Builder setRequestId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + requestId_ = value; + bitField0_ |= 0x00000004; + onChanged(); + 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).
+     * 
+ * + * string request_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearRequestId() { + requestId_ = getDefaultInstance().getRequestId(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + 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).
+     * 
+ * + * string request_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for requestId to set. + * @return This builder for chaining. + */ + public Builder setRequestIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + requestId_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + private boolean validateOnly_; + /** + * + * + *
+     * Optional. If set, the backend validates the request, but doesn't actually
+     * execute it.
+     * 
+ * + * bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The validateOnly. + */ + @java.lang.Override + public boolean getValidateOnly() { + return validateOnly_; + } + /** + * + * + *
+     * Optional. If set, the backend validates the request, but doesn't actually
+     * execute it.
+     * 
+ * + * bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The validateOnly to set. + * @return This builder for chaining. + */ + public Builder setValidateOnly(boolean value) { + + validateOnly_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. If set, the backend validates the request, but doesn't actually
+     * execute it.
+     * 
+ * + * bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearValidateOnly() { + bitField0_ = (bitField0_ & ~0x00000008); + validateOnly_ = false; + onChanged(); + return this; + } + + private boolean allowMissing_; + /** + * + * + *
+     * Optional. Allow missing fields in the update mask.
+     * 
+ * + * bool allow_missing = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The allowMissing. + */ + @java.lang.Override + public boolean getAllowMissing() { + return allowMissing_; + } + /** + * + * + *
+     * Optional. Allow missing fields in the update mask.
+     * 
+ * + * bool allow_missing = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The allowMissing to set. + * @return This builder for chaining. + */ + public Builder setAllowMissing(boolean value) { + + allowMissing_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Allow missing fields in the update mask.
+     * 
+ * + * bool allow_missing = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearAllowMissing() { + bitField0_ = (bitField0_ & ~0x00000010); + allowMissing_ = false; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.alloydb.v1.UpdateUserRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.alloydb.v1.UpdateUserRequest) + private static final com.google.cloud.alloydb.v1.UpdateUserRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.alloydb.v1.UpdateUserRequest(); + } + + public static com.google.cloud.alloydb.v1.UpdateUserRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public UpdateUserRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1.UpdateUserRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/UpdateUserRequestOrBuilder.java b/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/UpdateUserRequestOrBuilder.java new file mode 100644 index 000000000000..a1b300fbe957 --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/UpdateUserRequestOrBuilder.java @@ -0,0 +1,186 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/alloydb/v1/service.proto + +package com.google.cloud.alloydb.v1; + +public interface UpdateUserRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.alloydb.v1.UpdateUserRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * 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.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the updateMask field is set. + */ + boolean hasUpdateMask(); + /** + * + * + *
+   * 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.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The updateMask. + */ + com.google.protobuf.FieldMask getUpdateMask(); + /** + * + * + *
+   * 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.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder(); + + /** + * + * + *
+   * Required. The resource being updated
+   * 
+ * + * .google.cloud.alloydb.v1.User user = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return Whether the user field is set. + */ + boolean hasUser(); + /** + * + * + *
+   * Required. The resource being updated
+   * 
+ * + * .google.cloud.alloydb.v1.User user = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The user. + */ + com.google.cloud.alloydb.v1.User getUser(); + /** + * + * + *
+   * Required. The resource being updated
+   * 
+ * + * .google.cloud.alloydb.v1.User user = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + com.google.cloud.alloydb.v1.UserOrBuilder getUserOrBuilder(); + + /** + * + * + *
+   * Optional. An optional request ID to identify requests. Specify a unique
+   * request ID so that if you must retry your request, the server will know to
+   * ignore the request if it has already been completed. The server will
+   * guarantee that for at least 60 minutes since the first request.
+   *
+   * For example, consider a situation where you make an initial request and
+   * the request times out. If you make the request again with the same request
+   * ID, the server can check if original operation with the same request ID
+   * was received, and if so, will ignore the second request. This prevents
+   * clients from accidentally creating duplicate commitments.
+   *
+   * The request ID must be a valid UUID with the exception that zero UUID is
+   * not supported (00000000-0000-0000-0000-000000000000).
+   * 
+ * + * string request_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The requestId. + */ + java.lang.String getRequestId(); + /** + * + * + *
+   * Optional. An optional request ID to identify requests. Specify a unique
+   * request ID so that if you must retry your request, the server will know to
+   * ignore the request if it has already been completed. The server will
+   * guarantee that for at least 60 minutes since the first request.
+   *
+   * For example, consider a situation where you make an initial request and
+   * the request times out. If you make the request again with the same request
+   * ID, the server can check if original operation with the same request ID
+   * was received, and if so, will ignore the second request. This prevents
+   * clients from accidentally creating duplicate commitments.
+   *
+   * The request ID must be a valid UUID with the exception that zero UUID is
+   * not supported (00000000-0000-0000-0000-000000000000).
+   * 
+ * + * string request_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for requestId. + */ + com.google.protobuf.ByteString getRequestIdBytes(); + + /** + * + * + *
+   * Optional. If set, the backend validates the request, but doesn't actually
+   * execute it.
+   * 
+ * + * bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The validateOnly. + */ + boolean getValidateOnly(); + + /** + * + * + *
+   * Optional. Allow missing fields in the update mask.
+   * 
+ * + * bool allow_missing = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The allowMissing. + */ + boolean getAllowMissing(); +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/User.java b/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/User.java new file mode 100644 index 000000000000..66a4397407ea --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/User.java @@ -0,0 +1,1419 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/alloydb/v1/resources.proto + +package com.google.cloud.alloydb.v1; + +/** + * + * + *
+ * Message describing User object.
+ * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1.User} + */ +public final class User extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.alloydb.v1.User) + UserOrBuilder { + private static final long serialVersionUID = 0L; + // Use User.newBuilder() to construct. + private User(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private User() { + name_ = ""; + password_ = ""; + databaseRoles_ = com.google.protobuf.LazyStringArrayList.emptyList(); + userType_ = 0; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new User(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.alloydb.v1.ResourcesProto + .internal_static_google_cloud_alloydb_v1_User_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1.ResourcesProto + .internal_static_google_cloud_alloydb_v1_User_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1.User.class, com.google.cloud.alloydb.v1.User.Builder.class); + } + + /** + * + * + *
+   * Enum that details the user type.
+   * 
+ * + * Protobuf enum {@code google.cloud.alloydb.v1.User.UserType} + */ + public enum UserType implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * Unspecified user type.
+     * 
+ * + * USER_TYPE_UNSPECIFIED = 0; + */ + USER_TYPE_UNSPECIFIED(0), + /** + * + * + *
+     * The default user type that authenticates via password-based
+     * authentication.
+     * 
+ * + * ALLOYDB_BUILT_IN = 1; + */ + ALLOYDB_BUILT_IN(1), + /** + * + * + *
+     * Database user that can authenticate via IAM-Based authentication.
+     * 
+ * + * ALLOYDB_IAM_USER = 2; + */ + ALLOYDB_IAM_USER(2), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * Unspecified user type.
+     * 
+ * + * USER_TYPE_UNSPECIFIED = 0; + */ + public static final int USER_TYPE_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * The default user type that authenticates via password-based
+     * authentication.
+     * 
+ * + * ALLOYDB_BUILT_IN = 1; + */ + public static final int ALLOYDB_BUILT_IN_VALUE = 1; + /** + * + * + *
+     * Database user that can authenticate via IAM-Based authentication.
+     * 
+ * + * ALLOYDB_IAM_USER = 2; + */ + public static final int ALLOYDB_IAM_USER_VALUE = 2; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static UserType valueOf(int value) { + return forNumber(value); + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + */ + public static UserType forNumber(int value) { + switch (value) { + case 0: + return USER_TYPE_UNSPECIFIED; + case 1: + return ALLOYDB_BUILT_IN; + case 2: + return ALLOYDB_IAM_USER; + default: + return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap internalGetValueMap() { + return internalValueMap; + } + + private static final com.google.protobuf.Internal.EnumLiteMap internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public UserType findValueByNumber(int number) { + return UserType.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + return getDescriptor().getValues().get(ordinal()); + } + + public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { + return getDescriptor(); + } + + public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.cloud.alloydb.v1.User.getDescriptor().getEnumTypes().get(0); + } + + private static final UserType[] VALUES = values(); + + public static UserType valueOf(com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException("EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private UserType(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.alloydb.v1.User.UserType) + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + * + * + *
+   * Output only. Name of the resource in the form of
+   * projects/{project}/locations/{location}/cluster/{cluster}/users/{user}.
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * Output only. Name of the resource in the form of
+   * projects/{project}/locations/{location}/cluster/{cluster}/users/{user}.
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PASSWORD_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object password_ = ""; + /** + * + * + *
+   * Input only. Password for the user.
+   * 
+ * + * string password = 2 [(.google.api.field_behavior) = INPUT_ONLY]; + * + * @return The password. + */ + @java.lang.Override + public java.lang.String getPassword() { + java.lang.Object ref = password_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + password_ = s; + return s; + } + } + /** + * + * + *
+   * Input only. Password for the user.
+   * 
+ * + * string password = 2 [(.google.api.field_behavior) = INPUT_ONLY]; + * + * @return The bytes for password. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPasswordBytes() { + java.lang.Object ref = password_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + password_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DATABASE_ROLES_FIELD_NUMBER = 4; + + @SuppressWarnings("serial") + private com.google.protobuf.LazyStringArrayList databaseRoles_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + /** + * + * + *
+   * Optional. List of database roles this user has.
+   * The database role strings are subject to the PostgreSQL naming conventions.
+   * 
+ * + * repeated string database_roles = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return A list containing the databaseRoles. + */ + public com.google.protobuf.ProtocolStringList getDatabaseRolesList() { + return databaseRoles_; + } + /** + * + * + *
+   * Optional. List of database roles this user has.
+   * The database role strings are subject to the PostgreSQL naming conventions.
+   * 
+ * + * repeated string database_roles = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The count of databaseRoles. + */ + public int getDatabaseRolesCount() { + return databaseRoles_.size(); + } + /** + * + * + *
+   * Optional. List of database roles this user has.
+   * The database role strings are subject to the PostgreSQL naming conventions.
+   * 
+ * + * repeated string database_roles = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param index The index of the element to return. + * @return The databaseRoles at the given index. + */ + public java.lang.String getDatabaseRoles(int index) { + return databaseRoles_.get(index); + } + /** + * + * + *
+   * Optional. List of database roles this user has.
+   * The database role strings are subject to the PostgreSQL naming conventions.
+   * 
+ * + * repeated string database_roles = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param index The index of the value to return. + * @return The bytes of the databaseRoles at the given index. + */ + public com.google.protobuf.ByteString getDatabaseRolesBytes(int index) { + return databaseRoles_.getByteString(index); + } + + public static final int USER_TYPE_FIELD_NUMBER = 5; + private int userType_ = 0; + /** + * + * + *
+   * Optional. Type of this user.
+   * 
+ * + * + * .google.cloud.alloydb.v1.User.UserType user_type = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The enum numeric value on the wire for userType. + */ + @java.lang.Override + public int getUserTypeValue() { + return userType_; + } + /** + * + * + *
+   * Optional. Type of this user.
+   * 
+ * + * + * .google.cloud.alloydb.v1.User.UserType user_type = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The userType. + */ + @java.lang.Override + public com.google.cloud.alloydb.v1.User.UserType getUserType() { + com.google.cloud.alloydb.v1.User.UserType result = + com.google.cloud.alloydb.v1.User.UserType.forNumber(userType_); + return result == null ? com.google.cloud.alloydb.v1.User.UserType.UNRECOGNIZED : result; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(password_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, password_); + } + for (int i = 0; i < databaseRoles_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, databaseRoles_.getRaw(i)); + } + if (userType_ != com.google.cloud.alloydb.v1.User.UserType.USER_TYPE_UNSPECIFIED.getNumber()) { + output.writeEnum(5, userType_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(password_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, password_); + } + { + int dataSize = 0; + for (int i = 0; i < databaseRoles_.size(); i++) { + dataSize += computeStringSizeNoTag(databaseRoles_.getRaw(i)); + } + size += dataSize; + size += 1 * getDatabaseRolesList().size(); + } + if (userType_ != com.google.cloud.alloydb.v1.User.UserType.USER_TYPE_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(5, userType_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.alloydb.v1.User)) { + return super.equals(obj); + } + com.google.cloud.alloydb.v1.User other = (com.google.cloud.alloydb.v1.User) obj; + + if (!getName().equals(other.getName())) return false; + if (!getPassword().equals(other.getPassword())) return false; + if (!getDatabaseRolesList().equals(other.getDatabaseRolesList())) return false; + if (userType_ != other.userType_) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (37 * hash) + PASSWORD_FIELD_NUMBER; + hash = (53 * hash) + getPassword().hashCode(); + if (getDatabaseRolesCount() > 0) { + hash = (37 * hash) + DATABASE_ROLES_FIELD_NUMBER; + hash = (53 * hash) + getDatabaseRolesList().hashCode(); + } + hash = (37 * hash) + USER_TYPE_FIELD_NUMBER; + hash = (53 * hash) + userType_; + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.alloydb.v1.User parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1.User parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.alloydb.v1.User parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1.User parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.alloydb.v1.User parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1.User parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.alloydb.v1.User parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1.User parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.alloydb.v1.User parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1.User parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.alloydb.v1.User parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1.User parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.alloydb.v1.User prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Message describing User object.
+   * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1.User} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.alloydb.v1.User) + com.google.cloud.alloydb.v1.UserOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.alloydb.v1.ResourcesProto + .internal_static_google_cloud_alloydb_v1_User_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1.ResourcesProto + .internal_static_google_cloud_alloydb_v1_User_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1.User.class, + com.google.cloud.alloydb.v1.User.Builder.class); + } + + // Construct using com.google.cloud.alloydb.v1.User.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + password_ = ""; + databaseRoles_ = com.google.protobuf.LazyStringArrayList.emptyList(); + userType_ = 0; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.alloydb.v1.ResourcesProto + .internal_static_google_cloud_alloydb_v1_User_descriptor; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1.User getDefaultInstanceForType() { + return com.google.cloud.alloydb.v1.User.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.alloydb.v1.User build() { + com.google.cloud.alloydb.v1.User result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1.User buildPartial() { + com.google.cloud.alloydb.v1.User result = new com.google.cloud.alloydb.v1.User(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.alloydb.v1.User result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.password_ = password_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + databaseRoles_.makeImmutable(); + result.databaseRoles_ = databaseRoles_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.userType_ = userType_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.alloydb.v1.User) { + return mergeFrom((com.google.cloud.alloydb.v1.User) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.alloydb.v1.User other) { + if (other == com.google.cloud.alloydb.v1.User.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getPassword().isEmpty()) { + password_ = other.password_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (!other.databaseRoles_.isEmpty()) { + if (databaseRoles_.isEmpty()) { + databaseRoles_ = other.databaseRoles_; + bitField0_ |= 0x00000004; + } else { + ensureDatabaseRolesIsMutable(); + databaseRoles_.addAll(other.databaseRoles_); + } + onChanged(); + } + if (other.userType_ != 0) { + setUserTypeValue(other.getUserTypeValue()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + password_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 34: + { + java.lang.String s = input.readStringRequireUtf8(); + ensureDatabaseRolesIsMutable(); + databaseRoles_.add(s); + break; + } // case 34 + case 40: + { + userType_ = input.readEnum(); + bitField0_ |= 0x00000008; + break; + } // case 40 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Output only. Name of the resource in the form of
+     * projects/{project}/locations/{location}/cluster/{cluster}/users/{user}.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Output only. Name of the resource in the form of
+     * projects/{project}/locations/{location}/cluster/{cluster}/users/{user}.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Output only. Name of the resource in the form of
+     * projects/{project}/locations/{location}/cluster/{cluster}/users/{user}.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Name of the resource in the form of
+     * projects/{project}/locations/{location}/cluster/{cluster}/users/{user}.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Name of the resource in the form of
+     * projects/{project}/locations/{location}/cluster/{cluster}/users/{user}.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object password_ = ""; + /** + * + * + *
+     * Input only. Password for the user.
+     * 
+ * + * string password = 2 [(.google.api.field_behavior) = INPUT_ONLY]; + * + * @return The password. + */ + public java.lang.String getPassword() { + java.lang.Object ref = password_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + password_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Input only. Password for the user.
+     * 
+ * + * string password = 2 [(.google.api.field_behavior) = INPUT_ONLY]; + * + * @return The bytes for password. + */ + public com.google.protobuf.ByteString getPasswordBytes() { + java.lang.Object ref = password_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + password_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Input only. Password for the user.
+     * 
+ * + * string password = 2 [(.google.api.field_behavior) = INPUT_ONLY]; + * + * @param value The password to set. + * @return This builder for chaining. + */ + public Builder setPassword(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + password_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Input only. Password for the user.
+     * 
+ * + * string password = 2 [(.google.api.field_behavior) = INPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearPassword() { + password_ = getDefaultInstance().getPassword(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * Input only. Password for the user.
+     * 
+ * + * string password = 2 [(.google.api.field_behavior) = INPUT_ONLY]; + * + * @param value The bytes for password to set. + * @return This builder for chaining. + */ + public Builder setPasswordBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + password_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringArrayList databaseRoles_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + + private void ensureDatabaseRolesIsMutable() { + if (!databaseRoles_.isModifiable()) { + databaseRoles_ = new com.google.protobuf.LazyStringArrayList(databaseRoles_); + } + bitField0_ |= 0x00000004; + } + /** + * + * + *
+     * Optional. List of database roles this user has.
+     * The database role strings are subject to the PostgreSQL naming conventions.
+     * 
+ * + * repeated string database_roles = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return A list containing the databaseRoles. + */ + public com.google.protobuf.ProtocolStringList getDatabaseRolesList() { + databaseRoles_.makeImmutable(); + return databaseRoles_; + } + /** + * + * + *
+     * Optional. List of database roles this user has.
+     * The database role strings are subject to the PostgreSQL naming conventions.
+     * 
+ * + * repeated string database_roles = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The count of databaseRoles. + */ + public int getDatabaseRolesCount() { + return databaseRoles_.size(); + } + /** + * + * + *
+     * Optional. List of database roles this user has.
+     * The database role strings are subject to the PostgreSQL naming conventions.
+     * 
+ * + * repeated string database_roles = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param index The index of the element to return. + * @return The databaseRoles at the given index. + */ + public java.lang.String getDatabaseRoles(int index) { + return databaseRoles_.get(index); + } + /** + * + * + *
+     * Optional. List of database roles this user has.
+     * The database role strings are subject to the PostgreSQL naming conventions.
+     * 
+ * + * repeated string database_roles = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param index The index of the value to return. + * @return The bytes of the databaseRoles at the given index. + */ + public com.google.protobuf.ByteString getDatabaseRolesBytes(int index) { + return databaseRoles_.getByteString(index); + } + /** + * + * + *
+     * Optional. List of database roles this user has.
+     * The database role strings are subject to the PostgreSQL naming conventions.
+     * 
+ * + * repeated string database_roles = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param index The index to set the value at. + * @param value The databaseRoles to set. + * @return This builder for chaining. + */ + public Builder setDatabaseRoles(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureDatabaseRolesIsMutable(); + databaseRoles_.set(index, value); + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. List of database roles this user has.
+     * The database role strings are subject to the PostgreSQL naming conventions.
+     * 
+ * + * repeated string database_roles = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The databaseRoles to add. + * @return This builder for chaining. + */ + public Builder addDatabaseRoles(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureDatabaseRolesIsMutable(); + databaseRoles_.add(value); + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. List of database roles this user has.
+     * The database role strings are subject to the PostgreSQL naming conventions.
+     * 
+ * + * repeated string database_roles = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param values The databaseRoles to add. + * @return This builder for chaining. + */ + public Builder addAllDatabaseRoles(java.lang.Iterable values) { + ensureDatabaseRolesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, databaseRoles_); + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. List of database roles this user has.
+     * The database role strings are subject to the PostgreSQL naming conventions.
+     * 
+ * + * repeated string database_roles = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearDatabaseRoles() { + databaseRoles_ = com.google.protobuf.LazyStringArrayList.emptyList(); + bitField0_ = (bitField0_ & ~0x00000004); + ; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. List of database roles this user has.
+     * The database role strings are subject to the PostgreSQL naming conventions.
+     * 
+ * + * repeated string database_roles = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes of the databaseRoles to add. + * @return This builder for chaining. + */ + public Builder addDatabaseRolesBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureDatabaseRolesIsMutable(); + databaseRoles_.add(value); + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + private int userType_ = 0; + /** + * + * + *
+     * Optional. Type of this user.
+     * 
+ * + * + * .google.cloud.alloydb.v1.User.UserType user_type = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The enum numeric value on the wire for userType. + */ + @java.lang.Override + public int getUserTypeValue() { + return userType_; + } + /** + * + * + *
+     * Optional. Type of this user.
+     * 
+ * + * + * .google.cloud.alloydb.v1.User.UserType user_type = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param value The enum numeric value on the wire for userType to set. + * @return This builder for chaining. + */ + public Builder setUserTypeValue(int value) { + userType_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Type of this user.
+     * 
+ * + * + * .google.cloud.alloydb.v1.User.UserType user_type = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The userType. + */ + @java.lang.Override + public com.google.cloud.alloydb.v1.User.UserType getUserType() { + com.google.cloud.alloydb.v1.User.UserType result = + com.google.cloud.alloydb.v1.User.UserType.forNumber(userType_); + return result == null ? com.google.cloud.alloydb.v1.User.UserType.UNRECOGNIZED : result; + } + /** + * + * + *
+     * Optional. Type of this user.
+     * 
+ * + * + * .google.cloud.alloydb.v1.User.UserType user_type = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param value The userType to set. + * @return This builder for chaining. + */ + public Builder setUserType(com.google.cloud.alloydb.v1.User.UserType value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000008; + userType_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Type of this user.
+     * 
+ * + * + * .google.cloud.alloydb.v1.User.UserType user_type = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return This builder for chaining. + */ + public Builder clearUserType() { + bitField0_ = (bitField0_ & ~0x00000008); + userType_ = 0; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.alloydb.v1.User) + } + + // @@protoc_insertion_point(class_scope:google.cloud.alloydb.v1.User) + private static final com.google.cloud.alloydb.v1.User DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.alloydb.v1.User(); + } + + public static com.google.cloud.alloydb.v1.User getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public User parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1.User getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/UserName.java b/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/UserName.java new file mode 100644 index 000000000000..ac6a2d724a23 --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/UserName.java @@ -0,0 +1,257 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.alloydb.v1; + +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +@Generated("by gapic-generator-java") +public class UserName implements ResourceName { + private static final PathTemplate PROJECT_LOCATION_CLUSTER_USER = + PathTemplate.createWithoutUrlEncoding( + "projects/{project}/locations/{location}/clusters/{cluster}/users/{user}"); + private volatile Map fieldValuesMap; + private final String project; + private final String location; + private final String cluster; + private final String user; + + @Deprecated + protected UserName() { + project = null; + location = null; + cluster = null; + user = null; + } + + private UserName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + location = Preconditions.checkNotNull(builder.getLocation()); + cluster = Preconditions.checkNotNull(builder.getCluster()); + user = Preconditions.checkNotNull(builder.getUser()); + } + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getCluster() { + return cluster; + } + + public String getUser() { + return user; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + public static UserName of(String project, String location, String cluster, String user) { + return newBuilder() + .setProject(project) + .setLocation(location) + .setCluster(cluster) + .setUser(user) + .build(); + } + + public static String format(String project, String location, String cluster, String user) { + return newBuilder() + .setProject(project) + .setLocation(location) + .setCluster(cluster) + .setUser(user) + .build() + .toString(); + } + + public static UserName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + PROJECT_LOCATION_CLUSTER_USER.validatedMatch( + formattedString, "UserName.parse: formattedString not in valid format"); + return of( + matchMap.get("project"), + matchMap.get("location"), + matchMap.get("cluster"), + matchMap.get("user")); + } + + public static List parseList(List formattedStrings) { + List list = new ArrayList<>(formattedStrings.size()); + for (String formattedString : formattedStrings) { + list.add(parse(formattedString)); + } + return list; + } + + public static List toStringList(List values) { + List list = new ArrayList<>(values.size()); + for (UserName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return PROJECT_LOCATION_CLUSTER_USER.matches(formattedString); + } + + @Override + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + if (project != null) { + fieldMapBuilder.put("project", project); + } + if (location != null) { + fieldMapBuilder.put("location", location); + } + if (cluster != null) { + fieldMapBuilder.put("cluster", cluster); + } + if (user != null) { + fieldMapBuilder.put("user", user); + } + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return PROJECT_LOCATION_CLUSTER_USER.instantiate( + "project", project, "location", location, "cluster", cluster, "user", user); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null || getClass() == o.getClass()) { + UserName that = ((UserName) o); + return Objects.equals(this.project, that.project) + && Objects.equals(this.location, that.location) + && Objects.equals(this.cluster, that.cluster) + && Objects.equals(this.user, that.user); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= Objects.hashCode(project); + h *= 1000003; + h ^= Objects.hashCode(location); + h *= 1000003; + h ^= Objects.hashCode(cluster); + h *= 1000003; + h ^= Objects.hashCode(user); + return h; + } + + /** Builder for projects/{project}/locations/{location}/clusters/{cluster}/users/{user}. */ + public static class Builder { + private String project; + private String location; + private String cluster; + private String user; + + protected Builder() {} + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getCluster() { + return cluster; + } + + public String getUser() { + return user; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public Builder setLocation(String location) { + this.location = location; + return this; + } + + public Builder setCluster(String cluster) { + this.cluster = cluster; + return this; + } + + public Builder setUser(String user) { + this.user = user; + return this; + } + + private Builder(UserName userName) { + this.project = userName.project; + this.location = userName.location; + this.cluster = userName.cluster; + this.user = userName.user; + } + + public UserName build() { + return new UserName(this); + } + } +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/UserOrBuilder.java b/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/UserOrBuilder.java new file mode 100644 index 000000000000..1f8f8efc88c9 --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/UserOrBuilder.java @@ -0,0 +1,161 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/alloydb/v1/resources.proto + +package com.google.cloud.alloydb.v1; + +public interface UserOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.alloydb.v1.User) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Output only. Name of the resource in the form of
+   * projects/{project}/locations/{location}/cluster/{cluster}/users/{user}.
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Output only. Name of the resource in the form of
+   * projects/{project}/locations/{location}/cluster/{cluster}/users/{user}.
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * Input only. Password for the user.
+   * 
+ * + * string password = 2 [(.google.api.field_behavior) = INPUT_ONLY]; + * + * @return The password. + */ + java.lang.String getPassword(); + /** + * + * + *
+   * Input only. Password for the user.
+   * 
+ * + * string password = 2 [(.google.api.field_behavior) = INPUT_ONLY]; + * + * @return The bytes for password. + */ + com.google.protobuf.ByteString getPasswordBytes(); + + /** + * + * + *
+   * Optional. List of database roles this user has.
+   * The database role strings are subject to the PostgreSQL naming conventions.
+   * 
+ * + * repeated string database_roles = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return A list containing the databaseRoles. + */ + java.util.List getDatabaseRolesList(); + /** + * + * + *
+   * Optional. List of database roles this user has.
+   * The database role strings are subject to the PostgreSQL naming conventions.
+   * 
+ * + * repeated string database_roles = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The count of databaseRoles. + */ + int getDatabaseRolesCount(); + /** + * + * + *
+   * Optional. List of database roles this user has.
+   * The database role strings are subject to the PostgreSQL naming conventions.
+   * 
+ * + * repeated string database_roles = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param index The index of the element to return. + * @return The databaseRoles at the given index. + */ + java.lang.String getDatabaseRoles(int index); + /** + * + * + *
+   * Optional. List of database roles this user has.
+   * The database role strings are subject to the PostgreSQL naming conventions.
+   * 
+ * + * repeated string database_roles = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param index The index of the value to return. + * @return The bytes of the databaseRoles at the given index. + */ + com.google.protobuf.ByteString getDatabaseRolesBytes(int index); + + /** + * + * + *
+   * Optional. Type of this user.
+   * 
+ * + * + * .google.cloud.alloydb.v1.User.UserType user_type = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The enum numeric value on the wire for userType. + */ + int getUserTypeValue(); + /** + * + * + *
+   * Optional. Type of this user.
+   * 
+ * + * + * .google.cloud.alloydb.v1.User.UserType user_type = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The userType. + */ + com.google.cloud.alloydb.v1.User.UserType getUserType(); +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1/src/main/proto/google/cloud/alloydb/v1/resources.proto b/java-alloydb/proto-google-cloud-alloydb-v1/src/main/proto/google/cloud/alloydb/v1/resources.proto index 65d71d77c7c5..22b82d56d0fb 100644 --- a/java-alloydb/proto-google-cloud-alloydb-v1/src/main/proto/google/cloud/alloydb/v1/resources.proto +++ b/java-alloydb/proto-google-cloud-alloydb-v1/src/main/proto/google/cloud/alloydb/v1/resources.proto @@ -1,4 +1,4 @@ -// Copyright 2022 Google LLC +// Copyright 2023 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -40,18 +40,6 @@ option (google.api.resource_definition) = { pattern: "projects/{project}/global/networks/{network}" }; -// The supported database engine versions. -enum DatabaseVersion { - // This is an unknown database version. - DATABASE_VERSION_UNSPECIFIED = 0; - - // DEPRECATED - The database version is Postgres 13. - POSTGRES_13 = 1 [deprecated = true]; - - // The database version is Postgres 14. - POSTGRES_14 = 2; -} - // View on Instance. Pass this enum to rpcs that returns an Instance message to // control which subsets of fields to get. enum InstanceView { @@ -68,6 +56,35 @@ enum InstanceView { INSTANCE_VIEW_FULL = 2; } +// View on Cluster. Pass this enum to rpcs that returns a cluster message to +// control which subsets of fields to get. +enum ClusterView { + // CLUSTER_VIEW_UNSPECIFIED Not specified, equivalent to BASIC. + 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. + 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. + CLUSTER_VIEW_CONTINUOUS_BACKUP = 2; +} + +// The supported database engine versions. +enum DatabaseVersion { + // This is an unknown database version. + DATABASE_VERSION_UNSPECIFIED = 0; + + // DEPRECATED - The database version is Postgres 13. + POSTGRES_13 = 1 [deprecated = true]; + + // The database version is Postgres 14. + POSTGRES_14 = 2; +} + // The username/password for a database user. Used for specifying initial // users at cluster creation time. message UserPassword { @@ -141,25 +158,31 @@ message EncryptionInfo { ]; } -// SSL configuration for an AlloyDB Cluster. +// SSL configuration. message SslConfig { // SSL mode options. enum SslMode { - // SSL mode not specified. Defaults to SSL_MODE_ALLOW. + // SSL mode not specified. Defaults to ENCRYPTED_ONLY. SSL_MODE_UNSPECIFIED = 0; // SSL connections are optional. CA verification not enforced. - SSL_MODE_ALLOW = 1; + SSL_MODE_ALLOW = 1 [deprecated = true]; // SSL connections are required. CA verification not enforced. // Clients may use locally self-signed certificates (default psql client // behavior). - SSL_MODE_REQUIRE = 2; + SSL_MODE_REQUIRE = 2 [deprecated = true]; // SSL connections are required. CA verification enforced. // Clients must have certificates signed by a Cluster CA, e.g. via // GenerateClientCertificate. - SSL_MODE_VERIFY_CA = 3; + SSL_MODE_VERIFY_CA = 3 [deprecated = true]; + + // SSL connections are optional. CA verification not enforced. + ALLOW_UNENCRYPTED_AND_ENCRYPTED = 4; + + // SSL connections are required. CA verification not enforced. + ENCRYPTED_ONLY = 5; } // Certificate Authority (CA) source for SSL/TLS certificates. @@ -279,6 +302,48 @@ message AutomatedBackupPolicy { map labels = 7; } +// ContinuousBackupConfig describes the continuous backups recovery +// configurations of a cluster. +message ContinuousBackupConfig { + // Whether ContinuousBackup is enabled. + optional bool enabled = 1; + + // The number of days backups and logs will be retained, which determines the + // window of time that data is recoverable for. If not set, it defaults to 14 + // days. + int32 recovery_window_days = 4; + + // 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. + EncryptionConfig encryption_config = 3; +} + +// ContinuousBackupInfo describes the continuous backup properties of a +// cluster. +message ContinuousBackupInfo { + // Output only. The encryption information for the WALs and backups required + // for ContinuousBackup. + EncryptionInfo encryption_info = 1 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. When ContinuousBackup was most recently enabled. Set to null + // if ContinuousBackup is not enabled. + google.protobuf.Timestamp enabled_time = 2 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Days of the week on which a continuous backup is taken. Output + // only field. Ignored if passed into the request. + repeated google.type.DayOfWeek schedule = 3 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The earliest restorable time that can be restored to. Output + // only field. + google.protobuf.Timestamp earliest_restorable_time = 4 + [(google.api.field_behavior) = OUTPUT_ONLY]; +} + // Message describing a BackupSource. message BackupSource { // Output only. The system-generated UID of the backup which was used to @@ -294,6 +359,18 @@ message BackupSource { ]; } +// Message describing a ContinuousBackupSource. +message ContinuousBackupSource { + // 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. + string cluster = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The point in time to restore to. + google.protobuf.Timestamp point_in_time = 2 + [(google.api.field_behavior) = REQUIRED]; +} + // A cluster is a collection of regional AlloyDB resources. It can include a // primary instance and one or more read pool instances. // All cluster resources share a storage layer, which scales as needed. @@ -470,8 +547,8 @@ message Cluster { // documentation for the message type. AutomatedBackupPolicy automated_backup_policy = 17; - // SSL configuration for this AlloyDB Cluster. - SslConfig ssl_config = 18; + // SSL configuration for this AlloyDB cluster. + SslConfig ssl_config = 18 [deprecated = true]; // Optional. The encryption config can be specified to encrypt the data disks // and other persistent data resources of a cluster with a @@ -485,6 +562,14 @@ message Cluster { EncryptionInfo encryption_info = 20 [(google.api.field_behavior) = OUTPUT_ONLY]; + // Optional. Continuous backup configuration for this cluster. + ContinuousBackupConfig continuous_backup_config = 27 + [(google.api.field_behavior) = OPTIONAL]; + + // Output only. Continuous backup properties for this cluster. + ContinuousBackupInfo continuous_backup_info = 28 + [(google.api.field_behavior) = OUTPUT_ONLY]; + // Cross Region replication config specific to SECONDARY cluster. SecondaryConfig secondary_config = 22; @@ -610,10 +695,11 @@ message Instance { } // The Availability type of an instance. Potential values: + // // - ZONAL: The instance serves data from only one zone. Outages in that - // zone affect instance availability. + // zone affect instance availability. // - REGIONAL: The instance can serve data from more than one zone in a - // region (it is highly available). + // region (it is highly available). enum AvailabilityType { // This is an unknown Availability type. AVAILABILITY_TYPE_UNSPECIFIED = 0; @@ -669,8 +755,11 @@ message Instance { MachineConfig machine_config = 10; // Availability type of an Instance. - // Defaults to REGIONAL for both primary and read instances. - // Note that primary and read instances can have different availability types. + // 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). AvailabilityType availability_type = 11; // The Compute Engine zone that the instance should serve from, per @@ -822,7 +911,7 @@ message Backup { string cluster_uid = 18 [(google.api.field_behavior) = OUTPUT_ONLY]; // Required. The full resource name of the backup source cluster - // (e.g., projects//locations//clusters/). + // (e.g., projects/{project}/locations/{region}/clusters/{cluster_id}). string cluster_name = 10 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { type: "alloydb.googleapis.com/Cluster" } @@ -943,3 +1032,39 @@ message SupportedDatabaseFlag { // availability SLO's). bool requires_db_restart = 6; } + +// Message describing User object. +message User { + option (google.api.resource) = { + type: "alloydb.googleapis.com/User" + pattern: "projects/{project}/locations/{location}/clusters/{cluster}/users/{user}" + style: DECLARATIVE_FRIENDLY + }; + + // Enum that details the user type. + enum UserType { + // Unspecified user type. + USER_TYPE_UNSPECIFIED = 0; + + // The default user type that authenticates via password-based + // authentication. + ALLOYDB_BUILT_IN = 1; + + // Database user that can authenticate via IAM-Based authentication. + ALLOYDB_IAM_USER = 2; + } + + // Output only. Name of the resource in the form of + // projects/{project}/locations/{location}/cluster/{cluster}/users/{user}. + string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Input only. Password for the user. + string password = 2 [(google.api.field_behavior) = INPUT_ONLY]; + + // Optional. List of database roles this user has. + // The database role strings are subject to the PostgreSQL naming conventions. + repeated string database_roles = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Type of this user. + UserType user_type = 5 [(google.api.field_behavior) = OPTIONAL]; +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1/src/main/proto/google/cloud/alloydb/v1/service.proto b/java-alloydb/proto-google-cloud-alloydb-v1/src/main/proto/google/cloud/alloydb/v1/service.proto index ddc8ad705d04..4b4a87231da8 100644 --- a/java-alloydb/proto-google-cloud-alloydb-v1/src/main/proto/google/cloud/alloydb/v1/service.proto +++ b/java-alloydb/proto-google-cloud-alloydb-v1/src/main/proto/google/cloud/alloydb/v1/service.proto @@ -1,4 +1,4 @@ -// Copyright 2022 Google LLC +// Copyright 2023 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -98,6 +98,23 @@ service AlloyDBAdmin { }; } + // Promotes a SECONDARY cluster. This turns down replication + // from the PRIMARY cluster and promotes a secondary cluster + // into its own standalone cluster. + // Imperative only. + rpc PromoteCluster(PromoteClusterRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{name=projects/*/locations/*/clusters/*}:promote" + body: "*" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "Cluster" + metadata_type: "OperationMetadata" + }; + } + // 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. @@ -113,6 +130,21 @@ service AlloyDBAdmin { }; } + // Creates a cluster of type SECONDARY in the given location using + // the primary cluster as the source. + rpc CreateSecondaryCluster(CreateSecondaryClusterRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*}/clusters:createsecondary" + body: "cluster" + }; + option (google.api.method_signature) = "parent,cluster,cluster_id"; + option (google.longrunning.operation_info) = { + response_type: "Cluster" + metadata_type: "OperationMetadata" + }; + } + // Lists Instances in a given project and location. rpc ListInstances(ListInstancesRequest) returns (ListInstancesResponse) { option (google.api.http) = { @@ -143,6 +175,20 @@ service AlloyDBAdmin { }; } + // Creates a new SECONDARY Instance in a given project and location. + rpc CreateSecondaryInstance(CreateSecondaryInstanceRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*/clusters/*}/instances:createsecondary" + body: "instance" + }; + option (google.api.method_signature) = "parent,instance,instance_id"; + option (google.longrunning.operation_info) = { + response_type: "Instance" + metadata_type: "OperationMetadata" + }; + } + // 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 @@ -208,6 +254,20 @@ service AlloyDBAdmin { }; } + // Injects fault in an instance. + // Imperative only. + rpc InjectFault(InjectFaultRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{name=projects/*/locations/*/clusters/*/instances/*}:injectFault" + body: "*" + }; + option (google.api.method_signature) = "fault_type,name"; + option (google.longrunning.operation_info) = { + response_type: "Instance" + metadata_type: "OperationMetadata" + }; + } + // Restart an Instance in a cluster. // Imperative only. rpc RestartInstance(RestartInstanceRequest) @@ -285,6 +345,48 @@ service AlloyDBAdmin { }; option (google.api.method_signature) = "parent"; } + + // Lists Users in a given project and location. + rpc ListUsers(ListUsersRequest) returns (ListUsersResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*/clusters/*}/users" + }; + option (google.api.method_signature) = "parent"; + } + + // Gets details of a single User. + rpc GetUser(GetUserRequest) returns (User) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/clusters/*/users/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Creates a new User in a given project, location, and cluster. + rpc CreateUser(CreateUserRequest) returns (User) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*/clusters/*}/users" + body: "user" + }; + option (google.api.method_signature) = "parent,user,user_id"; + } + + // Updates the parameters of a single User. + rpc UpdateUser(UpdateUserRequest) returns (User) { + option (google.api.http) = { + patch: "/v1/{user.name=projects/*/locations/*/clusters/*/users/*}" + body: "user" + }; + option (google.api.method_signature) = "user,update_mask"; + } + + // Deletes a single User. + rpc DeleteUser(DeleteUserRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v1/{name=projects/*/locations/*/clusters/*/users/*}" + }; + option (google.api.method_signature) = "name"; + } } // Message for requesting list of Clusters @@ -334,11 +436,52 @@ message GetClusterRequest { (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { type: "alloydb.googleapis.com/Cluster" } ]; + + // Optional. The view of the cluster to return. Returns all default fields if + // not set. + ClusterView view = 2 [(google.api.field_behavior) = OPTIONAL]; +} + +message CreateSecondaryClusterRequest { + // Required. The location of the new cluster. For the required + // format, see the comment on the Cluster.name field. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "alloydb.googleapis.com/Cluster" + } + ]; + + // Required. ID of the requesting object (the secondary cluster). + string cluster_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. Configuration of the requesting object (the secondary cluster). + Cluster cluster = 3 [(google.api.field_behavior) = REQUIRED]; + + // Optional. An optional request ID to identify requests. Specify a unique + // request ID so that if you must retry your request, the server will know to + // ignore the request if it has already been completed. The server will + // guarantee that for at least 60 minutes since the first request. + // + // For example, consider a situation where you make an initial request and + // the request times out. If you make the request again with the same request + // ID, the server can check if original operation with the same request ID + // was received, and if so, will ignore the second request. This prevents + // clients from accidentally creating duplicate commitments. + // + // The request ID must be a valid UUID with the exception that zero UUID is + // not supported (00000000-0000-0000-0000-000000000000). + string request_id = 5 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If set, performs request validation (e.g. permission checks and + // any other type of validation), but do not actually execute the create + // request. + bool validate_only = 6 [(google.api.field_behavior) = OPTIONAL]; } // Message for creating a Cluster message CreateClusterRequest { - // Required. The name of the parent resource. For the required format, see the + // Required. The location of the new cluster. For the required format, see the // comment on the Cluster.name field. string parent = 1 [ (google.api.field_behavior) = REQUIRED, @@ -449,6 +592,40 @@ message DeleteClusterRequest { bool force = 5 [(google.api.field_behavior) = OPTIONAL]; } +// Message for promoting a Cluster +message PromoteClusterRequest { + // Required. The name of the resource. For the required format, see the + // comment on the Cluster.name field + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "alloydb.googleapis.com/Cluster" } + ]; + + // Optional. An optional request ID to identify requests. Specify a unique + // request ID so that if you must retry your request, the server will know to + // ignore the request if it has already been completed. The server will + // guarantee that for at least 60 minutes after the first request. + // + // For example, consider a situation where you make an initial request and + // the request times out. If you make the request again with the same request + // ID, the server can check if original operation with the same request ID + // was received, and if so, will ignore the second request. This prevents + // clients from accidentally creating duplicate commitments. + // + // The request ID must be a valid UUID with the exception that zero UUID is + // not supported (00000000-0000-0000-0000-000000000000). + string request_id = 2 [(google.api.field_behavior) = OPTIONAL]; + + // 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. + string etag = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If set, performs request validation (e.g. permission checks and + // any other type of validation), but do not actually execute the delete. + bool validate_only = 4 [(google.api.field_behavior) = OPTIONAL]; +} + // Message for restoring a Cluster from a backup or another cluster at a given // point in time. message RestoreClusterRequest { @@ -457,6 +634,10 @@ message RestoreClusterRequest { oneof source { // Backup source. BackupSource backup_source = 4; + + // ContinuousBackup source. Continuous backup needs to be enabled in the + // source cluster for this operation to succeed. + ContinuousBackupSource continuous_backup_source = 8; } // Required. The name of the parent resource. For the required format, see the @@ -589,6 +770,44 @@ message CreateInstanceRequest { bool validate_only = 5 [(google.api.field_behavior) = OPTIONAL]; } +// Message for creating a Secondary Instance +message CreateSecondaryInstanceRequest { + // Required. The name of the parent resource. For the required format, see the + // comment on the Instance.name field. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "alloydb.googleapis.com/Instance" + } + ]; + + // Required. ID of the requesting object. + string instance_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The resource being created + Instance instance = 3 [(google.api.field_behavior) = REQUIRED]; + + // Optional. An optional request ID to identify requests. Specify a unique + // request ID so that if you must retry your request, the server will know to + // ignore the request if it has already been completed. The server will + // guarantee that for at least 60 minutes since the first request. + // + // For example, consider a situation where you make an initial request and + // the request times out. If you make the request again with the same request + // ID, the server can check if original operation with the same request ID + // was received, and if so, will ignore the second request. This prevents + // clients from accidentally creating duplicate commitments. + // + // The request ID must be a valid UUID with the exception that zero UUID is + // not supported (00000000-0000-0000-0000-000000000000). + string request_id = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If set, performs request validation (e.g. permission checks and + // any other type of validation), but do not actually execute the create + // request. + bool validate_only = 5 [(google.api.field_behavior) = OPTIONAL]; +} + // See usage below for notes. message CreateInstanceRequests { // Required. Primary and read replica instances to be created. This list @@ -633,6 +852,7 @@ message BatchCreateInstancesResponse { } // Message for metadata that is specific to BatchCreateInstances API. +// NEXT_ID: 3 message BatchCreateInstancesMetadata { // 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 @@ -660,6 +880,7 @@ message BatchCreateInstancesMetadata { // 2. Instance2 = ROLLED_BACK // 3. Instance3 = FAILED // 4. Instance4 = FAILED +// // However, while the operation is running, the instance might be in other // states including PENDING_CREATE, ACTIVE, DELETING and CREATING. The states // / do not get further updated once the operation is done. @@ -819,6 +1040,51 @@ message FailoverInstanceRequest { bool validate_only = 3 [(google.api.field_behavior) = OPTIONAL]; } +// Message for triggering fault injection on an instance +message InjectFaultRequest { + // FaultType contains all valid types of faults that can be injected to an + // instance. + enum FaultType { + // The fault type is unknown. + FAULT_TYPE_UNSPECIFIED = 0; + + // Stop the VM + STOP_VM = 1; + } + + // Required. The type of fault to be injected in an instance. + FaultType fault_type = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The name of the resource. For the required format, see the + // comment on the Instance.name field. + string name = 2 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "alloydb.googleapis.com/Instance" + } + ]; + + // Optional. An optional request ID to identify requests. Specify a unique + // request ID so that if you must retry your request, the server will know to + // ignore the request if it has already been completed. The server will + // guarantee that for at least 60 minutes after the first request. + // + // For example, consider a situation where you make an initial request and + // the request times out. If you make the request again with the same request + // ID, the server can check if original operation with the same request ID + // was received, and if so, will ignore the second request. This prevents + // clients from accidentally creating duplicate commitments. + // + // The request ID must be a valid UUID with the exception that zero UUID is + // not supported (00000000-0000-0000-0000-000000000000). + string request_id = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If set, performs request validation (e.g. permission checks and + // any other type of validation), but do not actually execute the fault + // injection. + bool validate_only = 4 [(google.api.field_behavior) = OPTIONAL]; +} + message RestartInstanceRequest { // Required. The name of the resource. For the required format, see the // comment on the Instance.name field. @@ -1070,3 +1336,150 @@ message OperationMetadata { // Output only. API version used to start the operation. string api_version = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; } + +// Message for requesting list of Users +message ListUsersRequest { + // Required. Parent value for ListUsersRequest + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "alloydb.googleapis.com/User" + } + ]; + + // Optional. Requested page size. Server may return fewer items than + // requested. If unspecified, server will pick an appropriate default. + int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A token identifying a page of results the server should return. + string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Filtering results + string filter = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Hint for how to order the results + string order_by = 5 [(google.api.field_behavior) = OPTIONAL]; +} + +// Message for response to listing Users +message ListUsersResponse { + // The list of User + repeated User users = 1; + + // A token identifying a page of results the server should return. + string next_page_token = 2; + + // Locations that could not be reached. + repeated string unreachable = 3; +} + +// Message for getting a User +message GetUserRequest { + // Required. The name of the resource. For the required format, see the + // comment on the User.name field. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "alloydb.googleapis.com/User" } + ]; +} + +// Message for creating a User +message CreateUserRequest { + // Required. Value for parent. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "alloydb.googleapis.com/User" + } + ]; + + // Required. ID of the requesting object. + string user_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The resource being created + User user = 3 [(google.api.field_behavior) = REQUIRED]; + + // Optional. An optional request ID to identify requests. Specify a unique + // request ID so that if you must retry your request, the server will know to + // ignore the request if it has already been completed. The server will + // guarantee that for at least 60 minutes since the first request. + // + // For example, consider a situation where you make an initial request and + // the request times out. If you make the request again with the same request + // ID, the server can check if original operation with the same request ID + // was received, and if so, will ignore the second request. This prevents + // clients from accidentally creating duplicate commitments. + // + // The request ID must be a valid UUID with the exception that zero UUID is + // not supported (00000000-0000-0000-0000-000000000000). + string request_id = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If set, the backend validates the request, but doesn't actually + // execute it. + bool validate_only = 5 [(google.api.field_behavior) = OPTIONAL]; +} + +// Message for updating a User +message UpdateUserRequest { + // 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. + google.protobuf.FieldMask update_mask = 1 + [(google.api.field_behavior) = OPTIONAL]; + + // Required. The resource being updated + User user = 2 [(google.api.field_behavior) = REQUIRED]; + + // Optional. An optional request ID to identify requests. Specify a unique + // request ID so that if you must retry your request, the server will know to + // ignore the request if it has already been completed. The server will + // guarantee that for at least 60 minutes since the first request. + // + // For example, consider a situation where you make an initial request and + // the request times out. If you make the request again with the same request + // ID, the server can check if original operation with the same request ID + // was received, and if so, will ignore the second request. This prevents + // clients from accidentally creating duplicate commitments. + // + // The request ID must be a valid UUID with the exception that zero UUID is + // not supported (00000000-0000-0000-0000-000000000000). + string request_id = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If set, the backend validates the request, but doesn't actually + // execute it. + bool validate_only = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Allow missing fields in the update mask. + bool allow_missing = 5 [(google.api.field_behavior) = OPTIONAL]; +} + +// Message for deleting a User +message DeleteUserRequest { + // Required. The name of the resource. For the required format, see the + // comment on the User.name field. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "alloydb.googleapis.com/User" } + ]; + + // Optional. An optional request ID to identify requests. Specify a unique + // request ID so that if you must retry your request, the server will know to + // ignore the request if it has already been completed. The server will + // guarantee that for at least 60 minutes after the first request. + // + // For example, consider a situation where you make an initial request and + // the request times out. If you make the request again with the same request + // ID, the server can check if original operation with the same request ID + // was received, and if so, will ignore the second request. This prevents + // clients from accidentally creating duplicate commitments. + // + // The request ID must be a valid UUID with the exception that zero UUID is + // not supported (00000000-0000-0000-0000-000000000000). + string request_id = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If set, the backend validates the request, but doesn't actually + // execute it. + bool validate_only = 3 [(google.api.field_behavior) = OPTIONAL]; +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/Backup.java b/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/Backup.java index d4af5efb2cfb..314d91bf30ef 100644 --- a/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/Backup.java +++ b/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/Backup.java @@ -1076,7 +1076,7 @@ public com.google.protobuf.ByteString getClusterUidBytes() { * *
    * Required. The full resource name of the backup source cluster
-   * (e.g., projects/<project>/locations/<location>/clusters/<cluster_id>).
+   * (e.g., projects/{project}/locations/{region}/clusters/{cluster_id}).
    * 
* * @@ -1102,7 +1102,7 @@ public java.lang.String getClusterName() { * *
    * Required. The full resource name of the backup source cluster
-   * (e.g., projects/<project>/locations/<location>/clusters/<cluster_id>).
+   * (e.g., projects/{project}/locations/{region}/clusters/{cluster_id}).
    * 
* * @@ -3900,7 +3900,7 @@ public Builder setClusterUidBytes(com.google.protobuf.ByteString value) { * *
      * Required. The full resource name of the backup source cluster
-     * (e.g., projects/<project>/locations/<location>/clusters/<cluster_id>).
+     * (e.g., projects/{project}/locations/{region}/clusters/{cluster_id}).
      * 
* * @@ -3925,7 +3925,7 @@ public java.lang.String getClusterName() { * *
      * Required. The full resource name of the backup source cluster
-     * (e.g., projects/<project>/locations/<location>/clusters/<cluster_id>).
+     * (e.g., projects/{project}/locations/{region}/clusters/{cluster_id}).
      * 
* * @@ -3950,7 +3950,7 @@ public com.google.protobuf.ByteString getClusterNameBytes() { * *
      * Required. The full resource name of the backup source cluster
-     * (e.g., projects/<project>/locations/<location>/clusters/<cluster_id>).
+     * (e.g., projects/{project}/locations/{region}/clusters/{cluster_id}).
      * 
* * @@ -3974,7 +3974,7 @@ public Builder setClusterName(java.lang.String value) { * *
      * Required. The full resource name of the backup source cluster
-     * (e.g., projects/<project>/locations/<location>/clusters/<cluster_id>).
+     * (e.g., projects/{project}/locations/{region}/clusters/{cluster_id}).
      * 
* * @@ -3994,7 +3994,7 @@ public Builder clearClusterName() { * *
      * Required. The full resource name of the backup source cluster
-     * (e.g., projects/<project>/locations/<location>/clusters/<cluster_id>).
+     * (e.g., projects/{project}/locations/{region}/clusters/{cluster_id}).
      * 
* * diff --git a/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/BackupOrBuilder.java b/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/BackupOrBuilder.java index 8c23d9d157be..7ac7345334d9 100644 --- a/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/BackupOrBuilder.java +++ b/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/BackupOrBuilder.java @@ -399,7 +399,7 @@ java.lang.String getLabelsOrDefault( * *
    * Required. The full resource name of the backup source cluster
-   * (e.g., projects/<project>/locations/<location>/clusters/<cluster_id>).
+   * (e.g., projects/{project}/locations/{region}/clusters/{cluster_id}).
    * 
* * @@ -414,7 +414,7 @@ java.lang.String getLabelsOrDefault( * *
    * Required. The full resource name of the backup source cluster
-   * (e.g., projects/<project>/locations/<location>/clusters/<cluster_id>).
+   * (e.g., projects/{project}/locations/{region}/clusters/{cluster_id}).
    * 
* * diff --git a/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/BatchCreateInstanceStatus.java b/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/BatchCreateInstanceStatus.java index e6535545c366..c3cb8e4b5fe8 100644 --- a/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/BatchCreateInstanceStatus.java +++ b/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/BatchCreateInstanceStatus.java @@ -33,6 +33,7 @@ * 2. Instance2 = ROLLED_BACK * 3. Instance3 = FAILED * 4. Instance4 = FAILED + * * However, while the operation is running, the instance might be in other * states including PENDING_CREATE, ACTIVE, DELETING and CREATING. The states * / do not get further updated once the operation is done. @@ -725,6 +726,7 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build * 2. Instance2 = ROLLED_BACK * 3. Instance3 = FAILED * 4. Instance4 = FAILED + * * However, while the operation is running, the instance might be in other * states including PENDING_CREATE, ACTIVE, DELETING and CREATING. The states * / do not get further updated once the operation is done. diff --git a/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/BatchCreateInstancesMetadata.java b/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/BatchCreateInstancesMetadata.java index e5c3778bf02e..94aff9b605d5 100644 --- a/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/BatchCreateInstancesMetadata.java +++ b/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/BatchCreateInstancesMetadata.java @@ -23,6 +23,7 @@ * *
  * Message for metadata that is specific to BatchCreateInstances API.
+ * NEXT_ID: 3
  * 
* * Protobuf type {@code google.cloud.alloydb.v1alpha.BatchCreateInstancesMetadata} @@ -487,6 +488,7 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build * *
    * Message for metadata that is specific to BatchCreateInstances API.
+   * NEXT_ID: 3
    * 
* * Protobuf type {@code google.cloud.alloydb.v1alpha.BatchCreateInstancesMetadata} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/Cluster.java b/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/Cluster.java index 3f73e8f164b8..68446d853db7 100644 --- a/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/Cluster.java +++ b/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/Cluster.java @@ -570,6 +570,981 @@ private ClusterType(int value) { // @@protoc_insertion_point(enum_scope:google.cloud.alloydb.v1alpha.Cluster.ClusterType) } + public interface NetworkConfigOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.alloydb.v1alpha.Cluster.NetworkConfig) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * 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. It can be updated, but it cannot be
+     * removed.
+     * 
+ * + * + * string network = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The network. + */ + java.lang.String getNetwork(); + /** + * + * + *
+     * 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. It can be updated, but it cannot be
+     * removed.
+     * 
+ * + * + * string network = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for network. + */ + com.google.protobuf.ByteString getNetworkBytes(); + + /** + * + * + *
+     * Optional. The 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.
+     * 
+ * + * string allocated_ip_range = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The allocatedIpRange. + */ + java.lang.String getAllocatedIpRange(); + /** + * + * + *
+     * Optional. The 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.
+     * 
+ * + * string allocated_ip_range = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for allocatedIpRange. + */ + com.google.protobuf.ByteString getAllocatedIpRangeBytes(); + } + /** + * + * + *
+   * Metadata related to network configuration.
+   * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1alpha.Cluster.NetworkConfig} + */ + public static final class NetworkConfig extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.alloydb.v1alpha.Cluster.NetworkConfig) + NetworkConfigOrBuilder { + private static final long serialVersionUID = 0L; + // Use NetworkConfig.newBuilder() to construct. + private NetworkConfig(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private NetworkConfig() { + network_ = ""; + allocatedIpRange_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new NetworkConfig(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.alloydb.v1alpha.ResourcesProto + .internal_static_google_cloud_alloydb_v1alpha_Cluster_NetworkConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1alpha.ResourcesProto + .internal_static_google_cloud_alloydb_v1alpha_Cluster_NetworkConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1alpha.Cluster.NetworkConfig.class, + com.google.cloud.alloydb.v1alpha.Cluster.NetworkConfig.Builder.class); + } + + public static final int NETWORK_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object 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. It can be updated, but it cannot be
+     * removed.
+     * 
+ * + * + * string network = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The network. + */ + @java.lang.Override + public java.lang.String getNetwork() { + java.lang.Object ref = network_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + network_ = s; + return s; + } + } + /** + * + * + *
+     * 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. It can be updated, but it cannot be
+     * removed.
+     * 
+ * + * + * string network = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for network. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNetworkBytes() { + java.lang.Object ref = network_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + network_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ALLOCATED_IP_RANGE_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object allocatedIpRange_ = ""; + /** + * + * + *
+     * Optional. The 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.
+     * 
+ * + * string allocated_ip_range = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The allocatedIpRange. + */ + @java.lang.Override + public java.lang.String getAllocatedIpRange() { + java.lang.Object ref = allocatedIpRange_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + allocatedIpRange_ = s; + return s; + } + } + /** + * + * + *
+     * Optional. The 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.
+     * 
+ * + * string allocated_ip_range = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for allocatedIpRange. + */ + @java.lang.Override + public com.google.protobuf.ByteString getAllocatedIpRangeBytes() { + java.lang.Object ref = allocatedIpRange_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + allocatedIpRange_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(network_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, network_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(allocatedIpRange_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, allocatedIpRange_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(network_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, network_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(allocatedIpRange_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, allocatedIpRange_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.alloydb.v1alpha.Cluster.NetworkConfig)) { + return super.equals(obj); + } + com.google.cloud.alloydb.v1alpha.Cluster.NetworkConfig other = + (com.google.cloud.alloydb.v1alpha.Cluster.NetworkConfig) obj; + + if (!getNetwork().equals(other.getNetwork())) return false; + if (!getAllocatedIpRange().equals(other.getAllocatedIpRange())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NETWORK_FIELD_NUMBER; + hash = (53 * hash) + getNetwork().hashCode(); + hash = (37 * hash) + ALLOCATED_IP_RANGE_FIELD_NUMBER; + hash = (53 * hash) + getAllocatedIpRange().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.alloydb.v1alpha.Cluster.NetworkConfig parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1alpha.Cluster.NetworkConfig parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.alloydb.v1alpha.Cluster.NetworkConfig parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1alpha.Cluster.NetworkConfig parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.alloydb.v1alpha.Cluster.NetworkConfig parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1alpha.Cluster.NetworkConfig parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.alloydb.v1alpha.Cluster.NetworkConfig parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1alpha.Cluster.NetworkConfig parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.alloydb.v1alpha.Cluster.NetworkConfig parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1alpha.Cluster.NetworkConfig parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.alloydb.v1alpha.Cluster.NetworkConfig parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1alpha.Cluster.NetworkConfig parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.alloydb.v1alpha.Cluster.NetworkConfig prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+     * Metadata related to network configuration.
+     * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1alpha.Cluster.NetworkConfig} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.alloydb.v1alpha.Cluster.NetworkConfig) + com.google.cloud.alloydb.v1alpha.Cluster.NetworkConfigOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.alloydb.v1alpha.ResourcesProto + .internal_static_google_cloud_alloydb_v1alpha_Cluster_NetworkConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1alpha.ResourcesProto + .internal_static_google_cloud_alloydb_v1alpha_Cluster_NetworkConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1alpha.Cluster.NetworkConfig.class, + com.google.cloud.alloydb.v1alpha.Cluster.NetworkConfig.Builder.class); + } + + // Construct using com.google.cloud.alloydb.v1alpha.Cluster.NetworkConfig.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + network_ = ""; + allocatedIpRange_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.alloydb.v1alpha.ResourcesProto + .internal_static_google_cloud_alloydb_v1alpha_Cluster_NetworkConfig_descriptor; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.Cluster.NetworkConfig getDefaultInstanceForType() { + return com.google.cloud.alloydb.v1alpha.Cluster.NetworkConfig.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.Cluster.NetworkConfig build() { + com.google.cloud.alloydb.v1alpha.Cluster.NetworkConfig result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.Cluster.NetworkConfig buildPartial() { + com.google.cloud.alloydb.v1alpha.Cluster.NetworkConfig result = + new com.google.cloud.alloydb.v1alpha.Cluster.NetworkConfig(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.alloydb.v1alpha.Cluster.NetworkConfig result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.network_ = network_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.allocatedIpRange_ = allocatedIpRange_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, + java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.alloydb.v1alpha.Cluster.NetworkConfig) { + return mergeFrom((com.google.cloud.alloydb.v1alpha.Cluster.NetworkConfig) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.alloydb.v1alpha.Cluster.NetworkConfig other) { + if (other == com.google.cloud.alloydb.v1alpha.Cluster.NetworkConfig.getDefaultInstance()) + return this; + if (!other.getNetwork().isEmpty()) { + network_ = other.network_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getAllocatedIpRange().isEmpty()) { + allocatedIpRange_ = other.allocatedIpRange_; + bitField0_ |= 0x00000002; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + network_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + allocatedIpRange_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object 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. It can be updated, but it cannot be
+       * removed.
+       * 
+ * + * + * string network = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The network. + */ + public java.lang.String getNetwork() { + java.lang.Object ref = network_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + network_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+       * 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. It can be updated, but it cannot be
+       * removed.
+       * 
+ * + * + * string network = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for network. + */ + public com.google.protobuf.ByteString getNetworkBytes() { + java.lang.Object ref = network_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + network_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+       * 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. It can be updated, but it cannot be
+       * removed.
+       * 
+ * + * + * string network = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The network to set. + * @return This builder for chaining. + */ + public Builder setNetwork(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + network_ = value; + bitField0_ |= 0x00000001; + onChanged(); + 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_number}/global/networks/{network_id}". This is
+       * required to create a cluster. It can be updated, but it cannot be
+       * removed.
+       * 
+ * + * + * string network = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearNetwork() { + network_ = getDefaultInstance().getNetwork(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + 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_number}/global/networks/{network_id}". This is
+       * required to create a cluster. It can be updated, but it cannot be
+       * removed.
+       * 
+ * + * + * string network = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for network to set. + * @return This builder for chaining. + */ + public Builder setNetworkBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + network_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object allocatedIpRange_ = ""; + /** + * + * + *
+       * Optional. The 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.
+       * 
+ * + * string allocated_ip_range = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The allocatedIpRange. + */ + public java.lang.String getAllocatedIpRange() { + java.lang.Object ref = allocatedIpRange_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + allocatedIpRange_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+       * Optional. The 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.
+       * 
+ * + * string allocated_ip_range = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for allocatedIpRange. + */ + public com.google.protobuf.ByteString getAllocatedIpRangeBytes() { + java.lang.Object ref = allocatedIpRange_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + allocatedIpRange_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+       * Optional. The 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.
+       * 
+ * + * string allocated_ip_range = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The allocatedIpRange to set. + * @return This builder for chaining. + */ + public Builder setAllocatedIpRange(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + allocatedIpRange_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+       * Optional. The 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.
+       * 
+ * + * string allocated_ip_range = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearAllocatedIpRange() { + allocatedIpRange_ = getDefaultInstance().getAllocatedIpRange(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+       * Optional. The 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.
+       * 
+ * + * string allocated_ip_range = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for allocatedIpRange to set. + * @return This builder for chaining. + */ + public Builder setAllocatedIpRangeBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + allocatedIpRange_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.alloydb.v1alpha.Cluster.NetworkConfig) + } + + // @@protoc_insertion_point(class_scope:google.cloud.alloydb.v1alpha.Cluster.NetworkConfig) + private static final com.google.cloud.alloydb.v1alpha.Cluster.NetworkConfig DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.alloydb.v1alpha.Cluster.NetworkConfig(); + } + + public static com.google.cloud.alloydb.v1alpha.Cluster.NetworkConfig getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public NetworkConfig parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.Cluster.NetworkConfig getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + public interface SecondaryConfigOrBuilder extends // @@protoc_insertion_point(interface_extends:google.cloud.alloydb.v1alpha.Cluster.SecondaryConfig) @@ -2750,6 +3725,45 @@ public com.google.cloud.alloydb.v1alpha.DatabaseVersion getDatabaseVersion() { return result == null ? com.google.cloud.alloydb.v1alpha.DatabaseVersion.UNRECOGNIZED : result; } + public static final int NETWORK_CONFIG_FIELD_NUMBER = 29; + private com.google.cloud.alloydb.v1alpha.Cluster.NetworkConfig networkConfig_; + /** + * + * .google.cloud.alloydb.v1alpha.Cluster.NetworkConfig network_config = 29 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the networkConfig field is set. + */ + @java.lang.Override + public boolean hasNetworkConfig() { + return networkConfig_ != null; + } + /** + * + * .google.cloud.alloydb.v1alpha.Cluster.NetworkConfig network_config = 29 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The networkConfig. + */ + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.Cluster.NetworkConfig getNetworkConfig() { + return networkConfig_ == null + ? com.google.cloud.alloydb.v1alpha.Cluster.NetworkConfig.getDefaultInstance() + : networkConfig_; + } + /** + * + * .google.cloud.alloydb.v1alpha.Cluster.NetworkConfig network_config = 29 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.Cluster.NetworkConfigOrBuilder + getNetworkConfigOrBuilder() { + return networkConfig_ == null + ? com.google.cloud.alloydb.v1alpha.Cluster.NetworkConfig.getDefaultInstance() + : networkConfig_; + } + public static final int NETWORK_FIELD_NUMBER = 10; @SuppressWarnings("serial") @@ -3131,14 +4145,17 @@ public com.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy getAutomatedBackup * * *
-   * SSL configuration for this AlloyDB Cluster.
+   * SSL configuration for this AlloyDB cluster.
    * 
* - * .google.cloud.alloydb.v1alpha.SslConfig ssl_config = 18; + * .google.cloud.alloydb.v1alpha.SslConfig ssl_config = 18 [deprecated = true]; * + * @deprecated google.cloud.alloydb.v1alpha.Cluster.ssl_config is deprecated. See + * google/cloud/alloydb/v1alpha/resources.proto;l=578 * @return Whether the sslConfig field is set. */ @java.lang.Override + @java.lang.Deprecated public boolean hasSslConfig() { return sslConfig_ != null; } @@ -3146,14 +4163,17 @@ public boolean hasSslConfig() { * * *
-   * SSL configuration for this AlloyDB Cluster.
+   * SSL configuration for this AlloyDB cluster.
    * 
* - * .google.cloud.alloydb.v1alpha.SslConfig ssl_config = 18; + * .google.cloud.alloydb.v1alpha.SslConfig ssl_config = 18 [deprecated = true]; * + * @deprecated google.cloud.alloydb.v1alpha.Cluster.ssl_config is deprecated. See + * google/cloud/alloydb/v1alpha/resources.proto;l=578 * @return The sslConfig. */ @java.lang.Override + @java.lang.Deprecated public com.google.cloud.alloydb.v1alpha.SslConfig getSslConfig() { return sslConfig_ == null ? com.google.cloud.alloydb.v1alpha.SslConfig.getDefaultInstance() @@ -3163,12 +4183,13 @@ public com.google.cloud.alloydb.v1alpha.SslConfig getSslConfig() { * * *
-   * SSL configuration for this AlloyDB Cluster.
+   * SSL configuration for this AlloyDB cluster.
    * 
* - * .google.cloud.alloydb.v1alpha.SslConfig ssl_config = 18; + * .google.cloud.alloydb.v1alpha.SslConfig ssl_config = 18 [deprecated = true]; */ @java.lang.Override + @java.lang.Deprecated public com.google.cloud.alloydb.v1alpha.SslConfigOrBuilder getSslConfigOrBuilder() { return sslConfig_ == null ? com.google.cloud.alloydb.v1alpha.SslConfig.getDefaultInstance() @@ -3612,6 +4633,9 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (continuousBackupInfo_ != null) { output.writeMessage(28, getContinuousBackupInfo()); } + if (networkConfig_ != null) { + output.writeMessage(29, getNetworkConfig()); + } getUnknownFields().writeTo(output); } @@ -3721,6 +4745,9 @@ public int getSerializedSize() { size += com.google.protobuf.CodedOutputStream.computeMessageSize(28, getContinuousBackupInfo()); } + if (networkConfig_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(29, getNetworkConfig()); + } size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; @@ -3755,6 +4782,10 @@ public boolean equals(final java.lang.Object obj) { if (state_ != other.state_) return false; if (clusterType_ != other.clusterType_) return false; if (databaseVersion_ != other.databaseVersion_) return false; + if (hasNetworkConfig() != other.hasNetworkConfig()) return false; + if (hasNetworkConfig()) { + if (!getNetworkConfig().equals(other.getNetworkConfig())) return false; + } if (!getNetwork().equals(other.getNetwork())) return false; if (!getEtag().equals(other.getEtag())) return false; if (!internalGetAnnotations().equals(other.internalGetAnnotations())) return false; @@ -3845,6 +4876,10 @@ public int hashCode() { hash = (53 * hash) + clusterType_; hash = (37 * hash) + DATABASE_VERSION_FIELD_NUMBER; hash = (53 * hash) + databaseVersion_; + if (hasNetworkConfig()) { + hash = (37 * hash) + NETWORK_CONFIG_FIELD_NUMBER; + hash = (53 * hash) + getNetworkConfig().hashCode(); + } hash = (37 * hash) + NETWORK_FIELD_NUMBER; hash = (53 * hash) + getNetwork().hashCode(); hash = (37 * hash) + ETAG_FIELD_NUMBER; @@ -4096,6 +5131,11 @@ public Builder clear() { state_ = 0; clusterType_ = 0; databaseVersion_ = 0; + networkConfig_ = null; + if (networkConfigBuilder_ != null) { + networkConfigBuilder_.dispose(); + networkConfigBuilder_ = null; + } network_ = ""; etag_ = ""; internalGetMutableAnnotations().clear(); @@ -4216,56 +5256,60 @@ private void buildPartial0(com.google.cloud.alloydb.v1alpha.Cluster result) { result.databaseVersion_ = databaseVersion_; } if (((from_bitField0_ & 0x00001000) != 0)) { - result.network_ = network_; + result.networkConfig_ = + networkConfigBuilder_ == null ? networkConfig_ : networkConfigBuilder_.build(); } if (((from_bitField0_ & 0x00002000) != 0)) { - result.etag_ = etag_; + result.network_ = network_; } if (((from_bitField0_ & 0x00004000) != 0)) { + result.etag_ = etag_; + } + if (((from_bitField0_ & 0x00008000) != 0)) { result.annotations_ = internalGetAnnotations(); result.annotations_.makeImmutable(); } - if (((from_bitField0_ & 0x00008000) != 0)) { + if (((from_bitField0_ & 0x00010000) != 0)) { result.reconciling_ = reconciling_; } - if (((from_bitField0_ & 0x00010000) != 0)) { + if (((from_bitField0_ & 0x00020000) != 0)) { result.initialUser_ = initialUserBuilder_ == null ? initialUser_ : initialUserBuilder_.build(); } - if (((from_bitField0_ & 0x00020000) != 0)) { + if (((from_bitField0_ & 0x00040000) != 0)) { result.automatedBackupPolicy_ = automatedBackupPolicyBuilder_ == null ? automatedBackupPolicy_ : automatedBackupPolicyBuilder_.build(); } - if (((from_bitField0_ & 0x00040000) != 0)) { + if (((from_bitField0_ & 0x00080000) != 0)) { result.sslConfig_ = sslConfigBuilder_ == null ? sslConfig_ : sslConfigBuilder_.build(); } - if (((from_bitField0_ & 0x00080000) != 0)) { + if (((from_bitField0_ & 0x00100000) != 0)) { result.encryptionConfig_ = encryptionConfigBuilder_ == null ? encryptionConfig_ : encryptionConfigBuilder_.build(); } - if (((from_bitField0_ & 0x00100000) != 0)) { + if (((from_bitField0_ & 0x00200000) != 0)) { result.encryptionInfo_ = encryptionInfoBuilder_ == null ? encryptionInfo_ : encryptionInfoBuilder_.build(); } - if (((from_bitField0_ & 0x00200000) != 0)) { + if (((from_bitField0_ & 0x00400000) != 0)) { result.continuousBackupConfig_ = continuousBackupConfigBuilder_ == null ? continuousBackupConfig_ : continuousBackupConfigBuilder_.build(); } - if (((from_bitField0_ & 0x00400000) != 0)) { + if (((from_bitField0_ & 0x00800000) != 0)) { result.continuousBackupInfo_ = continuousBackupInfoBuilder_ == null ? continuousBackupInfo_ : continuousBackupInfoBuilder_.build(); } - if (((from_bitField0_ & 0x00800000) != 0)) { + if (((from_bitField0_ & 0x01000000) != 0)) { result.secondaryConfig_ = secondaryConfigBuilder_ == null ? secondaryConfig_ : secondaryConfigBuilder_.build(); } - if (((from_bitField0_ & 0x01000000) != 0)) { + if (((from_bitField0_ & 0x02000000) != 0)) { result.primaryConfig_ = primaryConfigBuilder_ == null ? primaryConfig_ : primaryConfigBuilder_.build(); } @@ -4362,18 +5406,21 @@ public Builder mergeFrom(com.google.cloud.alloydb.v1alpha.Cluster other) { if (other.databaseVersion_ != 0) { setDatabaseVersionValue(other.getDatabaseVersionValue()); } + if (other.hasNetworkConfig()) { + mergeNetworkConfig(other.getNetworkConfig()); + } if (!other.getNetwork().isEmpty()) { network_ = other.network_; - bitField0_ |= 0x00001000; + bitField0_ |= 0x00002000; onChanged(); } if (!other.getEtag().isEmpty()) { etag_ = other.etag_; - bitField0_ |= 0x00002000; + bitField0_ |= 0x00004000; onChanged(); } internalGetMutableAnnotations().mergeFrom(other.internalGetAnnotations()); - bitField0_ |= 0x00004000; + bitField0_ |= 0x00008000; if (other.getReconciling() != false) { setReconciling(other.getReconciling()); } @@ -4509,13 +5556,13 @@ public Builder mergeFrom( case 82: { network_ = input.readStringRequireUtf8(); - bitField0_ |= 0x00001000; + bitField0_ |= 0x00002000; break; } // case 82 case 90: { etag_ = input.readStringRequireUtf8(); - bitField0_ |= 0x00002000; + bitField0_ |= 0x00004000; break; } // case 90 case 98: @@ -4527,19 +5574,19 @@ public Builder mergeFrom( internalGetMutableAnnotations() .getMutableMap() .put(annotations__.getKey(), annotations__.getValue()); - bitField0_ |= 0x00004000; + bitField0_ |= 0x00008000; break; } // case 98 case 104: { reconciling_ = input.readBool(); - bitField0_ |= 0x00008000; + bitField0_ |= 0x00010000; break; } // case 104 case 114: { input.readMessage(getInitialUserFieldBuilder().getBuilder(), extensionRegistry); - bitField0_ |= 0x00010000; + bitField0_ |= 0x00020000; break; } // case 114 case 122: @@ -4558,38 +5605,38 @@ public Builder mergeFrom( { input.readMessage( getAutomatedBackupPolicyFieldBuilder().getBuilder(), extensionRegistry); - bitField0_ |= 0x00020000; + bitField0_ |= 0x00040000; break; } // case 138 case 146: { input.readMessage(getSslConfigFieldBuilder().getBuilder(), extensionRegistry); - bitField0_ |= 0x00040000; + bitField0_ |= 0x00080000; break; } // case 146 case 154: { input.readMessage( getEncryptionConfigFieldBuilder().getBuilder(), extensionRegistry); - bitField0_ |= 0x00080000; + bitField0_ |= 0x00100000; break; } // case 154 case 162: { input.readMessage(getEncryptionInfoFieldBuilder().getBuilder(), extensionRegistry); - bitField0_ |= 0x00100000; + bitField0_ |= 0x00200000; break; } // case 162 case 178: { input.readMessage(getSecondaryConfigFieldBuilder().getBuilder(), extensionRegistry); - bitField0_ |= 0x00800000; + bitField0_ |= 0x01000000; break; } // case 178 case 186: { input.readMessage(getPrimaryConfigFieldBuilder().getBuilder(), extensionRegistry); - bitField0_ |= 0x01000000; + bitField0_ |= 0x02000000; break; } // case 186 case 192: @@ -4602,16 +5649,22 @@ public Builder mergeFrom( { input.readMessage( getContinuousBackupConfigFieldBuilder().getBuilder(), extensionRegistry); - bitField0_ |= 0x00200000; + bitField0_ |= 0x00400000; break; } // case 218 case 226: { input.readMessage( getContinuousBackupInfoFieldBuilder().getBuilder(), extensionRegistry); - bitField0_ |= 0x00400000; + bitField0_ |= 0x00800000; break; } // case 226 + case 234: + { + input.readMessage(getNetworkConfigFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00001000; + break; + } // case 234 default: { if (!super.parseUnknownField(input, extensionRegistry, tag)) { @@ -6542,6 +7595,158 @@ public Builder clearDatabaseVersion() { return this; } + private com.google.cloud.alloydb.v1alpha.Cluster.NetworkConfig networkConfig_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1alpha.Cluster.NetworkConfig, + com.google.cloud.alloydb.v1alpha.Cluster.NetworkConfig.Builder, + com.google.cloud.alloydb.v1alpha.Cluster.NetworkConfigOrBuilder> + networkConfigBuilder_; + /** + * + * .google.cloud.alloydb.v1alpha.Cluster.NetworkConfig network_config = 29 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the networkConfig field is set. + */ + public boolean hasNetworkConfig() { + return ((bitField0_ & 0x00001000) != 0); + } + /** + * + * .google.cloud.alloydb.v1alpha.Cluster.NetworkConfig network_config = 29 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The networkConfig. + */ + public com.google.cloud.alloydb.v1alpha.Cluster.NetworkConfig getNetworkConfig() { + if (networkConfigBuilder_ == null) { + return networkConfig_ == null + ? com.google.cloud.alloydb.v1alpha.Cluster.NetworkConfig.getDefaultInstance() + : networkConfig_; + } else { + return networkConfigBuilder_.getMessage(); + } + } + /** + * + * .google.cloud.alloydb.v1alpha.Cluster.NetworkConfig network_config = 29 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setNetworkConfig(com.google.cloud.alloydb.v1alpha.Cluster.NetworkConfig value) { + if (networkConfigBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + networkConfig_ = value; + } else { + networkConfigBuilder_.setMessage(value); + } + bitField0_ |= 0x00001000; + onChanged(); + return this; + } + /** + * + * .google.cloud.alloydb.v1alpha.Cluster.NetworkConfig network_config = 29 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setNetworkConfig( + com.google.cloud.alloydb.v1alpha.Cluster.NetworkConfig.Builder builderForValue) { + if (networkConfigBuilder_ == null) { + networkConfig_ = builderForValue.build(); + } else { + networkConfigBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00001000; + onChanged(); + return this; + } + /** + * + * .google.cloud.alloydb.v1alpha.Cluster.NetworkConfig network_config = 29 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder mergeNetworkConfig( + com.google.cloud.alloydb.v1alpha.Cluster.NetworkConfig value) { + if (networkConfigBuilder_ == null) { + if (((bitField0_ & 0x00001000) != 0) + && networkConfig_ != null + && networkConfig_ + != com.google.cloud.alloydb.v1alpha.Cluster.NetworkConfig.getDefaultInstance()) { + getNetworkConfigBuilder().mergeFrom(value); + } else { + networkConfig_ = value; + } + } else { + networkConfigBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00001000; + onChanged(); + return this; + } + /** + * + * .google.cloud.alloydb.v1alpha.Cluster.NetworkConfig network_config = 29 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder clearNetworkConfig() { + bitField0_ = (bitField0_ & ~0x00001000); + networkConfig_ = null; + if (networkConfigBuilder_ != null) { + networkConfigBuilder_.dispose(); + networkConfigBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * .google.cloud.alloydb.v1alpha.Cluster.NetworkConfig network_config = 29 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.alloydb.v1alpha.Cluster.NetworkConfig.Builder + getNetworkConfigBuilder() { + bitField0_ |= 0x00001000; + onChanged(); + return getNetworkConfigFieldBuilder().getBuilder(); + } + /** + * + * .google.cloud.alloydb.v1alpha.Cluster.NetworkConfig network_config = 29 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.alloydb.v1alpha.Cluster.NetworkConfigOrBuilder + getNetworkConfigOrBuilder() { + if (networkConfigBuilder_ != null) { + return networkConfigBuilder_.getMessageOrBuilder(); + } else { + return networkConfig_ == null + ? com.google.cloud.alloydb.v1alpha.Cluster.NetworkConfig.getDefaultInstance() + : networkConfig_; + } + } + /** + * + * .google.cloud.alloydb.v1alpha.Cluster.NetworkConfig network_config = 29 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1alpha.Cluster.NetworkConfig, + com.google.cloud.alloydb.v1alpha.Cluster.NetworkConfig.Builder, + com.google.cloud.alloydb.v1alpha.Cluster.NetworkConfigOrBuilder> + getNetworkConfigFieldBuilder() { + if (networkConfigBuilder_ == null) { + networkConfigBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1alpha.Cluster.NetworkConfig, + com.google.cloud.alloydb.v1alpha.Cluster.NetworkConfig.Builder, + com.google.cloud.alloydb.v1alpha.Cluster.NetworkConfigOrBuilder>( + getNetworkConfig(), getParentForChildren(), isClean()); + networkConfig_ = null; + } + return networkConfigBuilder_; + } + private java.lang.Object network_ = ""; /** * @@ -6622,7 +7827,7 @@ public Builder setNetwork(java.lang.String value) { throw new NullPointerException(); } network_ = value; - bitField0_ |= 0x00001000; + bitField0_ |= 0x00002000; onChanged(); return this; } @@ -6645,7 +7850,7 @@ public Builder setNetwork(java.lang.String value) { */ public Builder clearNetwork() { network_ = getDefaultInstance().getNetwork(); - bitField0_ = (bitField0_ & ~0x00001000); + bitField0_ = (bitField0_ & ~0x00002000); onChanged(); return this; } @@ -6673,7 +7878,7 @@ public Builder setNetworkBytes(com.google.protobuf.ByteString value) { } checkByteStringIsUtf8(value); network_ = value; - bitField0_ |= 0x00001000; + bitField0_ |= 0x00002000; onChanged(); return this; } @@ -6740,7 +7945,7 @@ public Builder setEtag(java.lang.String value) { throw new NullPointerException(); } etag_ = value; - bitField0_ |= 0x00002000; + bitField0_ |= 0x00004000; onChanged(); return this; } @@ -6757,7 +7962,7 @@ public Builder setEtag(java.lang.String value) { */ public Builder clearEtag() { etag_ = getDefaultInstance().getEtag(); - bitField0_ = (bitField0_ & ~0x00002000); + bitField0_ = (bitField0_ & ~0x00004000); onChanged(); return this; } @@ -6779,7 +7984,7 @@ public Builder setEtagBytes(com.google.protobuf.ByteString value) { } checkByteStringIsUtf8(value); etag_ = value; - bitField0_ |= 0x00002000; + bitField0_ |= 0x00004000; onChanged(); return this; } @@ -6804,7 +8009,7 @@ public Builder setEtagBytes(com.google.protobuf.ByteString value) { if (!annotations_.isMutable()) { annotations_ = annotations_.copy(); } - bitField0_ |= 0x00004000; + bitField0_ |= 0x00008000; onChanged(); return annotations_; } @@ -6897,7 +8102,7 @@ public java.lang.String getAnnotationsOrThrow(java.lang.String key) { } public Builder clearAnnotations() { - bitField0_ = (bitField0_ & ~0x00004000); + bitField0_ = (bitField0_ & ~0x00008000); internalGetMutableAnnotations().getMutableMap().clear(); return this; } @@ -6922,7 +8127,7 @@ public Builder removeAnnotations(java.lang.String key) { /** Use alternate mutation accessors instead. */ @java.lang.Deprecated public java.util.Map getMutableAnnotations() { - bitField0_ |= 0x00004000; + bitField0_ |= 0x00008000; return internalGetMutableAnnotations().getMutableMap(); } /** @@ -6944,7 +8149,7 @@ public Builder putAnnotations(java.lang.String key, java.lang.String value) { throw new NullPointerException("map value"); } internalGetMutableAnnotations().getMutableMap().put(key, value); - bitField0_ |= 0x00004000; + bitField0_ |= 0x00008000; return this; } /** @@ -6960,7 +8165,7 @@ public Builder putAnnotations(java.lang.String key, java.lang.String value) { */ public Builder putAllAnnotations(java.util.Map values) { internalGetMutableAnnotations().getMutableMap().putAll(values); - bitField0_ |= 0x00004000; + bitField0_ |= 0x00008000; return this; } @@ -7003,7 +8208,7 @@ public boolean getReconciling() { public Builder setReconciling(boolean value) { reconciling_ = value; - bitField0_ |= 0x00008000; + bitField0_ |= 0x00010000; onChanged(); return this; } @@ -7023,7 +8228,7 @@ public Builder setReconciling(boolean value) { * @return This builder for chaining. */ public Builder clearReconciling() { - bitField0_ = (bitField0_ & ~0x00008000); + bitField0_ = (bitField0_ & ~0x00010000); reconciling_ = false; onChanged(); return this; @@ -7050,7 +8255,7 @@ public Builder clearReconciling() { * @return Whether the initialUser field is set. */ public boolean hasInitialUser() { - return ((bitField0_ & 0x00010000) != 0); + return ((bitField0_ & 0x00020000) != 0); } /** * @@ -7096,7 +8301,7 @@ public Builder setInitialUser(com.google.cloud.alloydb.v1alpha.UserPassword valu } else { initialUserBuilder_.setMessage(value); } - bitField0_ |= 0x00010000; + bitField0_ |= 0x00020000; onChanged(); return this; } @@ -7119,7 +8324,7 @@ public Builder setInitialUser( } else { initialUserBuilder_.setMessage(builderForValue.build()); } - bitField0_ |= 0x00010000; + bitField0_ |= 0x00020000; onChanged(); return this; } @@ -7137,7 +8342,7 @@ public Builder setInitialUser( */ public Builder mergeInitialUser(com.google.cloud.alloydb.v1alpha.UserPassword value) { if (initialUserBuilder_ == null) { - if (((bitField0_ & 0x00010000) != 0) + if (((bitField0_ & 0x00020000) != 0) && initialUser_ != null && initialUser_ != com.google.cloud.alloydb.v1alpha.UserPassword.getDefaultInstance()) { getInitialUserBuilder().mergeFrom(value); @@ -7147,7 +8352,7 @@ public Builder mergeInitialUser(com.google.cloud.alloydb.v1alpha.UserPassword va } else { initialUserBuilder_.mergeFrom(value); } - bitField0_ |= 0x00010000; + bitField0_ |= 0x00020000; onChanged(); return this; } @@ -7164,7 +8369,7 @@ public Builder mergeInitialUser(com.google.cloud.alloydb.v1alpha.UserPassword va *
*/ public Builder clearInitialUser() { - bitField0_ = (bitField0_ & ~0x00010000); + bitField0_ = (bitField0_ & ~0x00020000); initialUser_ = null; if (initialUserBuilder_ != null) { initialUserBuilder_.dispose(); @@ -7186,7 +8391,7 @@ public Builder clearInitialUser() { *
*/ public com.google.cloud.alloydb.v1alpha.UserPassword.Builder getInitialUserBuilder() { - bitField0_ |= 0x00010000; + bitField0_ |= 0x00020000; onChanged(); return getInitialUserFieldBuilder().getBuilder(); } @@ -7265,7 +8470,7 @@ public com.google.cloud.alloydb.v1alpha.UserPasswordOrBuilder getInitialUserOrBu * @return Whether the automatedBackupPolicy field is set. */ public boolean hasAutomatedBackupPolicy() { - return ((bitField0_ & 0x00020000) != 0); + return ((bitField0_ & 0x00040000) != 0); } /** * @@ -7320,7 +8525,7 @@ public Builder setAutomatedBackupPolicy( } else { automatedBackupPolicyBuilder_.setMessage(value); } - bitField0_ |= 0x00020000; + bitField0_ |= 0x00040000; onChanged(); return this; } @@ -7347,7 +8552,7 @@ public Builder setAutomatedBackupPolicy( } else { automatedBackupPolicyBuilder_.setMessage(builderForValue.build()); } - bitField0_ |= 0x00020000; + bitField0_ |= 0x00040000; onChanged(); return this; } @@ -7370,7 +8575,7 @@ public Builder setAutomatedBackupPolicy( public Builder mergeAutomatedBackupPolicy( com.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy value) { if (automatedBackupPolicyBuilder_ == null) { - if (((bitField0_ & 0x00020000) != 0) + if (((bitField0_ & 0x00040000) != 0) && automatedBackupPolicy_ != null && automatedBackupPolicy_ != com.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.getDefaultInstance()) { @@ -7381,7 +8586,7 @@ public Builder mergeAutomatedBackupPolicy( } else { automatedBackupPolicyBuilder_.mergeFrom(value); } - bitField0_ |= 0x00020000; + bitField0_ |= 0x00040000; onChanged(); return this; } @@ -7402,7 +8607,7 @@ public Builder mergeAutomatedBackupPolicy( *
*/ public Builder clearAutomatedBackupPolicy() { - bitField0_ = (bitField0_ & ~0x00020000); + bitField0_ = (bitField0_ & ~0x00040000); automatedBackupPolicy_ = null; if (automatedBackupPolicyBuilder_ != null) { automatedBackupPolicyBuilder_.dispose(); @@ -7429,7 +8634,7 @@ public Builder clearAutomatedBackupPolicy() { */ public com.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.Builder getAutomatedBackupPolicyBuilder() { - bitField0_ |= 0x00020000; + bitField0_ |= 0x00040000; onChanged(); return getAutomatedBackupPolicyFieldBuilder().getBuilder(); } @@ -7502,27 +8707,33 @@ public Builder clearAutomatedBackupPolicy() { * * *
-     * SSL configuration for this AlloyDB Cluster.
+     * SSL configuration for this AlloyDB cluster.
      * 
* - * .google.cloud.alloydb.v1alpha.SslConfig ssl_config = 18; + * .google.cloud.alloydb.v1alpha.SslConfig ssl_config = 18 [deprecated = true]; * + * @deprecated google.cloud.alloydb.v1alpha.Cluster.ssl_config is deprecated. See + * google/cloud/alloydb/v1alpha/resources.proto;l=578 * @return Whether the sslConfig field is set. */ + @java.lang.Deprecated public boolean hasSslConfig() { - return ((bitField0_ & 0x00040000) != 0); + return ((bitField0_ & 0x00080000) != 0); } /** * * *
-     * SSL configuration for this AlloyDB Cluster.
+     * SSL configuration for this AlloyDB cluster.
      * 
* - * .google.cloud.alloydb.v1alpha.SslConfig ssl_config = 18; + * .google.cloud.alloydb.v1alpha.SslConfig ssl_config = 18 [deprecated = true]; * + * @deprecated google.cloud.alloydb.v1alpha.Cluster.ssl_config is deprecated. See + * google/cloud/alloydb/v1alpha/resources.proto;l=578 * @return The sslConfig. */ + @java.lang.Deprecated public com.google.cloud.alloydb.v1alpha.SslConfig getSslConfig() { if (sslConfigBuilder_ == null) { return sslConfig_ == null @@ -7536,11 +8747,12 @@ public com.google.cloud.alloydb.v1alpha.SslConfig getSslConfig() { * * *
-     * SSL configuration for this AlloyDB Cluster.
+     * SSL configuration for this AlloyDB cluster.
      * 
* - * .google.cloud.alloydb.v1alpha.SslConfig ssl_config = 18; + * .google.cloud.alloydb.v1alpha.SslConfig ssl_config = 18 [deprecated = true]; */ + @java.lang.Deprecated public Builder setSslConfig(com.google.cloud.alloydb.v1alpha.SslConfig value) { if (sslConfigBuilder_ == null) { if (value == null) { @@ -7550,7 +8762,7 @@ public Builder setSslConfig(com.google.cloud.alloydb.v1alpha.SslConfig value) { } else { sslConfigBuilder_.setMessage(value); } - bitField0_ |= 0x00040000; + bitField0_ |= 0x00080000; onChanged(); return this; } @@ -7558,11 +8770,12 @@ public Builder setSslConfig(com.google.cloud.alloydb.v1alpha.SslConfig value) { * * *
-     * SSL configuration for this AlloyDB Cluster.
+     * SSL configuration for this AlloyDB cluster.
      * 
* - * .google.cloud.alloydb.v1alpha.SslConfig ssl_config = 18; + * .google.cloud.alloydb.v1alpha.SslConfig ssl_config = 18 [deprecated = true]; */ + @java.lang.Deprecated public Builder setSslConfig( com.google.cloud.alloydb.v1alpha.SslConfig.Builder builderForValue) { if (sslConfigBuilder_ == null) { @@ -7570,7 +8783,7 @@ public Builder setSslConfig( } else { sslConfigBuilder_.setMessage(builderForValue.build()); } - bitField0_ |= 0x00040000; + bitField0_ |= 0x00080000; onChanged(); return this; } @@ -7578,14 +8791,15 @@ public Builder setSslConfig( * * *
-     * SSL configuration for this AlloyDB Cluster.
+     * SSL configuration for this AlloyDB cluster.
      * 
* - * .google.cloud.alloydb.v1alpha.SslConfig ssl_config = 18; + * .google.cloud.alloydb.v1alpha.SslConfig ssl_config = 18 [deprecated = true]; */ + @java.lang.Deprecated public Builder mergeSslConfig(com.google.cloud.alloydb.v1alpha.SslConfig value) { if (sslConfigBuilder_ == null) { - if (((bitField0_ & 0x00040000) != 0) + if (((bitField0_ & 0x00080000) != 0) && sslConfig_ != null && sslConfig_ != com.google.cloud.alloydb.v1alpha.SslConfig.getDefaultInstance()) { getSslConfigBuilder().mergeFrom(value); @@ -7595,7 +8809,7 @@ public Builder mergeSslConfig(com.google.cloud.alloydb.v1alpha.SslConfig value) } else { sslConfigBuilder_.mergeFrom(value); } - bitField0_ |= 0x00040000; + bitField0_ |= 0x00080000; onChanged(); return this; } @@ -7603,13 +8817,14 @@ public Builder mergeSslConfig(com.google.cloud.alloydb.v1alpha.SslConfig value) * * *
-     * SSL configuration for this AlloyDB Cluster.
+     * SSL configuration for this AlloyDB cluster.
      * 
* - * .google.cloud.alloydb.v1alpha.SslConfig ssl_config = 18; + * .google.cloud.alloydb.v1alpha.SslConfig ssl_config = 18 [deprecated = true]; */ + @java.lang.Deprecated public Builder clearSslConfig() { - bitField0_ = (bitField0_ & ~0x00040000); + bitField0_ = (bitField0_ & ~0x00080000); sslConfig_ = null; if (sslConfigBuilder_ != null) { sslConfigBuilder_.dispose(); @@ -7622,13 +8837,14 @@ public Builder clearSslConfig() { * * *
-     * SSL configuration for this AlloyDB Cluster.
+     * SSL configuration for this AlloyDB cluster.
      * 
* - * .google.cloud.alloydb.v1alpha.SslConfig ssl_config = 18; + * .google.cloud.alloydb.v1alpha.SslConfig ssl_config = 18 [deprecated = true]; */ + @java.lang.Deprecated public com.google.cloud.alloydb.v1alpha.SslConfig.Builder getSslConfigBuilder() { - bitField0_ |= 0x00040000; + bitField0_ |= 0x00080000; onChanged(); return getSslConfigFieldBuilder().getBuilder(); } @@ -7636,11 +8852,12 @@ public com.google.cloud.alloydb.v1alpha.SslConfig.Builder getSslConfigBuilder() * * *
-     * SSL configuration for this AlloyDB Cluster.
+     * SSL configuration for this AlloyDB cluster.
      * 
* - * .google.cloud.alloydb.v1alpha.SslConfig ssl_config = 18; + * .google.cloud.alloydb.v1alpha.SslConfig ssl_config = 18 [deprecated = true]; */ + @java.lang.Deprecated public com.google.cloud.alloydb.v1alpha.SslConfigOrBuilder getSslConfigOrBuilder() { if (sslConfigBuilder_ != null) { return sslConfigBuilder_.getMessageOrBuilder(); @@ -7654,10 +8871,10 @@ public com.google.cloud.alloydb.v1alpha.SslConfigOrBuilder getSslConfigOrBuilder * * *
-     * SSL configuration for this AlloyDB Cluster.
+     * SSL configuration for this AlloyDB cluster.
      * 
* - * .google.cloud.alloydb.v1alpha.SslConfig ssl_config = 18; + * .google.cloud.alloydb.v1alpha.SslConfig ssl_config = 18 [deprecated = true]; */ private com.google.protobuf.SingleFieldBuilderV3< com.google.cloud.alloydb.v1alpha.SslConfig, @@ -7700,7 +8917,7 @@ public com.google.cloud.alloydb.v1alpha.SslConfigOrBuilder getSslConfigOrBuilder * @return Whether the encryptionConfig field is set. */ public boolean hasEncryptionConfig() { - return ((bitField0_ & 0x00080000) != 0); + return ((bitField0_ & 0x00100000) != 0); } /** * @@ -7752,7 +8969,7 @@ public Builder setEncryptionConfig(com.google.cloud.alloydb.v1alpha.EncryptionCo } else { encryptionConfigBuilder_.setMessage(value); } - bitField0_ |= 0x00080000; + bitField0_ |= 0x00100000; onChanged(); return this; } @@ -7778,7 +8995,7 @@ public Builder setEncryptionConfig( } else { encryptionConfigBuilder_.setMessage(builderForValue.build()); } - bitField0_ |= 0x00080000; + bitField0_ |= 0x00100000; onChanged(); return this; } @@ -7799,7 +9016,7 @@ public Builder setEncryptionConfig( */ public Builder mergeEncryptionConfig(com.google.cloud.alloydb.v1alpha.EncryptionConfig value) { if (encryptionConfigBuilder_ == null) { - if (((bitField0_ & 0x00080000) != 0) + if (((bitField0_ & 0x00100000) != 0) && encryptionConfig_ != null && encryptionConfig_ != com.google.cloud.alloydb.v1alpha.EncryptionConfig.getDefaultInstance()) { @@ -7810,7 +9027,7 @@ public Builder mergeEncryptionConfig(com.google.cloud.alloydb.v1alpha.Encryption } else { encryptionConfigBuilder_.mergeFrom(value); } - bitField0_ |= 0x00080000; + bitField0_ |= 0x00100000; onChanged(); return this; } @@ -7830,7 +9047,7 @@ public Builder mergeEncryptionConfig(com.google.cloud.alloydb.v1alpha.Encryption *
*/ public Builder clearEncryptionConfig() { - bitField0_ = (bitField0_ & ~0x00080000); + bitField0_ = (bitField0_ & ~0x00100000); encryptionConfig_ = null; if (encryptionConfigBuilder_ != null) { encryptionConfigBuilder_.dispose(); @@ -7855,7 +9072,7 @@ public Builder clearEncryptionConfig() { *
*/ public com.google.cloud.alloydb.v1alpha.EncryptionConfig.Builder getEncryptionConfigBuilder() { - bitField0_ |= 0x00080000; + bitField0_ |= 0x00100000; onChanged(); return getEncryptionConfigFieldBuilder().getBuilder(); } @@ -7936,7 +9153,7 @@ public com.google.cloud.alloydb.v1alpha.EncryptionConfig.Builder getEncryptionCo * @return Whether the encryptionInfo field is set. */ public boolean hasEncryptionInfo() { - return ((bitField0_ & 0x00100000) != 0); + return ((bitField0_ & 0x00200000) != 0); } /** * @@ -7980,7 +9197,7 @@ public Builder setEncryptionInfo(com.google.cloud.alloydb.v1alpha.EncryptionInfo } else { encryptionInfoBuilder_.setMessage(value); } - bitField0_ |= 0x00100000; + bitField0_ |= 0x00200000; onChanged(); return this; } @@ -8002,7 +9219,7 @@ public Builder setEncryptionInfo( } else { encryptionInfoBuilder_.setMessage(builderForValue.build()); } - bitField0_ |= 0x00100000; + bitField0_ |= 0x00200000; onChanged(); return this; } @@ -8019,7 +9236,7 @@ public Builder setEncryptionInfo( */ public Builder mergeEncryptionInfo(com.google.cloud.alloydb.v1alpha.EncryptionInfo value) { if (encryptionInfoBuilder_ == null) { - if (((bitField0_ & 0x00100000) != 0) + if (((bitField0_ & 0x00200000) != 0) && encryptionInfo_ != null && encryptionInfo_ != com.google.cloud.alloydb.v1alpha.EncryptionInfo.getDefaultInstance()) { @@ -8030,7 +9247,7 @@ public Builder mergeEncryptionInfo(com.google.cloud.alloydb.v1alpha.EncryptionIn } else { encryptionInfoBuilder_.mergeFrom(value); } - bitField0_ |= 0x00100000; + bitField0_ |= 0x00200000; onChanged(); return this; } @@ -8046,7 +9263,7 @@ public Builder mergeEncryptionInfo(com.google.cloud.alloydb.v1alpha.EncryptionIn *
*/ public Builder clearEncryptionInfo() { - bitField0_ = (bitField0_ & ~0x00100000); + bitField0_ = (bitField0_ & ~0x00200000); encryptionInfo_ = null; if (encryptionInfoBuilder_ != null) { encryptionInfoBuilder_.dispose(); @@ -8067,7 +9284,7 @@ public Builder clearEncryptionInfo() { *
*/ public com.google.cloud.alloydb.v1alpha.EncryptionInfo.Builder getEncryptionInfoBuilder() { - bitField0_ |= 0x00100000; + bitField0_ |= 0x00200000; onChanged(); return getEncryptionInfoFieldBuilder().getBuilder(); } @@ -8139,7 +9356,7 @@ public com.google.cloud.alloydb.v1alpha.EncryptionInfoOrBuilder getEncryptionInf * @return Whether the continuousBackupConfig field is set. */ public boolean hasContinuousBackupConfig() { - return ((bitField0_ & 0x00200000) != 0); + return ((bitField0_ & 0x00400000) != 0); } /** * @@ -8184,7 +9401,7 @@ public Builder setContinuousBackupConfig( } else { continuousBackupConfigBuilder_.setMessage(value); } - bitField0_ |= 0x00200000; + bitField0_ |= 0x00400000; onChanged(); return this; } @@ -8206,7 +9423,7 @@ public Builder setContinuousBackupConfig( } else { continuousBackupConfigBuilder_.setMessage(builderForValue.build()); } - bitField0_ |= 0x00200000; + bitField0_ |= 0x00400000; onChanged(); return this; } @@ -8224,7 +9441,7 @@ public Builder setContinuousBackupConfig( public Builder mergeContinuousBackupConfig( com.google.cloud.alloydb.v1alpha.ContinuousBackupConfig value) { if (continuousBackupConfigBuilder_ == null) { - if (((bitField0_ & 0x00200000) != 0) + if (((bitField0_ & 0x00400000) != 0) && continuousBackupConfig_ != null && continuousBackupConfig_ != com.google.cloud.alloydb.v1alpha.ContinuousBackupConfig.getDefaultInstance()) { @@ -8235,7 +9452,7 @@ public Builder mergeContinuousBackupConfig( } else { continuousBackupConfigBuilder_.mergeFrom(value); } - bitField0_ |= 0x00200000; + bitField0_ |= 0x00400000; onChanged(); return this; } @@ -8251,7 +9468,7 @@ public Builder mergeContinuousBackupConfig( *
*/ public Builder clearContinuousBackupConfig() { - bitField0_ = (bitField0_ & ~0x00200000); + bitField0_ = (bitField0_ & ~0x00400000); continuousBackupConfig_ = null; if (continuousBackupConfigBuilder_ != null) { continuousBackupConfigBuilder_.dispose(); @@ -8273,7 +9490,7 @@ public Builder clearContinuousBackupConfig() { */ public com.google.cloud.alloydb.v1alpha.ContinuousBackupConfig.Builder getContinuousBackupConfigBuilder() { - bitField0_ |= 0x00200000; + bitField0_ |= 0x00400000; onChanged(); return getContinuousBackupConfigFieldBuilder().getBuilder(); } @@ -8346,7 +9563,7 @@ public Builder clearContinuousBackupConfig() { * @return Whether the continuousBackupInfo field is set. */ public boolean hasContinuousBackupInfo() { - return ((bitField0_ & 0x00400000) != 0); + return ((bitField0_ & 0x00800000) != 0); } /** * @@ -8391,7 +9608,7 @@ public Builder setContinuousBackupInfo( } else { continuousBackupInfoBuilder_.setMessage(value); } - bitField0_ |= 0x00400000; + bitField0_ |= 0x00800000; onChanged(); return this; } @@ -8413,7 +9630,7 @@ public Builder setContinuousBackupInfo( } else { continuousBackupInfoBuilder_.setMessage(builderForValue.build()); } - bitField0_ |= 0x00400000; + bitField0_ |= 0x00800000; onChanged(); return this; } @@ -8431,7 +9648,7 @@ public Builder setContinuousBackupInfo( public Builder mergeContinuousBackupInfo( com.google.cloud.alloydb.v1alpha.ContinuousBackupInfo value) { if (continuousBackupInfoBuilder_ == null) { - if (((bitField0_ & 0x00400000) != 0) + if (((bitField0_ & 0x00800000) != 0) && continuousBackupInfo_ != null && continuousBackupInfo_ != com.google.cloud.alloydb.v1alpha.ContinuousBackupInfo.getDefaultInstance()) { @@ -8442,7 +9659,7 @@ public Builder mergeContinuousBackupInfo( } else { continuousBackupInfoBuilder_.mergeFrom(value); } - bitField0_ |= 0x00400000; + bitField0_ |= 0x00800000; onChanged(); return this; } @@ -8458,7 +9675,7 @@ public Builder mergeContinuousBackupInfo( *
*/ public Builder clearContinuousBackupInfo() { - bitField0_ = (bitField0_ & ~0x00400000); + bitField0_ = (bitField0_ & ~0x00800000); continuousBackupInfo_ = null; if (continuousBackupInfoBuilder_ != null) { continuousBackupInfoBuilder_.dispose(); @@ -8480,7 +9697,7 @@ public Builder clearContinuousBackupInfo() { */ public com.google.cloud.alloydb.v1alpha.ContinuousBackupInfo.Builder getContinuousBackupInfoBuilder() { - bitField0_ |= 0x00400000; + bitField0_ |= 0x00800000; onChanged(); return getContinuousBackupInfoFieldBuilder().getBuilder(); } @@ -8551,7 +9768,7 @@ public Builder clearContinuousBackupInfo() { * @return Whether the secondaryConfig field is set. */ public boolean hasSecondaryConfig() { - return ((bitField0_ & 0x00800000) != 0); + return ((bitField0_ & 0x01000000) != 0); } /** * @@ -8592,7 +9809,7 @@ public Builder setSecondaryConfig( } else { secondaryConfigBuilder_.setMessage(value); } - bitField0_ |= 0x00800000; + bitField0_ |= 0x01000000; onChanged(); return this; } @@ -8612,7 +9829,7 @@ public Builder setSecondaryConfig( } else { secondaryConfigBuilder_.setMessage(builderForValue.build()); } - bitField0_ |= 0x00800000; + bitField0_ |= 0x01000000; onChanged(); return this; } @@ -8628,7 +9845,7 @@ public Builder setSecondaryConfig( public Builder mergeSecondaryConfig( com.google.cloud.alloydb.v1alpha.Cluster.SecondaryConfig value) { if (secondaryConfigBuilder_ == null) { - if (((bitField0_ & 0x00800000) != 0) + if (((bitField0_ & 0x01000000) != 0) && secondaryConfig_ != null && secondaryConfig_ != com.google.cloud.alloydb.v1alpha.Cluster.SecondaryConfig.getDefaultInstance()) { @@ -8639,7 +9856,7 @@ public Builder mergeSecondaryConfig( } else { secondaryConfigBuilder_.mergeFrom(value); } - bitField0_ |= 0x00800000; + bitField0_ |= 0x01000000; onChanged(); return this; } @@ -8653,7 +9870,7 @@ public Builder mergeSecondaryConfig( * .google.cloud.alloydb.v1alpha.Cluster.SecondaryConfig secondary_config = 22; */ public Builder clearSecondaryConfig() { - bitField0_ = (bitField0_ & ~0x00800000); + bitField0_ = (bitField0_ & ~0x01000000); secondaryConfig_ = null; if (secondaryConfigBuilder_ != null) { secondaryConfigBuilder_.dispose(); @@ -8673,7 +9890,7 @@ public Builder clearSecondaryConfig() { */ public com.google.cloud.alloydb.v1alpha.Cluster.SecondaryConfig.Builder getSecondaryConfigBuilder() { - bitField0_ |= 0x00800000; + bitField0_ |= 0x01000000; onChanged(); return getSecondaryConfigFieldBuilder().getBuilder(); } @@ -8742,7 +9959,7 @@ public Builder clearSecondaryConfig() { * @return Whether the primaryConfig field is set. */ public boolean hasPrimaryConfig() { - return ((bitField0_ & 0x01000000) != 0); + return ((bitField0_ & 0x02000000) != 0); } /** * @@ -8786,7 +10003,7 @@ public Builder setPrimaryConfig(com.google.cloud.alloydb.v1alpha.Cluster.Primary } else { primaryConfigBuilder_.setMessage(value); } - bitField0_ |= 0x01000000; + bitField0_ |= 0x02000000; onChanged(); return this; } @@ -8808,7 +10025,7 @@ public Builder setPrimaryConfig( } else { primaryConfigBuilder_.setMessage(builderForValue.build()); } - bitField0_ |= 0x01000000; + bitField0_ |= 0x02000000; onChanged(); return this; } @@ -8826,7 +10043,7 @@ public Builder setPrimaryConfig( public Builder mergePrimaryConfig( com.google.cloud.alloydb.v1alpha.Cluster.PrimaryConfig value) { if (primaryConfigBuilder_ == null) { - if (((bitField0_ & 0x01000000) != 0) + if (((bitField0_ & 0x02000000) != 0) && primaryConfig_ != null && primaryConfig_ != com.google.cloud.alloydb.v1alpha.Cluster.PrimaryConfig.getDefaultInstance()) { @@ -8837,7 +10054,7 @@ public Builder mergePrimaryConfig( } else { primaryConfigBuilder_.mergeFrom(value); } - bitField0_ |= 0x01000000; + bitField0_ |= 0x02000000; onChanged(); return this; } @@ -8853,7 +10070,7 @@ public Builder mergePrimaryConfig( * */ public Builder clearPrimaryConfig() { - bitField0_ = (bitField0_ & ~0x01000000); + bitField0_ = (bitField0_ & ~0x02000000); primaryConfig_ = null; if (primaryConfigBuilder_ != null) { primaryConfigBuilder_.dispose(); @@ -8875,7 +10092,7 @@ public Builder clearPrimaryConfig() { */ public com.google.cloud.alloydb.v1alpha.Cluster.PrimaryConfig.Builder getPrimaryConfigBuilder() { - bitField0_ |= 0x01000000; + bitField0_ |= 0x02000000; onChanged(); return getPrimaryConfigFieldBuilder().getBuilder(); } diff --git a/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/ClusterOrBuilder.java b/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/ClusterOrBuilder.java index f2d12a1c905a..67851a3fc7a2 100644 --- a/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/ClusterOrBuilder.java +++ b/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/ClusterOrBuilder.java @@ -461,6 +461,29 @@ java.lang.String getLabelsOrDefault( */ com.google.cloud.alloydb.v1alpha.DatabaseVersion getDatabaseVersion(); + /** + * + * .google.cloud.alloydb.v1alpha.Cluster.NetworkConfig network_config = 29 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the networkConfig field is set. + */ + boolean hasNetworkConfig(); + /** + * + * .google.cloud.alloydb.v1alpha.Cluster.NetworkConfig network_config = 29 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The networkConfig. + */ + com.google.cloud.alloydb.v1alpha.Cluster.NetworkConfig getNetworkConfig(); + /** + * + * .google.cloud.alloydb.v1alpha.Cluster.NetworkConfig network_config = 29 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.cloud.alloydb.v1alpha.Cluster.NetworkConfigOrBuilder getNetworkConfigOrBuilder(); + /** * * @@ -710,35 +733,42 @@ java.lang.String getAnnotationsOrDefault( * * *
-   * SSL configuration for this AlloyDB Cluster.
+   * SSL configuration for this AlloyDB cluster.
    * 
* - * .google.cloud.alloydb.v1alpha.SslConfig ssl_config = 18; + * .google.cloud.alloydb.v1alpha.SslConfig ssl_config = 18 [deprecated = true]; * + * @deprecated google.cloud.alloydb.v1alpha.Cluster.ssl_config is deprecated. See + * google/cloud/alloydb/v1alpha/resources.proto;l=578 * @return Whether the sslConfig field is set. */ + @java.lang.Deprecated boolean hasSslConfig(); /** * * *
-   * SSL configuration for this AlloyDB Cluster.
+   * SSL configuration for this AlloyDB cluster.
    * 
* - * .google.cloud.alloydb.v1alpha.SslConfig ssl_config = 18; + * .google.cloud.alloydb.v1alpha.SslConfig ssl_config = 18 [deprecated = true]; * + * @deprecated google.cloud.alloydb.v1alpha.Cluster.ssl_config is deprecated. See + * google/cloud/alloydb/v1alpha/resources.proto;l=578 * @return The sslConfig. */ + @java.lang.Deprecated com.google.cloud.alloydb.v1alpha.SslConfig getSslConfig(); /** * * *
-   * SSL configuration for this AlloyDB Cluster.
+   * SSL configuration for this AlloyDB cluster.
    * 
* - * .google.cloud.alloydb.v1alpha.SslConfig ssl_config = 18; + * .google.cloud.alloydb.v1alpha.SslConfig ssl_config = 18 [deprecated = true]; */ + @java.lang.Deprecated com.google.cloud.alloydb.v1alpha.SslConfigOrBuilder getSslConfigOrBuilder(); /** diff --git a/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/ClusterView.java b/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/ClusterView.java new file mode 100644 index 000000000000..2a4dcdd02f3a --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/ClusterView.java @@ -0,0 +1,185 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/alloydb/v1alpha/resources.proto + +package com.google.cloud.alloydb.v1alpha; + +/** + * + * + *
+ * View on Cluster. Pass this enum to rpcs that returns a cluster message to
+ * control which subsets of fields to get.
+ * 
+ * + * Protobuf enum {@code google.cloud.alloydb.v1alpha.ClusterView} + */ +public enum ClusterView implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+   * CLUSTER_VIEW_UNSPECIFIED Not specified, equivalent to BASIC.
+   * 
+ * + * CLUSTER_VIEW_UNSPECIFIED = 0; + */ + 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.
+   * 
+ * + * CLUSTER_VIEW_BASIC = 1; + */ + 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.
+   * 
+ * + * CLUSTER_VIEW_CONTINUOUS_BACKUP = 2; + */ + CLUSTER_VIEW_CONTINUOUS_BACKUP(2), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+   * CLUSTER_VIEW_UNSPECIFIED Not specified, equivalent to BASIC.
+   * 
+ * + * CLUSTER_VIEW_UNSPECIFIED = 0; + */ + public static final int CLUSTER_VIEW_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+   * BASIC server responses include all the relevant cluster details, excluding
+   * Cluster.ContinuousBackupInfo.EarliestRestorableTime and other view-specific
+   * fields. The default value.
+   * 
+ * + * CLUSTER_VIEW_BASIC = 1; + */ + public static final int CLUSTER_VIEW_BASIC_VALUE = 1; + /** + * + * + *
+   * CONTINUOUS_BACKUP response returns all the fields from BASIC plus
+   * the earliest restorable time if continuous backups are enabled.
+   * May increase latency.
+   * 
+ * + * CLUSTER_VIEW_CONTINUOUS_BACKUP = 2; + */ + public static final int CLUSTER_VIEW_CONTINUOUS_BACKUP_VALUE = 2; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static ClusterView valueOf(int value) { + return forNumber(value); + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + */ + public static ClusterView forNumber(int value) { + switch (value) { + case 0: + return CLUSTER_VIEW_UNSPECIFIED; + case 1: + return CLUSTER_VIEW_BASIC; + case 2: + return CLUSTER_VIEW_CONTINUOUS_BACKUP; + default: + return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap internalGetValueMap() { + return internalValueMap; + } + + private static final com.google.protobuf.Internal.EnumLiteMap internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public ClusterView findValueByNumber(int number) { + return ClusterView.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + return getDescriptor().getValues().get(ordinal()); + } + + public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { + return getDescriptor(); + } + + public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.cloud.alloydb.v1alpha.ResourcesProto.getDescriptor().getEnumTypes().get(1); + } + + private static final ClusterView[] VALUES = values(); + + public static ClusterView valueOf(com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException("EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private ClusterView(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.alloydb.v1alpha.ClusterView) +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/ConnectionInfo.java b/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/ConnectionInfo.java index 347b7dbd0e6f..2771fba7347d 100644 --- a/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/ConnectionInfo.java +++ b/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/ConnectionInfo.java @@ -187,11 +187,15 @@ public com.google.protobuf.ByteString getIpAddressBytes() { * certificate. Expected to be in issuer-to-root order according to RFC 5246. * * - * repeated string pem_certificate_chain = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * repeated string pem_certificate_chain = 3 [deprecated = true, (.google.api.field_behavior) = OUTPUT_ONLY]; * * + * @deprecated google.cloud.alloydb.v1alpha.ConnectionInfo.pem_certificate_chain is deprecated. + * See google/cloud/alloydb/v1alpha/resources.proto;l=894 * @return A list containing the pemCertificateChain. */ + @java.lang.Deprecated public com.google.protobuf.ProtocolStringList getPemCertificateChainList() { return pemCertificateChain_; } @@ -203,11 +207,15 @@ public com.google.protobuf.ProtocolStringList getPemCertificateChainList() { * certificate. Expected to be in issuer-to-root order according to RFC 5246. * * - * repeated string pem_certificate_chain = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * repeated string pem_certificate_chain = 3 [deprecated = true, (.google.api.field_behavior) = OUTPUT_ONLY]; * * + * @deprecated google.cloud.alloydb.v1alpha.ConnectionInfo.pem_certificate_chain is deprecated. + * See google/cloud/alloydb/v1alpha/resources.proto;l=894 * @return The count of pemCertificateChain. */ + @java.lang.Deprecated public int getPemCertificateChainCount() { return pemCertificateChain_.size(); } @@ -219,12 +227,16 @@ public int getPemCertificateChainCount() { * certificate. Expected to be in issuer-to-root order according to RFC 5246. * * - * repeated string pem_certificate_chain = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * repeated string pem_certificate_chain = 3 [deprecated = true, (.google.api.field_behavior) = OUTPUT_ONLY]; * * + * @deprecated google.cloud.alloydb.v1alpha.ConnectionInfo.pem_certificate_chain is deprecated. + * See google/cloud/alloydb/v1alpha/resources.proto;l=894 * @param index The index of the element to return. * @return The pemCertificateChain at the given index. */ + @java.lang.Deprecated public java.lang.String getPemCertificateChain(int index) { return pemCertificateChain_.get(index); } @@ -236,12 +248,16 @@ public java.lang.String getPemCertificateChain(int index) { * certificate. Expected to be in issuer-to-root order according to RFC 5246. * * - * repeated string pem_certificate_chain = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * repeated string pem_certificate_chain = 3 [deprecated = true, (.google.api.field_behavior) = OUTPUT_ONLY]; * * + * @deprecated google.cloud.alloydb.v1alpha.ConnectionInfo.pem_certificate_chain is deprecated. + * See google/cloud/alloydb/v1alpha/resources.proto;l=894 * @param index The index of the value to return. * @return The bytes of the pemCertificateChain at the given index. */ + @java.lang.Deprecated public com.google.protobuf.ByteString getPemCertificateChainBytes(int index) { return pemCertificateChain_.getByteString(index); } @@ -970,11 +986,15 @@ private void ensurePemCertificateChainIsMutable() { * certificate. Expected to be in issuer-to-root order according to RFC 5246. * * - * repeated string pem_certificate_chain = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * repeated string pem_certificate_chain = 3 [deprecated = true, (.google.api.field_behavior) = OUTPUT_ONLY]; * * + * @deprecated google.cloud.alloydb.v1alpha.ConnectionInfo.pem_certificate_chain is deprecated. + * See google/cloud/alloydb/v1alpha/resources.proto;l=894 * @return A list containing the pemCertificateChain. */ + @java.lang.Deprecated public com.google.protobuf.ProtocolStringList getPemCertificateChainList() { pemCertificateChain_.makeImmutable(); return pemCertificateChain_; @@ -987,11 +1007,15 @@ public com.google.protobuf.ProtocolStringList getPemCertificateChainList() { * certificate. Expected to be in issuer-to-root order according to RFC 5246. * * - * repeated string pem_certificate_chain = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * repeated string pem_certificate_chain = 3 [deprecated = true, (.google.api.field_behavior) = OUTPUT_ONLY]; * * + * @deprecated google.cloud.alloydb.v1alpha.ConnectionInfo.pem_certificate_chain is deprecated. + * See google/cloud/alloydb/v1alpha/resources.proto;l=894 * @return The count of pemCertificateChain. */ + @java.lang.Deprecated public int getPemCertificateChainCount() { return pemCertificateChain_.size(); } @@ -1003,12 +1027,16 @@ public int getPemCertificateChainCount() { * certificate. Expected to be in issuer-to-root order according to RFC 5246. * * - * repeated string pem_certificate_chain = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * repeated string pem_certificate_chain = 3 [deprecated = true, (.google.api.field_behavior) = OUTPUT_ONLY]; * * + * @deprecated google.cloud.alloydb.v1alpha.ConnectionInfo.pem_certificate_chain is deprecated. + * See google/cloud/alloydb/v1alpha/resources.proto;l=894 * @param index The index of the element to return. * @return The pemCertificateChain at the given index. */ + @java.lang.Deprecated public java.lang.String getPemCertificateChain(int index) { return pemCertificateChain_.get(index); } @@ -1020,12 +1048,16 @@ public java.lang.String getPemCertificateChain(int index) { * certificate. Expected to be in issuer-to-root order according to RFC 5246. * * - * repeated string pem_certificate_chain = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * repeated string pem_certificate_chain = 3 [deprecated = true, (.google.api.field_behavior) = OUTPUT_ONLY]; * * + * @deprecated google.cloud.alloydb.v1alpha.ConnectionInfo.pem_certificate_chain is deprecated. + * See google/cloud/alloydb/v1alpha/resources.proto;l=894 * @param index The index of the value to return. * @return The bytes of the pemCertificateChain at the given index. */ + @java.lang.Deprecated public com.google.protobuf.ByteString getPemCertificateChainBytes(int index) { return pemCertificateChain_.getByteString(index); } @@ -1037,13 +1069,17 @@ public com.google.protobuf.ByteString getPemCertificateChainBytes(int index) { * certificate. Expected to be in issuer-to-root order according to RFC 5246. * * - * repeated string pem_certificate_chain = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * repeated string pem_certificate_chain = 3 [deprecated = true, (.google.api.field_behavior) = OUTPUT_ONLY]; * * + * @deprecated google.cloud.alloydb.v1alpha.ConnectionInfo.pem_certificate_chain is deprecated. + * See google/cloud/alloydb/v1alpha/resources.proto;l=894 * @param index The index to set the value at. * @param value The pemCertificateChain to set. * @return This builder for chaining. */ + @java.lang.Deprecated public Builder setPemCertificateChain(int index, java.lang.String value) { if (value == null) { throw new NullPointerException(); @@ -1062,12 +1098,16 @@ public Builder setPemCertificateChain(int index, java.lang.String value) { * certificate. Expected to be in issuer-to-root order according to RFC 5246. * * - * repeated string pem_certificate_chain = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * repeated string pem_certificate_chain = 3 [deprecated = true, (.google.api.field_behavior) = OUTPUT_ONLY]; * * + * @deprecated google.cloud.alloydb.v1alpha.ConnectionInfo.pem_certificate_chain is deprecated. + * See google/cloud/alloydb/v1alpha/resources.proto;l=894 * @param value The pemCertificateChain to add. * @return This builder for chaining. */ + @java.lang.Deprecated public Builder addPemCertificateChain(java.lang.String value) { if (value == null) { throw new NullPointerException(); @@ -1086,12 +1126,16 @@ public Builder addPemCertificateChain(java.lang.String value) { * certificate. Expected to be in issuer-to-root order according to RFC 5246. * * - * repeated string pem_certificate_chain = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * repeated string pem_certificate_chain = 3 [deprecated = true, (.google.api.field_behavior) = OUTPUT_ONLY]; * * + * @deprecated google.cloud.alloydb.v1alpha.ConnectionInfo.pem_certificate_chain is deprecated. + * See google/cloud/alloydb/v1alpha/resources.proto;l=894 * @param values The pemCertificateChain to add. * @return This builder for chaining. */ + @java.lang.Deprecated public Builder addAllPemCertificateChain(java.lang.Iterable values) { ensurePemCertificateChainIsMutable(); com.google.protobuf.AbstractMessageLite.Builder.addAll(values, pemCertificateChain_); @@ -1107,11 +1151,15 @@ public Builder addAllPemCertificateChain(java.lang.Iterable va * certificate. Expected to be in issuer-to-root order according to RFC 5246. * * - * repeated string pem_certificate_chain = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * repeated string pem_certificate_chain = 3 [deprecated = true, (.google.api.field_behavior) = OUTPUT_ONLY]; * * + * @deprecated google.cloud.alloydb.v1alpha.ConnectionInfo.pem_certificate_chain is deprecated. + * See google/cloud/alloydb/v1alpha/resources.proto;l=894 * @return This builder for chaining. */ + @java.lang.Deprecated public Builder clearPemCertificateChain() { pemCertificateChain_ = com.google.protobuf.LazyStringArrayList.emptyList(); bitField0_ = (bitField0_ & ~0x00000004); @@ -1127,12 +1175,16 @@ public Builder clearPemCertificateChain() { * certificate. Expected to be in issuer-to-root order according to RFC 5246. * * - * repeated string pem_certificate_chain = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * repeated string pem_certificate_chain = 3 [deprecated = true, (.google.api.field_behavior) = OUTPUT_ONLY]; * * + * @deprecated google.cloud.alloydb.v1alpha.ConnectionInfo.pem_certificate_chain is deprecated. + * See google/cloud/alloydb/v1alpha/resources.proto;l=894 * @param value The bytes of the pemCertificateChain to add. * @return This builder for chaining. */ + @java.lang.Deprecated public Builder addPemCertificateChainBytes(com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); diff --git a/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/ConnectionInfoOrBuilder.java b/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/ConnectionInfoOrBuilder.java index fd71f6d59777..41400234507a 100644 --- a/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/ConnectionInfoOrBuilder.java +++ b/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/ConnectionInfoOrBuilder.java @@ -87,11 +87,15 @@ public interface ConnectionInfoOrBuilder * certificate. Expected to be in issuer-to-root order according to RFC 5246. * * - * repeated string pem_certificate_chain = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * repeated string pem_certificate_chain = 3 [deprecated = true, (.google.api.field_behavior) = OUTPUT_ONLY]; * * + * @deprecated google.cloud.alloydb.v1alpha.ConnectionInfo.pem_certificate_chain is deprecated. + * See google/cloud/alloydb/v1alpha/resources.proto;l=894 * @return A list containing the pemCertificateChain. */ + @java.lang.Deprecated java.util.List getPemCertificateChainList(); /** * @@ -101,11 +105,15 @@ public interface ConnectionInfoOrBuilder * certificate. Expected to be in issuer-to-root order according to RFC 5246. * * - * repeated string pem_certificate_chain = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * repeated string pem_certificate_chain = 3 [deprecated = true, (.google.api.field_behavior) = OUTPUT_ONLY]; * * + * @deprecated google.cloud.alloydb.v1alpha.ConnectionInfo.pem_certificate_chain is deprecated. + * See google/cloud/alloydb/v1alpha/resources.proto;l=894 * @return The count of pemCertificateChain. */ + @java.lang.Deprecated int getPemCertificateChainCount(); /** * @@ -115,12 +123,16 @@ public interface ConnectionInfoOrBuilder * certificate. Expected to be in issuer-to-root order according to RFC 5246. * * - * repeated string pem_certificate_chain = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * repeated string pem_certificate_chain = 3 [deprecated = true, (.google.api.field_behavior) = OUTPUT_ONLY]; * * + * @deprecated google.cloud.alloydb.v1alpha.ConnectionInfo.pem_certificate_chain is deprecated. + * See google/cloud/alloydb/v1alpha/resources.proto;l=894 * @param index The index of the element to return. * @return The pemCertificateChain at the given index. */ + @java.lang.Deprecated java.lang.String getPemCertificateChain(int index); /** * @@ -130,12 +142,16 @@ public interface ConnectionInfoOrBuilder * certificate. Expected to be in issuer-to-root order according to RFC 5246. * * - * repeated string pem_certificate_chain = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * repeated string pem_certificate_chain = 3 [deprecated = true, (.google.api.field_behavior) = OUTPUT_ONLY]; * * + * @deprecated google.cloud.alloydb.v1alpha.ConnectionInfo.pem_certificate_chain is deprecated. + * See google/cloud/alloydb/v1alpha/resources.proto;l=894 * @param index The index of the value to return. * @return The bytes of the pemCertificateChain at the given index. */ + @java.lang.Deprecated com.google.protobuf.ByteString getPemCertificateChainBytes(int index); /** diff --git a/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/ContinuousBackupInfo.java b/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/ContinuousBackupInfo.java index 4a2e28d6b8fe..a647710942c9 100644 --- a/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/ContinuousBackupInfo.java +++ b/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/ContinuousBackupInfo.java @@ -285,6 +285,65 @@ public int getScheduleValue(int index) { private int scheduleMemoizedSerializedSize; + public static final int EARLIEST_RESTORABLE_TIME_FIELD_NUMBER = 4; + private com.google.protobuf.Timestamp earliestRestorableTime_; + /** + * + * + *
+   * Output only. The earliest restorable time that can be restored to. Output
+   * only field.
+   * 
+ * + * + * .google.protobuf.Timestamp earliest_restorable_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the earliestRestorableTime field is set. + */ + @java.lang.Override + public boolean hasEarliestRestorableTime() { + return earliestRestorableTime_ != null; + } + /** + * + * + *
+   * Output only. The earliest restorable time that can be restored to. Output
+   * only field.
+   * 
+ * + * + * .google.protobuf.Timestamp earliest_restorable_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The earliestRestorableTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getEarliestRestorableTime() { + return earliestRestorableTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : earliestRestorableTime_; + } + /** + * + * + *
+   * Output only. The earliest restorable time that can be restored to. Output
+   * only field.
+   * 
+ * + * + * .google.protobuf.Timestamp earliest_restorable_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getEarliestRestorableTimeOrBuilder() { + return earliestRestorableTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : earliestRestorableTime_; + } + private byte memoizedIsInitialized = -1; @java.lang.Override @@ -313,6 +372,9 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io for (int i = 0; i < schedule_.size(); i++) { output.writeEnumNoTag(schedule_.get(i)); } + if (earliestRestorableTime_ != null) { + output.writeMessage(4, getEarliestRestorableTime()); + } getUnknownFields().writeTo(output); } @@ -340,6 +402,10 @@ public int getSerializedSize() { } scheduleMemoizedSerializedSize = dataSize; } + if (earliestRestorableTime_ != null) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize(4, getEarliestRestorableTime()); + } size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; @@ -365,6 +431,10 @@ public boolean equals(final java.lang.Object obj) { if (!getEnabledTime().equals(other.getEnabledTime())) return false; } if (!schedule_.equals(other.schedule_)) return false; + if (hasEarliestRestorableTime() != other.hasEarliestRestorableTime()) return false; + if (hasEarliestRestorableTime()) { + if (!getEarliestRestorableTime().equals(other.getEarliestRestorableTime())) return false; + } if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -388,6 +458,10 @@ public int hashCode() { hash = (37 * hash) + SCHEDULE_FIELD_NUMBER; hash = (53 * hash) + schedule_.hashCode(); } + if (hasEarliestRestorableTime()) { + hash = (37 * hash) + EARLIEST_RESTORABLE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getEarliestRestorableTime().hashCode(); + } hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; @@ -541,6 +615,11 @@ public Builder clear() { } schedule_ = java.util.Collections.emptyList(); bitField0_ = (bitField0_ & ~0x00000004); + earliestRestorableTime_ = null; + if (earliestRestorableTimeBuilder_ != null) { + earliestRestorableTimeBuilder_.dispose(); + earliestRestorableTimeBuilder_ = null; + } return this; } @@ -595,6 +674,12 @@ private void buildPartial0(com.google.cloud.alloydb.v1alpha.ContinuousBackupInfo result.enabledTime_ = enabledTimeBuilder_ == null ? enabledTime_ : enabledTimeBuilder_.build(); } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.earliestRestorableTime_ = + earliestRestorableTimeBuilder_ == null + ? earliestRestorableTime_ + : earliestRestorableTimeBuilder_.build(); + } } @java.lang.Override @@ -659,6 +744,9 @@ public Builder mergeFrom(com.google.cloud.alloydb.v1alpha.ContinuousBackupInfo o } onChanged(); } + if (other.hasEarliestRestorableTime()) { + mergeEarliestRestorableTime(other.getEarliestRestorableTime()); + } this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; @@ -716,6 +804,13 @@ public Builder mergeFrom( input.popLimit(oldLimit); break; } // case 26 + case 34: + { + input.readMessage( + getEarliestRestorableTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000008; + break; + } // case 34 default: { if (!super.parseUnknownField(input, extensionRegistry, tag)) { @@ -1412,6 +1507,217 @@ public Builder addAllScheduleValue(java.lang.Iterable values) return this; } + private com.google.protobuf.Timestamp earliestRestorableTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + earliestRestorableTimeBuilder_; + /** + * + * + *
+     * Output only. The earliest restorable time that can be restored to. Output
+     * only field.
+     * 
+ * + * + * .google.protobuf.Timestamp earliest_restorable_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the earliestRestorableTime field is set. + */ + public boolean hasEarliestRestorableTime() { + return ((bitField0_ & 0x00000008) != 0); + } + /** + * + * + *
+     * Output only. The earliest restorable time that can be restored to. Output
+     * only field.
+     * 
+ * + * + * .google.protobuf.Timestamp earliest_restorable_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The earliestRestorableTime. + */ + public com.google.protobuf.Timestamp getEarliestRestorableTime() { + if (earliestRestorableTimeBuilder_ == null) { + return earliestRestorableTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : earliestRestorableTime_; + } else { + return earliestRestorableTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Output only. The earliest restorable time that can be restored to. Output
+     * only field.
+     * 
+ * + * + * .google.protobuf.Timestamp earliest_restorable_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setEarliestRestorableTime(com.google.protobuf.Timestamp value) { + if (earliestRestorableTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + earliestRestorableTime_ = value; + } else { + earliestRestorableTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The earliest restorable time that can be restored to. Output
+     * only field.
+     * 
+ * + * + * .google.protobuf.Timestamp earliest_restorable_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setEarliestRestorableTime( + com.google.protobuf.Timestamp.Builder builderForValue) { + if (earliestRestorableTimeBuilder_ == null) { + earliestRestorableTime_ = builderForValue.build(); + } else { + earliestRestorableTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The earliest restorable time that can be restored to. Output
+     * only field.
+     * 
+ * + * + * .google.protobuf.Timestamp earliest_restorable_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeEarliestRestorableTime(com.google.protobuf.Timestamp value) { + if (earliestRestorableTimeBuilder_ == null) { + if (((bitField0_ & 0x00000008) != 0) + && earliestRestorableTime_ != null + && earliestRestorableTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getEarliestRestorableTimeBuilder().mergeFrom(value); + } else { + earliestRestorableTime_ = value; + } + } else { + earliestRestorableTimeBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The earliest restorable time that can be restored to. Output
+     * only field.
+     * 
+ * + * + * .google.protobuf.Timestamp earliest_restorable_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearEarliestRestorableTime() { + bitField0_ = (bitField0_ & ~0x00000008); + earliestRestorableTime_ = null; + if (earliestRestorableTimeBuilder_ != null) { + earliestRestorableTimeBuilder_.dispose(); + earliestRestorableTimeBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The earliest restorable time that can be restored to. Output
+     * only field.
+     * 
+ * + * + * .google.protobuf.Timestamp earliest_restorable_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Timestamp.Builder getEarliestRestorableTimeBuilder() { + bitField0_ |= 0x00000008; + onChanged(); + return getEarliestRestorableTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. The earliest restorable time that can be restored to. Output
+     * only field.
+     * 
+ * + * + * .google.protobuf.Timestamp earliest_restorable_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.TimestampOrBuilder getEarliestRestorableTimeOrBuilder() { + if (earliestRestorableTimeBuilder_ != null) { + return earliestRestorableTimeBuilder_.getMessageOrBuilder(); + } else { + return earliestRestorableTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : earliestRestorableTime_; + } + } + /** + * + * + *
+     * Output only. The earliest restorable time that can be restored to. Output
+     * only field.
+     * 
+ * + * + * .google.protobuf.Timestamp earliest_restorable_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getEarliestRestorableTimeFieldBuilder() { + if (earliestRestorableTimeBuilder_ == null) { + earliestRestorableTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getEarliestRestorableTime(), getParentForChildren(), isClean()); + earliestRestorableTime_ = null; + } + return earliestRestorableTimeBuilder_; + } + @java.lang.Override public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { return super.setUnknownFields(unknownFields); diff --git a/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/ContinuousBackupInfoOrBuilder.java b/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/ContinuousBackupInfoOrBuilder.java index c97f201ac121..2aeb9b646427 100644 --- a/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/ContinuousBackupInfoOrBuilder.java +++ b/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/ContinuousBackupInfoOrBuilder.java @@ -185,4 +185,48 @@ public interface ContinuousBackupInfoOrBuilder * @return The enum numeric value on the wire of schedule at the given index. */ int getScheduleValue(int index); + + /** + * + * + *
+   * Output only. The earliest restorable time that can be restored to. Output
+   * only field.
+   * 
+ * + * + * .google.protobuf.Timestamp earliest_restorable_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the earliestRestorableTime field is set. + */ + boolean hasEarliestRestorableTime(); + /** + * + * + *
+   * Output only. The earliest restorable time that can be restored to. Output
+   * only field.
+   * 
+ * + * + * .google.protobuf.Timestamp earliest_restorable_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The earliestRestorableTime. + */ + com.google.protobuf.Timestamp getEarliestRestorableTime(); + /** + * + * + *
+   * Output only. The earliest restorable time that can be restored to. Output
+   * only field.
+   * 
+ * + * + * .google.protobuf.Timestamp earliest_restorable_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getEarliestRestorableTimeOrBuilder(); } diff --git a/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/CreateClusterRequest.java b/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/CreateClusterRequest.java index 80329cedfd28..0c1f7caf4bee 100644 --- a/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/CreateClusterRequest.java +++ b/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/CreateClusterRequest.java @@ -72,7 +72,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { * * *
-   * Required. The name of the parent resource. For the required format, see the
+   * Required. The location of the new cluster. For the required format, see the
    * comment on the Cluster.name field.
    * 
* @@ -98,7 +98,7 @@ public java.lang.String getParent() { * * *
-   * Required. The name of the parent resource. For the required format, see the
+   * Required. The location of the new cluster. For the required format, see the
    * comment on the Cluster.name field.
    * 
* @@ -772,7 +772,7 @@ public Builder mergeFrom( * * *
-     * Required. The name of the parent resource. For the required format, see the
+     * Required. The location of the new cluster. For the required format, see the
      * comment on the Cluster.name field.
      * 
* @@ -797,7 +797,7 @@ public java.lang.String getParent() { * * *
-     * Required. The name of the parent resource. For the required format, see the
+     * Required. The location of the new cluster. For the required format, see the
      * comment on the Cluster.name field.
      * 
* @@ -822,7 +822,7 @@ public com.google.protobuf.ByteString getParentBytes() { * * *
-     * Required. The name of the parent resource. For the required format, see the
+     * Required. The location of the new cluster. For the required format, see the
      * comment on the Cluster.name field.
      * 
* @@ -846,7 +846,7 @@ public Builder setParent(java.lang.String value) { * * *
-     * Required. The name of the parent resource. For the required format, see the
+     * Required. The location of the new cluster. For the required format, see the
      * comment on the Cluster.name field.
      * 
* @@ -866,7 +866,7 @@ public Builder clearParent() { * * *
-     * Required. The name of the parent resource. For the required format, see the
+     * Required. The location of the new cluster. For the required format, see the
      * comment on the Cluster.name field.
      * 
* diff --git a/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/CreateClusterRequestOrBuilder.java b/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/CreateClusterRequestOrBuilder.java index b24e0f08119f..40706ab05fd9 100644 --- a/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/CreateClusterRequestOrBuilder.java +++ b/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/CreateClusterRequestOrBuilder.java @@ -27,7 +27,7 @@ public interface CreateClusterRequestOrBuilder * * *
-   * Required. The name of the parent resource. For the required format, see the
+   * Required. The location of the new cluster. For the required format, see the
    * comment on the Cluster.name field.
    * 
* @@ -42,7 +42,7 @@ public interface CreateClusterRequestOrBuilder * * *
-   * Required. The name of the parent resource. For the required format, see the
+   * Required. The location of the new cluster. For the required format, see the
    * comment on the Cluster.name field.
    * 
* diff --git a/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/CreateSecondaryClusterRequest.java b/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/CreateSecondaryClusterRequest.java index c82aebd3fa39..5aaeecaecd6c 100644 --- a/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/CreateSecondaryClusterRequest.java +++ b/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/CreateSecondaryClusterRequest.java @@ -64,8 +64,8 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { * * *
-   * Required. The name of the parent resource (the primary cluster). For the
-   * required format, see the comment on the Cluster.name field.
+   * Required. The location of the new cluster. For the required
+   * format, see the comment on the Cluster.name field.
    * 
* * @@ -90,8 +90,8 @@ public java.lang.String getParent() { * * *
-   * Required. The name of the parent resource (the primary cluster). For the
-   * required format, see the comment on the Cluster.name field.
+   * Required. The location of the new cluster. For the required
+   * format, see the comment on the Cluster.name field.
    * 
* * @@ -759,8 +759,8 @@ public Builder mergeFrom( * * *
-     * Required. The name of the parent resource (the primary cluster). For the
-     * required format, see the comment on the Cluster.name field.
+     * Required. The location of the new cluster. For the required
+     * format, see the comment on the Cluster.name field.
      * 
* * @@ -784,8 +784,8 @@ public java.lang.String getParent() { * * *
-     * Required. The name of the parent resource (the primary cluster). For the
-     * required format, see the comment on the Cluster.name field.
+     * Required. The location of the new cluster. For the required
+     * format, see the comment on the Cluster.name field.
      * 
* * @@ -809,8 +809,8 @@ public com.google.protobuf.ByteString getParentBytes() { * * *
-     * Required. The name of the parent resource (the primary cluster). For the
-     * required format, see the comment on the Cluster.name field.
+     * Required. The location of the new cluster. For the required
+     * format, see the comment on the Cluster.name field.
      * 
* * @@ -833,8 +833,8 @@ public Builder setParent(java.lang.String value) { * * *
-     * Required. The name of the parent resource (the primary cluster). For the
-     * required format, see the comment on the Cluster.name field.
+     * Required. The location of the new cluster. For the required
+     * format, see the comment on the Cluster.name field.
      * 
* * @@ -853,8 +853,8 @@ public Builder clearParent() { * * *
-     * Required. The name of the parent resource (the primary cluster). For the
-     * required format, see the comment on the Cluster.name field.
+     * Required. The location of the new cluster. For the required
+     * format, see the comment on the Cluster.name field.
      * 
* * diff --git a/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/CreateSecondaryClusterRequestOrBuilder.java b/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/CreateSecondaryClusterRequestOrBuilder.java index 9cf8a792569a..e196ab372a8b 100644 --- a/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/CreateSecondaryClusterRequestOrBuilder.java +++ b/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/CreateSecondaryClusterRequestOrBuilder.java @@ -27,8 +27,8 @@ public interface CreateSecondaryClusterRequestOrBuilder * * *
-   * Required. The name of the parent resource (the primary cluster). For the
-   * required format, see the comment on the Cluster.name field.
+   * Required. The location of the new cluster. For the required
+   * format, see the comment on the Cluster.name field.
    * 
* * @@ -42,8 +42,8 @@ public interface CreateSecondaryClusterRequestOrBuilder * * *
-   * Required. The name of the parent resource (the primary cluster). For the
-   * required format, see the comment on the Cluster.name field.
+   * Required. The location of the new cluster. For the required
+   * format, see the comment on the Cluster.name field.
    * 
* * diff --git a/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/CreateUserRequest.java b/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/CreateUserRequest.java new file mode 100644 index 000000000000..cb3fc65b3681 --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/CreateUserRequest.java @@ -0,0 +1,1451 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/alloydb/v1alpha/service.proto + +package com.google.cloud.alloydb.v1alpha; + +/** + * + * + *
+ * Message for creating a User
+ * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1alpha.CreateUserRequest} + */ +public final class CreateUserRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.alloydb.v1alpha.CreateUserRequest) + CreateUserRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use CreateUserRequest.newBuilder() to construct. + private CreateUserRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private CreateUserRequest() { + parent_ = ""; + userId_ = ""; + requestId_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new CreateUserRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.alloydb.v1alpha.ServiceProto + .internal_static_google_cloud_alloydb_v1alpha_CreateUserRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1alpha.ServiceProto + .internal_static_google_cloud_alloydb_v1alpha_CreateUserRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1alpha.CreateUserRequest.class, + com.google.cloud.alloydb.v1alpha.CreateUserRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object parent_ = ""; + /** + * + * + *
+   * Required. Value for parent.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + @java.lang.Override + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } + } + /** + * + * + *
+   * Required. Value for parent.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + @java.lang.Override + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int USER_ID_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object userId_ = ""; + /** + * + * + *
+   * Required. ID of the requesting object.
+   * 
+ * + * string user_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The userId. + */ + @java.lang.Override + public java.lang.String getUserId() { + java.lang.Object ref = userId_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + userId_ = s; + return s; + } + } + /** + * + * + *
+   * Required. ID of the requesting object.
+   * 
+ * + * string user_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for userId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getUserIdBytes() { + java.lang.Object ref = userId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + userId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int USER_FIELD_NUMBER = 3; + private com.google.cloud.alloydb.v1alpha.User user_; + /** + * + * + *
+   * Required. The resource being created
+   * 
+ * + * .google.cloud.alloydb.v1alpha.User user = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the user field is set. + */ + @java.lang.Override + public boolean hasUser() { + return user_ != null; + } + /** + * + * + *
+   * Required. The resource being created
+   * 
+ * + * .google.cloud.alloydb.v1alpha.User user = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The user. + */ + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.User getUser() { + return user_ == null ? com.google.cloud.alloydb.v1alpha.User.getDefaultInstance() : user_; + } + /** + * + * + *
+   * Required. The resource being created
+   * 
+ * + * .google.cloud.alloydb.v1alpha.User user = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.UserOrBuilder getUserOrBuilder() { + return user_ == null ? com.google.cloud.alloydb.v1alpha.User.getDefaultInstance() : user_; + } + + public static final int REQUEST_ID_FIELD_NUMBER = 4; + + @SuppressWarnings("serial") + private volatile java.lang.Object 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).
+   * 
+ * + * string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The requestId. + */ + @java.lang.Override + public java.lang.String getRequestId() { + java.lang.Object ref = requestId_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + requestId_ = s; + return s; + } + } + /** + * + * + *
+   * Optional. An optional request ID to identify requests. Specify a unique
+   * request ID so that if you must retry your request, the server will know to
+   * ignore the request if it has already been completed. The server will
+   * guarantee that for at least 60 minutes since the first request.
+   *
+   * For example, consider a situation where you make an initial request and
+   * the request times out. If you make the request again with the same request
+   * ID, the server can check if original operation with the same request ID
+   * was received, and if so, will ignore the second request. This prevents
+   * clients from accidentally creating duplicate commitments.
+   *
+   * The request ID must be a valid UUID with the exception that zero UUID is
+   * not supported (00000000-0000-0000-0000-000000000000).
+   * 
+ * + * string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for requestId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getRequestIdBytes() { + java.lang.Object ref = requestId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + requestId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int VALIDATE_ONLY_FIELD_NUMBER = 5; + private boolean validateOnly_ = false; + /** + * + * + *
+   * Optional. If set, the backend validates the request, but doesn't actually
+   * execute it.
+   * 
+ * + * bool validate_only = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The validateOnly. + */ + @java.lang.Override + public boolean getValidateOnly() { + return validateOnly_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(userId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, userId_); + } + if (user_ != null) { + output.writeMessage(3, getUser()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(requestId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, requestId_); + } + if (validateOnly_ != false) { + output.writeBool(5, validateOnly_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(userId_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, userId_); + } + if (user_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getUser()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(requestId_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, requestId_); + } + if (validateOnly_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(5, validateOnly_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.alloydb.v1alpha.CreateUserRequest)) { + return super.equals(obj); + } + com.google.cloud.alloydb.v1alpha.CreateUserRequest other = + (com.google.cloud.alloydb.v1alpha.CreateUserRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (!getUserId().equals(other.getUserId())) return false; + if (hasUser() != other.hasUser()) return false; + if (hasUser()) { + if (!getUser().equals(other.getUser())) return false; + } + if (!getRequestId().equals(other.getRequestId())) return false; + if (getValidateOnly() != other.getValidateOnly()) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + PARENT_FIELD_NUMBER; + hash = (53 * hash) + getParent().hashCode(); + hash = (37 * hash) + USER_ID_FIELD_NUMBER; + hash = (53 * hash) + getUserId().hashCode(); + if (hasUser()) { + hash = (37 * hash) + USER_FIELD_NUMBER; + hash = (53 * hash) + getUser().hashCode(); + } + hash = (37 * hash) + REQUEST_ID_FIELD_NUMBER; + hash = (53 * hash) + getRequestId().hashCode(); + hash = (37 * hash) + VALIDATE_ONLY_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getValidateOnly()); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.alloydb.v1alpha.CreateUserRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1alpha.CreateUserRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.alloydb.v1alpha.CreateUserRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1alpha.CreateUserRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.alloydb.v1alpha.CreateUserRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1alpha.CreateUserRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.alloydb.v1alpha.CreateUserRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1alpha.CreateUserRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.alloydb.v1alpha.CreateUserRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1alpha.CreateUserRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.alloydb.v1alpha.CreateUserRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1alpha.CreateUserRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.alloydb.v1alpha.CreateUserRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Message for creating a User
+   * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1alpha.CreateUserRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.alloydb.v1alpha.CreateUserRequest) + com.google.cloud.alloydb.v1alpha.CreateUserRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.alloydb.v1alpha.ServiceProto + .internal_static_google_cloud_alloydb_v1alpha_CreateUserRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1alpha.ServiceProto + .internal_static_google_cloud_alloydb_v1alpha_CreateUserRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1alpha.CreateUserRequest.class, + com.google.cloud.alloydb.v1alpha.CreateUserRequest.Builder.class); + } + + // Construct using com.google.cloud.alloydb.v1alpha.CreateUserRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + parent_ = ""; + userId_ = ""; + user_ = null; + if (userBuilder_ != null) { + userBuilder_.dispose(); + userBuilder_ = null; + } + requestId_ = ""; + validateOnly_ = false; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.alloydb.v1alpha.ServiceProto + .internal_static_google_cloud_alloydb_v1alpha_CreateUserRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.CreateUserRequest getDefaultInstanceForType() { + return com.google.cloud.alloydb.v1alpha.CreateUserRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.CreateUserRequest build() { + com.google.cloud.alloydb.v1alpha.CreateUserRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.CreateUserRequest buildPartial() { + com.google.cloud.alloydb.v1alpha.CreateUserRequest result = + new com.google.cloud.alloydb.v1alpha.CreateUserRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.alloydb.v1alpha.CreateUserRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.parent_ = parent_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.userId_ = userId_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.user_ = userBuilder_ == null ? user_ : userBuilder_.build(); + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.requestId_ = requestId_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.validateOnly_ = validateOnly_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.alloydb.v1alpha.CreateUserRequest) { + return mergeFrom((com.google.cloud.alloydb.v1alpha.CreateUserRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.alloydb.v1alpha.CreateUserRequest other) { + if (other == com.google.cloud.alloydb.v1alpha.CreateUserRequest.getDefaultInstance()) + return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getUserId().isEmpty()) { + userId_ = other.userId_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (other.hasUser()) { + mergeUser(other.getUser()); + } + if (!other.getRequestId().isEmpty()) { + requestId_ = other.requestId_; + bitField0_ |= 0x00000008; + onChanged(); + } + if (other.getValidateOnly() != false) { + setValidateOnly(other.getValidateOnly()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + parent_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + userId_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + input.readMessage(getUserFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 34: + { + requestId_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000008; + break; + } // case 34 + case 40: + { + validateOnly_ = input.readBool(); + bitField0_ |= 0x00000010; + break; + } // case 40 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * Required. Value for parent.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. Value for parent.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. Value for parent.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The parent to set. + * @return This builder for chaining. + */ + public Builder setParent(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + parent_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Value for parent.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearParent() { + parent_ = getDefaultInstance().getParent(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Value for parent.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for parent to set. + * @return This builder for chaining. + */ + public Builder setParentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + parent_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object userId_ = ""; + /** + * + * + *
+     * Required. ID of the requesting object.
+     * 
+ * + * string user_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The userId. + */ + public java.lang.String getUserId() { + java.lang.Object ref = userId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + userId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. ID of the requesting object.
+     * 
+ * + * string user_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for userId. + */ + public com.google.protobuf.ByteString getUserIdBytes() { + java.lang.Object ref = userId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + userId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. ID of the requesting object.
+     * 
+ * + * string user_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The userId to set. + * @return This builder for chaining. + */ + public Builder setUserId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + userId_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. ID of the requesting object.
+     * 
+ * + * string user_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearUserId() { + userId_ = getDefaultInstance().getUserId(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. ID of the requesting object.
+     * 
+ * + * string user_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for userId to set. + * @return This builder for chaining. + */ + public Builder setUserIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + userId_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private com.google.cloud.alloydb.v1alpha.User user_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1alpha.User, + com.google.cloud.alloydb.v1alpha.User.Builder, + com.google.cloud.alloydb.v1alpha.UserOrBuilder> + userBuilder_; + /** + * + * + *
+     * Required. The resource being created
+     * 
+ * + * .google.cloud.alloydb.v1alpha.User user = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the user field is set. + */ + public boolean hasUser() { + return ((bitField0_ & 0x00000004) != 0); + } + /** + * + * + *
+     * Required. The resource being created
+     * 
+ * + * .google.cloud.alloydb.v1alpha.User user = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The user. + */ + public com.google.cloud.alloydb.v1alpha.User getUser() { + if (userBuilder_ == null) { + return user_ == null ? com.google.cloud.alloydb.v1alpha.User.getDefaultInstance() : user_; + } else { + return userBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. The resource being created
+     * 
+ * + * .google.cloud.alloydb.v1alpha.User user = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setUser(com.google.cloud.alloydb.v1alpha.User value) { + if (userBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + user_ = value; + } else { + userBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The resource being created
+     * 
+ * + * .google.cloud.alloydb.v1alpha.User user = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setUser(com.google.cloud.alloydb.v1alpha.User.Builder builderForValue) { + if (userBuilder_ == null) { + user_ = builderForValue.build(); + } else { + userBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The resource being created
+     * 
+ * + * .google.cloud.alloydb.v1alpha.User user = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeUser(com.google.cloud.alloydb.v1alpha.User value) { + if (userBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) + && user_ != null + && user_ != com.google.cloud.alloydb.v1alpha.User.getDefaultInstance()) { + getUserBuilder().mergeFrom(value); + } else { + user_ = value; + } + } else { + userBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The resource being created
+     * 
+ * + * .google.cloud.alloydb.v1alpha.User user = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearUser() { + bitField0_ = (bitField0_ & ~0x00000004); + user_ = null; + if (userBuilder_ != null) { + userBuilder_.dispose(); + userBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The resource being created
+     * 
+ * + * .google.cloud.alloydb.v1alpha.User user = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.alloydb.v1alpha.User.Builder getUserBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return getUserFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. The resource being created
+     * 
+ * + * .google.cloud.alloydb.v1alpha.User user = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.alloydb.v1alpha.UserOrBuilder getUserOrBuilder() { + if (userBuilder_ != null) { + return userBuilder_.getMessageOrBuilder(); + } else { + return user_ == null ? com.google.cloud.alloydb.v1alpha.User.getDefaultInstance() : user_; + } + } + /** + * + * + *
+     * Required. The resource being created
+     * 
+ * + * .google.cloud.alloydb.v1alpha.User user = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1alpha.User, + com.google.cloud.alloydb.v1alpha.User.Builder, + com.google.cloud.alloydb.v1alpha.UserOrBuilder> + getUserFieldBuilder() { + if (userBuilder_ == null) { + userBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1alpha.User, + com.google.cloud.alloydb.v1alpha.User.Builder, + com.google.cloud.alloydb.v1alpha.UserOrBuilder>( + getUser(), getParentForChildren(), isClean()); + user_ = null; + } + return userBuilder_; + } + + private java.lang.Object 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).
+     * 
+ * + * string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The requestId. + */ + public java.lang.String getRequestId() { + java.lang.Object ref = requestId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + requestId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes since the first request.
+     *
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     *
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for requestId. + */ + public com.google.protobuf.ByteString getRequestIdBytes() { + java.lang.Object ref = requestId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + requestId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes since the first request.
+     *
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     *
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The requestId to set. + * @return This builder for chaining. + */ + public Builder setRequestId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + requestId_ = value; + bitField0_ |= 0x00000008; + onChanged(); + 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).
+     * 
+ * + * string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearRequestId() { + requestId_ = getDefaultInstance().getRequestId(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + 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).
+     * 
+ * + * string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for requestId to set. + * @return This builder for chaining. + */ + public Builder setRequestIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + requestId_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + private boolean validateOnly_; + /** + * + * + *
+     * Optional. If set, the backend validates the request, but doesn't actually
+     * execute it.
+     * 
+ * + * bool validate_only = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The validateOnly. + */ + @java.lang.Override + public boolean getValidateOnly() { + return validateOnly_; + } + /** + * + * + *
+     * Optional. If set, the backend validates the request, but doesn't actually
+     * execute it.
+     * 
+ * + * bool validate_only = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The validateOnly to set. + * @return This builder for chaining. + */ + public Builder setValidateOnly(boolean value) { + + validateOnly_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. If set, the backend validates the request, but doesn't actually
+     * execute it.
+     * 
+ * + * bool validate_only = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearValidateOnly() { + bitField0_ = (bitField0_ & ~0x00000010); + validateOnly_ = false; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.alloydb.v1alpha.CreateUserRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.alloydb.v1alpha.CreateUserRequest) + private static final com.google.cloud.alloydb.v1alpha.CreateUserRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.alloydb.v1alpha.CreateUserRequest(); + } + + public static com.google.cloud.alloydb.v1alpha.CreateUserRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CreateUserRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.CreateUserRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/CreateUserRequestOrBuilder.java b/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/CreateUserRequestOrBuilder.java new file mode 100644 index 000000000000..a5df6112849f --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/CreateUserRequestOrBuilder.java @@ -0,0 +1,180 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/alloydb/v1alpha/service.proto + +package com.google.cloud.alloydb.v1alpha; + +public interface CreateUserRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.alloydb.v1alpha.CreateUserRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Value for parent.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. Value for parent.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * Required. ID of the requesting object.
+   * 
+ * + * string user_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The userId. + */ + java.lang.String getUserId(); + /** + * + * + *
+   * Required. ID of the requesting object.
+   * 
+ * + * string user_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for userId. + */ + com.google.protobuf.ByteString getUserIdBytes(); + + /** + * + * + *
+   * Required. The resource being created
+   * 
+ * + * .google.cloud.alloydb.v1alpha.User user = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the user field is set. + */ + boolean hasUser(); + /** + * + * + *
+   * Required. The resource being created
+   * 
+ * + * .google.cloud.alloydb.v1alpha.User user = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The user. + */ + com.google.cloud.alloydb.v1alpha.User getUser(); + /** + * + * + *
+   * Required. The resource being created
+   * 
+ * + * .google.cloud.alloydb.v1alpha.User user = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.alloydb.v1alpha.UserOrBuilder getUserOrBuilder(); + + /** + * + * + *
+   * Optional. An optional request ID to identify requests. Specify a unique
+   * request ID so that if you must retry your request, the server will know to
+   * ignore the request if it has already been completed. The server will
+   * guarantee that for at least 60 minutes since the first request.
+   *
+   * For example, consider a situation where you make an initial request and
+   * the request times out. If you make the request again with the same request
+   * ID, the server can check if original operation with the same request ID
+   * was received, and if so, will ignore the second request. This prevents
+   * clients from accidentally creating duplicate commitments.
+   *
+   * The request ID must be a valid UUID with the exception that zero UUID is
+   * not supported (00000000-0000-0000-0000-000000000000).
+   * 
+ * + * string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The requestId. + */ + java.lang.String getRequestId(); + /** + * + * + *
+   * Optional. An optional request ID to identify requests. Specify a unique
+   * request ID so that if you must retry your request, the server will know to
+   * ignore the request if it has already been completed. The server will
+   * guarantee that for at least 60 minutes since the first request.
+   *
+   * For example, consider a situation where you make an initial request and
+   * the request times out. If you make the request again with the same request
+   * ID, the server can check if original operation with the same request ID
+   * was received, and if so, will ignore the second request. This prevents
+   * clients from accidentally creating duplicate commitments.
+   *
+   * The request ID must be a valid UUID with the exception that zero UUID is
+   * not supported (00000000-0000-0000-0000-000000000000).
+   * 
+ * + * string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for requestId. + */ + com.google.protobuf.ByteString getRequestIdBytes(); + + /** + * + * + *
+   * Optional. If set, the backend validates the request, but doesn't actually
+   * execute it.
+   * 
+ * + * bool validate_only = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The validateOnly. + */ + boolean getValidateOnly(); +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/DatabaseVersion.java b/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/DatabaseVersion.java index a3bcac44a891..ca77f476b8cd 100644 --- a/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/DatabaseVersion.java +++ b/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/DatabaseVersion.java @@ -152,7 +152,7 @@ public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType } public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { - return com.google.cloud.alloydb.v1alpha.ResourcesProto.getDescriptor().getEnumTypes().get(0); + return com.google.cloud.alloydb.v1alpha.ResourcesProto.getDescriptor().getEnumTypes().get(2); } private static final DatabaseVersion[] VALUES = values(); diff --git a/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/DeleteUserRequest.java b/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/DeleteUserRequest.java new file mode 100644 index 000000000000..3fb79c299cea --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/DeleteUserRequest.java @@ -0,0 +1,1008 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/alloydb/v1alpha/service.proto + +package com.google.cloud.alloydb.v1alpha; + +/** + * + * + *
+ * Message for deleting a User
+ * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1alpha.DeleteUserRequest} + */ +public final class DeleteUserRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.alloydb.v1alpha.DeleteUserRequest) + DeleteUserRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use DeleteUserRequest.newBuilder() to construct. + private DeleteUserRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private DeleteUserRequest() { + name_ = ""; + requestId_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new DeleteUserRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.alloydb.v1alpha.ServiceProto + .internal_static_google_cloud_alloydb_v1alpha_DeleteUserRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1alpha.ServiceProto + .internal_static_google_cloud_alloydb_v1alpha_DeleteUserRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1alpha.DeleteUserRequest.class, + com.google.cloud.alloydb.v1alpha.DeleteUserRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + * + * + *
+   * Required. The name of the resource. For the required format, see the
+   * comment on the User.name field.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The name of the resource. For the required format, see the
+   * comment on the User.name field.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int REQUEST_ID_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object 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).
+   * 
+ * + * string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The requestId. + */ + @java.lang.Override + public java.lang.String getRequestId() { + java.lang.Object ref = requestId_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + requestId_ = s; + return s; + } + } + /** + * + * + *
+   * Optional. An optional request ID to identify requests. Specify a unique
+   * request ID so that if you must retry your request, the server will know to
+   * ignore the request if it has already been completed. The server will
+   * guarantee that for at least 60 minutes after the first request.
+   *
+   * For example, consider a situation where you make an initial request and
+   * the request times out. If you make the request again with the same request
+   * ID, the server can check if original operation with the same request ID
+   * was received, and if so, will ignore the second request. This prevents
+   * clients from accidentally creating duplicate commitments.
+   *
+   * The request ID must be a valid UUID with the exception that zero UUID is
+   * not supported (00000000-0000-0000-0000-000000000000).
+   * 
+ * + * string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for requestId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getRequestIdBytes() { + java.lang.Object ref = requestId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + requestId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int VALIDATE_ONLY_FIELD_NUMBER = 3; + private boolean validateOnly_ = false; + /** + * + * + *
+   * Optional. If set, the backend validates the request, but doesn't actually
+   * execute it.
+   * 
+ * + * bool validate_only = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The validateOnly. + */ + @java.lang.Override + public boolean getValidateOnly() { + return validateOnly_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(requestId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, requestId_); + } + if (validateOnly_ != false) { + output.writeBool(3, validateOnly_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(requestId_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, requestId_); + } + if (validateOnly_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(3, validateOnly_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.alloydb.v1alpha.DeleteUserRequest)) { + return super.equals(obj); + } + com.google.cloud.alloydb.v1alpha.DeleteUserRequest other = + (com.google.cloud.alloydb.v1alpha.DeleteUserRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (!getRequestId().equals(other.getRequestId())) return false; + if (getValidateOnly() != other.getValidateOnly()) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (37 * hash) + REQUEST_ID_FIELD_NUMBER; + hash = (53 * hash) + getRequestId().hashCode(); + hash = (37 * hash) + VALIDATE_ONLY_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getValidateOnly()); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.alloydb.v1alpha.DeleteUserRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1alpha.DeleteUserRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.alloydb.v1alpha.DeleteUserRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1alpha.DeleteUserRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.alloydb.v1alpha.DeleteUserRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1alpha.DeleteUserRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.alloydb.v1alpha.DeleteUserRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1alpha.DeleteUserRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.alloydb.v1alpha.DeleteUserRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1alpha.DeleteUserRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.alloydb.v1alpha.DeleteUserRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1alpha.DeleteUserRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.alloydb.v1alpha.DeleteUserRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Message for deleting a User
+   * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1alpha.DeleteUserRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.alloydb.v1alpha.DeleteUserRequest) + com.google.cloud.alloydb.v1alpha.DeleteUserRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.alloydb.v1alpha.ServiceProto + .internal_static_google_cloud_alloydb_v1alpha_DeleteUserRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1alpha.ServiceProto + .internal_static_google_cloud_alloydb_v1alpha_DeleteUserRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1alpha.DeleteUserRequest.class, + com.google.cloud.alloydb.v1alpha.DeleteUserRequest.Builder.class); + } + + // Construct using com.google.cloud.alloydb.v1alpha.DeleteUserRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + requestId_ = ""; + validateOnly_ = false; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.alloydb.v1alpha.ServiceProto + .internal_static_google_cloud_alloydb_v1alpha_DeleteUserRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.DeleteUserRequest getDefaultInstanceForType() { + return com.google.cloud.alloydb.v1alpha.DeleteUserRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.DeleteUserRequest build() { + com.google.cloud.alloydb.v1alpha.DeleteUserRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.DeleteUserRequest buildPartial() { + com.google.cloud.alloydb.v1alpha.DeleteUserRequest result = + new com.google.cloud.alloydb.v1alpha.DeleteUserRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.alloydb.v1alpha.DeleteUserRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.requestId_ = requestId_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.validateOnly_ = validateOnly_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.alloydb.v1alpha.DeleteUserRequest) { + return mergeFrom((com.google.cloud.alloydb.v1alpha.DeleteUserRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.alloydb.v1alpha.DeleteUserRequest other) { + if (other == com.google.cloud.alloydb.v1alpha.DeleteUserRequest.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getRequestId().isEmpty()) { + requestId_ = other.requestId_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (other.getValidateOnly() != false) { + setValidateOnly(other.getValidateOnly()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + requestId_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 24: + { + validateOnly_ = input.readBool(); + bitField0_ |= 0x00000004; + break; + } // case 24 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. The name of the resource. For the required format, see the
+     * comment on the User.name field.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The name of the resource. For the required format, see the
+     * comment on the User.name field.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The name of the resource. For the required format, see the
+     * comment on the User.name field.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the resource. For the required format, see the
+     * comment on the User.name field.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the resource. For the required format, see the
+     * comment on the User.name field.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object 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).
+     * 
+ * + * string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The requestId. + */ + public java.lang.String getRequestId() { + java.lang.Object ref = requestId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + requestId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes after the first request.
+     *
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     *
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for requestId. + */ + public com.google.protobuf.ByteString getRequestIdBytes() { + java.lang.Object ref = requestId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + requestId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes after the first request.
+     *
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     *
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The requestId to set. + * @return This builder for chaining. + */ + public Builder setRequestId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + requestId_ = value; + bitField0_ |= 0x00000002; + onChanged(); + 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).
+     * 
+ * + * string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearRequestId() { + requestId_ = getDefaultInstance().getRequestId(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + 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).
+     * 
+ * + * string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for requestId to set. + * @return This builder for chaining. + */ + public Builder setRequestIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + requestId_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private boolean validateOnly_; + /** + * + * + *
+     * Optional. If set, the backend validates the request, but doesn't actually
+     * execute it.
+     * 
+ * + * bool validate_only = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The validateOnly. + */ + @java.lang.Override + public boolean getValidateOnly() { + return validateOnly_; + } + /** + * + * + *
+     * Optional. If set, the backend validates the request, but doesn't actually
+     * execute it.
+     * 
+ * + * bool validate_only = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The validateOnly to set. + * @return This builder for chaining. + */ + public Builder setValidateOnly(boolean value) { + + validateOnly_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. If set, the backend validates the request, but doesn't actually
+     * execute it.
+     * 
+ * + * bool validate_only = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearValidateOnly() { + bitField0_ = (bitField0_ & ~0x00000004); + validateOnly_ = false; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.alloydb.v1alpha.DeleteUserRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.alloydb.v1alpha.DeleteUserRequest) + private static final com.google.cloud.alloydb.v1alpha.DeleteUserRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.alloydb.v1alpha.DeleteUserRequest(); + } + + public static com.google.cloud.alloydb.v1alpha.DeleteUserRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DeleteUserRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.DeleteUserRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/DeleteUserRequestOrBuilder.java b/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/DeleteUserRequestOrBuilder.java new file mode 100644 index 000000000000..8bf19858d1dd --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/DeleteUserRequestOrBuilder.java @@ -0,0 +1,119 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/alloydb/v1alpha/service.proto + +package com.google.cloud.alloydb.v1alpha; + +public interface DeleteUserRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.alloydb.v1alpha.DeleteUserRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The name of the resource. For the required format, see the
+   * comment on the User.name field.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. The name of the resource. For the required format, see the
+   * comment on the User.name field.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * Optional. An optional request ID to identify requests. Specify a unique
+   * request ID so that if you must retry your request, the server will know to
+   * ignore the request if it has already been completed. The server will
+   * guarantee that for at least 60 minutes after the first request.
+   *
+   * For example, consider a situation where you make an initial request and
+   * the request times out. If you make the request again with the same request
+   * ID, the server can check if original operation with the same request ID
+   * was received, and if so, will ignore the second request. This prevents
+   * clients from accidentally creating duplicate commitments.
+   *
+   * The request ID must be a valid UUID with the exception that zero UUID is
+   * not supported (00000000-0000-0000-0000-000000000000).
+   * 
+ * + * string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The requestId. + */ + java.lang.String getRequestId(); + /** + * + * + *
+   * Optional. An optional request ID to identify requests. Specify a unique
+   * request ID so that if you must retry your request, the server will know to
+   * ignore the request if it has already been completed. The server will
+   * guarantee that for at least 60 minutes after the first request.
+   *
+   * For example, consider a situation where you make an initial request and
+   * the request times out. If you make the request again with the same request
+   * ID, the server can check if original operation with the same request ID
+   * was received, and if so, will ignore the second request. This prevents
+   * clients from accidentally creating duplicate commitments.
+   *
+   * The request ID must be a valid UUID with the exception that zero UUID is
+   * not supported (00000000-0000-0000-0000-000000000000).
+   * 
+ * + * string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for requestId. + */ + com.google.protobuf.ByteString getRequestIdBytes(); + + /** + * + * + *
+   * Optional. If set, the backend validates the request, but doesn't actually
+   * execute it.
+   * 
+ * + * bool validate_only = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The validateOnly. + */ + boolean getValidateOnly(); +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/GenerateClientCertificateRequest.java b/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/GenerateClientCertificateRequest.java index 4816ba8d01bb..4f50f1daac71 100644 --- a/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/GenerateClientCertificateRequest.java +++ b/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/GenerateClientCertificateRequest.java @@ -43,6 +43,7 @@ private GenerateClientCertificateRequest() { parent_ = ""; requestId_ = ""; pemCsr_ = ""; + publicKey_ = ""; } @java.lang.Override @@ -209,11 +210,14 @@ public com.google.protobuf.ByteString getRequestIdBytes() { * Optional. A pem-encoded X.509 certificate signing request (CSR). * * - * string pem_csr = 3 [(.google.api.field_behavior) = OPTIONAL]; + * string pem_csr = 3 [deprecated = true, (.google.api.field_behavior) = OPTIONAL]; * + * @deprecated google.cloud.alloydb.v1alpha.GenerateClientCertificateRequest.pem_csr is + * deprecated. See google/cloud/alloydb/v1alpha/service.proto;l=1351 * @return The pemCsr. */ @java.lang.Override + @java.lang.Deprecated public java.lang.String getPemCsr() { java.lang.Object ref = pemCsr_; if (ref instanceof java.lang.String) { @@ -232,11 +236,14 @@ public java.lang.String getPemCsr() { * Optional. A pem-encoded X.509 certificate signing request (CSR). * * - * string pem_csr = 3 [(.google.api.field_behavior) = OPTIONAL]; + * string pem_csr = 3 [deprecated = true, (.google.api.field_behavior) = OPTIONAL]; * + * @deprecated google.cloud.alloydb.v1alpha.GenerateClientCertificateRequest.pem_csr is + * deprecated. See google/cloud/alloydb/v1alpha/service.proto;l=1351 * @return The bytes for pemCsr. */ @java.lang.Override + @java.lang.Deprecated public com.google.protobuf.ByteString getPemCsrBytes() { java.lang.Object ref = pemCsr_; if (ref instanceof java.lang.String) { @@ -314,6 +321,57 @@ public com.google.protobuf.DurationOrBuilder getCertDurationOrBuilder() { : certDuration_; } + public static final int PUBLIC_KEY_FIELD_NUMBER = 5; + + @SuppressWarnings("serial") + private volatile java.lang.Object publicKey_ = ""; + /** + * + * + *
+   * Optional. The public key from the client.
+   * 
+ * + * string public_key = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The publicKey. + */ + @java.lang.Override + public java.lang.String getPublicKey() { + java.lang.Object ref = publicKey_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + publicKey_ = s; + return s; + } + } + /** + * + * + *
+   * Optional. The public key from the client.
+   * 
+ * + * string public_key = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for publicKey. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPublicKeyBytes() { + java.lang.Object ref = publicKey_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + publicKey_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + private byte memoizedIsInitialized = -1; @java.lang.Override @@ -340,6 +398,9 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (certDuration_ != null) { output.writeMessage(4, getCertDuration()); } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(publicKey_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 5, publicKey_); + } getUnknownFields().writeTo(output); } @@ -361,6 +422,9 @@ public int getSerializedSize() { if (certDuration_ != null) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, getCertDuration()); } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(publicKey_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, publicKey_); + } size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; @@ -384,6 +448,7 @@ public boolean equals(final java.lang.Object obj) { if (hasCertDuration()) { if (!getCertDuration().equals(other.getCertDuration())) return false; } + if (!getPublicKey().equals(other.getPublicKey())) return false; if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -405,6 +470,8 @@ public int hashCode() { hash = (37 * hash) + CERT_DURATION_FIELD_NUMBER; hash = (53 * hash) + getCertDuration().hashCode(); } + hash = (37 * hash) + PUBLIC_KEY_FIELD_NUMBER; + hash = (53 * hash) + getPublicKey().hashCode(); hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; @@ -556,6 +623,7 @@ public Builder clear() { certDurationBuilder_.dispose(); certDurationBuilder_ = null; } + publicKey_ = ""; return this; } @@ -607,6 +675,9 @@ private void buildPartial0( result.certDuration_ = certDurationBuilder_ == null ? certDuration_ : certDurationBuilder_.build(); } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.publicKey_ = publicKey_; + } } @java.lang.Override @@ -675,6 +746,11 @@ public Builder mergeFrom( if (other.hasCertDuration()) { mergeCertDuration(other.getCertDuration()); } + if (!other.getPublicKey().isEmpty()) { + publicKey_ = other.publicKey_; + bitField0_ |= 0x00000010; + onChanged(); + } this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; @@ -725,6 +801,12 @@ public Builder mergeFrom( bitField0_ |= 0x00000008; break; } // case 34 + case 42: + { + publicKey_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000010; + break; + } // case 42 default: { if (!super.parseUnknownField(input, extensionRegistry, tag)) { @@ -1039,10 +1121,13 @@ public Builder setRequestIdBytes(com.google.protobuf.ByteString value) { * Optional. A pem-encoded X.509 certificate signing request (CSR). * * - * string pem_csr = 3 [(.google.api.field_behavior) = OPTIONAL]; + * string pem_csr = 3 [deprecated = true, (.google.api.field_behavior) = OPTIONAL]; * + * @deprecated google.cloud.alloydb.v1alpha.GenerateClientCertificateRequest.pem_csr is + * deprecated. See google/cloud/alloydb/v1alpha/service.proto;l=1351 * @return The pemCsr. */ + @java.lang.Deprecated public java.lang.String getPemCsr() { java.lang.Object ref = pemCsr_; if (!(ref instanceof java.lang.String)) { @@ -1061,10 +1146,13 @@ public java.lang.String getPemCsr() { * Optional. A pem-encoded X.509 certificate signing request (CSR). * * - * string pem_csr = 3 [(.google.api.field_behavior) = OPTIONAL]; + * string pem_csr = 3 [deprecated = true, (.google.api.field_behavior) = OPTIONAL]; * + * @deprecated google.cloud.alloydb.v1alpha.GenerateClientCertificateRequest.pem_csr is + * deprecated. See google/cloud/alloydb/v1alpha/service.proto;l=1351 * @return The bytes for pemCsr. */ + @java.lang.Deprecated public com.google.protobuf.ByteString getPemCsrBytes() { java.lang.Object ref = pemCsr_; if (ref instanceof String) { @@ -1083,11 +1171,14 @@ public com.google.protobuf.ByteString getPemCsrBytes() { * Optional. A pem-encoded X.509 certificate signing request (CSR). * * - * string pem_csr = 3 [(.google.api.field_behavior) = OPTIONAL]; + * string pem_csr = 3 [deprecated = true, (.google.api.field_behavior) = OPTIONAL]; * + * @deprecated google.cloud.alloydb.v1alpha.GenerateClientCertificateRequest.pem_csr is + * deprecated. See google/cloud/alloydb/v1alpha/service.proto;l=1351 * @param value The pemCsr to set. * @return This builder for chaining. */ + @java.lang.Deprecated public Builder setPemCsr(java.lang.String value) { if (value == null) { throw new NullPointerException(); @@ -1104,10 +1195,13 @@ public Builder setPemCsr(java.lang.String value) { * Optional. A pem-encoded X.509 certificate signing request (CSR). * * - * string pem_csr = 3 [(.google.api.field_behavior) = OPTIONAL]; + * string pem_csr = 3 [deprecated = true, (.google.api.field_behavior) = OPTIONAL]; * + * @deprecated google.cloud.alloydb.v1alpha.GenerateClientCertificateRequest.pem_csr is + * deprecated. See google/cloud/alloydb/v1alpha/service.proto;l=1351 * @return This builder for chaining. */ + @java.lang.Deprecated public Builder clearPemCsr() { pemCsr_ = getDefaultInstance().getPemCsr(); bitField0_ = (bitField0_ & ~0x00000004); @@ -1121,11 +1215,14 @@ public Builder clearPemCsr() { * Optional. A pem-encoded X.509 certificate signing request (CSR). * * - * string pem_csr = 3 [(.google.api.field_behavior) = OPTIONAL]; + * string pem_csr = 3 [deprecated = true, (.google.api.field_behavior) = OPTIONAL]; * + * @deprecated google.cloud.alloydb.v1alpha.GenerateClientCertificateRequest.pem_csr is + * deprecated. See google/cloud/alloydb/v1alpha/service.proto;l=1351 * @param value The bytes for pemCsr to set. * @return This builder for chaining. */ + @java.lang.Deprecated public Builder setPemCsrBytes(com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); @@ -1365,6 +1462,112 @@ public com.google.protobuf.DurationOrBuilder getCertDurationOrBuilder() { return certDurationBuilder_; } + private java.lang.Object publicKey_ = ""; + /** + * + * + *
+     * Optional. The public key from the client.
+     * 
+ * + * string public_key = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The publicKey. + */ + public java.lang.String getPublicKey() { + java.lang.Object ref = publicKey_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + publicKey_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Optional. The public key from the client.
+     * 
+ * + * string public_key = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for publicKey. + */ + public com.google.protobuf.ByteString getPublicKeyBytes() { + java.lang.Object ref = publicKey_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + publicKey_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Optional. The public key from the client.
+     * 
+ * + * string public_key = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The publicKey to set. + * @return This builder for chaining. + */ + public Builder setPublicKey(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + publicKey_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The public key from the client.
+     * 
+ * + * string public_key = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearPublicKey() { + publicKey_ = getDefaultInstance().getPublicKey(); + bitField0_ = (bitField0_ & ~0x00000010); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The public key from the client.
+     * 
+ * + * string public_key = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for publicKey to set. + * @return This builder for chaining. + */ + public Builder setPublicKeyBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + publicKey_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + @java.lang.Override public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { return super.setUnknownFields(unknownFields); diff --git a/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/GenerateClientCertificateRequestOrBuilder.java b/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/GenerateClientCertificateRequestOrBuilder.java index 02a42ebeb9cc..30138013088a 100644 --- a/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/GenerateClientCertificateRequestOrBuilder.java +++ b/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/GenerateClientCertificateRequestOrBuilder.java @@ -110,10 +110,13 @@ public interface GenerateClientCertificateRequestOrBuilder * Optional. A pem-encoded X.509 certificate signing request (CSR). * * - * string pem_csr = 3 [(.google.api.field_behavior) = OPTIONAL]; + * string pem_csr = 3 [deprecated = true, (.google.api.field_behavior) = OPTIONAL]; * + * @deprecated google.cloud.alloydb.v1alpha.GenerateClientCertificateRequest.pem_csr is + * deprecated. See google/cloud/alloydb/v1alpha/service.proto;l=1351 * @return The pemCsr. */ + @java.lang.Deprecated java.lang.String getPemCsr(); /** * @@ -122,10 +125,13 @@ public interface GenerateClientCertificateRequestOrBuilder * Optional. A pem-encoded X.509 certificate signing request (CSR). * * - * string pem_csr = 3 [(.google.api.field_behavior) = OPTIONAL]; + * string pem_csr = 3 [deprecated = true, (.google.api.field_behavior) = OPTIONAL]; * + * @deprecated google.cloud.alloydb.v1alpha.GenerateClientCertificateRequest.pem_csr is + * deprecated. See google/cloud/alloydb/v1alpha/service.proto;l=1351 * @return The bytes for pemCsr. */ + @java.lang.Deprecated com.google.protobuf.ByteString getPemCsrBytes(); /** @@ -177,4 +183,29 @@ public interface GenerateClientCertificateRequestOrBuilder *
*/ com.google.protobuf.DurationOrBuilder getCertDurationOrBuilder(); + + /** + * + * + *
+   * Optional. The public key from the client.
+   * 
+ * + * string public_key = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The publicKey. + */ + java.lang.String getPublicKey(); + /** + * + * + *
+   * Optional. The public key from the client.
+   * 
+ * + * string public_key = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for publicKey. + */ + com.google.protobuf.ByteString getPublicKeyBytes(); } diff --git a/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/GenerateClientCertificateResponse.java b/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/GenerateClientCertificateResponse.java index 07a7ce2424fb..f6bf2f36464f 100644 --- a/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/GenerateClientCertificateResponse.java +++ b/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/GenerateClientCertificateResponse.java @@ -41,6 +41,7 @@ private GenerateClientCertificateResponse( private GenerateClientCertificateResponse() { pemCertificate_ = ""; pemCertificateChain_ = com.google.protobuf.LazyStringArrayList.emptyList(); + caCert_ = ""; } @java.lang.Override @@ -187,6 +188,57 @@ public com.google.protobuf.ByteString getPemCertificateChainBytes(int index) { return pemCertificateChain_.getByteString(index); } + public static final int CA_CERT_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object caCert_ = ""; + /** + * + * + *
+   * Optional. The pem-encoded cluster ca X.509 certificate.
+   * 
+ * + * string ca_cert = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The caCert. + */ + @java.lang.Override + public java.lang.String getCaCert() { + java.lang.Object ref = caCert_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + caCert_ = s; + return s; + } + } + /** + * + * + *
+   * Optional. The pem-encoded cluster ca X.509 certificate.
+   * 
+ * + * string ca_cert = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for caCert. + */ + @java.lang.Override + public com.google.protobuf.ByteString getCaCertBytes() { + java.lang.Object ref = caCert_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + caCert_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + private byte memoizedIsInitialized = -1; @java.lang.Override @@ -207,6 +259,9 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io for (int i = 0; i < pemCertificateChain_.size(); i++) { com.google.protobuf.GeneratedMessageV3.writeString(output, 2, pemCertificateChain_.getRaw(i)); } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(caCert_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, caCert_); + } getUnknownFields().writeTo(output); } @@ -227,6 +282,9 @@ public int getSerializedSize() { size += dataSize; size += 1 * getPemCertificateChainList().size(); } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(caCert_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, caCert_); + } size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; @@ -245,6 +303,7 @@ public boolean equals(final java.lang.Object obj) { if (!getPemCertificate().equals(other.getPemCertificate())) return false; if (!getPemCertificateChainList().equals(other.getPemCertificateChainList())) return false; + if (!getCaCert().equals(other.getCaCert())) return false; if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -262,6 +321,8 @@ public int hashCode() { hash = (37 * hash) + PEM_CERTIFICATE_CHAIN_FIELD_NUMBER; hash = (53 * hash) + getPemCertificateChainList().hashCode(); } + hash = (37 * hash) + CA_CERT_FIELD_NUMBER; + hash = (53 * hash) + getCaCert().hashCode(); hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; @@ -406,6 +467,7 @@ public Builder clear() { bitField0_ = 0; pemCertificate_ = ""; pemCertificateChain_ = com.google.protobuf.LazyStringArrayList.emptyList(); + caCert_ = ""; return this; } @@ -452,6 +514,9 @@ private void buildPartial0( pemCertificateChain_.makeImmutable(); result.pemCertificateChain_ = pemCertificateChain_; } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.caCert_ = caCert_; + } } @java.lang.Override @@ -518,6 +583,11 @@ public Builder mergeFrom( } onChanged(); } + if (!other.getCaCert().isEmpty()) { + caCert_ = other.caCert_; + bitField0_ |= 0x00000004; + onChanged(); + } this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; @@ -557,6 +627,12 @@ public Builder mergeFrom( pemCertificateChain_.add(s); break; } // case 18 + case 26: + { + caCert_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 default: { if (!super.parseUnknownField(input, extensionRegistry, tag)) { @@ -874,6 +950,112 @@ public Builder addPemCertificateChainBytes(com.google.protobuf.ByteString value) return this; } + private java.lang.Object caCert_ = ""; + /** + * + * + *
+     * Optional. The pem-encoded cluster ca X.509 certificate.
+     * 
+ * + * string ca_cert = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The caCert. + */ + public java.lang.String getCaCert() { + java.lang.Object ref = caCert_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + caCert_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Optional. The pem-encoded cluster ca X.509 certificate.
+     * 
+ * + * string ca_cert = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for caCert. + */ + public com.google.protobuf.ByteString getCaCertBytes() { + java.lang.Object ref = caCert_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + caCert_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Optional. The pem-encoded cluster ca X.509 certificate.
+     * 
+ * + * string ca_cert = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The caCert to set. + * @return This builder for chaining. + */ + public Builder setCaCert(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + caCert_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The pem-encoded cluster ca X.509 certificate.
+     * 
+ * + * string ca_cert = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearCaCert() { + caCert_ = getDefaultInstance().getCaCert(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The pem-encoded cluster ca X.509 certificate.
+     * 
+ * + * string ca_cert = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for caCert to set. + * @return This builder for chaining. + */ + public Builder setCaCertBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + caCert_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + @java.lang.Override public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { return super.setUnknownFields(unknownFields); diff --git a/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/GenerateClientCertificateResponseOrBuilder.java b/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/GenerateClientCertificateResponseOrBuilder.java index 1da63b5cad12..a5af059f09d7 100644 --- a/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/GenerateClientCertificateResponseOrBuilder.java +++ b/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/GenerateClientCertificateResponseOrBuilder.java @@ -106,4 +106,29 @@ public interface GenerateClientCertificateResponseOrBuilder * @return The bytes of the pemCertificateChain at the given index. */ com.google.protobuf.ByteString getPemCertificateChainBytes(int index); + + /** + * + * + *
+   * Optional. The pem-encoded cluster ca X.509 certificate.
+   * 
+ * + * string ca_cert = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The caCert. + */ + java.lang.String getCaCert(); + /** + * + * + *
+   * Optional. The pem-encoded cluster ca X.509 certificate.
+   * 
+ * + * string ca_cert = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for caCert. + */ + com.google.protobuf.ByteString getCaCertBytes(); } diff --git a/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/GetClusterRequest.java b/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/GetClusterRequest.java index 14fd1b140070..5322b276a923 100644 --- a/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/GetClusterRequest.java +++ b/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/GetClusterRequest.java @@ -39,6 +39,7 @@ private GetClusterRequest(com.google.protobuf.GeneratedMessageV3.Builder buil private GetClusterRequest() { name_ = ""; + view_ = 0; } @java.lang.Override @@ -119,6 +120,47 @@ public com.google.protobuf.ByteString getNameBytes() { } } + public static final int VIEW_FIELD_NUMBER = 2; + private int view_ = 0; + /** + * + * + *
+   * Optional. The view of the cluster to return. Returns all default fields if
+   * not set.
+   * 
+ * + * + * .google.cloud.alloydb.v1alpha.ClusterView view = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The enum numeric value on the wire for view. + */ + @java.lang.Override + public int getViewValue() { + return view_; + } + /** + * + * + *
+   * Optional. The view of the cluster to return. Returns all default fields if
+   * not set.
+   * 
+ * + * + * .google.cloud.alloydb.v1alpha.ClusterView view = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The view. + */ + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.ClusterView getView() { + com.google.cloud.alloydb.v1alpha.ClusterView result = + com.google.cloud.alloydb.v1alpha.ClusterView.forNumber(view_); + return result == null ? com.google.cloud.alloydb.v1alpha.ClusterView.UNRECOGNIZED : result; + } + private byte memoizedIsInitialized = -1; @java.lang.Override @@ -136,6 +178,10 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); } + if (view_ + != com.google.cloud.alloydb.v1alpha.ClusterView.CLUSTER_VIEW_UNSPECIFIED.getNumber()) { + output.writeEnum(2, view_); + } getUnknownFields().writeTo(output); } @@ -148,6 +194,10 @@ public int getSerializedSize() { if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); } + if (view_ + != com.google.cloud.alloydb.v1alpha.ClusterView.CLUSTER_VIEW_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(2, view_); + } size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; @@ -165,6 +215,7 @@ public boolean equals(final java.lang.Object obj) { (com.google.cloud.alloydb.v1alpha.GetClusterRequest) obj; if (!getName().equals(other.getName())) return false; + if (view_ != other.view_) return false; if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -178,6 +229,8 @@ public int hashCode() { hash = (19 * hash) + getDescriptor().hashCode(); hash = (37 * hash) + NAME_FIELD_NUMBER; hash = (53 * hash) + getName().hashCode(); + hash = (37 * hash) + VIEW_FIELD_NUMBER; + hash = (53 * hash) + view_; hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; @@ -318,6 +371,7 @@ public Builder clear() { super.clear(); bitField0_ = 0; name_ = ""; + view_ = 0; return this; } @@ -357,6 +411,9 @@ private void buildPartial0(com.google.cloud.alloydb.v1alpha.GetClusterRequest re if (((from_bitField0_ & 0x00000001) != 0)) { result.name_ = name_; } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.view_ = view_; + } } @java.lang.Override @@ -410,6 +467,9 @@ public Builder mergeFrom(com.google.cloud.alloydb.v1alpha.GetClusterRequest othe bitField0_ |= 0x00000001; onChanged(); } + if (other.view_ != 0) { + setViewValue(other.getViewValue()); + } this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; @@ -442,6 +502,12 @@ public Builder mergeFrom( bitField0_ |= 0x00000001; break; } // case 10 + case 16: + { + view_ = input.readEnum(); + bitField0_ |= 0x00000002; + break; + } // case 16 default: { if (!super.parseUnknownField(input, extensionRegistry, tag)) { @@ -582,6 +648,111 @@ public Builder setNameBytes(com.google.protobuf.ByteString value) { return this; } + private int view_ = 0; + /** + * + * + *
+     * Optional. The view of the cluster to return. Returns all default fields if
+     * not set.
+     * 
+ * + * + * .google.cloud.alloydb.v1alpha.ClusterView view = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The enum numeric value on the wire for view. + */ + @java.lang.Override + public int getViewValue() { + return view_; + } + /** + * + * + *
+     * Optional. The view of the cluster to return. Returns all default fields if
+     * not set.
+     * 
+ * + * + * .google.cloud.alloydb.v1alpha.ClusterView view = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param value The enum numeric value on the wire for view to set. + * @return This builder for chaining. + */ + public Builder setViewValue(int value) { + view_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The view of the cluster to return. Returns all default fields if
+     * not set.
+     * 
+ * + * + * .google.cloud.alloydb.v1alpha.ClusterView view = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The view. + */ + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.ClusterView getView() { + com.google.cloud.alloydb.v1alpha.ClusterView result = + com.google.cloud.alloydb.v1alpha.ClusterView.forNumber(view_); + return result == null ? com.google.cloud.alloydb.v1alpha.ClusterView.UNRECOGNIZED : result; + } + /** + * + * + *
+     * Optional. The view of the cluster to return. Returns all default fields if
+     * not set.
+     * 
+ * + * + * .google.cloud.alloydb.v1alpha.ClusterView view = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param value The view to set. + * @return This builder for chaining. + */ + public Builder setView(com.google.cloud.alloydb.v1alpha.ClusterView value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000002; + view_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The view of the cluster to return. Returns all default fields if
+     * not set.
+     * 
+ * + * + * .google.cloud.alloydb.v1alpha.ClusterView view = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return This builder for chaining. + */ + public Builder clearView() { + bitField0_ = (bitField0_ & ~0x00000002); + view_ = 0; + onChanged(); + return this; + } + @java.lang.Override public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { return super.setUnknownFields(unknownFields); diff --git a/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/GetClusterRequestOrBuilder.java b/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/GetClusterRequestOrBuilder.java index 948617dec8f9..b5f6c98a12b4 100644 --- a/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/GetClusterRequestOrBuilder.java +++ b/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/GetClusterRequestOrBuilder.java @@ -53,4 +53,35 @@ public interface GetClusterRequestOrBuilder * @return The bytes for name. */ com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * Optional. The view of the cluster to return. Returns all default fields if
+   * not set.
+   * 
+ * + * + * .google.cloud.alloydb.v1alpha.ClusterView view = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The enum numeric value on the wire for view. + */ + int getViewValue(); + /** + * + * + *
+   * Optional. The view of the cluster to return. Returns all default fields if
+   * not set.
+   * 
+ * + * + * .google.cloud.alloydb.v1alpha.ClusterView view = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The view. + */ + com.google.cloud.alloydb.v1alpha.ClusterView getView(); } diff --git a/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/GetUserRequest.java b/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/GetUserRequest.java new file mode 100644 index 000000000000..37d40b99db02 --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/GetUserRequest.java @@ -0,0 +1,645 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/alloydb/v1alpha/service.proto + +package com.google.cloud.alloydb.v1alpha; + +/** + * + * + *
+ * Message for getting a User
+ * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1alpha.GetUserRequest} + */ +public final class GetUserRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.alloydb.v1alpha.GetUserRequest) + GetUserRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use GetUserRequest.newBuilder() to construct. + private GetUserRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private GetUserRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new GetUserRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.alloydb.v1alpha.ServiceProto + .internal_static_google_cloud_alloydb_v1alpha_GetUserRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1alpha.ServiceProto + .internal_static_google_cloud_alloydb_v1alpha_GetUserRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1alpha.GetUserRequest.class, + com.google.cloud.alloydb.v1alpha.GetUserRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + * + * + *
+   * Required. The name of the resource. For the required format, see the
+   * comment on the User.name field.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The name of the resource. For the required format, see the
+   * comment on the User.name field.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.alloydb.v1alpha.GetUserRequest)) { + return super.equals(obj); + } + com.google.cloud.alloydb.v1alpha.GetUserRequest other = + (com.google.cloud.alloydb.v1alpha.GetUserRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.alloydb.v1alpha.GetUserRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1alpha.GetUserRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.alloydb.v1alpha.GetUserRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1alpha.GetUserRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.alloydb.v1alpha.GetUserRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1alpha.GetUserRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.alloydb.v1alpha.GetUserRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1alpha.GetUserRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.alloydb.v1alpha.GetUserRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1alpha.GetUserRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.alloydb.v1alpha.GetUserRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1alpha.GetUserRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.alloydb.v1alpha.GetUserRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Message for getting a User
+   * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1alpha.GetUserRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.alloydb.v1alpha.GetUserRequest) + com.google.cloud.alloydb.v1alpha.GetUserRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.alloydb.v1alpha.ServiceProto + .internal_static_google_cloud_alloydb_v1alpha_GetUserRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1alpha.ServiceProto + .internal_static_google_cloud_alloydb_v1alpha_GetUserRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1alpha.GetUserRequest.class, + com.google.cloud.alloydb.v1alpha.GetUserRequest.Builder.class); + } + + // Construct using com.google.cloud.alloydb.v1alpha.GetUserRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.alloydb.v1alpha.ServiceProto + .internal_static_google_cloud_alloydb_v1alpha_GetUserRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.GetUserRequest getDefaultInstanceForType() { + return com.google.cloud.alloydb.v1alpha.GetUserRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.GetUserRequest build() { + com.google.cloud.alloydb.v1alpha.GetUserRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.GetUserRequest buildPartial() { + com.google.cloud.alloydb.v1alpha.GetUserRequest result = + new com.google.cloud.alloydb.v1alpha.GetUserRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.alloydb.v1alpha.GetUserRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.alloydb.v1alpha.GetUserRequest) { + return mergeFrom((com.google.cloud.alloydb.v1alpha.GetUserRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.alloydb.v1alpha.GetUserRequest other) { + if (other == com.google.cloud.alloydb.v1alpha.GetUserRequest.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. The name of the resource. For the required format, see the
+     * comment on the User.name field.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The name of the resource. For the required format, see the
+     * comment on the User.name field.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The name of the resource. For the required format, see the
+     * comment on the User.name field.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the resource. For the required format, see the
+     * comment on the User.name field.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the resource. For the required format, see the
+     * comment on the User.name field.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.alloydb.v1alpha.GetUserRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.alloydb.v1alpha.GetUserRequest) + private static final com.google.cloud.alloydb.v1alpha.GetUserRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.alloydb.v1alpha.GetUserRequest(); + } + + public static com.google.cloud.alloydb.v1alpha.GetUserRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GetUserRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.GetUserRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/GetUserRequestOrBuilder.java b/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/GetUserRequestOrBuilder.java new file mode 100644 index 000000000000..d8b6ff01f6e1 --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/GetUserRequestOrBuilder.java @@ -0,0 +1,56 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/alloydb/v1alpha/service.proto + +package com.google.cloud.alloydb.v1alpha; + +public interface GetUserRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.alloydb.v1alpha.GetUserRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The name of the resource. For the required format, see the
+   * comment on the User.name field.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. The name of the resource. For the required format, see the
+   * comment on the User.name field.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/InjectFaultRequest.java b/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/InjectFaultRequest.java new file mode 100644 index 000000000000..f5a19d8ea692 --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/InjectFaultRequest.java @@ -0,0 +1,1321 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/alloydb/v1alpha/service.proto + +package com.google.cloud.alloydb.v1alpha; + +/** + * + * + *
+ * Message for triggering fault injection on an instance
+ * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1alpha.InjectFaultRequest} + */ +public final class InjectFaultRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.alloydb.v1alpha.InjectFaultRequest) + InjectFaultRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use InjectFaultRequest.newBuilder() to construct. + private InjectFaultRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private InjectFaultRequest() { + faultType_ = 0; + name_ = ""; + requestId_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new InjectFaultRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.alloydb.v1alpha.ServiceProto + .internal_static_google_cloud_alloydb_v1alpha_InjectFaultRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1alpha.ServiceProto + .internal_static_google_cloud_alloydb_v1alpha_InjectFaultRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1alpha.InjectFaultRequest.class, + com.google.cloud.alloydb.v1alpha.InjectFaultRequest.Builder.class); + } + + /** + * + * + *
+   * FaultType contains all valid types of faults that can be injected to an
+   * instance.
+   * 
+ * + * Protobuf enum {@code google.cloud.alloydb.v1alpha.InjectFaultRequest.FaultType} + */ + public enum FaultType implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * The fault type is unknown.
+     * 
+ * + * FAULT_TYPE_UNSPECIFIED = 0; + */ + FAULT_TYPE_UNSPECIFIED(0), + /** + * + * + *
+     * Stop the VM
+     * 
+ * + * STOP_VM = 1; + */ + STOP_VM(1), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * The fault type is unknown.
+     * 
+ * + * FAULT_TYPE_UNSPECIFIED = 0; + */ + public static final int FAULT_TYPE_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * Stop the VM
+     * 
+ * + * STOP_VM = 1; + */ + public static final int STOP_VM_VALUE = 1; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static FaultType valueOf(int value) { + return forNumber(value); + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + */ + public static FaultType forNumber(int value) { + switch (value) { + case 0: + return FAULT_TYPE_UNSPECIFIED; + case 1: + return STOP_VM; + default: + return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap internalGetValueMap() { + return internalValueMap; + } + + private static final com.google.protobuf.Internal.EnumLiteMap internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public FaultType findValueByNumber(int number) { + return FaultType.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + return getDescriptor().getValues().get(ordinal()); + } + + public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { + return getDescriptor(); + } + + public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.cloud.alloydb.v1alpha.InjectFaultRequest.getDescriptor() + .getEnumTypes() + .get(0); + } + + private static final FaultType[] VALUES = values(); + + public static FaultType valueOf(com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException("EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private FaultType(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.alloydb.v1alpha.InjectFaultRequest.FaultType) + } + + public static final int FAULT_TYPE_FIELD_NUMBER = 1; + private int faultType_ = 0; + /** + * + * + *
+   * Required. The type of fault to be injected in an instance.
+   * 
+ * + * + * .google.cloud.alloydb.v1alpha.InjectFaultRequest.FaultType fault_type = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The enum numeric value on the wire for faultType. + */ + @java.lang.Override + public int getFaultTypeValue() { + return faultType_; + } + /** + * + * + *
+   * Required. The type of fault to be injected in an instance.
+   * 
+ * + * + * .google.cloud.alloydb.v1alpha.InjectFaultRequest.FaultType fault_type = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The faultType. + */ + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.InjectFaultRequest.FaultType getFaultType() { + com.google.cloud.alloydb.v1alpha.InjectFaultRequest.FaultType result = + com.google.cloud.alloydb.v1alpha.InjectFaultRequest.FaultType.forNumber(faultType_); + return result == null + ? com.google.cloud.alloydb.v1alpha.InjectFaultRequest.FaultType.UNRECOGNIZED + : result; + } + + public static final int NAME_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + * + * + *
+   * Required. The name of the resource. For the required format, see the
+   * comment on the Instance.name field.
+   * 
+ * + * + * string name = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The name of the resource. For the required format, see the
+   * comment on the Instance.name field.
+   * 
+ * + * + * string name = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int REQUEST_ID_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object 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).
+   * 
+ * + * string request_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The requestId. + */ + @java.lang.Override + public java.lang.String getRequestId() { + java.lang.Object ref = requestId_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + requestId_ = s; + return s; + } + } + /** + * + * + *
+   * Optional. An optional request ID to identify requests. Specify a unique
+   * request ID so that if you must retry your request, the server will know to
+   * ignore the request if it has already been completed. The server will
+   * guarantee that for at least 60 minutes after the first request.
+   *
+   * For example, consider a situation where you make an initial request and
+   * the request times out. If you make the request again with the same request
+   * ID, the server can check if original operation with the same request ID
+   * was received, and if so, will ignore the second request. This prevents
+   * clients from accidentally creating duplicate commitments.
+   *
+   * The request ID must be a valid UUID with the exception that zero UUID is
+   * not supported (00000000-0000-0000-0000-000000000000).
+   * 
+ * + * string request_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for requestId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getRequestIdBytes() { + java.lang.Object ref = requestId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + requestId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int VALIDATE_ONLY_FIELD_NUMBER = 4; + private boolean validateOnly_ = false; + /** + * + * + *
+   * Optional. If set, performs request validation (e.g. permission checks and
+   * any other type of validation), but do not actually execute the fault
+   * injection.
+   * 
+ * + * bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The validateOnly. + */ + @java.lang.Override + public boolean getValidateOnly() { + return validateOnly_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (faultType_ + != com.google.cloud.alloydb.v1alpha.InjectFaultRequest.FaultType.FAULT_TYPE_UNSPECIFIED + .getNumber()) { + output.writeEnum(1, faultType_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, name_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(requestId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, requestId_); + } + if (validateOnly_ != false) { + output.writeBool(4, validateOnly_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (faultType_ + != com.google.cloud.alloydb.v1alpha.InjectFaultRequest.FaultType.FAULT_TYPE_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(1, faultType_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, name_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(requestId_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, requestId_); + } + if (validateOnly_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(4, validateOnly_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.alloydb.v1alpha.InjectFaultRequest)) { + return super.equals(obj); + } + com.google.cloud.alloydb.v1alpha.InjectFaultRequest other = + (com.google.cloud.alloydb.v1alpha.InjectFaultRequest) obj; + + if (faultType_ != other.faultType_) return false; + if (!getName().equals(other.getName())) return false; + if (!getRequestId().equals(other.getRequestId())) return false; + if (getValidateOnly() != other.getValidateOnly()) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + FAULT_TYPE_FIELD_NUMBER; + hash = (53 * hash) + faultType_; + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (37 * hash) + REQUEST_ID_FIELD_NUMBER; + hash = (53 * hash) + getRequestId().hashCode(); + hash = (37 * hash) + VALIDATE_ONLY_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getValidateOnly()); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.alloydb.v1alpha.InjectFaultRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1alpha.InjectFaultRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.alloydb.v1alpha.InjectFaultRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1alpha.InjectFaultRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.alloydb.v1alpha.InjectFaultRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1alpha.InjectFaultRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.alloydb.v1alpha.InjectFaultRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1alpha.InjectFaultRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.alloydb.v1alpha.InjectFaultRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1alpha.InjectFaultRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.alloydb.v1alpha.InjectFaultRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1alpha.InjectFaultRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.alloydb.v1alpha.InjectFaultRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Message for triggering fault injection on an instance
+   * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1alpha.InjectFaultRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.alloydb.v1alpha.InjectFaultRequest) + com.google.cloud.alloydb.v1alpha.InjectFaultRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.alloydb.v1alpha.ServiceProto + .internal_static_google_cloud_alloydb_v1alpha_InjectFaultRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1alpha.ServiceProto + .internal_static_google_cloud_alloydb_v1alpha_InjectFaultRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1alpha.InjectFaultRequest.class, + com.google.cloud.alloydb.v1alpha.InjectFaultRequest.Builder.class); + } + + // Construct using com.google.cloud.alloydb.v1alpha.InjectFaultRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + faultType_ = 0; + name_ = ""; + requestId_ = ""; + validateOnly_ = false; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.alloydb.v1alpha.ServiceProto + .internal_static_google_cloud_alloydb_v1alpha_InjectFaultRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.InjectFaultRequest getDefaultInstanceForType() { + return com.google.cloud.alloydb.v1alpha.InjectFaultRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.InjectFaultRequest build() { + com.google.cloud.alloydb.v1alpha.InjectFaultRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.InjectFaultRequest buildPartial() { + com.google.cloud.alloydb.v1alpha.InjectFaultRequest result = + new com.google.cloud.alloydb.v1alpha.InjectFaultRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.alloydb.v1alpha.InjectFaultRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.faultType_ = faultType_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.name_ = name_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.requestId_ = requestId_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.validateOnly_ = validateOnly_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.alloydb.v1alpha.InjectFaultRequest) { + return mergeFrom((com.google.cloud.alloydb.v1alpha.InjectFaultRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.alloydb.v1alpha.InjectFaultRequest other) { + if (other == com.google.cloud.alloydb.v1alpha.InjectFaultRequest.getDefaultInstance()) + return this; + if (other.faultType_ != 0) { + setFaultTypeValue(other.getFaultTypeValue()); + } + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (!other.getRequestId().isEmpty()) { + requestId_ = other.requestId_; + bitField0_ |= 0x00000004; + onChanged(); + } + if (other.getValidateOnly() != false) { + setValidateOnly(other.getValidateOnly()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: + { + faultType_ = input.readEnum(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 18: + { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + requestId_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 32: + { + validateOnly_ = input.readBool(); + bitField0_ |= 0x00000008; + break; + } // case 32 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private int faultType_ = 0; + /** + * + * + *
+     * Required. The type of fault to be injected in an instance.
+     * 
+ * + * + * .google.cloud.alloydb.v1alpha.InjectFaultRequest.FaultType fault_type = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The enum numeric value on the wire for faultType. + */ + @java.lang.Override + public int getFaultTypeValue() { + return faultType_; + } + /** + * + * + *
+     * Required. The type of fault to be injected in an instance.
+     * 
+ * + * + * .google.cloud.alloydb.v1alpha.InjectFaultRequest.FaultType fault_type = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @param value The enum numeric value on the wire for faultType to set. + * @return This builder for chaining. + */ + public Builder setFaultTypeValue(int value) { + faultType_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The type of fault to be injected in an instance.
+     * 
+ * + * + * .google.cloud.alloydb.v1alpha.InjectFaultRequest.FaultType fault_type = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The faultType. + */ + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.InjectFaultRequest.FaultType getFaultType() { + com.google.cloud.alloydb.v1alpha.InjectFaultRequest.FaultType result = + com.google.cloud.alloydb.v1alpha.InjectFaultRequest.FaultType.forNumber(faultType_); + return result == null + ? com.google.cloud.alloydb.v1alpha.InjectFaultRequest.FaultType.UNRECOGNIZED + : result; + } + /** + * + * + *
+     * Required. The type of fault to be injected in an instance.
+     * 
+ * + * + * .google.cloud.alloydb.v1alpha.InjectFaultRequest.FaultType fault_type = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @param value The faultType to set. + * @return This builder for chaining. + */ + public Builder setFaultType( + com.google.cloud.alloydb.v1alpha.InjectFaultRequest.FaultType value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000001; + faultType_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The type of fault to be injected in an instance.
+     * 
+ * + * + * .google.cloud.alloydb.v1alpha.InjectFaultRequest.FaultType fault_type = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return This builder for chaining. + */ + public Builder clearFaultType() { + bitField0_ = (bitField0_ & ~0x00000001); + faultType_ = 0; + onChanged(); + return this; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. The name of the resource. For the required format, see the
+     * comment on the Instance.name field.
+     * 
+ * + * + * string name = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The name of the resource. For the required format, see the
+     * comment on the Instance.name field.
+     * 
+ * + * + * string name = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The name of the resource. For the required format, see the
+     * comment on the Instance.name field.
+     * 
+ * + * + * string name = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + name_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the resource. For the required format, see the
+     * comment on the Instance.name field.
+     * 
+ * + * + * string name = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the resource. For the required format, see the
+     * comment on the Instance.name field.
+     * 
+ * + * + * string name = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + name_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private java.lang.Object 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).
+     * 
+ * + * string request_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The requestId. + */ + public java.lang.String getRequestId() { + java.lang.Object ref = requestId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + requestId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes after the first request.
+     *
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     *
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for requestId. + */ + public com.google.protobuf.ByteString getRequestIdBytes() { + java.lang.Object ref = requestId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + requestId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes after the first request.
+     *
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     *
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The requestId to set. + * @return This builder for chaining. + */ + public Builder setRequestId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + requestId_ = value; + bitField0_ |= 0x00000004; + onChanged(); + 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).
+     * 
+ * + * string request_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearRequestId() { + requestId_ = getDefaultInstance().getRequestId(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + 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).
+     * 
+ * + * string request_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for requestId to set. + * @return This builder for chaining. + */ + public Builder setRequestIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + requestId_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + private boolean 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.
+     * 
+ * + * bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The validateOnly. + */ + @java.lang.Override + public boolean getValidateOnly() { + return 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.
+     * 
+ * + * bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The validateOnly to set. + * @return This builder for chaining. + */ + public Builder setValidateOnly(boolean value) { + + validateOnly_ = value; + bitField0_ |= 0x00000008; + onChanged(); + 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.
+     * 
+ * + * bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearValidateOnly() { + bitField0_ = (bitField0_ & ~0x00000008); + validateOnly_ = false; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.alloydb.v1alpha.InjectFaultRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.alloydb.v1alpha.InjectFaultRequest) + private static final com.google.cloud.alloydb.v1alpha.InjectFaultRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.alloydb.v1alpha.InjectFaultRequest(); + } + + public static com.google.cloud.alloydb.v1alpha.InjectFaultRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public InjectFaultRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.InjectFaultRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/InjectFaultRequestOrBuilder.java b/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/InjectFaultRequestOrBuilder.java new file mode 100644 index 000000000000..3a15e5e5394d --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/InjectFaultRequestOrBuilder.java @@ -0,0 +1,149 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/alloydb/v1alpha/service.proto + +package com.google.cloud.alloydb.v1alpha; + +public interface InjectFaultRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.alloydb.v1alpha.InjectFaultRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The type of fault to be injected in an instance.
+   * 
+ * + * + * .google.cloud.alloydb.v1alpha.InjectFaultRequest.FaultType fault_type = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The enum numeric value on the wire for faultType. + */ + int getFaultTypeValue(); + /** + * + * + *
+   * Required. The type of fault to be injected in an instance.
+   * 
+ * + * + * .google.cloud.alloydb.v1alpha.InjectFaultRequest.FaultType fault_type = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The faultType. + */ + com.google.cloud.alloydb.v1alpha.InjectFaultRequest.FaultType getFaultType(); + + /** + * + * + *
+   * Required. The name of the resource. For the required format, see the
+   * comment on the Instance.name field.
+   * 
+ * + * + * string name = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. The name of the resource. For the required format, see the
+   * comment on the Instance.name field.
+   * 
+ * + * + * string name = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * Optional. An optional request ID to identify requests. Specify a unique
+   * request ID so that if you must retry your request, the server will know to
+   * ignore the request if it has already been completed. The server will
+   * guarantee that for at least 60 minutes after the first request.
+   *
+   * For example, consider a situation where you make an initial request and
+   * the request times out. If you make the request again with the same request
+   * ID, the server can check if original operation with the same request ID
+   * was received, and if so, will ignore the second request. This prevents
+   * clients from accidentally creating duplicate commitments.
+   *
+   * The request ID must be a valid UUID with the exception that zero UUID is
+   * not supported (00000000-0000-0000-0000-000000000000).
+   * 
+ * + * string request_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The requestId. + */ + java.lang.String getRequestId(); + /** + * + * + *
+   * Optional. An optional request ID to identify requests. Specify a unique
+   * request ID so that if you must retry your request, the server will know to
+   * ignore the request if it has already been completed. The server will
+   * guarantee that for at least 60 minutes after the first request.
+   *
+   * For example, consider a situation where you make an initial request and
+   * the request times out. If you make the request again with the same request
+   * ID, the server can check if original operation with the same request ID
+   * was received, and if so, will ignore the second request. This prevents
+   * clients from accidentally creating duplicate commitments.
+   *
+   * The request ID must be a valid UUID with the exception that zero UUID is
+   * not supported (00000000-0000-0000-0000-000000000000).
+   * 
+ * + * string request_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for requestId. + */ + com.google.protobuf.ByteString getRequestIdBytes(); + + /** + * + * + *
+   * Optional. If set, performs request validation (e.g. permission checks and
+   * any other type of validation), but do not actually execute the fault
+   * injection.
+   * 
+ * + * bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The validateOnly. + */ + boolean getValidateOnly(); +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/Instance.java b/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/Instance.java index ef42008e95ad..165676a602f7 100644 --- a/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/Instance.java +++ b/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/Instance.java @@ -582,10 +582,11 @@ private InstanceType(int value) { * *
    * The Availability type of an instance. Potential values:
+   *
    * - ZONAL: The instance serves data from only one zone. Outages in that
-   * zone affect instance availability.
+   *     zone affect instance availability.
    * - REGIONAL: The instance can serve data from more than one zone in a
-   * region (it is highly available).
+   *     region (it is highly available).
    * 
* * Protobuf enum {@code google.cloud.alloydb.v1alpha.Instance.AvailabilityType} @@ -3690,23 +3691,757 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { com.google.cloud.alloydb.v1alpha.Instance.ReadPoolConfig.class, com.google.cloud.alloydb.v1alpha.Instance.ReadPoolConfig.Builder.class); } - - public static final int NODE_COUNT_FIELD_NUMBER = 1; - private int nodeCount_ = 0; + + public static final int NODE_COUNT_FIELD_NUMBER = 1; + private int nodeCount_ = 0; + /** + * + * + *
+     * Read capacity, i.e. number of nodes in a read pool instance.
+     * 
+ * + * int32 node_count = 1; + * + * @return The nodeCount. + */ + @java.lang.Override + public int getNodeCount() { + return nodeCount_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (nodeCount_ != 0) { + output.writeInt32(1, nodeCount_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (nodeCount_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(1, nodeCount_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.alloydb.v1alpha.Instance.ReadPoolConfig)) { + return super.equals(obj); + } + com.google.cloud.alloydb.v1alpha.Instance.ReadPoolConfig other = + (com.google.cloud.alloydb.v1alpha.Instance.ReadPoolConfig) obj; + + if (getNodeCount() != other.getNodeCount()) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NODE_COUNT_FIELD_NUMBER; + hash = (53 * hash) + getNodeCount(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.alloydb.v1alpha.Instance.ReadPoolConfig parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1alpha.Instance.ReadPoolConfig parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.alloydb.v1alpha.Instance.ReadPoolConfig parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1alpha.Instance.ReadPoolConfig parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.alloydb.v1alpha.Instance.ReadPoolConfig parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1alpha.Instance.ReadPoolConfig parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.alloydb.v1alpha.Instance.ReadPoolConfig parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1alpha.Instance.ReadPoolConfig parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.alloydb.v1alpha.Instance.ReadPoolConfig parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1alpha.Instance.ReadPoolConfig parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.alloydb.v1alpha.Instance.ReadPoolConfig parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1alpha.Instance.ReadPoolConfig parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.alloydb.v1alpha.Instance.ReadPoolConfig prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+     * Configuration for a read pool instance.
+     * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1alpha.Instance.ReadPoolConfig} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.alloydb.v1alpha.Instance.ReadPoolConfig) + com.google.cloud.alloydb.v1alpha.Instance.ReadPoolConfigOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.alloydb.v1alpha.ResourcesProto + .internal_static_google_cloud_alloydb_v1alpha_Instance_ReadPoolConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1alpha.ResourcesProto + .internal_static_google_cloud_alloydb_v1alpha_Instance_ReadPoolConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1alpha.Instance.ReadPoolConfig.class, + com.google.cloud.alloydb.v1alpha.Instance.ReadPoolConfig.Builder.class); + } + + // Construct using com.google.cloud.alloydb.v1alpha.Instance.ReadPoolConfig.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + nodeCount_ = 0; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.alloydb.v1alpha.ResourcesProto + .internal_static_google_cloud_alloydb_v1alpha_Instance_ReadPoolConfig_descriptor; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.Instance.ReadPoolConfig getDefaultInstanceForType() { + return com.google.cloud.alloydb.v1alpha.Instance.ReadPoolConfig.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.Instance.ReadPoolConfig build() { + com.google.cloud.alloydb.v1alpha.Instance.ReadPoolConfig result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.Instance.ReadPoolConfig buildPartial() { + com.google.cloud.alloydb.v1alpha.Instance.ReadPoolConfig result = + new com.google.cloud.alloydb.v1alpha.Instance.ReadPoolConfig(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.alloydb.v1alpha.Instance.ReadPoolConfig result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.nodeCount_ = nodeCount_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, + java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.alloydb.v1alpha.Instance.ReadPoolConfig) { + return mergeFrom((com.google.cloud.alloydb.v1alpha.Instance.ReadPoolConfig) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.alloydb.v1alpha.Instance.ReadPoolConfig other) { + if (other == com.google.cloud.alloydb.v1alpha.Instance.ReadPoolConfig.getDefaultInstance()) + return this; + if (other.getNodeCount() != 0) { + setNodeCount(other.getNodeCount()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: + { + nodeCount_ = input.readInt32(); + bitField0_ |= 0x00000001; + break; + } // case 8 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private int nodeCount_; + /** + * + * + *
+       * Read capacity, i.e. number of nodes in a read pool instance.
+       * 
+ * + * int32 node_count = 1; + * + * @return The nodeCount. + */ + @java.lang.Override + public int getNodeCount() { + return nodeCount_; + } + /** + * + * + *
+       * Read capacity, i.e. number of nodes in a read pool instance.
+       * 
+ * + * int32 node_count = 1; + * + * @param value The nodeCount to set. + * @return This builder for chaining. + */ + public Builder setNodeCount(int value) { + + nodeCount_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+       * Read capacity, i.e. number of nodes in a read pool instance.
+       * 
+ * + * int32 node_count = 1; + * + * @return This builder for chaining. + */ + public Builder clearNodeCount() { + bitField0_ = (bitField0_ & ~0x00000001); + nodeCount_ = 0; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.alloydb.v1alpha.Instance.ReadPoolConfig) + } + + // @@protoc_insertion_point(class_scope:google.cloud.alloydb.v1alpha.Instance.ReadPoolConfig) + private static final com.google.cloud.alloydb.v1alpha.Instance.ReadPoolConfig DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.alloydb.v1alpha.Instance.ReadPoolConfig(); + } + + public static com.google.cloud.alloydb.v1alpha.Instance.ReadPoolConfig getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ReadPoolConfig parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.Instance.ReadPoolConfig getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface UpdatePolicyOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.alloydb.v1alpha.Instance.UpdatePolicy) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * Mode for updating the instance.
+     * 
+ * + * .google.cloud.alloydb.v1alpha.Instance.UpdatePolicy.Mode mode = 1; + * + * @return The enum numeric value on the wire for mode. + */ + int getModeValue(); + /** + * + * + *
+     * Mode for updating the instance.
+     * 
+ * + * .google.cloud.alloydb.v1alpha.Instance.UpdatePolicy.Mode mode = 1; + * + * @return The mode. + */ + com.google.cloud.alloydb.v1alpha.Instance.UpdatePolicy.Mode getMode(); + } + /** + * + * + *
+   * Policy to be used while updating the instance.
+   * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1alpha.Instance.UpdatePolicy} + */ + public static final class UpdatePolicy extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.alloydb.v1alpha.Instance.UpdatePolicy) + UpdatePolicyOrBuilder { + private static final long serialVersionUID = 0L; + // Use UpdatePolicy.newBuilder() to construct. + private UpdatePolicy(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private UpdatePolicy() { + mode_ = 0; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new UpdatePolicy(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.alloydb.v1alpha.ResourcesProto + .internal_static_google_cloud_alloydb_v1alpha_Instance_UpdatePolicy_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1alpha.ResourcesProto + .internal_static_google_cloud_alloydb_v1alpha_Instance_UpdatePolicy_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1alpha.Instance.UpdatePolicy.class, + com.google.cloud.alloydb.v1alpha.Instance.UpdatePolicy.Builder.class); + } + + /** + * + * + *
+     * Specifies the available modes of update.
+     * 
+ * + * Protobuf enum {@code google.cloud.alloydb.v1alpha.Instance.UpdatePolicy.Mode} + */ + public enum Mode implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+       * Mode is unknown.
+       * 
+ * + * MODE_UNSPECIFIED = 0; + */ + MODE_UNSPECIFIED(0), + /** + * + * + *
+       * Least disruptive way to apply the update.
+       * 
+ * + * DEFAULT = 1; + */ + DEFAULT(1), + /** + * + * + *
+       * Performs a forced update when applicable. This will be fast but may
+       * incur a downtime.
+       * 
+ * + * FORCE_APPLY = 2; + */ + FORCE_APPLY(2), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+       * Mode is unknown.
+       * 
+ * + * MODE_UNSPECIFIED = 0; + */ + public static final int MODE_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+       * Least disruptive way to apply the update.
+       * 
+ * + * DEFAULT = 1; + */ + public static final int DEFAULT_VALUE = 1; + /** + * + * + *
+       * Performs a forced update when applicable. This will be fast but may
+       * incur a downtime.
+       * 
+ * + * FORCE_APPLY = 2; + */ + public static final int FORCE_APPLY_VALUE = 2; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static Mode valueOf(int value) { + return forNumber(value); + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + */ + public static Mode forNumber(int value) { + switch (value) { + case 0: + return MODE_UNSPECIFIED; + case 1: + return DEFAULT; + case 2: + return FORCE_APPLY; + default: + return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap internalGetValueMap() { + return internalValueMap; + } + + private static final com.google.protobuf.Internal.EnumLiteMap internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public Mode findValueByNumber(int number) { + return Mode.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + return getDescriptor().getValues().get(ordinal()); + } + + public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { + return getDescriptor(); + } + + public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.cloud.alloydb.v1alpha.Instance.UpdatePolicy.getDescriptor() + .getEnumTypes() + .get(0); + } + + private static final Mode[] VALUES = values(); + + public static Mode valueOf(com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException("EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private Mode(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.alloydb.v1alpha.Instance.UpdatePolicy.Mode) + } + + public static final int MODE_FIELD_NUMBER = 1; + private int mode_ = 0; + /** + * + * + *
+     * Mode for updating the instance.
+     * 
+ * + * .google.cloud.alloydb.v1alpha.Instance.UpdatePolicy.Mode mode = 1; + * + * @return The enum numeric value on the wire for mode. + */ + @java.lang.Override + public int getModeValue() { + return mode_; + } /** * * *
-     * Read capacity, i.e. number of nodes in a read pool instance.
+     * Mode for updating the instance.
      * 
* - * int32 node_count = 1; + * .google.cloud.alloydb.v1alpha.Instance.UpdatePolicy.Mode mode = 1; * - * @return The nodeCount. + * @return The mode. */ @java.lang.Override - public int getNodeCount() { - return nodeCount_; + public com.google.cloud.alloydb.v1alpha.Instance.UpdatePolicy.Mode getMode() { + com.google.cloud.alloydb.v1alpha.Instance.UpdatePolicy.Mode result = + com.google.cloud.alloydb.v1alpha.Instance.UpdatePolicy.Mode.forNumber(mode_); + return result == null + ? com.google.cloud.alloydb.v1alpha.Instance.UpdatePolicy.Mode.UNRECOGNIZED + : result; } private byte memoizedIsInitialized = -1; @@ -3723,8 +4458,10 @@ public final boolean isInitialized() { @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (nodeCount_ != 0) { - output.writeInt32(1, nodeCount_); + if (mode_ + != com.google.cloud.alloydb.v1alpha.Instance.UpdatePolicy.Mode.MODE_UNSPECIFIED + .getNumber()) { + output.writeEnum(1, mode_); } getUnknownFields().writeTo(output); } @@ -3735,8 +4472,10 @@ public int getSerializedSize() { if (size != -1) return size; size = 0; - if (nodeCount_ != 0) { - size += com.google.protobuf.CodedOutputStream.computeInt32Size(1, nodeCount_); + if (mode_ + != com.google.cloud.alloydb.v1alpha.Instance.UpdatePolicy.Mode.MODE_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(1, mode_); } size += getUnknownFields().getSerializedSize(); memoizedSize = size; @@ -3748,13 +4487,13 @@ public boolean equals(final java.lang.Object obj) { if (obj == this) { return true; } - if (!(obj instanceof com.google.cloud.alloydb.v1alpha.Instance.ReadPoolConfig)) { + if (!(obj instanceof com.google.cloud.alloydb.v1alpha.Instance.UpdatePolicy)) { return super.equals(obj); } - com.google.cloud.alloydb.v1alpha.Instance.ReadPoolConfig other = - (com.google.cloud.alloydb.v1alpha.Instance.ReadPoolConfig) obj; + com.google.cloud.alloydb.v1alpha.Instance.UpdatePolicy other = + (com.google.cloud.alloydb.v1alpha.Instance.UpdatePolicy) obj; - if (getNodeCount() != other.getNodeCount()) return false; + if (mode_ != other.mode_) return false; if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -3766,78 +4505,78 @@ public int hashCode() { } int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); - hash = (37 * hash) + NODE_COUNT_FIELD_NUMBER; - hash = (53 * hash) + getNodeCount(); + hash = (37 * hash) + MODE_FIELD_NUMBER; + hash = (53 * hash) + mode_; hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; } - public static com.google.cloud.alloydb.v1alpha.Instance.ReadPoolConfig parseFrom( + public static com.google.cloud.alloydb.v1alpha.Instance.UpdatePolicy parseFrom( java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static com.google.cloud.alloydb.v1alpha.Instance.ReadPoolConfig parseFrom( + public static com.google.cloud.alloydb.v1alpha.Instance.UpdatePolicy parseFrom( java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static com.google.cloud.alloydb.v1alpha.Instance.ReadPoolConfig parseFrom( + public static com.google.cloud.alloydb.v1alpha.Instance.UpdatePolicy parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static com.google.cloud.alloydb.v1alpha.Instance.ReadPoolConfig parseFrom( + public static com.google.cloud.alloydb.v1alpha.Instance.UpdatePolicy parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static com.google.cloud.alloydb.v1alpha.Instance.ReadPoolConfig parseFrom(byte[] data) + public static com.google.cloud.alloydb.v1alpha.Instance.UpdatePolicy parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static com.google.cloud.alloydb.v1alpha.Instance.ReadPoolConfig parseFrom( + public static com.google.cloud.alloydb.v1alpha.Instance.UpdatePolicy parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static com.google.cloud.alloydb.v1alpha.Instance.ReadPoolConfig parseFrom( + public static com.google.cloud.alloydb.v1alpha.Instance.UpdatePolicy parseFrom( java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); } - public static com.google.cloud.alloydb.v1alpha.Instance.ReadPoolConfig parseFrom( + public static com.google.cloud.alloydb.v1alpha.Instance.UpdatePolicy parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3.parseWithIOException( PARSER, input, extensionRegistry); } - public static com.google.cloud.alloydb.v1alpha.Instance.ReadPoolConfig parseDelimitedFrom( + public static com.google.cloud.alloydb.v1alpha.Instance.UpdatePolicy parseDelimitedFrom( java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); } - public static com.google.cloud.alloydb.v1alpha.Instance.ReadPoolConfig parseDelimitedFrom( + public static com.google.cloud.alloydb.v1alpha.Instance.UpdatePolicy parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( PARSER, input, extensionRegistry); } - public static com.google.cloud.alloydb.v1alpha.Instance.ReadPoolConfig parseFrom( + public static com.google.cloud.alloydb.v1alpha.Instance.UpdatePolicy parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); } - public static com.google.cloud.alloydb.v1alpha.Instance.ReadPoolConfig parseFrom( + public static com.google.cloud.alloydb.v1alpha.Instance.UpdatePolicy parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { @@ -3855,7 +4594,7 @@ public static Builder newBuilder() { } public static Builder newBuilder( - com.google.cloud.alloydb.v1alpha.Instance.ReadPoolConfig prototype) { + com.google.cloud.alloydb.v1alpha.Instance.UpdatePolicy prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } @@ -3874,32 +4613,32 @@ protected Builder newBuilderForType( * * *
-     * Configuration for a read pool instance.
+     * Policy to be used while updating the instance.
      * 
* - * Protobuf type {@code google.cloud.alloydb.v1alpha.Instance.ReadPoolConfig} + * Protobuf type {@code google.cloud.alloydb.v1alpha.Instance.UpdatePolicy} */ public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:google.cloud.alloydb.v1alpha.Instance.ReadPoolConfig) - com.google.cloud.alloydb.v1alpha.Instance.ReadPoolConfigOrBuilder { + // @@protoc_insertion_point(builder_implements:google.cloud.alloydb.v1alpha.Instance.UpdatePolicy) + com.google.cloud.alloydb.v1alpha.Instance.UpdatePolicyOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.cloud.alloydb.v1alpha.ResourcesProto - .internal_static_google_cloud_alloydb_v1alpha_Instance_ReadPoolConfig_descriptor; + .internal_static_google_cloud_alloydb_v1alpha_Instance_UpdatePolicy_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.cloud.alloydb.v1alpha.ResourcesProto - .internal_static_google_cloud_alloydb_v1alpha_Instance_ReadPoolConfig_fieldAccessorTable + .internal_static_google_cloud_alloydb_v1alpha_Instance_UpdatePolicy_fieldAccessorTable .ensureFieldAccessorsInitialized( - com.google.cloud.alloydb.v1alpha.Instance.ReadPoolConfig.class, - com.google.cloud.alloydb.v1alpha.Instance.ReadPoolConfig.Builder.class); + com.google.cloud.alloydb.v1alpha.Instance.UpdatePolicy.class, + com.google.cloud.alloydb.v1alpha.Instance.UpdatePolicy.Builder.class); } - // Construct using com.google.cloud.alloydb.v1alpha.Instance.ReadPoolConfig.newBuilder() + // Construct using com.google.cloud.alloydb.v1alpha.Instance.UpdatePolicy.newBuilder() private Builder() {} private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { @@ -3910,24 +4649,24 @@ private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { public Builder clear() { super.clear(); bitField0_ = 0; - nodeCount_ = 0; + mode_ = 0; return this; } @java.lang.Override public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { return com.google.cloud.alloydb.v1alpha.ResourcesProto - .internal_static_google_cloud_alloydb_v1alpha_Instance_ReadPoolConfig_descriptor; + .internal_static_google_cloud_alloydb_v1alpha_Instance_UpdatePolicy_descriptor; } @java.lang.Override - public com.google.cloud.alloydb.v1alpha.Instance.ReadPoolConfig getDefaultInstanceForType() { - return com.google.cloud.alloydb.v1alpha.Instance.ReadPoolConfig.getDefaultInstance(); + public com.google.cloud.alloydb.v1alpha.Instance.UpdatePolicy getDefaultInstanceForType() { + return com.google.cloud.alloydb.v1alpha.Instance.UpdatePolicy.getDefaultInstance(); } @java.lang.Override - public com.google.cloud.alloydb.v1alpha.Instance.ReadPoolConfig build() { - com.google.cloud.alloydb.v1alpha.Instance.ReadPoolConfig result = buildPartial(); + public com.google.cloud.alloydb.v1alpha.Instance.UpdatePolicy build() { + com.google.cloud.alloydb.v1alpha.Instance.UpdatePolicy result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } @@ -3935,9 +4674,9 @@ public com.google.cloud.alloydb.v1alpha.Instance.ReadPoolConfig build() { } @java.lang.Override - public com.google.cloud.alloydb.v1alpha.Instance.ReadPoolConfig buildPartial() { - com.google.cloud.alloydb.v1alpha.Instance.ReadPoolConfig result = - new com.google.cloud.alloydb.v1alpha.Instance.ReadPoolConfig(this); + public com.google.cloud.alloydb.v1alpha.Instance.UpdatePolicy buildPartial() { + com.google.cloud.alloydb.v1alpha.Instance.UpdatePolicy result = + new com.google.cloud.alloydb.v1alpha.Instance.UpdatePolicy(this); if (bitField0_ != 0) { buildPartial0(result); } @@ -3945,10 +4684,10 @@ public com.google.cloud.alloydb.v1alpha.Instance.ReadPoolConfig buildPartial() { return result; } - private void buildPartial0(com.google.cloud.alloydb.v1alpha.Instance.ReadPoolConfig result) { + private void buildPartial0(com.google.cloud.alloydb.v1alpha.Instance.UpdatePolicy result) { int from_bitField0_ = bitField0_; if (((from_bitField0_ & 0x00000001) != 0)) { - result.nodeCount_ = nodeCount_; + result.mode_ = mode_; } } @@ -3989,19 +4728,19 @@ public Builder addRepeatedField( @java.lang.Override public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof com.google.cloud.alloydb.v1alpha.Instance.ReadPoolConfig) { - return mergeFrom((com.google.cloud.alloydb.v1alpha.Instance.ReadPoolConfig) other); + if (other instanceof com.google.cloud.alloydb.v1alpha.Instance.UpdatePolicy) { + return mergeFrom((com.google.cloud.alloydb.v1alpha.Instance.UpdatePolicy) other); } else { super.mergeFrom(other); return this; } } - public Builder mergeFrom(com.google.cloud.alloydb.v1alpha.Instance.ReadPoolConfig other) { - if (other == com.google.cloud.alloydb.v1alpha.Instance.ReadPoolConfig.getDefaultInstance()) + public Builder mergeFrom(com.google.cloud.alloydb.v1alpha.Instance.UpdatePolicy other) { + if (other == com.google.cloud.alloydb.v1alpha.Instance.UpdatePolicy.getDefaultInstance()) return this; - if (other.getNodeCount() != 0) { - setNodeCount(other.getNodeCount()); + if (other.mode_ != 0) { + setModeValue(other.getModeValue()); } this.mergeUnknownFields(other.getUnknownFields()); onChanged(); @@ -4031,7 +4770,7 @@ public Builder mergeFrom( break; case 8: { - nodeCount_ = input.readInt32(); + mode_ = input.readEnum(); bitField0_ |= 0x00000001; break; } // case 8 @@ -4054,37 +4793,36 @@ public Builder mergeFrom( private int bitField0_; - private int nodeCount_; + private int mode_ = 0; /** * * *
-       * Read capacity, i.e. number of nodes in a read pool instance.
+       * Mode for updating the instance.
        * 
* - * int32 node_count = 1; + * .google.cloud.alloydb.v1alpha.Instance.UpdatePolicy.Mode mode = 1; * - * @return The nodeCount. + * @return The enum numeric value on the wire for mode. */ @java.lang.Override - public int getNodeCount() { - return nodeCount_; + public int getModeValue() { + return mode_; } /** * * *
-       * Read capacity, i.e. number of nodes in a read pool instance.
+       * Mode for updating the instance.
        * 
* - * int32 node_count = 1; + * .google.cloud.alloydb.v1alpha.Instance.UpdatePolicy.Mode mode = 1; * - * @param value The nodeCount to set. + * @param value The enum numeric value on the wire for mode to set. * @return This builder for chaining. */ - public Builder setNodeCount(int value) { - - nodeCount_ = value; + public Builder setModeValue(int value) { + mode_ = value; bitField0_ |= 0x00000001; onChanged(); return this; @@ -4093,16 +4831,56 @@ public Builder setNodeCount(int value) { * * *
-       * Read capacity, i.e. number of nodes in a read pool instance.
+       * Mode for updating the instance.
        * 
* - * int32 node_count = 1; + * .google.cloud.alloydb.v1alpha.Instance.UpdatePolicy.Mode mode = 1; + * + * @return The mode. + */ + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.Instance.UpdatePolicy.Mode getMode() { + com.google.cloud.alloydb.v1alpha.Instance.UpdatePolicy.Mode result = + com.google.cloud.alloydb.v1alpha.Instance.UpdatePolicy.Mode.forNumber(mode_); + return result == null + ? com.google.cloud.alloydb.v1alpha.Instance.UpdatePolicy.Mode.UNRECOGNIZED + : result; + } + /** + * * + *
+       * Mode for updating the instance.
+       * 
+ * + * .google.cloud.alloydb.v1alpha.Instance.UpdatePolicy.Mode mode = 1; + * + * @param value The mode to set. * @return This builder for chaining. */ - public Builder clearNodeCount() { + public Builder setMode(com.google.cloud.alloydb.v1alpha.Instance.UpdatePolicy.Mode value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000001; + mode_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+       * Mode for updating the instance.
+       * 
+ * + * .google.cloud.alloydb.v1alpha.Instance.UpdatePolicy.Mode mode = 1; + * + * @return This builder for chaining. + */ + public Builder clearMode() { bitField0_ = (bitField0_ & ~0x00000001); - nodeCount_ = 0; + mode_ = 0; onChanged(); return this; } @@ -4119,24 +4897,24 @@ public final Builder mergeUnknownFields( return super.mergeUnknownFields(unknownFields); } - // @@protoc_insertion_point(builder_scope:google.cloud.alloydb.v1alpha.Instance.ReadPoolConfig) + // @@protoc_insertion_point(builder_scope:google.cloud.alloydb.v1alpha.Instance.UpdatePolicy) } - // @@protoc_insertion_point(class_scope:google.cloud.alloydb.v1alpha.Instance.ReadPoolConfig) - private static final com.google.cloud.alloydb.v1alpha.Instance.ReadPoolConfig DEFAULT_INSTANCE; + // @@protoc_insertion_point(class_scope:google.cloud.alloydb.v1alpha.Instance.UpdatePolicy) + private static final com.google.cloud.alloydb.v1alpha.Instance.UpdatePolicy DEFAULT_INSTANCE; static { - DEFAULT_INSTANCE = new com.google.cloud.alloydb.v1alpha.Instance.ReadPoolConfig(); + DEFAULT_INSTANCE = new com.google.cloud.alloydb.v1alpha.Instance.UpdatePolicy(); } - public static com.google.cloud.alloydb.v1alpha.Instance.ReadPoolConfig getDefaultInstance() { + public static com.google.cloud.alloydb.v1alpha.Instance.UpdatePolicy getDefaultInstance() { return DEFAULT_INSTANCE; } - private static final com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { @java.lang.Override - public ReadPoolConfig parsePartialFrom( + public UpdatePolicy parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { @@ -4156,17 +4934,17 @@ public ReadPoolConfig parsePartialFrom( } }; - public static com.google.protobuf.Parser parser() { + public static com.google.protobuf.Parser parser() { return PARSER; } @java.lang.Override - public com.google.protobuf.Parser getParserForType() { + public com.google.protobuf.Parser getParserForType() { return PARSER; } @java.lang.Override - public com.google.cloud.alloydb.v1alpha.Instance.ReadPoolConfig getDefaultInstanceForType() { + public com.google.cloud.alloydb.v1alpha.Instance.UpdatePolicy getDefaultInstanceForType() { return DEFAULT_INSTANCE; } } @@ -4732,8 +5510,11 @@ public com.google.cloud.alloydb.v1alpha.Instance.MachineConfig getMachineConfig( * *
    * Availability type of an Instance.
-   * Defaults to REGIONAL for both primary and read instances.
-   * Note that primary and read instances can have different availability types.
+   * 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).
    * 
* * .google.cloud.alloydb.v1alpha.Instance.AvailabilityType availability_type = 11; @@ -4749,8 +5530,11 @@ public int getAvailabilityTypeValue() { * *
    * Availability type of an Instance.
-   * Defaults to REGIONAL for both primary and read instances.
-   * Note that primary and read instances can have different availability types.
+   * 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).
    * 
* * .google.cloud.alloydb.v1alpha.Instance.AvailabilityType availability_type = 11; @@ -5475,6 +6259,66 @@ public java.lang.String getAnnotationsOrThrow(java.lang.String key) { return map.get(key); } + public static final int UPDATE_POLICY_FIELD_NUMBER = 22; + private com.google.cloud.alloydb.v1alpha.Instance.UpdatePolicy updatePolicy_; + /** + * + * + *
+   * 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.
+   * 
+ * + * .google.cloud.alloydb.v1alpha.Instance.UpdatePolicy update_policy = 22; + * + * @return Whether the updatePolicy field is set. + */ + @java.lang.Override + public boolean hasUpdatePolicy() { + return updatePolicy_ != null; + } + /** + * + * + *
+   * 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.
+   * 
+ * + * .google.cloud.alloydb.v1alpha.Instance.UpdatePolicy update_policy = 22; + * + * @return The updatePolicy. + */ + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.Instance.UpdatePolicy getUpdatePolicy() { + return updatePolicy_ == null + ? com.google.cloud.alloydb.v1alpha.Instance.UpdatePolicy.getDefaultInstance() + : updatePolicy_; + } + /** + * + * + *
+   * 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.
+   * 
+ * + * .google.cloud.alloydb.v1alpha.Instance.UpdatePolicy update_policy = 22; + */ + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.Instance.UpdatePolicyOrBuilder + getUpdatePolicyOrBuilder() { + return updatePolicy_ == null + ? com.google.cloud.alloydb.v1alpha.Instance.UpdatePolicy.getDefaultInstance() + : updatePolicy_; + } + private byte memoizedIsInitialized = -1; @java.lang.Override @@ -5553,6 +6397,9 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (queryInsightsConfig_ != null) { output.writeMessage(21, getQueryInsightsConfig()); } + if (updatePolicy_ != null) { + output.writeMessage(22, getUpdatePolicy()); + } getUnknownFields().writeTo(output); } @@ -5651,6 +6498,9 @@ public int getSerializedSize() { size += com.google.protobuf.CodedOutputStream.computeMessageSize(21, getQueryInsightsConfig()); } + if (updatePolicy_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(22, getUpdatePolicy()); + } size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; @@ -5709,6 +6559,10 @@ public boolean equals(final java.lang.Object obj) { if (getReconciling() != other.getReconciling()) return false; if (!getEtag().equals(other.getEtag())) return false; if (!internalGetAnnotations().equals(other.internalGetAnnotations())) return false; + if (hasUpdatePolicy() != other.hasUpdatePolicy()) return false; + if (hasUpdatePolicy()) { + if (!getUpdatePolicy().equals(other.getUpdatePolicy())) return false; + } if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -5784,6 +6638,10 @@ public int hashCode() { hash = (37 * hash) + ANNOTATIONS_FIELD_NUMBER; hash = (53 * hash) + internalGetAnnotations().hashCode(); } + if (hasUpdatePolicy()) { + hash = (37 * hash) + UPDATE_POLICY_FIELD_NUMBER; + hash = (53 * hash) + getUpdatePolicy().hashCode(); + } hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; @@ -6007,6 +6865,11 @@ public Builder clear() { reconciling_ = false; etag_ = ""; internalGetMutableAnnotations().clear(); + updatePolicy_ = null; + if (updatePolicyBuilder_ != null) { + updatePolicyBuilder_.dispose(); + updatePolicyBuilder_ = null; + } return this; } @@ -6125,6 +6988,10 @@ private void buildPartial0(com.google.cloud.alloydb.v1alpha.Instance result) { result.annotations_ = internalGetAnnotations(); result.annotations_.makeImmutable(); } + if (((from_bitField0_ & 0x00200000) != 0)) { + result.updatePolicy_ = + updatePolicyBuilder_ == null ? updatePolicy_ : updatePolicyBuilder_.build(); + } } @java.lang.Override @@ -6268,6 +7135,9 @@ public Builder mergeFrom(com.google.cloud.alloydb.v1alpha.Instance other) { } internalGetMutableAnnotations().mergeFrom(other.internalGetAnnotations()); bitField0_ |= 0x00100000; + if (other.hasUpdatePolicy()) { + mergeUpdatePolicy(other.getUpdatePolicy()); + } this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; @@ -6446,6 +7316,12 @@ public Builder mergeFrom( bitField0_ |= 0x00008000; break; } // case 170 + case 178: + { + input.readMessage(getUpdatePolicyFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00200000; + break; + } // case 178 default: { if (!super.parseUnknownField(input, extensionRegistry, tag)) { @@ -7999,8 +8875,11 @@ public Builder clearMachineConfig() { * *
      * Availability type of an Instance.
-     * Defaults to REGIONAL for both primary and read instances.
-     * Note that primary and read instances can have different availability types.
+     * 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).
      * 
* * .google.cloud.alloydb.v1alpha.Instance.AvailabilityType availability_type = 11; @@ -8016,8 +8895,11 @@ public int getAvailabilityTypeValue() { * *
      * Availability type of an Instance.
-     * Defaults to REGIONAL for both primary and read instances.
-     * Note that primary and read instances can have different availability types.
+     * 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).
      * 
* * .google.cloud.alloydb.v1alpha.Instance.AvailabilityType availability_type = 11; @@ -8036,8 +8918,11 @@ public Builder setAvailabilityTypeValue(int value) { * *
      * Availability type of an Instance.
-     * Defaults to REGIONAL for both primary and read instances.
-     * Note that primary and read instances can have different availability types.
+     * 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).
      * 
* * .google.cloud.alloydb.v1alpha.Instance.AvailabilityType availability_type = 11; @@ -8057,8 +8942,11 @@ public com.google.cloud.alloydb.v1alpha.Instance.AvailabilityType getAvailabilit * *
      * Availability type of an Instance.
-     * Defaults to REGIONAL for both primary and read instances.
-     * Note that primary and read instances can have different availability types.
+     * 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).
      * 
* * .google.cloud.alloydb.v1alpha.Instance.AvailabilityType availability_type = 11; @@ -8081,8 +8969,11 @@ public Builder setAvailabilityType( * *
      * Availability type of an Instance.
-     * Defaults to REGIONAL for both primary and read instances.
-     * Note that primary and read instances can have different availability types.
+     * 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).
      * 
* * .google.cloud.alloydb.v1alpha.Instance.AvailabilityType availability_type = 11; @@ -9964,6 +10855,219 @@ public Builder putAllAnnotations(java.util.Map + updatePolicyBuilder_; + /** + * + * + *
+     * 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.
+     * 
+ * + * .google.cloud.alloydb.v1alpha.Instance.UpdatePolicy update_policy = 22; + * + * @return Whether the updatePolicy field is set. + */ + public boolean hasUpdatePolicy() { + return ((bitField0_ & 0x00200000) != 0); + } + /** + * + * + *
+     * 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.
+     * 
+ * + * .google.cloud.alloydb.v1alpha.Instance.UpdatePolicy update_policy = 22; + * + * @return The updatePolicy. + */ + public com.google.cloud.alloydb.v1alpha.Instance.UpdatePolicy getUpdatePolicy() { + if (updatePolicyBuilder_ == null) { + return updatePolicy_ == null + ? com.google.cloud.alloydb.v1alpha.Instance.UpdatePolicy.getDefaultInstance() + : updatePolicy_; + } else { + return updatePolicyBuilder_.getMessage(); + } + } + /** + * + * + *
+     * 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.
+     * 
+ * + * .google.cloud.alloydb.v1alpha.Instance.UpdatePolicy update_policy = 22; + */ + public Builder setUpdatePolicy(com.google.cloud.alloydb.v1alpha.Instance.UpdatePolicy value) { + if (updatePolicyBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + updatePolicy_ = value; + } else { + updatePolicyBuilder_.setMessage(value); + } + bitField0_ |= 0x00200000; + onChanged(); + 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.
+     * 
+ * + * .google.cloud.alloydb.v1alpha.Instance.UpdatePolicy update_policy = 22; + */ + public Builder setUpdatePolicy( + com.google.cloud.alloydb.v1alpha.Instance.UpdatePolicy.Builder builderForValue) { + if (updatePolicyBuilder_ == null) { + updatePolicy_ = builderForValue.build(); + } else { + updatePolicyBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00200000; + onChanged(); + 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.
+     * 
+ * + * .google.cloud.alloydb.v1alpha.Instance.UpdatePolicy update_policy = 22; + */ + public Builder mergeUpdatePolicy(com.google.cloud.alloydb.v1alpha.Instance.UpdatePolicy value) { + if (updatePolicyBuilder_ == null) { + if (((bitField0_ & 0x00200000) != 0) + && updatePolicy_ != null + && updatePolicy_ + != com.google.cloud.alloydb.v1alpha.Instance.UpdatePolicy.getDefaultInstance()) { + getUpdatePolicyBuilder().mergeFrom(value); + } else { + updatePolicy_ = value; + } + } else { + updatePolicyBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00200000; + onChanged(); + 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.
+     * 
+ * + * .google.cloud.alloydb.v1alpha.Instance.UpdatePolicy update_policy = 22; + */ + public Builder clearUpdatePolicy() { + bitField0_ = (bitField0_ & ~0x00200000); + updatePolicy_ = null; + if (updatePolicyBuilder_ != null) { + updatePolicyBuilder_.dispose(); + updatePolicyBuilder_ = null; + } + onChanged(); + 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.
+     * 
+ * + * .google.cloud.alloydb.v1alpha.Instance.UpdatePolicy update_policy = 22; + */ + public com.google.cloud.alloydb.v1alpha.Instance.UpdatePolicy.Builder getUpdatePolicyBuilder() { + bitField0_ |= 0x00200000; + onChanged(); + return getUpdatePolicyFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * 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.
+     * 
+ * + * .google.cloud.alloydb.v1alpha.Instance.UpdatePolicy update_policy = 22; + */ + public com.google.cloud.alloydb.v1alpha.Instance.UpdatePolicyOrBuilder + getUpdatePolicyOrBuilder() { + if (updatePolicyBuilder_ != null) { + return updatePolicyBuilder_.getMessageOrBuilder(); + } else { + return updatePolicy_ == null + ? com.google.cloud.alloydb.v1alpha.Instance.UpdatePolicy.getDefaultInstance() + : updatePolicy_; + } + } + /** + * + * + *
+     * 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.
+     * 
+ * + * .google.cloud.alloydb.v1alpha.Instance.UpdatePolicy update_policy = 22; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1alpha.Instance.UpdatePolicy, + com.google.cloud.alloydb.v1alpha.Instance.UpdatePolicy.Builder, + com.google.cloud.alloydb.v1alpha.Instance.UpdatePolicyOrBuilder> + getUpdatePolicyFieldBuilder() { + if (updatePolicyBuilder_ == null) { + updatePolicyBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1alpha.Instance.UpdatePolicy, + com.google.cloud.alloydb.v1alpha.Instance.UpdatePolicy.Builder, + com.google.cloud.alloydb.v1alpha.Instance.UpdatePolicyOrBuilder>( + getUpdatePolicy(), getParentForChildren(), isClean()); + updatePolicy_ = null; + } + return updatePolicyBuilder_; + } + @java.lang.Override public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { return super.setUnknownFields(unknownFields); diff --git a/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/InstanceOrBuilder.java b/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/InstanceOrBuilder.java index c68e71631913..14234f117a12 100644 --- a/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/InstanceOrBuilder.java +++ b/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/InstanceOrBuilder.java @@ -389,8 +389,11 @@ java.lang.String getLabelsOrDefault( * *
    * Availability type of an Instance.
-   * Defaults to REGIONAL for both primary and read instances.
-   * Note that primary and read instances can have different availability types.
+   * 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).
    * 
* * .google.cloud.alloydb.v1alpha.Instance.AvailabilityType availability_type = 11; @@ -403,8 +406,11 @@ java.lang.String getLabelsOrDefault( * *
    * Availability type of an Instance.
-   * Defaults to REGIONAL for both primary and read instances.
-   * Note that primary and read instances can have different availability types.
+   * 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).
    * 
* * .google.cloud.alloydb.v1alpha.Instance.AvailabilityType availability_type = 11; @@ -895,4 +901,48 @@ java.lang.String getAnnotationsOrDefault( * map<string, string> annotations = 18; */ java.lang.String getAnnotationsOrThrow(java.lang.String key); + + /** + * + * + *
+   * 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.
+   * 
+ * + * .google.cloud.alloydb.v1alpha.Instance.UpdatePolicy update_policy = 22; + * + * @return Whether the updatePolicy field is set. + */ + boolean hasUpdatePolicy(); + /** + * + * + *
+   * 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.
+   * 
+ * + * .google.cloud.alloydb.v1alpha.Instance.UpdatePolicy update_policy = 22; + * + * @return The updatePolicy. + */ + com.google.cloud.alloydb.v1alpha.Instance.UpdatePolicy getUpdatePolicy(); + /** + * + * + *
+   * 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.
+   * 
+ * + * .google.cloud.alloydb.v1alpha.Instance.UpdatePolicy update_policy = 22; + */ + com.google.cloud.alloydb.v1alpha.Instance.UpdatePolicyOrBuilder getUpdatePolicyOrBuilder(); } diff --git a/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/InstanceView.java b/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/InstanceView.java index 67f54d9fc1b8..182163036890 100644 --- a/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/InstanceView.java +++ b/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/InstanceView.java @@ -158,7 +158,7 @@ public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType } public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { - return com.google.cloud.alloydb.v1alpha.ResourcesProto.getDescriptor().getEnumTypes().get(1); + return com.google.cloud.alloydb.v1alpha.ResourcesProto.getDescriptor().getEnumTypes().get(0); } private static final InstanceView[] VALUES = values(); diff --git a/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/ListUsersRequest.java b/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/ListUsersRequest.java new file mode 100644 index 000000000000..9a7d2e83b150 --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/ListUsersRequest.java @@ -0,0 +1,1281 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/alloydb/v1alpha/service.proto + +package com.google.cloud.alloydb.v1alpha; + +/** + * + * + *
+ * Message for requesting list of Users
+ * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1alpha.ListUsersRequest} + */ +public final class ListUsersRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.alloydb.v1alpha.ListUsersRequest) + ListUsersRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListUsersRequest.newBuilder() to construct. + private ListUsersRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListUsersRequest() { + parent_ = ""; + pageToken_ = ""; + filter_ = ""; + orderBy_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListUsersRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.alloydb.v1alpha.ServiceProto + .internal_static_google_cloud_alloydb_v1alpha_ListUsersRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1alpha.ServiceProto + .internal_static_google_cloud_alloydb_v1alpha_ListUsersRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1alpha.ListUsersRequest.class, + com.google.cloud.alloydb.v1alpha.ListUsersRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object parent_ = ""; + /** + * + * + *
+   * Required. Parent value for ListUsersRequest
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + @java.lang.Override + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } + } + /** + * + * + *
+   * Required. Parent value for ListUsersRequest
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + @java.lang.Override + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PAGE_SIZE_FIELD_NUMBER = 2; + private int pageSize_ = 0; + /** + * + * + *
+   * Optional. Requested page size. Server may return fewer items than
+   * requested. If unspecified, server will pick an appropriate default.
+   * 
+ * + * int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + + public static final int PAGE_TOKEN_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object pageToken_ = ""; + /** + * + * + *
+   * Optional. A token identifying a page of results the server should return.
+   * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageToken. + */ + @java.lang.Override + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } + } + /** + * + * + *
+   * Optional. A token identifying a page of results the server should return.
+   * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for pageToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int FILTER_FIELD_NUMBER = 4; + + @SuppressWarnings("serial") + private volatile java.lang.Object filter_ = ""; + /** + * + * + *
+   * Optional. Filtering results
+   * 
+ * + * string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The filter. + */ + @java.lang.Override + public java.lang.String getFilter() { + java.lang.Object ref = filter_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + filter_ = s; + return s; + } + } + /** + * + * + *
+   * Optional. Filtering results
+   * 
+ * + * string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for filter. + */ + @java.lang.Override + public com.google.protobuf.ByteString getFilterBytes() { + java.lang.Object ref = filter_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + filter_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ORDER_BY_FIELD_NUMBER = 5; + + @SuppressWarnings("serial") + private volatile java.lang.Object orderBy_ = ""; + /** + * + * + *
+   * Optional. Hint for how to order the results
+   * 
+ * + * string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The orderBy. + */ + @java.lang.Override + public java.lang.String getOrderBy() { + java.lang.Object ref = orderBy_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + orderBy_ = s; + return s; + } + } + /** + * + * + *
+   * Optional. Hint for how to order the results
+   * 
+ * + * string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for orderBy. + */ + @java.lang.Override + public com.google.protobuf.ByteString getOrderByBytes() { + java.lang.Object ref = orderBy_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + orderBy_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); + } + if (pageSize_ != 0) { + output.writeInt32(2, pageSize_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pageToken_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, pageToken_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(filter_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, filter_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(orderBy_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 5, orderBy_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); + } + if (pageSize_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(2, pageSize_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pageToken_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, pageToken_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(filter_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, filter_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(orderBy_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, orderBy_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.alloydb.v1alpha.ListUsersRequest)) { + return super.equals(obj); + } + com.google.cloud.alloydb.v1alpha.ListUsersRequest other = + (com.google.cloud.alloydb.v1alpha.ListUsersRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (getPageSize() != other.getPageSize()) return false; + if (!getPageToken().equals(other.getPageToken())) return false; + if (!getFilter().equals(other.getFilter())) return false; + if (!getOrderBy().equals(other.getOrderBy())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + PARENT_FIELD_NUMBER; + hash = (53 * hash) + getParent().hashCode(); + hash = (37 * hash) + PAGE_SIZE_FIELD_NUMBER; + hash = (53 * hash) + getPageSize(); + hash = (37 * hash) + PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getPageToken().hashCode(); + hash = (37 * hash) + FILTER_FIELD_NUMBER; + hash = (53 * hash) + getFilter().hashCode(); + hash = (37 * hash) + ORDER_BY_FIELD_NUMBER; + hash = (53 * hash) + getOrderBy().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.alloydb.v1alpha.ListUsersRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1alpha.ListUsersRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.alloydb.v1alpha.ListUsersRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1alpha.ListUsersRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.alloydb.v1alpha.ListUsersRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1alpha.ListUsersRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.alloydb.v1alpha.ListUsersRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1alpha.ListUsersRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.alloydb.v1alpha.ListUsersRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1alpha.ListUsersRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.alloydb.v1alpha.ListUsersRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1alpha.ListUsersRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.alloydb.v1alpha.ListUsersRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Message for requesting list of Users
+   * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1alpha.ListUsersRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.alloydb.v1alpha.ListUsersRequest) + com.google.cloud.alloydb.v1alpha.ListUsersRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.alloydb.v1alpha.ServiceProto + .internal_static_google_cloud_alloydb_v1alpha_ListUsersRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1alpha.ServiceProto + .internal_static_google_cloud_alloydb_v1alpha_ListUsersRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1alpha.ListUsersRequest.class, + com.google.cloud.alloydb.v1alpha.ListUsersRequest.Builder.class); + } + + // Construct using com.google.cloud.alloydb.v1alpha.ListUsersRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + parent_ = ""; + pageSize_ = 0; + pageToken_ = ""; + filter_ = ""; + orderBy_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.alloydb.v1alpha.ServiceProto + .internal_static_google_cloud_alloydb_v1alpha_ListUsersRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.ListUsersRequest getDefaultInstanceForType() { + return com.google.cloud.alloydb.v1alpha.ListUsersRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.ListUsersRequest build() { + com.google.cloud.alloydb.v1alpha.ListUsersRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.ListUsersRequest buildPartial() { + com.google.cloud.alloydb.v1alpha.ListUsersRequest result = + new com.google.cloud.alloydb.v1alpha.ListUsersRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.alloydb.v1alpha.ListUsersRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.parent_ = parent_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.pageSize_ = pageSize_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.pageToken_ = pageToken_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.filter_ = filter_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.orderBy_ = orderBy_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.alloydb.v1alpha.ListUsersRequest) { + return mergeFrom((com.google.cloud.alloydb.v1alpha.ListUsersRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.alloydb.v1alpha.ListUsersRequest other) { + if (other == com.google.cloud.alloydb.v1alpha.ListUsersRequest.getDefaultInstance()) + return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.getPageSize() != 0) { + setPageSize(other.getPageSize()); + } + if (!other.getPageToken().isEmpty()) { + pageToken_ = other.pageToken_; + bitField0_ |= 0x00000004; + onChanged(); + } + if (!other.getFilter().isEmpty()) { + filter_ = other.filter_; + bitField0_ |= 0x00000008; + onChanged(); + } + if (!other.getOrderBy().isEmpty()) { + orderBy_ = other.orderBy_; + bitField0_ |= 0x00000010; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + parent_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 16: + { + pageSize_ = input.readInt32(); + bitField0_ |= 0x00000002; + break; + } // case 16 + case 26: + { + pageToken_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 34: + { + filter_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000008; + break; + } // case 34 + case 42: + { + orderBy_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000010; + break; + } // case 42 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * Required. Parent value for ListUsersRequest
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. Parent value for ListUsersRequest
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. Parent value for ListUsersRequest
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The parent to set. + * @return This builder for chaining. + */ + public Builder setParent(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + parent_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Parent value for ListUsersRequest
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearParent() { + parent_ = getDefaultInstance().getParent(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Parent value for ListUsersRequest
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for parent to set. + * @return This builder for chaining. + */ + public Builder setParentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + parent_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private int pageSize_; + /** + * + * + *
+     * Optional. Requested page size. Server may return fewer items than
+     * requested. If unspecified, server will pick an appropriate default.
+     * 
+ * + * int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + /** + * + * + *
+     * Optional. Requested page size. Server may return fewer items than
+     * requested. If unspecified, server will pick an appropriate default.
+     * 
+ * + * int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The pageSize to set. + * @return This builder for chaining. + */ + public Builder setPageSize(int value) { + + pageSize_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Requested page size. Server may return fewer items than
+     * requested. If unspecified, server will pick an appropriate default.
+     * 
+ * + * int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearPageSize() { + bitField0_ = (bitField0_ & ~0x00000002); + pageSize_ = 0; + onChanged(); + return this; + } + + private java.lang.Object pageToken_ = ""; + /** + * + * + *
+     * Optional. A token identifying a page of results the server should return.
+     * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageToken. + */ + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Optional. A token identifying a page of results the server should return.
+     * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for pageToken. + */ + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Optional. A token identifying a page of results the server should return.
+     * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + pageToken_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. A token identifying a page of results the server should return.
+     * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearPageToken() { + pageToken_ = getDefaultInstance().getPageToken(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. A token identifying a page of results the server should return.
+     * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + pageToken_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + private java.lang.Object filter_ = ""; + /** + * + * + *
+     * Optional. Filtering results
+     * 
+ * + * string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The filter. + */ + public java.lang.String getFilter() { + java.lang.Object ref = filter_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + filter_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Optional. Filtering results
+     * 
+ * + * string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for filter. + */ + public com.google.protobuf.ByteString getFilterBytes() { + java.lang.Object ref = filter_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + filter_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Optional. Filtering results
+     * 
+ * + * string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The filter to set. + * @return This builder for chaining. + */ + public Builder setFilter(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + filter_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Filtering results
+     * 
+ * + * string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearFilter() { + filter_ = getDefaultInstance().getFilter(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Filtering results
+     * 
+ * + * string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for filter to set. + * @return This builder for chaining. + */ + public Builder setFilterBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + filter_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + private java.lang.Object orderBy_ = ""; + /** + * + * + *
+     * Optional. Hint for how to order the results
+     * 
+ * + * string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The orderBy. + */ + public java.lang.String getOrderBy() { + java.lang.Object ref = orderBy_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + orderBy_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Optional. Hint for how to order the results
+     * 
+ * + * string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for orderBy. + */ + public com.google.protobuf.ByteString getOrderByBytes() { + java.lang.Object ref = orderBy_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + orderBy_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Optional. Hint for how to order the results
+     * 
+ * + * string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The orderBy to set. + * @return This builder for chaining. + */ + public Builder setOrderBy(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + orderBy_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Hint for how to order the results
+     * 
+ * + * string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearOrderBy() { + orderBy_ = getDefaultInstance().getOrderBy(); + bitField0_ = (bitField0_ & ~0x00000010); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Hint for how to order the results
+     * 
+ * + * string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for orderBy to set. + * @return This builder for chaining. + */ + public Builder setOrderByBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + orderBy_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.alloydb.v1alpha.ListUsersRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.alloydb.v1alpha.ListUsersRequest) + private static final com.google.cloud.alloydb.v1alpha.ListUsersRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.alloydb.v1alpha.ListUsersRequest(); + } + + public static com.google.cloud.alloydb.v1alpha.ListUsersRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListUsersRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.ListUsersRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/ListUsersRequestOrBuilder.java b/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/ListUsersRequestOrBuilder.java new file mode 100644 index 000000000000..f071ca7f557c --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/ListUsersRequestOrBuilder.java @@ -0,0 +1,143 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/alloydb/v1alpha/service.proto + +package com.google.cloud.alloydb.v1alpha; + +public interface ListUsersRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.alloydb.v1alpha.ListUsersRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Parent value for ListUsersRequest
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. Parent value for ListUsersRequest
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * Optional. Requested page size. Server may return fewer items than
+   * requested. If unspecified, server will pick an appropriate default.
+   * 
+ * + * int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageSize. + */ + int getPageSize(); + + /** + * + * + *
+   * Optional. A token identifying a page of results the server should return.
+   * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageToken. + */ + java.lang.String getPageToken(); + /** + * + * + *
+   * Optional. A token identifying a page of results the server should return.
+   * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for pageToken. + */ + com.google.protobuf.ByteString getPageTokenBytes(); + + /** + * + * + *
+   * Optional. Filtering results
+   * 
+ * + * string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The filter. + */ + java.lang.String getFilter(); + /** + * + * + *
+   * Optional. Filtering results
+   * 
+ * + * string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for filter. + */ + com.google.protobuf.ByteString getFilterBytes(); + + /** + * + * + *
+   * Optional. Hint for how to order the results
+   * 
+ * + * string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The orderBy. + */ + java.lang.String getOrderBy(); + /** + * + * + *
+   * Optional. Hint for how to order the results
+   * 
+ * + * string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for orderBy. + */ + com.google.protobuf.ByteString getOrderByBytes(); +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/ListUsersResponse.java b/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/ListUsersResponse.java new file mode 100644 index 000000000000..cdaadca052f1 --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/ListUsersResponse.java @@ -0,0 +1,1393 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/alloydb/v1alpha/service.proto + +package com.google.cloud.alloydb.v1alpha; + +/** + * + * + *
+ * Message for response to listing Users
+ * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1alpha.ListUsersResponse} + */ +public final class ListUsersResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.alloydb.v1alpha.ListUsersResponse) + ListUsersResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListUsersResponse.newBuilder() to construct. + private ListUsersResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListUsersResponse() { + users_ = java.util.Collections.emptyList(); + nextPageToken_ = ""; + unreachable_ = com.google.protobuf.LazyStringArrayList.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListUsersResponse(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.alloydb.v1alpha.ServiceProto + .internal_static_google_cloud_alloydb_v1alpha_ListUsersResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1alpha.ServiceProto + .internal_static_google_cloud_alloydb_v1alpha_ListUsersResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1alpha.ListUsersResponse.class, + com.google.cloud.alloydb.v1alpha.ListUsersResponse.Builder.class); + } + + public static final int USERS_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private java.util.List users_; + /** + * + * + *
+   * The list of User
+   * 
+ * + * repeated .google.cloud.alloydb.v1alpha.User users = 1; + */ + @java.lang.Override + public java.util.List getUsersList() { + return users_; + } + /** + * + * + *
+   * The list of User
+   * 
+ * + * repeated .google.cloud.alloydb.v1alpha.User users = 1; + */ + @java.lang.Override + public java.util.List + getUsersOrBuilderList() { + return users_; + } + /** + * + * + *
+   * The list of User
+   * 
+ * + * repeated .google.cloud.alloydb.v1alpha.User users = 1; + */ + @java.lang.Override + public int getUsersCount() { + return users_.size(); + } + /** + * + * + *
+   * The list of User
+   * 
+ * + * repeated .google.cloud.alloydb.v1alpha.User users = 1; + */ + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.User getUsers(int index) { + return users_.get(index); + } + /** + * + * + *
+   * The list of User
+   * 
+ * + * repeated .google.cloud.alloydb.v1alpha.User users = 1; + */ + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.UserOrBuilder getUsersOrBuilder(int index) { + return users_.get(index); + } + + public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object nextPageToken_ = ""; + /** + * + * + *
+   * A token identifying a page of results the server should return.
+   * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + @java.lang.Override + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } + } + /** + * + * + *
+   * A token identifying a page of results the server should return.
+   * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int UNREACHABLE_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private com.google.protobuf.LazyStringArrayList unreachable_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + /** + * + * + *
+   * Locations that could not be reached.
+   * 
+ * + * repeated string unreachable = 3; + * + * @return A list containing the unreachable. + */ + public com.google.protobuf.ProtocolStringList getUnreachableList() { + return unreachable_; + } + /** + * + * + *
+   * Locations that could not be reached.
+   * 
+ * + * repeated string unreachable = 3; + * + * @return The count of unreachable. + */ + public int getUnreachableCount() { + return unreachable_.size(); + } + /** + * + * + *
+   * Locations that could not be reached.
+   * 
+ * + * repeated string unreachable = 3; + * + * @param index The index of the element to return. + * @return The unreachable at the given index. + */ + public java.lang.String getUnreachable(int index) { + return unreachable_.get(index); + } + /** + * + * + *
+   * Locations that could not be reached.
+   * 
+ * + * repeated string unreachable = 3; + * + * @param index The index of the value to return. + * @return The bytes of the unreachable at the given index. + */ + public com.google.protobuf.ByteString getUnreachableBytes(int index) { + return unreachable_.getByteString(index); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + for (int i = 0; i < users_.size(); i++) { + output.writeMessage(1, users_.get(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, nextPageToken_); + } + for (int i = 0; i < unreachable_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, unreachable_.getRaw(i)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < users_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, users_.get(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, nextPageToken_); + } + { + int dataSize = 0; + for (int i = 0; i < unreachable_.size(); i++) { + dataSize += computeStringSizeNoTag(unreachable_.getRaw(i)); + } + size += dataSize; + size += 1 * getUnreachableList().size(); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.alloydb.v1alpha.ListUsersResponse)) { + return super.equals(obj); + } + com.google.cloud.alloydb.v1alpha.ListUsersResponse other = + (com.google.cloud.alloydb.v1alpha.ListUsersResponse) obj; + + if (!getUsersList().equals(other.getUsersList())) return false; + if (!getNextPageToken().equals(other.getNextPageToken())) return false; + if (!getUnreachableList().equals(other.getUnreachableList())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getUsersCount() > 0) { + hash = (37 * hash) + USERS_FIELD_NUMBER; + hash = (53 * hash) + getUsersList().hashCode(); + } + hash = (37 * hash) + NEXT_PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getNextPageToken().hashCode(); + if (getUnreachableCount() > 0) { + hash = (37 * hash) + UNREACHABLE_FIELD_NUMBER; + hash = (53 * hash) + getUnreachableList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.alloydb.v1alpha.ListUsersResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1alpha.ListUsersResponse parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.alloydb.v1alpha.ListUsersResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1alpha.ListUsersResponse parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.alloydb.v1alpha.ListUsersResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1alpha.ListUsersResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.alloydb.v1alpha.ListUsersResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1alpha.ListUsersResponse parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.alloydb.v1alpha.ListUsersResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1alpha.ListUsersResponse parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.alloydb.v1alpha.ListUsersResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1alpha.ListUsersResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.alloydb.v1alpha.ListUsersResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Message for response to listing Users
+   * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1alpha.ListUsersResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.alloydb.v1alpha.ListUsersResponse) + com.google.cloud.alloydb.v1alpha.ListUsersResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.alloydb.v1alpha.ServiceProto + .internal_static_google_cloud_alloydb_v1alpha_ListUsersResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1alpha.ServiceProto + .internal_static_google_cloud_alloydb_v1alpha_ListUsersResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1alpha.ListUsersResponse.class, + com.google.cloud.alloydb.v1alpha.ListUsersResponse.Builder.class); + } + + // Construct using com.google.cloud.alloydb.v1alpha.ListUsersResponse.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (usersBuilder_ == null) { + users_ = java.util.Collections.emptyList(); + } else { + users_ = null; + usersBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + nextPageToken_ = ""; + unreachable_ = com.google.protobuf.LazyStringArrayList.emptyList(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.alloydb.v1alpha.ServiceProto + .internal_static_google_cloud_alloydb_v1alpha_ListUsersResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.ListUsersResponse getDefaultInstanceForType() { + return com.google.cloud.alloydb.v1alpha.ListUsersResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.ListUsersResponse build() { + com.google.cloud.alloydb.v1alpha.ListUsersResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.ListUsersResponse buildPartial() { + com.google.cloud.alloydb.v1alpha.ListUsersResponse result = + new com.google.cloud.alloydb.v1alpha.ListUsersResponse(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields( + com.google.cloud.alloydb.v1alpha.ListUsersResponse result) { + if (usersBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + users_ = java.util.Collections.unmodifiableList(users_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.users_ = users_; + } else { + result.users_ = usersBuilder_.build(); + } + } + + private void buildPartial0(com.google.cloud.alloydb.v1alpha.ListUsersResponse result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.nextPageToken_ = nextPageToken_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + unreachable_.makeImmutable(); + result.unreachable_ = unreachable_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.alloydb.v1alpha.ListUsersResponse) { + return mergeFrom((com.google.cloud.alloydb.v1alpha.ListUsersResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.alloydb.v1alpha.ListUsersResponse other) { + if (other == com.google.cloud.alloydb.v1alpha.ListUsersResponse.getDefaultInstance()) + return this; + if (usersBuilder_ == null) { + if (!other.users_.isEmpty()) { + if (users_.isEmpty()) { + users_ = other.users_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureUsersIsMutable(); + users_.addAll(other.users_); + } + onChanged(); + } + } else { + if (!other.users_.isEmpty()) { + if (usersBuilder_.isEmpty()) { + usersBuilder_.dispose(); + usersBuilder_ = null; + users_ = other.users_; + bitField0_ = (bitField0_ & ~0x00000001); + usersBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getUsersFieldBuilder() + : null; + } else { + usersBuilder_.addAllMessages(other.users_); + } + } + } + if (!other.getNextPageToken().isEmpty()) { + nextPageToken_ = other.nextPageToken_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (!other.unreachable_.isEmpty()) { + if (unreachable_.isEmpty()) { + unreachable_ = other.unreachable_; + bitField0_ |= 0x00000004; + } else { + ensureUnreachableIsMutable(); + unreachable_.addAll(other.unreachable_); + } + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + com.google.cloud.alloydb.v1alpha.User m = + input.readMessage( + com.google.cloud.alloydb.v1alpha.User.parser(), extensionRegistry); + if (usersBuilder_ == null) { + ensureUsersIsMutable(); + users_.add(m); + } else { + usersBuilder_.addMessage(m); + } + break; + } // case 10 + case 18: + { + nextPageToken_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + ensureUnreachableIsMutable(); + unreachable_.add(s); + break; + } // case 26 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.util.List users_ = + java.util.Collections.emptyList(); + + private void ensureUsersIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + users_ = new java.util.ArrayList(users_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.alloydb.v1alpha.User, + com.google.cloud.alloydb.v1alpha.User.Builder, + com.google.cloud.alloydb.v1alpha.UserOrBuilder> + usersBuilder_; + + /** + * + * + *
+     * The list of User
+     * 
+ * + * repeated .google.cloud.alloydb.v1alpha.User users = 1; + */ + public java.util.List getUsersList() { + if (usersBuilder_ == null) { + return java.util.Collections.unmodifiableList(users_); + } else { + return usersBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * The list of User
+     * 
+ * + * repeated .google.cloud.alloydb.v1alpha.User users = 1; + */ + public int getUsersCount() { + if (usersBuilder_ == null) { + return users_.size(); + } else { + return usersBuilder_.getCount(); + } + } + /** + * + * + *
+     * The list of User
+     * 
+ * + * repeated .google.cloud.alloydb.v1alpha.User users = 1; + */ + public com.google.cloud.alloydb.v1alpha.User getUsers(int index) { + if (usersBuilder_ == null) { + return users_.get(index); + } else { + return usersBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * The list of User
+     * 
+ * + * repeated .google.cloud.alloydb.v1alpha.User users = 1; + */ + public Builder setUsers(int index, com.google.cloud.alloydb.v1alpha.User value) { + if (usersBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureUsersIsMutable(); + users_.set(index, value); + onChanged(); + } else { + usersBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The list of User
+     * 
+ * + * repeated .google.cloud.alloydb.v1alpha.User users = 1; + */ + public Builder setUsers( + int index, com.google.cloud.alloydb.v1alpha.User.Builder builderForValue) { + if (usersBuilder_ == null) { + ensureUsersIsMutable(); + users_.set(index, builderForValue.build()); + onChanged(); + } else { + usersBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The list of User
+     * 
+ * + * repeated .google.cloud.alloydb.v1alpha.User users = 1; + */ + public Builder addUsers(com.google.cloud.alloydb.v1alpha.User value) { + if (usersBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureUsersIsMutable(); + users_.add(value); + onChanged(); + } else { + usersBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * The list of User
+     * 
+ * + * repeated .google.cloud.alloydb.v1alpha.User users = 1; + */ + public Builder addUsers(int index, com.google.cloud.alloydb.v1alpha.User value) { + if (usersBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureUsersIsMutable(); + users_.add(index, value); + onChanged(); + } else { + usersBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The list of User
+     * 
+ * + * repeated .google.cloud.alloydb.v1alpha.User users = 1; + */ + public Builder addUsers(com.google.cloud.alloydb.v1alpha.User.Builder builderForValue) { + if (usersBuilder_ == null) { + ensureUsersIsMutable(); + users_.add(builderForValue.build()); + onChanged(); + } else { + usersBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The list of User
+     * 
+ * + * repeated .google.cloud.alloydb.v1alpha.User users = 1; + */ + public Builder addUsers( + int index, com.google.cloud.alloydb.v1alpha.User.Builder builderForValue) { + if (usersBuilder_ == null) { + ensureUsersIsMutable(); + users_.add(index, builderForValue.build()); + onChanged(); + } else { + usersBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The list of User
+     * 
+ * + * repeated .google.cloud.alloydb.v1alpha.User users = 1; + */ + public Builder addAllUsers( + java.lang.Iterable values) { + if (usersBuilder_ == null) { + ensureUsersIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, users_); + onChanged(); + } else { + usersBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * The list of User
+     * 
+ * + * repeated .google.cloud.alloydb.v1alpha.User users = 1; + */ + public Builder clearUsers() { + if (usersBuilder_ == null) { + users_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + usersBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * The list of User
+     * 
+ * + * repeated .google.cloud.alloydb.v1alpha.User users = 1; + */ + public Builder removeUsers(int index) { + if (usersBuilder_ == null) { + ensureUsersIsMutable(); + users_.remove(index); + onChanged(); + } else { + usersBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * The list of User
+     * 
+ * + * repeated .google.cloud.alloydb.v1alpha.User users = 1; + */ + public com.google.cloud.alloydb.v1alpha.User.Builder getUsersBuilder(int index) { + return getUsersFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * The list of User
+     * 
+ * + * repeated .google.cloud.alloydb.v1alpha.User users = 1; + */ + public com.google.cloud.alloydb.v1alpha.UserOrBuilder getUsersOrBuilder(int index) { + if (usersBuilder_ == null) { + return users_.get(index); + } else { + return usersBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * The list of User
+     * 
+ * + * repeated .google.cloud.alloydb.v1alpha.User users = 1; + */ + public java.util.List + getUsersOrBuilderList() { + if (usersBuilder_ != null) { + return usersBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(users_); + } + } + /** + * + * + *
+     * The list of User
+     * 
+ * + * repeated .google.cloud.alloydb.v1alpha.User users = 1; + */ + public com.google.cloud.alloydb.v1alpha.User.Builder addUsersBuilder() { + return getUsersFieldBuilder() + .addBuilder(com.google.cloud.alloydb.v1alpha.User.getDefaultInstance()); + } + /** + * + * + *
+     * The list of User
+     * 
+ * + * repeated .google.cloud.alloydb.v1alpha.User users = 1; + */ + public com.google.cloud.alloydb.v1alpha.User.Builder addUsersBuilder(int index) { + return getUsersFieldBuilder() + .addBuilder(index, com.google.cloud.alloydb.v1alpha.User.getDefaultInstance()); + } + /** + * + * + *
+     * The list of User
+     * 
+ * + * repeated .google.cloud.alloydb.v1alpha.User users = 1; + */ + public java.util.List getUsersBuilderList() { + return getUsersFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.alloydb.v1alpha.User, + com.google.cloud.alloydb.v1alpha.User.Builder, + com.google.cloud.alloydb.v1alpha.UserOrBuilder> + getUsersFieldBuilder() { + if (usersBuilder_ == null) { + usersBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.alloydb.v1alpha.User, + com.google.cloud.alloydb.v1alpha.User.Builder, + com.google.cloud.alloydb.v1alpha.UserOrBuilder>( + users_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + users_ = null; + } + return usersBuilder_; + } + + private java.lang.Object nextPageToken_ = ""; + /** + * + * + *
+     * A token identifying a page of results the server should return.
+     * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * A token identifying a page of results the server should return.
+     * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + public com.google.protobuf.ByteString getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * A token identifying a page of results the server should return.
+     * 
+ * + * string next_page_token = 2; + * + * @param value The nextPageToken to set. + * @return This builder for chaining. + */ + public Builder setNextPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + nextPageToken_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * A token identifying a page of results the server should return.
+     * 
+ * + * string next_page_token = 2; + * + * @return This builder for chaining. + */ + public Builder clearNextPageToken() { + nextPageToken_ = getDefaultInstance().getNextPageToken(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * A token identifying a page of results the server should return.
+     * 
+ * + * string next_page_token = 2; + * + * @param value The bytes for nextPageToken to set. + * @return This builder for chaining. + */ + public Builder setNextPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + nextPageToken_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringArrayList unreachable_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + + private void ensureUnreachableIsMutable() { + if (!unreachable_.isModifiable()) { + unreachable_ = new com.google.protobuf.LazyStringArrayList(unreachable_); + } + bitField0_ |= 0x00000004; + } + /** + * + * + *
+     * Locations that could not be reached.
+     * 
+ * + * repeated string unreachable = 3; + * + * @return A list containing the unreachable. + */ + public com.google.protobuf.ProtocolStringList getUnreachableList() { + unreachable_.makeImmutable(); + return unreachable_; + } + /** + * + * + *
+     * Locations that could not be reached.
+     * 
+ * + * repeated string unreachable = 3; + * + * @return The count of unreachable. + */ + public int getUnreachableCount() { + return unreachable_.size(); + } + /** + * + * + *
+     * Locations that could not be reached.
+     * 
+ * + * repeated string unreachable = 3; + * + * @param index The index of the element to return. + * @return The unreachable at the given index. + */ + public java.lang.String getUnreachable(int index) { + return unreachable_.get(index); + } + /** + * + * + *
+     * Locations that could not be reached.
+     * 
+ * + * repeated string unreachable = 3; + * + * @param index The index of the value to return. + * @return The bytes of the unreachable at the given index. + */ + public com.google.protobuf.ByteString getUnreachableBytes(int index) { + return unreachable_.getByteString(index); + } + /** + * + * + *
+     * Locations that could not be reached.
+     * 
+ * + * repeated string unreachable = 3; + * + * @param index The index to set the value at. + * @param value The unreachable to set. + * @return This builder for chaining. + */ + public Builder setUnreachable(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureUnreachableIsMutable(); + unreachable_.set(index, value); + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Locations that could not be reached.
+     * 
+ * + * repeated string unreachable = 3; + * + * @param value The unreachable to add. + * @return This builder for chaining. + */ + public Builder addUnreachable(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureUnreachableIsMutable(); + unreachable_.add(value); + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Locations that could not be reached.
+     * 
+ * + * repeated string unreachable = 3; + * + * @param values The unreachable to add. + * @return This builder for chaining. + */ + public Builder addAllUnreachable(java.lang.Iterable values) { + ensureUnreachableIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, unreachable_); + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Locations that could not be reached.
+     * 
+ * + * repeated string unreachable = 3; + * + * @return This builder for chaining. + */ + public Builder clearUnreachable() { + unreachable_ = com.google.protobuf.LazyStringArrayList.emptyList(); + bitField0_ = (bitField0_ & ~0x00000004); + ; + onChanged(); + return this; + } + /** + * + * + *
+     * Locations that could not be reached.
+     * 
+ * + * repeated string unreachable = 3; + * + * @param value The bytes of the unreachable to add. + * @return This builder for chaining. + */ + public Builder addUnreachableBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureUnreachableIsMutable(); + unreachable_.add(value); + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.alloydb.v1alpha.ListUsersResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.alloydb.v1alpha.ListUsersResponse) + private static final com.google.cloud.alloydb.v1alpha.ListUsersResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.alloydb.v1alpha.ListUsersResponse(); + } + + public static com.google.cloud.alloydb.v1alpha.ListUsersResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListUsersResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.ListUsersResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/ListUsersResponseOrBuilder.java b/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/ListUsersResponseOrBuilder.java new file mode 100644 index 000000000000..1ef9cfc50948 --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/ListUsersResponseOrBuilder.java @@ -0,0 +1,152 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/alloydb/v1alpha/service.proto + +package com.google.cloud.alloydb.v1alpha; + +public interface ListUsersResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.alloydb.v1alpha.ListUsersResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The list of User
+   * 
+ * + * repeated .google.cloud.alloydb.v1alpha.User users = 1; + */ + java.util.List getUsersList(); + /** + * + * + *
+   * The list of User
+   * 
+ * + * repeated .google.cloud.alloydb.v1alpha.User users = 1; + */ + com.google.cloud.alloydb.v1alpha.User getUsers(int index); + /** + * + * + *
+   * The list of User
+   * 
+ * + * repeated .google.cloud.alloydb.v1alpha.User users = 1; + */ + int getUsersCount(); + /** + * + * + *
+   * The list of User
+   * 
+ * + * repeated .google.cloud.alloydb.v1alpha.User users = 1; + */ + java.util.List getUsersOrBuilderList(); + /** + * + * + *
+   * The list of User
+   * 
+ * + * repeated .google.cloud.alloydb.v1alpha.User users = 1; + */ + com.google.cloud.alloydb.v1alpha.UserOrBuilder getUsersOrBuilder(int index); + + /** + * + * + *
+   * A token identifying a page of results the server should return.
+   * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + java.lang.String getNextPageToken(); + /** + * + * + *
+   * A token identifying a page of results the server should return.
+   * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + com.google.protobuf.ByteString getNextPageTokenBytes(); + + /** + * + * + *
+   * Locations that could not be reached.
+   * 
+ * + * repeated string unreachable = 3; + * + * @return A list containing the unreachable. + */ + java.util.List getUnreachableList(); + /** + * + * + *
+   * Locations that could not be reached.
+   * 
+ * + * repeated string unreachable = 3; + * + * @return The count of unreachable. + */ + int getUnreachableCount(); + /** + * + * + *
+   * Locations that could not be reached.
+   * 
+ * + * repeated string unreachable = 3; + * + * @param index The index of the element to return. + * @return The unreachable at the given index. + */ + java.lang.String getUnreachable(int index); + /** + * + * + *
+   * Locations that could not be reached.
+   * 
+ * + * repeated string unreachable = 3; + * + * @param index The index of the value to return. + * @return The bytes of the unreachable at the given index. + */ + com.google.protobuf.ByteString getUnreachableBytes(int index); +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/ResourcesProto.java b/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/ResourcesProto.java index e3d9c0c03bac..cb5b88f37dd6 100644 --- a/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/ResourcesProto.java +++ b/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/ResourcesProto.java @@ -87,6 +87,10 @@ public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry r internal_static_google_cloud_alloydb_v1alpha_Cluster_descriptor; static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_google_cloud_alloydb_v1alpha_Cluster_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_alloydb_v1alpha_Cluster_NetworkConfig_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_alloydb_v1alpha_Cluster_NetworkConfig_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_google_cloud_alloydb_v1alpha_Cluster_SecondaryConfig_descriptor; static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable @@ -123,6 +127,10 @@ public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry r internal_static_google_cloud_alloydb_v1alpha_Instance_ReadPoolConfig_descriptor; static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_google_cloud_alloydb_v1alpha_Instance_ReadPoolConfig_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_alloydb_v1alpha_Instance_UpdatePolicy_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_alloydb_v1alpha_Instance_UpdatePolicy_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_google_cloud_alloydb_v1alpha_Instance_LabelsEntry_descriptor; static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable @@ -163,6 +171,10 @@ public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry r internal_static_google_cloud_alloydb_v1alpha_SupportedDatabaseFlag_IntegerRestrictions_descriptor; static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_google_cloud_alloydb_v1alpha_SupportedDatabaseFlag_IntegerRestrictions_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_alloydb_v1alpha_User_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_alloydb_v1alpha_User_fieldAccessorTable; public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { return descriptor; @@ -194,235 +206,261 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + "udkms.googleapis.com/CryptoKeyVersion\"\\\n" + "\004Type\022\024\n\020TYPE_UNSPECIFIED\020\000\022\035\n\031GOOGLE_DE" + "FAULT_ENCRYPTION\020\001\022\037\n\033CUSTOMER_MANAGED_E" - + "NCRYPTION\020\002\"\304\002\n\tSslConfig\022G\n\010ssl_mode\030\001 " + + "NCRYPTION\020\002\"\212\003\n\tSslConfig\022G\n\010ssl_mode\030\001 " + "\001(\0162/.google.cloud.alloydb.v1alpha.SslCo" + "nfig.SslModeB\004\342A\001\001\022I\n\tca_source\030\002 \001(\01620." + "google.cloud.alloydb.v1alpha.SslConfig.C" - + "aSourceB\004\342A\001\001\"e\n\007SslMode\022\030\n\024SSL_MODE_UNS" - + "PECIFIED\020\000\022\022\n\016SSL_MODE_ALLOW\020\001\022\024\n\020SSL_MO" - + "DE_REQUIRE\020\002\022\026\n\022SSL_MODE_VERIFY_CA\020\003\"<\n\010" - + "CaSource\022\031\n\025CA_SOURCE_UNSPECIFIED\020\000\022\025\n\021C" - + "A_SOURCE_MANAGED\020\001\"\377\006\n\025AutomatedBackupPo" - + "licy\022]\n\017weekly_schedule\030\002 \001(\0132B.google.c" - + "loud.alloydb.v1alpha.AutomatedBackupPoli" - + "cy.WeeklyScheduleH\000\022f\n\024time_based_retent" - + "ion\030\004 \001(\0132F.google.cloud.alloydb.v1alpha" - + ".AutomatedBackupPolicy.TimeBasedRetentio" - + "nH\001\022n\n\030quantity_based_retention\030\005 \001(\0132J." - + "google.cloud.alloydb.v1alpha.AutomatedBa" - + "ckupPolicy.QuantityBasedRetentionH\001\022\024\n\007e" - + "nabled\030\001 \001(\010H\002\210\001\001\0220\n\rbackup_window\030\003 \001(\013" - + "2\031.google.protobuf.Duration\022O\n\021encryptio" - + "n_config\030\010 \001(\0132..google.cloud.alloydb.v1" - + "alpha.EncryptionConfigB\004\342A\001\001\022\020\n\010location" - + "\030\006 \001(\t\022O\n\006labels\030\007 \003(\0132?.google.cloud.al" - + "loydb.v1alpha.AutomatedBackupPolicy.Labe" - + "lsEntry\032k\n\016WeeklySchedule\022+\n\013start_times" - + "\030\001 \003(\0132\026.google.type.TimeOfDay\022,\n\014days_o" - + "f_week\030\002 \003(\0162\026.google.type.DayOfWeek\032I\n\022" - + "TimeBasedRetention\0223\n\020retention_period\030\001" - + " \001(\0132\031.google.protobuf.Duration\032\'\n\026Quant" - + "ityBasedRetention\022\r\n\005count\030\001 \001(\005\032-\n\013Labe" - + "lsEntry\022\013\n\003key\030\001 \001(\t\022\r\n\005value\030\002 \001(\t:\0028\001B" - + "\n\n\010scheduleB\013\n\tretentionB\n\n\010_enabled\"\243\001\n" - + "\026ContinuousBackupConfig\022\024\n\007enabled\030\001 \001(\010" - + "H\000\210\001\001\022\034\n\024recovery_window_days\030\004 \001(\005\022I\n\021e" - + "ncryption_config\030\003 \001(\0132..google.cloud.al" - + "loydb.v1alpha.EncryptionConfigB\n\n\010_enabl" - + "ed\"\313\001\n\024ContinuousBackupInfo\022K\n\017encryptio" - + "n_info\030\001 \001(\0132,.google.cloud.alloydb.v1al" - + "pha.EncryptionInfoB\004\342A\001\003\0226\n\014enabled_time" - + "\030\002 \001(\0132\032.google.protobuf.TimestampB\004\342A\001\003" - + "\022.\n\010schedule\030\003 \003(\0162\026.google.type.DayOfWe" - + "ekB\004\342A\001\003\"e\n\014BackupSource\022\030\n\nbackup_uid\030\002" - + " \001(\tB\004\342A\001\003\022;\n\013backup_name\030\001 \001(\tB&\342A\001\002\372A\037" - + "\n\035alloydb.googleapis.com/Backup\"h\n\026Conti" - + "nuousBackupSource\022\025\n\007cluster\030\001 \001(\tB\004\342A\001\002" - + "\0227\n\rpoint_in_time\030\002 \001(\0132\032.google.protobu" - + "f.TimestampB\004\342A\001\002\"\321\020\n\007Cluster\022I\n\rbackup_" - + "source\030\017 \001(\0132*.google.cloud.alloydb.v1al" - + "pha.BackupSourceB\004\342A\001\003H\000\022O\n\020migration_so" - + "urce\030\020 \001(\0132-.google.cloud.alloydb.v1alph" - + "a.MigrationSourceB\004\342A\001\003H\000\022\022\n\004name\030\001 \001(\tB" - + "\004\342A\001\003\022\024\n\014display_name\030\002 \001(\t\022\021\n\003uid\030\003 \001(\t" - + "B\004\342A\001\003\0225\n\013create_time\030\004 \001(\0132\032.google.pro" - + "tobuf.TimestampB\004\342A\001\003\0225\n\013update_time\030\005 \001" - + "(\0132\032.google.protobuf.TimestampB\004\342A\001\003\0225\n\013" - + "delete_time\030\006 \001(\0132\032.google.protobuf.Time" - + "stampB\004\342A\001\003\022A\n\006labels\030\007 \003(\01321.google.clo" - + "ud.alloydb.v1alpha.Cluster.LabelsEntry\022@" - + "\n\005state\030\010 \001(\0162+.google.cloud.alloydb.v1a" - + "lpha.Cluster.StateB\004\342A\001\003\022M\n\014cluster_type" - + "\030\030 \001(\01621.google.cloud.alloydb.v1alpha.Cl" - + "uster.ClusterTypeB\004\342A\001\003\022M\n\020database_vers" - + "ion\030\t \001(\0162-.google.cloud.alloydb.v1alpha" - + ".DatabaseVersionB\004\342A\001\003\0228\n\007network\030\n \001(\tB" - + "\'\342A\001\002\372A \n\036compute.googleapis.com/Network" - + "\022\014\n\004etag\030\013 \001(\t\022K\n\013annotations\030\014 \003(\01326.go" - + "ogle.cloud.alloydb.v1alpha.Cluster.Annot" - + "ationsEntry\022\031\n\013reconciling\030\r \001(\010B\004\342A\001\003\022F" - + "\n\014initial_user\030\016 \001(\0132*.google.cloud.allo" - + "ydb.v1alpha.UserPasswordB\004\342A\001\004\022T\n\027automa" - + "ted_backup_policy\030\021 \001(\01323.google.cloud.a" - + "lloydb.v1alpha.AutomatedBackupPolicy\022;\n\n" - + "ssl_config\030\022 \001(\0132\'.google.cloud.alloydb." - + "v1alpha.SslConfig\022O\n\021encryption_config\030\023" + + "aSourceB\004\342A\001\001\"\252\001\n\007SslMode\022\030\n\024SSL_MODE_UN" + + "SPECIFIED\020\000\022\026\n\016SSL_MODE_ALLOW\020\001\032\002\010\001\022\030\n\020S" + + "SL_MODE_REQUIRE\020\002\032\002\010\001\022\032\n\022SSL_MODE_VERIFY" + + "_CA\020\003\032\002\010\001\022#\n\037ALLOW_UNENCRYPTED_AND_ENCRY" + + "PTED\020\004\022\022\n\016ENCRYPTED_ONLY\020\005\"<\n\010CaSource\022\031" + + "\n\025CA_SOURCE_UNSPECIFIED\020\000\022\025\n\021CA_SOURCE_M" + + "ANAGED\020\001\"\377\006\n\025AutomatedBackupPolicy\022]\n\017we" + + "ekly_schedule\030\002 \001(\0132B.google.cloud.alloy" + + "db.v1alpha.AutomatedBackupPolicy.WeeklyS" + + "cheduleH\000\022f\n\024time_based_retention\030\004 \001(\0132" + + "F.google.cloud.alloydb.v1alpha.Automated" + + "BackupPolicy.TimeBasedRetentionH\001\022n\n\030qua" + + "ntity_based_retention\030\005 \001(\0132J.google.clo" + + "ud.alloydb.v1alpha.AutomatedBackupPolicy" + + ".QuantityBasedRetentionH\001\022\024\n\007enabled\030\001 \001" + + "(\010H\002\210\001\001\0220\n\rbackup_window\030\003 \001(\0132\031.google." + + "protobuf.Duration\022O\n\021encryption_config\030\010" + " \001(\0132..google.cloud.alloydb.v1alpha.Encr" - + "yptionConfigB\004\342A\001\001\022K\n\017encryption_info\030\024 " - + "\001(\0132,.google.cloud.alloydb.v1alpha.Encry" - + "ptionInfoB\004\342A\001\003\022\\\n\030continuous_backup_con" - + "fig\030\033 \001(\01324.google.cloud.alloydb.v1alpha" - + ".ContinuousBackupConfigB\004\342A\001\001\022X\n\026continu" - + "ous_backup_info\030\034 \001(\01322.google.cloud.all" - + "oydb.v1alpha.ContinuousBackupInfoB\004\342A\001\003\022" - + "O\n\020secondary_config\030\026 \001(\01325.google.cloud" - + ".alloydb.v1alpha.Cluster.SecondaryConfig" - + "\022Q\n\016primary_config\030\027 \001(\01323.google.cloud." - + "alloydb.v1alpha.Cluster.PrimaryConfigB\004\342" - + "A\001\003\032/\n\017SecondaryConfig\022\034\n\024primary_cluste" - + "r_name\030\001 \001(\t\0326\n\rPrimaryConfig\022%\n\027seconda" - + "ry_cluster_names\030\001 \003(\tB\004\342A\001\003\032-\n\013LabelsEn" - + "try\022\013\n\003key\030\001 \001(\t\022\r\n\005value\030\002 \001(\t:\0028\001\0322\n\020A" - + "nnotationsEntry\022\013\n\003key\030\001 \001(\t\022\r\n\005value\030\002 " - + "\001(\t:\0028\001\"\234\001\n\005State\022\025\n\021STATE_UNSPECIFIED\020\000" - + "\022\t\n\005READY\020\001\022\013\n\007STOPPED\020\002\022\t\n\005EMPTY\020\003\022\014\n\010C" - + "REATING\020\004\022\014\n\010DELETING\020\005\022\n\n\006FAILED\020\006\022\021\n\rB" - + "OOTSTRAPPING\020\007\022\017\n\013MAINTENANCE\020\010\022\r\n\tPROMO" - + "TING\020\t\"G\n\013ClusterType\022\034\n\030CLUSTER_TYPE_UN" - + "SPECIFIED\020\000\022\013\n\007PRIMARY\020\001\022\r\n\tSECONDARY\020\002:" - + "b\352A_\n\036alloydb.googleapis.com/Cluster\022:pr" - + "ojects/{project}/locations/{location}/cl" - + "usters/{cluster}R\001\001B\010\n\006source\"\365\020\n\010Instan" - + "ce\022\022\n\004name\030\001 \001(\tB\004\342A\001\003\022\024\n\014display_name\030\002" - + " \001(\t\022\021\n\003uid\030\003 \001(\tB\004\342A\001\003\0225\n\013create_time\030\004" - + " \001(\0132\032.google.protobuf.TimestampB\004\342A\001\003\0225" - + "\n\013update_time\030\005 \001(\0132\032.google.protobuf.Ti" - + "mestampB\004\342A\001\003\0225\n\013delete_time\030\006 \001(\0132\032.goo" - + "gle.protobuf.TimestampB\004\342A\001\003\022B\n\006labels\030\007" - + " \003(\01322.google.cloud.alloydb.v1alpha.Inst" - + "ance.LabelsEntry\022A\n\005state\030\010 \001(\0162,.google" - + ".cloud.alloydb.v1alpha.Instance.StateB\004\342" - + "A\001\003\022P\n\rinstance_type\030\t \001(\01623.google.clou" - + "d.alloydb.v1alpha.Instance.InstanceTypeB" - + "\004\342A\001\002\022L\n\016machine_config\030\n \001(\01324.google.c" - + "loud.alloydb.v1alpha.Instance.MachineCon" - + "fig\022R\n\021availability_type\030\013 \001(\01627.google." - + "cloud.alloydb.v1alpha.Instance.Availabil" - + "ityType\022\020\n\010gce_zone\030\014 \001(\t\022Q\n\016database_fl" - + "ags\030\r \003(\01329.google.cloud.alloydb.v1alpha" - + ".Instance.DatabaseFlagsEntry\022H\n\rwritable" - + "_node\030\023 \001(\0132+.google.cloud.alloydb.v1alp" - + "ha.Instance.NodeB\004\342A\001\003\022@\n\005nodes\030\024 \003(\0132+." - + "google.cloud.alloydb.v1alpha.Instance.No" - + "deB\004\342A\001\003\022a\n\025query_insights_config\030\025 \001(\0132" - + "B.google.cloud.alloydb.v1alpha.Instance." - + "QueryInsightsInstanceConfig\022O\n\020read_pool" - + "_config\030\016 \001(\01325.google.cloud.alloydb.v1a" - + "lpha.Instance.ReadPoolConfig\022\030\n\nip_addre" - + "ss\030\017 \001(\tB\004\342A\001\003\022\031\n\013reconciling\030\020 \001(\010B\004\342A\001" - + "\003\022\014\n\004etag\030\021 \001(\t\022L\n\013annotations\030\022 \003(\01327.g" - + "oogle.cloud.alloydb.v1alpha.Instance.Ann" - + "otationsEntry\032\"\n\rMachineConfig\022\021\n\tcpu_co" - + "unt\030\001 \001(\005\032>\n\004Node\022\017\n\007zone_id\030\001 \001(\t\022\n\n\002id" - + "\030\002 \001(\t\022\n\n\002ip\030\003 \001(\t\022\r\n\005state\030\004 \001(\t\032\372\001\n\033Qu" - + "eryInsightsInstanceConfig\022$\n\027record_appl" - + "ication_tags\030\002 \001(\010H\000\210\001\001\022\"\n\025record_client" - + "_address\030\003 \001(\010H\001\210\001\001\022\033\n\023query_string_leng" - + "th\030\004 \001(\r\022#\n\026query_plans_per_minute\030\005 \001(\r" - + "H\002\210\001\001B\032\n\030_record_application_tagsB\030\n\026_re" - + "cord_client_addressB\031\n\027_query_plans_per_" - + "minute\032$\n\016ReadPoolConfig\022\022\n\nnode_count\030\001" - + " \001(\005\032-\n\013LabelsEntry\022\013\n\003key\030\001 \001(\t\022\r\n\005valu" - + "e\030\002 \001(\t:\0028\001\0324\n\022DatabaseFlagsEntry\022\013\n\003key" - + "\030\001 \001(\t\022\r\n\005value\030\002 \001(\t:\0028\001\0322\n\020Annotations" - + "Entry\022\013\n\003key\030\001 \001(\t\022\r\n\005value\030\002 \001(\t:\0028\001\"\221\001" - + "\n\005State\022\025\n\021STATE_UNSPECIFIED\020\000\022\t\n\005READY\020" - + "\001\022\013\n\007STOPPED\020\002\022\014\n\010CREATING\020\003\022\014\n\010DELETING" - + "\020\004\022\017\n\013MAINTENANCE\020\005\022\n\n\006FAILED\020\006\022\021\n\rBOOTS" - + "TRAPPING\020\010\022\r\n\tPROMOTING\020\t\"X\n\014InstanceTyp" - + "e\022\035\n\031INSTANCE_TYPE_UNSPECIFIED\020\000\022\013\n\007PRIM" - + "ARY\020\001\022\r\n\tREAD_POOL\020\002\022\r\n\tSECONDARY\020\003\"N\n\020A" - + "vailabilityType\022!\n\035AVAILABILITY_TYPE_UNS" - + "PECIFIED\020\000\022\t\n\005ZONAL\020\001\022\014\n\010REGIONAL\020\002:x\352Au" - + "\n\037alloydb.googleapis.com/Instance\022Oproje" - + "cts/{project}/locations/{location}/clust" - + "ers/{cluster}/instances/{instance}R\001\001\"\207\002" - + "\n\016ConnectionInfo\022\014\n\004name\030\001 \001(\t\022\030\n\nip_add" - + "ress\030\002 \001(\tB\004\342A\001\003\022#\n\025pem_certificate_chai" - + "n\030\003 \003(\tB\004\342A\001\003\022\032\n\014instance_uid\030\004 \001(\tB\004\342A\001" - + "\003:\213\001\352A\207\001\n%alloydb.googleapis.com/Connect" - + "ionInfo\022^projects/{project}/locations/{l" - + "ocation}/clusters/{cluster}/instances/{i" - + "nstance}/connectionInfo\"\334\t\n\006Backup\022\022\n\004na" - + "me\030\001 \001(\tB\004\342A\001\003\022\024\n\014display_name\030\002 \001(\t\022\021\n\003" - + "uid\030\003 \001(\tB\004\342A\001\003\0225\n\013create_time\030\004 \001(\0132\032.g" - + "oogle.protobuf.TimestampB\004\342A\001\003\0225\n\013update" - + "_time\030\005 \001(\0132\032.google.protobuf.TimestampB" - + "\004\342A\001\003\0225\n\013delete_time\030\017 \001(\0132\032.google.prot" - + "obuf.TimestampB\004\342A\001\003\022@\n\006labels\030\006 \003(\01320.g" - + "oogle.cloud.alloydb.v1alpha.Backup.Label" - + "sEntry\022?\n\005state\030\007 \001(\0162*.google.cloud.all" - + "oydb.v1alpha.Backup.StateB\004\342A\001\003\0227\n\004type\030" - + "\010 \001(\0162).google.cloud.alloydb.v1alpha.Bac" - + "kup.Type\022\023\n\013description\030\t \001(\t\022\031\n\013cluster" - + "_uid\030\022 \001(\tB\004\342A\001\003\022=\n\014cluster_name\030\n \001(\tB\'" - + "\342A\001\002\372A \n\036alloydb.googleapis.com/Cluster\022" - + "\031\n\013reconciling\030\013 \001(\010B\004\342A\001\003\022O\n\021encryption" - + "_config\030\014 \001(\0132..google.cloud.alloydb.v1a" - + "lpha.EncryptionConfigB\004\342A\001\001\022K\n\017encryptio" - + "n_info\030\r \001(\0132,.google.cloud.alloydb.v1al" - + "pha.EncryptionInfoB\004\342A\001\003\022\014\n\004etag\030\016 \001(\t\022J" - + "\n\013annotations\030\020 \003(\01325.google.cloud.alloy" - + "db.v1alpha.Backup.AnnotationsEntry\022\030\n\nsi" - + "ze_bytes\030\021 \001(\003B\004\342A\001\003\0225\n\013expiry_time\030\023 \001(" - + "\0132\032.google.protobuf.TimestampB\004\342A\001\003\032-\n\013L" - + "abelsEntry\022\013\n\003key\030\001 \001(\t\022\r\n\005value\030\002 \001(\t:\002" - + "8\001\0322\n\020AnnotationsEntry\022\013\n\003key\030\001 \001(\t\022\r\n\005v" - + "alue\030\002 \001(\t:\0028\001\"Q\n\005State\022\025\n\021STATE_UNSPECI" - + "FIED\020\000\022\t\n\005READY\020\001\022\014\n\010CREATING\020\002\022\n\n\006FAILE" - + "D\020\003\022\014\n\010DELETING\020\004\"J\n\004Type\022\024\n\020TYPE_UNSPEC" - + "IFIED\020\000\022\r\n\tON_DEMAND\020\001\022\r\n\tAUTOMATED\020\002\022\016\n" - + "\nCONTINUOUS\020\003:_\352A\\\n\035alloydb.googleapis.c" - + "om/Backup\0228projects/{project}/locations/" - + "{location}/backups/{backup}R\001\001\"\334\006\n\025Suppo" - + "rtedDatabaseFlag\022e\n\023string_restrictions\030" - + "\007 \001(\0132F.google.cloud.alloydb.v1alpha.Sup" - + "portedDatabaseFlag.StringRestrictionsH\000\022" - + "g\n\024integer_restrictions\030\010 \001(\0132G.google.c" - + "loud.alloydb.v1alpha.SupportedDatabaseFl" - + "ag.IntegerRestrictionsH\000\022\014\n\004name\030\001 \001(\t\022\021" - + "\n\tflag_name\030\002 \001(\t\022Q\n\nvalue_type\030\003 \001(\0162=." - + "google.cloud.alloydb.v1alpha.SupportedDa" - + "tabaseFlag.ValueType\022\037\n\027accepts_multiple" - + "_values\030\004 \001(\010\022L\n\025supported_db_versions\030\005" - + " \003(\0162-.google.cloud.alloydb.v1alpha.Data" - + "baseVersion\022\033\n\023requires_db_restart\030\006 \001(\010" - + "\032,\n\022StringRestrictions\022\026\n\016allowed_values" - + "\030\001 \003(\t\032u\n\023IntegerRestrictions\022.\n\tmin_val" - + "ue\030\001 \001(\0132\033.google.protobuf.Int64Value\022.\n" - + "\tmax_value\030\002 \001(\0132\033.google.protobuf.Int64" - + "Value\"U\n\tValueType\022\032\n\026VALUE_TYPE_UNSPECI" - + "FIED\020\000\022\n\n\006STRING\020\001\022\013\n\007INTEGER\020\002\022\t\n\005FLOAT" - + "\020\003\022\010\n\004NONE\020\004:g\352Ad\n,alloydb.googleapis.co" - + "m/SupportedDatabaseFlag\0224projects/{proje" - + "ct}/locations/{location}/flags/{flag}B\016\n" - + "\014restrictions*Y\n\017DatabaseVersion\022 \n\034DATA" - + "BASE_VERSION_UNSPECIFIED\020\000\022\023\n\013POSTGRES_1" - + "3\020\001\032\002\010\001\022\017\n\013POSTGRES_14\020\002*^\n\014InstanceView" - + "\022\035\n\031INSTANCE_VIEW_UNSPECIFIED\020\000\022\027\n\023INSTA" - + "NCE_VIEW_BASIC\020\001\022\026\n\022INSTANCE_VIEW_FULL\020\002" - + "B\313\003\n com.google.cloud.alloydb.v1alphaB\016R" - + "esourcesProtoP\001Z:cloud.google.com/go/all" - + "oydb/apiv1alpha/alloydbpb;alloydbpb\252\002\034Go" - + "ogle.Cloud.AlloyDb.V1Alpha\312\002\034Google\\Clou" - + "d\\AlloyDb\\V1alpha\352\002\037Google::Cloud::Alloy" - + "DB::V1alpha\352A\246\001\n(cloudkms.googleapis.com" - + "/CryptoKeyVersion\022zprojects/{project}/lo" - + "cations/{location}/keyRings/{key_ring}/c" - + "ryptoKeys/{crypto_key}/cryptoKeyVersions" - + "/{crypto_key_version}\352AN\n\036compute.google" - + "apis.com/Network\022,projects/{project}/glo" - + "bal/networks/{network}b\006proto3" + + "yptionConfigB\004\342A\001\001\022\020\n\010location\030\006 \001(\t\022O\n\006" + + "labels\030\007 \003(\0132?.google.cloud.alloydb.v1al" + + "pha.AutomatedBackupPolicy.LabelsEntry\032k\n" + + "\016WeeklySchedule\022+\n\013start_times\030\001 \003(\0132\026.g" + + "oogle.type.TimeOfDay\022,\n\014days_of_week\030\002 \003" + + "(\0162\026.google.type.DayOfWeek\032I\n\022TimeBasedR" + + "etention\0223\n\020retention_period\030\001 \001(\0132\031.goo" + + "gle.protobuf.Duration\032\'\n\026QuantityBasedRe" + + "tention\022\r\n\005count\030\001 \001(\005\032-\n\013LabelsEntry\022\013\n" + + "\003key\030\001 \001(\t\022\r\n\005value\030\002 \001(\t:\0028\001B\n\n\010schedul" + + "eB\013\n\tretentionB\n\n\010_enabled\"\243\001\n\026Continuou" + + "sBackupConfig\022\024\n\007enabled\030\001 \001(\010H\000\210\001\001\022\034\n\024r" + + "ecovery_window_days\030\004 \001(\005\022I\n\021encryption_" + + "config\030\003 \001(\0132..google.cloud.alloydb.v1al" + + "pha.EncryptionConfigB\n\n\010_enabled\"\217\002\n\024Con" + + "tinuousBackupInfo\022K\n\017encryption_info\030\001 \001" + + "(\0132,.google.cloud.alloydb.v1alpha.Encryp" + + "tionInfoB\004\342A\001\003\0226\n\014enabled_time\030\002 \001(\0132\032.g" + + "oogle.protobuf.TimestampB\004\342A\001\003\022.\n\010schedu" + + "le\030\003 \003(\0162\026.google.type.DayOfWeekB\004\342A\001\003\022B" + + "\n\030earliest_restorable_time\030\004 \001(\0132\032.googl" + + "e.protobuf.TimestampB\004\342A\001\003\"e\n\014BackupSour" + + "ce\022\030\n\nbackup_uid\030\002 \001(\tB\004\342A\001\003\022;\n\013backup_n" + + "ame\030\001 \001(\tB&\342A\001\002\372A\037\n\035alloydb.googleapis.c" + + "om/Backup\"h\n\026ContinuousBackupSource\022\025\n\007c" + + "luster\030\001 \001(\tB\004\342A\001\002\0227\n\rpoint_in_time\030\002 \001(" + + "\0132\032.google.protobuf.TimestampB\004\342A\001\002\"\225\022\n\007" + + "Cluster\022I\n\rbackup_source\030\017 \001(\0132*.google." + + "cloud.alloydb.v1alpha.BackupSourceB\004\342A\001\003" + + "H\000\022O\n\020migration_source\030\020 \001(\0132-.google.cl" + + "oud.alloydb.v1alpha.MigrationSourceB\004\342A\001" + + "\003H\000\022\022\n\004name\030\001 \001(\tB\004\342A\001\003\022\024\n\014display_name\030" + + "\002 \001(\t\022\021\n\003uid\030\003 \001(\tB\004\342A\001\003\0225\n\013create_time\030" + + "\004 \001(\0132\032.google.protobuf.TimestampB\004\342A\001\003\022" + + "5\n\013update_time\030\005 \001(\0132\032.google.protobuf.T" + + "imestampB\004\342A\001\003\0225\n\013delete_time\030\006 \001(\0132\032.go" + + "ogle.protobuf.TimestampB\004\342A\001\003\022A\n\006labels\030" + + "\007 \003(\01321.google.cloud.alloydb.v1alpha.Clu" + + "ster.LabelsEntry\022@\n\005state\030\010 \001(\0162+.google" + + ".cloud.alloydb.v1alpha.Cluster.StateB\004\342A" + + "\001\003\022M\n\014cluster_type\030\030 \001(\01621.google.cloud." + + "alloydb.v1alpha.Cluster.ClusterTypeB\004\342A\001" + + "\003\022M\n\020database_version\030\t \001(\0162-.google.clo" + + "ud.alloydb.v1alpha.DatabaseVersionB\004\342A\001\003" + + "\022Q\n\016network_config\030\035 \001(\01323.google.cloud." + + "alloydb.v1alpha.Cluster.NetworkConfigB\004\342" + + "A\001\001\0228\n\007network\030\n \001(\tB\'\342A\001\002\372A \n\036compute.g" + + "oogleapis.com/Network\022\014\n\004etag\030\013 \001(\t\022K\n\013a" + + "nnotations\030\014 \003(\01326.google.cloud.alloydb." + + "v1alpha.Cluster.AnnotationsEntry\022\031\n\013reco" + + "nciling\030\r \001(\010B\004\342A\001\003\022F\n\014initial_user\030\016 \001(" + + "\0132*.google.cloud.alloydb.v1alpha.UserPas" + + "swordB\004\342A\001\004\022T\n\027automated_backup_policy\030\021" + + " \001(\01323.google.cloud.alloydb.v1alpha.Auto" + + "matedBackupPolicy\022?\n\nssl_config\030\022 \001(\0132\'." + + "google.cloud.alloydb.v1alpha.SslConfigB\002" + + "\030\001\022O\n\021encryption_config\030\023 \001(\0132..google.c" + + "loud.alloydb.v1alpha.EncryptionConfigB\004\342" + + "A\001\001\022K\n\017encryption_info\030\024 \001(\0132,.google.cl" + + "oud.alloydb.v1alpha.EncryptionInfoB\004\342A\001\003" + + "\022\\\n\030continuous_backup_config\030\033 \001(\01324.goo" + + "gle.cloud.alloydb.v1alpha.ContinuousBack" + + "upConfigB\004\342A\001\001\022X\n\026continuous_backup_info" + + "\030\034 \001(\01322.google.cloud.alloydb.v1alpha.Co" + + "ntinuousBackupInfoB\004\342A\001\003\022O\n\020secondary_co" + + "nfig\030\026 \001(\01325.google.cloud.alloydb.v1alph" + + "a.Cluster.SecondaryConfig\022Q\n\016primary_con" + + "fig\030\027 \001(\01323.google.cloud.alloydb.v1alpha" + + ".Cluster.PrimaryConfigB\004\342A\001\003\032k\n\rNetworkC" + + "onfig\0228\n\007network\030\001 \001(\tB\'\342A\001\002\372A \n\036compute" + + ".googleapis.com/Network\022 \n\022allocated_ip_" + + "range\030\002 \001(\tB\004\342A\001\001\032/\n\017SecondaryConfig\022\034\n\024" + + "primary_cluster_name\030\001 \001(\t\0326\n\rPrimaryCon" + + "fig\022%\n\027secondary_cluster_names\030\001 \003(\tB\004\342A" + + "\001\003\032-\n\013LabelsEntry\022\013\n\003key\030\001 \001(\t\022\r\n\005value\030" + + "\002 \001(\t:\0028\001\0322\n\020AnnotationsEntry\022\013\n\003key\030\001 \001" + + "(\t\022\r\n\005value\030\002 \001(\t:\0028\001\"\234\001\n\005State\022\025\n\021STATE" + + "_UNSPECIFIED\020\000\022\t\n\005READY\020\001\022\013\n\007STOPPED\020\002\022\t" + + "\n\005EMPTY\020\003\022\014\n\010CREATING\020\004\022\014\n\010DELETING\020\005\022\n\n" + + "\006FAILED\020\006\022\021\n\rBOOTSTRAPPING\020\007\022\017\n\013MAINTENA" + + "NCE\020\010\022\r\n\tPROMOTING\020\t\"G\n\013ClusterType\022\034\n\030C" + + "LUSTER_TYPE_UNSPECIFIED\020\000\022\013\n\007PRIMARY\020\001\022\r" + + "\n\tSECONDARY\020\002:b\352A_\n\036alloydb.googleapis.c" + + "om/Cluster\022:projects/{project}/locations" + + "/{location}/clusters/{cluster}R\001\001B\010\n\006sou" + + "rce\"\326\022\n\010Instance\022\022\n\004name\030\001 \001(\tB\004\342A\001\003\022\024\n\014" + + "display_name\030\002 \001(\t\022\021\n\003uid\030\003 \001(\tB\004\342A\001\003\0225\n" + + "\013create_time\030\004 \001(\0132\032.google.protobuf.Tim" + + "estampB\004\342A\001\003\0225\n\013update_time\030\005 \001(\0132\032.goog" + + "le.protobuf.TimestampB\004\342A\001\003\0225\n\013delete_ti" + + "me\030\006 \001(\0132\032.google.protobuf.TimestampB\004\342A" + + "\001\003\022B\n\006labels\030\007 \003(\01322.google.cloud.alloyd" + + "b.v1alpha.Instance.LabelsEntry\022A\n\005state\030" + + "\010 \001(\0162,.google.cloud.alloydb.v1alpha.Ins" + + "tance.StateB\004\342A\001\003\022P\n\rinstance_type\030\t \001(\016" + + "23.google.cloud.alloydb.v1alpha.Instance" + + ".InstanceTypeB\004\342A\001\002\022L\n\016machine_config\030\n " + + "\001(\01324.google.cloud.alloydb.v1alpha.Insta" + + "nce.MachineConfig\022R\n\021availability_type\030\013" + + " \001(\01627.google.cloud.alloydb.v1alpha.Inst" + + "ance.AvailabilityType\022\020\n\010gce_zone\030\014 \001(\t\022" + + "Q\n\016database_flags\030\r \003(\01329.google.cloud.a" + + "lloydb.v1alpha.Instance.DatabaseFlagsEnt" + + "ry\022H\n\rwritable_node\030\023 \001(\0132+.google.cloud" + + ".alloydb.v1alpha.Instance.NodeB\004\342A\001\003\022@\n\005" + + "nodes\030\024 \003(\0132+.google.cloud.alloydb.v1alp" + + "ha.Instance.NodeB\004\342A\001\003\022a\n\025query_insights" + + "_config\030\025 \001(\0132B.google.cloud.alloydb.v1a" + + "lpha.Instance.QueryInsightsInstanceConfi" + + "g\022O\n\020read_pool_config\030\016 \001(\01325.google.clo" + + "ud.alloydb.v1alpha.Instance.ReadPoolConf" + + "ig\022\030\n\nip_address\030\017 \001(\tB\004\342A\001\003\022\031\n\013reconcil" + + "ing\030\020 \001(\010B\004\342A\001\003\022\014\n\004etag\030\021 \001(\t\022L\n\013annotat" + + "ions\030\022 \003(\01327.google.cloud.alloydb.v1alph" + + "a.Instance.AnnotationsEntry\022J\n\rupdate_po" + + "licy\030\026 \001(\01323.google.cloud.alloydb.v1alph" + + "a.Instance.UpdatePolicy\032\"\n\rMachineConfig" + + "\022\021\n\tcpu_count\030\001 \001(\005\032>\n\004Node\022\017\n\007zone_id\030\001" + + " \001(\t\022\n\n\002id\030\002 \001(\t\022\n\n\002ip\030\003 \001(\t\022\r\n\005state\030\004 " + + "\001(\t\032\372\001\n\033QueryInsightsInstanceConfig\022$\n\027r" + + "ecord_application_tags\030\002 \001(\010H\000\210\001\001\022\"\n\025rec" + + "ord_client_address\030\003 \001(\010H\001\210\001\001\022\033\n\023query_s" + + "tring_length\030\004 \001(\r\022#\n\026query_plans_per_mi" + + "nute\030\005 \001(\rH\002\210\001\001B\032\n\030_record_application_t" + + "agsB\030\n\026_record_client_addressB\031\n\027_query_" + + "plans_per_minute\032$\n\016ReadPoolConfig\022\022\n\nno" + + "de_count\030\001 \001(\005\032\222\001\n\014UpdatePolicy\022F\n\004mode\030" + + "\001 \001(\01628.google.cloud.alloydb.v1alpha.Ins" + + "tance.UpdatePolicy.Mode\":\n\004Mode\022\024\n\020MODE_" + + "UNSPECIFIED\020\000\022\013\n\007DEFAULT\020\001\022\017\n\013FORCE_APPL" + + "Y\020\002\032-\n\013LabelsEntry\022\013\n\003key\030\001 \001(\t\022\r\n\005value" + + "\030\002 \001(\t:\0028\001\0324\n\022DatabaseFlagsEntry\022\013\n\003key\030" + + "\001 \001(\t\022\r\n\005value\030\002 \001(\t:\0028\001\0322\n\020AnnotationsE" + + "ntry\022\013\n\003key\030\001 \001(\t\022\r\n\005value\030\002 \001(\t:\0028\001\"\221\001\n" + + "\005State\022\025\n\021STATE_UNSPECIFIED\020\000\022\t\n\005READY\020\001" + + "\022\013\n\007STOPPED\020\002\022\014\n\010CREATING\020\003\022\014\n\010DELETING\020" + + "\004\022\017\n\013MAINTENANCE\020\005\022\n\n\006FAILED\020\006\022\021\n\rBOOTST" + + "RAPPING\020\010\022\r\n\tPROMOTING\020\t\"X\n\014InstanceType" + + "\022\035\n\031INSTANCE_TYPE_UNSPECIFIED\020\000\022\013\n\007PRIMA" + + "RY\020\001\022\r\n\tREAD_POOL\020\002\022\r\n\tSECONDARY\020\003\"N\n\020Av" + + "ailabilityType\022!\n\035AVAILABILITY_TYPE_UNSP" + + "ECIFIED\020\000\022\t\n\005ZONAL\020\001\022\014\n\010REGIONAL\020\002:x\352Au\n" + + "\037alloydb.googleapis.com/Instance\022Oprojec" + + "ts/{project}/locations/{location}/cluste" + + "rs/{cluster}/instances/{instance}R\001\001\"\211\002\n" + + "\016ConnectionInfo\022\014\n\004name\030\001 \001(\t\022\030\n\nip_addr" + + "ess\030\002 \001(\tB\004\342A\001\003\022%\n\025pem_certificate_chain" + + "\030\003 \003(\tB\006\030\001\342A\001\003\022\032\n\014instance_uid\030\004 \001(\tB\004\342A" + + "\001\003:\213\001\352A\207\001\n%alloydb.googleapis.com/Connec" + + "tionInfo\022^projects/{project}/locations/{" + + "location}/clusters/{cluster}/instances/{" + + "instance}/connectionInfo\"\334\t\n\006Backup\022\022\n\004n" + + "ame\030\001 \001(\tB\004\342A\001\003\022\024\n\014display_name\030\002 \001(\t\022\021\n" + + "\003uid\030\003 \001(\tB\004\342A\001\003\0225\n\013create_time\030\004 \001(\0132\032." + + "google.protobuf.TimestampB\004\342A\001\003\0225\n\013updat" + + "e_time\030\005 \001(\0132\032.google.protobuf.Timestamp" + + "B\004\342A\001\003\0225\n\013delete_time\030\017 \001(\0132\032.google.pro" + + "tobuf.TimestampB\004\342A\001\003\022@\n\006labels\030\006 \003(\01320." + + "google.cloud.alloydb.v1alpha.Backup.Labe" + + "lsEntry\022?\n\005state\030\007 \001(\0162*.google.cloud.al" + + "loydb.v1alpha.Backup.StateB\004\342A\001\003\0227\n\004type" + + "\030\010 \001(\0162).google.cloud.alloydb.v1alpha.Ba" + + "ckup.Type\022\023\n\013description\030\t \001(\t\022\031\n\013cluste" + + "r_uid\030\022 \001(\tB\004\342A\001\003\022=\n\014cluster_name\030\n \001(\tB" + + "\'\342A\001\002\372A \n\036alloydb.googleapis.com/Cluster" + + "\022\031\n\013reconciling\030\013 \001(\010B\004\342A\001\003\022O\n\021encryptio" + + "n_config\030\014 \001(\0132..google.cloud.alloydb.v1" + + "alpha.EncryptionConfigB\004\342A\001\001\022K\n\017encrypti" + + "on_info\030\r \001(\0132,.google.cloud.alloydb.v1a" + + "lpha.EncryptionInfoB\004\342A\001\003\022\014\n\004etag\030\016 \001(\t\022" + + "J\n\013annotations\030\020 \003(\01325.google.cloud.allo" + + "ydb.v1alpha.Backup.AnnotationsEntry\022\030\n\ns" + + "ize_bytes\030\021 \001(\003B\004\342A\001\003\0225\n\013expiry_time\030\023 \001" + + "(\0132\032.google.protobuf.TimestampB\004\342A\001\003\032-\n\013" + + "LabelsEntry\022\013\n\003key\030\001 \001(\t\022\r\n\005value\030\002 \001(\t:" + + "\0028\001\0322\n\020AnnotationsEntry\022\013\n\003key\030\001 \001(\t\022\r\n\005" + + "value\030\002 \001(\t:\0028\001\"Q\n\005State\022\025\n\021STATE_UNSPEC" + + "IFIED\020\000\022\t\n\005READY\020\001\022\014\n\010CREATING\020\002\022\n\n\006FAIL" + + "ED\020\003\022\014\n\010DELETING\020\004\"J\n\004Type\022\024\n\020TYPE_UNSPE" + + "CIFIED\020\000\022\r\n\tON_DEMAND\020\001\022\r\n\tAUTOMATED\020\002\022\016" + + "\n\nCONTINUOUS\020\003:_\352A\\\n\035alloydb.googleapis." + + "com/Backup\0228projects/{project}/locations" + + "/{location}/backups/{backup}R\001\001\"\334\006\n\025Supp" + + "ortedDatabaseFlag\022e\n\023string_restrictions" + + "\030\007 \001(\0132F.google.cloud.alloydb.v1alpha.Su" + + "pportedDatabaseFlag.StringRestrictionsH\000" + + "\022g\n\024integer_restrictions\030\010 \001(\0132G.google." + + "cloud.alloydb.v1alpha.SupportedDatabaseF" + + "lag.IntegerRestrictionsH\000\022\014\n\004name\030\001 \001(\t\022" + + "\021\n\tflag_name\030\002 \001(\t\022Q\n\nvalue_type\030\003 \001(\0162=" + + ".google.cloud.alloydb.v1alpha.SupportedD" + + "atabaseFlag.ValueType\022\037\n\027accepts_multipl" + + "e_values\030\004 \001(\010\022L\n\025supported_db_versions\030" + + "\005 \003(\0162-.google.cloud.alloydb.v1alpha.Dat" + + "abaseVersion\022\033\n\023requires_db_restart\030\006 \001(" + + "\010\032,\n\022StringRestrictions\022\026\n\016allowed_value" + + "s\030\001 \003(\t\032u\n\023IntegerRestrictions\022.\n\tmin_va" + + "lue\030\001 \001(\0132\033.google.protobuf.Int64Value\022." + + "\n\tmax_value\030\002 \001(\0132\033.google.protobuf.Int6" + + "4Value\"U\n\tValueType\022\032\n\026VALUE_TYPE_UNSPEC" + + "IFIED\020\000\022\n\n\006STRING\020\001\022\013\n\007INTEGER\020\002\022\t\n\005FLOA" + + "T\020\003\022\010\n\004NONE\020\004:g\352Ad\n,alloydb.googleapis.c" + + "om/SupportedDatabaseFlag\0224projects/{proj" + + "ect}/locations/{location}/flags/{flag}B\016" + + "\n\014restrictions\"\327\002\n\004User\022\022\n\004name\030\001 \001(\tB\004\342" + + "A\001\003\022\026\n\010password\030\002 \001(\tB\004\342A\001\004\022\034\n\016database_" + + "roles\030\004 \003(\tB\004\342A\001\001\022D\n\tuser_type\030\005 \001(\0162+.g" + + "oogle.cloud.alloydb.v1alpha.User.UserTyp" + + "eB\004\342A\001\001\"Q\n\010UserType\022\031\n\025USER_TYPE_UNSPECI" + + "FIED\020\000\022\024\n\020ALLOYDB_BUILT_IN\020\001\022\024\n\020ALLOYDB_" + + "IAM_USER\020\002:l\352Ai\n\033alloydb.googleapis.com/" + + "User\022Gprojects/{project}/locations/{loca" + + "tion}/clusters/{cluster}/users/{user}R\001\001" + + "*^\n\014InstanceView\022\035\n\031INSTANCE_VIEW_UNSPEC" + + "IFIED\020\000\022\027\n\023INSTANCE_VIEW_BASIC\020\001\022\026\n\022INST" + + "ANCE_VIEW_FULL\020\002*g\n\013ClusterView\022\034\n\030CLUST" + + "ER_VIEW_UNSPECIFIED\020\000\022\026\n\022CLUSTER_VIEW_BA" + + "SIC\020\001\022\"\n\036CLUSTER_VIEW_CONTINUOUS_BACKUP\020" + + "\002*Y\n\017DatabaseVersion\022 \n\034DATABASE_VERSION" + + "_UNSPECIFIED\020\000\022\023\n\013POSTGRES_13\020\001\032\002\010\001\022\017\n\013P" + + "OSTGRES_14\020\002B\313\003\n com.google.cloud.alloyd" + + "b.v1alphaB\016ResourcesProtoP\001Z:cloud.googl" + + "e.com/go/alloydb/apiv1alpha/alloydbpb;al" + + "loydbpb\252\002\034Google.Cloud.AlloyDb.V1Alpha\312\002" + + "\034Google\\Cloud\\AlloyDb\\V1alpha\352\002\037Google::" + + "Cloud::AlloyDB::V1alpha\352A\246\001\n(cloudkms.go" + + "ogleapis.com/CryptoKeyVersion\022zprojects/" + + "{project}/locations/{location}/keyRings/" + + "{key_ring}/cryptoKeys/{crypto_key}/crypt" + + "oKeyVersions/{crypto_key_version}\352AN\n\036co" + + "mpute.googleapis.com/Network\022,projects/{" + + "project}/global/networks/{network}b\006prot" + + "o3" }; descriptor = com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( @@ -548,7 +586,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_alloydb_v1alpha_ContinuousBackupInfo_descriptor, new java.lang.String[] { - "EncryptionInfo", "EnabledTime", "Schedule", + "EncryptionInfo", "EnabledTime", "Schedule", "EarliestRestorableTime", }); internal_static_google_cloud_alloydb_v1alpha_BackupSource_descriptor = getDescriptor().getMessageTypes().get(8); @@ -584,6 +622,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "State", "ClusterType", "DatabaseVersion", + "NetworkConfig", "Network", "Etag", "Annotations", @@ -599,8 +638,16 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "PrimaryConfig", "Source", }); - internal_static_google_cloud_alloydb_v1alpha_Cluster_SecondaryConfig_descriptor = + internal_static_google_cloud_alloydb_v1alpha_Cluster_NetworkConfig_descriptor = internal_static_google_cloud_alloydb_v1alpha_Cluster_descriptor.getNestedTypes().get(0); + internal_static_google_cloud_alloydb_v1alpha_Cluster_NetworkConfig_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_alloydb_v1alpha_Cluster_NetworkConfig_descriptor, + new java.lang.String[] { + "Network", "AllocatedIpRange", + }); + internal_static_google_cloud_alloydb_v1alpha_Cluster_SecondaryConfig_descriptor = + internal_static_google_cloud_alloydb_v1alpha_Cluster_descriptor.getNestedTypes().get(1); internal_static_google_cloud_alloydb_v1alpha_Cluster_SecondaryConfig_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_alloydb_v1alpha_Cluster_SecondaryConfig_descriptor, @@ -608,7 +655,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "PrimaryClusterName", }); internal_static_google_cloud_alloydb_v1alpha_Cluster_PrimaryConfig_descriptor = - internal_static_google_cloud_alloydb_v1alpha_Cluster_descriptor.getNestedTypes().get(1); + internal_static_google_cloud_alloydb_v1alpha_Cluster_descriptor.getNestedTypes().get(2); internal_static_google_cloud_alloydb_v1alpha_Cluster_PrimaryConfig_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_alloydb_v1alpha_Cluster_PrimaryConfig_descriptor, @@ -616,7 +663,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "SecondaryClusterNames", }); internal_static_google_cloud_alloydb_v1alpha_Cluster_LabelsEntry_descriptor = - internal_static_google_cloud_alloydb_v1alpha_Cluster_descriptor.getNestedTypes().get(2); + internal_static_google_cloud_alloydb_v1alpha_Cluster_descriptor.getNestedTypes().get(3); internal_static_google_cloud_alloydb_v1alpha_Cluster_LabelsEntry_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_alloydb_v1alpha_Cluster_LabelsEntry_descriptor, @@ -624,7 +671,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "Key", "Value", }); internal_static_google_cloud_alloydb_v1alpha_Cluster_AnnotationsEntry_descriptor = - internal_static_google_cloud_alloydb_v1alpha_Cluster_descriptor.getNestedTypes().get(3); + internal_static_google_cloud_alloydb_v1alpha_Cluster_descriptor.getNestedTypes().get(4); internal_static_google_cloud_alloydb_v1alpha_Cluster_AnnotationsEntry_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_alloydb_v1alpha_Cluster_AnnotationsEntry_descriptor, @@ -658,6 +705,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "Reconciling", "Etag", "Annotations", + "UpdatePolicy", }); internal_static_google_cloud_alloydb_v1alpha_Instance_MachineConfig_descriptor = internal_static_google_cloud_alloydb_v1alpha_Instance_descriptor.getNestedTypes().get(0); @@ -697,8 +745,16 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { new java.lang.String[] { "NodeCount", }); - internal_static_google_cloud_alloydb_v1alpha_Instance_LabelsEntry_descriptor = + internal_static_google_cloud_alloydb_v1alpha_Instance_UpdatePolicy_descriptor = internal_static_google_cloud_alloydb_v1alpha_Instance_descriptor.getNestedTypes().get(4); + internal_static_google_cloud_alloydb_v1alpha_Instance_UpdatePolicy_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_alloydb_v1alpha_Instance_UpdatePolicy_descriptor, + new java.lang.String[] { + "Mode", + }); + internal_static_google_cloud_alloydb_v1alpha_Instance_LabelsEntry_descriptor = + internal_static_google_cloud_alloydb_v1alpha_Instance_descriptor.getNestedTypes().get(5); internal_static_google_cloud_alloydb_v1alpha_Instance_LabelsEntry_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_alloydb_v1alpha_Instance_LabelsEntry_descriptor, @@ -706,7 +762,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "Key", "Value", }); internal_static_google_cloud_alloydb_v1alpha_Instance_DatabaseFlagsEntry_descriptor = - internal_static_google_cloud_alloydb_v1alpha_Instance_descriptor.getNestedTypes().get(5); + internal_static_google_cloud_alloydb_v1alpha_Instance_descriptor.getNestedTypes().get(6); internal_static_google_cloud_alloydb_v1alpha_Instance_DatabaseFlagsEntry_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_alloydb_v1alpha_Instance_DatabaseFlagsEntry_descriptor, @@ -714,7 +770,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "Key", "Value", }); internal_static_google_cloud_alloydb_v1alpha_Instance_AnnotationsEntry_descriptor = - internal_static_google_cloud_alloydb_v1alpha_Instance_descriptor.getNestedTypes().get(6); + internal_static_google_cloud_alloydb_v1alpha_Instance_descriptor.getNestedTypes().get(7); internal_static_google_cloud_alloydb_v1alpha_Instance_AnnotationsEntry_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_alloydb_v1alpha_Instance_AnnotationsEntry_descriptor, @@ -807,6 +863,14 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { new java.lang.String[] { "MinValue", "MaxValue", }); + internal_static_google_cloud_alloydb_v1alpha_User_descriptor = + getDescriptor().getMessageTypes().get(15); + internal_static_google_cloud_alloydb_v1alpha_User_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_alloydb_v1alpha_User_descriptor, + new java.lang.String[] { + "Name", "Password", "DatabaseRoles", "UserType", + }); com.google.protobuf.ExtensionRegistry registry = com.google.protobuf.ExtensionRegistry.newInstance(); registry.add(com.google.api.FieldBehaviorProto.fieldBehavior); diff --git a/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/ServiceProto.java b/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/ServiceProto.java index 1b754cacc26d..8069377873ed 100644 --- a/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/ServiceProto.java +++ b/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/ServiceProto.java @@ -119,6 +119,10 @@ public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry r internal_static_google_cloud_alloydb_v1alpha_FailoverInstanceRequest_descriptor; static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_google_cloud_alloydb_v1alpha_FailoverInstanceRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_alloydb_v1alpha_InjectFaultRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_alloydb_v1alpha_InjectFaultRequest_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_google_cloud_alloydb_v1alpha_RestartInstanceRequest_descriptor; static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable @@ -171,6 +175,30 @@ public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry r internal_static_google_cloud_alloydb_v1alpha_OperationMetadata_descriptor; static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_google_cloud_alloydb_v1alpha_OperationMetadata_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_alloydb_v1alpha_ListUsersRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_alloydb_v1alpha_ListUsersRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_alloydb_v1alpha_ListUsersResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_alloydb_v1alpha_ListUsersResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_alloydb_v1alpha_GetUserRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_alloydb_v1alpha_GetUserRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_alloydb_v1alpha_CreateUserRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_alloydb_v1alpha_CreateUserRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_alloydb_v1alpha_UpdateUserRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_alloydb_v1alpha_UpdateUserRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_alloydb_v1alpha_DeleteUserRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_alloydb_v1alpha_DeleteUserRequest_fieldAccessorTable; public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { return descriptor; @@ -198,307 +226,368 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + "\024ListClustersResponse\0227\n\010clusters\030\001 \003(\0132" + "%.google.cloud.alloydb.v1alpha.Cluster\022\027" + "\n\017next_page_token\030\002 \001(\t\022\023\n\013unreachable\030\003" - + " \003(\t\"J\n\021GetClusterRequest\0225\n\004name\030\001 \001(\tB" - + "\'\342A\001\002\372A \n\036alloydb.googleapis.com/Cluster" - + "\"\347\001\n\035CreateSecondaryClusterRequest\0227\n\006pa" - + "rent\030\001 \001(\tB\'\342A\001\002\372A \022\036alloydb.googleapis." - + "com/Cluster\022\030\n\ncluster_id\030\002 \001(\tB\004\342A\001\002\022<\n" - + "\007cluster\030\003 \001(\0132%.google.cloud.alloydb.v1" - + "alpha.ClusterB\004\342A\001\002\022\030\n\nrequest_id\030\005 \001(\tB" - + "\004\342A\001\001\022\033\n\rvalidate_only\030\006 \001(\010B\004\342A\001\001\"\336\001\n\024C" - + "reateClusterRequest\0227\n\006parent\030\001 \001(\tB\'\342A\001" - + "\002\372A \022\036alloydb.googleapis.com/Cluster\022\030\n\n" - + "cluster_id\030\002 \001(\tB\004\342A\001\002\022<\n\007cluster\030\003 \001(\0132" - + "%.google.cloud.alloydb.v1alpha.ClusterB\004" - + "\342A\001\002\022\030\n\nrequest_id\030\004 \001(\tB\004\342A\001\001\022\033\n\rvalida" - + "te_only\030\005 \001(\010B\004\342A\001\001\"\337\001\n\024UpdateClusterReq" - + "uest\0225\n\013update_mask\030\001 \001(\0132\032.google.proto" - + "buf.FieldMaskB\004\342A\001\001\022<\n\007cluster\030\002 \001(\0132%.g" - + "oogle.cloud.alloydb.v1alpha.ClusterB\004\342A\001" - + "\002\022\030\n\nrequest_id\030\003 \001(\tB\004\342A\001\001\022\033\n\rvalidate_" - + "only\030\004 \001(\010B\004\342A\001\001\022\033\n\rallow_missing\030\005 \001(\010B" - + "\004\342A\001\001\"\255\001\n\024DeleteClusterRequest\0225\n\004name\030\001" - + " \001(\tB\'\342A\001\002\372A \n\036alloydb.googleapis.com/Cl" - + "uster\022\030\n\nrequest_id\030\002 \001(\tB\004\342A\001\001\022\022\n\004etag\030" - + "\003 \001(\tB\004\342A\001\001\022\033\n\rvalidate_only\030\004 \001(\010B\004\342A\001\001" - + "\022\023\n\005force\030\005 \001(\010B\004\342A\001\001\"\231\001\n\025PromoteCluster" - + "Request\0225\n\004name\030\001 \001(\tB\'\342A\001\002\372A \n\036alloydb." - + "googleapis.com/Cluster\022\030\n\nrequest_id\030\002 \001" - + "(\tB\004\342A\001\001\022\022\n\004etag\030\003 \001(\tB\004\342A\001\001\022\033\n\rvalidate" - + "_only\030\004 \001(\010B\004\342A\001\001\"\210\003\n\025RestoreClusterRequ" - + "est\022C\n\rbackup_source\030\004 \001(\0132*.google.clou" - + "d.alloydb.v1alpha.BackupSourceH\000\022X\n\030cont" - + "inuous_backup_source\030\010 \001(\01324.google.clou" - + "d.alloydb.v1alpha.ContinuousBackupSource" - + "H\000\0227\n\006parent\030\001 \001(\tB\'\342A\001\002\372A \022\036alloydb.goo" - + "gleapis.com/Cluster\022\030\n\ncluster_id\030\002 \001(\tB" - + "\004\342A\001\002\022<\n\007cluster\030\003 \001(\0132%.google.cloud.al" - + "loydb.v1alpha.ClusterB\004\342A\001\002\022\030\n\nrequest_i" - + "d\030\005 \001(\tB\004\342A\001\001\022\033\n\rvalidate_only\030\006 \001(\010B\004\342A" - + "\001\001B\010\n\006source\"\253\001\n\024ListInstancesRequest\0228\n" - + "\006parent\030\001 \001(\tB(\342A\001\002\372A!\022\037alloydb.googleap" - + "is.com/Instance\022\027\n\tpage_size\030\002 \001(\005B\004\342A\001\001" - + "\022\022\n\npage_token\030\003 \001(\t\022\024\n\006filter\030\004 \001(\tB\004\342A" - + "\001\001\022\026\n\010order_by\030\005 \001(\tB\004\342A\001\001\"\200\001\n\025ListInsta" - + "ncesResponse\0229\n\tinstances\030\001 \003(\0132&.google" - + ".cloud.alloydb.v1alpha.Instance\022\027\n\017next_" - + "page_token\030\002 \001(\t\022\023\n\013unreachable\030\003 \003(\t\"\206\001" - + "\n\022GetInstanceRequest\0226\n\004name\030\001 \001(\tB(\342A\001\002" - + "\372A!\n\037alloydb.googleapis.com/Instance\0228\n\004" - + "view\030\002 \001(\0162*.google.cloud.alloydb.v1alph" - + "a.InstanceView\"\343\001\n\025CreateInstanceRequest" - + "\0228\n\006parent\030\001 \001(\tB(\342A\001\002\372A!\022\037alloydb.googl" - + "eapis.com/Instance\022\031\n\013instance_id\030\002 \001(\tB" - + "\004\342A\001\002\022>\n\010instance\030\003 \001(\0132&.google.cloud.a" - + "lloydb.v1alpha.InstanceB\004\342A\001\002\022\030\n\nrequest" - + "_id\030\004 \001(\tB\004\342A\001\001\022\033\n\rvalidate_only\030\005 \001(\010B\004" - + "\342A\001\001\"\354\001\n\036CreateSecondaryInstanceRequest\022" - + "8\n\006parent\030\001 \001(\tB(\342A\001\002\372A!\022\037alloydb.google" - + "apis.com/Instance\022\031\n\013instance_id\030\002 \001(\tB\004" - + "\342A\001\002\022>\n\010instance\030\003 \001(\0132&.google.cloud.al" - + "loydb.v1alpha.InstanceB\004\342A\001\002\022\030\n\nrequest_" + + " \003(\t\"\211\001\n\021GetClusterRequest\0225\n\004name\030\001 \001(\t" + + "B\'\342A\001\002\372A \n\036alloydb.googleapis.com/Cluste" + + "r\022=\n\004view\030\002 \001(\0162).google.cloud.alloydb.v" + + "1alpha.ClusterViewB\004\342A\001\001\"\347\001\n\035CreateSecon" + + "daryClusterRequest\0227\n\006parent\030\001 \001(\tB\'\342A\001\002" + + "\372A \022\036alloydb.googleapis.com/Cluster\022\030\n\nc" + + "luster_id\030\002 \001(\tB\004\342A\001\002\022<\n\007cluster\030\003 \001(\0132%" + + ".google.cloud.alloydb.v1alpha.ClusterB\004\342" + + "A\001\002\022\030\n\nrequest_id\030\005 \001(\tB\004\342A\001\001\022\033\n\rvalidat" + + "e_only\030\006 \001(\010B\004\342A\001\001\"\336\001\n\024CreateClusterRequ" + + "est\0227\n\006parent\030\001 \001(\tB\'\342A\001\002\372A \022\036alloydb.go" + + "ogleapis.com/Cluster\022\030\n\ncluster_id\030\002 \001(\t" + + "B\004\342A\001\002\022<\n\007cluster\030\003 \001(\0132%.google.cloud.a" + + "lloydb.v1alpha.ClusterB\004\342A\001\002\022\030\n\nrequest_" + "id\030\004 \001(\tB\004\342A\001\001\022\033\n\rvalidate_only\030\005 \001(\010B\004\342" - + "A\001\001\"u\n\026CreateInstanceRequests\022[\n\030create_" - + "instance_requests\030\001 \003(\01323.google.cloud.a" - + "lloydb.v1alpha.CreateInstanceRequestB\004\342A" - + "\001\002\"\277\001\n\033BatchCreateInstancesRequest\0228\n\006pa" - + "rent\030\001 \001(\tB(\342A\001\002\372A!\022\037alloydb.googleapis." - + "com/Instance\022L\n\010requests\030\002 \001(\01324.google." - + "cloud.alloydb.v1alpha.CreateInstanceRequ" - + "estsB\004\342A\001\002\022\030\n\nrequest_id\030\003 \001(\tB\004\342A\001\001\"Y\n\034" - + "BatchCreateInstancesResponse\0229\n\tinstance" - + "s\030\001 \003(\0132&.google.cloud.alloydb.v1alpha.I" - + "nstance\"\227\002\n\034BatchCreateInstancesMetadata" - + "\022\030\n\020instance_targets\030\001 \003(\t\022k\n\021instance_s" - + "tatuses\030\002 \003(\0132P.google.cloud.alloydb.v1a" - + "lpha.BatchCreateInstancesMetadata.Instan" - + "ceStatusesEntry\032p\n\025InstanceStatusesEntry" - + "\022\013\n\003key\030\001 \001(\t\022F\n\005value\030\002 \001(\01327.google.cl" - + "oud.alloydb.v1alpha.BatchCreateInstanceS" - + "tatus:\0028\001\"\332\002\n\031BatchCreateInstanceStatus\022" - + "L\n\005state\030\001 \001(\0162=.google.cloud.alloydb.v1" - + "alpha.BatchCreateInstanceStatus.State\022\021\n" - + "\terror_msg\030\002 \001(\t\022!\n\005error\030\004 \001(\0132\022.google" - + ".rpc.Status\022A\n\004type\030\003 \001(\01623.google.cloud" - + ".alloydb.v1alpha.Instance.InstanceType\"v" - + "\n\005State\022\025\n\021STATE_UNSPECIFIED\020\000\022\022\n\016PENDIN" - + "G_CREATE\020\001\022\t\n\005READY\020\002\022\014\n\010CREATING\020\003\022\014\n\010D" - + "ELETING\020\004\022\n\n\006FAILED\020\005\022\017\n\013ROLLED_BACK\020\006\"\342" - + "\001\n\025UpdateInstanceRequest\0225\n\013update_mask\030" - + "\001 \001(\0132\032.google.protobuf.FieldMaskB\004\342A\001\001\022" - + ">\n\010instance\030\002 \001(\0132&.google.cloud.alloydb" - + ".v1alpha.InstanceB\004\342A\001\002\022\030\n\nrequest_id\030\003 " - + "\001(\tB\004\342A\001\001\022\033\n\rvalidate_only\030\004 \001(\010B\004\342A\001\001\022\033" - + "\n\rallow_missing\030\005 \001(\010B\004\342A\001\001\"\232\001\n\025DeleteIn" - + "stanceRequest\0226\n\004name\030\001 \001(\tB(\342A\001\002\372A!\n\037al" - + "loydb.googleapis.com/Instance\022\030\n\nrequest" + + "A\001\001\"\337\001\n\024UpdateClusterRequest\0225\n\013update_m" + + "ask\030\001 \001(\0132\032.google.protobuf.FieldMaskB\004\342" + + "A\001\001\022<\n\007cluster\030\002 \001(\0132%.google.cloud.allo" + + "ydb.v1alpha.ClusterB\004\342A\001\002\022\030\n\nrequest_id\030" + + "\003 \001(\tB\004\342A\001\001\022\033\n\rvalidate_only\030\004 \001(\010B\004\342A\001\001" + + "\022\033\n\rallow_missing\030\005 \001(\010B\004\342A\001\001\"\255\001\n\024Delete" + + "ClusterRequest\0225\n\004name\030\001 \001(\tB\'\342A\001\002\372A \n\036a" + + "lloydb.googleapis.com/Cluster\022\030\n\nrequest" + "_id\030\002 \001(\tB\004\342A\001\001\022\022\n\004etag\030\003 \001(\tB\004\342A\001\001\022\033\n\rv" - + "alidate_only\030\004 \001(\010B\004\342A\001\001\"\210\001\n\027FailoverIns" - + "tanceRequest\0226\n\004name\030\001 \001(\tB(\342A\001\002\372A!\n\037all" - + "oydb.googleapis.com/Instance\022\030\n\nrequest_" - + "id\030\002 \001(\tB\004\342A\001\001\022\033\n\rvalidate_only\030\003 \001(\010B\004\342" - + "A\001\001\"\207\001\n\026RestartInstanceRequest\0226\n\004name\030\001" - + " \001(\tB(\342A\001\002\372A!\n\037alloydb.googleapis.com/In" - + "stance\022\030\n\nrequest_id\030\002 \001(\tB\004\342A\001\001\022\033\n\rvali" - + "date_only\030\003 \001(\010B\004\342A\001\001\"\225\001\n\022ListBackupsReq" - + "uest\0226\n\006parent\030\001 \001(\tB&\342A\001\002\372A\037\022\035alloydb.g" - + "oogleapis.com/Backup\022\021\n\tpage_size\030\002 \001(\005\022" - + "\022\n\npage_token\030\003 \001(\t\022\016\n\006filter\030\004 \001(\t\022\020\n\010o" - + "rder_by\030\005 \001(\t\"z\n\023ListBackupsResponse\0225\n\007" - + "backups\030\001 \003(\0132$.google.cloud.alloydb.v1a" - + "lpha.Backup\022\027\n\017next_page_token\030\002 \001(\t\022\023\n\013" - + "unreachable\030\003 \003(\t\"H\n\020GetBackupRequest\0224\n" - + "\004name\030\001 \001(\tB&\342A\001\002\372A\037\n\035alloydb.googleapis" - + ".com/Backup\"\331\001\n\023CreateBackupRequest\0226\n\006p" - + "arent\030\001 \001(\tB&\342A\001\002\372A\037\022\035alloydb.googleapis" - + ".com/Backup\022\027\n\tbackup_id\030\002 \001(\tB\004\342A\001\002\022:\n\006" - + "backup\030\003 \001(\0132$.google.cloud.alloydb.v1al" - + "pha.BackupB\004\342A\001\002\022\030\n\nrequest_id\030\004 \001(\tB\004\342A" - + "\001\001\022\033\n\rvalidate_only\030\005 \001(\010B\004\342A\001\001\"\334\001\n\023Upda" - + "teBackupRequest\0225\n\013update_mask\030\001 \001(\0132\032.g" - + "oogle.protobuf.FieldMaskB\004\342A\001\001\022:\n\006backup" - + "\030\002 \001(\0132$.google.cloud.alloydb.v1alpha.Ba" - + "ckupB\004\342A\001\002\022\030\n\nrequest_id\030\003 \001(\tB\004\342A\001\001\022\033\n\r" - + "validate_only\030\004 \001(\010B\004\342A\001\001\022\033\n\rallow_missi" - + "ng\030\005 \001(\010B\004\342A\001\001\"\226\001\n\023DeleteBackupRequest\0224" - + "\n\004name\030\001 \001(\tB&\342A\001\002\372A\037\n\035alloydb.googleapi" - + "s.com/Backup\022\030\n\nrequest_id\030\002 \001(\tB\004\342A\001\001\022\033" - + "\n\rvalidate_only\030\003 \001(\010B\004\342A\001\001\022\022\n\004etag\030\004 \001(" - + "\tB\004\342A\001\001\"\221\001\n!ListSupportedDatabaseFlagsRe" - + "quest\022E\n\006parent\030\001 \001(\tB5\342A\001\002\372A.\022,alloydb." - + "googleapis.com/SupportedDatabaseFlag\022\021\n\t" - + "page_size\030\002 \001(\005\022\022\n\npage_token\030\003 \001(\t\"\224\001\n\"" - + "ListSupportedDatabaseFlagsResponse\022U\n\030su" - + "pported_database_flags\030\001 \003(\01323.google.cl" - + "oud.alloydb.v1alpha.SupportedDatabaseFla" - + "g\022\027\n\017next_page_token\030\002 \001(\t\"\304\001\n GenerateC" - + "lientCertificateRequest\0227\n\006parent\030\001 \001(\tB" - + "\'\342A\001\002\372A \n\036alloydb.googleapis.com/Cluster" - + "\022\030\n\nrequest_id\030\002 \001(\tB\004\342A\001\001\022\025\n\007pem_csr\030\003 " - + "\001(\tB\004\342A\001\001\0226\n\rcert_duration\030\004 \001(\0132\031.googl" - + "e.protobuf.DurationB\004\342A\001\001\"g\n!GenerateCli" - + "entCertificateResponse\022\035\n\017pem_certificat" - + "e\030\001 \001(\tB\004\342A\001\003\022#\n\025pem_certificate_chain\030\002" - + " \003(\tB\004\342A\001\003\"n\n\030GetConnectionInfoRequest\0228" - + "\n\006parent\030\001 \001(\tB(\342A\001\002\372A!\n\037alloydb.googlea" - + "pis.com/Instance\022\030\n\nrequest_id\030\002 \001(\tB\004\342A" - + "\001\001\"\210\003\n\021OperationMetadata\022k\n\037batch_create" - + "_instances_metadata\030\010 \001(\0132:.google.cloud" - + ".alloydb.v1alpha.BatchCreateInstancesMet" - + "adataB\004\342A\001\003H\000\0225\n\013create_time\030\001 \001(\0132\032.goo" - + "gle.protobuf.TimestampB\004\342A\001\003\0222\n\010end_time" - + "\030\002 \001(\0132\032.google.protobuf.TimestampB\004\342A\001\003" - + "\022\024\n\006target\030\003 \001(\tB\004\342A\001\003\022\022\n\004verb\030\004 \001(\tB\004\342A" - + "\001\003\022\034\n\016status_message\030\005 \001(\tB\004\342A\001\003\022$\n\026requ" - + "ested_cancellation\030\006 \001(\010B\004\342A\001\003\022\031\n\013api_ve" - + "rsion\030\007 \001(\tB\004\342A\001\003B\022\n\020request_specific2\372+" - + "\n\014AlloyDBAdmin\022\271\001\n\014ListClusters\0221.google" - + ".cloud.alloydb.v1alpha.ListClustersReque" - + "st\0322.google.cloud.alloydb.v1alpha.ListCl" - + "ustersResponse\"B\332A\006parent\202\323\344\223\0023\0221/v1alph" - + "a/{parent=projects/*/locations/*}/cluste" - + "rs\022\246\001\n\nGetCluster\022/.google.cloud.alloydb" - + ".v1alpha.GetClusterRequest\032%.google.clou" - + "d.alloydb.v1alpha.Cluster\"@\332A\004name\202\323\344\223\0023" - + "\0221/v1alpha/{name=projects/*/locations/*/" - + "clusters/*}\022\341\001\n\rCreateCluster\0222.google.c" - + "loud.alloydb.v1alpha.CreateClusterReques" - + "t\032\035.google.longrunning.Operation\"}\312A\034\n\007C" - + "luster\022\021OperationMetadata\332A\031parent,clust" - + "er,cluster_id\202\323\344\223\002<\"1/v1alpha/{parent=pr" - + "ojects/*/locations/*}/clusters:\007cluster\022" - + "\343\001\n\rUpdateCluster\0222.google.cloud.alloydb" - + ".v1alpha.UpdateClusterRequest\032\035.google.l" - + "ongrunning.Operation\"\177\312A\034\n\007Cluster\022\021Oper" - + "ationMetadata\332A\023cluster,update_mask\202\323\344\223\002" - + "D29/v1alpha/{cluster.name=projects/*/loc" - + "ations/*/clusters/*}:\007cluster\022\321\001\n\rDelete" - + "Cluster\0222.google.cloud.alloydb.v1alpha.D" - + "eleteClusterRequest\032\035.google.longrunning" - + ".Operation\"m\312A*\n\025google.protobuf.Empty\022\021" - + "OperationMetadata\332A\004name\202\323\344\223\0023*1/v1alpha" - + "/{name=projects/*/locations/*/clusters/*" - + "}\022\320\001\n\016PromoteCluster\0223.google.cloud.allo" - + "ydb.v1alpha.PromoteClusterRequest\032\035.goog" - + "le.longrunning.Operation\"j\312A\034\n\007Cluster\022\021" - + "OperationMetadata\332A\004name\202\323\344\223\002>\"9/v1alpha" - + "/{name=projects/*/locations/*/clusters/*" - + "}:promote:\001*\022\311\001\n\016RestoreCluster\0223.google" - + ".cloud.alloydb.v1alpha.RestoreClusterReq" - + "uest\032\035.google.longrunning.Operation\"c\312A\034" - + "\n\007Cluster\022\021OperationMetadata\202\323\344\223\002>\"9/v1a" - + "lpha/{parent=projects/*/locations/*}/clu" - + "sters:restore:\001*\022\204\002\n\026CreateSecondaryClus" - + "ter\022;.google.cloud.alloydb.v1alpha.Creat" - + "eSecondaryClusterRequest\032\035.google.longru" - + "nning.Operation\"\215\001\312A\034\n\007Cluster\022\021Operatio" + + "alidate_only\030\004 \001(\010B\004\342A\001\001\022\023\n\005force\030\005 \001(\010B" + + "\004\342A\001\001\"\231\001\n\025PromoteClusterRequest\0225\n\004name\030" + + "\001 \001(\tB\'\342A\001\002\372A \n\036alloydb.googleapis.com/C" + + "luster\022\030\n\nrequest_id\030\002 \001(\tB\004\342A\001\001\022\022\n\004etag" + + "\030\003 \001(\tB\004\342A\001\001\022\033\n\rvalidate_only\030\004 \001(\010B\004\342A\001" + + "\001\"\210\003\n\025RestoreClusterRequest\022C\n\rbackup_so" + + "urce\030\004 \001(\0132*.google.cloud.alloydb.v1alph" + + "a.BackupSourceH\000\022X\n\030continuous_backup_so" + + "urce\030\010 \001(\01324.google.cloud.alloydb.v1alph" + + "a.ContinuousBackupSourceH\000\0227\n\006parent\030\001 \001" + + "(\tB\'\342A\001\002\372A \022\036alloydb.googleapis.com/Clus" + + "ter\022\030\n\ncluster_id\030\002 \001(\tB\004\342A\001\002\022<\n\007cluster" + + "\030\003 \001(\0132%.google.cloud.alloydb.v1alpha.Cl" + + "usterB\004\342A\001\002\022\030\n\nrequest_id\030\005 \001(\tB\004\342A\001\001\022\033\n" + + "\rvalidate_only\030\006 \001(\010B\004\342A\001\001B\010\n\006source\"\253\001\n" + + "\024ListInstancesRequest\0228\n\006parent\030\001 \001(\tB(\342" + + "A\001\002\372A!\022\037alloydb.googleapis.com/Instance\022" + + "\027\n\tpage_size\030\002 \001(\005B\004\342A\001\001\022\022\n\npage_token\030\003" + + " \001(\t\022\024\n\006filter\030\004 \001(\tB\004\342A\001\001\022\026\n\010order_by\030\005" + + " \001(\tB\004\342A\001\001\"\200\001\n\025ListInstancesResponse\0229\n\t" + + "instances\030\001 \003(\0132&.google.cloud.alloydb.v" + + "1alpha.Instance\022\027\n\017next_page_token\030\002 \001(\t" + + "\022\023\n\013unreachable\030\003 \003(\t\"\206\001\n\022GetInstanceReq" + + "uest\0226\n\004name\030\001 \001(\tB(\342A\001\002\372A!\n\037alloydb.goo" + + "gleapis.com/Instance\0228\n\004view\030\002 \001(\0162*.goo" + + "gle.cloud.alloydb.v1alpha.InstanceView\"\343" + + "\001\n\025CreateInstanceRequest\0228\n\006parent\030\001 \001(\t" + + "B(\342A\001\002\372A!\022\037alloydb.googleapis.com/Instan" + + "ce\022\031\n\013instance_id\030\002 \001(\tB\004\342A\001\002\022>\n\010instanc" + + "e\030\003 \001(\0132&.google.cloud.alloydb.v1alpha.I" + + "nstanceB\004\342A\001\002\022\030\n\nrequest_id\030\004 \001(\tB\004\342A\001\001\022" + + "\033\n\rvalidate_only\030\005 \001(\010B\004\342A\001\001\"\354\001\n\036CreateS" + + "econdaryInstanceRequest\0228\n\006parent\030\001 \001(\tB" + + "(\342A\001\002\372A!\022\037alloydb.googleapis.com/Instanc" + + "e\022\031\n\013instance_id\030\002 \001(\tB\004\342A\001\002\022>\n\010instance" + + "\030\003 \001(\0132&.google.cloud.alloydb.v1alpha.In" + + "stanceB\004\342A\001\002\022\030\n\nrequest_id\030\004 \001(\tB\004\342A\001\001\022\033" + + "\n\rvalidate_only\030\005 \001(\010B\004\342A\001\001\"u\n\026CreateIns" + + "tanceRequests\022[\n\030create_instance_request" + + "s\030\001 \003(\01323.google.cloud.alloydb.v1alpha.C" + + "reateInstanceRequestB\004\342A\001\002\"\277\001\n\033BatchCrea" + + "teInstancesRequest\0228\n\006parent\030\001 \001(\tB(\342A\001\002" + + "\372A!\022\037alloydb.googleapis.com/Instance\022L\n\010" + + "requests\030\002 \001(\01324.google.cloud.alloydb.v1" + + "alpha.CreateInstanceRequestsB\004\342A\001\002\022\030\n\nre" + + "quest_id\030\003 \001(\tB\004\342A\001\001\"Y\n\034BatchCreateInsta" + + "ncesResponse\0229\n\tinstances\030\001 \003(\0132&.google" + + ".cloud.alloydb.v1alpha.Instance\"\227\002\n\034Batc" + + "hCreateInstancesMetadata\022\030\n\020instance_tar" + + "gets\030\001 \003(\t\022k\n\021instance_statuses\030\002 \003(\0132P." + + "google.cloud.alloydb.v1alpha.BatchCreate" + + "InstancesMetadata.InstanceStatusesEntry\032" + + "p\n\025InstanceStatusesEntry\022\013\n\003key\030\001 \001(\t\022F\n" + + "\005value\030\002 \001(\01327.google.cloud.alloydb.v1al" + + "pha.BatchCreateInstanceStatus:\0028\001\"\332\002\n\031Ba" + + "tchCreateInstanceStatus\022L\n\005state\030\001 \001(\0162=" + + ".google.cloud.alloydb.v1alpha.BatchCreat" + + "eInstanceStatus.State\022\021\n\terror_msg\030\002 \001(\t" + + "\022!\n\005error\030\004 \001(\0132\022.google.rpc.Status\022A\n\004t" + + "ype\030\003 \001(\01623.google.cloud.alloydb.v1alpha" + + ".Instance.InstanceType\"v\n\005State\022\025\n\021STATE" + + "_UNSPECIFIED\020\000\022\022\n\016PENDING_CREATE\020\001\022\t\n\005RE" + + "ADY\020\002\022\014\n\010CREATING\020\003\022\014\n\010DELETING\020\004\022\n\n\006FAI" + + "LED\020\005\022\017\n\013ROLLED_BACK\020\006\"\342\001\n\025UpdateInstanc" + + "eRequest\0225\n\013update_mask\030\001 \001(\0132\032.google.p" + + "rotobuf.FieldMaskB\004\342A\001\001\022>\n\010instance\030\002 \001(" + + "\0132&.google.cloud.alloydb.v1alpha.Instanc" + + "eB\004\342A\001\002\022\030\n\nrequest_id\030\003 \001(\tB\004\342A\001\001\022\033\n\rval" + + "idate_only\030\004 \001(\010B\004\342A\001\001\022\033\n\rallow_missing\030" + + "\005 \001(\010B\004\342A\001\001\"\232\001\n\025DeleteInstanceRequest\0226\n" + + "\004name\030\001 \001(\tB(\342A\001\002\372A!\n\037alloydb.googleapis" + + ".com/Instance\022\030\n\nrequest_id\030\002 \001(\tB\004\342A\001\001\022" + + "\022\n\004etag\030\003 \001(\tB\004\342A\001\001\022\033\n\rvalidate_only\030\004 \001" + + "(\010B\004\342A\001\001\"\210\001\n\027FailoverInstanceRequest\0226\n\004" + + "name\030\001 \001(\tB(\342A\001\002\372A!\n\037alloydb.googleapis." + + "com/Instance\022\030\n\nrequest_id\030\002 \001(\tB\004\342A\001\001\022\033" + + "\n\rvalidate_only\030\003 \001(\010B\004\342A\001\001\"\217\002\n\022InjectFa" + + "ultRequest\022T\n\nfault_type\030\001 \001(\0162:.google." + + "cloud.alloydb.v1alpha.InjectFaultRequest" + + ".FaultTypeB\004\342A\001\002\0226\n\004name\030\002 \001(\tB(\342A\001\002\372A!\n" + + "\037alloydb.googleapis.com/Instance\022\030\n\nrequ" + + "est_id\030\003 \001(\tB\004\342A\001\001\022\033\n\rvalidate_only\030\004 \001(" + + "\010B\004\342A\001\001\"4\n\tFaultType\022\032\n\026FAULT_TYPE_UNSPE" + + "CIFIED\020\000\022\013\n\007STOP_VM\020\001\"\207\001\n\026RestartInstanc" + + "eRequest\0226\n\004name\030\001 \001(\tB(\342A\001\002\372A!\n\037alloydb" + + ".googleapis.com/Instance\022\030\n\nrequest_id\030\002" + + " \001(\tB\004\342A\001\001\022\033\n\rvalidate_only\030\003 \001(\010B\004\342A\001\001\"" + + "\225\001\n\022ListBackupsRequest\0226\n\006parent\030\001 \001(\tB&" + + "\342A\001\002\372A\037\022\035alloydb.googleapis.com/Backup\022\021" + + "\n\tpage_size\030\002 \001(\005\022\022\n\npage_token\030\003 \001(\t\022\016\n" + + "\006filter\030\004 \001(\t\022\020\n\010order_by\030\005 \001(\t\"z\n\023ListB" + + "ackupsResponse\0225\n\007backups\030\001 \003(\0132$.google" + + ".cloud.alloydb.v1alpha.Backup\022\027\n\017next_pa" + + "ge_token\030\002 \001(\t\022\023\n\013unreachable\030\003 \003(\t\"H\n\020G" + + "etBackupRequest\0224\n\004name\030\001 \001(\tB&\342A\001\002\372A\037\n\035" + + "alloydb.googleapis.com/Backup\"\331\001\n\023Create" + + "BackupRequest\0226\n\006parent\030\001 \001(\tB&\342A\001\002\372A\037\022\035" + + "alloydb.googleapis.com/Backup\022\027\n\tbackup_" + + "id\030\002 \001(\tB\004\342A\001\002\022:\n\006backup\030\003 \001(\0132$.google." + + "cloud.alloydb.v1alpha.BackupB\004\342A\001\002\022\030\n\nre" + + "quest_id\030\004 \001(\tB\004\342A\001\001\022\033\n\rvalidate_only\030\005 " + + "\001(\010B\004\342A\001\001\"\334\001\n\023UpdateBackupRequest\0225\n\013upd" + + "ate_mask\030\001 \001(\0132\032.google.protobuf.FieldMa" + + "skB\004\342A\001\001\022:\n\006backup\030\002 \001(\0132$.google.cloud." + + "alloydb.v1alpha.BackupB\004\342A\001\002\022\030\n\nrequest_" + + "id\030\003 \001(\tB\004\342A\001\001\022\033\n\rvalidate_only\030\004 \001(\010B\004\342" + + "A\001\001\022\033\n\rallow_missing\030\005 \001(\010B\004\342A\001\001\"\226\001\n\023Del" + + "eteBackupRequest\0224\n\004name\030\001 \001(\tB&\342A\001\002\372A\037\n" + + "\035alloydb.googleapis.com/Backup\022\030\n\nreques" + + "t_id\030\002 \001(\tB\004\342A\001\001\022\033\n\rvalidate_only\030\003 \001(\010B" + + "\004\342A\001\001\022\022\n\004etag\030\004 \001(\tB\004\342A\001\001\"\221\001\n!ListSuppor" + + "tedDatabaseFlagsRequest\022E\n\006parent\030\001 \001(\tB" + + "5\342A\001\002\372A.\022,alloydb.googleapis.com/Support" + + "edDatabaseFlag\022\021\n\tpage_size\030\002 \001(\005\022\022\n\npag" + + "e_token\030\003 \001(\t\"\224\001\n\"ListSupportedDatabaseF" + + "lagsResponse\022U\n\030supported_database_flags" + + "\030\001 \003(\01323.google.cloud.alloydb.v1alpha.Su" + + "pportedDatabaseFlag\022\027\n\017next_page_token\030\002" + + " \001(\t\"\340\001\n GenerateClientCertificateReques" + + "t\0227\n\006parent\030\001 \001(\tB\'\342A\001\002\372A \n\036alloydb.goog" + + "leapis.com/Cluster\022\030\n\nrequest_id\030\002 \001(\tB\004" + + "\342A\001\001\022\027\n\007pem_csr\030\003 \001(\tB\006\030\001\342A\001\001\0226\n\rcert_du" + + "ration\030\004 \001(\0132\031.google.protobuf.DurationB" + + "\004\342A\001\001\022\030\n\npublic_key\030\005 \001(\tB\004\342A\001\001\"~\n!Gener" + + "ateClientCertificateResponse\022\035\n\017pem_cert" + + "ificate\030\001 \001(\tB\004\342A\001\003\022#\n\025pem_certificate_c" + + "hain\030\002 \003(\tB\004\342A\001\003\022\025\n\007ca_cert\030\003 \001(\tB\004\342A\001\001\"" + + "n\n\030GetConnectionInfoRequest\0228\n\006parent\030\001 " + + "\001(\tB(\342A\001\002\372A!\n\037alloydb.googleapis.com/Ins" + + "tance\022\030\n\nrequest_id\030\002 \001(\tB\004\342A\001\001\"\210\003\n\021Oper" + + "ationMetadata\022k\n\037batch_create_instances_" + + "metadata\030\010 \001(\0132:.google.cloud.alloydb.v1" + + "alpha.BatchCreateInstancesMetadataB\004\342A\001\003" + + "H\000\0225\n\013create_time\030\001 \001(\0132\032.google.protobu" + + "f.TimestampB\004\342A\001\003\0222\n\010end_time\030\002 \001(\0132\032.go" + + "ogle.protobuf.TimestampB\004\342A\001\003\022\024\n\006target\030" + + "\003 \001(\tB\004\342A\001\003\022\022\n\004verb\030\004 \001(\tB\004\342A\001\003\022\034\n\016statu" + + "s_message\030\005 \001(\tB\004\342A\001\003\022$\n\026requested_cance" + + "llation\030\006 \001(\010B\004\342A\001\003\022\031\n\013api_version\030\007 \001(\t" + + "B\004\342A\001\003B\022\n\020request_specific\"\251\001\n\020ListUsers" + + "Request\0224\n\006parent\030\001 \001(\tB$\342A\001\002\372A\035\022\033alloyd" + + "b.googleapis.com/User\022\027\n\tpage_size\030\002 \001(\005" + + "B\004\342A\001\001\022\030\n\npage_token\030\003 \001(\tB\004\342A\001\001\022\024\n\006filt" + + "er\030\004 \001(\tB\004\342A\001\001\022\026\n\010order_by\030\005 \001(\tB\004\342A\001\001\"t" + + "\n\021ListUsersResponse\0221\n\005users\030\001 \003(\0132\".goo" + + "gle.cloud.alloydb.v1alpha.User\022\027\n\017next_p" + + "age_token\030\002 \001(\t\022\023\n\013unreachable\030\003 \003(\t\"D\n\016" + + "GetUserRequest\0222\n\004name\030\001 \001(\tB$\342A\001\002\372A\035\n\033a" + + "lloydb.googleapis.com/User\"\317\001\n\021CreateUse" + + "rRequest\0224\n\006parent\030\001 \001(\tB$\342A\001\002\372A\035\022\033alloy" + + "db.googleapis.com/User\022\025\n\007user_id\030\002 \001(\tB" + + "\004\342A\001\002\0226\n\004user\030\003 \001(\0132\".google.cloud.alloy" + + "db.v1alpha.UserB\004\342A\001\002\022\030\n\nrequest_id\030\004 \001(" + + "\tB\004\342A\001\001\022\033\n\rvalidate_only\030\005 \001(\010B\004\342A\001\001\"\326\001\n" + + "\021UpdateUserRequest\0225\n\013update_mask\030\001 \001(\0132" + + "\032.google.protobuf.FieldMaskB\004\342A\001\001\0226\n\004use" + + "r\030\002 \001(\0132\".google.cloud.alloydb.v1alpha.U" + + "serB\004\342A\001\002\022\030\n\nrequest_id\030\003 \001(\tB\004\342A\001\001\022\033\n\rv" + + "alidate_only\030\004 \001(\010B\004\342A\001\001\022\033\n\rallow_missin" + + "g\030\005 \001(\010B\004\342A\001\001\"~\n\021DeleteUserRequest\0222\n\004na" + + "me\030\001 \001(\tB$\342A\001\002\372A\035\n\033alloydb.googleapis.co" + + "m/User\022\030\n\nrequest_id\030\002 \001(\tB\004\342A\001\001\022\033\n\rvali" + + "date_only\030\003 \001(\010B\004\342A\001\0012\3614\n\014AlloyDBAdmin\022\271" + + "\001\n\014ListClusters\0221.google.cloud.alloydb.v" + + "1alpha.ListClustersRequest\0322.google.clou" + + "d.alloydb.v1alpha.ListClustersResponse\"B" + + "\332A\006parent\202\323\344\223\0023\0221/v1alpha/{parent=projec" + + "ts/*/locations/*}/clusters\022\246\001\n\nGetCluste" + + "r\022/.google.cloud.alloydb.v1alpha.GetClus" + + "terRequest\032%.google.cloud.alloydb.v1alph" + + "a.Cluster\"@\332A\004name\202\323\344\223\0023\0221/v1alpha/{name" + + "=projects/*/locations/*/clusters/*}\022\341\001\n\r" + + "CreateCluster\0222.google.cloud.alloydb.v1a" + + "lpha.CreateClusterRequest\032\035.google.longr" + + "unning.Operation\"}\312A\034\n\007Cluster\022\021Operatio" + "nMetadata\332A\031parent,cluster,cluster_id\202\323\344" - + "\223\002L\"A/v1alpha/{parent=projects/*/locatio" - + "ns/*}/clusters:createsecondary:\007cluster\022" - + "\310\001\n\rListInstances\0222.google.cloud.alloydb" - + ".v1alpha.ListInstancesRequest\0323.google.c" - + "loud.alloydb.v1alpha.ListInstancesRespon" - + "se\"N\332A\006parent\202\323\344\223\002?\022=/v1alpha/{parent=pr" - + "ojects/*/locations/*/clusters/*}/instanc" - + "es\022\265\001\n\013GetInstance\0220.google.cloud.alloyd" - + "b.v1alpha.GetInstanceRequest\032&.google.cl" - + "oud.alloydb.v1alpha.Instance\"L\332A\004name\202\323\344" - + "\223\002?\022=/v1alpha/{name=projects/*/locations" - + "/*/clusters/*/instances/*}\022\364\001\n\016CreateIns" - + "tance\0223.google.cloud.alloydb.v1alpha.Cre" - + "ateInstanceRequest\032\035.google.longrunning." - + "Operation\"\215\001\312A\035\n\010Instance\022\021OperationMeta" - + "data\332A\033parent,instance,instance_id\202\323\344\223\002I" - + "\"=/v1alpha/{parent=projects/*/locations/" - + "*/clusters/*}/instances:\010instance\022\226\002\n\027Cr" - + "eateSecondaryInstance\022<.google.cloud.all" - + "oydb.v1alpha.CreateSecondaryInstanceRequ" - + "est\032\035.google.longrunning.Operation\"\235\001\312A\035" - + "\n\010Instance\022\021OperationMetadata\332A\033parent,i" - + "nstance,instance_id\202\323\344\223\002Y\"M/v1alpha/{par" - + "ent=projects/*/locations/*/clusters/*}/i" - + "nstances:createsecondary:\010instance\022\202\002\n\024B" - + "atchCreateInstances\0229.google.cloud.alloy" - + "db.v1alpha.BatchCreateInstancesRequest\032\035" - + ".google.longrunning.Operation\"\217\001\312A1\n\034Bat" - + "chCreateInstancesResponse\022\021OperationMeta" - + "data\202\323\344\223\002U\"I/v1alpha/{parent=projects/*/" - + "locations/*/clusters/*}/instances:batchC" - + "reate:\010requests\022\366\001\n\016UpdateInstance\0223.goo" - + "gle.cloud.alloydb.v1alpha.UpdateInstance" - + "Request\032\035.google.longrunning.Operation\"\217" - + "\001\312A\035\n\010Instance\022\021OperationMetadata\332A\024inst" - + "ance,update_mask\202\323\344\223\002R2F/v1alpha/{instan" - + "ce.name=projects/*/locations/*/clusters/" - + "*/instances/*}:\010instance\022\337\001\n\016DeleteInsta" - + "nce\0223.google.cloud.alloydb.v1alpha.Delet" - + "eInstanceRequest\032\035.google.longrunning.Op" - + "eration\"y\312A*\n\025google.protobuf.Empty\022\021Ope" - + "rationMetadata\332A\004name\202\323\344\223\002?*=/v1alpha/{n" + + "\223\002<\"1/v1alpha/{parent=projects/*/locatio" + + "ns/*}/clusters:\007cluster\022\343\001\n\rUpdateCluste" + + "r\0222.google.cloud.alloydb.v1alpha.UpdateC" + + "lusterRequest\032\035.google.longrunning.Opera" + + "tion\"\177\312A\034\n\007Cluster\022\021OperationMetadata\332A\023" + + "cluster,update_mask\202\323\344\223\002D29/v1alpha/{clu" + + "ster.name=projects/*/locations/*/cluster" + + "s/*}:\007cluster\022\321\001\n\rDeleteCluster\0222.google" + + ".cloud.alloydb.v1alpha.DeleteClusterRequ" + + "est\032\035.google.longrunning.Operation\"m\312A*\n" + + "\025google.protobuf.Empty\022\021OperationMetadat" + + "a\332A\004name\202\323\344\223\0023*1/v1alpha/{name=projects/" + + "*/locations/*/clusters/*}\022\320\001\n\016PromoteClu" + + "ster\0223.google.cloud.alloydb.v1alpha.Prom" + + "oteClusterRequest\032\035.google.longrunning.O" + + "peration\"j\312A\034\n\007Cluster\022\021OperationMetadat" + + "a\332A\004name\202\323\344\223\002>\"9/v1alpha/{name=projects/" + + "*/locations/*/clusters/*}:promote:\001*\022\311\001\n" + + "\016RestoreCluster\0223.google.cloud.alloydb.v" + + "1alpha.RestoreClusterRequest\032\035.google.lo" + + "ngrunning.Operation\"c\312A\034\n\007Cluster\022\021Opera" + + "tionMetadata\202\323\344\223\002>\"9/v1alpha/{parent=pro" + + "jects/*/locations/*}/clusters:restore:\001*" + + "\022\204\002\n\026CreateSecondaryCluster\022;.google.clo" + + "ud.alloydb.v1alpha.CreateSecondaryCluste" + + "rRequest\032\035.google.longrunning.Operation\"" + + "\215\001\312A\034\n\007Cluster\022\021OperationMetadata\332A\031pare" + + "nt,cluster,cluster_id\202\323\344\223\002L\"A/v1alpha/{p" + + "arent=projects/*/locations/*}/clusters:c" + + "reatesecondary:\007cluster\022\310\001\n\rListInstance" + + "s\0222.google.cloud.alloydb.v1alpha.ListIns" + + "tancesRequest\0323.google.cloud.alloydb.v1a" + + "lpha.ListInstancesResponse\"N\332A\006parent\202\323\344" + + "\223\002?\022=/v1alpha/{parent=projects/*/locatio" + + "ns/*/clusters/*}/instances\022\265\001\n\013GetInstan" + + "ce\0220.google.cloud.alloydb.v1alpha.GetIns" + + "tanceRequest\032&.google.cloud.alloydb.v1al" + + "pha.Instance\"L\332A\004name\202\323\344\223\002?\022=/v1alpha/{n" + "ame=projects/*/locations/*/clusters/*/in" - + "stances/*}\022\342\001\n\020FailoverInstance\0225.google" - + ".cloud.alloydb.v1alpha.FailoverInstanceR" - + "equest\032\035.google.longrunning.Operation\"x\312" - + "A\035\n\010Instance\022\021OperationMetadata\332A\004name\202\323" - + "\344\223\002K\"F/v1alpha/{name=projects/*/location" - + "s/*/clusters/*/instances/*}:failover:\001*\022" - + "\337\001\n\017RestartInstance\0224.google.cloud.alloy" - + "db.v1alpha.RestartInstanceRequest\032\035.goog" - + "le.longrunning.Operation\"w\312A\035\n\010Instance\022" - + "\021OperationMetadata\332A\004name\202\323\344\223\002J\"E/v1alph" - + "a/{name=projects/*/locations/*/clusters/" - + "*/instances/*}:restart:\001*\022\265\001\n\013ListBackup" - + "s\0220.google.cloud.alloydb.v1alpha.ListBac" - + "kupsRequest\0321.google.cloud.alloydb.v1alp" - + "ha.ListBackupsResponse\"A\332A\006parent\202\323\344\223\0022\022" - + "0/v1alpha/{parent=projects/*/locations/*" - + "}/backups\022\242\001\n\tGetBackup\022..google.cloud.a" - + "lloydb.v1alpha.GetBackupRequest\032$.google" - + ".cloud.alloydb.v1alpha.Backup\"?\332A\004name\202\323" - + "\344\223\0022\0220/v1alpha/{name=projects/*/location" - + "s/*/backups/*}\022\332\001\n\014CreateBackup\0221.google" - + ".cloud.alloydb.v1alpha.CreateBackupReque" - + "st\032\035.google.longrunning.Operation\"x\312A\033\n\006" - + "Backup\022\021OperationMetadata\332A\027parent,backu" - + "p,backup_id\202\323\344\223\002:\"0/v1alpha/{parent=proj" - + "ects/*/locations/*}/backups:\006backup\022\334\001\n\014" - + "UpdateBackup\0221.google.cloud.alloydb.v1al" - + "pha.UpdateBackupRequest\032\035.google.longrun" - + "ning.Operation\"z\312A\033\n\006Backup\022\021OperationMe" - + "tadata\332A\022backup,update_mask\202\323\344\223\002A27/v1al" - + "pha/{backup.name=projects/*/locations/*/" - + "backups/*}:\006backup\022\316\001\n\014DeleteBackup\0221.go" - + "ogle.cloud.alloydb.v1alpha.DeleteBackupR" - + "equest\032\035.google.longrunning.Operation\"l\312" - + "A*\n\025google.protobuf.Empty\022\021OperationMeta" - + "data\332A\004name\202\323\344\223\0022*0/v1alpha/{name=projec" - + "ts/*/locations/*/backups/*}\022\361\001\n\032ListSupp" - + "ortedDatabaseFlags\022?.google.cloud.alloyd" - + "b.v1alpha.ListSupportedDatabaseFlagsRequ" - + "est\032@.google.cloud.alloydb.v1alpha.ListS" - + "upportedDatabaseFlagsResponse\"P\332A\006parent" - + "\202\323\344\223\002A\022?/v1alpha/{parent=projects/*/loca" - + "tions/*}/supportedDatabaseFlags\022\377\001\n\031Gene" - + "rateClientCertificate\022>.google.cloud.all" - + "oydb.v1alpha.GenerateClientCertificateRe" - + "quest\032?.google.cloud.alloydb.v1alpha.Gen" - + "erateClientCertificateResponse\"a\332A\006paren" - + "t\202\323\344\223\002R\"M/v1alpha/{parent=projects/*/loc" - + "ations/*/clusters/*}:generateClientCerti" - + "ficate:\001*\022\332\001\n\021GetConnectionInfo\0226.google" - + ".cloud.alloydb.v1alpha.GetConnectionInfo" - + "Request\032,.google.cloud.alloydb.v1alpha.C" - + "onnectionInfo\"_\332A\006parent\202\323\344\223\002P\022N/v1alpha" - + "/{parent=projects/*/locations/*/clusters" - + "/*/instances/*}/connectionInfo\032J\312A\026alloy" - + "db.googleapis.com\322A.https://www.googleap" - + "is.com/auth/cloud-platformB\316\001\n com.googl" - + "e.cloud.alloydb.v1alphaB\014ServiceProtoP\001Z" - + ":cloud.google.com/go/alloydb/apiv1alpha/" - + "alloydbpb;alloydbpb\252\002\034Google.Cloud.Alloy" - + "Db.V1Alpha\312\002\034Google\\Cloud\\AlloyDb\\V1alph" - + "a\352\002\037Google::Cloud::AlloyDB::V1alphab\006pro" - + "to3" + + "stances/*}\022\364\001\n\016CreateInstance\0223.google.c" + + "loud.alloydb.v1alpha.CreateInstanceReque" + + "st\032\035.google.longrunning.Operation\"\215\001\312A\035\n" + + "\010Instance\022\021OperationMetadata\332A\033parent,in" + + "stance,instance_id\202\323\344\223\002I\"=/v1alpha/{pare" + + "nt=projects/*/locations/*/clusters/*}/in" + + "stances:\010instance\022\226\002\n\027CreateSecondaryIns" + + "tance\022<.google.cloud.alloydb.v1alpha.Cre" + + "ateSecondaryInstanceRequest\032\035.google.lon" + + "grunning.Operation\"\235\001\312A\035\n\010Instance\022\021Oper" + + "ationMetadata\332A\033parent,instance,instance" + + "_id\202\323\344\223\002Y\"M/v1alpha/{parent=projects/*/l" + + "ocations/*/clusters/*}/instances:creates" + + "econdary:\010instance\022\202\002\n\024BatchCreateInstan" + + "ces\0229.google.cloud.alloydb.v1alpha.Batch" + + "CreateInstancesRequest\032\035.google.longrunn" + + "ing.Operation\"\217\001\312A1\n\034BatchCreateInstance" + + "sResponse\022\021OperationMetadata\202\323\344\223\002U\"I/v1a" + + "lpha/{parent=projects/*/locations/*/clus" + + "ters/*}/instances:batchCreate:\010requests\022" + + "\366\001\n\016UpdateInstance\0223.google.cloud.alloyd" + + "b.v1alpha.UpdateInstanceRequest\032\035.google" + + ".longrunning.Operation\"\217\001\312A\035\n\010Instance\022\021" + + "OperationMetadata\332A\024instance,update_mask" + + "\202\323\344\223\002R2F/v1alpha/{instance.name=projects" + + "/*/locations/*/clusters/*/instances/*}:\010" + + "instance\022\337\001\n\016DeleteInstance\0223.google.clo" + + "ud.alloydb.v1alpha.DeleteInstanceRequest" + + "\032\035.google.longrunning.Operation\"y\312A*\n\025go" + + "ogle.protobuf.Empty\022\021OperationMetadata\332A" + + "\004name\202\323\344\223\002?*=/v1alpha/{name=projects/*/l" + + "ocations/*/clusters/*/instances/*}\022\342\001\n\020F" + + "ailoverInstance\0225.google.cloud.alloydb.v" + + "1alpha.FailoverInstanceRequest\032\035.google." + + "longrunning.Operation\"x\312A\035\n\010Instance\022\021Op" + + "erationMetadata\332A\004name\202\323\344\223\002K\"F/v1alpha/{" + + "name=projects/*/locations/*/clusters/*/i" + + "nstances/*}:failover:\001*\022\347\001\n\013InjectFault\022" + + "0.google.cloud.alloydb.v1alpha.InjectFau" + + "ltRequest\032\035.google.longrunning.Operation" + + "\"\206\001\312A\035\n\010Instance\022\021OperationMetadata\332A\017fa" + + "ult_type,name\202\323\344\223\002N\"I/v1alpha/{name=proj" + + "ects/*/locations/*/clusters/*/instances/" + + "*}:injectFault:\001*\022\337\001\n\017RestartInstance\0224." + + "google.cloud.alloydb.v1alpha.RestartInst" + + "anceRequest\032\035.google.longrunning.Operati" + + "on\"w\312A\035\n\010Instance\022\021OperationMetadata\332A\004n" + + "ame\202\323\344\223\002J\"E/v1alpha/{name=projects/*/loc" + + "ations/*/clusters/*/instances/*}:restart" + + ":\001*\022\265\001\n\013ListBackups\0220.google.cloud.alloy" + + "db.v1alpha.ListBackupsRequest\0321.google.c" + + "loud.alloydb.v1alpha.ListBackupsResponse" + + "\"A\332A\006parent\202\323\344\223\0022\0220/v1alpha/{parent=proj" + + "ects/*/locations/*}/backups\022\242\001\n\tGetBacku" + + "p\022..google.cloud.alloydb.v1alpha.GetBack" + + "upRequest\032$.google.cloud.alloydb.v1alpha" + + ".Backup\"?\332A\004name\202\323\344\223\0022\0220/v1alpha/{name=p" + + "rojects/*/locations/*/backups/*}\022\332\001\n\014Cre" + + "ateBackup\0221.google.cloud.alloydb.v1alpha" + + ".CreateBackupRequest\032\035.google.longrunnin" + + "g.Operation\"x\312A\033\n\006Backup\022\021OperationMetad" + + "ata\332A\027parent,backup,backup_id\202\323\344\223\002:\"0/v1" + + "alpha/{parent=projects/*/locations/*}/ba" + + "ckups:\006backup\022\334\001\n\014UpdateBackup\0221.google." + + "cloud.alloydb.v1alpha.UpdateBackupReques" + + "t\032\035.google.longrunning.Operation\"z\312A\033\n\006B" + + "ackup\022\021OperationMetadata\332A\022backup,update" + + "_mask\202\323\344\223\002A27/v1alpha/{backup.name=proje" + + "cts/*/locations/*/backups/*}:\006backup\022\316\001\n" + + "\014DeleteBackup\0221.google.cloud.alloydb.v1a" + + "lpha.DeleteBackupRequest\032\035.google.longru" + + "nning.Operation\"l\312A*\n\025google.protobuf.Em" + + "pty\022\021OperationMetadata\332A\004name\202\323\344\223\0022*0/v1" + + "alpha/{name=projects/*/locations/*/backu" + + "ps/*}\022\361\001\n\032ListSupportedDatabaseFlags\022?.g" + + "oogle.cloud.alloydb.v1alpha.ListSupporte" + + "dDatabaseFlagsRequest\032@.google.cloud.all" + + "oydb.v1alpha.ListSupportedDatabaseFlagsR" + + "esponse\"P\332A\006parent\202\323\344\223\002A\022?/v1alpha/{pare" + + "nt=projects/*/locations/*}/supportedData" + + "baseFlags\022\377\001\n\031GenerateClientCertificate\022" + + ">.google.cloud.alloydb.v1alpha.GenerateC" + + "lientCertificateRequest\032?.google.cloud.a" + + "lloydb.v1alpha.GenerateClientCertificate" + + "Response\"a\332A\006parent\202\323\344\223\002R\"M/v1alpha/{par" + + "ent=projects/*/locations/*/clusters/*}:g" + + "enerateClientCertificate:\001*\022\332\001\n\021GetConne" + + "ctionInfo\0226.google.cloud.alloydb.v1alpha" + + ".GetConnectionInfoRequest\032,.google.cloud" + + ".alloydb.v1alpha.ConnectionInfo\"_\332A\006pare" + + "nt\202\323\344\223\002P\022N/v1alpha/{parent=projects/*/lo" + + "cations/*/clusters/*/instances/*}/connec" + + "tionInfo\022\270\001\n\tListUsers\022..google.cloud.al" + + "loydb.v1alpha.ListUsersRequest\032/.google." + + "cloud.alloydb.v1alpha.ListUsersResponse\"" + + "J\332A\006parent\202\323\344\223\002;\0229/v1alpha/{parent=proje" + + "cts/*/locations/*/clusters/*}/users\022\245\001\n\007" + + "GetUser\022,.google.cloud.alloydb.v1alpha.G" + + "etUserRequest\032\".google.cloud.alloydb.v1a" + + "lpha.User\"H\332A\004name\202\323\344\223\002;\0229/v1alpha/{name" + + "=projects/*/locations/*/clusters/*/users" + + "/*}\022\300\001\n\nCreateUser\022/.google.cloud.alloyd" + + "b.v1alpha.CreateUserRequest\032\".google.clo" + + "ud.alloydb.v1alpha.User\"]\332A\023parent,user," + + "user_id\202\323\344\223\002A\"9/v1alpha/{parent=projects" + + "/*/locations/*/clusters/*}/users:\004user\022\302" + + "\001\n\nUpdateUser\022/.google.cloud.alloydb.v1a" + + "lpha.UpdateUserRequest\032\".google.cloud.al" + + "loydb.v1alpha.User\"_\332A\020user,update_mask\202" + + "\323\344\223\002F2>/v1alpha/{user.name=projects/*/lo" + + "cations/*/clusters/*/users/*}:\004user\022\237\001\n\n" + + "DeleteUser\022/.google.cloud.alloydb.v1alph" + + "a.DeleteUserRequest\032\026.google.protobuf.Em" + + "pty\"H\332A\004name\202\323\344\223\002;*9/v1alpha/{name=proje" + + "cts/*/locations/*/clusters/*/users/*}\032J\312" + + "A\026alloydb.googleapis.com\322A.https://www.g" + + "oogleapis.com/auth/cloud-platformB\316\001\n co" + + "m.google.cloud.alloydb.v1alphaB\014ServiceP" + + "rotoP\001Z:cloud.google.com/go/alloydb/apiv" + + "1alpha/alloydbpb;alloydbpb\252\002\034Google.Clou" + + "d.AlloyDb.V1Alpha\312\002\034Google\\Cloud\\AlloyDb" + + "\\V1alpha\352\002\037Google::Cloud::AlloyDB::V1alp" + + "hab\006proto3" }; descriptor = com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( @@ -538,7 +627,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_alloydb_v1alpha_GetClusterRequest_descriptor, new java.lang.String[] { - "Name", + "Name", "View", }); internal_static_google_cloud_alloydb_v1alpha_CreateSecondaryClusterRequest_descriptor = getDescriptor().getMessageTypes().get(3); @@ -709,8 +798,16 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { new java.lang.String[] { "Name", "RequestId", "ValidateOnly", }); - internal_static_google_cloud_alloydb_v1alpha_RestartInstanceRequest_descriptor = + internal_static_google_cloud_alloydb_v1alpha_InjectFaultRequest_descriptor = getDescriptor().getMessageTypes().get(22); + internal_static_google_cloud_alloydb_v1alpha_InjectFaultRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_alloydb_v1alpha_InjectFaultRequest_descriptor, + new java.lang.String[] { + "FaultType", "Name", "RequestId", "ValidateOnly", + }); + internal_static_google_cloud_alloydb_v1alpha_RestartInstanceRequest_descriptor = + getDescriptor().getMessageTypes().get(23); internal_static_google_cloud_alloydb_v1alpha_RestartInstanceRequest_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_alloydb_v1alpha_RestartInstanceRequest_descriptor, @@ -718,7 +815,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "Name", "RequestId", "ValidateOnly", }); internal_static_google_cloud_alloydb_v1alpha_ListBackupsRequest_descriptor = - getDescriptor().getMessageTypes().get(23); + getDescriptor().getMessageTypes().get(24); internal_static_google_cloud_alloydb_v1alpha_ListBackupsRequest_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_alloydb_v1alpha_ListBackupsRequest_descriptor, @@ -726,7 +823,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "Parent", "PageSize", "PageToken", "Filter", "OrderBy", }); internal_static_google_cloud_alloydb_v1alpha_ListBackupsResponse_descriptor = - getDescriptor().getMessageTypes().get(24); + getDescriptor().getMessageTypes().get(25); internal_static_google_cloud_alloydb_v1alpha_ListBackupsResponse_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_alloydb_v1alpha_ListBackupsResponse_descriptor, @@ -734,7 +831,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "Backups", "NextPageToken", "Unreachable", }); internal_static_google_cloud_alloydb_v1alpha_GetBackupRequest_descriptor = - getDescriptor().getMessageTypes().get(25); + getDescriptor().getMessageTypes().get(26); internal_static_google_cloud_alloydb_v1alpha_GetBackupRequest_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_alloydb_v1alpha_GetBackupRequest_descriptor, @@ -742,7 +839,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "Name", }); internal_static_google_cloud_alloydb_v1alpha_CreateBackupRequest_descriptor = - getDescriptor().getMessageTypes().get(26); + getDescriptor().getMessageTypes().get(27); internal_static_google_cloud_alloydb_v1alpha_CreateBackupRequest_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_alloydb_v1alpha_CreateBackupRequest_descriptor, @@ -750,7 +847,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "Parent", "BackupId", "Backup", "RequestId", "ValidateOnly", }); internal_static_google_cloud_alloydb_v1alpha_UpdateBackupRequest_descriptor = - getDescriptor().getMessageTypes().get(27); + getDescriptor().getMessageTypes().get(28); internal_static_google_cloud_alloydb_v1alpha_UpdateBackupRequest_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_alloydb_v1alpha_UpdateBackupRequest_descriptor, @@ -758,7 +855,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "UpdateMask", "Backup", "RequestId", "ValidateOnly", "AllowMissing", }); internal_static_google_cloud_alloydb_v1alpha_DeleteBackupRequest_descriptor = - getDescriptor().getMessageTypes().get(28); + getDescriptor().getMessageTypes().get(29); internal_static_google_cloud_alloydb_v1alpha_DeleteBackupRequest_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_alloydb_v1alpha_DeleteBackupRequest_descriptor, @@ -766,7 +863,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "Name", "RequestId", "ValidateOnly", "Etag", }); internal_static_google_cloud_alloydb_v1alpha_ListSupportedDatabaseFlagsRequest_descriptor = - getDescriptor().getMessageTypes().get(29); + getDescriptor().getMessageTypes().get(30); internal_static_google_cloud_alloydb_v1alpha_ListSupportedDatabaseFlagsRequest_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_alloydb_v1alpha_ListSupportedDatabaseFlagsRequest_descriptor, @@ -774,7 +871,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "Parent", "PageSize", "PageToken", }); internal_static_google_cloud_alloydb_v1alpha_ListSupportedDatabaseFlagsResponse_descriptor = - getDescriptor().getMessageTypes().get(30); + getDescriptor().getMessageTypes().get(31); internal_static_google_cloud_alloydb_v1alpha_ListSupportedDatabaseFlagsResponse_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_alloydb_v1alpha_ListSupportedDatabaseFlagsResponse_descriptor, @@ -782,23 +879,23 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "SupportedDatabaseFlags", "NextPageToken", }); internal_static_google_cloud_alloydb_v1alpha_GenerateClientCertificateRequest_descriptor = - getDescriptor().getMessageTypes().get(31); + getDescriptor().getMessageTypes().get(32); internal_static_google_cloud_alloydb_v1alpha_GenerateClientCertificateRequest_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_alloydb_v1alpha_GenerateClientCertificateRequest_descriptor, new java.lang.String[] { - "Parent", "RequestId", "PemCsr", "CertDuration", + "Parent", "RequestId", "PemCsr", "CertDuration", "PublicKey", }); internal_static_google_cloud_alloydb_v1alpha_GenerateClientCertificateResponse_descriptor = - getDescriptor().getMessageTypes().get(32); + getDescriptor().getMessageTypes().get(33); internal_static_google_cloud_alloydb_v1alpha_GenerateClientCertificateResponse_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_alloydb_v1alpha_GenerateClientCertificateResponse_descriptor, new java.lang.String[] { - "PemCertificate", "PemCertificateChain", + "PemCertificate", "PemCertificateChain", "CaCert", }); internal_static_google_cloud_alloydb_v1alpha_GetConnectionInfoRequest_descriptor = - getDescriptor().getMessageTypes().get(33); + getDescriptor().getMessageTypes().get(34); internal_static_google_cloud_alloydb_v1alpha_GetConnectionInfoRequest_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_alloydb_v1alpha_GetConnectionInfoRequest_descriptor, @@ -806,7 +903,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "Parent", "RequestId", }); internal_static_google_cloud_alloydb_v1alpha_OperationMetadata_descriptor = - getDescriptor().getMessageTypes().get(34); + getDescriptor().getMessageTypes().get(35); internal_static_google_cloud_alloydb_v1alpha_OperationMetadata_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_alloydb_v1alpha_OperationMetadata_descriptor, @@ -821,6 +918,54 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "ApiVersion", "RequestSpecific", }); + internal_static_google_cloud_alloydb_v1alpha_ListUsersRequest_descriptor = + getDescriptor().getMessageTypes().get(36); + internal_static_google_cloud_alloydb_v1alpha_ListUsersRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_alloydb_v1alpha_ListUsersRequest_descriptor, + new java.lang.String[] { + "Parent", "PageSize", "PageToken", "Filter", "OrderBy", + }); + internal_static_google_cloud_alloydb_v1alpha_ListUsersResponse_descriptor = + getDescriptor().getMessageTypes().get(37); + internal_static_google_cloud_alloydb_v1alpha_ListUsersResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_alloydb_v1alpha_ListUsersResponse_descriptor, + new java.lang.String[] { + "Users", "NextPageToken", "Unreachable", + }); + internal_static_google_cloud_alloydb_v1alpha_GetUserRequest_descriptor = + getDescriptor().getMessageTypes().get(38); + internal_static_google_cloud_alloydb_v1alpha_GetUserRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_alloydb_v1alpha_GetUserRequest_descriptor, + new java.lang.String[] { + "Name", + }); + internal_static_google_cloud_alloydb_v1alpha_CreateUserRequest_descriptor = + getDescriptor().getMessageTypes().get(39); + internal_static_google_cloud_alloydb_v1alpha_CreateUserRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_alloydb_v1alpha_CreateUserRequest_descriptor, + new java.lang.String[] { + "Parent", "UserId", "User", "RequestId", "ValidateOnly", + }); + internal_static_google_cloud_alloydb_v1alpha_UpdateUserRequest_descriptor = + getDescriptor().getMessageTypes().get(40); + internal_static_google_cloud_alloydb_v1alpha_UpdateUserRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_alloydb_v1alpha_UpdateUserRequest_descriptor, + new java.lang.String[] { + "UpdateMask", "User", "RequestId", "ValidateOnly", "AllowMissing", + }); + internal_static_google_cloud_alloydb_v1alpha_DeleteUserRequest_descriptor = + getDescriptor().getMessageTypes().get(41); + internal_static_google_cloud_alloydb_v1alpha_DeleteUserRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_alloydb_v1alpha_DeleteUserRequest_descriptor, + new java.lang.String[] { + "Name", "RequestId", "ValidateOnly", + }); com.google.protobuf.ExtensionRegistry registry = com.google.protobuf.ExtensionRegistry.newInstance(); registry.add(com.google.api.ClientProto.defaultHost); diff --git a/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/SslConfig.java b/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/SslConfig.java index eb11b34e5307..397b72fb9998 100644 --- a/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/SslConfig.java +++ b/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/SslConfig.java @@ -22,7 +22,7 @@ * * *
- * SSL configuration for an AlloyDB Cluster.
+ * SSL configuration.
  * 
* * Protobuf type {@code google.cloud.alloydb.v1alpha.SslConfig} @@ -77,7 +77,7 @@ public enum SslMode implements com.google.protobuf.ProtocolMessageEnum { * * *
-     * SSL mode not specified. Defaults to SSL_MODE_ALLOW.
+     * SSL mode not specified. Defaults to ENCRYPTED_ONLY.
      * 
* * SSL_MODE_UNSPECIFIED = 0; @@ -90,8 +90,9 @@ public enum SslMode implements com.google.protobuf.ProtocolMessageEnum { * SSL connections are optional. CA verification not enforced. * * - * SSL_MODE_ALLOW = 1; + * SSL_MODE_ALLOW = 1 [deprecated = true]; */ + @java.lang.Deprecated SSL_MODE_ALLOW(1), /** * @@ -102,8 +103,9 @@ public enum SslMode implements com.google.protobuf.ProtocolMessageEnum { * behavior). * * - * SSL_MODE_REQUIRE = 2; + * SSL_MODE_REQUIRE = 2 [deprecated = true]; */ + @java.lang.Deprecated SSL_MODE_REQUIRE(2), /** * @@ -114,9 +116,30 @@ public enum SslMode implements com.google.protobuf.ProtocolMessageEnum { * GenerateClientCertificate. * * - * SSL_MODE_VERIFY_CA = 3; + * SSL_MODE_VERIFY_CA = 3 [deprecated = true]; */ + @java.lang.Deprecated SSL_MODE_VERIFY_CA(3), + /** + * + * + *
+     * SSL connections are optional. CA verification not enforced.
+     * 
+ * + * ALLOW_UNENCRYPTED_AND_ENCRYPTED = 4; + */ + ALLOW_UNENCRYPTED_AND_ENCRYPTED(4), + /** + * + * + *
+     * SSL connections are required. CA verification not enforced.
+     * 
+ * + * ENCRYPTED_ONLY = 5; + */ + ENCRYPTED_ONLY(5), UNRECOGNIZED(-1), ; @@ -124,7 +147,7 @@ public enum SslMode implements com.google.protobuf.ProtocolMessageEnum { * * *
-     * SSL mode not specified. Defaults to SSL_MODE_ALLOW.
+     * SSL mode not specified. Defaults to ENCRYPTED_ONLY.
      * 
* * SSL_MODE_UNSPECIFIED = 0; @@ -137,9 +160,9 @@ public enum SslMode implements com.google.protobuf.ProtocolMessageEnum { * SSL connections are optional. CA verification not enforced. * * - * SSL_MODE_ALLOW = 1; + * SSL_MODE_ALLOW = 1 [deprecated = true]; */ - public static final int SSL_MODE_ALLOW_VALUE = 1; + @java.lang.Deprecated public static final int SSL_MODE_ALLOW_VALUE = 1; /** * * @@ -149,9 +172,9 @@ public enum SslMode implements com.google.protobuf.ProtocolMessageEnum { * behavior). * * - * SSL_MODE_REQUIRE = 2; + * SSL_MODE_REQUIRE = 2 [deprecated = true]; */ - public static final int SSL_MODE_REQUIRE_VALUE = 2; + @java.lang.Deprecated public static final int SSL_MODE_REQUIRE_VALUE = 2; /** * * @@ -161,9 +184,29 @@ public enum SslMode implements com.google.protobuf.ProtocolMessageEnum { * GenerateClientCertificate. * * - * SSL_MODE_VERIFY_CA = 3; + * SSL_MODE_VERIFY_CA = 3 [deprecated = true]; + */ + @java.lang.Deprecated public static final int SSL_MODE_VERIFY_CA_VALUE = 3; + /** + * + * + *
+     * SSL connections are optional. CA verification not enforced.
+     * 
+ * + * ALLOW_UNENCRYPTED_AND_ENCRYPTED = 4; + */ + public static final int ALLOW_UNENCRYPTED_AND_ENCRYPTED_VALUE = 4; + /** + * + * + *
+     * SSL connections are required. CA verification not enforced.
+     * 
+ * + * ENCRYPTED_ONLY = 5; */ - public static final int SSL_MODE_VERIFY_CA_VALUE = 3; + public static final int ENCRYPTED_ONLY_VALUE = 5; public final int getNumber() { if (this == UNRECOGNIZED) { @@ -197,6 +240,10 @@ public static SslMode forNumber(int value) { return SSL_MODE_REQUIRE; case 3: return SSL_MODE_VERIFY_CA; + case 4: + return ALLOW_UNENCRYPTED_AND_ENCRYPTED; + case 5: + return ENCRYPTED_ONLY; default: return null; } @@ -647,7 +694,7 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build * * *
-   * SSL configuration for an AlloyDB Cluster.
+   * SSL configuration.
    * 
* * Protobuf type {@code google.cloud.alloydb.v1alpha.SslConfig} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/UpdateUserRequest.java b/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/UpdateUserRequest.java new file mode 100644 index 000000000000..740d1e60d4bc --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/UpdateUserRequest.java @@ -0,0 +1,1486 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/alloydb/v1alpha/service.proto + +package com.google.cloud.alloydb.v1alpha; + +/** + * + * + *
+ * Message for updating a User
+ * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1alpha.UpdateUserRequest} + */ +public final class UpdateUserRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.alloydb.v1alpha.UpdateUserRequest) + UpdateUserRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use UpdateUserRequest.newBuilder() to construct. + private UpdateUserRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private UpdateUserRequest() { + requestId_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new UpdateUserRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.alloydb.v1alpha.ServiceProto + .internal_static_google_cloud_alloydb_v1alpha_UpdateUserRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1alpha.ServiceProto + .internal_static_google_cloud_alloydb_v1alpha_UpdateUserRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1alpha.UpdateUserRequest.class, + com.google.cloud.alloydb.v1alpha.UpdateUserRequest.Builder.class); + } + + public static final int UPDATE_MASK_FIELD_NUMBER = 1; + private com.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.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the updateMask field is set. + */ + @java.lang.Override + public boolean hasUpdateMask() { + return updateMask_ != null; + } + /** + * + * + *
+   * 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.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The updateMask. + */ + @java.lang.Override + public com.google.protobuf.FieldMask getUpdateMask() { + return updateMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : 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.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { + return updateMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : updateMask_; + } + + public static final int USER_FIELD_NUMBER = 2; + private com.google.cloud.alloydb.v1alpha.User user_; + /** + * + * + *
+   * Required. The resource being updated
+   * 
+ * + * .google.cloud.alloydb.v1alpha.User user = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the user field is set. + */ + @java.lang.Override + public boolean hasUser() { + return user_ != null; + } + /** + * + * + *
+   * Required. The resource being updated
+   * 
+ * + * .google.cloud.alloydb.v1alpha.User user = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The user. + */ + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.User getUser() { + return user_ == null ? com.google.cloud.alloydb.v1alpha.User.getDefaultInstance() : user_; + } + /** + * + * + *
+   * Required. The resource being updated
+   * 
+ * + * .google.cloud.alloydb.v1alpha.User user = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.UserOrBuilder getUserOrBuilder() { + return user_ == null ? com.google.cloud.alloydb.v1alpha.User.getDefaultInstance() : user_; + } + + public static final int REQUEST_ID_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object 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).
+   * 
+ * + * string request_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The requestId. + */ + @java.lang.Override + public java.lang.String getRequestId() { + java.lang.Object ref = requestId_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + requestId_ = s; + return s; + } + } + /** + * + * + *
+   * Optional. An optional request ID to identify requests. Specify a unique
+   * request ID so that if you must retry your request, the server will know to
+   * ignore the request if it has already been completed. The server will
+   * guarantee that for at least 60 minutes since the first request.
+   *
+   * For example, consider a situation where you make an initial request and
+   * the request times out. If you make the request again with the same request
+   * ID, the server can check if original operation with the same request ID
+   * was received, and if so, will ignore the second request. This prevents
+   * clients from accidentally creating duplicate commitments.
+   *
+   * The request ID must be a valid UUID with the exception that zero UUID is
+   * not supported (00000000-0000-0000-0000-000000000000).
+   * 
+ * + * string request_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for requestId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getRequestIdBytes() { + java.lang.Object ref = requestId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + requestId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int VALIDATE_ONLY_FIELD_NUMBER = 4; + private boolean validateOnly_ = false; + /** + * + * + *
+   * Optional. If set, the backend validates the request, but doesn't actually
+   * execute it.
+   * 
+ * + * bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The validateOnly. + */ + @java.lang.Override + public boolean getValidateOnly() { + return validateOnly_; + } + + public static final int ALLOW_MISSING_FIELD_NUMBER = 5; + private boolean allowMissing_ = false; + /** + * + * + *
+   * Optional. Allow missing fields in the update mask.
+   * 
+ * + * bool allow_missing = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The allowMissing. + */ + @java.lang.Override + public boolean getAllowMissing() { + return allowMissing_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (updateMask_ != null) { + output.writeMessage(1, getUpdateMask()); + } + if (user_ != null) { + output.writeMessage(2, getUser()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(requestId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, requestId_); + } + if (validateOnly_ != false) { + output.writeBool(4, validateOnly_); + } + if (allowMissing_ != false) { + output.writeBool(5, allowMissing_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (updateMask_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getUpdateMask()); + } + if (user_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getUser()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(requestId_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, requestId_); + } + if (validateOnly_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(4, validateOnly_); + } + if (allowMissing_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(5, allowMissing_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.alloydb.v1alpha.UpdateUserRequest)) { + return super.equals(obj); + } + com.google.cloud.alloydb.v1alpha.UpdateUserRequest other = + (com.google.cloud.alloydb.v1alpha.UpdateUserRequest) obj; + + if (hasUpdateMask() != other.hasUpdateMask()) return false; + if (hasUpdateMask()) { + if (!getUpdateMask().equals(other.getUpdateMask())) return false; + } + if (hasUser() != other.hasUser()) return false; + if (hasUser()) { + if (!getUser().equals(other.getUser())) return false; + } + if (!getRequestId().equals(other.getRequestId())) return false; + if (getValidateOnly() != other.getValidateOnly()) return false; + if (getAllowMissing() != other.getAllowMissing()) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasUpdateMask()) { + hash = (37 * hash) + UPDATE_MASK_FIELD_NUMBER; + hash = (53 * hash) + getUpdateMask().hashCode(); + } + if (hasUser()) { + hash = (37 * hash) + USER_FIELD_NUMBER; + hash = (53 * hash) + getUser().hashCode(); + } + hash = (37 * hash) + REQUEST_ID_FIELD_NUMBER; + hash = (53 * hash) + getRequestId().hashCode(); + hash = (37 * hash) + VALIDATE_ONLY_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getValidateOnly()); + hash = (37 * hash) + ALLOW_MISSING_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getAllowMissing()); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.alloydb.v1alpha.UpdateUserRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1alpha.UpdateUserRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.alloydb.v1alpha.UpdateUserRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1alpha.UpdateUserRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.alloydb.v1alpha.UpdateUserRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1alpha.UpdateUserRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.alloydb.v1alpha.UpdateUserRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1alpha.UpdateUserRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.alloydb.v1alpha.UpdateUserRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1alpha.UpdateUserRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.alloydb.v1alpha.UpdateUserRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1alpha.UpdateUserRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.alloydb.v1alpha.UpdateUserRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Message for updating a User
+   * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1alpha.UpdateUserRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.alloydb.v1alpha.UpdateUserRequest) + com.google.cloud.alloydb.v1alpha.UpdateUserRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.alloydb.v1alpha.ServiceProto + .internal_static_google_cloud_alloydb_v1alpha_UpdateUserRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1alpha.ServiceProto + .internal_static_google_cloud_alloydb_v1alpha_UpdateUserRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1alpha.UpdateUserRequest.class, + com.google.cloud.alloydb.v1alpha.UpdateUserRequest.Builder.class); + } + + // Construct using com.google.cloud.alloydb.v1alpha.UpdateUserRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + updateMask_ = null; + if (updateMaskBuilder_ != null) { + updateMaskBuilder_.dispose(); + updateMaskBuilder_ = null; + } + user_ = null; + if (userBuilder_ != null) { + userBuilder_.dispose(); + userBuilder_ = null; + } + requestId_ = ""; + validateOnly_ = false; + allowMissing_ = false; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.alloydb.v1alpha.ServiceProto + .internal_static_google_cloud_alloydb_v1alpha_UpdateUserRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.UpdateUserRequest getDefaultInstanceForType() { + return com.google.cloud.alloydb.v1alpha.UpdateUserRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.UpdateUserRequest build() { + com.google.cloud.alloydb.v1alpha.UpdateUserRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.UpdateUserRequest buildPartial() { + com.google.cloud.alloydb.v1alpha.UpdateUserRequest result = + new com.google.cloud.alloydb.v1alpha.UpdateUserRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.alloydb.v1alpha.UpdateUserRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.updateMask_ = updateMaskBuilder_ == null ? updateMask_ : updateMaskBuilder_.build(); + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.user_ = userBuilder_ == null ? user_ : userBuilder_.build(); + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.requestId_ = requestId_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.validateOnly_ = validateOnly_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.allowMissing_ = allowMissing_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.alloydb.v1alpha.UpdateUserRequest) { + return mergeFrom((com.google.cloud.alloydb.v1alpha.UpdateUserRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.alloydb.v1alpha.UpdateUserRequest other) { + if (other == com.google.cloud.alloydb.v1alpha.UpdateUserRequest.getDefaultInstance()) + return this; + if (other.hasUpdateMask()) { + mergeUpdateMask(other.getUpdateMask()); + } + if (other.hasUser()) { + mergeUser(other.getUser()); + } + if (!other.getRequestId().isEmpty()) { + requestId_ = other.requestId_; + bitField0_ |= 0x00000004; + onChanged(); + } + if (other.getValidateOnly() != false) { + setValidateOnly(other.getValidateOnly()); + } + if (other.getAllowMissing() != false) { + setAllowMissing(other.getAllowMissing()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + input.readMessage(getUpdateMaskFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + input.readMessage(getUserFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + requestId_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 32: + { + validateOnly_ = input.readBool(); + bitField0_ |= 0x00000008; + break; + } // case 32 + case 40: + { + allowMissing_ = input.readBool(); + bitField0_ |= 0x00000010; + break; + } // case 40 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private com.google.protobuf.FieldMask updateMask_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder> + updateMaskBuilder_; + /** + * + * + *
+     * 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.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the updateMask field is set. + */ + public boolean hasUpdateMask() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+     * 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.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The updateMask. + */ + public com.google.protobuf.FieldMask getUpdateMask() { + if (updateMaskBuilder_ == null) { + return updateMask_ == null + ? com.google.protobuf.FieldMask.getDefaultInstance() + : updateMask_; + } else { + return updateMaskBuilder_.getMessage(); + } + } + /** + * + * + *
+     * 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.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setUpdateMask(com.google.protobuf.FieldMask value) { + if (updateMaskBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + updateMask_ = value; + } else { + updateMaskBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * 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.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setUpdateMask(com.google.protobuf.FieldMask.Builder builderForValue) { + if (updateMaskBuilder_ == null) { + updateMask_ = builderForValue.build(); + } else { + updateMaskBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * 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.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder mergeUpdateMask(com.google.protobuf.FieldMask value) { + if (updateMaskBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && updateMask_ != null + && updateMask_ != com.google.protobuf.FieldMask.getDefaultInstance()) { + getUpdateMaskBuilder().mergeFrom(value); + } else { + updateMask_ = value; + } + } else { + updateMaskBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * 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.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder clearUpdateMask() { + bitField0_ = (bitField0_ & ~0x00000001); + updateMask_ = null; + if (updateMaskBuilder_ != null) { + updateMaskBuilder_.dispose(); + updateMaskBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * 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.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.protobuf.FieldMask.Builder getUpdateMaskBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return getUpdateMaskFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * 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.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { + if (updateMaskBuilder_ != null) { + return updateMaskBuilder_.getMessageOrBuilder(); + } else { + return updateMask_ == null + ? com.google.protobuf.FieldMask.getDefaultInstance() + : 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.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder> + getUpdateMaskFieldBuilder() { + if (updateMaskBuilder_ == null) { + updateMaskBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder>( + getUpdateMask(), getParentForChildren(), isClean()); + updateMask_ = null; + } + return updateMaskBuilder_; + } + + private com.google.cloud.alloydb.v1alpha.User user_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1alpha.User, + com.google.cloud.alloydb.v1alpha.User.Builder, + com.google.cloud.alloydb.v1alpha.UserOrBuilder> + userBuilder_; + /** + * + * + *
+     * Required. The resource being updated
+     * 
+ * + * .google.cloud.alloydb.v1alpha.User user = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the user field is set. + */ + public boolean hasUser() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+     * Required. The resource being updated
+     * 
+ * + * .google.cloud.alloydb.v1alpha.User user = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The user. + */ + public com.google.cloud.alloydb.v1alpha.User getUser() { + if (userBuilder_ == null) { + return user_ == null ? com.google.cloud.alloydb.v1alpha.User.getDefaultInstance() : user_; + } else { + return userBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. The resource being updated
+     * 
+ * + * .google.cloud.alloydb.v1alpha.User user = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setUser(com.google.cloud.alloydb.v1alpha.User value) { + if (userBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + user_ = value; + } else { + userBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The resource being updated
+     * 
+ * + * .google.cloud.alloydb.v1alpha.User user = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setUser(com.google.cloud.alloydb.v1alpha.User.Builder builderForValue) { + if (userBuilder_ == null) { + user_ = builderForValue.build(); + } else { + userBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The resource being updated
+     * 
+ * + * .google.cloud.alloydb.v1alpha.User user = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeUser(com.google.cloud.alloydb.v1alpha.User value) { + if (userBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && user_ != null + && user_ != com.google.cloud.alloydb.v1alpha.User.getDefaultInstance()) { + getUserBuilder().mergeFrom(value); + } else { + user_ = value; + } + } else { + userBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The resource being updated
+     * 
+ * + * .google.cloud.alloydb.v1alpha.User user = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearUser() { + bitField0_ = (bitField0_ & ~0x00000002); + user_ = null; + if (userBuilder_ != null) { + userBuilder_.dispose(); + userBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The resource being updated
+     * 
+ * + * .google.cloud.alloydb.v1alpha.User user = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.alloydb.v1alpha.User.Builder getUserBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return getUserFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. The resource being updated
+     * 
+ * + * .google.cloud.alloydb.v1alpha.User user = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.alloydb.v1alpha.UserOrBuilder getUserOrBuilder() { + if (userBuilder_ != null) { + return userBuilder_.getMessageOrBuilder(); + } else { + return user_ == null ? com.google.cloud.alloydb.v1alpha.User.getDefaultInstance() : user_; + } + } + /** + * + * + *
+     * Required. The resource being updated
+     * 
+ * + * .google.cloud.alloydb.v1alpha.User user = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1alpha.User, + com.google.cloud.alloydb.v1alpha.User.Builder, + com.google.cloud.alloydb.v1alpha.UserOrBuilder> + getUserFieldBuilder() { + if (userBuilder_ == null) { + userBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1alpha.User, + com.google.cloud.alloydb.v1alpha.User.Builder, + com.google.cloud.alloydb.v1alpha.UserOrBuilder>( + getUser(), getParentForChildren(), isClean()); + user_ = null; + } + return userBuilder_; + } + + private java.lang.Object 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).
+     * 
+ * + * string request_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The requestId. + */ + public java.lang.String getRequestId() { + java.lang.Object ref = requestId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + requestId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes since the first request.
+     *
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     *
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for requestId. + */ + public com.google.protobuf.ByteString getRequestIdBytes() { + java.lang.Object ref = requestId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + requestId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes since the first request.
+     *
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     *
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The requestId to set. + * @return This builder for chaining. + */ + public Builder setRequestId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + requestId_ = value; + bitField0_ |= 0x00000004; + onChanged(); + 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).
+     * 
+ * + * string request_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearRequestId() { + requestId_ = getDefaultInstance().getRequestId(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + 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).
+     * 
+ * + * string request_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for requestId to set. + * @return This builder for chaining. + */ + public Builder setRequestIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + requestId_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + private boolean validateOnly_; + /** + * + * + *
+     * Optional. If set, the backend validates the request, but doesn't actually
+     * execute it.
+     * 
+ * + * bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The validateOnly. + */ + @java.lang.Override + public boolean getValidateOnly() { + return validateOnly_; + } + /** + * + * + *
+     * Optional. If set, the backend validates the request, but doesn't actually
+     * execute it.
+     * 
+ * + * bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The validateOnly to set. + * @return This builder for chaining. + */ + public Builder setValidateOnly(boolean value) { + + validateOnly_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. If set, the backend validates the request, but doesn't actually
+     * execute it.
+     * 
+ * + * bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearValidateOnly() { + bitField0_ = (bitField0_ & ~0x00000008); + validateOnly_ = false; + onChanged(); + return this; + } + + private boolean allowMissing_; + /** + * + * + *
+     * Optional. Allow missing fields in the update mask.
+     * 
+ * + * bool allow_missing = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The allowMissing. + */ + @java.lang.Override + public boolean getAllowMissing() { + return allowMissing_; + } + /** + * + * + *
+     * Optional. Allow missing fields in the update mask.
+     * 
+ * + * bool allow_missing = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The allowMissing to set. + * @return This builder for chaining. + */ + public Builder setAllowMissing(boolean value) { + + allowMissing_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Allow missing fields in the update mask.
+     * 
+ * + * bool allow_missing = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearAllowMissing() { + bitField0_ = (bitField0_ & ~0x00000010); + allowMissing_ = false; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.alloydb.v1alpha.UpdateUserRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.alloydb.v1alpha.UpdateUserRequest) + private static final com.google.cloud.alloydb.v1alpha.UpdateUserRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.alloydb.v1alpha.UpdateUserRequest(); + } + + public static com.google.cloud.alloydb.v1alpha.UpdateUserRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public UpdateUserRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.UpdateUserRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/UpdateUserRequestOrBuilder.java b/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/UpdateUserRequestOrBuilder.java new file mode 100644 index 000000000000..a38bf5d0ecb4 --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/UpdateUserRequestOrBuilder.java @@ -0,0 +1,189 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/alloydb/v1alpha/service.proto + +package com.google.cloud.alloydb.v1alpha; + +public interface UpdateUserRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.alloydb.v1alpha.UpdateUserRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * 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.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the updateMask field is set. + */ + boolean hasUpdateMask(); + /** + * + * + *
+   * 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.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The updateMask. + */ + com.google.protobuf.FieldMask getUpdateMask(); + /** + * + * + *
+   * 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.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder(); + + /** + * + * + *
+   * Required. The resource being updated
+   * 
+ * + * .google.cloud.alloydb.v1alpha.User user = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the user field is set. + */ + boolean hasUser(); + /** + * + * + *
+   * Required. The resource being updated
+   * 
+ * + * .google.cloud.alloydb.v1alpha.User user = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The user. + */ + com.google.cloud.alloydb.v1alpha.User getUser(); + /** + * + * + *
+   * Required. The resource being updated
+   * 
+ * + * .google.cloud.alloydb.v1alpha.User user = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.alloydb.v1alpha.UserOrBuilder getUserOrBuilder(); + + /** + * + * + *
+   * Optional. An optional request ID to identify requests. Specify a unique
+   * request ID so that if you must retry your request, the server will know to
+   * ignore the request if it has already been completed. The server will
+   * guarantee that for at least 60 minutes since the first request.
+   *
+   * For example, consider a situation where you make an initial request and
+   * the request times out. If you make the request again with the same request
+   * ID, the server can check if original operation with the same request ID
+   * was received, and if so, will ignore the second request. This prevents
+   * clients from accidentally creating duplicate commitments.
+   *
+   * The request ID must be a valid UUID with the exception that zero UUID is
+   * not supported (00000000-0000-0000-0000-000000000000).
+   * 
+ * + * string request_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The requestId. + */ + java.lang.String getRequestId(); + /** + * + * + *
+   * Optional. An optional request ID to identify requests. Specify a unique
+   * request ID so that if you must retry your request, the server will know to
+   * ignore the request if it has already been completed. The server will
+   * guarantee that for at least 60 minutes since the first request.
+   *
+   * For example, consider a situation where you make an initial request and
+   * the request times out. If you make the request again with the same request
+   * ID, the server can check if original operation with the same request ID
+   * was received, and if so, will ignore the second request. This prevents
+   * clients from accidentally creating duplicate commitments.
+   *
+   * The request ID must be a valid UUID with the exception that zero UUID is
+   * not supported (00000000-0000-0000-0000-000000000000).
+   * 
+ * + * string request_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for requestId. + */ + com.google.protobuf.ByteString getRequestIdBytes(); + + /** + * + * + *
+   * Optional. If set, the backend validates the request, but doesn't actually
+   * execute it.
+   * 
+ * + * bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The validateOnly. + */ + boolean getValidateOnly(); + + /** + * + * + *
+   * Optional. Allow missing fields in the update mask.
+   * 
+ * + * bool allow_missing = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The allowMissing. + */ + boolean getAllowMissing(); +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/User.java b/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/User.java new file mode 100644 index 000000000000..184951add8bd --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/User.java @@ -0,0 +1,1423 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/alloydb/v1alpha/resources.proto + +package com.google.cloud.alloydb.v1alpha; + +/** + * + * + *
+ * Message describing User object.
+ * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1alpha.User} + */ +public final class User extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.alloydb.v1alpha.User) + UserOrBuilder { + private static final long serialVersionUID = 0L; + // Use User.newBuilder() to construct. + private User(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private User() { + name_ = ""; + password_ = ""; + databaseRoles_ = com.google.protobuf.LazyStringArrayList.emptyList(); + userType_ = 0; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new User(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.alloydb.v1alpha.ResourcesProto + .internal_static_google_cloud_alloydb_v1alpha_User_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1alpha.ResourcesProto + .internal_static_google_cloud_alloydb_v1alpha_User_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1alpha.User.class, + com.google.cloud.alloydb.v1alpha.User.Builder.class); + } + + /** + * + * + *
+   * Enum that details the user type.
+   * 
+ * + * Protobuf enum {@code google.cloud.alloydb.v1alpha.User.UserType} + */ + public enum UserType implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * Unspecified user type.
+     * 
+ * + * USER_TYPE_UNSPECIFIED = 0; + */ + USER_TYPE_UNSPECIFIED(0), + /** + * + * + *
+     * The default user type that authenticates via password-based
+     * authentication.
+     * 
+ * + * ALLOYDB_BUILT_IN = 1; + */ + ALLOYDB_BUILT_IN(1), + /** + * + * + *
+     * Database user that can authenticate via IAM-Based authentication.
+     * 
+ * + * ALLOYDB_IAM_USER = 2; + */ + ALLOYDB_IAM_USER(2), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * Unspecified user type.
+     * 
+ * + * USER_TYPE_UNSPECIFIED = 0; + */ + public static final int USER_TYPE_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * The default user type that authenticates via password-based
+     * authentication.
+     * 
+ * + * ALLOYDB_BUILT_IN = 1; + */ + public static final int ALLOYDB_BUILT_IN_VALUE = 1; + /** + * + * + *
+     * Database user that can authenticate via IAM-Based authentication.
+     * 
+ * + * ALLOYDB_IAM_USER = 2; + */ + public static final int ALLOYDB_IAM_USER_VALUE = 2; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static UserType valueOf(int value) { + return forNumber(value); + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + */ + public static UserType forNumber(int value) { + switch (value) { + case 0: + return USER_TYPE_UNSPECIFIED; + case 1: + return ALLOYDB_BUILT_IN; + case 2: + return ALLOYDB_IAM_USER; + default: + return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap internalGetValueMap() { + return internalValueMap; + } + + private static final com.google.protobuf.Internal.EnumLiteMap internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public UserType findValueByNumber(int number) { + return UserType.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + return getDescriptor().getValues().get(ordinal()); + } + + public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { + return getDescriptor(); + } + + public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.cloud.alloydb.v1alpha.User.getDescriptor().getEnumTypes().get(0); + } + + private static final UserType[] VALUES = values(); + + public static UserType valueOf(com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException("EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private UserType(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.alloydb.v1alpha.User.UserType) + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + * + * + *
+   * Output only. Name of the resource in the form of
+   * projects/{project}/locations/{location}/cluster/{cluster}/users/{user}.
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * Output only. Name of the resource in the form of
+   * projects/{project}/locations/{location}/cluster/{cluster}/users/{user}.
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PASSWORD_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object password_ = ""; + /** + * + * + *
+   * Input only. Password for the user.
+   * 
+ * + * string password = 2 [(.google.api.field_behavior) = INPUT_ONLY]; + * + * @return The password. + */ + @java.lang.Override + public java.lang.String getPassword() { + java.lang.Object ref = password_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + password_ = s; + return s; + } + } + /** + * + * + *
+   * Input only. Password for the user.
+   * 
+ * + * string password = 2 [(.google.api.field_behavior) = INPUT_ONLY]; + * + * @return The bytes for password. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPasswordBytes() { + java.lang.Object ref = password_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + password_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DATABASE_ROLES_FIELD_NUMBER = 4; + + @SuppressWarnings("serial") + private com.google.protobuf.LazyStringArrayList databaseRoles_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + /** + * + * + *
+   * Optional. List of database roles this user has.
+   * The database role strings are subject to the PostgreSQL naming conventions.
+   * 
+ * + * repeated string database_roles = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return A list containing the databaseRoles. + */ + public com.google.protobuf.ProtocolStringList getDatabaseRolesList() { + return databaseRoles_; + } + /** + * + * + *
+   * Optional. List of database roles this user has.
+   * The database role strings are subject to the PostgreSQL naming conventions.
+   * 
+ * + * repeated string database_roles = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The count of databaseRoles. + */ + public int getDatabaseRolesCount() { + return databaseRoles_.size(); + } + /** + * + * + *
+   * Optional. List of database roles this user has.
+   * The database role strings are subject to the PostgreSQL naming conventions.
+   * 
+ * + * repeated string database_roles = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param index The index of the element to return. + * @return The databaseRoles at the given index. + */ + public java.lang.String getDatabaseRoles(int index) { + return databaseRoles_.get(index); + } + /** + * + * + *
+   * Optional. List of database roles this user has.
+   * The database role strings are subject to the PostgreSQL naming conventions.
+   * 
+ * + * repeated string database_roles = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param index The index of the value to return. + * @return The bytes of the databaseRoles at the given index. + */ + public com.google.protobuf.ByteString getDatabaseRolesBytes(int index) { + return databaseRoles_.getByteString(index); + } + + public static final int USER_TYPE_FIELD_NUMBER = 5; + private int userType_ = 0; + /** + * + * + *
+   * Optional. Type of this user.
+   * 
+ * + * + * .google.cloud.alloydb.v1alpha.User.UserType user_type = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The enum numeric value on the wire for userType. + */ + @java.lang.Override + public int getUserTypeValue() { + return userType_; + } + /** + * + * + *
+   * Optional. Type of this user.
+   * 
+ * + * + * .google.cloud.alloydb.v1alpha.User.UserType user_type = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The userType. + */ + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.User.UserType getUserType() { + com.google.cloud.alloydb.v1alpha.User.UserType result = + com.google.cloud.alloydb.v1alpha.User.UserType.forNumber(userType_); + return result == null ? com.google.cloud.alloydb.v1alpha.User.UserType.UNRECOGNIZED : result; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(password_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, password_); + } + for (int i = 0; i < databaseRoles_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, databaseRoles_.getRaw(i)); + } + if (userType_ + != com.google.cloud.alloydb.v1alpha.User.UserType.USER_TYPE_UNSPECIFIED.getNumber()) { + output.writeEnum(5, userType_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(password_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, password_); + } + { + int dataSize = 0; + for (int i = 0; i < databaseRoles_.size(); i++) { + dataSize += computeStringSizeNoTag(databaseRoles_.getRaw(i)); + } + size += dataSize; + size += 1 * getDatabaseRolesList().size(); + } + if (userType_ + != com.google.cloud.alloydb.v1alpha.User.UserType.USER_TYPE_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(5, userType_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.alloydb.v1alpha.User)) { + return super.equals(obj); + } + com.google.cloud.alloydb.v1alpha.User other = (com.google.cloud.alloydb.v1alpha.User) obj; + + if (!getName().equals(other.getName())) return false; + if (!getPassword().equals(other.getPassword())) return false; + if (!getDatabaseRolesList().equals(other.getDatabaseRolesList())) return false; + if (userType_ != other.userType_) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (37 * hash) + PASSWORD_FIELD_NUMBER; + hash = (53 * hash) + getPassword().hashCode(); + if (getDatabaseRolesCount() > 0) { + hash = (37 * hash) + DATABASE_ROLES_FIELD_NUMBER; + hash = (53 * hash) + getDatabaseRolesList().hashCode(); + } + hash = (37 * hash) + USER_TYPE_FIELD_NUMBER; + hash = (53 * hash) + userType_; + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.alloydb.v1alpha.User parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1alpha.User parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.alloydb.v1alpha.User parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1alpha.User parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.alloydb.v1alpha.User parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1alpha.User parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.alloydb.v1alpha.User parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1alpha.User parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.alloydb.v1alpha.User parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1alpha.User parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.alloydb.v1alpha.User parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1alpha.User parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.alloydb.v1alpha.User prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Message describing User object.
+   * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1alpha.User} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.alloydb.v1alpha.User) + com.google.cloud.alloydb.v1alpha.UserOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.alloydb.v1alpha.ResourcesProto + .internal_static_google_cloud_alloydb_v1alpha_User_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1alpha.ResourcesProto + .internal_static_google_cloud_alloydb_v1alpha_User_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1alpha.User.class, + com.google.cloud.alloydb.v1alpha.User.Builder.class); + } + + // Construct using com.google.cloud.alloydb.v1alpha.User.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + password_ = ""; + databaseRoles_ = com.google.protobuf.LazyStringArrayList.emptyList(); + userType_ = 0; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.alloydb.v1alpha.ResourcesProto + .internal_static_google_cloud_alloydb_v1alpha_User_descriptor; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.User getDefaultInstanceForType() { + return com.google.cloud.alloydb.v1alpha.User.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.User build() { + com.google.cloud.alloydb.v1alpha.User result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.User buildPartial() { + com.google.cloud.alloydb.v1alpha.User result = + new com.google.cloud.alloydb.v1alpha.User(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.alloydb.v1alpha.User result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.password_ = password_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + databaseRoles_.makeImmutable(); + result.databaseRoles_ = databaseRoles_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.userType_ = userType_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.alloydb.v1alpha.User) { + return mergeFrom((com.google.cloud.alloydb.v1alpha.User) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.alloydb.v1alpha.User other) { + if (other == com.google.cloud.alloydb.v1alpha.User.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getPassword().isEmpty()) { + password_ = other.password_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (!other.databaseRoles_.isEmpty()) { + if (databaseRoles_.isEmpty()) { + databaseRoles_ = other.databaseRoles_; + bitField0_ |= 0x00000004; + } else { + ensureDatabaseRolesIsMutable(); + databaseRoles_.addAll(other.databaseRoles_); + } + onChanged(); + } + if (other.userType_ != 0) { + setUserTypeValue(other.getUserTypeValue()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + password_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 34: + { + java.lang.String s = input.readStringRequireUtf8(); + ensureDatabaseRolesIsMutable(); + databaseRoles_.add(s); + break; + } // case 34 + case 40: + { + userType_ = input.readEnum(); + bitField0_ |= 0x00000008; + break; + } // case 40 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Output only. Name of the resource in the form of
+     * projects/{project}/locations/{location}/cluster/{cluster}/users/{user}.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Output only. Name of the resource in the form of
+     * projects/{project}/locations/{location}/cluster/{cluster}/users/{user}.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Output only. Name of the resource in the form of
+     * projects/{project}/locations/{location}/cluster/{cluster}/users/{user}.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Name of the resource in the form of
+     * projects/{project}/locations/{location}/cluster/{cluster}/users/{user}.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Name of the resource in the form of
+     * projects/{project}/locations/{location}/cluster/{cluster}/users/{user}.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object password_ = ""; + /** + * + * + *
+     * Input only. Password for the user.
+     * 
+ * + * string password = 2 [(.google.api.field_behavior) = INPUT_ONLY]; + * + * @return The password. + */ + public java.lang.String getPassword() { + java.lang.Object ref = password_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + password_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Input only. Password for the user.
+     * 
+ * + * string password = 2 [(.google.api.field_behavior) = INPUT_ONLY]; + * + * @return The bytes for password. + */ + public com.google.protobuf.ByteString getPasswordBytes() { + java.lang.Object ref = password_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + password_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Input only. Password for the user.
+     * 
+ * + * string password = 2 [(.google.api.field_behavior) = INPUT_ONLY]; + * + * @param value The password to set. + * @return This builder for chaining. + */ + public Builder setPassword(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + password_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Input only. Password for the user.
+     * 
+ * + * string password = 2 [(.google.api.field_behavior) = INPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearPassword() { + password_ = getDefaultInstance().getPassword(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * Input only. Password for the user.
+     * 
+ * + * string password = 2 [(.google.api.field_behavior) = INPUT_ONLY]; + * + * @param value The bytes for password to set. + * @return This builder for chaining. + */ + public Builder setPasswordBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + password_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringArrayList databaseRoles_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + + private void ensureDatabaseRolesIsMutable() { + if (!databaseRoles_.isModifiable()) { + databaseRoles_ = new com.google.protobuf.LazyStringArrayList(databaseRoles_); + } + bitField0_ |= 0x00000004; + } + /** + * + * + *
+     * Optional. List of database roles this user has.
+     * The database role strings are subject to the PostgreSQL naming conventions.
+     * 
+ * + * repeated string database_roles = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return A list containing the databaseRoles. + */ + public com.google.protobuf.ProtocolStringList getDatabaseRolesList() { + databaseRoles_.makeImmutable(); + return databaseRoles_; + } + /** + * + * + *
+     * Optional. List of database roles this user has.
+     * The database role strings are subject to the PostgreSQL naming conventions.
+     * 
+ * + * repeated string database_roles = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The count of databaseRoles. + */ + public int getDatabaseRolesCount() { + return databaseRoles_.size(); + } + /** + * + * + *
+     * Optional. List of database roles this user has.
+     * The database role strings are subject to the PostgreSQL naming conventions.
+     * 
+ * + * repeated string database_roles = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param index The index of the element to return. + * @return The databaseRoles at the given index. + */ + public java.lang.String getDatabaseRoles(int index) { + return databaseRoles_.get(index); + } + /** + * + * + *
+     * Optional. List of database roles this user has.
+     * The database role strings are subject to the PostgreSQL naming conventions.
+     * 
+ * + * repeated string database_roles = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param index The index of the value to return. + * @return The bytes of the databaseRoles at the given index. + */ + public com.google.protobuf.ByteString getDatabaseRolesBytes(int index) { + return databaseRoles_.getByteString(index); + } + /** + * + * + *
+     * Optional. List of database roles this user has.
+     * The database role strings are subject to the PostgreSQL naming conventions.
+     * 
+ * + * repeated string database_roles = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param index The index to set the value at. + * @param value The databaseRoles to set. + * @return This builder for chaining. + */ + public Builder setDatabaseRoles(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureDatabaseRolesIsMutable(); + databaseRoles_.set(index, value); + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. List of database roles this user has.
+     * The database role strings are subject to the PostgreSQL naming conventions.
+     * 
+ * + * repeated string database_roles = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The databaseRoles to add. + * @return This builder for chaining. + */ + public Builder addDatabaseRoles(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureDatabaseRolesIsMutable(); + databaseRoles_.add(value); + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. List of database roles this user has.
+     * The database role strings are subject to the PostgreSQL naming conventions.
+     * 
+ * + * repeated string database_roles = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param values The databaseRoles to add. + * @return This builder for chaining. + */ + public Builder addAllDatabaseRoles(java.lang.Iterable values) { + ensureDatabaseRolesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, databaseRoles_); + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. List of database roles this user has.
+     * The database role strings are subject to the PostgreSQL naming conventions.
+     * 
+ * + * repeated string database_roles = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearDatabaseRoles() { + databaseRoles_ = com.google.protobuf.LazyStringArrayList.emptyList(); + bitField0_ = (bitField0_ & ~0x00000004); + ; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. List of database roles this user has.
+     * The database role strings are subject to the PostgreSQL naming conventions.
+     * 
+ * + * repeated string database_roles = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes of the databaseRoles to add. + * @return This builder for chaining. + */ + public Builder addDatabaseRolesBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureDatabaseRolesIsMutable(); + databaseRoles_.add(value); + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + private int userType_ = 0; + /** + * + * + *
+     * Optional. Type of this user.
+     * 
+ * + * + * .google.cloud.alloydb.v1alpha.User.UserType user_type = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The enum numeric value on the wire for userType. + */ + @java.lang.Override + public int getUserTypeValue() { + return userType_; + } + /** + * + * + *
+     * Optional. Type of this user.
+     * 
+ * + * + * .google.cloud.alloydb.v1alpha.User.UserType user_type = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param value The enum numeric value on the wire for userType to set. + * @return This builder for chaining. + */ + public Builder setUserTypeValue(int value) { + userType_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Type of this user.
+     * 
+ * + * + * .google.cloud.alloydb.v1alpha.User.UserType user_type = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The userType. + */ + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.User.UserType getUserType() { + com.google.cloud.alloydb.v1alpha.User.UserType result = + com.google.cloud.alloydb.v1alpha.User.UserType.forNumber(userType_); + return result == null ? com.google.cloud.alloydb.v1alpha.User.UserType.UNRECOGNIZED : result; + } + /** + * + * + *
+     * Optional. Type of this user.
+     * 
+ * + * + * .google.cloud.alloydb.v1alpha.User.UserType user_type = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param value The userType to set. + * @return This builder for chaining. + */ + public Builder setUserType(com.google.cloud.alloydb.v1alpha.User.UserType value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000008; + userType_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Type of this user.
+     * 
+ * + * + * .google.cloud.alloydb.v1alpha.User.UserType user_type = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return This builder for chaining. + */ + public Builder clearUserType() { + bitField0_ = (bitField0_ & ~0x00000008); + userType_ = 0; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.alloydb.v1alpha.User) + } + + // @@protoc_insertion_point(class_scope:google.cloud.alloydb.v1alpha.User) + private static final com.google.cloud.alloydb.v1alpha.User DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.alloydb.v1alpha.User(); + } + + public static com.google.cloud.alloydb.v1alpha.User getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public User parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1alpha.User getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/UserName.java b/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/UserName.java new file mode 100644 index 000000000000..540024b0b606 --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/UserName.java @@ -0,0 +1,257 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.alloydb.v1alpha; + +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +@Generated("by gapic-generator-java") +public class UserName implements ResourceName { + private static final PathTemplate PROJECT_LOCATION_CLUSTER_USER = + PathTemplate.createWithoutUrlEncoding( + "projects/{project}/locations/{location}/clusters/{cluster}/users/{user}"); + private volatile Map fieldValuesMap; + private final String project; + private final String location; + private final String cluster; + private final String user; + + @Deprecated + protected UserName() { + project = null; + location = null; + cluster = null; + user = null; + } + + private UserName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + location = Preconditions.checkNotNull(builder.getLocation()); + cluster = Preconditions.checkNotNull(builder.getCluster()); + user = Preconditions.checkNotNull(builder.getUser()); + } + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getCluster() { + return cluster; + } + + public String getUser() { + return user; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + public static UserName of(String project, String location, String cluster, String user) { + return newBuilder() + .setProject(project) + .setLocation(location) + .setCluster(cluster) + .setUser(user) + .build(); + } + + public static String format(String project, String location, String cluster, String user) { + return newBuilder() + .setProject(project) + .setLocation(location) + .setCluster(cluster) + .setUser(user) + .build() + .toString(); + } + + public static UserName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + PROJECT_LOCATION_CLUSTER_USER.validatedMatch( + formattedString, "UserName.parse: formattedString not in valid format"); + return of( + matchMap.get("project"), + matchMap.get("location"), + matchMap.get("cluster"), + matchMap.get("user")); + } + + public static List parseList(List formattedStrings) { + List list = new ArrayList<>(formattedStrings.size()); + for (String formattedString : formattedStrings) { + list.add(parse(formattedString)); + } + return list; + } + + public static List toStringList(List values) { + List list = new ArrayList<>(values.size()); + for (UserName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return PROJECT_LOCATION_CLUSTER_USER.matches(formattedString); + } + + @Override + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + if (project != null) { + fieldMapBuilder.put("project", project); + } + if (location != null) { + fieldMapBuilder.put("location", location); + } + if (cluster != null) { + fieldMapBuilder.put("cluster", cluster); + } + if (user != null) { + fieldMapBuilder.put("user", user); + } + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return PROJECT_LOCATION_CLUSTER_USER.instantiate( + "project", project, "location", location, "cluster", cluster, "user", user); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null || getClass() == o.getClass()) { + UserName that = ((UserName) o); + return Objects.equals(this.project, that.project) + && Objects.equals(this.location, that.location) + && Objects.equals(this.cluster, that.cluster) + && Objects.equals(this.user, that.user); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= Objects.hashCode(project); + h *= 1000003; + h ^= Objects.hashCode(location); + h *= 1000003; + h ^= Objects.hashCode(cluster); + h *= 1000003; + h ^= Objects.hashCode(user); + return h; + } + + /** Builder for projects/{project}/locations/{location}/clusters/{cluster}/users/{user}. */ + public static class Builder { + private String project; + private String location; + private String cluster; + private String user; + + protected Builder() {} + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getCluster() { + return cluster; + } + + public String getUser() { + return user; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public Builder setLocation(String location) { + this.location = location; + return this; + } + + public Builder setCluster(String cluster) { + this.cluster = cluster; + return this; + } + + public Builder setUser(String user) { + this.user = user; + return this; + } + + private Builder(UserName userName) { + this.project = userName.project; + this.location = userName.location; + this.cluster = userName.cluster; + this.user = userName.user; + } + + public UserName build() { + return new UserName(this); + } + } +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/UserOrBuilder.java b/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/UserOrBuilder.java new file mode 100644 index 000000000000..85ca3a86f2d8 --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/java/com/google/cloud/alloydb/v1alpha/UserOrBuilder.java @@ -0,0 +1,161 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/alloydb/v1alpha/resources.proto + +package com.google.cloud.alloydb.v1alpha; + +public interface UserOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.alloydb.v1alpha.User) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Output only. Name of the resource in the form of
+   * projects/{project}/locations/{location}/cluster/{cluster}/users/{user}.
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Output only. Name of the resource in the form of
+   * projects/{project}/locations/{location}/cluster/{cluster}/users/{user}.
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * Input only. Password for the user.
+   * 
+ * + * string password = 2 [(.google.api.field_behavior) = INPUT_ONLY]; + * + * @return The password. + */ + java.lang.String getPassword(); + /** + * + * + *
+   * Input only. Password for the user.
+   * 
+ * + * string password = 2 [(.google.api.field_behavior) = INPUT_ONLY]; + * + * @return The bytes for password. + */ + com.google.protobuf.ByteString getPasswordBytes(); + + /** + * + * + *
+   * Optional. List of database roles this user has.
+   * The database role strings are subject to the PostgreSQL naming conventions.
+   * 
+ * + * repeated string database_roles = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return A list containing the databaseRoles. + */ + java.util.List getDatabaseRolesList(); + /** + * + * + *
+   * Optional. List of database roles this user has.
+   * The database role strings are subject to the PostgreSQL naming conventions.
+   * 
+ * + * repeated string database_roles = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The count of databaseRoles. + */ + int getDatabaseRolesCount(); + /** + * + * + *
+   * Optional. List of database roles this user has.
+   * The database role strings are subject to the PostgreSQL naming conventions.
+   * 
+ * + * repeated string database_roles = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param index The index of the element to return. + * @return The databaseRoles at the given index. + */ + java.lang.String getDatabaseRoles(int index); + /** + * + * + *
+   * Optional. List of database roles this user has.
+   * The database role strings are subject to the PostgreSQL naming conventions.
+   * 
+ * + * repeated string database_roles = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param index The index of the value to return. + * @return The bytes of the databaseRoles at the given index. + */ + com.google.protobuf.ByteString getDatabaseRolesBytes(int index); + + /** + * + * + *
+   * Optional. Type of this user.
+   * 
+ * + * + * .google.cloud.alloydb.v1alpha.User.UserType user_type = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The enum numeric value on the wire for userType. + */ + int getUserTypeValue(); + /** + * + * + *
+   * Optional. Type of this user.
+   * 
+ * + * + * .google.cloud.alloydb.v1alpha.User.UserType user_type = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The userType. + */ + com.google.cloud.alloydb.v1alpha.User.UserType getUserType(); +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/proto/google/cloud/alloydb/v1alpha/resources.proto b/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/proto/google/cloud/alloydb/v1alpha/resources.proto index bfc100ad7e77..34355dc8391a 100644 --- a/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/proto/google/cloud/alloydb/v1alpha/resources.proto +++ b/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/proto/google/cloud/alloydb/v1alpha/resources.proto @@ -1,4 +1,4 @@ -// Copyright 2022 Google LLC +// Copyright 2023 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -40,18 +40,6 @@ option (google.api.resource_definition) = { pattern: "projects/{project}/global/networks/{network}" }; -// The supported database engine versions. -enum DatabaseVersion { - // This is an unknown database version. - DATABASE_VERSION_UNSPECIFIED = 0; - - // DEPRECATED - The database version is Postgres 13. - POSTGRES_13 = 1 [deprecated = true]; - - // The database version is Postgres 14. - POSTGRES_14 = 2; -} - // View on Instance. Pass this enum to rpcs that returns an Instance message to // control which subsets of fields to get. enum InstanceView { @@ -68,6 +56,35 @@ enum InstanceView { INSTANCE_VIEW_FULL = 2; } +// View on Cluster. Pass this enum to rpcs that returns a cluster message to +// control which subsets of fields to get. +enum ClusterView { + // CLUSTER_VIEW_UNSPECIFIED Not specified, equivalent to BASIC. + 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. + 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. + CLUSTER_VIEW_CONTINUOUS_BACKUP = 2; +} + +// The supported database engine versions. +enum DatabaseVersion { + // This is an unknown database version. + DATABASE_VERSION_UNSPECIFIED = 0; + + // DEPRECATED - The database version is Postgres 13. + POSTGRES_13 = 1 [deprecated = true]; + + // The database version is Postgres 14. + POSTGRES_14 = 2; +} + // The username/password for a database user. Used for specifying initial // users at cluster creation time. message UserPassword { @@ -141,25 +158,31 @@ message EncryptionInfo { ]; } -// SSL configuration for an AlloyDB Cluster. +// SSL configuration. message SslConfig { // SSL mode options. enum SslMode { - // SSL mode not specified. Defaults to SSL_MODE_ALLOW. + // SSL mode not specified. Defaults to ENCRYPTED_ONLY. SSL_MODE_UNSPECIFIED = 0; // SSL connections are optional. CA verification not enforced. - SSL_MODE_ALLOW = 1; + SSL_MODE_ALLOW = 1 [deprecated = true]; // SSL connections are required. CA verification not enforced. // Clients may use locally self-signed certificates (default psql client // behavior). - SSL_MODE_REQUIRE = 2; + SSL_MODE_REQUIRE = 2 [deprecated = true]; // SSL connections are required. CA verification enforced. // Clients must have certificates signed by a Cluster CA, e.g. via // GenerateClientCertificate. - SSL_MODE_VERIFY_CA = 3; + SSL_MODE_VERIFY_CA = 3 [deprecated = true]; + + // SSL connections are optional. CA verification not enforced. + ALLOW_UNENCRYPTED_AND_ENCRYPTED = 4; + + // SSL connections are required. CA verification not enforced. + ENCRYPTED_ONLY = 5; } // Certificate Authority (CA) source for SSL/TLS certificates. @@ -314,6 +337,11 @@ message ContinuousBackupInfo { // only field. Ignored if passed into the request. repeated google.type.DayOfWeek schedule = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The earliest restorable time that can be restored to. Output + // only field. + google.protobuf.Timestamp earliest_restorable_time = 4 + [(google.api.field_behavior) = OUTPUT_ONLY]; } // Message describing a BackupSource. @@ -353,6 +381,32 @@ message Cluster { style: DECLARATIVE_FRIENDLY }; + // Metadata related to network configuration. + message NetworkConfig { + // 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. It can be updated, but it cannot be + // removed. + string network = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "compute.googleapis.com/Network" + } + ]; + + // Optional. The 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. + string allocated_ip_range = 2 [(google.api.field_behavior) = OPTIONAL]; + } + // Configuration information for the secondary cluster. This should be set // if and only if the cluster is of type SECONDARY. message SecondaryConfig { @@ -481,6 +535,8 @@ message Cluster { DatabaseVersion database_version = 9 [(google.api.field_behavior) = OUTPUT_ONLY]; + NetworkConfig network_config = 29 [(google.api.field_behavior) = OPTIONAL]; + // 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 @@ -519,8 +575,8 @@ message Cluster { // documentation for the message type. AutomatedBackupPolicy automated_backup_policy = 17; - // SSL configuration for this AlloyDB Cluster. - SslConfig ssl_config = 18; + // SSL configuration for this AlloyDB cluster. + SslConfig ssl_config = 18 [deprecated = true]; // Optional. The encryption config can be specified to encrypt the data disks // and other persistent data resources of a cluster with a @@ -610,6 +666,25 @@ message Instance { int32 node_count = 1; } + // Policy to be used while updating the instance. + message UpdatePolicy { + // Specifies the available modes of update. + enum Mode { + // Mode is unknown. + MODE_UNSPECIFIED = 0; + + // Least disruptive way to apply the update. + DEFAULT = 1; + + // Performs a forced update when applicable. This will be fast but may + // incur a downtime. + FORCE_APPLY = 2; + } + + // Mode for updating the instance. + Mode mode = 1; + } + // Instance State enum State { // The state of the instance is unknown. @@ -667,10 +742,11 @@ message Instance { } // The Availability type of an instance. Potential values: + // // - ZONAL: The instance serves data from only one zone. Outages in that - // zone affect instance availability. + // zone affect instance availability. // - REGIONAL: The instance can serve data from more than one zone in a - // region (it is highly available). + // region (it is highly available). enum AvailabilityType { // This is an unknown Availability type. AVAILABILITY_TYPE_UNSPECIFIED = 0; @@ -726,8 +802,11 @@ message Instance { MachineConfig machine_config = 10; // Availability type of an Instance. - // Defaults to REGIONAL for both primary and read instances. - // Note that primary and read instances can have different availability types. + // 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). AvailabilityType availability_type = 11; // The Compute Engine zone that the instance should serve from, per @@ -786,6 +865,12 @@ message Instance { // This is distinct from labels. // https://google.aip.dev/128 map annotations = 18; + + // 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. + UpdatePolicy update_policy = 22; } // ConnectionInfo singleton resource. @@ -808,7 +893,7 @@ message ConnectionInfo { // 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. repeated string pem_certificate_chain = 3 - [(google.api.field_behavior) = OUTPUT_ONLY]; + [deprecated = true, (google.api.field_behavior) = OUTPUT_ONLY]; // Output only. The unique ID of the Instance. string instance_uid = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; @@ -905,7 +990,7 @@ message Backup { string cluster_uid = 18 [(google.api.field_behavior) = OUTPUT_ONLY]; // Required. The full resource name of the backup source cluster - // (e.g., projects//locations//clusters/). + // (e.g., projects/{project}/locations/{region}/clusters/{cluster_id}). string cluster_name = 10 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { type: "alloydb.googleapis.com/Cluster" } @@ -1026,3 +1111,39 @@ message SupportedDatabaseFlag { // availability SLO's). bool requires_db_restart = 6; } + +// Message describing User object. +message User { + option (google.api.resource) = { + type: "alloydb.googleapis.com/User" + pattern: "projects/{project}/locations/{location}/clusters/{cluster}/users/{user}" + style: DECLARATIVE_FRIENDLY + }; + + // Enum that details the user type. + enum UserType { + // Unspecified user type. + USER_TYPE_UNSPECIFIED = 0; + + // The default user type that authenticates via password-based + // authentication. + ALLOYDB_BUILT_IN = 1; + + // Database user that can authenticate via IAM-Based authentication. + ALLOYDB_IAM_USER = 2; + } + + // Output only. Name of the resource in the form of + // projects/{project}/locations/{location}/cluster/{cluster}/users/{user}. + string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Input only. Password for the user. + string password = 2 [(google.api.field_behavior) = INPUT_ONLY]; + + // Optional. List of database roles this user has. + // The database role strings are subject to the PostgreSQL naming conventions. + repeated string database_roles = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Type of this user. + UserType user_type = 5 [(google.api.field_behavior) = OPTIONAL]; +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/proto/google/cloud/alloydb/v1alpha/service.proto b/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/proto/google/cloud/alloydb/v1alpha/service.proto index d733e961cbda..296f4d2d26a7 100644 --- a/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/proto/google/cloud/alloydb/v1alpha/service.proto +++ b/java-alloydb/proto-google-cloud-alloydb-v1alpha/src/main/proto/google/cloud/alloydb/v1alpha/service.proto @@ -1,4 +1,4 @@ -// Copyright 2022 Google LLC +// Copyright 2023 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -255,6 +255,20 @@ service AlloyDBAdmin { }; } + // Injects fault in an instance. + // Imperative only. + rpc InjectFault(InjectFaultRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1alpha/{name=projects/*/locations/*/clusters/*/instances/*}:injectFault" + body: "*" + }; + option (google.api.method_signature) = "fault_type,name"; + option (google.longrunning.operation_info) = { + response_type: "Instance" + metadata_type: "OperationMetadata" + }; + } + // Restart an Instance in a cluster. // Imperative only. rpc RestartInstance(RestartInstanceRequest) @@ -354,6 +368,48 @@ service AlloyDBAdmin { }; option (google.api.method_signature) = "parent"; } + + // Lists Users in a given project and location. + rpc ListUsers(ListUsersRequest) returns (ListUsersResponse) { + option (google.api.http) = { + get: "/v1alpha/{parent=projects/*/locations/*/clusters/*}/users" + }; + option (google.api.method_signature) = "parent"; + } + + // Gets details of a single User. + rpc GetUser(GetUserRequest) returns (User) { + option (google.api.http) = { + get: "/v1alpha/{name=projects/*/locations/*/clusters/*/users/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Creates a new User in a given project, location, and cluster. + rpc CreateUser(CreateUserRequest) returns (User) { + option (google.api.http) = { + post: "/v1alpha/{parent=projects/*/locations/*/clusters/*}/users" + body: "user" + }; + option (google.api.method_signature) = "parent,user,user_id"; + } + + // Updates the parameters of a single User. + rpc UpdateUser(UpdateUserRequest) returns (User) { + option (google.api.http) = { + patch: "/v1alpha/{user.name=projects/*/locations/*/clusters/*/users/*}" + body: "user" + }; + option (google.api.method_signature) = "user,update_mask"; + } + + // Deletes a single User. + rpc DeleteUser(DeleteUserRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v1alpha/{name=projects/*/locations/*/clusters/*/users/*}" + }; + option (google.api.method_signature) = "name"; + } } // Message for requesting list of Clusters @@ -403,11 +459,15 @@ message GetClusterRequest { (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { type: "alloydb.googleapis.com/Cluster" } ]; + + // Optional. The view of the cluster to return. Returns all default fields if + // not set. + ClusterView view = 2 [(google.api.field_behavior) = OPTIONAL]; } message CreateSecondaryClusterRequest { - // Required. The name of the parent resource (the primary cluster). For the - // required format, see the comment on the Cluster.name field. + // Required. The location of the new cluster. For the required + // format, see the comment on the Cluster.name field. string parent = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { @@ -444,7 +504,7 @@ message CreateSecondaryClusterRequest { // Message for creating a Cluster message CreateClusterRequest { - // Required. The name of the parent resource. For the required format, see the + // Required. The location of the new cluster. For the required format, see the // comment on the Cluster.name field. string parent = 1 [ (google.api.field_behavior) = REQUIRED, @@ -815,6 +875,7 @@ message BatchCreateInstancesResponse { } // Message for metadata that is specific to BatchCreateInstances API. +// NEXT_ID: 3 message BatchCreateInstancesMetadata { // 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 @@ -842,6 +903,7 @@ message BatchCreateInstancesMetadata { // 2. Instance2 = ROLLED_BACK // 3. Instance3 = FAILED // 4. Instance4 = FAILED +// // However, while the operation is running, the instance might be in other // states including PENDING_CREATE, ACTIVE, DELETING and CREATING. The states // / do not get further updated once the operation is done. @@ -1001,6 +1063,51 @@ message FailoverInstanceRequest { bool validate_only = 3 [(google.api.field_behavior) = OPTIONAL]; } +// Message for triggering fault injection on an instance +message InjectFaultRequest { + // FaultType contains all valid types of faults that can be injected to an + // instance. + enum FaultType { + // The fault type is unknown. + FAULT_TYPE_UNSPECIFIED = 0; + + // Stop the VM + STOP_VM = 1; + } + + // Required. The type of fault to be injected in an instance. + FaultType fault_type = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The name of the resource. For the required format, see the + // comment on the Instance.name field. + string name = 2 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "alloydb.googleapis.com/Instance" + } + ]; + + // Optional. An optional request ID to identify requests. Specify a unique + // request ID so that if you must retry your request, the server will know to + // ignore the request if it has already been completed. The server will + // guarantee that for at least 60 minutes after the first request. + // + // For example, consider a situation where you make an initial request and + // the request times out. If you make the request again with the same request + // ID, the server can check if original operation with the same request ID + // was received, and if so, will ignore the second request. This prevents + // clients from accidentally creating duplicate commitments. + // + // The request ID must be a valid UUID with the exception that zero UUID is + // not supported (00000000-0000-0000-0000-000000000000). + string request_id = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If set, performs request validation (e.g. permission checks and + // any other type of validation), but do not actually execute the fault + // injection. + bool validate_only = 4 [(google.api.field_behavior) = OPTIONAL]; +} + message RestartInstanceRequest { // Required. The name of the resource. For the required format, see the // comment on the Instance.name field. @@ -1242,7 +1349,8 @@ message GenerateClientCertificateRequest { string request_id = 2 [(google.api.field_behavior) = OPTIONAL]; // Optional. A pem-encoded X.509 certificate signing request (CSR). - string pem_csr = 3 [(google.api.field_behavior) = OPTIONAL]; + string pem_csr = 3 + [deprecated = true, (google.api.field_behavior) = OPTIONAL]; // Optional. An optional hint to the endpoint to generate the client // certificate with the requested duration. The duration can be from 1 hour to @@ -1251,6 +1359,9 @@ message GenerateClientCertificateRequest { // default duration. google.protobuf.Duration cert_duration = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The public key from the client. + string public_key = 5 [(google.api.field_behavior) = OPTIONAL]; } // Message returned by a GenerateClientCertificate operation. @@ -1262,6 +1373,9 @@ message GenerateClientCertificateResponse { // certificate. Expected to be in issuer-to-root order according to RFC 5246. repeated string pem_certificate_chain = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. The pem-encoded cluster ca X.509 certificate. + string ca_cert = 3 [(google.api.field_behavior) = OPTIONAL]; } // Request message for GetConnectionInfo. @@ -1327,3 +1441,150 @@ message OperationMetadata { // Output only. API version used to start the operation. string api_version = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; } + +// Message for requesting list of Users +message ListUsersRequest { + // Required. Parent value for ListUsersRequest + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "alloydb.googleapis.com/User" + } + ]; + + // Optional. Requested page size. Server may return fewer items than + // requested. If unspecified, server will pick an appropriate default. + int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A token identifying a page of results the server should return. + string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Filtering results + string filter = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Hint for how to order the results + string order_by = 5 [(google.api.field_behavior) = OPTIONAL]; +} + +// Message for response to listing Users +message ListUsersResponse { + // The list of User + repeated User users = 1; + + // A token identifying a page of results the server should return. + string next_page_token = 2; + + // Locations that could not be reached. + repeated string unreachable = 3; +} + +// Message for getting a User +message GetUserRequest { + // Required. The name of the resource. For the required format, see the + // comment on the User.name field. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "alloydb.googleapis.com/User" } + ]; +} + +// Message for creating a User +message CreateUserRequest { + // Required. Value for parent. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "alloydb.googleapis.com/User" + } + ]; + + // Required. ID of the requesting object. + string user_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The resource being created + User user = 3 [(google.api.field_behavior) = REQUIRED]; + + // Optional. An optional request ID to identify requests. Specify a unique + // request ID so that if you must retry your request, the server will know to + // ignore the request if it has already been completed. The server will + // guarantee that for at least 60 minutes since the first request. + // + // For example, consider a situation where you make an initial request and + // the request times out. If you make the request again with the same request + // ID, the server can check if original operation with the same request ID + // was received, and if so, will ignore the second request. This prevents + // clients from accidentally creating duplicate commitments. + // + // The request ID must be a valid UUID with the exception that zero UUID is + // not supported (00000000-0000-0000-0000-000000000000). + string request_id = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If set, the backend validates the request, but doesn't actually + // execute it. + bool validate_only = 5 [(google.api.field_behavior) = OPTIONAL]; +} + +// Message for updating a User +message UpdateUserRequest { + // 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. + google.protobuf.FieldMask update_mask = 1 + [(google.api.field_behavior) = OPTIONAL]; + + // Required. The resource being updated + User user = 2 [(google.api.field_behavior) = REQUIRED]; + + // Optional. An optional request ID to identify requests. Specify a unique + // request ID so that if you must retry your request, the server will know to + // ignore the request if it has already been completed. The server will + // guarantee that for at least 60 minutes since the first request. + // + // For example, consider a situation where you make an initial request and + // the request times out. If you make the request again with the same request + // ID, the server can check if original operation with the same request ID + // was received, and if so, will ignore the second request. This prevents + // clients from accidentally creating duplicate commitments. + // + // The request ID must be a valid UUID with the exception that zero UUID is + // not supported (00000000-0000-0000-0000-000000000000). + string request_id = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If set, the backend validates the request, but doesn't actually + // execute it. + bool validate_only = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Allow missing fields in the update mask. + bool allow_missing = 5 [(google.api.field_behavior) = OPTIONAL]; +} + +// Message for deleting a User +message DeleteUserRequest { + // Required. The name of the resource. For the required format, see the + // comment on the User.name field. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "alloydb.googleapis.com/User" } + ]; + + // Optional. An optional request ID to identify requests. Specify a unique + // request ID so that if you must retry your request, the server will know to + // ignore the request if it has already been completed. The server will + // guarantee that for at least 60 minutes after the first request. + // + // For example, consider a situation where you make an initial request and + // the request times out. If you make the request again with the same request + // ID, the server can check if original operation with the same request ID + // was received, and if so, will ignore the second request. This prevents + // clients from accidentally creating duplicate commitments. + // + // The request ID must be a valid UUID with the exception that zero UUID is + // not supported (00000000-0000-0000-0000-000000000000). + string request_id = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If set, the backend validates the request, but doesn't actually + // execute it. + bool validate_only = 3 [(google.api.field_behavior) = OPTIONAL]; +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/Backup.java b/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/Backup.java index 8dec7be175f4..59f34b796262 100644 --- a/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/Backup.java +++ b/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/Backup.java @@ -1076,7 +1076,7 @@ public com.google.protobuf.ByteString getClusterUidBytes() { * *
    * Required. The full resource name of the backup source cluster
-   * (e.g., projects/<project>/locations/<location>/clusters/<cluster_id>).
+   * (e.g., projects/{project}/locations/{region}/clusters/{cluster_id}).
    * 
* * @@ -1102,7 +1102,7 @@ public java.lang.String getClusterName() { * *
    * Required. The full resource name of the backup source cluster
-   * (e.g., projects/<project>/locations/<location>/clusters/<cluster_id>).
+   * (e.g., projects/{project}/locations/{region}/clusters/{cluster_id}).
    * 
* * @@ -3900,7 +3900,7 @@ public Builder setClusterUidBytes(com.google.protobuf.ByteString value) { * *
      * Required. The full resource name of the backup source cluster
-     * (e.g., projects/<project>/locations/<location>/clusters/<cluster_id>).
+     * (e.g., projects/{project}/locations/{region}/clusters/{cluster_id}).
      * 
* * @@ -3925,7 +3925,7 @@ public java.lang.String getClusterName() { * *
      * Required. The full resource name of the backup source cluster
-     * (e.g., projects/<project>/locations/<location>/clusters/<cluster_id>).
+     * (e.g., projects/{project}/locations/{region}/clusters/{cluster_id}).
      * 
* * @@ -3950,7 +3950,7 @@ public com.google.protobuf.ByteString getClusterNameBytes() { * *
      * Required. The full resource name of the backup source cluster
-     * (e.g., projects/<project>/locations/<location>/clusters/<cluster_id>).
+     * (e.g., projects/{project}/locations/{region}/clusters/{cluster_id}).
      * 
* * @@ -3974,7 +3974,7 @@ public Builder setClusterName(java.lang.String value) { * *
      * Required. The full resource name of the backup source cluster
-     * (e.g., projects/<project>/locations/<location>/clusters/<cluster_id>).
+     * (e.g., projects/{project}/locations/{region}/clusters/{cluster_id}).
      * 
* * @@ -3994,7 +3994,7 @@ public Builder clearClusterName() { * *
      * Required. The full resource name of the backup source cluster
-     * (e.g., projects/<project>/locations/<location>/clusters/<cluster_id>).
+     * (e.g., projects/{project}/locations/{region}/clusters/{cluster_id}).
      * 
* * diff --git a/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/BackupOrBuilder.java b/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/BackupOrBuilder.java index e087f964139b..32417f71e4bf 100644 --- a/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/BackupOrBuilder.java +++ b/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/BackupOrBuilder.java @@ -399,7 +399,7 @@ java.lang.String getLabelsOrDefault( * *
    * Required. The full resource name of the backup source cluster
-   * (e.g., projects/<project>/locations/<location>/clusters/<cluster_id>).
+   * (e.g., projects/{project}/locations/{region}/clusters/{cluster_id}).
    * 
* * @@ -414,7 +414,7 @@ java.lang.String getLabelsOrDefault( * *
    * Required. The full resource name of the backup source cluster
-   * (e.g., projects/<project>/locations/<location>/clusters/<cluster_id>).
+   * (e.g., projects/{project}/locations/{region}/clusters/{cluster_id}).
    * 
* * diff --git a/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/BatchCreateInstanceStatus.java b/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/BatchCreateInstanceStatus.java index 02054e841323..a2206d3c73f2 100644 --- a/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/BatchCreateInstanceStatus.java +++ b/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/BatchCreateInstanceStatus.java @@ -33,6 +33,7 @@ * 2. Instance2 = ROLLED_BACK * 3. Instance3 = FAILED * 4. Instance4 = FAILED + * * However, while the operation is running, the instance might be in other * states including PENDING_CREATE, ACTIVE, DELETING and CREATING. The states * / do not get further updated once the operation is done. @@ -725,6 +726,7 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build * 2. Instance2 = ROLLED_BACK * 3. Instance3 = FAILED * 4. Instance4 = FAILED + * * However, while the operation is running, the instance might be in other * states including PENDING_CREATE, ACTIVE, DELETING and CREATING. The states * / do not get further updated once the operation is done. diff --git a/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/BatchCreateInstancesMetadata.java b/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/BatchCreateInstancesMetadata.java index 067e112bc855..8efed805e02b 100644 --- a/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/BatchCreateInstancesMetadata.java +++ b/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/BatchCreateInstancesMetadata.java @@ -23,6 +23,7 @@ * *
  * Message for metadata that is specific to BatchCreateInstances API.
+ * NEXT_ID: 3
  * 
* * Protobuf type {@code google.cloud.alloydb.v1beta.BatchCreateInstancesMetadata} @@ -487,6 +488,7 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build * *
    * Message for metadata that is specific to BatchCreateInstances API.
+   * NEXT_ID: 3
    * 
* * Protobuf type {@code google.cloud.alloydb.v1beta.BatchCreateInstancesMetadata} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/Cluster.java b/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/Cluster.java index cf67d985c0a5..1c28b46f1584 100644 --- a/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/Cluster.java +++ b/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/Cluster.java @@ -570,6 +570,981 @@ private ClusterType(int value) { // @@protoc_insertion_point(enum_scope:google.cloud.alloydb.v1beta.Cluster.ClusterType) } + public interface NetworkConfigOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.alloydb.v1beta.Cluster.NetworkConfig) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * 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. It can be updated, but it cannot be
+     * removed.
+     * 
+ * + * + * string network = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The network. + */ + java.lang.String getNetwork(); + /** + * + * + *
+     * 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. It can be updated, but it cannot be
+     * removed.
+     * 
+ * + * + * string network = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for network. + */ + com.google.protobuf.ByteString getNetworkBytes(); + + /** + * + * + *
+     * Optional. The 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.
+     * 
+ * + * string allocated_ip_range = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The allocatedIpRange. + */ + java.lang.String getAllocatedIpRange(); + /** + * + * + *
+     * Optional. The 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.
+     * 
+ * + * string allocated_ip_range = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for allocatedIpRange. + */ + com.google.protobuf.ByteString getAllocatedIpRangeBytes(); + } + /** + * + * + *
+   * Metadata related to network configuration.
+   * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1beta.Cluster.NetworkConfig} + */ + public static final class NetworkConfig extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.alloydb.v1beta.Cluster.NetworkConfig) + NetworkConfigOrBuilder { + private static final long serialVersionUID = 0L; + // Use NetworkConfig.newBuilder() to construct. + private NetworkConfig(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private NetworkConfig() { + network_ = ""; + allocatedIpRange_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new NetworkConfig(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.alloydb.v1beta.ResourcesProto + .internal_static_google_cloud_alloydb_v1beta_Cluster_NetworkConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1beta.ResourcesProto + .internal_static_google_cloud_alloydb_v1beta_Cluster_NetworkConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1beta.Cluster.NetworkConfig.class, + com.google.cloud.alloydb.v1beta.Cluster.NetworkConfig.Builder.class); + } + + public static final int NETWORK_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object 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. It can be updated, but it cannot be
+     * removed.
+     * 
+ * + * + * string network = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The network. + */ + @java.lang.Override + public java.lang.String getNetwork() { + java.lang.Object ref = network_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + network_ = s; + return s; + } + } + /** + * + * + *
+     * 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. It can be updated, but it cannot be
+     * removed.
+     * 
+ * + * + * string network = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for network. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNetworkBytes() { + java.lang.Object ref = network_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + network_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ALLOCATED_IP_RANGE_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object allocatedIpRange_ = ""; + /** + * + * + *
+     * Optional. The 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.
+     * 
+ * + * string allocated_ip_range = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The allocatedIpRange. + */ + @java.lang.Override + public java.lang.String getAllocatedIpRange() { + java.lang.Object ref = allocatedIpRange_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + allocatedIpRange_ = s; + return s; + } + } + /** + * + * + *
+     * Optional. The 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.
+     * 
+ * + * string allocated_ip_range = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for allocatedIpRange. + */ + @java.lang.Override + public com.google.protobuf.ByteString getAllocatedIpRangeBytes() { + java.lang.Object ref = allocatedIpRange_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + allocatedIpRange_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(network_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, network_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(allocatedIpRange_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, allocatedIpRange_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(network_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, network_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(allocatedIpRange_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, allocatedIpRange_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.alloydb.v1beta.Cluster.NetworkConfig)) { + return super.equals(obj); + } + com.google.cloud.alloydb.v1beta.Cluster.NetworkConfig other = + (com.google.cloud.alloydb.v1beta.Cluster.NetworkConfig) obj; + + if (!getNetwork().equals(other.getNetwork())) return false; + if (!getAllocatedIpRange().equals(other.getAllocatedIpRange())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NETWORK_FIELD_NUMBER; + hash = (53 * hash) + getNetwork().hashCode(); + hash = (37 * hash) + ALLOCATED_IP_RANGE_FIELD_NUMBER; + hash = (53 * hash) + getAllocatedIpRange().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.alloydb.v1beta.Cluster.NetworkConfig parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1beta.Cluster.NetworkConfig parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.alloydb.v1beta.Cluster.NetworkConfig parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1beta.Cluster.NetworkConfig parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.alloydb.v1beta.Cluster.NetworkConfig parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1beta.Cluster.NetworkConfig parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.alloydb.v1beta.Cluster.NetworkConfig parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1beta.Cluster.NetworkConfig parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.alloydb.v1beta.Cluster.NetworkConfig parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1beta.Cluster.NetworkConfig parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.alloydb.v1beta.Cluster.NetworkConfig parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1beta.Cluster.NetworkConfig parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.alloydb.v1beta.Cluster.NetworkConfig prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+     * Metadata related to network configuration.
+     * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1beta.Cluster.NetworkConfig} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.alloydb.v1beta.Cluster.NetworkConfig) + com.google.cloud.alloydb.v1beta.Cluster.NetworkConfigOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.alloydb.v1beta.ResourcesProto + .internal_static_google_cloud_alloydb_v1beta_Cluster_NetworkConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1beta.ResourcesProto + .internal_static_google_cloud_alloydb_v1beta_Cluster_NetworkConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1beta.Cluster.NetworkConfig.class, + com.google.cloud.alloydb.v1beta.Cluster.NetworkConfig.Builder.class); + } + + // Construct using com.google.cloud.alloydb.v1beta.Cluster.NetworkConfig.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + network_ = ""; + allocatedIpRange_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.alloydb.v1beta.ResourcesProto + .internal_static_google_cloud_alloydb_v1beta_Cluster_NetworkConfig_descriptor; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1beta.Cluster.NetworkConfig getDefaultInstanceForType() { + return com.google.cloud.alloydb.v1beta.Cluster.NetworkConfig.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.alloydb.v1beta.Cluster.NetworkConfig build() { + com.google.cloud.alloydb.v1beta.Cluster.NetworkConfig result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1beta.Cluster.NetworkConfig buildPartial() { + com.google.cloud.alloydb.v1beta.Cluster.NetworkConfig result = + new com.google.cloud.alloydb.v1beta.Cluster.NetworkConfig(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.alloydb.v1beta.Cluster.NetworkConfig result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.network_ = network_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.allocatedIpRange_ = allocatedIpRange_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, + java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.alloydb.v1beta.Cluster.NetworkConfig) { + return mergeFrom((com.google.cloud.alloydb.v1beta.Cluster.NetworkConfig) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.alloydb.v1beta.Cluster.NetworkConfig other) { + if (other == com.google.cloud.alloydb.v1beta.Cluster.NetworkConfig.getDefaultInstance()) + return this; + if (!other.getNetwork().isEmpty()) { + network_ = other.network_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getAllocatedIpRange().isEmpty()) { + allocatedIpRange_ = other.allocatedIpRange_; + bitField0_ |= 0x00000002; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + network_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + allocatedIpRange_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object 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. It can be updated, but it cannot be
+       * removed.
+       * 
+ * + * + * string network = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The network. + */ + public java.lang.String getNetwork() { + java.lang.Object ref = network_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + network_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+       * 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. It can be updated, but it cannot be
+       * removed.
+       * 
+ * + * + * string network = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for network. + */ + public com.google.protobuf.ByteString getNetworkBytes() { + java.lang.Object ref = network_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + network_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+       * 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. It can be updated, but it cannot be
+       * removed.
+       * 
+ * + * + * string network = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The network to set. + * @return This builder for chaining. + */ + public Builder setNetwork(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + network_ = value; + bitField0_ |= 0x00000001; + onChanged(); + 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_number}/global/networks/{network_id}". This is
+       * required to create a cluster. It can be updated, but it cannot be
+       * removed.
+       * 
+ * + * + * string network = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearNetwork() { + network_ = getDefaultInstance().getNetwork(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + 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_number}/global/networks/{network_id}". This is
+       * required to create a cluster. It can be updated, but it cannot be
+       * removed.
+       * 
+ * + * + * string network = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for network to set. + * @return This builder for chaining. + */ + public Builder setNetworkBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + network_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object allocatedIpRange_ = ""; + /** + * + * + *
+       * Optional. The 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.
+       * 
+ * + * string allocated_ip_range = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The allocatedIpRange. + */ + public java.lang.String getAllocatedIpRange() { + java.lang.Object ref = allocatedIpRange_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + allocatedIpRange_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+       * Optional. The 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.
+       * 
+ * + * string allocated_ip_range = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for allocatedIpRange. + */ + public com.google.protobuf.ByteString getAllocatedIpRangeBytes() { + java.lang.Object ref = allocatedIpRange_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + allocatedIpRange_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+       * Optional. The 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.
+       * 
+ * + * string allocated_ip_range = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The allocatedIpRange to set. + * @return This builder for chaining. + */ + public Builder setAllocatedIpRange(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + allocatedIpRange_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+       * Optional. The 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.
+       * 
+ * + * string allocated_ip_range = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearAllocatedIpRange() { + allocatedIpRange_ = getDefaultInstance().getAllocatedIpRange(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+       * Optional. The 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.
+       * 
+ * + * string allocated_ip_range = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for allocatedIpRange to set. + * @return This builder for chaining. + */ + public Builder setAllocatedIpRangeBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + allocatedIpRange_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.alloydb.v1beta.Cluster.NetworkConfig) + } + + // @@protoc_insertion_point(class_scope:google.cloud.alloydb.v1beta.Cluster.NetworkConfig) + private static final com.google.cloud.alloydb.v1beta.Cluster.NetworkConfig DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.alloydb.v1beta.Cluster.NetworkConfig(); + } + + public static com.google.cloud.alloydb.v1beta.Cluster.NetworkConfig getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public NetworkConfig parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1beta.Cluster.NetworkConfig getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + public interface SecondaryConfigOrBuilder extends // @@protoc_insertion_point(interface_extends:google.cloud.alloydb.v1beta.Cluster.SecondaryConfig) @@ -2750,6 +3725,45 @@ public com.google.cloud.alloydb.v1beta.DatabaseVersion getDatabaseVersion() { return result == null ? com.google.cloud.alloydb.v1beta.DatabaseVersion.UNRECOGNIZED : result; } + public static final int NETWORK_CONFIG_FIELD_NUMBER = 29; + private com.google.cloud.alloydb.v1beta.Cluster.NetworkConfig networkConfig_; + /** + * + * .google.cloud.alloydb.v1beta.Cluster.NetworkConfig network_config = 29 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the networkConfig field is set. + */ + @java.lang.Override + public boolean hasNetworkConfig() { + return networkConfig_ != null; + } + /** + * + * .google.cloud.alloydb.v1beta.Cluster.NetworkConfig network_config = 29 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The networkConfig. + */ + @java.lang.Override + public com.google.cloud.alloydb.v1beta.Cluster.NetworkConfig getNetworkConfig() { + return networkConfig_ == null + ? com.google.cloud.alloydb.v1beta.Cluster.NetworkConfig.getDefaultInstance() + : networkConfig_; + } + /** + * + * .google.cloud.alloydb.v1beta.Cluster.NetworkConfig network_config = 29 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.cloud.alloydb.v1beta.Cluster.NetworkConfigOrBuilder + getNetworkConfigOrBuilder() { + return networkConfig_ == null + ? com.google.cloud.alloydb.v1beta.Cluster.NetworkConfig.getDefaultInstance() + : networkConfig_; + } + public static final int NETWORK_FIELD_NUMBER = 10; @SuppressWarnings("serial") @@ -3131,14 +4145,17 @@ public com.google.cloud.alloydb.v1beta.AutomatedBackupPolicy getAutomatedBackupP * * *
-   * SSL configuration for this AlloyDB Cluster.
+   * SSL configuration for this AlloyDB cluster.
    * 
* - * .google.cloud.alloydb.v1beta.SslConfig ssl_config = 18; + * .google.cloud.alloydb.v1beta.SslConfig ssl_config = 18 [deprecated = true]; * + * @deprecated google.cloud.alloydb.v1beta.Cluster.ssl_config is deprecated. See + * google/cloud/alloydb/v1beta/resources.proto;l=578 * @return Whether the sslConfig field is set. */ @java.lang.Override + @java.lang.Deprecated public boolean hasSslConfig() { return sslConfig_ != null; } @@ -3146,14 +4163,17 @@ public boolean hasSslConfig() { * * *
-   * SSL configuration for this AlloyDB Cluster.
+   * SSL configuration for this AlloyDB cluster.
    * 
* - * .google.cloud.alloydb.v1beta.SslConfig ssl_config = 18; + * .google.cloud.alloydb.v1beta.SslConfig ssl_config = 18 [deprecated = true]; * + * @deprecated google.cloud.alloydb.v1beta.Cluster.ssl_config is deprecated. See + * google/cloud/alloydb/v1beta/resources.proto;l=578 * @return The sslConfig. */ @java.lang.Override + @java.lang.Deprecated public com.google.cloud.alloydb.v1beta.SslConfig getSslConfig() { return sslConfig_ == null ? com.google.cloud.alloydb.v1beta.SslConfig.getDefaultInstance() @@ -3163,12 +4183,13 @@ public com.google.cloud.alloydb.v1beta.SslConfig getSslConfig() { * * *
-   * SSL configuration for this AlloyDB Cluster.
+   * SSL configuration for this AlloyDB cluster.
    * 
* - * .google.cloud.alloydb.v1beta.SslConfig ssl_config = 18; + * .google.cloud.alloydb.v1beta.SslConfig ssl_config = 18 [deprecated = true]; */ @java.lang.Override + @java.lang.Deprecated public com.google.cloud.alloydb.v1beta.SslConfigOrBuilder getSslConfigOrBuilder() { return sslConfig_ == null ? com.google.cloud.alloydb.v1beta.SslConfig.getDefaultInstance() @@ -3612,6 +4633,9 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (continuousBackupInfo_ != null) { output.writeMessage(28, getContinuousBackupInfo()); } + if (networkConfig_ != null) { + output.writeMessage(29, getNetworkConfig()); + } getUnknownFields().writeTo(output); } @@ -3721,6 +4745,9 @@ public int getSerializedSize() { size += com.google.protobuf.CodedOutputStream.computeMessageSize(28, getContinuousBackupInfo()); } + if (networkConfig_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(29, getNetworkConfig()); + } size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; @@ -3755,6 +4782,10 @@ public boolean equals(final java.lang.Object obj) { if (state_ != other.state_) return false; if (clusterType_ != other.clusterType_) return false; if (databaseVersion_ != other.databaseVersion_) return false; + if (hasNetworkConfig() != other.hasNetworkConfig()) return false; + if (hasNetworkConfig()) { + if (!getNetworkConfig().equals(other.getNetworkConfig())) return false; + } if (!getNetwork().equals(other.getNetwork())) return false; if (!getEtag().equals(other.getEtag())) return false; if (!internalGetAnnotations().equals(other.internalGetAnnotations())) return false; @@ -3845,6 +4876,10 @@ public int hashCode() { hash = (53 * hash) + clusterType_; hash = (37 * hash) + DATABASE_VERSION_FIELD_NUMBER; hash = (53 * hash) + databaseVersion_; + if (hasNetworkConfig()) { + hash = (37 * hash) + NETWORK_CONFIG_FIELD_NUMBER; + hash = (53 * hash) + getNetworkConfig().hashCode(); + } hash = (37 * hash) + NETWORK_FIELD_NUMBER; hash = (53 * hash) + getNetwork().hashCode(); hash = (37 * hash) + ETAG_FIELD_NUMBER; @@ -4096,6 +5131,11 @@ public Builder clear() { state_ = 0; clusterType_ = 0; databaseVersion_ = 0; + networkConfig_ = null; + if (networkConfigBuilder_ != null) { + networkConfigBuilder_.dispose(); + networkConfigBuilder_ = null; + } network_ = ""; etag_ = ""; internalGetMutableAnnotations().clear(); @@ -4216,56 +5256,60 @@ private void buildPartial0(com.google.cloud.alloydb.v1beta.Cluster result) { result.databaseVersion_ = databaseVersion_; } if (((from_bitField0_ & 0x00001000) != 0)) { - result.network_ = network_; + result.networkConfig_ = + networkConfigBuilder_ == null ? networkConfig_ : networkConfigBuilder_.build(); } if (((from_bitField0_ & 0x00002000) != 0)) { - result.etag_ = etag_; + result.network_ = network_; } if (((from_bitField0_ & 0x00004000) != 0)) { + result.etag_ = etag_; + } + if (((from_bitField0_ & 0x00008000) != 0)) { result.annotations_ = internalGetAnnotations(); result.annotations_.makeImmutable(); } - if (((from_bitField0_ & 0x00008000) != 0)) { + if (((from_bitField0_ & 0x00010000) != 0)) { result.reconciling_ = reconciling_; } - if (((from_bitField0_ & 0x00010000) != 0)) { + if (((from_bitField0_ & 0x00020000) != 0)) { result.initialUser_ = initialUserBuilder_ == null ? initialUser_ : initialUserBuilder_.build(); } - if (((from_bitField0_ & 0x00020000) != 0)) { + if (((from_bitField0_ & 0x00040000) != 0)) { result.automatedBackupPolicy_ = automatedBackupPolicyBuilder_ == null ? automatedBackupPolicy_ : automatedBackupPolicyBuilder_.build(); } - if (((from_bitField0_ & 0x00040000) != 0)) { + if (((from_bitField0_ & 0x00080000) != 0)) { result.sslConfig_ = sslConfigBuilder_ == null ? sslConfig_ : sslConfigBuilder_.build(); } - if (((from_bitField0_ & 0x00080000) != 0)) { + if (((from_bitField0_ & 0x00100000) != 0)) { result.encryptionConfig_ = encryptionConfigBuilder_ == null ? encryptionConfig_ : encryptionConfigBuilder_.build(); } - if (((from_bitField0_ & 0x00100000) != 0)) { + if (((from_bitField0_ & 0x00200000) != 0)) { result.encryptionInfo_ = encryptionInfoBuilder_ == null ? encryptionInfo_ : encryptionInfoBuilder_.build(); } - if (((from_bitField0_ & 0x00200000) != 0)) { + if (((from_bitField0_ & 0x00400000) != 0)) { result.continuousBackupConfig_ = continuousBackupConfigBuilder_ == null ? continuousBackupConfig_ : continuousBackupConfigBuilder_.build(); } - if (((from_bitField0_ & 0x00400000) != 0)) { + if (((from_bitField0_ & 0x00800000) != 0)) { result.continuousBackupInfo_ = continuousBackupInfoBuilder_ == null ? continuousBackupInfo_ : continuousBackupInfoBuilder_.build(); } - if (((from_bitField0_ & 0x00800000) != 0)) { + if (((from_bitField0_ & 0x01000000) != 0)) { result.secondaryConfig_ = secondaryConfigBuilder_ == null ? secondaryConfig_ : secondaryConfigBuilder_.build(); } - if (((from_bitField0_ & 0x01000000) != 0)) { + if (((from_bitField0_ & 0x02000000) != 0)) { result.primaryConfig_ = primaryConfigBuilder_ == null ? primaryConfig_ : primaryConfigBuilder_.build(); } @@ -4362,18 +5406,21 @@ public Builder mergeFrom(com.google.cloud.alloydb.v1beta.Cluster other) { if (other.databaseVersion_ != 0) { setDatabaseVersionValue(other.getDatabaseVersionValue()); } + if (other.hasNetworkConfig()) { + mergeNetworkConfig(other.getNetworkConfig()); + } if (!other.getNetwork().isEmpty()) { network_ = other.network_; - bitField0_ |= 0x00001000; + bitField0_ |= 0x00002000; onChanged(); } if (!other.getEtag().isEmpty()) { etag_ = other.etag_; - bitField0_ |= 0x00002000; + bitField0_ |= 0x00004000; onChanged(); } internalGetMutableAnnotations().mergeFrom(other.internalGetAnnotations()); - bitField0_ |= 0x00004000; + bitField0_ |= 0x00008000; if (other.getReconciling() != false) { setReconciling(other.getReconciling()); } @@ -4509,13 +5556,13 @@ public Builder mergeFrom( case 82: { network_ = input.readStringRequireUtf8(); - bitField0_ |= 0x00001000; + bitField0_ |= 0x00002000; break; } // case 82 case 90: { etag_ = input.readStringRequireUtf8(); - bitField0_ |= 0x00002000; + bitField0_ |= 0x00004000; break; } // case 90 case 98: @@ -4527,19 +5574,19 @@ public Builder mergeFrom( internalGetMutableAnnotations() .getMutableMap() .put(annotations__.getKey(), annotations__.getValue()); - bitField0_ |= 0x00004000; + bitField0_ |= 0x00008000; break; } // case 98 case 104: { reconciling_ = input.readBool(); - bitField0_ |= 0x00008000; + bitField0_ |= 0x00010000; break; } // case 104 case 114: { input.readMessage(getInitialUserFieldBuilder().getBuilder(), extensionRegistry); - bitField0_ |= 0x00010000; + bitField0_ |= 0x00020000; break; } // case 114 case 122: @@ -4558,38 +5605,38 @@ public Builder mergeFrom( { input.readMessage( getAutomatedBackupPolicyFieldBuilder().getBuilder(), extensionRegistry); - bitField0_ |= 0x00020000; + bitField0_ |= 0x00040000; break; } // case 138 case 146: { input.readMessage(getSslConfigFieldBuilder().getBuilder(), extensionRegistry); - bitField0_ |= 0x00040000; + bitField0_ |= 0x00080000; break; } // case 146 case 154: { input.readMessage( getEncryptionConfigFieldBuilder().getBuilder(), extensionRegistry); - bitField0_ |= 0x00080000; + bitField0_ |= 0x00100000; break; } // case 154 case 162: { input.readMessage(getEncryptionInfoFieldBuilder().getBuilder(), extensionRegistry); - bitField0_ |= 0x00100000; + bitField0_ |= 0x00200000; break; } // case 162 case 178: { input.readMessage(getSecondaryConfigFieldBuilder().getBuilder(), extensionRegistry); - bitField0_ |= 0x00800000; + bitField0_ |= 0x01000000; break; } // case 178 case 186: { input.readMessage(getPrimaryConfigFieldBuilder().getBuilder(), extensionRegistry); - bitField0_ |= 0x01000000; + bitField0_ |= 0x02000000; break; } // case 186 case 192: @@ -4602,16 +5649,22 @@ public Builder mergeFrom( { input.readMessage( getContinuousBackupConfigFieldBuilder().getBuilder(), extensionRegistry); - bitField0_ |= 0x00200000; + bitField0_ |= 0x00400000; break; } // case 218 case 226: { input.readMessage( getContinuousBackupInfoFieldBuilder().getBuilder(), extensionRegistry); - bitField0_ |= 0x00400000; + bitField0_ |= 0x00800000; break; } // case 226 + case 234: + { + input.readMessage(getNetworkConfigFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00001000; + break; + } // case 234 default: { if (!super.parseUnknownField(input, extensionRegistry, tag)) { @@ -6540,6 +7593,156 @@ public Builder clearDatabaseVersion() { return this; } + private com.google.cloud.alloydb.v1beta.Cluster.NetworkConfig networkConfig_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1beta.Cluster.NetworkConfig, + com.google.cloud.alloydb.v1beta.Cluster.NetworkConfig.Builder, + com.google.cloud.alloydb.v1beta.Cluster.NetworkConfigOrBuilder> + networkConfigBuilder_; + /** + * + * .google.cloud.alloydb.v1beta.Cluster.NetworkConfig network_config = 29 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the networkConfig field is set. + */ + public boolean hasNetworkConfig() { + return ((bitField0_ & 0x00001000) != 0); + } + /** + * + * .google.cloud.alloydb.v1beta.Cluster.NetworkConfig network_config = 29 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The networkConfig. + */ + public com.google.cloud.alloydb.v1beta.Cluster.NetworkConfig getNetworkConfig() { + if (networkConfigBuilder_ == null) { + return networkConfig_ == null + ? com.google.cloud.alloydb.v1beta.Cluster.NetworkConfig.getDefaultInstance() + : networkConfig_; + } else { + return networkConfigBuilder_.getMessage(); + } + } + /** + * + * .google.cloud.alloydb.v1beta.Cluster.NetworkConfig network_config = 29 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setNetworkConfig(com.google.cloud.alloydb.v1beta.Cluster.NetworkConfig value) { + if (networkConfigBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + networkConfig_ = value; + } else { + networkConfigBuilder_.setMessage(value); + } + bitField0_ |= 0x00001000; + onChanged(); + return this; + } + /** + * + * .google.cloud.alloydb.v1beta.Cluster.NetworkConfig network_config = 29 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setNetworkConfig( + com.google.cloud.alloydb.v1beta.Cluster.NetworkConfig.Builder builderForValue) { + if (networkConfigBuilder_ == null) { + networkConfig_ = builderForValue.build(); + } else { + networkConfigBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00001000; + onChanged(); + return this; + } + /** + * + * .google.cloud.alloydb.v1beta.Cluster.NetworkConfig network_config = 29 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder mergeNetworkConfig(com.google.cloud.alloydb.v1beta.Cluster.NetworkConfig value) { + if (networkConfigBuilder_ == null) { + if (((bitField0_ & 0x00001000) != 0) + && networkConfig_ != null + && networkConfig_ + != com.google.cloud.alloydb.v1beta.Cluster.NetworkConfig.getDefaultInstance()) { + getNetworkConfigBuilder().mergeFrom(value); + } else { + networkConfig_ = value; + } + } else { + networkConfigBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00001000; + onChanged(); + return this; + } + /** + * + * .google.cloud.alloydb.v1beta.Cluster.NetworkConfig network_config = 29 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder clearNetworkConfig() { + bitField0_ = (bitField0_ & ~0x00001000); + networkConfig_ = null; + if (networkConfigBuilder_ != null) { + networkConfigBuilder_.dispose(); + networkConfigBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * .google.cloud.alloydb.v1beta.Cluster.NetworkConfig network_config = 29 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.alloydb.v1beta.Cluster.NetworkConfig.Builder getNetworkConfigBuilder() { + bitField0_ |= 0x00001000; + onChanged(); + return getNetworkConfigFieldBuilder().getBuilder(); + } + /** + * + * .google.cloud.alloydb.v1beta.Cluster.NetworkConfig network_config = 29 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.alloydb.v1beta.Cluster.NetworkConfigOrBuilder + getNetworkConfigOrBuilder() { + if (networkConfigBuilder_ != null) { + return networkConfigBuilder_.getMessageOrBuilder(); + } else { + return networkConfig_ == null + ? com.google.cloud.alloydb.v1beta.Cluster.NetworkConfig.getDefaultInstance() + : networkConfig_; + } + } + /** + * + * .google.cloud.alloydb.v1beta.Cluster.NetworkConfig network_config = 29 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1beta.Cluster.NetworkConfig, + com.google.cloud.alloydb.v1beta.Cluster.NetworkConfig.Builder, + com.google.cloud.alloydb.v1beta.Cluster.NetworkConfigOrBuilder> + getNetworkConfigFieldBuilder() { + if (networkConfigBuilder_ == null) { + networkConfigBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1beta.Cluster.NetworkConfig, + com.google.cloud.alloydb.v1beta.Cluster.NetworkConfig.Builder, + com.google.cloud.alloydb.v1beta.Cluster.NetworkConfigOrBuilder>( + getNetworkConfig(), getParentForChildren(), isClean()); + networkConfig_ = null; + } + return networkConfigBuilder_; + } + private java.lang.Object network_ = ""; /** * @@ -6620,7 +7823,7 @@ public Builder setNetwork(java.lang.String value) { throw new NullPointerException(); } network_ = value; - bitField0_ |= 0x00001000; + bitField0_ |= 0x00002000; onChanged(); return this; } @@ -6643,7 +7846,7 @@ public Builder setNetwork(java.lang.String value) { */ public Builder clearNetwork() { network_ = getDefaultInstance().getNetwork(); - bitField0_ = (bitField0_ & ~0x00001000); + bitField0_ = (bitField0_ & ~0x00002000); onChanged(); return this; } @@ -6671,7 +7874,7 @@ public Builder setNetworkBytes(com.google.protobuf.ByteString value) { } checkByteStringIsUtf8(value); network_ = value; - bitField0_ |= 0x00001000; + bitField0_ |= 0x00002000; onChanged(); return this; } @@ -6738,7 +7941,7 @@ public Builder setEtag(java.lang.String value) { throw new NullPointerException(); } etag_ = value; - bitField0_ |= 0x00002000; + bitField0_ |= 0x00004000; onChanged(); return this; } @@ -6755,7 +7958,7 @@ public Builder setEtag(java.lang.String value) { */ public Builder clearEtag() { etag_ = getDefaultInstance().getEtag(); - bitField0_ = (bitField0_ & ~0x00002000); + bitField0_ = (bitField0_ & ~0x00004000); onChanged(); return this; } @@ -6777,7 +7980,7 @@ public Builder setEtagBytes(com.google.protobuf.ByteString value) { } checkByteStringIsUtf8(value); etag_ = value; - bitField0_ |= 0x00002000; + bitField0_ |= 0x00004000; onChanged(); return this; } @@ -6802,7 +8005,7 @@ public Builder setEtagBytes(com.google.protobuf.ByteString value) { if (!annotations_.isMutable()) { annotations_ = annotations_.copy(); } - bitField0_ |= 0x00004000; + bitField0_ |= 0x00008000; onChanged(); return annotations_; } @@ -6895,7 +8098,7 @@ public java.lang.String getAnnotationsOrThrow(java.lang.String key) { } public Builder clearAnnotations() { - bitField0_ = (bitField0_ & ~0x00004000); + bitField0_ = (bitField0_ & ~0x00008000); internalGetMutableAnnotations().getMutableMap().clear(); return this; } @@ -6920,7 +8123,7 @@ public Builder removeAnnotations(java.lang.String key) { /** Use alternate mutation accessors instead. */ @java.lang.Deprecated public java.util.Map getMutableAnnotations() { - bitField0_ |= 0x00004000; + bitField0_ |= 0x00008000; return internalGetMutableAnnotations().getMutableMap(); } /** @@ -6942,7 +8145,7 @@ public Builder putAnnotations(java.lang.String key, java.lang.String value) { throw new NullPointerException("map value"); } internalGetMutableAnnotations().getMutableMap().put(key, value); - bitField0_ |= 0x00004000; + bitField0_ |= 0x00008000; return this; } /** @@ -6958,7 +8161,7 @@ public Builder putAnnotations(java.lang.String key, java.lang.String value) { */ public Builder putAllAnnotations(java.util.Map values) { internalGetMutableAnnotations().getMutableMap().putAll(values); - bitField0_ |= 0x00004000; + bitField0_ |= 0x00008000; return this; } @@ -7001,7 +8204,7 @@ public boolean getReconciling() { public Builder setReconciling(boolean value) { reconciling_ = value; - bitField0_ |= 0x00008000; + bitField0_ |= 0x00010000; onChanged(); return this; } @@ -7021,7 +8224,7 @@ public Builder setReconciling(boolean value) { * @return This builder for chaining. */ public Builder clearReconciling() { - bitField0_ = (bitField0_ & ~0x00008000); + bitField0_ = (bitField0_ & ~0x00010000); reconciling_ = false; onChanged(); return this; @@ -7048,7 +8251,7 @@ public Builder clearReconciling() { * @return Whether the initialUser field is set. */ public boolean hasInitialUser() { - return ((bitField0_ & 0x00010000) != 0); + return ((bitField0_ & 0x00020000) != 0); } /** * @@ -7094,7 +8297,7 @@ public Builder setInitialUser(com.google.cloud.alloydb.v1beta.UserPassword value } else { initialUserBuilder_.setMessage(value); } - bitField0_ |= 0x00010000; + bitField0_ |= 0x00020000; onChanged(); return this; } @@ -7117,7 +8320,7 @@ public Builder setInitialUser( } else { initialUserBuilder_.setMessage(builderForValue.build()); } - bitField0_ |= 0x00010000; + bitField0_ |= 0x00020000; onChanged(); return this; } @@ -7135,7 +8338,7 @@ public Builder setInitialUser( */ public Builder mergeInitialUser(com.google.cloud.alloydb.v1beta.UserPassword value) { if (initialUserBuilder_ == null) { - if (((bitField0_ & 0x00010000) != 0) + if (((bitField0_ & 0x00020000) != 0) && initialUser_ != null && initialUser_ != com.google.cloud.alloydb.v1beta.UserPassword.getDefaultInstance()) { getInitialUserBuilder().mergeFrom(value); @@ -7145,7 +8348,7 @@ public Builder mergeInitialUser(com.google.cloud.alloydb.v1beta.UserPassword val } else { initialUserBuilder_.mergeFrom(value); } - bitField0_ |= 0x00010000; + bitField0_ |= 0x00020000; onChanged(); return this; } @@ -7162,7 +8365,7 @@ public Builder mergeInitialUser(com.google.cloud.alloydb.v1beta.UserPassword val *
*/ public Builder clearInitialUser() { - bitField0_ = (bitField0_ & ~0x00010000); + bitField0_ = (bitField0_ & ~0x00020000); initialUser_ = null; if (initialUserBuilder_ != null) { initialUserBuilder_.dispose(); @@ -7184,7 +8387,7 @@ public Builder clearInitialUser() { *
*/ public com.google.cloud.alloydb.v1beta.UserPassword.Builder getInitialUserBuilder() { - bitField0_ |= 0x00010000; + bitField0_ |= 0x00020000; onChanged(); return getInitialUserFieldBuilder().getBuilder(); } @@ -7262,7 +8465,7 @@ public com.google.cloud.alloydb.v1beta.UserPasswordOrBuilder getInitialUserOrBui * @return Whether the automatedBackupPolicy field is set. */ public boolean hasAutomatedBackupPolicy() { - return ((bitField0_ & 0x00020000) != 0); + return ((bitField0_ & 0x00040000) != 0); } /** * @@ -7315,7 +8518,7 @@ public Builder setAutomatedBackupPolicy( } else { automatedBackupPolicyBuilder_.setMessage(value); } - bitField0_ |= 0x00020000; + bitField0_ |= 0x00040000; onChanged(); return this; } @@ -7341,7 +8544,7 @@ public Builder setAutomatedBackupPolicy( } else { automatedBackupPolicyBuilder_.setMessage(builderForValue.build()); } - bitField0_ |= 0x00020000; + bitField0_ |= 0x00040000; onChanged(); return this; } @@ -7363,7 +8566,7 @@ public Builder setAutomatedBackupPolicy( public Builder mergeAutomatedBackupPolicy( com.google.cloud.alloydb.v1beta.AutomatedBackupPolicy value) { if (automatedBackupPolicyBuilder_ == null) { - if (((bitField0_ & 0x00020000) != 0) + if (((bitField0_ & 0x00040000) != 0) && automatedBackupPolicy_ != null && automatedBackupPolicy_ != com.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.getDefaultInstance()) { @@ -7374,7 +8577,7 @@ public Builder mergeAutomatedBackupPolicy( } else { automatedBackupPolicyBuilder_.mergeFrom(value); } - bitField0_ |= 0x00020000; + bitField0_ |= 0x00040000; onChanged(); return this; } @@ -7394,7 +8597,7 @@ public Builder mergeAutomatedBackupPolicy( * .google.cloud.alloydb.v1beta.AutomatedBackupPolicy automated_backup_policy = 17; */ public Builder clearAutomatedBackupPolicy() { - bitField0_ = (bitField0_ & ~0x00020000); + bitField0_ = (bitField0_ & ~0x00040000); automatedBackupPolicy_ = null; if (automatedBackupPolicyBuilder_ != null) { automatedBackupPolicyBuilder_.dispose(); @@ -7420,7 +8623,7 @@ public Builder clearAutomatedBackupPolicy() { */ public com.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.Builder getAutomatedBackupPolicyBuilder() { - bitField0_ |= 0x00020000; + bitField0_ |= 0x00040000; onChanged(); return getAutomatedBackupPolicyFieldBuilder().getBuilder(); } @@ -7491,27 +8694,33 @@ public Builder clearAutomatedBackupPolicy() { * * *
-     * SSL configuration for this AlloyDB Cluster.
+     * SSL configuration for this AlloyDB cluster.
      * 
* - * .google.cloud.alloydb.v1beta.SslConfig ssl_config = 18; + * .google.cloud.alloydb.v1beta.SslConfig ssl_config = 18 [deprecated = true]; * + * @deprecated google.cloud.alloydb.v1beta.Cluster.ssl_config is deprecated. See + * google/cloud/alloydb/v1beta/resources.proto;l=578 * @return Whether the sslConfig field is set. */ + @java.lang.Deprecated public boolean hasSslConfig() { - return ((bitField0_ & 0x00040000) != 0); + return ((bitField0_ & 0x00080000) != 0); } /** * * *
-     * SSL configuration for this AlloyDB Cluster.
+     * SSL configuration for this AlloyDB cluster.
      * 
* - * .google.cloud.alloydb.v1beta.SslConfig ssl_config = 18; + * .google.cloud.alloydb.v1beta.SslConfig ssl_config = 18 [deprecated = true]; * + * @deprecated google.cloud.alloydb.v1beta.Cluster.ssl_config is deprecated. See + * google/cloud/alloydb/v1beta/resources.proto;l=578 * @return The sslConfig. */ + @java.lang.Deprecated public com.google.cloud.alloydb.v1beta.SslConfig getSslConfig() { if (sslConfigBuilder_ == null) { return sslConfig_ == null @@ -7525,11 +8734,12 @@ public com.google.cloud.alloydb.v1beta.SslConfig getSslConfig() { * * *
-     * SSL configuration for this AlloyDB Cluster.
+     * SSL configuration for this AlloyDB cluster.
      * 
* - * .google.cloud.alloydb.v1beta.SslConfig ssl_config = 18; + * .google.cloud.alloydb.v1beta.SslConfig ssl_config = 18 [deprecated = true]; */ + @java.lang.Deprecated public Builder setSslConfig(com.google.cloud.alloydb.v1beta.SslConfig value) { if (sslConfigBuilder_ == null) { if (value == null) { @@ -7539,7 +8749,7 @@ public Builder setSslConfig(com.google.cloud.alloydb.v1beta.SslConfig value) { } else { sslConfigBuilder_.setMessage(value); } - bitField0_ |= 0x00040000; + bitField0_ |= 0x00080000; onChanged(); return this; } @@ -7547,18 +8757,19 @@ public Builder setSslConfig(com.google.cloud.alloydb.v1beta.SslConfig value) { * * *
-     * SSL configuration for this AlloyDB Cluster.
+     * SSL configuration for this AlloyDB cluster.
      * 
* - * .google.cloud.alloydb.v1beta.SslConfig ssl_config = 18; + * .google.cloud.alloydb.v1beta.SslConfig ssl_config = 18 [deprecated = true]; */ + @java.lang.Deprecated public Builder setSslConfig(com.google.cloud.alloydb.v1beta.SslConfig.Builder builderForValue) { if (sslConfigBuilder_ == null) { sslConfig_ = builderForValue.build(); } else { sslConfigBuilder_.setMessage(builderForValue.build()); } - bitField0_ |= 0x00040000; + bitField0_ |= 0x00080000; onChanged(); return this; } @@ -7566,14 +8777,15 @@ public Builder setSslConfig(com.google.cloud.alloydb.v1beta.SslConfig.Builder bu * * *
-     * SSL configuration for this AlloyDB Cluster.
+     * SSL configuration for this AlloyDB cluster.
      * 
* - * .google.cloud.alloydb.v1beta.SslConfig ssl_config = 18; + * .google.cloud.alloydb.v1beta.SslConfig ssl_config = 18 [deprecated = true]; */ + @java.lang.Deprecated public Builder mergeSslConfig(com.google.cloud.alloydb.v1beta.SslConfig value) { if (sslConfigBuilder_ == null) { - if (((bitField0_ & 0x00040000) != 0) + if (((bitField0_ & 0x00080000) != 0) && sslConfig_ != null && sslConfig_ != com.google.cloud.alloydb.v1beta.SslConfig.getDefaultInstance()) { getSslConfigBuilder().mergeFrom(value); @@ -7583,7 +8795,7 @@ public Builder mergeSslConfig(com.google.cloud.alloydb.v1beta.SslConfig value) { } else { sslConfigBuilder_.mergeFrom(value); } - bitField0_ |= 0x00040000; + bitField0_ |= 0x00080000; onChanged(); return this; } @@ -7591,13 +8803,14 @@ public Builder mergeSslConfig(com.google.cloud.alloydb.v1beta.SslConfig value) { * * *
-     * SSL configuration for this AlloyDB Cluster.
+     * SSL configuration for this AlloyDB cluster.
      * 
* - * .google.cloud.alloydb.v1beta.SslConfig ssl_config = 18; + * .google.cloud.alloydb.v1beta.SslConfig ssl_config = 18 [deprecated = true]; */ + @java.lang.Deprecated public Builder clearSslConfig() { - bitField0_ = (bitField0_ & ~0x00040000); + bitField0_ = (bitField0_ & ~0x00080000); sslConfig_ = null; if (sslConfigBuilder_ != null) { sslConfigBuilder_.dispose(); @@ -7610,13 +8823,14 @@ public Builder clearSslConfig() { * * *
-     * SSL configuration for this AlloyDB Cluster.
+     * SSL configuration for this AlloyDB cluster.
      * 
* - * .google.cloud.alloydb.v1beta.SslConfig ssl_config = 18; + * .google.cloud.alloydb.v1beta.SslConfig ssl_config = 18 [deprecated = true]; */ + @java.lang.Deprecated public com.google.cloud.alloydb.v1beta.SslConfig.Builder getSslConfigBuilder() { - bitField0_ |= 0x00040000; + bitField0_ |= 0x00080000; onChanged(); return getSslConfigFieldBuilder().getBuilder(); } @@ -7624,11 +8838,12 @@ public com.google.cloud.alloydb.v1beta.SslConfig.Builder getSslConfigBuilder() { * * *
-     * SSL configuration for this AlloyDB Cluster.
+     * SSL configuration for this AlloyDB cluster.
      * 
* - * .google.cloud.alloydb.v1beta.SslConfig ssl_config = 18; + * .google.cloud.alloydb.v1beta.SslConfig ssl_config = 18 [deprecated = true]; */ + @java.lang.Deprecated public com.google.cloud.alloydb.v1beta.SslConfigOrBuilder getSslConfigOrBuilder() { if (sslConfigBuilder_ != null) { return sslConfigBuilder_.getMessageOrBuilder(); @@ -7642,10 +8857,10 @@ public com.google.cloud.alloydb.v1beta.SslConfigOrBuilder getSslConfigOrBuilder( * * *
-     * SSL configuration for this AlloyDB Cluster.
+     * SSL configuration for this AlloyDB cluster.
      * 
* - * .google.cloud.alloydb.v1beta.SslConfig ssl_config = 18; + * .google.cloud.alloydb.v1beta.SslConfig ssl_config = 18 [deprecated = true]; */ private com.google.protobuf.SingleFieldBuilderV3< com.google.cloud.alloydb.v1beta.SslConfig, @@ -7688,7 +8903,7 @@ public com.google.cloud.alloydb.v1beta.SslConfigOrBuilder getSslConfigOrBuilder( * @return Whether the encryptionConfig field is set. */ public boolean hasEncryptionConfig() { - return ((bitField0_ & 0x00080000) != 0); + return ((bitField0_ & 0x00100000) != 0); } /** * @@ -7740,7 +8955,7 @@ public Builder setEncryptionConfig(com.google.cloud.alloydb.v1beta.EncryptionCon } else { encryptionConfigBuilder_.setMessage(value); } - bitField0_ |= 0x00080000; + bitField0_ |= 0x00100000; onChanged(); return this; } @@ -7766,7 +8981,7 @@ public Builder setEncryptionConfig( } else { encryptionConfigBuilder_.setMessage(builderForValue.build()); } - bitField0_ |= 0x00080000; + bitField0_ |= 0x00100000; onChanged(); return this; } @@ -7787,7 +9002,7 @@ public Builder setEncryptionConfig( */ public Builder mergeEncryptionConfig(com.google.cloud.alloydb.v1beta.EncryptionConfig value) { if (encryptionConfigBuilder_ == null) { - if (((bitField0_ & 0x00080000) != 0) + if (((bitField0_ & 0x00100000) != 0) && encryptionConfig_ != null && encryptionConfig_ != com.google.cloud.alloydb.v1beta.EncryptionConfig.getDefaultInstance()) { @@ -7798,7 +9013,7 @@ public Builder mergeEncryptionConfig(com.google.cloud.alloydb.v1beta.EncryptionC } else { encryptionConfigBuilder_.mergeFrom(value); } - bitField0_ |= 0x00080000; + bitField0_ |= 0x00100000; onChanged(); return this; } @@ -7818,7 +9033,7 @@ public Builder mergeEncryptionConfig(com.google.cloud.alloydb.v1beta.EncryptionC *
*/ public Builder clearEncryptionConfig() { - bitField0_ = (bitField0_ & ~0x00080000); + bitField0_ = (bitField0_ & ~0x00100000); encryptionConfig_ = null; if (encryptionConfigBuilder_ != null) { encryptionConfigBuilder_.dispose(); @@ -7843,7 +9058,7 @@ public Builder clearEncryptionConfig() { *
*/ public com.google.cloud.alloydb.v1beta.EncryptionConfig.Builder getEncryptionConfigBuilder() { - bitField0_ |= 0x00080000; + bitField0_ |= 0x00100000; onChanged(); return getEncryptionConfigFieldBuilder().getBuilder(); } @@ -7924,7 +9139,7 @@ public com.google.cloud.alloydb.v1beta.EncryptionConfig.Builder getEncryptionCon * @return Whether the encryptionInfo field is set. */ public boolean hasEncryptionInfo() { - return ((bitField0_ & 0x00100000) != 0); + return ((bitField0_ & 0x00200000) != 0); } /** * @@ -7968,7 +9183,7 @@ public Builder setEncryptionInfo(com.google.cloud.alloydb.v1beta.EncryptionInfo } else { encryptionInfoBuilder_.setMessage(value); } - bitField0_ |= 0x00100000; + bitField0_ |= 0x00200000; onChanged(); return this; } @@ -7990,7 +9205,7 @@ public Builder setEncryptionInfo( } else { encryptionInfoBuilder_.setMessage(builderForValue.build()); } - bitField0_ |= 0x00100000; + bitField0_ |= 0x00200000; onChanged(); return this; } @@ -8007,7 +9222,7 @@ public Builder setEncryptionInfo( */ public Builder mergeEncryptionInfo(com.google.cloud.alloydb.v1beta.EncryptionInfo value) { if (encryptionInfoBuilder_ == null) { - if (((bitField0_ & 0x00100000) != 0) + if (((bitField0_ & 0x00200000) != 0) && encryptionInfo_ != null && encryptionInfo_ != com.google.cloud.alloydb.v1beta.EncryptionInfo.getDefaultInstance()) { @@ -8018,7 +9233,7 @@ public Builder mergeEncryptionInfo(com.google.cloud.alloydb.v1beta.EncryptionInf } else { encryptionInfoBuilder_.mergeFrom(value); } - bitField0_ |= 0x00100000; + bitField0_ |= 0x00200000; onChanged(); return this; } @@ -8034,7 +9249,7 @@ public Builder mergeEncryptionInfo(com.google.cloud.alloydb.v1beta.EncryptionInf *
*/ public Builder clearEncryptionInfo() { - bitField0_ = (bitField0_ & ~0x00100000); + bitField0_ = (bitField0_ & ~0x00200000); encryptionInfo_ = null; if (encryptionInfoBuilder_ != null) { encryptionInfoBuilder_.dispose(); @@ -8055,7 +9270,7 @@ public Builder clearEncryptionInfo() { *
*/ public com.google.cloud.alloydb.v1beta.EncryptionInfo.Builder getEncryptionInfoBuilder() { - bitField0_ |= 0x00100000; + bitField0_ |= 0x00200000; onChanged(); return getEncryptionInfoFieldBuilder().getBuilder(); } @@ -8127,7 +9342,7 @@ public com.google.cloud.alloydb.v1beta.EncryptionInfoOrBuilder getEncryptionInfo * @return Whether the continuousBackupConfig field is set. */ public boolean hasContinuousBackupConfig() { - return ((bitField0_ & 0x00200000) != 0); + return ((bitField0_ & 0x00400000) != 0); } /** * @@ -8172,7 +9387,7 @@ public Builder setContinuousBackupConfig( } else { continuousBackupConfigBuilder_.setMessage(value); } - bitField0_ |= 0x00200000; + bitField0_ |= 0x00400000; onChanged(); return this; } @@ -8194,7 +9409,7 @@ public Builder setContinuousBackupConfig( } else { continuousBackupConfigBuilder_.setMessage(builderForValue.build()); } - bitField0_ |= 0x00200000; + bitField0_ |= 0x00400000; onChanged(); return this; } @@ -8212,7 +9427,7 @@ public Builder setContinuousBackupConfig( public Builder mergeContinuousBackupConfig( com.google.cloud.alloydb.v1beta.ContinuousBackupConfig value) { if (continuousBackupConfigBuilder_ == null) { - if (((bitField0_ & 0x00200000) != 0) + if (((bitField0_ & 0x00400000) != 0) && continuousBackupConfig_ != null && continuousBackupConfig_ != com.google.cloud.alloydb.v1beta.ContinuousBackupConfig.getDefaultInstance()) { @@ -8223,7 +9438,7 @@ public Builder mergeContinuousBackupConfig( } else { continuousBackupConfigBuilder_.mergeFrom(value); } - bitField0_ |= 0x00200000; + bitField0_ |= 0x00400000; onChanged(); return this; } @@ -8239,7 +9454,7 @@ public Builder mergeContinuousBackupConfig( *
*/ public Builder clearContinuousBackupConfig() { - bitField0_ = (bitField0_ & ~0x00200000); + bitField0_ = (bitField0_ & ~0x00400000); continuousBackupConfig_ = null; if (continuousBackupConfigBuilder_ != null) { continuousBackupConfigBuilder_.dispose(); @@ -8261,7 +9476,7 @@ public Builder clearContinuousBackupConfig() { */ public com.google.cloud.alloydb.v1beta.ContinuousBackupConfig.Builder getContinuousBackupConfigBuilder() { - bitField0_ |= 0x00200000; + bitField0_ |= 0x00400000; onChanged(); return getContinuousBackupConfigFieldBuilder().getBuilder(); } @@ -8334,7 +9549,7 @@ public Builder clearContinuousBackupConfig() { * @return Whether the continuousBackupInfo field is set. */ public boolean hasContinuousBackupInfo() { - return ((bitField0_ & 0x00400000) != 0); + return ((bitField0_ & 0x00800000) != 0); } /** * @@ -8379,7 +9594,7 @@ public Builder setContinuousBackupInfo( } else { continuousBackupInfoBuilder_.setMessage(value); } - bitField0_ |= 0x00400000; + bitField0_ |= 0x00800000; onChanged(); return this; } @@ -8401,7 +9616,7 @@ public Builder setContinuousBackupInfo( } else { continuousBackupInfoBuilder_.setMessage(builderForValue.build()); } - bitField0_ |= 0x00400000; + bitField0_ |= 0x00800000; onChanged(); return this; } @@ -8419,7 +9634,7 @@ public Builder setContinuousBackupInfo( public Builder mergeContinuousBackupInfo( com.google.cloud.alloydb.v1beta.ContinuousBackupInfo value) { if (continuousBackupInfoBuilder_ == null) { - if (((bitField0_ & 0x00400000) != 0) + if (((bitField0_ & 0x00800000) != 0) && continuousBackupInfo_ != null && continuousBackupInfo_ != com.google.cloud.alloydb.v1beta.ContinuousBackupInfo.getDefaultInstance()) { @@ -8430,7 +9645,7 @@ public Builder mergeContinuousBackupInfo( } else { continuousBackupInfoBuilder_.mergeFrom(value); } - bitField0_ |= 0x00400000; + bitField0_ |= 0x00800000; onChanged(); return this; } @@ -8446,7 +9661,7 @@ public Builder mergeContinuousBackupInfo( *
*/ public Builder clearContinuousBackupInfo() { - bitField0_ = (bitField0_ & ~0x00400000); + bitField0_ = (bitField0_ & ~0x00800000); continuousBackupInfo_ = null; if (continuousBackupInfoBuilder_ != null) { continuousBackupInfoBuilder_.dispose(); @@ -8468,7 +9683,7 @@ public Builder clearContinuousBackupInfo() { */ public com.google.cloud.alloydb.v1beta.ContinuousBackupInfo.Builder getContinuousBackupInfoBuilder() { - bitField0_ |= 0x00400000; + bitField0_ |= 0x00800000; onChanged(); return getContinuousBackupInfoFieldBuilder().getBuilder(); } @@ -8539,7 +9754,7 @@ public Builder clearContinuousBackupInfo() { * @return Whether the secondaryConfig field is set. */ public boolean hasSecondaryConfig() { - return ((bitField0_ & 0x00800000) != 0); + return ((bitField0_ & 0x01000000) != 0); } /** * @@ -8580,7 +9795,7 @@ public Builder setSecondaryConfig( } else { secondaryConfigBuilder_.setMessage(value); } - bitField0_ |= 0x00800000; + bitField0_ |= 0x01000000; onChanged(); return this; } @@ -8600,7 +9815,7 @@ public Builder setSecondaryConfig( } else { secondaryConfigBuilder_.setMessage(builderForValue.build()); } - bitField0_ |= 0x00800000; + bitField0_ |= 0x01000000; onChanged(); return this; } @@ -8616,7 +9831,7 @@ public Builder setSecondaryConfig( public Builder mergeSecondaryConfig( com.google.cloud.alloydb.v1beta.Cluster.SecondaryConfig value) { if (secondaryConfigBuilder_ == null) { - if (((bitField0_ & 0x00800000) != 0) + if (((bitField0_ & 0x01000000) != 0) && secondaryConfig_ != null && secondaryConfig_ != com.google.cloud.alloydb.v1beta.Cluster.SecondaryConfig.getDefaultInstance()) { @@ -8627,7 +9842,7 @@ public Builder mergeSecondaryConfig( } else { secondaryConfigBuilder_.mergeFrom(value); } - bitField0_ |= 0x00800000; + bitField0_ |= 0x01000000; onChanged(); return this; } @@ -8641,7 +9856,7 @@ public Builder mergeSecondaryConfig( * .google.cloud.alloydb.v1beta.Cluster.SecondaryConfig secondary_config = 22; */ public Builder clearSecondaryConfig() { - bitField0_ = (bitField0_ & ~0x00800000); + bitField0_ = (bitField0_ & ~0x01000000); secondaryConfig_ = null; if (secondaryConfigBuilder_ != null) { secondaryConfigBuilder_.dispose(); @@ -8661,7 +9876,7 @@ public Builder clearSecondaryConfig() { */ public com.google.cloud.alloydb.v1beta.Cluster.SecondaryConfig.Builder getSecondaryConfigBuilder() { - bitField0_ |= 0x00800000; + bitField0_ |= 0x01000000; onChanged(); return getSecondaryConfigFieldBuilder().getBuilder(); } @@ -8730,7 +9945,7 @@ public Builder clearSecondaryConfig() { * @return Whether the primaryConfig field is set. */ public boolean hasPrimaryConfig() { - return ((bitField0_ & 0x01000000) != 0); + return ((bitField0_ & 0x02000000) != 0); } /** * @@ -8774,7 +9989,7 @@ public Builder setPrimaryConfig(com.google.cloud.alloydb.v1beta.Cluster.PrimaryC } else { primaryConfigBuilder_.setMessage(value); } - bitField0_ |= 0x01000000; + bitField0_ |= 0x02000000; onChanged(); return this; } @@ -8796,7 +10011,7 @@ public Builder setPrimaryConfig( } else { primaryConfigBuilder_.setMessage(builderForValue.build()); } - bitField0_ |= 0x01000000; + bitField0_ |= 0x02000000; onChanged(); return this; } @@ -8813,7 +10028,7 @@ public Builder setPrimaryConfig( */ public Builder mergePrimaryConfig(com.google.cloud.alloydb.v1beta.Cluster.PrimaryConfig value) { if (primaryConfigBuilder_ == null) { - if (((bitField0_ & 0x01000000) != 0) + if (((bitField0_ & 0x02000000) != 0) && primaryConfig_ != null && primaryConfig_ != com.google.cloud.alloydb.v1beta.Cluster.PrimaryConfig.getDefaultInstance()) { @@ -8824,7 +10039,7 @@ public Builder mergePrimaryConfig(com.google.cloud.alloydb.v1beta.Cluster.Primar } else { primaryConfigBuilder_.mergeFrom(value); } - bitField0_ |= 0x01000000; + bitField0_ |= 0x02000000; onChanged(); return this; } @@ -8840,7 +10055,7 @@ public Builder mergePrimaryConfig(com.google.cloud.alloydb.v1beta.Cluster.Primar *
*/ public Builder clearPrimaryConfig() { - bitField0_ = (bitField0_ & ~0x01000000); + bitField0_ = (bitField0_ & ~0x02000000); primaryConfig_ = null; if (primaryConfigBuilder_ != null) { primaryConfigBuilder_.dispose(); @@ -8861,7 +10076,7 @@ public Builder clearPrimaryConfig() { * */ public com.google.cloud.alloydb.v1beta.Cluster.PrimaryConfig.Builder getPrimaryConfigBuilder() { - bitField0_ |= 0x01000000; + bitField0_ |= 0x02000000; onChanged(); return getPrimaryConfigFieldBuilder().getBuilder(); } diff --git a/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/ClusterOrBuilder.java b/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/ClusterOrBuilder.java index 0d24f3a196ab..985ba5002a10 100644 --- a/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/ClusterOrBuilder.java +++ b/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/ClusterOrBuilder.java @@ -461,6 +461,29 @@ java.lang.String getLabelsOrDefault( */ com.google.cloud.alloydb.v1beta.DatabaseVersion getDatabaseVersion(); + /** + * + * .google.cloud.alloydb.v1beta.Cluster.NetworkConfig network_config = 29 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the networkConfig field is set. + */ + boolean hasNetworkConfig(); + /** + * + * .google.cloud.alloydb.v1beta.Cluster.NetworkConfig network_config = 29 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The networkConfig. + */ + com.google.cloud.alloydb.v1beta.Cluster.NetworkConfig getNetworkConfig(); + /** + * + * .google.cloud.alloydb.v1beta.Cluster.NetworkConfig network_config = 29 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.cloud.alloydb.v1beta.Cluster.NetworkConfigOrBuilder getNetworkConfigOrBuilder(); + /** * * @@ -710,35 +733,42 @@ java.lang.String getAnnotationsOrDefault( * * *
-   * SSL configuration for this AlloyDB Cluster.
+   * SSL configuration for this AlloyDB cluster.
    * 
* - * .google.cloud.alloydb.v1beta.SslConfig ssl_config = 18; + * .google.cloud.alloydb.v1beta.SslConfig ssl_config = 18 [deprecated = true]; * + * @deprecated google.cloud.alloydb.v1beta.Cluster.ssl_config is deprecated. See + * google/cloud/alloydb/v1beta/resources.proto;l=578 * @return Whether the sslConfig field is set. */ + @java.lang.Deprecated boolean hasSslConfig(); /** * * *
-   * SSL configuration for this AlloyDB Cluster.
+   * SSL configuration for this AlloyDB cluster.
    * 
* - * .google.cloud.alloydb.v1beta.SslConfig ssl_config = 18; + * .google.cloud.alloydb.v1beta.SslConfig ssl_config = 18 [deprecated = true]; * + * @deprecated google.cloud.alloydb.v1beta.Cluster.ssl_config is deprecated. See + * google/cloud/alloydb/v1beta/resources.proto;l=578 * @return The sslConfig. */ + @java.lang.Deprecated com.google.cloud.alloydb.v1beta.SslConfig getSslConfig(); /** * * *
-   * SSL configuration for this AlloyDB Cluster.
+   * SSL configuration for this AlloyDB cluster.
    * 
* - * .google.cloud.alloydb.v1beta.SslConfig ssl_config = 18; + * .google.cloud.alloydb.v1beta.SslConfig ssl_config = 18 [deprecated = true]; */ + @java.lang.Deprecated com.google.cloud.alloydb.v1beta.SslConfigOrBuilder getSslConfigOrBuilder(); /** diff --git a/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/ClusterView.java b/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/ClusterView.java new file mode 100644 index 000000000000..790e2d2e5e18 --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/ClusterView.java @@ -0,0 +1,185 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/alloydb/v1beta/resources.proto + +package com.google.cloud.alloydb.v1beta; + +/** + * + * + *
+ * View on Cluster. Pass this enum to rpcs that returns a cluster message to
+ * control which subsets of fields to get.
+ * 
+ * + * Protobuf enum {@code google.cloud.alloydb.v1beta.ClusterView} + */ +public enum ClusterView implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+   * CLUSTER_VIEW_UNSPECIFIED Not specified, equivalent to BASIC.
+   * 
+ * + * CLUSTER_VIEW_UNSPECIFIED = 0; + */ + 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.
+   * 
+ * + * CLUSTER_VIEW_BASIC = 1; + */ + 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.
+   * 
+ * + * CLUSTER_VIEW_CONTINUOUS_BACKUP = 2; + */ + CLUSTER_VIEW_CONTINUOUS_BACKUP(2), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+   * CLUSTER_VIEW_UNSPECIFIED Not specified, equivalent to BASIC.
+   * 
+ * + * CLUSTER_VIEW_UNSPECIFIED = 0; + */ + public static final int CLUSTER_VIEW_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+   * BASIC server responses include all the relevant cluster details, excluding
+   * Cluster.ContinuousBackupInfo.EarliestRestorableTime and other view-specific
+   * fields. The default value.
+   * 
+ * + * CLUSTER_VIEW_BASIC = 1; + */ + public static final int CLUSTER_VIEW_BASIC_VALUE = 1; + /** + * + * + *
+   * CONTINUOUS_BACKUP response returns all the fields from BASIC plus
+   * the earliest restorable time if continuous backups are enabled.
+   * May increase latency.
+   * 
+ * + * CLUSTER_VIEW_CONTINUOUS_BACKUP = 2; + */ + public static final int CLUSTER_VIEW_CONTINUOUS_BACKUP_VALUE = 2; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static ClusterView valueOf(int value) { + return forNumber(value); + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + */ + public static ClusterView forNumber(int value) { + switch (value) { + case 0: + return CLUSTER_VIEW_UNSPECIFIED; + case 1: + return CLUSTER_VIEW_BASIC; + case 2: + return CLUSTER_VIEW_CONTINUOUS_BACKUP; + default: + return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap internalGetValueMap() { + return internalValueMap; + } + + private static final com.google.protobuf.Internal.EnumLiteMap internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public ClusterView findValueByNumber(int number) { + return ClusterView.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + return getDescriptor().getValues().get(ordinal()); + } + + public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { + return getDescriptor(); + } + + public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.cloud.alloydb.v1beta.ResourcesProto.getDescriptor().getEnumTypes().get(1); + } + + private static final ClusterView[] VALUES = values(); + + public static ClusterView valueOf(com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException("EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private ClusterView(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.alloydb.v1beta.ClusterView) +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/ConnectionInfo.java b/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/ConnectionInfo.java index 87f5b6ef463c..301329ae96e1 100644 --- a/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/ConnectionInfo.java +++ b/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/ConnectionInfo.java @@ -187,11 +187,15 @@ public com.google.protobuf.ByteString getIpAddressBytes() { * certificate. Expected to be in issuer-to-root order according to RFC 5246. * * - * repeated string pem_certificate_chain = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * repeated string pem_certificate_chain = 3 [deprecated = true, (.google.api.field_behavior) = OUTPUT_ONLY]; * * + * @deprecated google.cloud.alloydb.v1beta.ConnectionInfo.pem_certificate_chain is deprecated. See + * google/cloud/alloydb/v1beta/resources.proto;l=894 * @return A list containing the pemCertificateChain. */ + @java.lang.Deprecated public com.google.protobuf.ProtocolStringList getPemCertificateChainList() { return pemCertificateChain_; } @@ -203,11 +207,15 @@ public com.google.protobuf.ProtocolStringList getPemCertificateChainList() { * certificate. Expected to be in issuer-to-root order according to RFC 5246. * * - * repeated string pem_certificate_chain = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * repeated string pem_certificate_chain = 3 [deprecated = true, (.google.api.field_behavior) = OUTPUT_ONLY]; * * + * @deprecated google.cloud.alloydb.v1beta.ConnectionInfo.pem_certificate_chain is deprecated. See + * google/cloud/alloydb/v1beta/resources.proto;l=894 * @return The count of pemCertificateChain. */ + @java.lang.Deprecated public int getPemCertificateChainCount() { return pemCertificateChain_.size(); } @@ -219,12 +227,16 @@ public int getPemCertificateChainCount() { * certificate. Expected to be in issuer-to-root order according to RFC 5246. * * - * repeated string pem_certificate_chain = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * repeated string pem_certificate_chain = 3 [deprecated = true, (.google.api.field_behavior) = OUTPUT_ONLY]; * * + * @deprecated google.cloud.alloydb.v1beta.ConnectionInfo.pem_certificate_chain is deprecated. See + * google/cloud/alloydb/v1beta/resources.proto;l=894 * @param index The index of the element to return. * @return The pemCertificateChain at the given index. */ + @java.lang.Deprecated public java.lang.String getPemCertificateChain(int index) { return pemCertificateChain_.get(index); } @@ -236,12 +248,16 @@ public java.lang.String getPemCertificateChain(int index) { * certificate. Expected to be in issuer-to-root order according to RFC 5246. * * - * repeated string pem_certificate_chain = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * repeated string pem_certificate_chain = 3 [deprecated = true, (.google.api.field_behavior) = OUTPUT_ONLY]; * * + * @deprecated google.cloud.alloydb.v1beta.ConnectionInfo.pem_certificate_chain is deprecated. See + * google/cloud/alloydb/v1beta/resources.proto;l=894 * @param index The index of the value to return. * @return The bytes of the pemCertificateChain at the given index. */ + @java.lang.Deprecated public com.google.protobuf.ByteString getPemCertificateChainBytes(int index) { return pemCertificateChain_.getByteString(index); } @@ -969,11 +985,15 @@ private void ensurePemCertificateChainIsMutable() { * certificate. Expected to be in issuer-to-root order according to RFC 5246. * * - * repeated string pem_certificate_chain = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * repeated string pem_certificate_chain = 3 [deprecated = true, (.google.api.field_behavior) = OUTPUT_ONLY]; * * + * @deprecated google.cloud.alloydb.v1beta.ConnectionInfo.pem_certificate_chain is deprecated. + * See google/cloud/alloydb/v1beta/resources.proto;l=894 * @return A list containing the pemCertificateChain. */ + @java.lang.Deprecated public com.google.protobuf.ProtocolStringList getPemCertificateChainList() { pemCertificateChain_.makeImmutable(); return pemCertificateChain_; @@ -986,11 +1006,15 @@ public com.google.protobuf.ProtocolStringList getPemCertificateChainList() { * certificate. Expected to be in issuer-to-root order according to RFC 5246. * * - * repeated string pem_certificate_chain = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * repeated string pem_certificate_chain = 3 [deprecated = true, (.google.api.field_behavior) = OUTPUT_ONLY]; * * + * @deprecated google.cloud.alloydb.v1beta.ConnectionInfo.pem_certificate_chain is deprecated. + * See google/cloud/alloydb/v1beta/resources.proto;l=894 * @return The count of pemCertificateChain. */ + @java.lang.Deprecated public int getPemCertificateChainCount() { return pemCertificateChain_.size(); } @@ -1002,12 +1026,16 @@ public int getPemCertificateChainCount() { * certificate. Expected to be in issuer-to-root order according to RFC 5246. * * - * repeated string pem_certificate_chain = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * repeated string pem_certificate_chain = 3 [deprecated = true, (.google.api.field_behavior) = OUTPUT_ONLY]; * * + * @deprecated google.cloud.alloydb.v1beta.ConnectionInfo.pem_certificate_chain is deprecated. + * See google/cloud/alloydb/v1beta/resources.proto;l=894 * @param index The index of the element to return. * @return The pemCertificateChain at the given index. */ + @java.lang.Deprecated public java.lang.String getPemCertificateChain(int index) { return pemCertificateChain_.get(index); } @@ -1019,12 +1047,16 @@ public java.lang.String getPemCertificateChain(int index) { * certificate. Expected to be in issuer-to-root order according to RFC 5246. * * - * repeated string pem_certificate_chain = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * repeated string pem_certificate_chain = 3 [deprecated = true, (.google.api.field_behavior) = OUTPUT_ONLY]; * * + * @deprecated google.cloud.alloydb.v1beta.ConnectionInfo.pem_certificate_chain is deprecated. + * See google/cloud/alloydb/v1beta/resources.proto;l=894 * @param index The index of the value to return. * @return The bytes of the pemCertificateChain at the given index. */ + @java.lang.Deprecated public com.google.protobuf.ByteString getPemCertificateChainBytes(int index) { return pemCertificateChain_.getByteString(index); } @@ -1036,13 +1068,17 @@ public com.google.protobuf.ByteString getPemCertificateChainBytes(int index) { * certificate. Expected to be in issuer-to-root order according to RFC 5246. * * - * repeated string pem_certificate_chain = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * repeated string pem_certificate_chain = 3 [deprecated = true, (.google.api.field_behavior) = OUTPUT_ONLY]; * * + * @deprecated google.cloud.alloydb.v1beta.ConnectionInfo.pem_certificate_chain is deprecated. + * See google/cloud/alloydb/v1beta/resources.proto;l=894 * @param index The index to set the value at. * @param value The pemCertificateChain to set. * @return This builder for chaining. */ + @java.lang.Deprecated public Builder setPemCertificateChain(int index, java.lang.String value) { if (value == null) { throw new NullPointerException(); @@ -1061,12 +1097,16 @@ public Builder setPemCertificateChain(int index, java.lang.String value) { * certificate. Expected to be in issuer-to-root order according to RFC 5246. * * - * repeated string pem_certificate_chain = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * repeated string pem_certificate_chain = 3 [deprecated = true, (.google.api.field_behavior) = OUTPUT_ONLY]; * * + * @deprecated google.cloud.alloydb.v1beta.ConnectionInfo.pem_certificate_chain is deprecated. + * See google/cloud/alloydb/v1beta/resources.proto;l=894 * @param value The pemCertificateChain to add. * @return This builder for chaining. */ + @java.lang.Deprecated public Builder addPemCertificateChain(java.lang.String value) { if (value == null) { throw new NullPointerException(); @@ -1085,12 +1125,16 @@ public Builder addPemCertificateChain(java.lang.String value) { * certificate. Expected to be in issuer-to-root order according to RFC 5246. * * - * repeated string pem_certificate_chain = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * repeated string pem_certificate_chain = 3 [deprecated = true, (.google.api.field_behavior) = OUTPUT_ONLY]; * * + * @deprecated google.cloud.alloydb.v1beta.ConnectionInfo.pem_certificate_chain is deprecated. + * See google/cloud/alloydb/v1beta/resources.proto;l=894 * @param values The pemCertificateChain to add. * @return This builder for chaining. */ + @java.lang.Deprecated public Builder addAllPemCertificateChain(java.lang.Iterable values) { ensurePemCertificateChainIsMutable(); com.google.protobuf.AbstractMessageLite.Builder.addAll(values, pemCertificateChain_); @@ -1106,11 +1150,15 @@ public Builder addAllPemCertificateChain(java.lang.Iterable va * certificate. Expected to be in issuer-to-root order according to RFC 5246. * * - * repeated string pem_certificate_chain = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * repeated string pem_certificate_chain = 3 [deprecated = true, (.google.api.field_behavior) = OUTPUT_ONLY]; * * + * @deprecated google.cloud.alloydb.v1beta.ConnectionInfo.pem_certificate_chain is deprecated. + * See google/cloud/alloydb/v1beta/resources.proto;l=894 * @return This builder for chaining. */ + @java.lang.Deprecated public Builder clearPemCertificateChain() { pemCertificateChain_ = com.google.protobuf.LazyStringArrayList.emptyList(); bitField0_ = (bitField0_ & ~0x00000004); @@ -1126,12 +1174,16 @@ public Builder clearPemCertificateChain() { * certificate. Expected to be in issuer-to-root order according to RFC 5246. * * - * repeated string pem_certificate_chain = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * repeated string pem_certificate_chain = 3 [deprecated = true, (.google.api.field_behavior) = OUTPUT_ONLY]; * * + * @deprecated google.cloud.alloydb.v1beta.ConnectionInfo.pem_certificate_chain is deprecated. + * See google/cloud/alloydb/v1beta/resources.proto;l=894 * @param value The bytes of the pemCertificateChain to add. * @return This builder for chaining. */ + @java.lang.Deprecated public Builder addPemCertificateChainBytes(com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); diff --git a/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/ConnectionInfoOrBuilder.java b/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/ConnectionInfoOrBuilder.java index 4363ab9a28a8..f368cd305a2b 100644 --- a/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/ConnectionInfoOrBuilder.java +++ b/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/ConnectionInfoOrBuilder.java @@ -87,11 +87,15 @@ public interface ConnectionInfoOrBuilder * certificate. Expected to be in issuer-to-root order according to RFC 5246. * * - * repeated string pem_certificate_chain = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * repeated string pem_certificate_chain = 3 [deprecated = true, (.google.api.field_behavior) = OUTPUT_ONLY]; * * + * @deprecated google.cloud.alloydb.v1beta.ConnectionInfo.pem_certificate_chain is deprecated. See + * google/cloud/alloydb/v1beta/resources.proto;l=894 * @return A list containing the pemCertificateChain. */ + @java.lang.Deprecated java.util.List getPemCertificateChainList(); /** * @@ -101,11 +105,15 @@ public interface ConnectionInfoOrBuilder * certificate. Expected to be in issuer-to-root order according to RFC 5246. * * - * repeated string pem_certificate_chain = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * repeated string pem_certificate_chain = 3 [deprecated = true, (.google.api.field_behavior) = OUTPUT_ONLY]; * * + * @deprecated google.cloud.alloydb.v1beta.ConnectionInfo.pem_certificate_chain is deprecated. See + * google/cloud/alloydb/v1beta/resources.proto;l=894 * @return The count of pemCertificateChain. */ + @java.lang.Deprecated int getPemCertificateChainCount(); /** * @@ -115,12 +123,16 @@ public interface ConnectionInfoOrBuilder * certificate. Expected to be in issuer-to-root order according to RFC 5246. * * - * repeated string pem_certificate_chain = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * repeated string pem_certificate_chain = 3 [deprecated = true, (.google.api.field_behavior) = OUTPUT_ONLY]; * * + * @deprecated google.cloud.alloydb.v1beta.ConnectionInfo.pem_certificate_chain is deprecated. See + * google/cloud/alloydb/v1beta/resources.proto;l=894 * @param index The index of the element to return. * @return The pemCertificateChain at the given index. */ + @java.lang.Deprecated java.lang.String getPemCertificateChain(int index); /** * @@ -130,12 +142,16 @@ public interface ConnectionInfoOrBuilder * certificate. Expected to be in issuer-to-root order according to RFC 5246. * * - * repeated string pem_certificate_chain = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * repeated string pem_certificate_chain = 3 [deprecated = true, (.google.api.field_behavior) = OUTPUT_ONLY]; * * + * @deprecated google.cloud.alloydb.v1beta.ConnectionInfo.pem_certificate_chain is deprecated. See + * google/cloud/alloydb/v1beta/resources.proto;l=894 * @param index The index of the value to return. * @return The bytes of the pemCertificateChain at the given index. */ + @java.lang.Deprecated com.google.protobuf.ByteString getPemCertificateChainBytes(int index); /** diff --git a/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/ContinuousBackupInfo.java b/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/ContinuousBackupInfo.java index 386d6cb68c4c..e2628d8a74af 100644 --- a/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/ContinuousBackupInfo.java +++ b/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/ContinuousBackupInfo.java @@ -285,6 +285,65 @@ public int getScheduleValue(int index) { private int scheduleMemoizedSerializedSize; + public static final int EARLIEST_RESTORABLE_TIME_FIELD_NUMBER = 4; + private com.google.protobuf.Timestamp earliestRestorableTime_; + /** + * + * + *
+   * Output only. The earliest restorable time that can be restored to. Output
+   * only field.
+   * 
+ * + * + * .google.protobuf.Timestamp earliest_restorable_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the earliestRestorableTime field is set. + */ + @java.lang.Override + public boolean hasEarliestRestorableTime() { + return earliestRestorableTime_ != null; + } + /** + * + * + *
+   * Output only. The earliest restorable time that can be restored to. Output
+   * only field.
+   * 
+ * + * + * .google.protobuf.Timestamp earliest_restorable_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The earliestRestorableTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getEarliestRestorableTime() { + return earliestRestorableTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : earliestRestorableTime_; + } + /** + * + * + *
+   * Output only. The earliest restorable time that can be restored to. Output
+   * only field.
+   * 
+ * + * + * .google.protobuf.Timestamp earliest_restorable_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getEarliestRestorableTimeOrBuilder() { + return earliestRestorableTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : earliestRestorableTime_; + } + private byte memoizedIsInitialized = -1; @java.lang.Override @@ -313,6 +372,9 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io for (int i = 0; i < schedule_.size(); i++) { output.writeEnumNoTag(schedule_.get(i)); } + if (earliestRestorableTime_ != null) { + output.writeMessage(4, getEarliestRestorableTime()); + } getUnknownFields().writeTo(output); } @@ -340,6 +402,10 @@ public int getSerializedSize() { } scheduleMemoizedSerializedSize = dataSize; } + if (earliestRestorableTime_ != null) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize(4, getEarliestRestorableTime()); + } size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; @@ -365,6 +431,10 @@ public boolean equals(final java.lang.Object obj) { if (!getEnabledTime().equals(other.getEnabledTime())) return false; } if (!schedule_.equals(other.schedule_)) return false; + if (hasEarliestRestorableTime() != other.hasEarliestRestorableTime()) return false; + if (hasEarliestRestorableTime()) { + if (!getEarliestRestorableTime().equals(other.getEarliestRestorableTime())) return false; + } if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -388,6 +458,10 @@ public int hashCode() { hash = (37 * hash) + SCHEDULE_FIELD_NUMBER; hash = (53 * hash) + schedule_.hashCode(); } + if (hasEarliestRestorableTime()) { + hash = (37 * hash) + EARLIEST_RESTORABLE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getEarliestRestorableTime().hashCode(); + } hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; @@ -540,6 +614,11 @@ public Builder clear() { } schedule_ = java.util.Collections.emptyList(); bitField0_ = (bitField0_ & ~0x00000004); + earliestRestorableTime_ = null; + if (earliestRestorableTimeBuilder_ != null) { + earliestRestorableTimeBuilder_.dispose(); + earliestRestorableTimeBuilder_ = null; + } return this; } @@ -594,6 +673,12 @@ private void buildPartial0(com.google.cloud.alloydb.v1beta.ContinuousBackupInfo result.enabledTime_ = enabledTimeBuilder_ == null ? enabledTime_ : enabledTimeBuilder_.build(); } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.earliestRestorableTime_ = + earliestRestorableTimeBuilder_ == null + ? earliestRestorableTime_ + : earliestRestorableTimeBuilder_.build(); + } } @java.lang.Override @@ -658,6 +743,9 @@ public Builder mergeFrom(com.google.cloud.alloydb.v1beta.ContinuousBackupInfo ot } onChanged(); } + if (other.hasEarliestRestorableTime()) { + mergeEarliestRestorableTime(other.getEarliestRestorableTime()); + } this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; @@ -715,6 +803,13 @@ public Builder mergeFrom( input.popLimit(oldLimit); break; } // case 26 + case 34: + { + input.readMessage( + getEarliestRestorableTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000008; + break; + } // case 34 default: { if (!super.parseUnknownField(input, extensionRegistry, tag)) { @@ -1411,6 +1506,217 @@ public Builder addAllScheduleValue(java.lang.Iterable values) return this; } + private com.google.protobuf.Timestamp earliestRestorableTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + earliestRestorableTimeBuilder_; + /** + * + * + *
+     * Output only. The earliest restorable time that can be restored to. Output
+     * only field.
+     * 
+ * + * + * .google.protobuf.Timestamp earliest_restorable_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the earliestRestorableTime field is set. + */ + public boolean hasEarliestRestorableTime() { + return ((bitField0_ & 0x00000008) != 0); + } + /** + * + * + *
+     * Output only. The earliest restorable time that can be restored to. Output
+     * only field.
+     * 
+ * + * + * .google.protobuf.Timestamp earliest_restorable_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The earliestRestorableTime. + */ + public com.google.protobuf.Timestamp getEarliestRestorableTime() { + if (earliestRestorableTimeBuilder_ == null) { + return earliestRestorableTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : earliestRestorableTime_; + } else { + return earliestRestorableTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Output only. The earliest restorable time that can be restored to. Output
+     * only field.
+     * 
+ * + * + * .google.protobuf.Timestamp earliest_restorable_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setEarliestRestorableTime(com.google.protobuf.Timestamp value) { + if (earliestRestorableTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + earliestRestorableTime_ = value; + } else { + earliestRestorableTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The earliest restorable time that can be restored to. Output
+     * only field.
+     * 
+ * + * + * .google.protobuf.Timestamp earliest_restorable_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setEarliestRestorableTime( + com.google.protobuf.Timestamp.Builder builderForValue) { + if (earliestRestorableTimeBuilder_ == null) { + earliestRestorableTime_ = builderForValue.build(); + } else { + earliestRestorableTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The earliest restorable time that can be restored to. Output
+     * only field.
+     * 
+ * + * + * .google.protobuf.Timestamp earliest_restorable_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeEarliestRestorableTime(com.google.protobuf.Timestamp value) { + if (earliestRestorableTimeBuilder_ == null) { + if (((bitField0_ & 0x00000008) != 0) + && earliestRestorableTime_ != null + && earliestRestorableTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getEarliestRestorableTimeBuilder().mergeFrom(value); + } else { + earliestRestorableTime_ = value; + } + } else { + earliestRestorableTimeBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The earliest restorable time that can be restored to. Output
+     * only field.
+     * 
+ * + * + * .google.protobuf.Timestamp earliest_restorable_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearEarliestRestorableTime() { + bitField0_ = (bitField0_ & ~0x00000008); + earliestRestorableTime_ = null; + if (earliestRestorableTimeBuilder_ != null) { + earliestRestorableTimeBuilder_.dispose(); + earliestRestorableTimeBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The earliest restorable time that can be restored to. Output
+     * only field.
+     * 
+ * + * + * .google.protobuf.Timestamp earliest_restorable_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Timestamp.Builder getEarliestRestorableTimeBuilder() { + bitField0_ |= 0x00000008; + onChanged(); + return getEarliestRestorableTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. The earliest restorable time that can be restored to. Output
+     * only field.
+     * 
+ * + * + * .google.protobuf.Timestamp earliest_restorable_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.TimestampOrBuilder getEarliestRestorableTimeOrBuilder() { + if (earliestRestorableTimeBuilder_ != null) { + return earliestRestorableTimeBuilder_.getMessageOrBuilder(); + } else { + return earliestRestorableTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : earliestRestorableTime_; + } + } + /** + * + * + *
+     * Output only. The earliest restorable time that can be restored to. Output
+     * only field.
+     * 
+ * + * + * .google.protobuf.Timestamp earliest_restorable_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getEarliestRestorableTimeFieldBuilder() { + if (earliestRestorableTimeBuilder_ == null) { + earliestRestorableTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getEarliestRestorableTime(), getParentForChildren(), isClean()); + earliestRestorableTime_ = null; + } + return earliestRestorableTimeBuilder_; + } + @java.lang.Override public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { return super.setUnknownFields(unknownFields); diff --git a/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/ContinuousBackupInfoOrBuilder.java b/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/ContinuousBackupInfoOrBuilder.java index 6faa7b7582c9..f3fe409127f4 100644 --- a/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/ContinuousBackupInfoOrBuilder.java +++ b/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/ContinuousBackupInfoOrBuilder.java @@ -185,4 +185,48 @@ public interface ContinuousBackupInfoOrBuilder * @return The enum numeric value on the wire of schedule at the given index. */ int getScheduleValue(int index); + + /** + * + * + *
+   * Output only. The earliest restorable time that can be restored to. Output
+   * only field.
+   * 
+ * + * + * .google.protobuf.Timestamp earliest_restorable_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the earliestRestorableTime field is set. + */ + boolean hasEarliestRestorableTime(); + /** + * + * + *
+   * Output only. The earliest restorable time that can be restored to. Output
+   * only field.
+   * 
+ * + * + * .google.protobuf.Timestamp earliest_restorable_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The earliestRestorableTime. + */ + com.google.protobuf.Timestamp getEarliestRestorableTime(); + /** + * + * + *
+   * Output only. The earliest restorable time that can be restored to. Output
+   * only field.
+   * 
+ * + * + * .google.protobuf.Timestamp earliest_restorable_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getEarliestRestorableTimeOrBuilder(); } diff --git a/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/CreateClusterRequest.java b/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/CreateClusterRequest.java index bdea0c8df20d..3c02eeb285c7 100644 --- a/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/CreateClusterRequest.java +++ b/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/CreateClusterRequest.java @@ -72,7 +72,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { * * *
-   * Required. The name of the parent resource. For the required format, see the
+   * Required. The location of the new cluster. For the required format, see the
    * comment on the Cluster.name field.
    * 
* @@ -98,7 +98,7 @@ public java.lang.String getParent() { * * *
-   * Required. The name of the parent resource. For the required format, see the
+   * Required. The location of the new cluster. For the required format, see the
    * comment on the Cluster.name field.
    * 
* @@ -771,7 +771,7 @@ public Builder mergeFrom( * * *
-     * Required. The name of the parent resource. For the required format, see the
+     * Required. The location of the new cluster. For the required format, see the
      * comment on the Cluster.name field.
      * 
* @@ -796,7 +796,7 @@ public java.lang.String getParent() { * * *
-     * Required. The name of the parent resource. For the required format, see the
+     * Required. The location of the new cluster. For the required format, see the
      * comment on the Cluster.name field.
      * 
* @@ -821,7 +821,7 @@ public com.google.protobuf.ByteString getParentBytes() { * * *
-     * Required. The name of the parent resource. For the required format, see the
+     * Required. The location of the new cluster. For the required format, see the
      * comment on the Cluster.name field.
      * 
* @@ -845,7 +845,7 @@ public Builder setParent(java.lang.String value) { * * *
-     * Required. The name of the parent resource. For the required format, see the
+     * Required. The location of the new cluster. For the required format, see the
      * comment on the Cluster.name field.
      * 
* @@ -865,7 +865,7 @@ public Builder clearParent() { * * *
-     * Required. The name of the parent resource. For the required format, see the
+     * Required. The location of the new cluster. For the required format, see the
      * comment on the Cluster.name field.
      * 
* diff --git a/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/CreateClusterRequestOrBuilder.java b/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/CreateClusterRequestOrBuilder.java index b7baea721687..53733edca894 100644 --- a/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/CreateClusterRequestOrBuilder.java +++ b/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/CreateClusterRequestOrBuilder.java @@ -27,7 +27,7 @@ public interface CreateClusterRequestOrBuilder * * *
-   * Required. The name of the parent resource. For the required format, see the
+   * Required. The location of the new cluster. For the required format, see the
    * comment on the Cluster.name field.
    * 
* @@ -42,7 +42,7 @@ public interface CreateClusterRequestOrBuilder * * *
-   * Required. The name of the parent resource. For the required format, see the
+   * Required. The location of the new cluster. For the required format, see the
    * comment on the Cluster.name field.
    * 
* diff --git a/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/CreateSecondaryClusterRequest.java b/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/CreateSecondaryClusterRequest.java index 9e769a69c18a..3bf6ff438f2f 100644 --- a/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/CreateSecondaryClusterRequest.java +++ b/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/CreateSecondaryClusterRequest.java @@ -64,8 +64,8 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { * * *
-   * Required. The name of the parent resource (the primary cluster). For the
-   * required format, see the comment on the Cluster.name field.
+   * Required. The location of the new cluster. For the required
+   * format, see the comment on the Cluster.name field.
    * 
* * @@ -90,8 +90,8 @@ public java.lang.String getParent() { * * *
-   * Required. The name of the parent resource (the primary cluster). For the
-   * required format, see the comment on the Cluster.name field.
+   * Required. The location of the new cluster. For the required
+   * format, see the comment on the Cluster.name field.
    * 
* * @@ -759,8 +759,8 @@ public Builder mergeFrom( * * *
-     * Required. The name of the parent resource (the primary cluster). For the
-     * required format, see the comment on the Cluster.name field.
+     * Required. The location of the new cluster. For the required
+     * format, see the comment on the Cluster.name field.
      * 
* * @@ -784,8 +784,8 @@ public java.lang.String getParent() { * * *
-     * Required. The name of the parent resource (the primary cluster). For the
-     * required format, see the comment on the Cluster.name field.
+     * Required. The location of the new cluster. For the required
+     * format, see the comment on the Cluster.name field.
      * 
* * @@ -809,8 +809,8 @@ public com.google.protobuf.ByteString getParentBytes() { * * *
-     * Required. The name of the parent resource (the primary cluster). For the
-     * required format, see the comment on the Cluster.name field.
+     * Required. The location of the new cluster. For the required
+     * format, see the comment on the Cluster.name field.
      * 
* * @@ -833,8 +833,8 @@ public Builder setParent(java.lang.String value) { * * *
-     * Required. The name of the parent resource (the primary cluster). For the
-     * required format, see the comment on the Cluster.name field.
+     * Required. The location of the new cluster. For the required
+     * format, see the comment on the Cluster.name field.
      * 
* * @@ -853,8 +853,8 @@ public Builder clearParent() { * * *
-     * Required. The name of the parent resource (the primary cluster). For the
-     * required format, see the comment on the Cluster.name field.
+     * Required. The location of the new cluster. For the required
+     * format, see the comment on the Cluster.name field.
      * 
* * diff --git a/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/CreateSecondaryClusterRequestOrBuilder.java b/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/CreateSecondaryClusterRequestOrBuilder.java index 83fcf6dd3618..944bb75d84d3 100644 --- a/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/CreateSecondaryClusterRequestOrBuilder.java +++ b/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/CreateSecondaryClusterRequestOrBuilder.java @@ -27,8 +27,8 @@ public interface CreateSecondaryClusterRequestOrBuilder * * *
-   * Required. The name of the parent resource (the primary cluster). For the
-   * required format, see the comment on the Cluster.name field.
+   * Required. The location of the new cluster. For the required
+   * format, see the comment on the Cluster.name field.
    * 
* * @@ -42,8 +42,8 @@ public interface CreateSecondaryClusterRequestOrBuilder * * *
-   * Required. The name of the parent resource (the primary cluster). For the
-   * required format, see the comment on the Cluster.name field.
+   * Required. The location of the new cluster. For the required
+   * format, see the comment on the Cluster.name field.
    * 
* * diff --git a/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/CreateUserRequest.java b/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/CreateUserRequest.java new file mode 100644 index 000000000000..bf632650cafd --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/CreateUserRequest.java @@ -0,0 +1,1451 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/alloydb/v1beta/service.proto + +package com.google.cloud.alloydb.v1beta; + +/** + * + * + *
+ * Message for creating a User
+ * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1beta.CreateUserRequest} + */ +public final class CreateUserRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.alloydb.v1beta.CreateUserRequest) + CreateUserRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use CreateUserRequest.newBuilder() to construct. + private CreateUserRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private CreateUserRequest() { + parent_ = ""; + userId_ = ""; + requestId_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new CreateUserRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.alloydb.v1beta.ServiceProto + .internal_static_google_cloud_alloydb_v1beta_CreateUserRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1beta.ServiceProto + .internal_static_google_cloud_alloydb_v1beta_CreateUserRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1beta.CreateUserRequest.class, + com.google.cloud.alloydb.v1beta.CreateUserRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object parent_ = ""; + /** + * + * + *
+   * Required. Value for parent.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + @java.lang.Override + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } + } + /** + * + * + *
+   * Required. Value for parent.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + @java.lang.Override + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int USER_ID_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object userId_ = ""; + /** + * + * + *
+   * Required. ID of the requesting object.
+   * 
+ * + * string user_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The userId. + */ + @java.lang.Override + public java.lang.String getUserId() { + java.lang.Object ref = userId_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + userId_ = s; + return s; + } + } + /** + * + * + *
+   * Required. ID of the requesting object.
+   * 
+ * + * string user_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for userId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getUserIdBytes() { + java.lang.Object ref = userId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + userId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int USER_FIELD_NUMBER = 3; + private com.google.cloud.alloydb.v1beta.User user_; + /** + * + * + *
+   * Required. The resource being created
+   * 
+ * + * .google.cloud.alloydb.v1beta.User user = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the user field is set. + */ + @java.lang.Override + public boolean hasUser() { + return user_ != null; + } + /** + * + * + *
+   * Required. The resource being created
+   * 
+ * + * .google.cloud.alloydb.v1beta.User user = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The user. + */ + @java.lang.Override + public com.google.cloud.alloydb.v1beta.User getUser() { + return user_ == null ? com.google.cloud.alloydb.v1beta.User.getDefaultInstance() : user_; + } + /** + * + * + *
+   * Required. The resource being created
+   * 
+ * + * .google.cloud.alloydb.v1beta.User user = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.alloydb.v1beta.UserOrBuilder getUserOrBuilder() { + return user_ == null ? com.google.cloud.alloydb.v1beta.User.getDefaultInstance() : user_; + } + + public static final int REQUEST_ID_FIELD_NUMBER = 4; + + @SuppressWarnings("serial") + private volatile java.lang.Object 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).
+   * 
+ * + * string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The requestId. + */ + @java.lang.Override + public java.lang.String getRequestId() { + java.lang.Object ref = requestId_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + requestId_ = s; + return s; + } + } + /** + * + * + *
+   * Optional. An optional request ID to identify requests. Specify a unique
+   * request ID so that if you must retry your request, the server will know to
+   * ignore the request if it has already been completed. The server will
+   * guarantee that for at least 60 minutes since the first request.
+   *
+   * For example, consider a situation where you make an initial request and
+   * the request times out. If you make the request again with the same request
+   * ID, the server can check if original operation with the same request ID
+   * was received, and if so, will ignore the second request. This prevents
+   * clients from accidentally creating duplicate commitments.
+   *
+   * The request ID must be a valid UUID with the exception that zero UUID is
+   * not supported (00000000-0000-0000-0000-000000000000).
+   * 
+ * + * string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for requestId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getRequestIdBytes() { + java.lang.Object ref = requestId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + requestId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int VALIDATE_ONLY_FIELD_NUMBER = 5; + private boolean validateOnly_ = false; + /** + * + * + *
+   * Optional. If set, the backend validates the request, but doesn't actually
+   * execute it.
+   * 
+ * + * bool validate_only = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The validateOnly. + */ + @java.lang.Override + public boolean getValidateOnly() { + return validateOnly_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(userId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, userId_); + } + if (user_ != null) { + output.writeMessage(3, getUser()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(requestId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, requestId_); + } + if (validateOnly_ != false) { + output.writeBool(5, validateOnly_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(userId_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, userId_); + } + if (user_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getUser()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(requestId_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, requestId_); + } + if (validateOnly_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(5, validateOnly_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.alloydb.v1beta.CreateUserRequest)) { + return super.equals(obj); + } + com.google.cloud.alloydb.v1beta.CreateUserRequest other = + (com.google.cloud.alloydb.v1beta.CreateUserRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (!getUserId().equals(other.getUserId())) return false; + if (hasUser() != other.hasUser()) return false; + if (hasUser()) { + if (!getUser().equals(other.getUser())) return false; + } + if (!getRequestId().equals(other.getRequestId())) return false; + if (getValidateOnly() != other.getValidateOnly()) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + PARENT_FIELD_NUMBER; + hash = (53 * hash) + getParent().hashCode(); + hash = (37 * hash) + USER_ID_FIELD_NUMBER; + hash = (53 * hash) + getUserId().hashCode(); + if (hasUser()) { + hash = (37 * hash) + USER_FIELD_NUMBER; + hash = (53 * hash) + getUser().hashCode(); + } + hash = (37 * hash) + REQUEST_ID_FIELD_NUMBER; + hash = (53 * hash) + getRequestId().hashCode(); + hash = (37 * hash) + VALIDATE_ONLY_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getValidateOnly()); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.alloydb.v1beta.CreateUserRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1beta.CreateUserRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.alloydb.v1beta.CreateUserRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1beta.CreateUserRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.alloydb.v1beta.CreateUserRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1beta.CreateUserRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.alloydb.v1beta.CreateUserRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1beta.CreateUserRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.alloydb.v1beta.CreateUserRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1beta.CreateUserRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.alloydb.v1beta.CreateUserRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1beta.CreateUserRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.alloydb.v1beta.CreateUserRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Message for creating a User
+   * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1beta.CreateUserRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.alloydb.v1beta.CreateUserRequest) + com.google.cloud.alloydb.v1beta.CreateUserRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.alloydb.v1beta.ServiceProto + .internal_static_google_cloud_alloydb_v1beta_CreateUserRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1beta.ServiceProto + .internal_static_google_cloud_alloydb_v1beta_CreateUserRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1beta.CreateUserRequest.class, + com.google.cloud.alloydb.v1beta.CreateUserRequest.Builder.class); + } + + // Construct using com.google.cloud.alloydb.v1beta.CreateUserRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + parent_ = ""; + userId_ = ""; + user_ = null; + if (userBuilder_ != null) { + userBuilder_.dispose(); + userBuilder_ = null; + } + requestId_ = ""; + validateOnly_ = false; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.alloydb.v1beta.ServiceProto + .internal_static_google_cloud_alloydb_v1beta_CreateUserRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1beta.CreateUserRequest getDefaultInstanceForType() { + return com.google.cloud.alloydb.v1beta.CreateUserRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.alloydb.v1beta.CreateUserRequest build() { + com.google.cloud.alloydb.v1beta.CreateUserRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1beta.CreateUserRequest buildPartial() { + com.google.cloud.alloydb.v1beta.CreateUserRequest result = + new com.google.cloud.alloydb.v1beta.CreateUserRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.alloydb.v1beta.CreateUserRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.parent_ = parent_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.userId_ = userId_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.user_ = userBuilder_ == null ? user_ : userBuilder_.build(); + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.requestId_ = requestId_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.validateOnly_ = validateOnly_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.alloydb.v1beta.CreateUserRequest) { + return mergeFrom((com.google.cloud.alloydb.v1beta.CreateUserRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.alloydb.v1beta.CreateUserRequest other) { + if (other == com.google.cloud.alloydb.v1beta.CreateUserRequest.getDefaultInstance()) + return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getUserId().isEmpty()) { + userId_ = other.userId_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (other.hasUser()) { + mergeUser(other.getUser()); + } + if (!other.getRequestId().isEmpty()) { + requestId_ = other.requestId_; + bitField0_ |= 0x00000008; + onChanged(); + } + if (other.getValidateOnly() != false) { + setValidateOnly(other.getValidateOnly()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + parent_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + userId_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + input.readMessage(getUserFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 34: + { + requestId_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000008; + break; + } // case 34 + case 40: + { + validateOnly_ = input.readBool(); + bitField0_ |= 0x00000010; + break; + } // case 40 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * Required. Value for parent.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. Value for parent.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. Value for parent.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The parent to set. + * @return This builder for chaining. + */ + public Builder setParent(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + parent_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Value for parent.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearParent() { + parent_ = getDefaultInstance().getParent(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Value for parent.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for parent to set. + * @return This builder for chaining. + */ + public Builder setParentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + parent_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object userId_ = ""; + /** + * + * + *
+     * Required. ID of the requesting object.
+     * 
+ * + * string user_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The userId. + */ + public java.lang.String getUserId() { + java.lang.Object ref = userId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + userId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. ID of the requesting object.
+     * 
+ * + * string user_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for userId. + */ + public com.google.protobuf.ByteString getUserIdBytes() { + java.lang.Object ref = userId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + userId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. ID of the requesting object.
+     * 
+ * + * string user_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The userId to set. + * @return This builder for chaining. + */ + public Builder setUserId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + userId_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. ID of the requesting object.
+     * 
+ * + * string user_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearUserId() { + userId_ = getDefaultInstance().getUserId(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. ID of the requesting object.
+     * 
+ * + * string user_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for userId to set. + * @return This builder for chaining. + */ + public Builder setUserIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + userId_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private com.google.cloud.alloydb.v1beta.User user_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1beta.User, + com.google.cloud.alloydb.v1beta.User.Builder, + com.google.cloud.alloydb.v1beta.UserOrBuilder> + userBuilder_; + /** + * + * + *
+     * Required. The resource being created
+     * 
+ * + * .google.cloud.alloydb.v1beta.User user = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the user field is set. + */ + public boolean hasUser() { + return ((bitField0_ & 0x00000004) != 0); + } + /** + * + * + *
+     * Required. The resource being created
+     * 
+ * + * .google.cloud.alloydb.v1beta.User user = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The user. + */ + public com.google.cloud.alloydb.v1beta.User getUser() { + if (userBuilder_ == null) { + return user_ == null ? com.google.cloud.alloydb.v1beta.User.getDefaultInstance() : user_; + } else { + return userBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. The resource being created
+     * 
+ * + * .google.cloud.alloydb.v1beta.User user = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setUser(com.google.cloud.alloydb.v1beta.User value) { + if (userBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + user_ = value; + } else { + userBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The resource being created
+     * 
+ * + * .google.cloud.alloydb.v1beta.User user = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setUser(com.google.cloud.alloydb.v1beta.User.Builder builderForValue) { + if (userBuilder_ == null) { + user_ = builderForValue.build(); + } else { + userBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The resource being created
+     * 
+ * + * .google.cloud.alloydb.v1beta.User user = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeUser(com.google.cloud.alloydb.v1beta.User value) { + if (userBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) + && user_ != null + && user_ != com.google.cloud.alloydb.v1beta.User.getDefaultInstance()) { + getUserBuilder().mergeFrom(value); + } else { + user_ = value; + } + } else { + userBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The resource being created
+     * 
+ * + * .google.cloud.alloydb.v1beta.User user = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearUser() { + bitField0_ = (bitField0_ & ~0x00000004); + user_ = null; + if (userBuilder_ != null) { + userBuilder_.dispose(); + userBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The resource being created
+     * 
+ * + * .google.cloud.alloydb.v1beta.User user = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.alloydb.v1beta.User.Builder getUserBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return getUserFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. The resource being created
+     * 
+ * + * .google.cloud.alloydb.v1beta.User user = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.alloydb.v1beta.UserOrBuilder getUserOrBuilder() { + if (userBuilder_ != null) { + return userBuilder_.getMessageOrBuilder(); + } else { + return user_ == null ? com.google.cloud.alloydb.v1beta.User.getDefaultInstance() : user_; + } + } + /** + * + * + *
+     * Required. The resource being created
+     * 
+ * + * .google.cloud.alloydb.v1beta.User user = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1beta.User, + com.google.cloud.alloydb.v1beta.User.Builder, + com.google.cloud.alloydb.v1beta.UserOrBuilder> + getUserFieldBuilder() { + if (userBuilder_ == null) { + userBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1beta.User, + com.google.cloud.alloydb.v1beta.User.Builder, + com.google.cloud.alloydb.v1beta.UserOrBuilder>( + getUser(), getParentForChildren(), isClean()); + user_ = null; + } + return userBuilder_; + } + + private java.lang.Object 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).
+     * 
+ * + * string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The requestId. + */ + public java.lang.String getRequestId() { + java.lang.Object ref = requestId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + requestId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes since the first request.
+     *
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     *
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for requestId. + */ + public com.google.protobuf.ByteString getRequestIdBytes() { + java.lang.Object ref = requestId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + requestId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes since the first request.
+     *
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     *
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The requestId to set. + * @return This builder for chaining. + */ + public Builder setRequestId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + requestId_ = value; + bitField0_ |= 0x00000008; + onChanged(); + 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).
+     * 
+ * + * string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearRequestId() { + requestId_ = getDefaultInstance().getRequestId(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + 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).
+     * 
+ * + * string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for requestId to set. + * @return This builder for chaining. + */ + public Builder setRequestIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + requestId_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + private boolean validateOnly_; + /** + * + * + *
+     * Optional. If set, the backend validates the request, but doesn't actually
+     * execute it.
+     * 
+ * + * bool validate_only = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The validateOnly. + */ + @java.lang.Override + public boolean getValidateOnly() { + return validateOnly_; + } + /** + * + * + *
+     * Optional. If set, the backend validates the request, but doesn't actually
+     * execute it.
+     * 
+ * + * bool validate_only = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The validateOnly to set. + * @return This builder for chaining. + */ + public Builder setValidateOnly(boolean value) { + + validateOnly_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. If set, the backend validates the request, but doesn't actually
+     * execute it.
+     * 
+ * + * bool validate_only = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearValidateOnly() { + bitField0_ = (bitField0_ & ~0x00000010); + validateOnly_ = false; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.alloydb.v1beta.CreateUserRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.alloydb.v1beta.CreateUserRequest) + private static final com.google.cloud.alloydb.v1beta.CreateUserRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.alloydb.v1beta.CreateUserRequest(); + } + + public static com.google.cloud.alloydb.v1beta.CreateUserRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CreateUserRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1beta.CreateUserRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/CreateUserRequestOrBuilder.java b/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/CreateUserRequestOrBuilder.java new file mode 100644 index 000000000000..cf53f106a0af --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/CreateUserRequestOrBuilder.java @@ -0,0 +1,180 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/alloydb/v1beta/service.proto + +package com.google.cloud.alloydb.v1beta; + +public interface CreateUserRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.alloydb.v1beta.CreateUserRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Value for parent.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. Value for parent.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * Required. ID of the requesting object.
+   * 
+ * + * string user_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The userId. + */ + java.lang.String getUserId(); + /** + * + * + *
+   * Required. ID of the requesting object.
+   * 
+ * + * string user_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for userId. + */ + com.google.protobuf.ByteString getUserIdBytes(); + + /** + * + * + *
+   * Required. The resource being created
+   * 
+ * + * .google.cloud.alloydb.v1beta.User user = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the user field is set. + */ + boolean hasUser(); + /** + * + * + *
+   * Required. The resource being created
+   * 
+ * + * .google.cloud.alloydb.v1beta.User user = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The user. + */ + com.google.cloud.alloydb.v1beta.User getUser(); + /** + * + * + *
+   * Required. The resource being created
+   * 
+ * + * .google.cloud.alloydb.v1beta.User user = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.alloydb.v1beta.UserOrBuilder getUserOrBuilder(); + + /** + * + * + *
+   * Optional. An optional request ID to identify requests. Specify a unique
+   * request ID so that if you must retry your request, the server will know to
+   * ignore the request if it has already been completed. The server will
+   * guarantee that for at least 60 minutes since the first request.
+   *
+   * For example, consider a situation where you make an initial request and
+   * the request times out. If you make the request again with the same request
+   * ID, the server can check if original operation with the same request ID
+   * was received, and if so, will ignore the second request. This prevents
+   * clients from accidentally creating duplicate commitments.
+   *
+   * The request ID must be a valid UUID with the exception that zero UUID is
+   * not supported (00000000-0000-0000-0000-000000000000).
+   * 
+ * + * string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The requestId. + */ + java.lang.String getRequestId(); + /** + * + * + *
+   * Optional. An optional request ID to identify requests. Specify a unique
+   * request ID so that if you must retry your request, the server will know to
+   * ignore the request if it has already been completed. The server will
+   * guarantee that for at least 60 minutes since the first request.
+   *
+   * For example, consider a situation where you make an initial request and
+   * the request times out. If you make the request again with the same request
+   * ID, the server can check if original operation with the same request ID
+   * was received, and if so, will ignore the second request. This prevents
+   * clients from accidentally creating duplicate commitments.
+   *
+   * The request ID must be a valid UUID with the exception that zero UUID is
+   * not supported (00000000-0000-0000-0000-000000000000).
+   * 
+ * + * string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for requestId. + */ + com.google.protobuf.ByteString getRequestIdBytes(); + + /** + * + * + *
+   * Optional. If set, the backend validates the request, but doesn't actually
+   * execute it.
+   * 
+ * + * bool validate_only = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The validateOnly. + */ + boolean getValidateOnly(); +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/DatabaseVersion.java b/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/DatabaseVersion.java index 3f0f25305036..39b8c3a85d43 100644 --- a/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/DatabaseVersion.java +++ b/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/DatabaseVersion.java @@ -152,7 +152,7 @@ public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType } public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { - return com.google.cloud.alloydb.v1beta.ResourcesProto.getDescriptor().getEnumTypes().get(0); + return com.google.cloud.alloydb.v1beta.ResourcesProto.getDescriptor().getEnumTypes().get(2); } private static final DatabaseVersion[] VALUES = values(); diff --git a/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/DeleteUserRequest.java b/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/DeleteUserRequest.java new file mode 100644 index 000000000000..f9cd5b9f9489 --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/DeleteUserRequest.java @@ -0,0 +1,1008 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/alloydb/v1beta/service.proto + +package com.google.cloud.alloydb.v1beta; + +/** + * + * + *
+ * Message for deleting a User
+ * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1beta.DeleteUserRequest} + */ +public final class DeleteUserRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.alloydb.v1beta.DeleteUserRequest) + DeleteUserRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use DeleteUserRequest.newBuilder() to construct. + private DeleteUserRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private DeleteUserRequest() { + name_ = ""; + requestId_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new DeleteUserRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.alloydb.v1beta.ServiceProto + .internal_static_google_cloud_alloydb_v1beta_DeleteUserRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1beta.ServiceProto + .internal_static_google_cloud_alloydb_v1beta_DeleteUserRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1beta.DeleteUserRequest.class, + com.google.cloud.alloydb.v1beta.DeleteUserRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + * + * + *
+   * Required. The name of the resource. For the required format, see the
+   * comment on the User.name field.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The name of the resource. For the required format, see the
+   * comment on the User.name field.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int REQUEST_ID_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object 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).
+   * 
+ * + * string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The requestId. + */ + @java.lang.Override + public java.lang.String getRequestId() { + java.lang.Object ref = requestId_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + requestId_ = s; + return s; + } + } + /** + * + * + *
+   * Optional. An optional request ID to identify requests. Specify a unique
+   * request ID so that if you must retry your request, the server will know to
+   * ignore the request if it has already been completed. The server will
+   * guarantee that for at least 60 minutes after the first request.
+   *
+   * For example, consider a situation where you make an initial request and
+   * the request times out. If you make the request again with the same request
+   * ID, the server can check if original operation with the same request ID
+   * was received, and if so, will ignore the second request. This prevents
+   * clients from accidentally creating duplicate commitments.
+   *
+   * The request ID must be a valid UUID with the exception that zero UUID is
+   * not supported (00000000-0000-0000-0000-000000000000).
+   * 
+ * + * string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for requestId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getRequestIdBytes() { + java.lang.Object ref = requestId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + requestId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int VALIDATE_ONLY_FIELD_NUMBER = 3; + private boolean validateOnly_ = false; + /** + * + * + *
+   * Optional. If set, the backend validates the request, but doesn't actually
+   * execute it.
+   * 
+ * + * bool validate_only = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The validateOnly. + */ + @java.lang.Override + public boolean getValidateOnly() { + return validateOnly_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(requestId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, requestId_); + } + if (validateOnly_ != false) { + output.writeBool(3, validateOnly_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(requestId_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, requestId_); + } + if (validateOnly_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(3, validateOnly_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.alloydb.v1beta.DeleteUserRequest)) { + return super.equals(obj); + } + com.google.cloud.alloydb.v1beta.DeleteUserRequest other = + (com.google.cloud.alloydb.v1beta.DeleteUserRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (!getRequestId().equals(other.getRequestId())) return false; + if (getValidateOnly() != other.getValidateOnly()) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (37 * hash) + REQUEST_ID_FIELD_NUMBER; + hash = (53 * hash) + getRequestId().hashCode(); + hash = (37 * hash) + VALIDATE_ONLY_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getValidateOnly()); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.alloydb.v1beta.DeleteUserRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1beta.DeleteUserRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.alloydb.v1beta.DeleteUserRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1beta.DeleteUserRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.alloydb.v1beta.DeleteUserRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1beta.DeleteUserRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.alloydb.v1beta.DeleteUserRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1beta.DeleteUserRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.alloydb.v1beta.DeleteUserRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1beta.DeleteUserRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.alloydb.v1beta.DeleteUserRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1beta.DeleteUserRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.alloydb.v1beta.DeleteUserRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Message for deleting a User
+   * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1beta.DeleteUserRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.alloydb.v1beta.DeleteUserRequest) + com.google.cloud.alloydb.v1beta.DeleteUserRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.alloydb.v1beta.ServiceProto + .internal_static_google_cloud_alloydb_v1beta_DeleteUserRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1beta.ServiceProto + .internal_static_google_cloud_alloydb_v1beta_DeleteUserRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1beta.DeleteUserRequest.class, + com.google.cloud.alloydb.v1beta.DeleteUserRequest.Builder.class); + } + + // Construct using com.google.cloud.alloydb.v1beta.DeleteUserRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + requestId_ = ""; + validateOnly_ = false; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.alloydb.v1beta.ServiceProto + .internal_static_google_cloud_alloydb_v1beta_DeleteUserRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1beta.DeleteUserRequest getDefaultInstanceForType() { + return com.google.cloud.alloydb.v1beta.DeleteUserRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.alloydb.v1beta.DeleteUserRequest build() { + com.google.cloud.alloydb.v1beta.DeleteUserRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1beta.DeleteUserRequest buildPartial() { + com.google.cloud.alloydb.v1beta.DeleteUserRequest result = + new com.google.cloud.alloydb.v1beta.DeleteUserRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.alloydb.v1beta.DeleteUserRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.requestId_ = requestId_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.validateOnly_ = validateOnly_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.alloydb.v1beta.DeleteUserRequest) { + return mergeFrom((com.google.cloud.alloydb.v1beta.DeleteUserRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.alloydb.v1beta.DeleteUserRequest other) { + if (other == com.google.cloud.alloydb.v1beta.DeleteUserRequest.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getRequestId().isEmpty()) { + requestId_ = other.requestId_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (other.getValidateOnly() != false) { + setValidateOnly(other.getValidateOnly()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + requestId_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 24: + { + validateOnly_ = input.readBool(); + bitField0_ |= 0x00000004; + break; + } // case 24 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. The name of the resource. For the required format, see the
+     * comment on the User.name field.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The name of the resource. For the required format, see the
+     * comment on the User.name field.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The name of the resource. For the required format, see the
+     * comment on the User.name field.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the resource. For the required format, see the
+     * comment on the User.name field.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the resource. For the required format, see the
+     * comment on the User.name field.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object 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).
+     * 
+ * + * string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The requestId. + */ + public java.lang.String getRequestId() { + java.lang.Object ref = requestId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + requestId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes after the first request.
+     *
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     *
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for requestId. + */ + public com.google.protobuf.ByteString getRequestIdBytes() { + java.lang.Object ref = requestId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + requestId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes after the first request.
+     *
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     *
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The requestId to set. + * @return This builder for chaining. + */ + public Builder setRequestId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + requestId_ = value; + bitField0_ |= 0x00000002; + onChanged(); + 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).
+     * 
+ * + * string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearRequestId() { + requestId_ = getDefaultInstance().getRequestId(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + 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).
+     * 
+ * + * string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for requestId to set. + * @return This builder for chaining. + */ + public Builder setRequestIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + requestId_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private boolean validateOnly_; + /** + * + * + *
+     * Optional. If set, the backend validates the request, but doesn't actually
+     * execute it.
+     * 
+ * + * bool validate_only = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The validateOnly. + */ + @java.lang.Override + public boolean getValidateOnly() { + return validateOnly_; + } + /** + * + * + *
+     * Optional. If set, the backend validates the request, but doesn't actually
+     * execute it.
+     * 
+ * + * bool validate_only = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The validateOnly to set. + * @return This builder for chaining. + */ + public Builder setValidateOnly(boolean value) { + + validateOnly_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. If set, the backend validates the request, but doesn't actually
+     * execute it.
+     * 
+ * + * bool validate_only = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearValidateOnly() { + bitField0_ = (bitField0_ & ~0x00000004); + validateOnly_ = false; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.alloydb.v1beta.DeleteUserRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.alloydb.v1beta.DeleteUserRequest) + private static final com.google.cloud.alloydb.v1beta.DeleteUserRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.alloydb.v1beta.DeleteUserRequest(); + } + + public static com.google.cloud.alloydb.v1beta.DeleteUserRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DeleteUserRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1beta.DeleteUserRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/DeleteUserRequestOrBuilder.java b/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/DeleteUserRequestOrBuilder.java new file mode 100644 index 000000000000..757096167d77 --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/DeleteUserRequestOrBuilder.java @@ -0,0 +1,119 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/alloydb/v1beta/service.proto + +package com.google.cloud.alloydb.v1beta; + +public interface DeleteUserRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.alloydb.v1beta.DeleteUserRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The name of the resource. For the required format, see the
+   * comment on the User.name field.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. The name of the resource. For the required format, see the
+   * comment on the User.name field.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * Optional. An optional request ID to identify requests. Specify a unique
+   * request ID so that if you must retry your request, the server will know to
+   * ignore the request if it has already been completed. The server will
+   * guarantee that for at least 60 minutes after the first request.
+   *
+   * For example, consider a situation where you make an initial request and
+   * the request times out. If you make the request again with the same request
+   * ID, the server can check if original operation with the same request ID
+   * was received, and if so, will ignore the second request. This prevents
+   * clients from accidentally creating duplicate commitments.
+   *
+   * The request ID must be a valid UUID with the exception that zero UUID is
+   * not supported (00000000-0000-0000-0000-000000000000).
+   * 
+ * + * string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The requestId. + */ + java.lang.String getRequestId(); + /** + * + * + *
+   * Optional. An optional request ID to identify requests. Specify a unique
+   * request ID so that if you must retry your request, the server will know to
+   * ignore the request if it has already been completed. The server will
+   * guarantee that for at least 60 minutes after the first request.
+   *
+   * For example, consider a situation where you make an initial request and
+   * the request times out. If you make the request again with the same request
+   * ID, the server can check if original operation with the same request ID
+   * was received, and if so, will ignore the second request. This prevents
+   * clients from accidentally creating duplicate commitments.
+   *
+   * The request ID must be a valid UUID with the exception that zero UUID is
+   * not supported (00000000-0000-0000-0000-000000000000).
+   * 
+ * + * string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for requestId. + */ + com.google.protobuf.ByteString getRequestIdBytes(); + + /** + * + * + *
+   * Optional. If set, the backend validates the request, but doesn't actually
+   * execute it.
+   * 
+ * + * bool validate_only = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The validateOnly. + */ + boolean getValidateOnly(); +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/GenerateClientCertificateRequest.java b/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/GenerateClientCertificateRequest.java index 4a1ad807d161..bdf9508939ca 100644 --- a/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/GenerateClientCertificateRequest.java +++ b/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/GenerateClientCertificateRequest.java @@ -43,6 +43,7 @@ private GenerateClientCertificateRequest() { parent_ = ""; requestId_ = ""; pemCsr_ = ""; + publicKey_ = ""; } @java.lang.Override @@ -209,11 +210,14 @@ public com.google.protobuf.ByteString getRequestIdBytes() { * Optional. A pem-encoded X.509 certificate signing request (CSR). * * - * string pem_csr = 3 [(.google.api.field_behavior) = OPTIONAL]; + * string pem_csr = 3 [deprecated = true, (.google.api.field_behavior) = OPTIONAL]; * + * @deprecated google.cloud.alloydb.v1beta.GenerateClientCertificateRequest.pem_csr is deprecated. + * See google/cloud/alloydb/v1beta/service.proto;l=1351 * @return The pemCsr. */ @java.lang.Override + @java.lang.Deprecated public java.lang.String getPemCsr() { java.lang.Object ref = pemCsr_; if (ref instanceof java.lang.String) { @@ -232,11 +236,14 @@ public java.lang.String getPemCsr() { * Optional. A pem-encoded X.509 certificate signing request (CSR). * * - * string pem_csr = 3 [(.google.api.field_behavior) = OPTIONAL]; + * string pem_csr = 3 [deprecated = true, (.google.api.field_behavior) = OPTIONAL]; * + * @deprecated google.cloud.alloydb.v1beta.GenerateClientCertificateRequest.pem_csr is deprecated. + * See google/cloud/alloydb/v1beta/service.proto;l=1351 * @return The bytes for pemCsr. */ @java.lang.Override + @java.lang.Deprecated public com.google.protobuf.ByteString getPemCsrBytes() { java.lang.Object ref = pemCsr_; if (ref instanceof java.lang.String) { @@ -314,6 +321,57 @@ public com.google.protobuf.DurationOrBuilder getCertDurationOrBuilder() { : certDuration_; } + public static final int PUBLIC_KEY_FIELD_NUMBER = 5; + + @SuppressWarnings("serial") + private volatile java.lang.Object publicKey_ = ""; + /** + * + * + *
+   * Optional. The public key from the client.
+   * 
+ * + * string public_key = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The publicKey. + */ + @java.lang.Override + public java.lang.String getPublicKey() { + java.lang.Object ref = publicKey_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + publicKey_ = s; + return s; + } + } + /** + * + * + *
+   * Optional. The public key from the client.
+   * 
+ * + * string public_key = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for publicKey. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPublicKeyBytes() { + java.lang.Object ref = publicKey_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + publicKey_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + private byte memoizedIsInitialized = -1; @java.lang.Override @@ -340,6 +398,9 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (certDuration_ != null) { output.writeMessage(4, getCertDuration()); } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(publicKey_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 5, publicKey_); + } getUnknownFields().writeTo(output); } @@ -361,6 +422,9 @@ public int getSerializedSize() { if (certDuration_ != null) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, getCertDuration()); } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(publicKey_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, publicKey_); + } size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; @@ -384,6 +448,7 @@ public boolean equals(final java.lang.Object obj) { if (hasCertDuration()) { if (!getCertDuration().equals(other.getCertDuration())) return false; } + if (!getPublicKey().equals(other.getPublicKey())) return false; if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -405,6 +470,8 @@ public int hashCode() { hash = (37 * hash) + CERT_DURATION_FIELD_NUMBER; hash = (53 * hash) + getCertDuration().hashCode(); } + hash = (37 * hash) + PUBLIC_KEY_FIELD_NUMBER; + hash = (53 * hash) + getPublicKey().hashCode(); hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; @@ -554,6 +621,7 @@ public Builder clear() { certDurationBuilder_.dispose(); certDurationBuilder_ = null; } + publicKey_ = ""; return this; } @@ -605,6 +673,9 @@ private void buildPartial0( result.certDuration_ = certDurationBuilder_ == null ? certDuration_ : certDurationBuilder_.build(); } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.publicKey_ = publicKey_; + } } @java.lang.Override @@ -673,6 +744,11 @@ public Builder mergeFrom( if (other.hasCertDuration()) { mergeCertDuration(other.getCertDuration()); } + if (!other.getPublicKey().isEmpty()) { + publicKey_ = other.publicKey_; + bitField0_ |= 0x00000010; + onChanged(); + } this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; @@ -723,6 +799,12 @@ public Builder mergeFrom( bitField0_ |= 0x00000008; break; } // case 34 + case 42: + { + publicKey_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000010; + break; + } // case 42 default: { if (!super.parseUnknownField(input, extensionRegistry, tag)) { @@ -1037,10 +1119,13 @@ public Builder setRequestIdBytes(com.google.protobuf.ByteString value) { * Optional. A pem-encoded X.509 certificate signing request (CSR). * * - * string pem_csr = 3 [(.google.api.field_behavior) = OPTIONAL]; + * string pem_csr = 3 [deprecated = true, (.google.api.field_behavior) = OPTIONAL]; * + * @deprecated google.cloud.alloydb.v1beta.GenerateClientCertificateRequest.pem_csr is + * deprecated. See google/cloud/alloydb/v1beta/service.proto;l=1351 * @return The pemCsr. */ + @java.lang.Deprecated public java.lang.String getPemCsr() { java.lang.Object ref = pemCsr_; if (!(ref instanceof java.lang.String)) { @@ -1059,10 +1144,13 @@ public java.lang.String getPemCsr() { * Optional. A pem-encoded X.509 certificate signing request (CSR). * * - * string pem_csr = 3 [(.google.api.field_behavior) = OPTIONAL]; + * string pem_csr = 3 [deprecated = true, (.google.api.field_behavior) = OPTIONAL]; * + * @deprecated google.cloud.alloydb.v1beta.GenerateClientCertificateRequest.pem_csr is + * deprecated. See google/cloud/alloydb/v1beta/service.proto;l=1351 * @return The bytes for pemCsr. */ + @java.lang.Deprecated public com.google.protobuf.ByteString getPemCsrBytes() { java.lang.Object ref = pemCsr_; if (ref instanceof String) { @@ -1081,11 +1169,14 @@ public com.google.protobuf.ByteString getPemCsrBytes() { * Optional. A pem-encoded X.509 certificate signing request (CSR). * * - * string pem_csr = 3 [(.google.api.field_behavior) = OPTIONAL]; + * string pem_csr = 3 [deprecated = true, (.google.api.field_behavior) = OPTIONAL]; * + * @deprecated google.cloud.alloydb.v1beta.GenerateClientCertificateRequest.pem_csr is + * deprecated. See google/cloud/alloydb/v1beta/service.proto;l=1351 * @param value The pemCsr to set. * @return This builder for chaining. */ + @java.lang.Deprecated public Builder setPemCsr(java.lang.String value) { if (value == null) { throw new NullPointerException(); @@ -1102,10 +1193,13 @@ public Builder setPemCsr(java.lang.String value) { * Optional. A pem-encoded X.509 certificate signing request (CSR). * * - * string pem_csr = 3 [(.google.api.field_behavior) = OPTIONAL]; + * string pem_csr = 3 [deprecated = true, (.google.api.field_behavior) = OPTIONAL]; * + * @deprecated google.cloud.alloydb.v1beta.GenerateClientCertificateRequest.pem_csr is + * deprecated. See google/cloud/alloydb/v1beta/service.proto;l=1351 * @return This builder for chaining. */ + @java.lang.Deprecated public Builder clearPemCsr() { pemCsr_ = getDefaultInstance().getPemCsr(); bitField0_ = (bitField0_ & ~0x00000004); @@ -1119,11 +1213,14 @@ public Builder clearPemCsr() { * Optional. A pem-encoded X.509 certificate signing request (CSR). * * - * string pem_csr = 3 [(.google.api.field_behavior) = OPTIONAL]; + * string pem_csr = 3 [deprecated = true, (.google.api.field_behavior) = OPTIONAL]; * + * @deprecated google.cloud.alloydb.v1beta.GenerateClientCertificateRequest.pem_csr is + * deprecated. See google/cloud/alloydb/v1beta/service.proto;l=1351 * @param value The bytes for pemCsr to set. * @return This builder for chaining. */ + @java.lang.Deprecated public Builder setPemCsrBytes(com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); @@ -1363,6 +1460,112 @@ public com.google.protobuf.DurationOrBuilder getCertDurationOrBuilder() { return certDurationBuilder_; } + private java.lang.Object publicKey_ = ""; + /** + * + * + *
+     * Optional. The public key from the client.
+     * 
+ * + * string public_key = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The publicKey. + */ + public java.lang.String getPublicKey() { + java.lang.Object ref = publicKey_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + publicKey_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Optional. The public key from the client.
+     * 
+ * + * string public_key = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for publicKey. + */ + public com.google.protobuf.ByteString getPublicKeyBytes() { + java.lang.Object ref = publicKey_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + publicKey_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Optional. The public key from the client.
+     * 
+ * + * string public_key = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The publicKey to set. + * @return This builder for chaining. + */ + public Builder setPublicKey(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + publicKey_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The public key from the client.
+     * 
+ * + * string public_key = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearPublicKey() { + publicKey_ = getDefaultInstance().getPublicKey(); + bitField0_ = (bitField0_ & ~0x00000010); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The public key from the client.
+     * 
+ * + * string public_key = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for publicKey to set. + * @return This builder for chaining. + */ + public Builder setPublicKeyBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + publicKey_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + @java.lang.Override public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { return super.setUnknownFields(unknownFields); diff --git a/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/GenerateClientCertificateRequestOrBuilder.java b/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/GenerateClientCertificateRequestOrBuilder.java index a2f27e2aae65..a7aacac55fcb 100644 --- a/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/GenerateClientCertificateRequestOrBuilder.java +++ b/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/GenerateClientCertificateRequestOrBuilder.java @@ -110,10 +110,13 @@ public interface GenerateClientCertificateRequestOrBuilder * Optional. A pem-encoded X.509 certificate signing request (CSR). * * - * string pem_csr = 3 [(.google.api.field_behavior) = OPTIONAL]; + * string pem_csr = 3 [deprecated = true, (.google.api.field_behavior) = OPTIONAL]; * + * @deprecated google.cloud.alloydb.v1beta.GenerateClientCertificateRequest.pem_csr is deprecated. + * See google/cloud/alloydb/v1beta/service.proto;l=1351 * @return The pemCsr. */ + @java.lang.Deprecated java.lang.String getPemCsr(); /** * @@ -122,10 +125,13 @@ public interface GenerateClientCertificateRequestOrBuilder * Optional. A pem-encoded X.509 certificate signing request (CSR). * * - * string pem_csr = 3 [(.google.api.field_behavior) = OPTIONAL]; + * string pem_csr = 3 [deprecated = true, (.google.api.field_behavior) = OPTIONAL]; * + * @deprecated google.cloud.alloydb.v1beta.GenerateClientCertificateRequest.pem_csr is deprecated. + * See google/cloud/alloydb/v1beta/service.proto;l=1351 * @return The bytes for pemCsr. */ + @java.lang.Deprecated com.google.protobuf.ByteString getPemCsrBytes(); /** @@ -177,4 +183,29 @@ public interface GenerateClientCertificateRequestOrBuilder *
*/ com.google.protobuf.DurationOrBuilder getCertDurationOrBuilder(); + + /** + * + * + *
+   * Optional. The public key from the client.
+   * 
+ * + * string public_key = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The publicKey. + */ + java.lang.String getPublicKey(); + /** + * + * + *
+   * Optional. The public key from the client.
+   * 
+ * + * string public_key = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for publicKey. + */ + com.google.protobuf.ByteString getPublicKeyBytes(); } diff --git a/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/GenerateClientCertificateResponse.java b/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/GenerateClientCertificateResponse.java index 34675f2a2253..fbfc7b0256f3 100644 --- a/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/GenerateClientCertificateResponse.java +++ b/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/GenerateClientCertificateResponse.java @@ -41,6 +41,7 @@ private GenerateClientCertificateResponse( private GenerateClientCertificateResponse() { pemCertificate_ = ""; pemCertificateChain_ = com.google.protobuf.LazyStringArrayList.emptyList(); + caCert_ = ""; } @java.lang.Override @@ -187,6 +188,57 @@ public com.google.protobuf.ByteString getPemCertificateChainBytes(int index) { return pemCertificateChain_.getByteString(index); } + public static final int CA_CERT_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object caCert_ = ""; + /** + * + * + *
+   * Optional. The pem-encoded cluster ca X.509 certificate.
+   * 
+ * + * string ca_cert = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The caCert. + */ + @java.lang.Override + public java.lang.String getCaCert() { + java.lang.Object ref = caCert_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + caCert_ = s; + return s; + } + } + /** + * + * + *
+   * Optional. The pem-encoded cluster ca X.509 certificate.
+   * 
+ * + * string ca_cert = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for caCert. + */ + @java.lang.Override + public com.google.protobuf.ByteString getCaCertBytes() { + java.lang.Object ref = caCert_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + caCert_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + private byte memoizedIsInitialized = -1; @java.lang.Override @@ -207,6 +259,9 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io for (int i = 0; i < pemCertificateChain_.size(); i++) { com.google.protobuf.GeneratedMessageV3.writeString(output, 2, pemCertificateChain_.getRaw(i)); } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(caCert_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, caCert_); + } getUnknownFields().writeTo(output); } @@ -227,6 +282,9 @@ public int getSerializedSize() { size += dataSize; size += 1 * getPemCertificateChainList().size(); } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(caCert_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, caCert_); + } size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; @@ -245,6 +303,7 @@ public boolean equals(final java.lang.Object obj) { if (!getPemCertificate().equals(other.getPemCertificate())) return false; if (!getPemCertificateChainList().equals(other.getPemCertificateChainList())) return false; + if (!getCaCert().equals(other.getCaCert())) return false; if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -262,6 +321,8 @@ public int hashCode() { hash = (37 * hash) + PEM_CERTIFICATE_CHAIN_FIELD_NUMBER; hash = (53 * hash) + getPemCertificateChainList().hashCode(); } + hash = (37 * hash) + CA_CERT_FIELD_NUMBER; + hash = (53 * hash) + getCaCert().hashCode(); hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; @@ -406,6 +467,7 @@ public Builder clear() { bitField0_ = 0; pemCertificate_ = ""; pemCertificateChain_ = com.google.protobuf.LazyStringArrayList.emptyList(); + caCert_ = ""; return this; } @@ -451,6 +513,9 @@ private void buildPartial0( pemCertificateChain_.makeImmutable(); result.pemCertificateChain_ = pemCertificateChain_; } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.caCert_ = caCert_; + } } @java.lang.Override @@ -516,6 +581,11 @@ public Builder mergeFrom( } onChanged(); } + if (!other.getCaCert().isEmpty()) { + caCert_ = other.caCert_; + bitField0_ |= 0x00000004; + onChanged(); + } this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; @@ -555,6 +625,12 @@ public Builder mergeFrom( pemCertificateChain_.add(s); break; } // case 18 + case 26: + { + caCert_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 default: { if (!super.parseUnknownField(input, extensionRegistry, tag)) { @@ -872,6 +948,112 @@ public Builder addPemCertificateChainBytes(com.google.protobuf.ByteString value) return this; } + private java.lang.Object caCert_ = ""; + /** + * + * + *
+     * Optional. The pem-encoded cluster ca X.509 certificate.
+     * 
+ * + * string ca_cert = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The caCert. + */ + public java.lang.String getCaCert() { + java.lang.Object ref = caCert_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + caCert_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Optional. The pem-encoded cluster ca X.509 certificate.
+     * 
+ * + * string ca_cert = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for caCert. + */ + public com.google.protobuf.ByteString getCaCertBytes() { + java.lang.Object ref = caCert_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + caCert_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Optional. The pem-encoded cluster ca X.509 certificate.
+     * 
+ * + * string ca_cert = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The caCert to set. + * @return This builder for chaining. + */ + public Builder setCaCert(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + caCert_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The pem-encoded cluster ca X.509 certificate.
+     * 
+ * + * string ca_cert = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearCaCert() { + caCert_ = getDefaultInstance().getCaCert(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The pem-encoded cluster ca X.509 certificate.
+     * 
+ * + * string ca_cert = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for caCert to set. + * @return This builder for chaining. + */ + public Builder setCaCertBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + caCert_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + @java.lang.Override public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { return super.setUnknownFields(unknownFields); diff --git a/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/GenerateClientCertificateResponseOrBuilder.java b/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/GenerateClientCertificateResponseOrBuilder.java index 4d12d272a3c6..1dee5e4edb1f 100644 --- a/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/GenerateClientCertificateResponseOrBuilder.java +++ b/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/GenerateClientCertificateResponseOrBuilder.java @@ -106,4 +106,29 @@ public interface GenerateClientCertificateResponseOrBuilder * @return The bytes of the pemCertificateChain at the given index. */ com.google.protobuf.ByteString getPemCertificateChainBytes(int index); + + /** + * + * + *
+   * Optional. The pem-encoded cluster ca X.509 certificate.
+   * 
+ * + * string ca_cert = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The caCert. + */ + java.lang.String getCaCert(); + /** + * + * + *
+   * Optional. The pem-encoded cluster ca X.509 certificate.
+   * 
+ * + * string ca_cert = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for caCert. + */ + com.google.protobuf.ByteString getCaCertBytes(); } diff --git a/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/GetClusterRequest.java b/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/GetClusterRequest.java index 61a149818745..c844832408a2 100644 --- a/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/GetClusterRequest.java +++ b/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/GetClusterRequest.java @@ -39,6 +39,7 @@ private GetClusterRequest(com.google.protobuf.GeneratedMessageV3.Builder buil private GetClusterRequest() { name_ = ""; + view_ = 0; } @java.lang.Override @@ -119,6 +120,47 @@ public com.google.protobuf.ByteString getNameBytes() { } } + public static final int VIEW_FIELD_NUMBER = 2; + private int view_ = 0; + /** + * + * + *
+   * Optional. The view of the cluster to return. Returns all default fields if
+   * not set.
+   * 
+ * + * + * .google.cloud.alloydb.v1beta.ClusterView view = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The enum numeric value on the wire for view. + */ + @java.lang.Override + public int getViewValue() { + return view_; + } + /** + * + * + *
+   * Optional. The view of the cluster to return. Returns all default fields if
+   * not set.
+   * 
+ * + * + * .google.cloud.alloydb.v1beta.ClusterView view = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The view. + */ + @java.lang.Override + public com.google.cloud.alloydb.v1beta.ClusterView getView() { + com.google.cloud.alloydb.v1beta.ClusterView result = + com.google.cloud.alloydb.v1beta.ClusterView.forNumber(view_); + return result == null ? com.google.cloud.alloydb.v1beta.ClusterView.UNRECOGNIZED : result; + } + private byte memoizedIsInitialized = -1; @java.lang.Override @@ -136,6 +178,9 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); } + if (view_ != com.google.cloud.alloydb.v1beta.ClusterView.CLUSTER_VIEW_UNSPECIFIED.getNumber()) { + output.writeEnum(2, view_); + } getUnknownFields().writeTo(output); } @@ -148,6 +193,9 @@ public int getSerializedSize() { if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); } + if (view_ != com.google.cloud.alloydb.v1beta.ClusterView.CLUSTER_VIEW_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(2, view_); + } size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; @@ -165,6 +213,7 @@ public boolean equals(final java.lang.Object obj) { (com.google.cloud.alloydb.v1beta.GetClusterRequest) obj; if (!getName().equals(other.getName())) return false; + if (view_ != other.view_) return false; if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -178,6 +227,8 @@ public int hashCode() { hash = (19 * hash) + getDescriptor().hashCode(); hash = (37 * hash) + NAME_FIELD_NUMBER; hash = (53 * hash) + getName().hashCode(); + hash = (37 * hash) + VIEW_FIELD_NUMBER; + hash = (53 * hash) + view_; hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; @@ -318,6 +369,7 @@ public Builder clear() { super.clear(); bitField0_ = 0; name_ = ""; + view_ = 0; return this; } @@ -357,6 +409,9 @@ private void buildPartial0(com.google.cloud.alloydb.v1beta.GetClusterRequest res if (((from_bitField0_ & 0x00000001) != 0)) { result.name_ = name_; } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.view_ = view_; + } } @java.lang.Override @@ -410,6 +465,9 @@ public Builder mergeFrom(com.google.cloud.alloydb.v1beta.GetClusterRequest other bitField0_ |= 0x00000001; onChanged(); } + if (other.view_ != 0) { + setViewValue(other.getViewValue()); + } this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; @@ -442,6 +500,12 @@ public Builder mergeFrom( bitField0_ |= 0x00000001; break; } // case 10 + case 16: + { + view_ = input.readEnum(); + bitField0_ |= 0x00000002; + break; + } // case 16 default: { if (!super.parseUnknownField(input, extensionRegistry, tag)) { @@ -582,6 +646,111 @@ public Builder setNameBytes(com.google.protobuf.ByteString value) { return this; } + private int view_ = 0; + /** + * + * + *
+     * Optional. The view of the cluster to return. Returns all default fields if
+     * not set.
+     * 
+ * + * + * .google.cloud.alloydb.v1beta.ClusterView view = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The enum numeric value on the wire for view. + */ + @java.lang.Override + public int getViewValue() { + return view_; + } + /** + * + * + *
+     * Optional. The view of the cluster to return. Returns all default fields if
+     * not set.
+     * 
+ * + * + * .google.cloud.alloydb.v1beta.ClusterView view = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param value The enum numeric value on the wire for view to set. + * @return This builder for chaining. + */ + public Builder setViewValue(int value) { + view_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The view of the cluster to return. Returns all default fields if
+     * not set.
+     * 
+ * + * + * .google.cloud.alloydb.v1beta.ClusterView view = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The view. + */ + @java.lang.Override + public com.google.cloud.alloydb.v1beta.ClusterView getView() { + com.google.cloud.alloydb.v1beta.ClusterView result = + com.google.cloud.alloydb.v1beta.ClusterView.forNumber(view_); + return result == null ? com.google.cloud.alloydb.v1beta.ClusterView.UNRECOGNIZED : result; + } + /** + * + * + *
+     * Optional. The view of the cluster to return. Returns all default fields if
+     * not set.
+     * 
+ * + * + * .google.cloud.alloydb.v1beta.ClusterView view = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param value The view to set. + * @return This builder for chaining. + */ + public Builder setView(com.google.cloud.alloydb.v1beta.ClusterView value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000002; + view_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The view of the cluster to return. Returns all default fields if
+     * not set.
+     * 
+ * + * + * .google.cloud.alloydb.v1beta.ClusterView view = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return This builder for chaining. + */ + public Builder clearView() { + bitField0_ = (bitField0_ & ~0x00000002); + view_ = 0; + onChanged(); + return this; + } + @java.lang.Override public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { return super.setUnknownFields(unknownFields); diff --git a/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/GetClusterRequestOrBuilder.java b/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/GetClusterRequestOrBuilder.java index cd4ecd4c0da8..290b41367fb8 100644 --- a/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/GetClusterRequestOrBuilder.java +++ b/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/GetClusterRequestOrBuilder.java @@ -53,4 +53,35 @@ public interface GetClusterRequestOrBuilder * @return The bytes for name. */ com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * Optional. The view of the cluster to return. Returns all default fields if
+   * not set.
+   * 
+ * + * + * .google.cloud.alloydb.v1beta.ClusterView view = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The enum numeric value on the wire for view. + */ + int getViewValue(); + /** + * + * + *
+   * Optional. The view of the cluster to return. Returns all default fields if
+   * not set.
+   * 
+ * + * + * .google.cloud.alloydb.v1beta.ClusterView view = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The view. + */ + com.google.cloud.alloydb.v1beta.ClusterView getView(); } diff --git a/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/GetUserRequest.java b/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/GetUserRequest.java new file mode 100644 index 000000000000..dc0f15beb2f9 --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/GetUserRequest.java @@ -0,0 +1,644 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/alloydb/v1beta/service.proto + +package com.google.cloud.alloydb.v1beta; + +/** + * + * + *
+ * Message for getting a User
+ * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1beta.GetUserRequest} + */ +public final class GetUserRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.alloydb.v1beta.GetUserRequest) + GetUserRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use GetUserRequest.newBuilder() to construct. + private GetUserRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private GetUserRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new GetUserRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.alloydb.v1beta.ServiceProto + .internal_static_google_cloud_alloydb_v1beta_GetUserRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1beta.ServiceProto + .internal_static_google_cloud_alloydb_v1beta_GetUserRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1beta.GetUserRequest.class, + com.google.cloud.alloydb.v1beta.GetUserRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + * + * + *
+   * Required. The name of the resource. For the required format, see the
+   * comment on the User.name field.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The name of the resource. For the required format, see the
+   * comment on the User.name field.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.alloydb.v1beta.GetUserRequest)) { + return super.equals(obj); + } + com.google.cloud.alloydb.v1beta.GetUserRequest other = + (com.google.cloud.alloydb.v1beta.GetUserRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.alloydb.v1beta.GetUserRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1beta.GetUserRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.alloydb.v1beta.GetUserRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1beta.GetUserRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.alloydb.v1beta.GetUserRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1beta.GetUserRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.alloydb.v1beta.GetUserRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1beta.GetUserRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.alloydb.v1beta.GetUserRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1beta.GetUserRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.alloydb.v1beta.GetUserRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1beta.GetUserRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.alloydb.v1beta.GetUserRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Message for getting a User
+   * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1beta.GetUserRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.alloydb.v1beta.GetUserRequest) + com.google.cloud.alloydb.v1beta.GetUserRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.alloydb.v1beta.ServiceProto + .internal_static_google_cloud_alloydb_v1beta_GetUserRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1beta.ServiceProto + .internal_static_google_cloud_alloydb_v1beta_GetUserRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1beta.GetUserRequest.class, + com.google.cloud.alloydb.v1beta.GetUserRequest.Builder.class); + } + + // Construct using com.google.cloud.alloydb.v1beta.GetUserRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.alloydb.v1beta.ServiceProto + .internal_static_google_cloud_alloydb_v1beta_GetUserRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1beta.GetUserRequest getDefaultInstanceForType() { + return com.google.cloud.alloydb.v1beta.GetUserRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.alloydb.v1beta.GetUserRequest build() { + com.google.cloud.alloydb.v1beta.GetUserRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1beta.GetUserRequest buildPartial() { + com.google.cloud.alloydb.v1beta.GetUserRequest result = + new com.google.cloud.alloydb.v1beta.GetUserRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.alloydb.v1beta.GetUserRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.alloydb.v1beta.GetUserRequest) { + return mergeFrom((com.google.cloud.alloydb.v1beta.GetUserRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.alloydb.v1beta.GetUserRequest other) { + if (other == com.google.cloud.alloydb.v1beta.GetUserRequest.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. The name of the resource. For the required format, see the
+     * comment on the User.name field.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The name of the resource. For the required format, see the
+     * comment on the User.name field.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The name of the resource. For the required format, see the
+     * comment on the User.name field.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the resource. For the required format, see the
+     * comment on the User.name field.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the resource. For the required format, see the
+     * comment on the User.name field.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.alloydb.v1beta.GetUserRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.alloydb.v1beta.GetUserRequest) + private static final com.google.cloud.alloydb.v1beta.GetUserRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.alloydb.v1beta.GetUserRequest(); + } + + public static com.google.cloud.alloydb.v1beta.GetUserRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GetUserRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1beta.GetUserRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/GetUserRequestOrBuilder.java b/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/GetUserRequestOrBuilder.java new file mode 100644 index 000000000000..7eabfce51dbe --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/GetUserRequestOrBuilder.java @@ -0,0 +1,56 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/alloydb/v1beta/service.proto + +package com.google.cloud.alloydb.v1beta; + +public interface GetUserRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.alloydb.v1beta.GetUserRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The name of the resource. For the required format, see the
+   * comment on the User.name field.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. The name of the resource. For the required format, see the
+   * comment on the User.name field.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/InjectFaultRequest.java b/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/InjectFaultRequest.java new file mode 100644 index 000000000000..ea2d8a6f7319 --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/InjectFaultRequest.java @@ -0,0 +1,1321 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/alloydb/v1beta/service.proto + +package com.google.cloud.alloydb.v1beta; + +/** + * + * + *
+ * Message for triggering fault injection on an instance
+ * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1beta.InjectFaultRequest} + */ +public final class InjectFaultRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.alloydb.v1beta.InjectFaultRequest) + InjectFaultRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use InjectFaultRequest.newBuilder() to construct. + private InjectFaultRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private InjectFaultRequest() { + faultType_ = 0; + name_ = ""; + requestId_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new InjectFaultRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.alloydb.v1beta.ServiceProto + .internal_static_google_cloud_alloydb_v1beta_InjectFaultRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1beta.ServiceProto + .internal_static_google_cloud_alloydb_v1beta_InjectFaultRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1beta.InjectFaultRequest.class, + com.google.cloud.alloydb.v1beta.InjectFaultRequest.Builder.class); + } + + /** + * + * + *
+   * FaultType contains all valid types of faults that can be injected to an
+   * instance.
+   * 
+ * + * Protobuf enum {@code google.cloud.alloydb.v1beta.InjectFaultRequest.FaultType} + */ + public enum FaultType implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * The fault type is unknown.
+     * 
+ * + * FAULT_TYPE_UNSPECIFIED = 0; + */ + FAULT_TYPE_UNSPECIFIED(0), + /** + * + * + *
+     * Stop the VM
+     * 
+ * + * STOP_VM = 1; + */ + STOP_VM(1), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * The fault type is unknown.
+     * 
+ * + * FAULT_TYPE_UNSPECIFIED = 0; + */ + public static final int FAULT_TYPE_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * Stop the VM
+     * 
+ * + * STOP_VM = 1; + */ + public static final int STOP_VM_VALUE = 1; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static FaultType valueOf(int value) { + return forNumber(value); + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + */ + public static FaultType forNumber(int value) { + switch (value) { + case 0: + return FAULT_TYPE_UNSPECIFIED; + case 1: + return STOP_VM; + default: + return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap internalGetValueMap() { + return internalValueMap; + } + + private static final com.google.protobuf.Internal.EnumLiteMap internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public FaultType findValueByNumber(int number) { + return FaultType.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + return getDescriptor().getValues().get(ordinal()); + } + + public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { + return getDescriptor(); + } + + public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.cloud.alloydb.v1beta.InjectFaultRequest.getDescriptor() + .getEnumTypes() + .get(0); + } + + private static final FaultType[] VALUES = values(); + + public static FaultType valueOf(com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException("EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private FaultType(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.alloydb.v1beta.InjectFaultRequest.FaultType) + } + + public static final int FAULT_TYPE_FIELD_NUMBER = 1; + private int faultType_ = 0; + /** + * + * + *
+   * Required. The type of fault to be injected in an instance.
+   * 
+ * + * + * .google.cloud.alloydb.v1beta.InjectFaultRequest.FaultType fault_type = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The enum numeric value on the wire for faultType. + */ + @java.lang.Override + public int getFaultTypeValue() { + return faultType_; + } + /** + * + * + *
+   * Required. The type of fault to be injected in an instance.
+   * 
+ * + * + * .google.cloud.alloydb.v1beta.InjectFaultRequest.FaultType fault_type = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The faultType. + */ + @java.lang.Override + public com.google.cloud.alloydb.v1beta.InjectFaultRequest.FaultType getFaultType() { + com.google.cloud.alloydb.v1beta.InjectFaultRequest.FaultType result = + com.google.cloud.alloydb.v1beta.InjectFaultRequest.FaultType.forNumber(faultType_); + return result == null + ? com.google.cloud.alloydb.v1beta.InjectFaultRequest.FaultType.UNRECOGNIZED + : result; + } + + public static final int NAME_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + * + * + *
+   * Required. The name of the resource. For the required format, see the
+   * comment on the Instance.name field.
+   * 
+ * + * + * string name = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The name of the resource. For the required format, see the
+   * comment on the Instance.name field.
+   * 
+ * + * + * string name = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int REQUEST_ID_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object 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).
+   * 
+ * + * string request_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The requestId. + */ + @java.lang.Override + public java.lang.String getRequestId() { + java.lang.Object ref = requestId_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + requestId_ = s; + return s; + } + } + /** + * + * + *
+   * Optional. An optional request ID to identify requests. Specify a unique
+   * request ID so that if you must retry your request, the server will know to
+   * ignore the request if it has already been completed. The server will
+   * guarantee that for at least 60 minutes after the first request.
+   *
+   * For example, consider a situation where you make an initial request and
+   * the request times out. If you make the request again with the same request
+   * ID, the server can check if original operation with the same request ID
+   * was received, and if so, will ignore the second request. This prevents
+   * clients from accidentally creating duplicate commitments.
+   *
+   * The request ID must be a valid UUID with the exception that zero UUID is
+   * not supported (00000000-0000-0000-0000-000000000000).
+   * 
+ * + * string request_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for requestId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getRequestIdBytes() { + java.lang.Object ref = requestId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + requestId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int VALIDATE_ONLY_FIELD_NUMBER = 4; + private boolean validateOnly_ = false; + /** + * + * + *
+   * Optional. If set, performs request validation (e.g. permission checks and
+   * any other type of validation), but do not actually execute the fault
+   * injection.
+   * 
+ * + * bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The validateOnly. + */ + @java.lang.Override + public boolean getValidateOnly() { + return validateOnly_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (faultType_ + != com.google.cloud.alloydb.v1beta.InjectFaultRequest.FaultType.FAULT_TYPE_UNSPECIFIED + .getNumber()) { + output.writeEnum(1, faultType_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, name_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(requestId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, requestId_); + } + if (validateOnly_ != false) { + output.writeBool(4, validateOnly_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (faultType_ + != com.google.cloud.alloydb.v1beta.InjectFaultRequest.FaultType.FAULT_TYPE_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(1, faultType_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, name_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(requestId_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, requestId_); + } + if (validateOnly_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(4, validateOnly_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.alloydb.v1beta.InjectFaultRequest)) { + return super.equals(obj); + } + com.google.cloud.alloydb.v1beta.InjectFaultRequest other = + (com.google.cloud.alloydb.v1beta.InjectFaultRequest) obj; + + if (faultType_ != other.faultType_) return false; + if (!getName().equals(other.getName())) return false; + if (!getRequestId().equals(other.getRequestId())) return false; + if (getValidateOnly() != other.getValidateOnly()) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + FAULT_TYPE_FIELD_NUMBER; + hash = (53 * hash) + faultType_; + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (37 * hash) + REQUEST_ID_FIELD_NUMBER; + hash = (53 * hash) + getRequestId().hashCode(); + hash = (37 * hash) + VALIDATE_ONLY_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getValidateOnly()); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.alloydb.v1beta.InjectFaultRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1beta.InjectFaultRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.alloydb.v1beta.InjectFaultRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1beta.InjectFaultRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.alloydb.v1beta.InjectFaultRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1beta.InjectFaultRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.alloydb.v1beta.InjectFaultRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1beta.InjectFaultRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.alloydb.v1beta.InjectFaultRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1beta.InjectFaultRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.alloydb.v1beta.InjectFaultRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1beta.InjectFaultRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.alloydb.v1beta.InjectFaultRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Message for triggering fault injection on an instance
+   * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1beta.InjectFaultRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.alloydb.v1beta.InjectFaultRequest) + com.google.cloud.alloydb.v1beta.InjectFaultRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.alloydb.v1beta.ServiceProto + .internal_static_google_cloud_alloydb_v1beta_InjectFaultRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1beta.ServiceProto + .internal_static_google_cloud_alloydb_v1beta_InjectFaultRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1beta.InjectFaultRequest.class, + com.google.cloud.alloydb.v1beta.InjectFaultRequest.Builder.class); + } + + // Construct using com.google.cloud.alloydb.v1beta.InjectFaultRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + faultType_ = 0; + name_ = ""; + requestId_ = ""; + validateOnly_ = false; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.alloydb.v1beta.ServiceProto + .internal_static_google_cloud_alloydb_v1beta_InjectFaultRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1beta.InjectFaultRequest getDefaultInstanceForType() { + return com.google.cloud.alloydb.v1beta.InjectFaultRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.alloydb.v1beta.InjectFaultRequest build() { + com.google.cloud.alloydb.v1beta.InjectFaultRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1beta.InjectFaultRequest buildPartial() { + com.google.cloud.alloydb.v1beta.InjectFaultRequest result = + new com.google.cloud.alloydb.v1beta.InjectFaultRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.alloydb.v1beta.InjectFaultRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.faultType_ = faultType_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.name_ = name_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.requestId_ = requestId_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.validateOnly_ = validateOnly_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.alloydb.v1beta.InjectFaultRequest) { + return mergeFrom((com.google.cloud.alloydb.v1beta.InjectFaultRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.alloydb.v1beta.InjectFaultRequest other) { + if (other == com.google.cloud.alloydb.v1beta.InjectFaultRequest.getDefaultInstance()) + return this; + if (other.faultType_ != 0) { + setFaultTypeValue(other.getFaultTypeValue()); + } + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (!other.getRequestId().isEmpty()) { + requestId_ = other.requestId_; + bitField0_ |= 0x00000004; + onChanged(); + } + if (other.getValidateOnly() != false) { + setValidateOnly(other.getValidateOnly()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: + { + faultType_ = input.readEnum(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 18: + { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + requestId_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 32: + { + validateOnly_ = input.readBool(); + bitField0_ |= 0x00000008; + break; + } // case 32 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private int faultType_ = 0; + /** + * + * + *
+     * Required. The type of fault to be injected in an instance.
+     * 
+ * + * + * .google.cloud.alloydb.v1beta.InjectFaultRequest.FaultType fault_type = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The enum numeric value on the wire for faultType. + */ + @java.lang.Override + public int getFaultTypeValue() { + return faultType_; + } + /** + * + * + *
+     * Required. The type of fault to be injected in an instance.
+     * 
+ * + * + * .google.cloud.alloydb.v1beta.InjectFaultRequest.FaultType fault_type = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @param value The enum numeric value on the wire for faultType to set. + * @return This builder for chaining. + */ + public Builder setFaultTypeValue(int value) { + faultType_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The type of fault to be injected in an instance.
+     * 
+ * + * + * .google.cloud.alloydb.v1beta.InjectFaultRequest.FaultType fault_type = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The faultType. + */ + @java.lang.Override + public com.google.cloud.alloydb.v1beta.InjectFaultRequest.FaultType getFaultType() { + com.google.cloud.alloydb.v1beta.InjectFaultRequest.FaultType result = + com.google.cloud.alloydb.v1beta.InjectFaultRequest.FaultType.forNumber(faultType_); + return result == null + ? com.google.cloud.alloydb.v1beta.InjectFaultRequest.FaultType.UNRECOGNIZED + : result; + } + /** + * + * + *
+     * Required. The type of fault to be injected in an instance.
+     * 
+ * + * + * .google.cloud.alloydb.v1beta.InjectFaultRequest.FaultType fault_type = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @param value The faultType to set. + * @return This builder for chaining. + */ + public Builder setFaultType( + com.google.cloud.alloydb.v1beta.InjectFaultRequest.FaultType value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000001; + faultType_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The type of fault to be injected in an instance.
+     * 
+ * + * + * .google.cloud.alloydb.v1beta.InjectFaultRequest.FaultType fault_type = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return This builder for chaining. + */ + public Builder clearFaultType() { + bitField0_ = (bitField0_ & ~0x00000001); + faultType_ = 0; + onChanged(); + return this; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. The name of the resource. For the required format, see the
+     * comment on the Instance.name field.
+     * 
+ * + * + * string name = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The name of the resource. For the required format, see the
+     * comment on the Instance.name field.
+     * 
+ * + * + * string name = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The name of the resource. For the required format, see the
+     * comment on the Instance.name field.
+     * 
+ * + * + * string name = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + name_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the resource. For the required format, see the
+     * comment on the Instance.name field.
+     * 
+ * + * + * string name = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the resource. For the required format, see the
+     * comment on the Instance.name field.
+     * 
+ * + * + * string name = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + name_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private java.lang.Object 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).
+     * 
+ * + * string request_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The requestId. + */ + public java.lang.String getRequestId() { + java.lang.Object ref = requestId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + requestId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes after the first request.
+     *
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     *
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for requestId. + */ + public com.google.protobuf.ByteString getRequestIdBytes() { + java.lang.Object ref = requestId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + requestId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes after the first request.
+     *
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     *
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The requestId to set. + * @return This builder for chaining. + */ + public Builder setRequestId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + requestId_ = value; + bitField0_ |= 0x00000004; + onChanged(); + 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).
+     * 
+ * + * string request_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearRequestId() { + requestId_ = getDefaultInstance().getRequestId(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + 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).
+     * 
+ * + * string request_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for requestId to set. + * @return This builder for chaining. + */ + public Builder setRequestIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + requestId_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + private boolean 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.
+     * 
+ * + * bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The validateOnly. + */ + @java.lang.Override + public boolean getValidateOnly() { + return 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.
+     * 
+ * + * bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The validateOnly to set. + * @return This builder for chaining. + */ + public Builder setValidateOnly(boolean value) { + + validateOnly_ = value; + bitField0_ |= 0x00000008; + onChanged(); + 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.
+     * 
+ * + * bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearValidateOnly() { + bitField0_ = (bitField0_ & ~0x00000008); + validateOnly_ = false; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.alloydb.v1beta.InjectFaultRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.alloydb.v1beta.InjectFaultRequest) + private static final com.google.cloud.alloydb.v1beta.InjectFaultRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.alloydb.v1beta.InjectFaultRequest(); + } + + public static com.google.cloud.alloydb.v1beta.InjectFaultRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public InjectFaultRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1beta.InjectFaultRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/InjectFaultRequestOrBuilder.java b/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/InjectFaultRequestOrBuilder.java new file mode 100644 index 000000000000..e22c11f13974 --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/InjectFaultRequestOrBuilder.java @@ -0,0 +1,149 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/alloydb/v1beta/service.proto + +package com.google.cloud.alloydb.v1beta; + +public interface InjectFaultRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.alloydb.v1beta.InjectFaultRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The type of fault to be injected in an instance.
+   * 
+ * + * + * .google.cloud.alloydb.v1beta.InjectFaultRequest.FaultType fault_type = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The enum numeric value on the wire for faultType. + */ + int getFaultTypeValue(); + /** + * + * + *
+   * Required. The type of fault to be injected in an instance.
+   * 
+ * + * + * .google.cloud.alloydb.v1beta.InjectFaultRequest.FaultType fault_type = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The faultType. + */ + com.google.cloud.alloydb.v1beta.InjectFaultRequest.FaultType getFaultType(); + + /** + * + * + *
+   * Required. The name of the resource. For the required format, see the
+   * comment on the Instance.name field.
+   * 
+ * + * + * string name = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. The name of the resource. For the required format, see the
+   * comment on the Instance.name field.
+   * 
+ * + * + * string name = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * Optional. An optional request ID to identify requests. Specify a unique
+   * request ID so that if you must retry your request, the server will know to
+   * ignore the request if it has already been completed. The server will
+   * guarantee that for at least 60 minutes after the first request.
+   *
+   * For example, consider a situation where you make an initial request and
+   * the request times out. If you make the request again with the same request
+   * ID, the server can check if original operation with the same request ID
+   * was received, and if so, will ignore the second request. This prevents
+   * clients from accidentally creating duplicate commitments.
+   *
+   * The request ID must be a valid UUID with the exception that zero UUID is
+   * not supported (00000000-0000-0000-0000-000000000000).
+   * 
+ * + * string request_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The requestId. + */ + java.lang.String getRequestId(); + /** + * + * + *
+   * Optional. An optional request ID to identify requests. Specify a unique
+   * request ID so that if you must retry your request, the server will know to
+   * ignore the request if it has already been completed. The server will
+   * guarantee that for at least 60 minutes after the first request.
+   *
+   * For example, consider a situation where you make an initial request and
+   * the request times out. If you make the request again with the same request
+   * ID, the server can check if original operation with the same request ID
+   * was received, and if so, will ignore the second request. This prevents
+   * clients from accidentally creating duplicate commitments.
+   *
+   * The request ID must be a valid UUID with the exception that zero UUID is
+   * not supported (00000000-0000-0000-0000-000000000000).
+   * 
+ * + * string request_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for requestId. + */ + com.google.protobuf.ByteString getRequestIdBytes(); + + /** + * + * + *
+   * Optional. If set, performs request validation (e.g. permission checks and
+   * any other type of validation), but do not actually execute the fault
+   * injection.
+   * 
+ * + * bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The validateOnly. + */ + boolean getValidateOnly(); +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/Instance.java b/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/Instance.java index af45a51e17d6..d406d8a41fb5 100644 --- a/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/Instance.java +++ b/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/Instance.java @@ -582,10 +582,11 @@ private InstanceType(int value) { * *
    * The Availability type of an instance. Potential values:
+   *
    * - ZONAL: The instance serves data from only one zone. Outages in that
-   * zone affect instance availability.
+   *     zone affect instance availability.
    * - REGIONAL: The instance can serve data from more than one zone in a
-   * region (it is highly available).
+   *     region (it is highly available).
    * 
* * Protobuf enum {@code google.cloud.alloydb.v1beta.Instance.AvailabilityType} @@ -3687,23 +3688,757 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { com.google.cloud.alloydb.v1beta.Instance.ReadPoolConfig.class, com.google.cloud.alloydb.v1beta.Instance.ReadPoolConfig.Builder.class); } - - public static final int NODE_COUNT_FIELD_NUMBER = 1; - private int nodeCount_ = 0; + + public static final int NODE_COUNT_FIELD_NUMBER = 1; + private int nodeCount_ = 0; + /** + * + * + *
+     * Read capacity, i.e. number of nodes in a read pool instance.
+     * 
+ * + * int32 node_count = 1; + * + * @return The nodeCount. + */ + @java.lang.Override + public int getNodeCount() { + return nodeCount_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (nodeCount_ != 0) { + output.writeInt32(1, nodeCount_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (nodeCount_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(1, nodeCount_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.alloydb.v1beta.Instance.ReadPoolConfig)) { + return super.equals(obj); + } + com.google.cloud.alloydb.v1beta.Instance.ReadPoolConfig other = + (com.google.cloud.alloydb.v1beta.Instance.ReadPoolConfig) obj; + + if (getNodeCount() != other.getNodeCount()) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NODE_COUNT_FIELD_NUMBER; + hash = (53 * hash) + getNodeCount(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.alloydb.v1beta.Instance.ReadPoolConfig parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1beta.Instance.ReadPoolConfig parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.alloydb.v1beta.Instance.ReadPoolConfig parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1beta.Instance.ReadPoolConfig parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.alloydb.v1beta.Instance.ReadPoolConfig parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1beta.Instance.ReadPoolConfig parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.alloydb.v1beta.Instance.ReadPoolConfig parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1beta.Instance.ReadPoolConfig parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.alloydb.v1beta.Instance.ReadPoolConfig parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1beta.Instance.ReadPoolConfig parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.alloydb.v1beta.Instance.ReadPoolConfig parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1beta.Instance.ReadPoolConfig parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.alloydb.v1beta.Instance.ReadPoolConfig prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+     * Configuration for a read pool instance.
+     * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1beta.Instance.ReadPoolConfig} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.alloydb.v1beta.Instance.ReadPoolConfig) + com.google.cloud.alloydb.v1beta.Instance.ReadPoolConfigOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.alloydb.v1beta.ResourcesProto + .internal_static_google_cloud_alloydb_v1beta_Instance_ReadPoolConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1beta.ResourcesProto + .internal_static_google_cloud_alloydb_v1beta_Instance_ReadPoolConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1beta.Instance.ReadPoolConfig.class, + com.google.cloud.alloydb.v1beta.Instance.ReadPoolConfig.Builder.class); + } + + // Construct using com.google.cloud.alloydb.v1beta.Instance.ReadPoolConfig.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + nodeCount_ = 0; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.alloydb.v1beta.ResourcesProto + .internal_static_google_cloud_alloydb_v1beta_Instance_ReadPoolConfig_descriptor; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1beta.Instance.ReadPoolConfig getDefaultInstanceForType() { + return com.google.cloud.alloydb.v1beta.Instance.ReadPoolConfig.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.alloydb.v1beta.Instance.ReadPoolConfig build() { + com.google.cloud.alloydb.v1beta.Instance.ReadPoolConfig result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1beta.Instance.ReadPoolConfig buildPartial() { + com.google.cloud.alloydb.v1beta.Instance.ReadPoolConfig result = + new com.google.cloud.alloydb.v1beta.Instance.ReadPoolConfig(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.alloydb.v1beta.Instance.ReadPoolConfig result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.nodeCount_ = nodeCount_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, + java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.alloydb.v1beta.Instance.ReadPoolConfig) { + return mergeFrom((com.google.cloud.alloydb.v1beta.Instance.ReadPoolConfig) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.alloydb.v1beta.Instance.ReadPoolConfig other) { + if (other == com.google.cloud.alloydb.v1beta.Instance.ReadPoolConfig.getDefaultInstance()) + return this; + if (other.getNodeCount() != 0) { + setNodeCount(other.getNodeCount()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: + { + nodeCount_ = input.readInt32(); + bitField0_ |= 0x00000001; + break; + } // case 8 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private int nodeCount_; + /** + * + * + *
+       * Read capacity, i.e. number of nodes in a read pool instance.
+       * 
+ * + * int32 node_count = 1; + * + * @return The nodeCount. + */ + @java.lang.Override + public int getNodeCount() { + return nodeCount_; + } + /** + * + * + *
+       * Read capacity, i.e. number of nodes in a read pool instance.
+       * 
+ * + * int32 node_count = 1; + * + * @param value The nodeCount to set. + * @return This builder for chaining. + */ + public Builder setNodeCount(int value) { + + nodeCount_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+       * Read capacity, i.e. number of nodes in a read pool instance.
+       * 
+ * + * int32 node_count = 1; + * + * @return This builder for chaining. + */ + public Builder clearNodeCount() { + bitField0_ = (bitField0_ & ~0x00000001); + nodeCount_ = 0; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.alloydb.v1beta.Instance.ReadPoolConfig) + } + + // @@protoc_insertion_point(class_scope:google.cloud.alloydb.v1beta.Instance.ReadPoolConfig) + private static final com.google.cloud.alloydb.v1beta.Instance.ReadPoolConfig DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.alloydb.v1beta.Instance.ReadPoolConfig(); + } + + public static com.google.cloud.alloydb.v1beta.Instance.ReadPoolConfig getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ReadPoolConfig parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1beta.Instance.ReadPoolConfig getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface UpdatePolicyOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.alloydb.v1beta.Instance.UpdatePolicy) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * Mode for updating the instance.
+     * 
+ * + * .google.cloud.alloydb.v1beta.Instance.UpdatePolicy.Mode mode = 1; + * + * @return The enum numeric value on the wire for mode. + */ + int getModeValue(); + /** + * + * + *
+     * Mode for updating the instance.
+     * 
+ * + * .google.cloud.alloydb.v1beta.Instance.UpdatePolicy.Mode mode = 1; + * + * @return The mode. + */ + com.google.cloud.alloydb.v1beta.Instance.UpdatePolicy.Mode getMode(); + } + /** + * + * + *
+   * Policy to be used while updating the instance.
+   * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1beta.Instance.UpdatePolicy} + */ + public static final class UpdatePolicy extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.alloydb.v1beta.Instance.UpdatePolicy) + UpdatePolicyOrBuilder { + private static final long serialVersionUID = 0L; + // Use UpdatePolicy.newBuilder() to construct. + private UpdatePolicy(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private UpdatePolicy() { + mode_ = 0; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new UpdatePolicy(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.alloydb.v1beta.ResourcesProto + .internal_static_google_cloud_alloydb_v1beta_Instance_UpdatePolicy_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1beta.ResourcesProto + .internal_static_google_cloud_alloydb_v1beta_Instance_UpdatePolicy_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1beta.Instance.UpdatePolicy.class, + com.google.cloud.alloydb.v1beta.Instance.UpdatePolicy.Builder.class); + } + + /** + * + * + *
+     * Specifies the available modes of update.
+     * 
+ * + * Protobuf enum {@code google.cloud.alloydb.v1beta.Instance.UpdatePolicy.Mode} + */ + public enum Mode implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+       * Mode is unknown.
+       * 
+ * + * MODE_UNSPECIFIED = 0; + */ + MODE_UNSPECIFIED(0), + /** + * + * + *
+       * Least disruptive way to apply the update.
+       * 
+ * + * DEFAULT = 1; + */ + DEFAULT(1), + /** + * + * + *
+       * Performs a forced update when applicable. This will be fast but may
+       * incur a downtime.
+       * 
+ * + * FORCE_APPLY = 2; + */ + FORCE_APPLY(2), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+       * Mode is unknown.
+       * 
+ * + * MODE_UNSPECIFIED = 0; + */ + public static final int MODE_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+       * Least disruptive way to apply the update.
+       * 
+ * + * DEFAULT = 1; + */ + public static final int DEFAULT_VALUE = 1; + /** + * + * + *
+       * Performs a forced update when applicable. This will be fast but may
+       * incur a downtime.
+       * 
+ * + * FORCE_APPLY = 2; + */ + public static final int FORCE_APPLY_VALUE = 2; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static Mode valueOf(int value) { + return forNumber(value); + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + */ + public static Mode forNumber(int value) { + switch (value) { + case 0: + return MODE_UNSPECIFIED; + case 1: + return DEFAULT; + case 2: + return FORCE_APPLY; + default: + return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap internalGetValueMap() { + return internalValueMap; + } + + private static final com.google.protobuf.Internal.EnumLiteMap internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public Mode findValueByNumber(int number) { + return Mode.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + return getDescriptor().getValues().get(ordinal()); + } + + public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { + return getDescriptor(); + } + + public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.cloud.alloydb.v1beta.Instance.UpdatePolicy.getDescriptor() + .getEnumTypes() + .get(0); + } + + private static final Mode[] VALUES = values(); + + public static Mode valueOf(com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException("EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private Mode(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.alloydb.v1beta.Instance.UpdatePolicy.Mode) + } + + public static final int MODE_FIELD_NUMBER = 1; + private int mode_ = 0; + /** + * + * + *
+     * Mode for updating the instance.
+     * 
+ * + * .google.cloud.alloydb.v1beta.Instance.UpdatePolicy.Mode mode = 1; + * + * @return The enum numeric value on the wire for mode. + */ + @java.lang.Override + public int getModeValue() { + return mode_; + } /** * * *
-     * Read capacity, i.e. number of nodes in a read pool instance.
+     * Mode for updating the instance.
      * 
* - * int32 node_count = 1; + * .google.cloud.alloydb.v1beta.Instance.UpdatePolicy.Mode mode = 1; * - * @return The nodeCount. + * @return The mode. */ @java.lang.Override - public int getNodeCount() { - return nodeCount_; + public com.google.cloud.alloydb.v1beta.Instance.UpdatePolicy.Mode getMode() { + com.google.cloud.alloydb.v1beta.Instance.UpdatePolicy.Mode result = + com.google.cloud.alloydb.v1beta.Instance.UpdatePolicy.Mode.forNumber(mode_); + return result == null + ? com.google.cloud.alloydb.v1beta.Instance.UpdatePolicy.Mode.UNRECOGNIZED + : result; } private byte memoizedIsInitialized = -1; @@ -3720,8 +4455,10 @@ public final boolean isInitialized() { @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (nodeCount_ != 0) { - output.writeInt32(1, nodeCount_); + if (mode_ + != com.google.cloud.alloydb.v1beta.Instance.UpdatePolicy.Mode.MODE_UNSPECIFIED + .getNumber()) { + output.writeEnum(1, mode_); } getUnknownFields().writeTo(output); } @@ -3732,8 +4469,10 @@ public int getSerializedSize() { if (size != -1) return size; size = 0; - if (nodeCount_ != 0) { - size += com.google.protobuf.CodedOutputStream.computeInt32Size(1, nodeCount_); + if (mode_ + != com.google.cloud.alloydb.v1beta.Instance.UpdatePolicy.Mode.MODE_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(1, mode_); } size += getUnknownFields().getSerializedSize(); memoizedSize = size; @@ -3745,13 +4484,13 @@ public boolean equals(final java.lang.Object obj) { if (obj == this) { return true; } - if (!(obj instanceof com.google.cloud.alloydb.v1beta.Instance.ReadPoolConfig)) { + if (!(obj instanceof com.google.cloud.alloydb.v1beta.Instance.UpdatePolicy)) { return super.equals(obj); } - com.google.cloud.alloydb.v1beta.Instance.ReadPoolConfig other = - (com.google.cloud.alloydb.v1beta.Instance.ReadPoolConfig) obj; + com.google.cloud.alloydb.v1beta.Instance.UpdatePolicy other = + (com.google.cloud.alloydb.v1beta.Instance.UpdatePolicy) obj; - if (getNodeCount() != other.getNodeCount()) return false; + if (mode_ != other.mode_) return false; if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -3763,78 +4502,78 @@ public int hashCode() { } int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); - hash = (37 * hash) + NODE_COUNT_FIELD_NUMBER; - hash = (53 * hash) + getNodeCount(); + hash = (37 * hash) + MODE_FIELD_NUMBER; + hash = (53 * hash) + mode_; hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; } - public static com.google.cloud.alloydb.v1beta.Instance.ReadPoolConfig parseFrom( + public static com.google.cloud.alloydb.v1beta.Instance.UpdatePolicy parseFrom( java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static com.google.cloud.alloydb.v1beta.Instance.ReadPoolConfig parseFrom( + public static com.google.cloud.alloydb.v1beta.Instance.UpdatePolicy parseFrom( java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static com.google.cloud.alloydb.v1beta.Instance.ReadPoolConfig parseFrom( + public static com.google.cloud.alloydb.v1beta.Instance.UpdatePolicy parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static com.google.cloud.alloydb.v1beta.Instance.ReadPoolConfig parseFrom( + public static com.google.cloud.alloydb.v1beta.Instance.UpdatePolicy parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static com.google.cloud.alloydb.v1beta.Instance.ReadPoolConfig parseFrom(byte[] data) + public static com.google.cloud.alloydb.v1beta.Instance.UpdatePolicy parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static com.google.cloud.alloydb.v1beta.Instance.ReadPoolConfig parseFrom( + public static com.google.cloud.alloydb.v1beta.Instance.UpdatePolicy parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static com.google.cloud.alloydb.v1beta.Instance.ReadPoolConfig parseFrom( + public static com.google.cloud.alloydb.v1beta.Instance.UpdatePolicy parseFrom( java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); } - public static com.google.cloud.alloydb.v1beta.Instance.ReadPoolConfig parseFrom( + public static com.google.cloud.alloydb.v1beta.Instance.UpdatePolicy parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3.parseWithIOException( PARSER, input, extensionRegistry); } - public static com.google.cloud.alloydb.v1beta.Instance.ReadPoolConfig parseDelimitedFrom( + public static com.google.cloud.alloydb.v1beta.Instance.UpdatePolicy parseDelimitedFrom( java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); } - public static com.google.cloud.alloydb.v1beta.Instance.ReadPoolConfig parseDelimitedFrom( + public static com.google.cloud.alloydb.v1beta.Instance.UpdatePolicy parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( PARSER, input, extensionRegistry); } - public static com.google.cloud.alloydb.v1beta.Instance.ReadPoolConfig parseFrom( + public static com.google.cloud.alloydb.v1beta.Instance.UpdatePolicy parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); } - public static com.google.cloud.alloydb.v1beta.Instance.ReadPoolConfig parseFrom( + public static com.google.cloud.alloydb.v1beta.Instance.UpdatePolicy parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { @@ -3852,7 +4591,7 @@ public static Builder newBuilder() { } public static Builder newBuilder( - com.google.cloud.alloydb.v1beta.Instance.ReadPoolConfig prototype) { + com.google.cloud.alloydb.v1beta.Instance.UpdatePolicy prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } @@ -3871,32 +4610,32 @@ protected Builder newBuilderForType( * * *
-     * Configuration for a read pool instance.
+     * Policy to be used while updating the instance.
      * 
* - * Protobuf type {@code google.cloud.alloydb.v1beta.Instance.ReadPoolConfig} + * Protobuf type {@code google.cloud.alloydb.v1beta.Instance.UpdatePolicy} */ public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:google.cloud.alloydb.v1beta.Instance.ReadPoolConfig) - com.google.cloud.alloydb.v1beta.Instance.ReadPoolConfigOrBuilder { + // @@protoc_insertion_point(builder_implements:google.cloud.alloydb.v1beta.Instance.UpdatePolicy) + com.google.cloud.alloydb.v1beta.Instance.UpdatePolicyOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.cloud.alloydb.v1beta.ResourcesProto - .internal_static_google_cloud_alloydb_v1beta_Instance_ReadPoolConfig_descriptor; + .internal_static_google_cloud_alloydb_v1beta_Instance_UpdatePolicy_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.cloud.alloydb.v1beta.ResourcesProto - .internal_static_google_cloud_alloydb_v1beta_Instance_ReadPoolConfig_fieldAccessorTable + .internal_static_google_cloud_alloydb_v1beta_Instance_UpdatePolicy_fieldAccessorTable .ensureFieldAccessorsInitialized( - com.google.cloud.alloydb.v1beta.Instance.ReadPoolConfig.class, - com.google.cloud.alloydb.v1beta.Instance.ReadPoolConfig.Builder.class); + com.google.cloud.alloydb.v1beta.Instance.UpdatePolicy.class, + com.google.cloud.alloydb.v1beta.Instance.UpdatePolicy.Builder.class); } - // Construct using com.google.cloud.alloydb.v1beta.Instance.ReadPoolConfig.newBuilder() + // Construct using com.google.cloud.alloydb.v1beta.Instance.UpdatePolicy.newBuilder() private Builder() {} private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { @@ -3907,24 +4646,24 @@ private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { public Builder clear() { super.clear(); bitField0_ = 0; - nodeCount_ = 0; + mode_ = 0; return this; } @java.lang.Override public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { return com.google.cloud.alloydb.v1beta.ResourcesProto - .internal_static_google_cloud_alloydb_v1beta_Instance_ReadPoolConfig_descriptor; + .internal_static_google_cloud_alloydb_v1beta_Instance_UpdatePolicy_descriptor; } @java.lang.Override - public com.google.cloud.alloydb.v1beta.Instance.ReadPoolConfig getDefaultInstanceForType() { - return com.google.cloud.alloydb.v1beta.Instance.ReadPoolConfig.getDefaultInstance(); + public com.google.cloud.alloydb.v1beta.Instance.UpdatePolicy getDefaultInstanceForType() { + return com.google.cloud.alloydb.v1beta.Instance.UpdatePolicy.getDefaultInstance(); } @java.lang.Override - public com.google.cloud.alloydb.v1beta.Instance.ReadPoolConfig build() { - com.google.cloud.alloydb.v1beta.Instance.ReadPoolConfig result = buildPartial(); + public com.google.cloud.alloydb.v1beta.Instance.UpdatePolicy build() { + com.google.cloud.alloydb.v1beta.Instance.UpdatePolicy result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } @@ -3932,9 +4671,9 @@ public com.google.cloud.alloydb.v1beta.Instance.ReadPoolConfig build() { } @java.lang.Override - public com.google.cloud.alloydb.v1beta.Instance.ReadPoolConfig buildPartial() { - com.google.cloud.alloydb.v1beta.Instance.ReadPoolConfig result = - new com.google.cloud.alloydb.v1beta.Instance.ReadPoolConfig(this); + public com.google.cloud.alloydb.v1beta.Instance.UpdatePolicy buildPartial() { + com.google.cloud.alloydb.v1beta.Instance.UpdatePolicy result = + new com.google.cloud.alloydb.v1beta.Instance.UpdatePolicy(this); if (bitField0_ != 0) { buildPartial0(result); } @@ -3942,10 +4681,10 @@ public com.google.cloud.alloydb.v1beta.Instance.ReadPoolConfig buildPartial() { return result; } - private void buildPartial0(com.google.cloud.alloydb.v1beta.Instance.ReadPoolConfig result) { + private void buildPartial0(com.google.cloud.alloydb.v1beta.Instance.UpdatePolicy result) { int from_bitField0_ = bitField0_; if (((from_bitField0_ & 0x00000001) != 0)) { - result.nodeCount_ = nodeCount_; + result.mode_ = mode_; } } @@ -3986,19 +4725,19 @@ public Builder addRepeatedField( @java.lang.Override public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof com.google.cloud.alloydb.v1beta.Instance.ReadPoolConfig) { - return mergeFrom((com.google.cloud.alloydb.v1beta.Instance.ReadPoolConfig) other); + if (other instanceof com.google.cloud.alloydb.v1beta.Instance.UpdatePolicy) { + return mergeFrom((com.google.cloud.alloydb.v1beta.Instance.UpdatePolicy) other); } else { super.mergeFrom(other); return this; } } - public Builder mergeFrom(com.google.cloud.alloydb.v1beta.Instance.ReadPoolConfig other) { - if (other == com.google.cloud.alloydb.v1beta.Instance.ReadPoolConfig.getDefaultInstance()) + public Builder mergeFrom(com.google.cloud.alloydb.v1beta.Instance.UpdatePolicy other) { + if (other == com.google.cloud.alloydb.v1beta.Instance.UpdatePolicy.getDefaultInstance()) return this; - if (other.getNodeCount() != 0) { - setNodeCount(other.getNodeCount()); + if (other.mode_ != 0) { + setModeValue(other.getModeValue()); } this.mergeUnknownFields(other.getUnknownFields()); onChanged(); @@ -4028,7 +4767,7 @@ public Builder mergeFrom( break; case 8: { - nodeCount_ = input.readInt32(); + mode_ = input.readEnum(); bitField0_ |= 0x00000001; break; } // case 8 @@ -4051,37 +4790,36 @@ public Builder mergeFrom( private int bitField0_; - private int nodeCount_; + private int mode_ = 0; /** * * *
-       * Read capacity, i.e. number of nodes in a read pool instance.
+       * Mode for updating the instance.
        * 
* - * int32 node_count = 1; + * .google.cloud.alloydb.v1beta.Instance.UpdatePolicy.Mode mode = 1; * - * @return The nodeCount. + * @return The enum numeric value on the wire for mode. */ @java.lang.Override - public int getNodeCount() { - return nodeCount_; + public int getModeValue() { + return mode_; } /** * * *
-       * Read capacity, i.e. number of nodes in a read pool instance.
+       * Mode for updating the instance.
        * 
* - * int32 node_count = 1; + * .google.cloud.alloydb.v1beta.Instance.UpdatePolicy.Mode mode = 1; * - * @param value The nodeCount to set. + * @param value The enum numeric value on the wire for mode to set. * @return This builder for chaining. */ - public Builder setNodeCount(int value) { - - nodeCount_ = value; + public Builder setModeValue(int value) { + mode_ = value; bitField0_ |= 0x00000001; onChanged(); return this; @@ -4090,16 +4828,56 @@ public Builder setNodeCount(int value) { * * *
-       * Read capacity, i.e. number of nodes in a read pool instance.
+       * Mode for updating the instance.
        * 
* - * int32 node_count = 1; + * .google.cloud.alloydb.v1beta.Instance.UpdatePolicy.Mode mode = 1; + * + * @return The mode. + */ + @java.lang.Override + public com.google.cloud.alloydb.v1beta.Instance.UpdatePolicy.Mode getMode() { + com.google.cloud.alloydb.v1beta.Instance.UpdatePolicy.Mode result = + com.google.cloud.alloydb.v1beta.Instance.UpdatePolicy.Mode.forNumber(mode_); + return result == null + ? com.google.cloud.alloydb.v1beta.Instance.UpdatePolicy.Mode.UNRECOGNIZED + : result; + } + /** + * * + *
+       * Mode for updating the instance.
+       * 
+ * + * .google.cloud.alloydb.v1beta.Instance.UpdatePolicy.Mode mode = 1; + * + * @param value The mode to set. * @return This builder for chaining. */ - public Builder clearNodeCount() { + public Builder setMode(com.google.cloud.alloydb.v1beta.Instance.UpdatePolicy.Mode value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000001; + mode_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+       * Mode for updating the instance.
+       * 
+ * + * .google.cloud.alloydb.v1beta.Instance.UpdatePolicy.Mode mode = 1; + * + * @return This builder for chaining. + */ + public Builder clearMode() { bitField0_ = (bitField0_ & ~0x00000001); - nodeCount_ = 0; + mode_ = 0; onChanged(); return this; } @@ -4116,24 +4894,24 @@ public final Builder mergeUnknownFields( return super.mergeUnknownFields(unknownFields); } - // @@protoc_insertion_point(builder_scope:google.cloud.alloydb.v1beta.Instance.ReadPoolConfig) + // @@protoc_insertion_point(builder_scope:google.cloud.alloydb.v1beta.Instance.UpdatePolicy) } - // @@protoc_insertion_point(class_scope:google.cloud.alloydb.v1beta.Instance.ReadPoolConfig) - private static final com.google.cloud.alloydb.v1beta.Instance.ReadPoolConfig DEFAULT_INSTANCE; + // @@protoc_insertion_point(class_scope:google.cloud.alloydb.v1beta.Instance.UpdatePolicy) + private static final com.google.cloud.alloydb.v1beta.Instance.UpdatePolicy DEFAULT_INSTANCE; static { - DEFAULT_INSTANCE = new com.google.cloud.alloydb.v1beta.Instance.ReadPoolConfig(); + DEFAULT_INSTANCE = new com.google.cloud.alloydb.v1beta.Instance.UpdatePolicy(); } - public static com.google.cloud.alloydb.v1beta.Instance.ReadPoolConfig getDefaultInstance() { + public static com.google.cloud.alloydb.v1beta.Instance.UpdatePolicy getDefaultInstance() { return DEFAULT_INSTANCE; } - private static final com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { @java.lang.Override - public ReadPoolConfig parsePartialFrom( + public UpdatePolicy parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { @@ -4153,17 +4931,17 @@ public ReadPoolConfig parsePartialFrom( } }; - public static com.google.protobuf.Parser parser() { + public static com.google.protobuf.Parser parser() { return PARSER; } @java.lang.Override - public com.google.protobuf.Parser getParserForType() { + public com.google.protobuf.Parser getParserForType() { return PARSER; } @java.lang.Override - public com.google.cloud.alloydb.v1beta.Instance.ReadPoolConfig getDefaultInstanceForType() { + public com.google.cloud.alloydb.v1beta.Instance.UpdatePolicy getDefaultInstanceForType() { return DEFAULT_INSTANCE; } } @@ -4729,8 +5507,11 @@ public com.google.cloud.alloydb.v1beta.Instance.MachineConfig getMachineConfig() * *
    * Availability type of an Instance.
-   * Defaults to REGIONAL for both primary and read instances.
-   * Note that primary and read instances can have different availability types.
+   * 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).
    * 
* * .google.cloud.alloydb.v1beta.Instance.AvailabilityType availability_type = 11; @@ -4746,8 +5527,11 @@ public int getAvailabilityTypeValue() { * *
    * Availability type of an Instance.
-   * Defaults to REGIONAL for both primary and read instances.
-   * Note that primary and read instances can have different availability types.
+   * 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).
    * 
* * .google.cloud.alloydb.v1beta.Instance.AvailabilityType availability_type = 11; @@ -5471,6 +6255,65 @@ public java.lang.String getAnnotationsOrThrow(java.lang.String key) { return map.get(key); } + public static final int UPDATE_POLICY_FIELD_NUMBER = 22; + private com.google.cloud.alloydb.v1beta.Instance.UpdatePolicy updatePolicy_; + /** + * + * + *
+   * 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.
+   * 
+ * + * .google.cloud.alloydb.v1beta.Instance.UpdatePolicy update_policy = 22; + * + * @return Whether the updatePolicy field is set. + */ + @java.lang.Override + public boolean hasUpdatePolicy() { + return updatePolicy_ != null; + } + /** + * + * + *
+   * 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.
+   * 
+ * + * .google.cloud.alloydb.v1beta.Instance.UpdatePolicy update_policy = 22; + * + * @return The updatePolicy. + */ + @java.lang.Override + public com.google.cloud.alloydb.v1beta.Instance.UpdatePolicy getUpdatePolicy() { + return updatePolicy_ == null + ? com.google.cloud.alloydb.v1beta.Instance.UpdatePolicy.getDefaultInstance() + : updatePolicy_; + } + /** + * + * + *
+   * 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.
+   * 
+ * + * .google.cloud.alloydb.v1beta.Instance.UpdatePolicy update_policy = 22; + */ + @java.lang.Override + public com.google.cloud.alloydb.v1beta.Instance.UpdatePolicyOrBuilder getUpdatePolicyOrBuilder() { + return updatePolicy_ == null + ? com.google.cloud.alloydb.v1beta.Instance.UpdatePolicy.getDefaultInstance() + : updatePolicy_; + } + private byte memoizedIsInitialized = -1; @java.lang.Override @@ -5549,6 +6392,9 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (queryInsightsConfig_ != null) { output.writeMessage(21, getQueryInsightsConfig()); } + if (updatePolicy_ != null) { + output.writeMessage(22, getUpdatePolicy()); + } getUnknownFields().writeTo(output); } @@ -5647,6 +6493,9 @@ public int getSerializedSize() { size += com.google.protobuf.CodedOutputStream.computeMessageSize(21, getQueryInsightsConfig()); } + if (updatePolicy_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(22, getUpdatePolicy()); + } size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; @@ -5704,6 +6553,10 @@ public boolean equals(final java.lang.Object obj) { if (getReconciling() != other.getReconciling()) return false; if (!getEtag().equals(other.getEtag())) return false; if (!internalGetAnnotations().equals(other.internalGetAnnotations())) return false; + if (hasUpdatePolicy() != other.hasUpdatePolicy()) return false; + if (hasUpdatePolicy()) { + if (!getUpdatePolicy().equals(other.getUpdatePolicy())) return false; + } if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -5779,6 +6632,10 @@ public int hashCode() { hash = (37 * hash) + ANNOTATIONS_FIELD_NUMBER; hash = (53 * hash) + internalGetAnnotations().hashCode(); } + if (hasUpdatePolicy()) { + hash = (37 * hash) + UPDATE_POLICY_FIELD_NUMBER; + hash = (53 * hash) + getUpdatePolicy().hashCode(); + } hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; @@ -6002,6 +6859,11 @@ public Builder clear() { reconciling_ = false; etag_ = ""; internalGetMutableAnnotations().clear(); + updatePolicy_ = null; + if (updatePolicyBuilder_ != null) { + updatePolicyBuilder_.dispose(); + updatePolicyBuilder_ = null; + } return this; } @@ -6120,6 +6982,10 @@ private void buildPartial0(com.google.cloud.alloydb.v1beta.Instance result) { result.annotations_ = internalGetAnnotations(); result.annotations_.makeImmutable(); } + if (((from_bitField0_ & 0x00200000) != 0)) { + result.updatePolicy_ = + updatePolicyBuilder_ == null ? updatePolicy_ : updatePolicyBuilder_.build(); + } } @java.lang.Override @@ -6263,6 +7129,9 @@ public Builder mergeFrom(com.google.cloud.alloydb.v1beta.Instance other) { } internalGetMutableAnnotations().mergeFrom(other.internalGetAnnotations()); bitField0_ |= 0x00100000; + if (other.hasUpdatePolicy()) { + mergeUpdatePolicy(other.getUpdatePolicy()); + } this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; @@ -6441,6 +7310,12 @@ public Builder mergeFrom( bitField0_ |= 0x00008000; break; } // case 170 + case 178: + { + input.readMessage(getUpdatePolicyFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00200000; + break; + } // case 178 default: { if (!super.parseUnknownField(input, extensionRegistry, tag)) { @@ -7994,8 +8869,11 @@ public Builder clearMachineConfig() { * *
      * Availability type of an Instance.
-     * Defaults to REGIONAL for both primary and read instances.
-     * Note that primary and read instances can have different availability types.
+     * 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).
      * 
* * .google.cloud.alloydb.v1beta.Instance.AvailabilityType availability_type = 11; @@ -8011,8 +8889,11 @@ public int getAvailabilityTypeValue() { * *
      * Availability type of an Instance.
-     * Defaults to REGIONAL for both primary and read instances.
-     * Note that primary and read instances can have different availability types.
+     * 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).
      * 
* * .google.cloud.alloydb.v1beta.Instance.AvailabilityType availability_type = 11; @@ -8031,8 +8912,11 @@ public Builder setAvailabilityTypeValue(int value) { * *
      * Availability type of an Instance.
-     * Defaults to REGIONAL for both primary and read instances.
-     * Note that primary and read instances can have different availability types.
+     * 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).
      * 
* * .google.cloud.alloydb.v1beta.Instance.AvailabilityType availability_type = 11; @@ -8052,8 +8936,11 @@ public com.google.cloud.alloydb.v1beta.Instance.AvailabilityType getAvailability * *
      * Availability type of an Instance.
-     * Defaults to REGIONAL for both primary and read instances.
-     * Note that primary and read instances can have different availability types.
+     * 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).
      * 
* * .google.cloud.alloydb.v1beta.Instance.AvailabilityType availability_type = 11; @@ -8076,8 +8963,11 @@ public Builder setAvailabilityType( * *
      * Availability type of an Instance.
-     * Defaults to REGIONAL for both primary and read instances.
-     * Note that primary and read instances can have different availability types.
+     * 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).
      * 
* * .google.cloud.alloydb.v1beta.Instance.AvailabilityType availability_type = 11; @@ -9958,6 +10848,219 @@ public Builder putAllAnnotations(java.util.Map + updatePolicyBuilder_; + /** + * + * + *
+     * 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.
+     * 
+ * + * .google.cloud.alloydb.v1beta.Instance.UpdatePolicy update_policy = 22; + * + * @return Whether the updatePolicy field is set. + */ + public boolean hasUpdatePolicy() { + return ((bitField0_ & 0x00200000) != 0); + } + /** + * + * + *
+     * 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.
+     * 
+ * + * .google.cloud.alloydb.v1beta.Instance.UpdatePolicy update_policy = 22; + * + * @return The updatePolicy. + */ + public com.google.cloud.alloydb.v1beta.Instance.UpdatePolicy getUpdatePolicy() { + if (updatePolicyBuilder_ == null) { + return updatePolicy_ == null + ? com.google.cloud.alloydb.v1beta.Instance.UpdatePolicy.getDefaultInstance() + : updatePolicy_; + } else { + return updatePolicyBuilder_.getMessage(); + } + } + /** + * + * + *
+     * 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.
+     * 
+ * + * .google.cloud.alloydb.v1beta.Instance.UpdatePolicy update_policy = 22; + */ + public Builder setUpdatePolicy(com.google.cloud.alloydb.v1beta.Instance.UpdatePolicy value) { + if (updatePolicyBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + updatePolicy_ = value; + } else { + updatePolicyBuilder_.setMessage(value); + } + bitField0_ |= 0x00200000; + onChanged(); + 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.
+     * 
+ * + * .google.cloud.alloydb.v1beta.Instance.UpdatePolicy update_policy = 22; + */ + public Builder setUpdatePolicy( + com.google.cloud.alloydb.v1beta.Instance.UpdatePolicy.Builder builderForValue) { + if (updatePolicyBuilder_ == null) { + updatePolicy_ = builderForValue.build(); + } else { + updatePolicyBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00200000; + onChanged(); + 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.
+     * 
+ * + * .google.cloud.alloydb.v1beta.Instance.UpdatePolicy update_policy = 22; + */ + public Builder mergeUpdatePolicy(com.google.cloud.alloydb.v1beta.Instance.UpdatePolicy value) { + if (updatePolicyBuilder_ == null) { + if (((bitField0_ & 0x00200000) != 0) + && updatePolicy_ != null + && updatePolicy_ + != com.google.cloud.alloydb.v1beta.Instance.UpdatePolicy.getDefaultInstance()) { + getUpdatePolicyBuilder().mergeFrom(value); + } else { + updatePolicy_ = value; + } + } else { + updatePolicyBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00200000; + onChanged(); + 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.
+     * 
+ * + * .google.cloud.alloydb.v1beta.Instance.UpdatePolicy update_policy = 22; + */ + public Builder clearUpdatePolicy() { + bitField0_ = (bitField0_ & ~0x00200000); + updatePolicy_ = null; + if (updatePolicyBuilder_ != null) { + updatePolicyBuilder_.dispose(); + updatePolicyBuilder_ = null; + } + onChanged(); + 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.
+     * 
+ * + * .google.cloud.alloydb.v1beta.Instance.UpdatePolicy update_policy = 22; + */ + public com.google.cloud.alloydb.v1beta.Instance.UpdatePolicy.Builder getUpdatePolicyBuilder() { + bitField0_ |= 0x00200000; + onChanged(); + return getUpdatePolicyFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * 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.
+     * 
+ * + * .google.cloud.alloydb.v1beta.Instance.UpdatePolicy update_policy = 22; + */ + public com.google.cloud.alloydb.v1beta.Instance.UpdatePolicyOrBuilder + getUpdatePolicyOrBuilder() { + if (updatePolicyBuilder_ != null) { + return updatePolicyBuilder_.getMessageOrBuilder(); + } else { + return updatePolicy_ == null + ? com.google.cloud.alloydb.v1beta.Instance.UpdatePolicy.getDefaultInstance() + : updatePolicy_; + } + } + /** + * + * + *
+     * 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.
+     * 
+ * + * .google.cloud.alloydb.v1beta.Instance.UpdatePolicy update_policy = 22; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1beta.Instance.UpdatePolicy, + com.google.cloud.alloydb.v1beta.Instance.UpdatePolicy.Builder, + com.google.cloud.alloydb.v1beta.Instance.UpdatePolicyOrBuilder> + getUpdatePolicyFieldBuilder() { + if (updatePolicyBuilder_ == null) { + updatePolicyBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1beta.Instance.UpdatePolicy, + com.google.cloud.alloydb.v1beta.Instance.UpdatePolicy.Builder, + com.google.cloud.alloydb.v1beta.Instance.UpdatePolicyOrBuilder>( + getUpdatePolicy(), getParentForChildren(), isClean()); + updatePolicy_ = null; + } + return updatePolicyBuilder_; + } + @java.lang.Override public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { return super.setUnknownFields(unknownFields); diff --git a/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/InstanceOrBuilder.java b/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/InstanceOrBuilder.java index fe79c1d57572..5abbd545fe97 100644 --- a/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/InstanceOrBuilder.java +++ b/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/InstanceOrBuilder.java @@ -389,8 +389,11 @@ java.lang.String getLabelsOrDefault( * *
    * Availability type of an Instance.
-   * Defaults to REGIONAL for both primary and read instances.
-   * Note that primary and read instances can have different availability types.
+   * 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).
    * 
* * .google.cloud.alloydb.v1beta.Instance.AvailabilityType availability_type = 11; @@ -403,8 +406,11 @@ java.lang.String getLabelsOrDefault( * *
    * Availability type of an Instance.
-   * Defaults to REGIONAL for both primary and read instances.
-   * Note that primary and read instances can have different availability types.
+   * 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).
    * 
* * .google.cloud.alloydb.v1beta.Instance.AvailabilityType availability_type = 11; @@ -895,4 +901,48 @@ java.lang.String getAnnotationsOrDefault( * map<string, string> annotations = 18; */ java.lang.String getAnnotationsOrThrow(java.lang.String key); + + /** + * + * + *
+   * 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.
+   * 
+ * + * .google.cloud.alloydb.v1beta.Instance.UpdatePolicy update_policy = 22; + * + * @return Whether the updatePolicy field is set. + */ + boolean hasUpdatePolicy(); + /** + * + * + *
+   * 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.
+   * 
+ * + * .google.cloud.alloydb.v1beta.Instance.UpdatePolicy update_policy = 22; + * + * @return The updatePolicy. + */ + com.google.cloud.alloydb.v1beta.Instance.UpdatePolicy getUpdatePolicy(); + /** + * + * + *
+   * 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.
+   * 
+ * + * .google.cloud.alloydb.v1beta.Instance.UpdatePolicy update_policy = 22; + */ + com.google.cloud.alloydb.v1beta.Instance.UpdatePolicyOrBuilder getUpdatePolicyOrBuilder(); } diff --git a/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/InstanceView.java b/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/InstanceView.java index 47c3da6c1772..ec117864b081 100644 --- a/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/InstanceView.java +++ b/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/InstanceView.java @@ -158,7 +158,7 @@ public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType } public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { - return com.google.cloud.alloydb.v1beta.ResourcesProto.getDescriptor().getEnumTypes().get(1); + return com.google.cloud.alloydb.v1beta.ResourcesProto.getDescriptor().getEnumTypes().get(0); } private static final InstanceView[] VALUES = values(); diff --git a/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/ListUsersRequest.java b/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/ListUsersRequest.java new file mode 100644 index 000000000000..9382024ed318 --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/ListUsersRequest.java @@ -0,0 +1,1281 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/alloydb/v1beta/service.proto + +package com.google.cloud.alloydb.v1beta; + +/** + * + * + *
+ * Message for requesting list of Users
+ * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1beta.ListUsersRequest} + */ +public final class ListUsersRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.alloydb.v1beta.ListUsersRequest) + ListUsersRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListUsersRequest.newBuilder() to construct. + private ListUsersRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListUsersRequest() { + parent_ = ""; + pageToken_ = ""; + filter_ = ""; + orderBy_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListUsersRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.alloydb.v1beta.ServiceProto + .internal_static_google_cloud_alloydb_v1beta_ListUsersRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1beta.ServiceProto + .internal_static_google_cloud_alloydb_v1beta_ListUsersRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1beta.ListUsersRequest.class, + com.google.cloud.alloydb.v1beta.ListUsersRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object parent_ = ""; + /** + * + * + *
+   * Required. Parent value for ListUsersRequest
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + @java.lang.Override + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } + } + /** + * + * + *
+   * Required. Parent value for ListUsersRequest
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + @java.lang.Override + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PAGE_SIZE_FIELD_NUMBER = 2; + private int pageSize_ = 0; + /** + * + * + *
+   * Optional. Requested page size. Server may return fewer items than
+   * requested. If unspecified, server will pick an appropriate default.
+   * 
+ * + * int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + + public static final int PAGE_TOKEN_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object pageToken_ = ""; + /** + * + * + *
+   * Optional. A token identifying a page of results the server should return.
+   * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageToken. + */ + @java.lang.Override + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } + } + /** + * + * + *
+   * Optional. A token identifying a page of results the server should return.
+   * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for pageToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int FILTER_FIELD_NUMBER = 4; + + @SuppressWarnings("serial") + private volatile java.lang.Object filter_ = ""; + /** + * + * + *
+   * Optional. Filtering results
+   * 
+ * + * string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The filter. + */ + @java.lang.Override + public java.lang.String getFilter() { + java.lang.Object ref = filter_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + filter_ = s; + return s; + } + } + /** + * + * + *
+   * Optional. Filtering results
+   * 
+ * + * string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for filter. + */ + @java.lang.Override + public com.google.protobuf.ByteString getFilterBytes() { + java.lang.Object ref = filter_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + filter_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ORDER_BY_FIELD_NUMBER = 5; + + @SuppressWarnings("serial") + private volatile java.lang.Object orderBy_ = ""; + /** + * + * + *
+   * Optional. Hint for how to order the results
+   * 
+ * + * string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The orderBy. + */ + @java.lang.Override + public java.lang.String getOrderBy() { + java.lang.Object ref = orderBy_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + orderBy_ = s; + return s; + } + } + /** + * + * + *
+   * Optional. Hint for how to order the results
+   * 
+ * + * string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for orderBy. + */ + @java.lang.Override + public com.google.protobuf.ByteString getOrderByBytes() { + java.lang.Object ref = orderBy_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + orderBy_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); + } + if (pageSize_ != 0) { + output.writeInt32(2, pageSize_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pageToken_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, pageToken_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(filter_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, filter_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(orderBy_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 5, orderBy_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); + } + if (pageSize_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(2, pageSize_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pageToken_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, pageToken_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(filter_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, filter_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(orderBy_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, orderBy_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.alloydb.v1beta.ListUsersRequest)) { + return super.equals(obj); + } + com.google.cloud.alloydb.v1beta.ListUsersRequest other = + (com.google.cloud.alloydb.v1beta.ListUsersRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (getPageSize() != other.getPageSize()) return false; + if (!getPageToken().equals(other.getPageToken())) return false; + if (!getFilter().equals(other.getFilter())) return false; + if (!getOrderBy().equals(other.getOrderBy())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + PARENT_FIELD_NUMBER; + hash = (53 * hash) + getParent().hashCode(); + hash = (37 * hash) + PAGE_SIZE_FIELD_NUMBER; + hash = (53 * hash) + getPageSize(); + hash = (37 * hash) + PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getPageToken().hashCode(); + hash = (37 * hash) + FILTER_FIELD_NUMBER; + hash = (53 * hash) + getFilter().hashCode(); + hash = (37 * hash) + ORDER_BY_FIELD_NUMBER; + hash = (53 * hash) + getOrderBy().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.alloydb.v1beta.ListUsersRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1beta.ListUsersRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.alloydb.v1beta.ListUsersRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1beta.ListUsersRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.alloydb.v1beta.ListUsersRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1beta.ListUsersRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.alloydb.v1beta.ListUsersRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1beta.ListUsersRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.alloydb.v1beta.ListUsersRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1beta.ListUsersRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.alloydb.v1beta.ListUsersRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1beta.ListUsersRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.alloydb.v1beta.ListUsersRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Message for requesting list of Users
+   * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1beta.ListUsersRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.alloydb.v1beta.ListUsersRequest) + com.google.cloud.alloydb.v1beta.ListUsersRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.alloydb.v1beta.ServiceProto + .internal_static_google_cloud_alloydb_v1beta_ListUsersRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1beta.ServiceProto + .internal_static_google_cloud_alloydb_v1beta_ListUsersRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1beta.ListUsersRequest.class, + com.google.cloud.alloydb.v1beta.ListUsersRequest.Builder.class); + } + + // Construct using com.google.cloud.alloydb.v1beta.ListUsersRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + parent_ = ""; + pageSize_ = 0; + pageToken_ = ""; + filter_ = ""; + orderBy_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.alloydb.v1beta.ServiceProto + .internal_static_google_cloud_alloydb_v1beta_ListUsersRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1beta.ListUsersRequest getDefaultInstanceForType() { + return com.google.cloud.alloydb.v1beta.ListUsersRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.alloydb.v1beta.ListUsersRequest build() { + com.google.cloud.alloydb.v1beta.ListUsersRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1beta.ListUsersRequest buildPartial() { + com.google.cloud.alloydb.v1beta.ListUsersRequest result = + new com.google.cloud.alloydb.v1beta.ListUsersRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.alloydb.v1beta.ListUsersRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.parent_ = parent_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.pageSize_ = pageSize_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.pageToken_ = pageToken_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.filter_ = filter_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.orderBy_ = orderBy_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.alloydb.v1beta.ListUsersRequest) { + return mergeFrom((com.google.cloud.alloydb.v1beta.ListUsersRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.alloydb.v1beta.ListUsersRequest other) { + if (other == com.google.cloud.alloydb.v1beta.ListUsersRequest.getDefaultInstance()) + return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.getPageSize() != 0) { + setPageSize(other.getPageSize()); + } + if (!other.getPageToken().isEmpty()) { + pageToken_ = other.pageToken_; + bitField0_ |= 0x00000004; + onChanged(); + } + if (!other.getFilter().isEmpty()) { + filter_ = other.filter_; + bitField0_ |= 0x00000008; + onChanged(); + } + if (!other.getOrderBy().isEmpty()) { + orderBy_ = other.orderBy_; + bitField0_ |= 0x00000010; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + parent_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 16: + { + pageSize_ = input.readInt32(); + bitField0_ |= 0x00000002; + break; + } // case 16 + case 26: + { + pageToken_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 34: + { + filter_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000008; + break; + } // case 34 + case 42: + { + orderBy_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000010; + break; + } // case 42 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * Required. Parent value for ListUsersRequest
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. Parent value for ListUsersRequest
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. Parent value for ListUsersRequest
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The parent to set. + * @return This builder for chaining. + */ + public Builder setParent(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + parent_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Parent value for ListUsersRequest
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearParent() { + parent_ = getDefaultInstance().getParent(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Parent value for ListUsersRequest
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for parent to set. + * @return This builder for chaining. + */ + public Builder setParentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + parent_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private int pageSize_; + /** + * + * + *
+     * Optional. Requested page size. Server may return fewer items than
+     * requested. If unspecified, server will pick an appropriate default.
+     * 
+ * + * int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + /** + * + * + *
+     * Optional. Requested page size. Server may return fewer items than
+     * requested. If unspecified, server will pick an appropriate default.
+     * 
+ * + * int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The pageSize to set. + * @return This builder for chaining. + */ + public Builder setPageSize(int value) { + + pageSize_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Requested page size. Server may return fewer items than
+     * requested. If unspecified, server will pick an appropriate default.
+     * 
+ * + * int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearPageSize() { + bitField0_ = (bitField0_ & ~0x00000002); + pageSize_ = 0; + onChanged(); + return this; + } + + private java.lang.Object pageToken_ = ""; + /** + * + * + *
+     * Optional. A token identifying a page of results the server should return.
+     * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageToken. + */ + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Optional. A token identifying a page of results the server should return.
+     * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for pageToken. + */ + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Optional. A token identifying a page of results the server should return.
+     * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + pageToken_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. A token identifying a page of results the server should return.
+     * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearPageToken() { + pageToken_ = getDefaultInstance().getPageToken(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. A token identifying a page of results the server should return.
+     * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + pageToken_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + private java.lang.Object filter_ = ""; + /** + * + * + *
+     * Optional. Filtering results
+     * 
+ * + * string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The filter. + */ + public java.lang.String getFilter() { + java.lang.Object ref = filter_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + filter_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Optional. Filtering results
+     * 
+ * + * string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for filter. + */ + public com.google.protobuf.ByteString getFilterBytes() { + java.lang.Object ref = filter_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + filter_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Optional. Filtering results
+     * 
+ * + * string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The filter to set. + * @return This builder for chaining. + */ + public Builder setFilter(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + filter_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Filtering results
+     * 
+ * + * string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearFilter() { + filter_ = getDefaultInstance().getFilter(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Filtering results
+     * 
+ * + * string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for filter to set. + * @return This builder for chaining. + */ + public Builder setFilterBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + filter_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + private java.lang.Object orderBy_ = ""; + /** + * + * + *
+     * Optional. Hint for how to order the results
+     * 
+ * + * string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The orderBy. + */ + public java.lang.String getOrderBy() { + java.lang.Object ref = orderBy_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + orderBy_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Optional. Hint for how to order the results
+     * 
+ * + * string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for orderBy. + */ + public com.google.protobuf.ByteString getOrderByBytes() { + java.lang.Object ref = orderBy_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + orderBy_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Optional. Hint for how to order the results
+     * 
+ * + * string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The orderBy to set. + * @return This builder for chaining. + */ + public Builder setOrderBy(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + orderBy_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Hint for how to order the results
+     * 
+ * + * string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearOrderBy() { + orderBy_ = getDefaultInstance().getOrderBy(); + bitField0_ = (bitField0_ & ~0x00000010); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Hint for how to order the results
+     * 
+ * + * string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for orderBy to set. + * @return This builder for chaining. + */ + public Builder setOrderByBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + orderBy_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.alloydb.v1beta.ListUsersRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.alloydb.v1beta.ListUsersRequest) + private static final com.google.cloud.alloydb.v1beta.ListUsersRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.alloydb.v1beta.ListUsersRequest(); + } + + public static com.google.cloud.alloydb.v1beta.ListUsersRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListUsersRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1beta.ListUsersRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/ListUsersRequestOrBuilder.java b/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/ListUsersRequestOrBuilder.java new file mode 100644 index 000000000000..8965a38280c7 --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/ListUsersRequestOrBuilder.java @@ -0,0 +1,143 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/alloydb/v1beta/service.proto + +package com.google.cloud.alloydb.v1beta; + +public interface ListUsersRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.alloydb.v1beta.ListUsersRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Parent value for ListUsersRequest
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. Parent value for ListUsersRequest
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * Optional. Requested page size. Server may return fewer items than
+   * requested. If unspecified, server will pick an appropriate default.
+   * 
+ * + * int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageSize. + */ + int getPageSize(); + + /** + * + * + *
+   * Optional. A token identifying a page of results the server should return.
+   * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageToken. + */ + java.lang.String getPageToken(); + /** + * + * + *
+   * Optional. A token identifying a page of results the server should return.
+   * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for pageToken. + */ + com.google.protobuf.ByteString getPageTokenBytes(); + + /** + * + * + *
+   * Optional. Filtering results
+   * 
+ * + * string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The filter. + */ + java.lang.String getFilter(); + /** + * + * + *
+   * Optional. Filtering results
+   * 
+ * + * string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for filter. + */ + com.google.protobuf.ByteString getFilterBytes(); + + /** + * + * + *
+   * Optional. Hint for how to order the results
+   * 
+ * + * string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The orderBy. + */ + java.lang.String getOrderBy(); + /** + * + * + *
+   * Optional. Hint for how to order the results
+   * 
+ * + * string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for orderBy. + */ + com.google.protobuf.ByteString getOrderByBytes(); +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/ListUsersResponse.java b/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/ListUsersResponse.java new file mode 100644 index 000000000000..cdc046ce4ecc --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/ListUsersResponse.java @@ -0,0 +1,1393 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/alloydb/v1beta/service.proto + +package com.google.cloud.alloydb.v1beta; + +/** + * + * + *
+ * Message for response to listing Users
+ * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1beta.ListUsersResponse} + */ +public final class ListUsersResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.alloydb.v1beta.ListUsersResponse) + ListUsersResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListUsersResponse.newBuilder() to construct. + private ListUsersResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListUsersResponse() { + users_ = java.util.Collections.emptyList(); + nextPageToken_ = ""; + unreachable_ = com.google.protobuf.LazyStringArrayList.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListUsersResponse(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.alloydb.v1beta.ServiceProto + .internal_static_google_cloud_alloydb_v1beta_ListUsersResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1beta.ServiceProto + .internal_static_google_cloud_alloydb_v1beta_ListUsersResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1beta.ListUsersResponse.class, + com.google.cloud.alloydb.v1beta.ListUsersResponse.Builder.class); + } + + public static final int USERS_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private java.util.List users_; + /** + * + * + *
+   * The list of User
+   * 
+ * + * repeated .google.cloud.alloydb.v1beta.User users = 1; + */ + @java.lang.Override + public java.util.List getUsersList() { + return users_; + } + /** + * + * + *
+   * The list of User
+   * 
+ * + * repeated .google.cloud.alloydb.v1beta.User users = 1; + */ + @java.lang.Override + public java.util.List + getUsersOrBuilderList() { + return users_; + } + /** + * + * + *
+   * The list of User
+   * 
+ * + * repeated .google.cloud.alloydb.v1beta.User users = 1; + */ + @java.lang.Override + public int getUsersCount() { + return users_.size(); + } + /** + * + * + *
+   * The list of User
+   * 
+ * + * repeated .google.cloud.alloydb.v1beta.User users = 1; + */ + @java.lang.Override + public com.google.cloud.alloydb.v1beta.User getUsers(int index) { + return users_.get(index); + } + /** + * + * + *
+   * The list of User
+   * 
+ * + * repeated .google.cloud.alloydb.v1beta.User users = 1; + */ + @java.lang.Override + public com.google.cloud.alloydb.v1beta.UserOrBuilder getUsersOrBuilder(int index) { + return users_.get(index); + } + + public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object nextPageToken_ = ""; + /** + * + * + *
+   * A token identifying a page of results the server should return.
+   * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + @java.lang.Override + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } + } + /** + * + * + *
+   * A token identifying a page of results the server should return.
+   * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int UNREACHABLE_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private com.google.protobuf.LazyStringArrayList unreachable_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + /** + * + * + *
+   * Locations that could not be reached.
+   * 
+ * + * repeated string unreachable = 3; + * + * @return A list containing the unreachable. + */ + public com.google.protobuf.ProtocolStringList getUnreachableList() { + return unreachable_; + } + /** + * + * + *
+   * Locations that could not be reached.
+   * 
+ * + * repeated string unreachable = 3; + * + * @return The count of unreachable. + */ + public int getUnreachableCount() { + return unreachable_.size(); + } + /** + * + * + *
+   * Locations that could not be reached.
+   * 
+ * + * repeated string unreachable = 3; + * + * @param index The index of the element to return. + * @return The unreachable at the given index. + */ + public java.lang.String getUnreachable(int index) { + return unreachable_.get(index); + } + /** + * + * + *
+   * Locations that could not be reached.
+   * 
+ * + * repeated string unreachable = 3; + * + * @param index The index of the value to return. + * @return The bytes of the unreachable at the given index. + */ + public com.google.protobuf.ByteString getUnreachableBytes(int index) { + return unreachable_.getByteString(index); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + for (int i = 0; i < users_.size(); i++) { + output.writeMessage(1, users_.get(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, nextPageToken_); + } + for (int i = 0; i < unreachable_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, unreachable_.getRaw(i)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < users_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, users_.get(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, nextPageToken_); + } + { + int dataSize = 0; + for (int i = 0; i < unreachable_.size(); i++) { + dataSize += computeStringSizeNoTag(unreachable_.getRaw(i)); + } + size += dataSize; + size += 1 * getUnreachableList().size(); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.alloydb.v1beta.ListUsersResponse)) { + return super.equals(obj); + } + com.google.cloud.alloydb.v1beta.ListUsersResponse other = + (com.google.cloud.alloydb.v1beta.ListUsersResponse) obj; + + if (!getUsersList().equals(other.getUsersList())) return false; + if (!getNextPageToken().equals(other.getNextPageToken())) return false; + if (!getUnreachableList().equals(other.getUnreachableList())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getUsersCount() > 0) { + hash = (37 * hash) + USERS_FIELD_NUMBER; + hash = (53 * hash) + getUsersList().hashCode(); + } + hash = (37 * hash) + NEXT_PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getNextPageToken().hashCode(); + if (getUnreachableCount() > 0) { + hash = (37 * hash) + UNREACHABLE_FIELD_NUMBER; + hash = (53 * hash) + getUnreachableList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.alloydb.v1beta.ListUsersResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1beta.ListUsersResponse parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.alloydb.v1beta.ListUsersResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1beta.ListUsersResponse parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.alloydb.v1beta.ListUsersResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1beta.ListUsersResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.alloydb.v1beta.ListUsersResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1beta.ListUsersResponse parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.alloydb.v1beta.ListUsersResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1beta.ListUsersResponse parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.alloydb.v1beta.ListUsersResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1beta.ListUsersResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.alloydb.v1beta.ListUsersResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Message for response to listing Users
+   * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1beta.ListUsersResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.alloydb.v1beta.ListUsersResponse) + com.google.cloud.alloydb.v1beta.ListUsersResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.alloydb.v1beta.ServiceProto + .internal_static_google_cloud_alloydb_v1beta_ListUsersResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1beta.ServiceProto + .internal_static_google_cloud_alloydb_v1beta_ListUsersResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1beta.ListUsersResponse.class, + com.google.cloud.alloydb.v1beta.ListUsersResponse.Builder.class); + } + + // Construct using com.google.cloud.alloydb.v1beta.ListUsersResponse.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (usersBuilder_ == null) { + users_ = java.util.Collections.emptyList(); + } else { + users_ = null; + usersBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + nextPageToken_ = ""; + unreachable_ = com.google.protobuf.LazyStringArrayList.emptyList(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.alloydb.v1beta.ServiceProto + .internal_static_google_cloud_alloydb_v1beta_ListUsersResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1beta.ListUsersResponse getDefaultInstanceForType() { + return com.google.cloud.alloydb.v1beta.ListUsersResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.alloydb.v1beta.ListUsersResponse build() { + com.google.cloud.alloydb.v1beta.ListUsersResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1beta.ListUsersResponse buildPartial() { + com.google.cloud.alloydb.v1beta.ListUsersResponse result = + new com.google.cloud.alloydb.v1beta.ListUsersResponse(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields( + com.google.cloud.alloydb.v1beta.ListUsersResponse result) { + if (usersBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + users_ = java.util.Collections.unmodifiableList(users_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.users_ = users_; + } else { + result.users_ = usersBuilder_.build(); + } + } + + private void buildPartial0(com.google.cloud.alloydb.v1beta.ListUsersResponse result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.nextPageToken_ = nextPageToken_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + unreachable_.makeImmutable(); + result.unreachable_ = unreachable_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.alloydb.v1beta.ListUsersResponse) { + return mergeFrom((com.google.cloud.alloydb.v1beta.ListUsersResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.alloydb.v1beta.ListUsersResponse other) { + if (other == com.google.cloud.alloydb.v1beta.ListUsersResponse.getDefaultInstance()) + return this; + if (usersBuilder_ == null) { + if (!other.users_.isEmpty()) { + if (users_.isEmpty()) { + users_ = other.users_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureUsersIsMutable(); + users_.addAll(other.users_); + } + onChanged(); + } + } else { + if (!other.users_.isEmpty()) { + if (usersBuilder_.isEmpty()) { + usersBuilder_.dispose(); + usersBuilder_ = null; + users_ = other.users_; + bitField0_ = (bitField0_ & ~0x00000001); + usersBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getUsersFieldBuilder() + : null; + } else { + usersBuilder_.addAllMessages(other.users_); + } + } + } + if (!other.getNextPageToken().isEmpty()) { + nextPageToken_ = other.nextPageToken_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (!other.unreachable_.isEmpty()) { + if (unreachable_.isEmpty()) { + unreachable_ = other.unreachable_; + bitField0_ |= 0x00000004; + } else { + ensureUnreachableIsMutable(); + unreachable_.addAll(other.unreachable_); + } + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + com.google.cloud.alloydb.v1beta.User m = + input.readMessage( + com.google.cloud.alloydb.v1beta.User.parser(), extensionRegistry); + if (usersBuilder_ == null) { + ensureUsersIsMutable(); + users_.add(m); + } else { + usersBuilder_.addMessage(m); + } + break; + } // case 10 + case 18: + { + nextPageToken_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + ensureUnreachableIsMutable(); + unreachable_.add(s); + break; + } // case 26 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.util.List users_ = + java.util.Collections.emptyList(); + + private void ensureUsersIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + users_ = new java.util.ArrayList(users_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.alloydb.v1beta.User, + com.google.cloud.alloydb.v1beta.User.Builder, + com.google.cloud.alloydb.v1beta.UserOrBuilder> + usersBuilder_; + + /** + * + * + *
+     * The list of User
+     * 
+ * + * repeated .google.cloud.alloydb.v1beta.User users = 1; + */ + public java.util.List getUsersList() { + if (usersBuilder_ == null) { + return java.util.Collections.unmodifiableList(users_); + } else { + return usersBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * The list of User
+     * 
+ * + * repeated .google.cloud.alloydb.v1beta.User users = 1; + */ + public int getUsersCount() { + if (usersBuilder_ == null) { + return users_.size(); + } else { + return usersBuilder_.getCount(); + } + } + /** + * + * + *
+     * The list of User
+     * 
+ * + * repeated .google.cloud.alloydb.v1beta.User users = 1; + */ + public com.google.cloud.alloydb.v1beta.User getUsers(int index) { + if (usersBuilder_ == null) { + return users_.get(index); + } else { + return usersBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * The list of User
+     * 
+ * + * repeated .google.cloud.alloydb.v1beta.User users = 1; + */ + public Builder setUsers(int index, com.google.cloud.alloydb.v1beta.User value) { + if (usersBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureUsersIsMutable(); + users_.set(index, value); + onChanged(); + } else { + usersBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The list of User
+     * 
+ * + * repeated .google.cloud.alloydb.v1beta.User users = 1; + */ + public Builder setUsers( + int index, com.google.cloud.alloydb.v1beta.User.Builder builderForValue) { + if (usersBuilder_ == null) { + ensureUsersIsMutable(); + users_.set(index, builderForValue.build()); + onChanged(); + } else { + usersBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The list of User
+     * 
+ * + * repeated .google.cloud.alloydb.v1beta.User users = 1; + */ + public Builder addUsers(com.google.cloud.alloydb.v1beta.User value) { + if (usersBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureUsersIsMutable(); + users_.add(value); + onChanged(); + } else { + usersBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * The list of User
+     * 
+ * + * repeated .google.cloud.alloydb.v1beta.User users = 1; + */ + public Builder addUsers(int index, com.google.cloud.alloydb.v1beta.User value) { + if (usersBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureUsersIsMutable(); + users_.add(index, value); + onChanged(); + } else { + usersBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The list of User
+     * 
+ * + * repeated .google.cloud.alloydb.v1beta.User users = 1; + */ + public Builder addUsers(com.google.cloud.alloydb.v1beta.User.Builder builderForValue) { + if (usersBuilder_ == null) { + ensureUsersIsMutable(); + users_.add(builderForValue.build()); + onChanged(); + } else { + usersBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The list of User
+     * 
+ * + * repeated .google.cloud.alloydb.v1beta.User users = 1; + */ + public Builder addUsers( + int index, com.google.cloud.alloydb.v1beta.User.Builder builderForValue) { + if (usersBuilder_ == null) { + ensureUsersIsMutable(); + users_.add(index, builderForValue.build()); + onChanged(); + } else { + usersBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The list of User
+     * 
+ * + * repeated .google.cloud.alloydb.v1beta.User users = 1; + */ + public Builder addAllUsers( + java.lang.Iterable values) { + if (usersBuilder_ == null) { + ensureUsersIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, users_); + onChanged(); + } else { + usersBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * The list of User
+     * 
+ * + * repeated .google.cloud.alloydb.v1beta.User users = 1; + */ + public Builder clearUsers() { + if (usersBuilder_ == null) { + users_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + usersBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * The list of User
+     * 
+ * + * repeated .google.cloud.alloydb.v1beta.User users = 1; + */ + public Builder removeUsers(int index) { + if (usersBuilder_ == null) { + ensureUsersIsMutable(); + users_.remove(index); + onChanged(); + } else { + usersBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * The list of User
+     * 
+ * + * repeated .google.cloud.alloydb.v1beta.User users = 1; + */ + public com.google.cloud.alloydb.v1beta.User.Builder getUsersBuilder(int index) { + return getUsersFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * The list of User
+     * 
+ * + * repeated .google.cloud.alloydb.v1beta.User users = 1; + */ + public com.google.cloud.alloydb.v1beta.UserOrBuilder getUsersOrBuilder(int index) { + if (usersBuilder_ == null) { + return users_.get(index); + } else { + return usersBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * The list of User
+     * 
+ * + * repeated .google.cloud.alloydb.v1beta.User users = 1; + */ + public java.util.List + getUsersOrBuilderList() { + if (usersBuilder_ != null) { + return usersBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(users_); + } + } + /** + * + * + *
+     * The list of User
+     * 
+ * + * repeated .google.cloud.alloydb.v1beta.User users = 1; + */ + public com.google.cloud.alloydb.v1beta.User.Builder addUsersBuilder() { + return getUsersFieldBuilder() + .addBuilder(com.google.cloud.alloydb.v1beta.User.getDefaultInstance()); + } + /** + * + * + *
+     * The list of User
+     * 
+ * + * repeated .google.cloud.alloydb.v1beta.User users = 1; + */ + public com.google.cloud.alloydb.v1beta.User.Builder addUsersBuilder(int index) { + return getUsersFieldBuilder() + .addBuilder(index, com.google.cloud.alloydb.v1beta.User.getDefaultInstance()); + } + /** + * + * + *
+     * The list of User
+     * 
+ * + * repeated .google.cloud.alloydb.v1beta.User users = 1; + */ + public java.util.List getUsersBuilderList() { + return getUsersFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.alloydb.v1beta.User, + com.google.cloud.alloydb.v1beta.User.Builder, + com.google.cloud.alloydb.v1beta.UserOrBuilder> + getUsersFieldBuilder() { + if (usersBuilder_ == null) { + usersBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.alloydb.v1beta.User, + com.google.cloud.alloydb.v1beta.User.Builder, + com.google.cloud.alloydb.v1beta.UserOrBuilder>( + users_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + users_ = null; + } + return usersBuilder_; + } + + private java.lang.Object nextPageToken_ = ""; + /** + * + * + *
+     * A token identifying a page of results the server should return.
+     * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * A token identifying a page of results the server should return.
+     * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + public com.google.protobuf.ByteString getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * A token identifying a page of results the server should return.
+     * 
+ * + * string next_page_token = 2; + * + * @param value The nextPageToken to set. + * @return This builder for chaining. + */ + public Builder setNextPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + nextPageToken_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * A token identifying a page of results the server should return.
+     * 
+ * + * string next_page_token = 2; + * + * @return This builder for chaining. + */ + public Builder clearNextPageToken() { + nextPageToken_ = getDefaultInstance().getNextPageToken(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * A token identifying a page of results the server should return.
+     * 
+ * + * string next_page_token = 2; + * + * @param value The bytes for nextPageToken to set. + * @return This builder for chaining. + */ + public Builder setNextPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + nextPageToken_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringArrayList unreachable_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + + private void ensureUnreachableIsMutable() { + if (!unreachable_.isModifiable()) { + unreachable_ = new com.google.protobuf.LazyStringArrayList(unreachable_); + } + bitField0_ |= 0x00000004; + } + /** + * + * + *
+     * Locations that could not be reached.
+     * 
+ * + * repeated string unreachable = 3; + * + * @return A list containing the unreachable. + */ + public com.google.protobuf.ProtocolStringList getUnreachableList() { + unreachable_.makeImmutable(); + return unreachable_; + } + /** + * + * + *
+     * Locations that could not be reached.
+     * 
+ * + * repeated string unreachable = 3; + * + * @return The count of unreachable. + */ + public int getUnreachableCount() { + return unreachable_.size(); + } + /** + * + * + *
+     * Locations that could not be reached.
+     * 
+ * + * repeated string unreachable = 3; + * + * @param index The index of the element to return. + * @return The unreachable at the given index. + */ + public java.lang.String getUnreachable(int index) { + return unreachable_.get(index); + } + /** + * + * + *
+     * Locations that could not be reached.
+     * 
+ * + * repeated string unreachable = 3; + * + * @param index The index of the value to return. + * @return The bytes of the unreachable at the given index. + */ + public com.google.protobuf.ByteString getUnreachableBytes(int index) { + return unreachable_.getByteString(index); + } + /** + * + * + *
+     * Locations that could not be reached.
+     * 
+ * + * repeated string unreachable = 3; + * + * @param index The index to set the value at. + * @param value The unreachable to set. + * @return This builder for chaining. + */ + public Builder setUnreachable(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureUnreachableIsMutable(); + unreachable_.set(index, value); + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Locations that could not be reached.
+     * 
+ * + * repeated string unreachable = 3; + * + * @param value The unreachable to add. + * @return This builder for chaining. + */ + public Builder addUnreachable(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureUnreachableIsMutable(); + unreachable_.add(value); + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Locations that could not be reached.
+     * 
+ * + * repeated string unreachable = 3; + * + * @param values The unreachable to add. + * @return This builder for chaining. + */ + public Builder addAllUnreachable(java.lang.Iterable values) { + ensureUnreachableIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, unreachable_); + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Locations that could not be reached.
+     * 
+ * + * repeated string unreachable = 3; + * + * @return This builder for chaining. + */ + public Builder clearUnreachable() { + unreachable_ = com.google.protobuf.LazyStringArrayList.emptyList(); + bitField0_ = (bitField0_ & ~0x00000004); + ; + onChanged(); + return this; + } + /** + * + * + *
+     * Locations that could not be reached.
+     * 
+ * + * repeated string unreachable = 3; + * + * @param value The bytes of the unreachable to add. + * @return This builder for chaining. + */ + public Builder addUnreachableBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureUnreachableIsMutable(); + unreachable_.add(value); + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.alloydb.v1beta.ListUsersResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.alloydb.v1beta.ListUsersResponse) + private static final com.google.cloud.alloydb.v1beta.ListUsersResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.alloydb.v1beta.ListUsersResponse(); + } + + public static com.google.cloud.alloydb.v1beta.ListUsersResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListUsersResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1beta.ListUsersResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/ListUsersResponseOrBuilder.java b/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/ListUsersResponseOrBuilder.java new file mode 100644 index 000000000000..4bc1eed15a37 --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/ListUsersResponseOrBuilder.java @@ -0,0 +1,152 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/alloydb/v1beta/service.proto + +package com.google.cloud.alloydb.v1beta; + +public interface ListUsersResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.alloydb.v1beta.ListUsersResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The list of User
+   * 
+ * + * repeated .google.cloud.alloydb.v1beta.User users = 1; + */ + java.util.List getUsersList(); + /** + * + * + *
+   * The list of User
+   * 
+ * + * repeated .google.cloud.alloydb.v1beta.User users = 1; + */ + com.google.cloud.alloydb.v1beta.User getUsers(int index); + /** + * + * + *
+   * The list of User
+   * 
+ * + * repeated .google.cloud.alloydb.v1beta.User users = 1; + */ + int getUsersCount(); + /** + * + * + *
+   * The list of User
+   * 
+ * + * repeated .google.cloud.alloydb.v1beta.User users = 1; + */ + java.util.List getUsersOrBuilderList(); + /** + * + * + *
+   * The list of User
+   * 
+ * + * repeated .google.cloud.alloydb.v1beta.User users = 1; + */ + com.google.cloud.alloydb.v1beta.UserOrBuilder getUsersOrBuilder(int index); + + /** + * + * + *
+   * A token identifying a page of results the server should return.
+   * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + java.lang.String getNextPageToken(); + /** + * + * + *
+   * A token identifying a page of results the server should return.
+   * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + com.google.protobuf.ByteString getNextPageTokenBytes(); + + /** + * + * + *
+   * Locations that could not be reached.
+   * 
+ * + * repeated string unreachable = 3; + * + * @return A list containing the unreachable. + */ + java.util.List getUnreachableList(); + /** + * + * + *
+   * Locations that could not be reached.
+   * 
+ * + * repeated string unreachable = 3; + * + * @return The count of unreachable. + */ + int getUnreachableCount(); + /** + * + * + *
+   * Locations that could not be reached.
+   * 
+ * + * repeated string unreachable = 3; + * + * @param index The index of the element to return. + * @return The unreachable at the given index. + */ + java.lang.String getUnreachable(int index); + /** + * + * + *
+   * Locations that could not be reached.
+   * 
+ * + * repeated string unreachable = 3; + * + * @param index The index of the value to return. + * @return The bytes of the unreachable at the given index. + */ + com.google.protobuf.ByteString getUnreachableBytes(int index); +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/ResourcesProto.java b/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/ResourcesProto.java index af446137bade..50f6796f22ed 100644 --- a/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/ResourcesProto.java +++ b/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/ResourcesProto.java @@ -87,6 +87,10 @@ public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry r internal_static_google_cloud_alloydb_v1beta_Cluster_descriptor; static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_google_cloud_alloydb_v1beta_Cluster_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_alloydb_v1beta_Cluster_NetworkConfig_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_alloydb_v1beta_Cluster_NetworkConfig_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_google_cloud_alloydb_v1beta_Cluster_SecondaryConfig_descriptor; static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable @@ -123,6 +127,10 @@ public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry r internal_static_google_cloud_alloydb_v1beta_Instance_ReadPoolConfig_descriptor; static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_google_cloud_alloydb_v1beta_Instance_ReadPoolConfig_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_alloydb_v1beta_Instance_UpdatePolicy_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_alloydb_v1beta_Instance_UpdatePolicy_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_google_cloud_alloydb_v1beta_Instance_LabelsEntry_descriptor; static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable @@ -163,6 +171,10 @@ public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry r internal_static_google_cloud_alloydb_v1beta_SupportedDatabaseFlag_IntegerRestrictions_descriptor; static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_google_cloud_alloydb_v1beta_SupportedDatabaseFlag_IntegerRestrictions_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_alloydb_v1beta_User_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_alloydb_v1beta_User_fieldAccessorTable; public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { return descriptor; @@ -194,234 +206,259 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + "s.googleapis.com/CryptoKeyVersion\"\\\n\004Typ" + "e\022\024\n\020TYPE_UNSPECIFIED\020\000\022\035\n\031GOOGLE_DEFAUL" + "T_ENCRYPTION\020\001\022\037\n\033CUSTOMER_MANAGED_ENCRY" - + "PTION\020\002\"\302\002\n\tSslConfig\022F\n\010ssl_mode\030\001 \001(\0162" + + "PTION\020\002\"\210\003\n\tSslConfig\022F\n\010ssl_mode\030\001 \001(\0162" + "..google.cloud.alloydb.v1beta.SslConfig." + "SslModeB\004\342A\001\001\022H\n\tca_source\030\002 \001(\0162/.googl" + "e.cloud.alloydb.v1beta.SslConfig.CaSourc" - + "eB\004\342A\001\001\"e\n\007SslMode\022\030\n\024SSL_MODE_UNSPECIFI" - + "ED\020\000\022\022\n\016SSL_MODE_ALLOW\020\001\022\024\n\020SSL_MODE_REQ" - + "UIRE\020\002\022\026\n\022SSL_MODE_VERIFY_CA\020\003\"<\n\010CaSour" - + "ce\022\031\n\025CA_SOURCE_UNSPECIFIED\020\000\022\025\n\021CA_SOUR" - + "CE_MANAGED\020\001\"\372\006\n\025AutomatedBackupPolicy\022\\" - + "\n\017weekly_schedule\030\002 \001(\0132A.google.cloud.a" - + "lloydb.v1beta.AutomatedBackupPolicy.Week" - + "lyScheduleH\000\022e\n\024time_based_retention\030\004 \001" - + "(\0132E.google.cloud.alloydb.v1beta.Automat" - + "edBackupPolicy.TimeBasedRetentionH\001\022m\n\030q" - + "uantity_based_retention\030\005 \001(\0132I.google.c" - + "loud.alloydb.v1beta.AutomatedBackupPolic" - + "y.QuantityBasedRetentionH\001\022\024\n\007enabled\030\001 " - + "\001(\010H\002\210\001\001\0220\n\rbackup_window\030\003 \001(\0132\031.google" - + ".protobuf.Duration\022N\n\021encryption_config\030" - + "\010 \001(\0132-.google.cloud.alloydb.v1beta.Encr" - + "yptionConfigB\004\342A\001\001\022\020\n\010location\030\006 \001(\t\022N\n\006" - + "labels\030\007 \003(\0132>.google.cloud.alloydb.v1be" - + "ta.AutomatedBackupPolicy.LabelsEntry\032k\n\016" - + "WeeklySchedule\022+\n\013start_times\030\001 \003(\0132\026.go" - + "ogle.type.TimeOfDay\022,\n\014days_of_week\030\002 \003(" - + "\0162\026.google.type.DayOfWeek\032I\n\022TimeBasedRe" - + "tention\0223\n\020retention_period\030\001 \001(\0132\031.goog" - + "le.protobuf.Duration\032\'\n\026QuantityBasedRet" - + "ention\022\r\n\005count\030\001 \001(\005\032-\n\013LabelsEntry\022\013\n\003" - + "key\030\001 \001(\t\022\r\n\005value\030\002 \001(\t:\0028\001B\n\n\010schedule" - + "B\013\n\tretentionB\n\n\010_enabled\"\242\001\n\026Continuous" - + "BackupConfig\022\024\n\007enabled\030\001 \001(\010H\000\210\001\001\022\034\n\024re" - + "covery_window_days\030\004 \001(\005\022H\n\021encryption_c" - + "onfig\030\003 \001(\0132-.google.cloud.alloydb.v1bet" - + "a.EncryptionConfigB\n\n\010_enabled\"\312\001\n\024Conti" - + "nuousBackupInfo\022J\n\017encryption_info\030\001 \001(\013" - + "2+.google.cloud.alloydb.v1beta.Encryptio" - + "nInfoB\004\342A\001\003\0226\n\014enabled_time\030\002 \001(\0132\032.goog" - + "le.protobuf.TimestampB\004\342A\001\003\022.\n\010schedule\030" - + "\003 \003(\0162\026.google.type.DayOfWeekB\004\342A\001\003\"e\n\014B" - + "ackupSource\022\030\n\nbackup_uid\030\002 \001(\tB\004\342A\001\003\022;\n" - + "\013backup_name\030\001 \001(\tB&\342A\001\002\372A\037\n\035alloydb.goo" - + "gleapis.com/Backup\"h\n\026ContinuousBackupSo" - + "urce\022\025\n\007cluster\030\001 \001(\tB\004\342A\001\002\0227\n\rpoint_in_" - + "time\030\002 \001(\0132\032.google.protobuf.TimestampB\004" - + "\342A\001\002\"\301\020\n\007Cluster\022H\n\rbackup_source\030\017 \001(\0132" - + ").google.cloud.alloydb.v1beta.BackupSour" - + "ceB\004\342A\001\003H\000\022N\n\020migration_source\030\020 \001(\0132,.g" - + "oogle.cloud.alloydb.v1beta.MigrationSour" - + "ceB\004\342A\001\003H\000\022\022\n\004name\030\001 \001(\tB\004\342A\001\003\022\024\n\014displa" - + "y_name\030\002 \001(\t\022\021\n\003uid\030\003 \001(\tB\004\342A\001\003\0225\n\013creat" - + "e_time\030\004 \001(\0132\032.google.protobuf.Timestamp" - + "B\004\342A\001\003\0225\n\013update_time\030\005 \001(\0132\032.google.pro" - + "tobuf.TimestampB\004\342A\001\003\0225\n\013delete_time\030\006 \001" - + "(\0132\032.google.protobuf.TimestampB\004\342A\001\003\022@\n\006" - + "labels\030\007 \003(\01320.google.cloud.alloydb.v1be" - + "ta.Cluster.LabelsEntry\022?\n\005state\030\010 \001(\0162*." - + "google.cloud.alloydb.v1beta.Cluster.Stat" - + "eB\004\342A\001\003\022L\n\014cluster_type\030\030 \001(\01620.google.c" - + "loud.alloydb.v1beta.Cluster.ClusterTypeB" - + "\004\342A\001\003\022L\n\020database_version\030\t \001(\0162,.google" - + ".cloud.alloydb.v1beta.DatabaseVersionB\004\342" - + "A\001\003\0228\n\007network\030\n \001(\tB\'\342A\001\002\372A \n\036compute.g" - + "oogleapis.com/Network\022\014\n\004etag\030\013 \001(\t\022J\n\013a" - + "nnotations\030\014 \003(\01325.google.cloud.alloydb." - + "v1beta.Cluster.AnnotationsEntry\022\031\n\013recon" - + "ciling\030\r \001(\010B\004\342A\001\003\022E\n\014initial_user\030\016 \001(\013" - + "2).google.cloud.alloydb.v1beta.UserPassw" - + "ordB\004\342A\001\004\022S\n\027automated_backup_policy\030\021 \001" - + "(\01322.google.cloud.alloydb.v1beta.Automat" - + "edBackupPolicy\022:\n\nssl_config\030\022 \001(\0132&.goo" - + "gle.cloud.alloydb.v1beta.SslConfig\022N\n\021en" - + "cryption_config\030\023 \001(\0132-.google.cloud.all" - + "oydb.v1beta.EncryptionConfigB\004\342A\001\001\022J\n\017en" - + "cryption_info\030\024 \001(\0132+.google.cloud.alloy" - + "db.v1beta.EncryptionInfoB\004\342A\001\003\022[\n\030contin" - + "uous_backup_config\030\033 \001(\01323.google.cloud." - + "alloydb.v1beta.ContinuousBackupConfigB\004\342" - + "A\001\001\022W\n\026continuous_backup_info\030\034 \001(\01321.go" - + "ogle.cloud.alloydb.v1beta.ContinuousBack" - + "upInfoB\004\342A\001\003\022N\n\020secondary_config\030\026 \001(\01324" - + ".google.cloud.alloydb.v1beta.Cluster.Sec" - + "ondaryConfig\022P\n\016primary_config\030\027 \001(\01322.g" - + "oogle.cloud.alloydb.v1beta.Cluster.Prima" - + "ryConfigB\004\342A\001\003\032/\n\017SecondaryConfig\022\034\n\024pri" - + "mary_cluster_name\030\001 \001(\t\0326\n\rPrimaryConfig" - + "\022%\n\027secondary_cluster_names\030\001 \003(\tB\004\342A\001\003\032" - + "-\n\013LabelsEntry\022\013\n\003key\030\001 \001(\t\022\r\n\005value\030\002 \001" - + "(\t:\0028\001\0322\n\020AnnotationsEntry\022\013\n\003key\030\001 \001(\t\022" - + "\r\n\005value\030\002 \001(\t:\0028\001\"\234\001\n\005State\022\025\n\021STATE_UN" - + "SPECIFIED\020\000\022\t\n\005READY\020\001\022\013\n\007STOPPED\020\002\022\t\n\005E" - + "MPTY\020\003\022\014\n\010CREATING\020\004\022\014\n\010DELETING\020\005\022\n\n\006FA" - + "ILED\020\006\022\021\n\rBOOTSTRAPPING\020\007\022\017\n\013MAINTENANCE" - + "\020\010\022\r\n\tPROMOTING\020\t\"G\n\013ClusterType\022\034\n\030CLUS" - + "TER_TYPE_UNSPECIFIED\020\000\022\013\n\007PRIMARY\020\001\022\r\n\tS" - + "ECONDARY\020\002:b\352A_\n\036alloydb.googleapis.com/" - + "Cluster\022:projects/{project}/locations/{l" - + "ocation}/clusters/{cluster}R\001\001B\010\n\006source" - + "\"\352\020\n\010Instance\022\022\n\004name\030\001 \001(\tB\004\342A\001\003\022\024\n\014dis" - + "play_name\030\002 \001(\t\022\021\n\003uid\030\003 \001(\tB\004\342A\001\003\0225\n\013cr" - + "eate_time\030\004 \001(\0132\032.google.protobuf.Timest" - + "ampB\004\342A\001\003\0225\n\013update_time\030\005 \001(\0132\032.google." - + "protobuf.TimestampB\004\342A\001\003\0225\n\013delete_time\030" - + "\006 \001(\0132\032.google.protobuf.TimestampB\004\342A\001\003\022" - + "A\n\006labels\030\007 \003(\01321.google.cloud.alloydb.v" - + "1beta.Instance.LabelsEntry\022@\n\005state\030\010 \001(" - + "\0162+.google.cloud.alloydb.v1beta.Instance" - + ".StateB\004\342A\001\003\022O\n\rinstance_type\030\t \001(\01622.go" - + "ogle.cloud.alloydb.v1beta.Instance.Insta" - + "nceTypeB\004\342A\001\002\022K\n\016machine_config\030\n \001(\01323." - + "google.cloud.alloydb.v1beta.Instance.Mac" - + "hineConfig\022Q\n\021availability_type\030\013 \001(\01626." - + "google.cloud.alloydb.v1beta.Instance.Ava" - + "ilabilityType\022\020\n\010gce_zone\030\014 \001(\t\022P\n\016datab" - + "ase_flags\030\r \003(\01328.google.cloud.alloydb.v" - + "1beta.Instance.DatabaseFlagsEntry\022G\n\rwri" - + "table_node\030\023 \001(\0132*.google.cloud.alloydb." - + "v1beta.Instance.NodeB\004\342A\001\003\022?\n\005nodes\030\024 \003(" - + "\0132*.google.cloud.alloydb.v1beta.Instance" - + ".NodeB\004\342A\001\003\022`\n\025query_insights_config\030\025 \001" - + "(\0132A.google.cloud.alloydb.v1beta.Instanc" - + "e.QueryInsightsInstanceConfig\022N\n\020read_po" - + "ol_config\030\016 \001(\01324.google.cloud.alloydb.v" - + "1beta.Instance.ReadPoolConfig\022\030\n\nip_addr" - + "ess\030\017 \001(\tB\004\342A\001\003\022\031\n\013reconciling\030\020 \001(\010B\004\342A" - + "\001\003\022\014\n\004etag\030\021 \001(\t\022K\n\013annotations\030\022 \003(\01326." - + "google.cloud.alloydb.v1beta.Instance.Ann" - + "otationsEntry\032\"\n\rMachineConfig\022\021\n\tcpu_co" - + "unt\030\001 \001(\005\032>\n\004Node\022\017\n\007zone_id\030\001 \001(\t\022\n\n\002id" - + "\030\002 \001(\t\022\n\n\002ip\030\003 \001(\t\022\r\n\005state\030\004 \001(\t\032\372\001\n\033Qu" - + "eryInsightsInstanceConfig\022$\n\027record_appl" - + "ication_tags\030\002 \001(\010H\000\210\001\001\022\"\n\025record_client" - + "_address\030\003 \001(\010H\001\210\001\001\022\033\n\023query_string_leng" - + "th\030\004 \001(\r\022#\n\026query_plans_per_minute\030\005 \001(\r" - + "H\002\210\001\001B\032\n\030_record_application_tagsB\030\n\026_re" - + "cord_client_addressB\031\n\027_query_plans_per_" - + "minute\032$\n\016ReadPoolConfig\022\022\n\nnode_count\030\001" - + " \001(\005\032-\n\013LabelsEntry\022\013\n\003key\030\001 \001(\t\022\r\n\005valu" - + "e\030\002 \001(\t:\0028\001\0324\n\022DatabaseFlagsEntry\022\013\n\003key" - + "\030\001 \001(\t\022\r\n\005value\030\002 \001(\t:\0028\001\0322\n\020Annotations" - + "Entry\022\013\n\003key\030\001 \001(\t\022\r\n\005value\030\002 \001(\t:\0028\001\"\221\001" - + "\n\005State\022\025\n\021STATE_UNSPECIFIED\020\000\022\t\n\005READY\020" - + "\001\022\013\n\007STOPPED\020\002\022\014\n\010CREATING\020\003\022\014\n\010DELETING" - + "\020\004\022\017\n\013MAINTENANCE\020\005\022\n\n\006FAILED\020\006\022\021\n\rBOOTS" - + "TRAPPING\020\010\022\r\n\tPROMOTING\020\t\"X\n\014InstanceTyp" - + "e\022\035\n\031INSTANCE_TYPE_UNSPECIFIED\020\000\022\013\n\007PRIM" - + "ARY\020\001\022\r\n\tREAD_POOL\020\002\022\r\n\tSECONDARY\020\003\"N\n\020A" - + "vailabilityType\022!\n\035AVAILABILITY_TYPE_UNS" - + "PECIFIED\020\000\022\t\n\005ZONAL\020\001\022\014\n\010REGIONAL\020\002:x\352Au" - + "\n\037alloydb.googleapis.com/Instance\022Oproje" - + "cts/{project}/locations/{location}/clust" - + "ers/{cluster}/instances/{instance}R\001\001\"\207\002" - + "\n\016ConnectionInfo\022\014\n\004name\030\001 \001(\t\022\030\n\nip_add" - + "ress\030\002 \001(\tB\004\342A\001\003\022#\n\025pem_certificate_chai" - + "n\030\003 \003(\tB\004\342A\001\003\022\032\n\014instance_uid\030\004 \001(\tB\004\342A\001" - + "\003:\213\001\352A\207\001\n%alloydb.googleapis.com/Connect" - + "ionInfo\022^projects/{project}/locations/{l" - + "ocation}/clusters/{cluster}/instances/{i" - + "nstance}/connectionInfo\"\326\t\n\006Backup\022\022\n\004na" - + "me\030\001 \001(\tB\004\342A\001\003\022\024\n\014display_name\030\002 \001(\t\022\021\n\003" - + "uid\030\003 \001(\tB\004\342A\001\003\0225\n\013create_time\030\004 \001(\0132\032.g" - + "oogle.protobuf.TimestampB\004\342A\001\003\0225\n\013update" - + "_time\030\005 \001(\0132\032.google.protobuf.TimestampB" - + "\004\342A\001\003\0225\n\013delete_time\030\017 \001(\0132\032.google.prot" - + "obuf.TimestampB\004\342A\001\003\022?\n\006labels\030\006 \003(\0132/.g" - + "oogle.cloud.alloydb.v1beta.Backup.Labels" - + "Entry\022>\n\005state\030\007 \001(\0162).google.cloud.allo" - + "ydb.v1beta.Backup.StateB\004\342A\001\003\0226\n\004type\030\010 " - + "\001(\0162(.google.cloud.alloydb.v1beta.Backup" - + ".Type\022\023\n\013description\030\t \001(\t\022\031\n\013cluster_ui" - + "d\030\022 \001(\tB\004\342A\001\003\022=\n\014cluster_name\030\n \001(\tB\'\342A\001" - + "\002\372A \n\036alloydb.googleapis.com/Cluster\022\031\n\013" - + "reconciling\030\013 \001(\010B\004\342A\001\003\022N\n\021encryption_co" - + "nfig\030\014 \001(\0132-.google.cloud.alloydb.v1beta" - + ".EncryptionConfigB\004\342A\001\001\022J\n\017encryption_in" - + "fo\030\r \001(\0132+.google.cloud.alloydb.v1beta.E" - + "ncryptionInfoB\004\342A\001\003\022\014\n\004etag\030\016 \001(\t\022I\n\013ann" - + "otations\030\020 \003(\01324.google.cloud.alloydb.v1" - + "beta.Backup.AnnotationsEntry\022\030\n\nsize_byt" - + "es\030\021 \001(\003B\004\342A\001\003\0225\n\013expiry_time\030\023 \001(\0132\032.go" - + "ogle.protobuf.TimestampB\004\342A\001\003\032-\n\013LabelsE" - + "ntry\022\013\n\003key\030\001 \001(\t\022\r\n\005value\030\002 \001(\t:\0028\001\0322\n\020" - + "AnnotationsEntry\022\013\n\003key\030\001 \001(\t\022\r\n\005value\030\002" - + " \001(\t:\0028\001\"Q\n\005State\022\025\n\021STATE_UNSPECIFIED\020\000" - + "\022\t\n\005READY\020\001\022\014\n\010CREATING\020\002\022\n\n\006FAILED\020\003\022\014\n" - + "\010DELETING\020\004\"J\n\004Type\022\024\n\020TYPE_UNSPECIFIED\020" - + "\000\022\r\n\tON_DEMAND\020\001\022\r\n\tAUTOMATED\020\002\022\016\n\nCONTI" - + "NUOUS\020\003:_\352A\\\n\035alloydb.googleapis.com/Bac" - + "kup\0228projects/{project}/locations/{locat" - + "ion}/backups/{backup}R\001\001\"\330\006\n\025SupportedDa" - + "tabaseFlag\022d\n\023string_restrictions\030\007 \001(\0132" - + "E.google.cloud.alloydb.v1beta.SupportedD" - + "atabaseFlag.StringRestrictionsH\000\022f\n\024inte" - + "ger_restrictions\030\010 \001(\0132F.google.cloud.al" - + "loydb.v1beta.SupportedDatabaseFlag.Integ" - + "erRestrictionsH\000\022\014\n\004name\030\001 \001(\t\022\021\n\tflag_n" - + "ame\030\002 \001(\t\022P\n\nvalue_type\030\003 \001(\0162<.google.c" - + "loud.alloydb.v1beta.SupportedDatabaseFla" - + "g.ValueType\022\037\n\027accepts_multiple_values\030\004" - + " \001(\010\022K\n\025supported_db_versions\030\005 \003(\0162,.go" - + "ogle.cloud.alloydb.v1beta.DatabaseVersio" - + "n\022\033\n\023requires_db_restart\030\006 \001(\010\032,\n\022String" - + "Restrictions\022\026\n\016allowed_values\030\001 \003(\t\032u\n\023" - + "IntegerRestrictions\022.\n\tmin_value\030\001 \001(\0132\033" - + ".google.protobuf.Int64Value\022.\n\tmax_value" - + "\030\002 \001(\0132\033.google.protobuf.Int64Value\"U\n\tV" - + "alueType\022\032\n\026VALUE_TYPE_UNSPECIFIED\020\000\022\n\n\006" - + "STRING\020\001\022\013\n\007INTEGER\020\002\022\t\n\005FLOAT\020\003\022\010\n\004NONE" - + "\020\004:g\352Ad\n,alloydb.googleapis.com/Supporte" - + "dDatabaseFlag\0224projects/{project}/locati" - + "ons/{location}/flags/{flag}B\016\n\014restricti" - + "ons*Y\n\017DatabaseVersion\022 \n\034DATABASE_VERSI" - + "ON_UNSPECIFIED\020\000\022\023\n\013POSTGRES_13\020\001\032\002\010\001\022\017\n" - + "\013POSTGRES_14\020\002*^\n\014InstanceView\022\035\n\031INSTAN" - + "CE_VIEW_UNSPECIFIED\020\000\022\027\n\023INSTANCE_VIEW_B" - + "ASIC\020\001\022\026\n\022INSTANCE_VIEW_FULL\020\002B\306\003\n\037com.g" - + "oogle.cloud.alloydb.v1betaB\016ResourcesPro" - + "toP\001Z9cloud.google.com/go/alloydb/apiv1b" - + "eta/alloydbpb;alloydbpb\252\002\033Google.Cloud.A" - + "lloyDb.V1Beta\312\002\033Google\\Cloud\\AlloyDb\\V1b" - + "eta\352\002\036Google::Cloud::AlloyDB::V1beta\352A\246\001" - + "\n(cloudkms.googleapis.com/CryptoKeyVersi" - + "on\022zprojects/{project}/locations/{locati" - + "on}/keyRings/{key_ring}/cryptoKeys/{cryp" - + "to_key}/cryptoKeyVersions/{crypto_key_ve" - + "rsion}\352AN\n\036compute.googleapis.com/Networ" - + "k\022,projects/{project}/global/networks/{n" - + "etwork}b\006proto3" + + "eB\004\342A\001\001\"\252\001\n\007SslMode\022\030\n\024SSL_MODE_UNSPECIF" + + "IED\020\000\022\026\n\016SSL_MODE_ALLOW\020\001\032\002\010\001\022\030\n\020SSL_MOD" + + "E_REQUIRE\020\002\032\002\010\001\022\032\n\022SSL_MODE_VERIFY_CA\020\003\032" + + "\002\010\001\022#\n\037ALLOW_UNENCRYPTED_AND_ENCRYPTED\020\004" + + "\022\022\n\016ENCRYPTED_ONLY\020\005\"<\n\010CaSource\022\031\n\025CA_S" + + "OURCE_UNSPECIFIED\020\000\022\025\n\021CA_SOURCE_MANAGED" + + "\020\001\"\372\006\n\025AutomatedBackupPolicy\022\\\n\017weekly_s" + + "chedule\030\002 \001(\0132A.google.cloud.alloydb.v1b" + + "eta.AutomatedBackupPolicy.WeeklySchedule" + + "H\000\022e\n\024time_based_retention\030\004 \001(\0132E.googl" + + "e.cloud.alloydb.v1beta.AutomatedBackupPo" + + "licy.TimeBasedRetentionH\001\022m\n\030quantity_ba" + + "sed_retention\030\005 \001(\0132I.google.cloud.alloy" + + "db.v1beta.AutomatedBackupPolicy.Quantity" + + "BasedRetentionH\001\022\024\n\007enabled\030\001 \001(\010H\002\210\001\001\0220" + + "\n\rbackup_window\030\003 \001(\0132\031.google.protobuf." + + "Duration\022N\n\021encryption_config\030\010 \001(\0132-.go" + + "ogle.cloud.alloydb.v1beta.EncryptionConf" + + "igB\004\342A\001\001\022\020\n\010location\030\006 \001(\t\022N\n\006labels\030\007 \003" + + "(\0132>.google.cloud.alloydb.v1beta.Automat" + + "edBackupPolicy.LabelsEntry\032k\n\016WeeklySche" + + "dule\022+\n\013start_times\030\001 \003(\0132\026.google.type." + + "TimeOfDay\022,\n\014days_of_week\030\002 \003(\0162\026.google" + + ".type.DayOfWeek\032I\n\022TimeBasedRetention\0223\n" + + "\020retention_period\030\001 \001(\0132\031.google.protobu" + + "f.Duration\032\'\n\026QuantityBasedRetention\022\r\n\005" + + "count\030\001 \001(\005\032-\n\013LabelsEntry\022\013\n\003key\030\001 \001(\t\022" + + "\r\n\005value\030\002 \001(\t:\0028\001B\n\n\010scheduleB\013\n\tretent" + + "ionB\n\n\010_enabled\"\242\001\n\026ContinuousBackupConf" + + "ig\022\024\n\007enabled\030\001 \001(\010H\000\210\001\001\022\034\n\024recovery_win" + + "dow_days\030\004 \001(\005\022H\n\021encryption_config\030\003 \001(" + + "\0132-.google.cloud.alloydb.v1beta.Encrypti" + + "onConfigB\n\n\010_enabled\"\216\002\n\024ContinuousBacku" + + "pInfo\022J\n\017encryption_info\030\001 \001(\0132+.google." + + "cloud.alloydb.v1beta.EncryptionInfoB\004\342A\001" + + "\003\0226\n\014enabled_time\030\002 \001(\0132\032.google.protobu" + + "f.TimestampB\004\342A\001\003\022.\n\010schedule\030\003 \003(\0162\026.go" + + "ogle.type.DayOfWeekB\004\342A\001\003\022B\n\030earliest_re" + + "storable_time\030\004 \001(\0132\032.google.protobuf.Ti" + + "mestampB\004\342A\001\003\"e\n\014BackupSource\022\030\n\nbackup_" + + "uid\030\002 \001(\tB\004\342A\001\003\022;\n\013backup_name\030\001 \001(\tB&\342A" + + "\001\002\372A\037\n\035alloydb.googleapis.com/Backup\"h\n\026" + + "ContinuousBackupSource\022\025\n\007cluster\030\001 \001(\tB" + + "\004\342A\001\002\0227\n\rpoint_in_time\030\002 \001(\0132\032.google.pr" + + "otobuf.TimestampB\004\342A\001\002\"\204\022\n\007Cluster\022H\n\rba" + + "ckup_source\030\017 \001(\0132).google.cloud.alloydb" + + ".v1beta.BackupSourceB\004\342A\001\003H\000\022N\n\020migratio" + + "n_source\030\020 \001(\0132,.google.cloud.alloydb.v1" + + "beta.MigrationSourceB\004\342A\001\003H\000\022\022\n\004name\030\001 \001" + + "(\tB\004\342A\001\003\022\024\n\014display_name\030\002 \001(\t\022\021\n\003uid\030\003 " + + "\001(\tB\004\342A\001\003\0225\n\013create_time\030\004 \001(\0132\032.google." + + "protobuf.TimestampB\004\342A\001\003\0225\n\013update_time\030" + + "\005 \001(\0132\032.google.protobuf.TimestampB\004\342A\001\003\022" + + "5\n\013delete_time\030\006 \001(\0132\032.google.protobuf.T" + + "imestampB\004\342A\001\003\022@\n\006labels\030\007 \003(\01320.google." + + "cloud.alloydb.v1beta.Cluster.LabelsEntry" + + "\022?\n\005state\030\010 \001(\0162*.google.cloud.alloydb.v" + + "1beta.Cluster.StateB\004\342A\001\003\022L\n\014cluster_typ" + + "e\030\030 \001(\01620.google.cloud.alloydb.v1beta.Cl" + + "uster.ClusterTypeB\004\342A\001\003\022L\n\020database_vers" + + "ion\030\t \001(\0162,.google.cloud.alloydb.v1beta." + + "DatabaseVersionB\004\342A\001\003\022P\n\016network_config\030" + + "\035 \001(\01322.google.cloud.alloydb.v1beta.Clus" + + "ter.NetworkConfigB\004\342A\001\001\0228\n\007network\030\n \001(\t" + + "B\'\342A\001\002\372A \n\036compute.googleapis.com/Networ" + + "k\022\014\n\004etag\030\013 \001(\t\022J\n\013annotations\030\014 \003(\01325.g" + + "oogle.cloud.alloydb.v1beta.Cluster.Annot" + + "ationsEntry\022\031\n\013reconciling\030\r \001(\010B\004\342A\001\003\022E" + + "\n\014initial_user\030\016 \001(\0132).google.cloud.allo" + + "ydb.v1beta.UserPasswordB\004\342A\001\004\022S\n\027automat" + + "ed_backup_policy\030\021 \001(\01322.google.cloud.al" + + "loydb.v1beta.AutomatedBackupPolicy\022>\n\nss" + + "l_config\030\022 \001(\0132&.google.cloud.alloydb.v1" + + "beta.SslConfigB\002\030\001\022N\n\021encryption_config\030" + + "\023 \001(\0132-.google.cloud.alloydb.v1beta.Encr" + + "yptionConfigB\004\342A\001\001\022J\n\017encryption_info\030\024 " + + "\001(\0132+.google.cloud.alloydb.v1beta.Encryp" + + "tionInfoB\004\342A\001\003\022[\n\030continuous_backup_conf" + + "ig\030\033 \001(\01323.google.cloud.alloydb.v1beta.C" + + "ontinuousBackupConfigB\004\342A\001\001\022W\n\026continuou" + + "s_backup_info\030\034 \001(\01321.google.cloud.alloy" + + "db.v1beta.ContinuousBackupInfoB\004\342A\001\003\022N\n\020" + + "secondary_config\030\026 \001(\01324.google.cloud.al" + + "loydb.v1beta.Cluster.SecondaryConfig\022P\n\016" + + "primary_config\030\027 \001(\01322.google.cloud.allo" + + "ydb.v1beta.Cluster.PrimaryConfigB\004\342A\001\003\032k" + + "\n\rNetworkConfig\0228\n\007network\030\001 \001(\tB\'\342A\001\002\372A" + + " \n\036compute.googleapis.com/Network\022 \n\022all" + + "ocated_ip_range\030\002 \001(\tB\004\342A\001\001\032/\n\017Secondary" + + "Config\022\034\n\024primary_cluster_name\030\001 \001(\t\0326\n\r" + + "PrimaryConfig\022%\n\027secondary_cluster_names" + + "\030\001 \003(\tB\004\342A\001\003\032-\n\013LabelsEntry\022\013\n\003key\030\001 \001(\t" + + "\022\r\n\005value\030\002 \001(\t:\0028\001\0322\n\020AnnotationsEntry\022" + + "\013\n\003key\030\001 \001(\t\022\r\n\005value\030\002 \001(\t:\0028\001\"\234\001\n\005Stat" + + "e\022\025\n\021STATE_UNSPECIFIED\020\000\022\t\n\005READY\020\001\022\013\n\007S" + + "TOPPED\020\002\022\t\n\005EMPTY\020\003\022\014\n\010CREATING\020\004\022\014\n\010DEL" + + "ETING\020\005\022\n\n\006FAILED\020\006\022\021\n\rBOOTSTRAPPING\020\007\022\017" + + "\n\013MAINTENANCE\020\010\022\r\n\tPROMOTING\020\t\"G\n\013Cluste" + + "rType\022\034\n\030CLUSTER_TYPE_UNSPECIFIED\020\000\022\013\n\007P" + + "RIMARY\020\001\022\r\n\tSECONDARY\020\002:b\352A_\n\036alloydb.go" + + "ogleapis.com/Cluster\022:projects/{project}" + + "/locations/{location}/clusters/{cluster}" + + "R\001\001B\010\n\006source\"\311\022\n\010Instance\022\022\n\004name\030\001 \001(\t" + + "B\004\342A\001\003\022\024\n\014display_name\030\002 \001(\t\022\021\n\003uid\030\003 \001(" + + "\tB\004\342A\001\003\0225\n\013create_time\030\004 \001(\0132\032.google.pr" + + "otobuf.TimestampB\004\342A\001\003\0225\n\013update_time\030\005 " + + "\001(\0132\032.google.protobuf.TimestampB\004\342A\001\003\0225\n" + + "\013delete_time\030\006 \001(\0132\032.google.protobuf.Tim" + + "estampB\004\342A\001\003\022A\n\006labels\030\007 \003(\01321.google.cl" + + "oud.alloydb.v1beta.Instance.LabelsEntry\022" + + "@\n\005state\030\010 \001(\0162+.google.cloud.alloydb.v1" + + "beta.Instance.StateB\004\342A\001\003\022O\n\rinstance_ty" + + "pe\030\t \001(\01622.google.cloud.alloydb.v1beta.I" + + "nstance.InstanceTypeB\004\342A\001\002\022K\n\016machine_co" + + "nfig\030\n \001(\01323.google.cloud.alloydb.v1beta" + + ".Instance.MachineConfig\022Q\n\021availability_" + + "type\030\013 \001(\01626.google.cloud.alloydb.v1beta" + + ".Instance.AvailabilityType\022\020\n\010gce_zone\030\014" + + " \001(\t\022P\n\016database_flags\030\r \003(\01328.google.cl" + + "oud.alloydb.v1beta.Instance.DatabaseFlag" + + "sEntry\022G\n\rwritable_node\030\023 \001(\0132*.google.c" + + "loud.alloydb.v1beta.Instance.NodeB\004\342A\001\003\022" + + "?\n\005nodes\030\024 \003(\0132*.google.cloud.alloydb.v1" + + "beta.Instance.NodeB\004\342A\001\003\022`\n\025query_insigh" + + "ts_config\030\025 \001(\0132A.google.cloud.alloydb.v" + + "1beta.Instance.QueryInsightsInstanceConf" + + "ig\022N\n\020read_pool_config\030\016 \001(\01324.google.cl" + + "oud.alloydb.v1beta.Instance.ReadPoolConf" + + "ig\022\030\n\nip_address\030\017 \001(\tB\004\342A\001\003\022\031\n\013reconcil" + + "ing\030\020 \001(\010B\004\342A\001\003\022\014\n\004etag\030\021 \001(\t\022K\n\013annotat" + + "ions\030\022 \003(\01326.google.cloud.alloydb.v1beta" + + ".Instance.AnnotationsEntry\022I\n\rupdate_pol" + + "icy\030\026 \001(\01322.google.cloud.alloydb.v1beta." + + "Instance.UpdatePolicy\032\"\n\rMachineConfig\022\021" + + "\n\tcpu_count\030\001 \001(\005\032>\n\004Node\022\017\n\007zone_id\030\001 \001" + + "(\t\022\n\n\002id\030\002 \001(\t\022\n\n\002ip\030\003 \001(\t\022\r\n\005state\030\004 \001(" + + "\t\032\372\001\n\033QueryInsightsInstanceConfig\022$\n\027rec" + + "ord_application_tags\030\002 \001(\010H\000\210\001\001\022\"\n\025recor" + + "d_client_address\030\003 \001(\010H\001\210\001\001\022\033\n\023query_str" + + "ing_length\030\004 \001(\r\022#\n\026query_plans_per_minu" + + "te\030\005 \001(\rH\002\210\001\001B\032\n\030_record_application_tag" + + "sB\030\n\026_record_client_addressB\031\n\027_query_pl" + + "ans_per_minute\032$\n\016ReadPoolConfig\022\022\n\nnode" + + "_count\030\001 \001(\005\032\221\001\n\014UpdatePolicy\022E\n\004mode\030\001 " + + "\001(\01627.google.cloud.alloydb.v1beta.Instan" + + "ce.UpdatePolicy.Mode\":\n\004Mode\022\024\n\020MODE_UNS" + + "PECIFIED\020\000\022\013\n\007DEFAULT\020\001\022\017\n\013FORCE_APPLY\020\002" + + "\032-\n\013LabelsEntry\022\013\n\003key\030\001 \001(\t\022\r\n\005value\030\002 " + + "\001(\t:\0028\001\0324\n\022DatabaseFlagsEntry\022\013\n\003key\030\001 \001" + + "(\t\022\r\n\005value\030\002 \001(\t:\0028\001\0322\n\020AnnotationsEntr" + + "y\022\013\n\003key\030\001 \001(\t\022\r\n\005value\030\002 \001(\t:\0028\001\"\221\001\n\005St" + + "ate\022\025\n\021STATE_UNSPECIFIED\020\000\022\t\n\005READY\020\001\022\013\n" + + "\007STOPPED\020\002\022\014\n\010CREATING\020\003\022\014\n\010DELETING\020\004\022\017" + + "\n\013MAINTENANCE\020\005\022\n\n\006FAILED\020\006\022\021\n\rBOOTSTRAP" + + "PING\020\010\022\r\n\tPROMOTING\020\t\"X\n\014InstanceType\022\035\n" + + "\031INSTANCE_TYPE_UNSPECIFIED\020\000\022\013\n\007PRIMARY\020" + + "\001\022\r\n\tREAD_POOL\020\002\022\r\n\tSECONDARY\020\003\"N\n\020Avail" + + "abilityType\022!\n\035AVAILABILITY_TYPE_UNSPECI" + + "FIED\020\000\022\t\n\005ZONAL\020\001\022\014\n\010REGIONAL\020\002:x\352Au\n\037al" + + "loydb.googleapis.com/Instance\022Oprojects/" + + "{project}/locations/{location}/clusters/" + + "{cluster}/instances/{instance}R\001\001\"\211\002\n\016Co" + + "nnectionInfo\022\014\n\004name\030\001 \001(\t\022\030\n\nip_address" + + "\030\002 \001(\tB\004\342A\001\003\022%\n\025pem_certificate_chain\030\003 " + + "\003(\tB\006\030\001\342A\001\003\022\032\n\014instance_uid\030\004 \001(\tB\004\342A\001\003:" + + "\213\001\352A\207\001\n%alloydb.googleapis.com/Connectio" + + "nInfo\022^projects/{project}/locations/{loc" + + "ation}/clusters/{cluster}/instances/{ins" + + "tance}/connectionInfo\"\326\t\n\006Backup\022\022\n\004name" + + "\030\001 \001(\tB\004\342A\001\003\022\024\n\014display_name\030\002 \001(\t\022\021\n\003ui" + + "d\030\003 \001(\tB\004\342A\001\003\0225\n\013create_time\030\004 \001(\0132\032.goo" + + "gle.protobuf.TimestampB\004\342A\001\003\0225\n\013update_t" + + "ime\030\005 \001(\0132\032.google.protobuf.TimestampB\004\342" + + "A\001\003\0225\n\013delete_time\030\017 \001(\0132\032.google.protob" + + "uf.TimestampB\004\342A\001\003\022?\n\006labels\030\006 \003(\0132/.goo" + + "gle.cloud.alloydb.v1beta.Backup.LabelsEn" + + "try\022>\n\005state\030\007 \001(\0162).google.cloud.alloyd" + + "b.v1beta.Backup.StateB\004\342A\001\003\0226\n\004type\030\010 \001(" + + "\0162(.google.cloud.alloydb.v1beta.Backup.T" + + "ype\022\023\n\013description\030\t \001(\t\022\031\n\013cluster_uid\030" + + "\022 \001(\tB\004\342A\001\003\022=\n\014cluster_name\030\n \001(\tB\'\342A\001\002\372" + + "A \n\036alloydb.googleapis.com/Cluster\022\031\n\013re" + + "conciling\030\013 \001(\010B\004\342A\001\003\022N\n\021encryption_conf" + + "ig\030\014 \001(\0132-.google.cloud.alloydb.v1beta.E" + + "ncryptionConfigB\004\342A\001\001\022J\n\017encryption_info" + + "\030\r \001(\0132+.google.cloud.alloydb.v1beta.Enc" + + "ryptionInfoB\004\342A\001\003\022\014\n\004etag\030\016 \001(\t\022I\n\013annot" + + "ations\030\020 \003(\01324.google.cloud.alloydb.v1be" + + "ta.Backup.AnnotationsEntry\022\030\n\nsize_bytes" + + "\030\021 \001(\003B\004\342A\001\003\0225\n\013expiry_time\030\023 \001(\0132\032.goog" + + "le.protobuf.TimestampB\004\342A\001\003\032-\n\013LabelsEnt" + + "ry\022\013\n\003key\030\001 \001(\t\022\r\n\005value\030\002 \001(\t:\0028\001\0322\n\020An" + + "notationsEntry\022\013\n\003key\030\001 \001(\t\022\r\n\005value\030\002 \001" + + "(\t:\0028\001\"Q\n\005State\022\025\n\021STATE_UNSPECIFIED\020\000\022\t" + + "\n\005READY\020\001\022\014\n\010CREATING\020\002\022\n\n\006FAILED\020\003\022\014\n\010D" + + "ELETING\020\004\"J\n\004Type\022\024\n\020TYPE_UNSPECIFIED\020\000\022" + + "\r\n\tON_DEMAND\020\001\022\r\n\tAUTOMATED\020\002\022\016\n\nCONTINU" + + "OUS\020\003:_\352A\\\n\035alloydb.googleapis.com/Backu" + + "p\0228projects/{project}/locations/{locatio" + + "n}/backups/{backup}R\001\001\"\330\006\n\025SupportedData" + + "baseFlag\022d\n\023string_restrictions\030\007 \001(\0132E." + + "google.cloud.alloydb.v1beta.SupportedDat" + + "abaseFlag.StringRestrictionsH\000\022f\n\024intege" + + "r_restrictions\030\010 \001(\0132F.google.cloud.allo" + + "ydb.v1beta.SupportedDatabaseFlag.Integer" + + "RestrictionsH\000\022\014\n\004name\030\001 \001(\t\022\021\n\tflag_nam" + + "e\030\002 \001(\t\022P\n\nvalue_type\030\003 \001(\0162<.google.clo" + + "ud.alloydb.v1beta.SupportedDatabaseFlag." + + "ValueType\022\037\n\027accepts_multiple_values\030\004 \001" + + "(\010\022K\n\025supported_db_versions\030\005 \003(\0162,.goog" + + "le.cloud.alloydb.v1beta.DatabaseVersion\022" + + "\033\n\023requires_db_restart\030\006 \001(\010\032,\n\022StringRe" + + "strictions\022\026\n\016allowed_values\030\001 \003(\t\032u\n\023In" + + "tegerRestrictions\022.\n\tmin_value\030\001 \001(\0132\033.g" + + "oogle.protobuf.Int64Value\022.\n\tmax_value\030\002" + + " \001(\0132\033.google.protobuf.Int64Value\"U\n\tVal" + + "ueType\022\032\n\026VALUE_TYPE_UNSPECIFIED\020\000\022\n\n\006ST" + + "RING\020\001\022\013\n\007INTEGER\020\002\022\t\n\005FLOAT\020\003\022\010\n\004NONE\020\004" + + ":g\352Ad\n,alloydb.googleapis.com/SupportedD" + + "atabaseFlag\0224projects/{project}/location" + + "s/{location}/flags/{flag}B\016\n\014restriction" + + "s\"\326\002\n\004User\022\022\n\004name\030\001 \001(\tB\004\342A\001\003\022\026\n\010passwo" + + "rd\030\002 \001(\tB\004\342A\001\004\022\034\n\016database_roles\030\004 \003(\tB\004" + + "\342A\001\001\022C\n\tuser_type\030\005 \001(\0162*.google.cloud.a" + + "lloydb.v1beta.User.UserTypeB\004\342A\001\001\"Q\n\010Use" + + "rType\022\031\n\025USER_TYPE_UNSPECIFIED\020\000\022\024\n\020ALLO" + + "YDB_BUILT_IN\020\001\022\024\n\020ALLOYDB_IAM_USER\020\002:l\352A" + + "i\n\033alloydb.googleapis.com/User\022Gprojects" + + "/{project}/locations/{location}/clusters" + + "/{cluster}/users/{user}R\001\001*^\n\014InstanceVi" + + "ew\022\035\n\031INSTANCE_VIEW_UNSPECIFIED\020\000\022\027\n\023INS" + + "TANCE_VIEW_BASIC\020\001\022\026\n\022INSTANCE_VIEW_FULL" + + "\020\002*g\n\013ClusterView\022\034\n\030CLUSTER_VIEW_UNSPEC" + + "IFIED\020\000\022\026\n\022CLUSTER_VIEW_BASIC\020\001\022\"\n\036CLUST" + + "ER_VIEW_CONTINUOUS_BACKUP\020\002*Y\n\017DatabaseV" + + "ersion\022 \n\034DATABASE_VERSION_UNSPECIFIED\020\000" + + "\022\023\n\013POSTGRES_13\020\001\032\002\010\001\022\017\n\013POSTGRES_14\020\002B\306" + + "\003\n\037com.google.cloud.alloydb.v1betaB\016Reso" + + "urcesProtoP\001Z9cloud.google.com/go/alloyd" + + "b/apiv1beta/alloydbpb;alloydbpb\252\002\033Google" + + ".Cloud.AlloyDb.V1Beta\312\002\033Google\\Cloud\\All" + + "oyDb\\V1beta\352\002\036Google::Cloud::AlloyDB::V1" + + "beta\352A\246\001\n(cloudkms.googleapis.com/Crypto" + + "KeyVersion\022zprojects/{project}/locations" + + "/{location}/keyRings/{key_ring}/cryptoKe" + + "ys/{crypto_key}/cryptoKeyVersions/{crypt" + + "o_key_version}\352AN\n\036compute.googleapis.co" + + "m/Network\022,projects/{project}/global/net" + + "works/{network}b\006proto3" }; descriptor = com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( @@ -547,7 +584,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_alloydb_v1beta_ContinuousBackupInfo_descriptor, new java.lang.String[] { - "EncryptionInfo", "EnabledTime", "Schedule", + "EncryptionInfo", "EnabledTime", "Schedule", "EarliestRestorableTime", }); internal_static_google_cloud_alloydb_v1beta_BackupSource_descriptor = getDescriptor().getMessageTypes().get(8); @@ -583,6 +620,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "State", "ClusterType", "DatabaseVersion", + "NetworkConfig", "Network", "Etag", "Annotations", @@ -598,8 +636,16 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "PrimaryConfig", "Source", }); - internal_static_google_cloud_alloydb_v1beta_Cluster_SecondaryConfig_descriptor = + internal_static_google_cloud_alloydb_v1beta_Cluster_NetworkConfig_descriptor = internal_static_google_cloud_alloydb_v1beta_Cluster_descriptor.getNestedTypes().get(0); + internal_static_google_cloud_alloydb_v1beta_Cluster_NetworkConfig_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_alloydb_v1beta_Cluster_NetworkConfig_descriptor, + new java.lang.String[] { + "Network", "AllocatedIpRange", + }); + internal_static_google_cloud_alloydb_v1beta_Cluster_SecondaryConfig_descriptor = + internal_static_google_cloud_alloydb_v1beta_Cluster_descriptor.getNestedTypes().get(1); internal_static_google_cloud_alloydb_v1beta_Cluster_SecondaryConfig_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_alloydb_v1beta_Cluster_SecondaryConfig_descriptor, @@ -607,7 +653,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "PrimaryClusterName", }); internal_static_google_cloud_alloydb_v1beta_Cluster_PrimaryConfig_descriptor = - internal_static_google_cloud_alloydb_v1beta_Cluster_descriptor.getNestedTypes().get(1); + internal_static_google_cloud_alloydb_v1beta_Cluster_descriptor.getNestedTypes().get(2); internal_static_google_cloud_alloydb_v1beta_Cluster_PrimaryConfig_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_alloydb_v1beta_Cluster_PrimaryConfig_descriptor, @@ -615,7 +661,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "SecondaryClusterNames", }); internal_static_google_cloud_alloydb_v1beta_Cluster_LabelsEntry_descriptor = - internal_static_google_cloud_alloydb_v1beta_Cluster_descriptor.getNestedTypes().get(2); + internal_static_google_cloud_alloydb_v1beta_Cluster_descriptor.getNestedTypes().get(3); internal_static_google_cloud_alloydb_v1beta_Cluster_LabelsEntry_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_alloydb_v1beta_Cluster_LabelsEntry_descriptor, @@ -623,7 +669,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "Key", "Value", }); internal_static_google_cloud_alloydb_v1beta_Cluster_AnnotationsEntry_descriptor = - internal_static_google_cloud_alloydb_v1beta_Cluster_descriptor.getNestedTypes().get(3); + internal_static_google_cloud_alloydb_v1beta_Cluster_descriptor.getNestedTypes().get(4); internal_static_google_cloud_alloydb_v1beta_Cluster_AnnotationsEntry_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_alloydb_v1beta_Cluster_AnnotationsEntry_descriptor, @@ -657,6 +703,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "Reconciling", "Etag", "Annotations", + "UpdatePolicy", }); internal_static_google_cloud_alloydb_v1beta_Instance_MachineConfig_descriptor = internal_static_google_cloud_alloydb_v1beta_Instance_descriptor.getNestedTypes().get(0); @@ -696,8 +743,16 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { new java.lang.String[] { "NodeCount", }); - internal_static_google_cloud_alloydb_v1beta_Instance_LabelsEntry_descriptor = + internal_static_google_cloud_alloydb_v1beta_Instance_UpdatePolicy_descriptor = internal_static_google_cloud_alloydb_v1beta_Instance_descriptor.getNestedTypes().get(4); + internal_static_google_cloud_alloydb_v1beta_Instance_UpdatePolicy_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_alloydb_v1beta_Instance_UpdatePolicy_descriptor, + new java.lang.String[] { + "Mode", + }); + internal_static_google_cloud_alloydb_v1beta_Instance_LabelsEntry_descriptor = + internal_static_google_cloud_alloydb_v1beta_Instance_descriptor.getNestedTypes().get(5); internal_static_google_cloud_alloydb_v1beta_Instance_LabelsEntry_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_alloydb_v1beta_Instance_LabelsEntry_descriptor, @@ -705,7 +760,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "Key", "Value", }); internal_static_google_cloud_alloydb_v1beta_Instance_DatabaseFlagsEntry_descriptor = - internal_static_google_cloud_alloydb_v1beta_Instance_descriptor.getNestedTypes().get(5); + internal_static_google_cloud_alloydb_v1beta_Instance_descriptor.getNestedTypes().get(6); internal_static_google_cloud_alloydb_v1beta_Instance_DatabaseFlagsEntry_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_alloydb_v1beta_Instance_DatabaseFlagsEntry_descriptor, @@ -713,7 +768,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "Key", "Value", }); internal_static_google_cloud_alloydb_v1beta_Instance_AnnotationsEntry_descriptor = - internal_static_google_cloud_alloydb_v1beta_Instance_descriptor.getNestedTypes().get(6); + internal_static_google_cloud_alloydb_v1beta_Instance_descriptor.getNestedTypes().get(7); internal_static_google_cloud_alloydb_v1beta_Instance_AnnotationsEntry_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_alloydb_v1beta_Instance_AnnotationsEntry_descriptor, @@ -806,6 +861,14 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { new java.lang.String[] { "MinValue", "MaxValue", }); + internal_static_google_cloud_alloydb_v1beta_User_descriptor = + getDescriptor().getMessageTypes().get(15); + internal_static_google_cloud_alloydb_v1beta_User_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_alloydb_v1beta_User_descriptor, + new java.lang.String[] { + "Name", "Password", "DatabaseRoles", "UserType", + }); com.google.protobuf.ExtensionRegistry registry = com.google.protobuf.ExtensionRegistry.newInstance(); registry.add(com.google.api.FieldBehaviorProto.fieldBehavior); diff --git a/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/ServiceProto.java b/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/ServiceProto.java index b8bed402db51..f8f7961ffac1 100644 --- a/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/ServiceProto.java +++ b/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/ServiceProto.java @@ -119,6 +119,10 @@ public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry r internal_static_google_cloud_alloydb_v1beta_FailoverInstanceRequest_descriptor; static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_google_cloud_alloydb_v1beta_FailoverInstanceRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_alloydb_v1beta_InjectFaultRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_alloydb_v1beta_InjectFaultRequest_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_google_cloud_alloydb_v1beta_RestartInstanceRequest_descriptor; static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable @@ -171,6 +175,30 @@ public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry r internal_static_google_cloud_alloydb_v1beta_OperationMetadata_descriptor; static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_google_cloud_alloydb_v1beta_OperationMetadata_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_alloydb_v1beta_ListUsersRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_alloydb_v1beta_ListUsersRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_alloydb_v1beta_ListUsersResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_alloydb_v1beta_ListUsersResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_alloydb_v1beta_GetUserRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_alloydb_v1beta_GetUserRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_alloydb_v1beta_CreateUserRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_alloydb_v1beta_CreateUserRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_alloydb_v1beta_UpdateUserRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_alloydb_v1beta_UpdateUserRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_alloydb_v1beta_DeleteUserRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_alloydb_v1beta_DeleteUserRequest_fieldAccessorTable; public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { return descriptor; @@ -198,304 +226,365 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + "stClustersResponse\0226\n\010clusters\030\001 \003(\0132$.g" + "oogle.cloud.alloydb.v1beta.Cluster\022\027\n\017ne" + "xt_page_token\030\002 \001(\t\022\023\n\013unreachable\030\003 \003(\t" - + "\"J\n\021GetClusterRequest\0225\n\004name\030\001 \001(\tB\'\342A\001" - + "\002\372A \n\036alloydb.googleapis.com/Cluster\"\346\001\n" - + "\035CreateSecondaryClusterRequest\0227\n\006parent" - + "\030\001 \001(\tB\'\342A\001\002\372A \022\036alloydb.googleapis.com/" - + "Cluster\022\030\n\ncluster_id\030\002 \001(\tB\004\342A\001\002\022;\n\007clu" - + "ster\030\003 \001(\0132$.google.cloud.alloydb.v1beta" - + ".ClusterB\004\342A\001\002\022\030\n\nrequest_id\030\005 \001(\tB\004\342A\001\001" - + "\022\033\n\rvalidate_only\030\006 \001(\010B\004\342A\001\001\"\335\001\n\024Create" - + "ClusterRequest\0227\n\006parent\030\001 \001(\tB\'\342A\001\002\372A \022" - + "\036alloydb.googleapis.com/Cluster\022\030\n\nclust" - + "er_id\030\002 \001(\tB\004\342A\001\002\022;\n\007cluster\030\003 \001(\0132$.goo" - + "gle.cloud.alloydb.v1beta.ClusterB\004\342A\001\002\022\030" - + "\n\nrequest_id\030\004 \001(\tB\004\342A\001\001\022\033\n\rvalidate_onl" - + "y\030\005 \001(\010B\004\342A\001\001\"\336\001\n\024UpdateClusterRequest\0225" - + "\n\013update_mask\030\001 \001(\0132\032.google.protobuf.Fi" - + "eldMaskB\004\342A\001\001\022;\n\007cluster\030\002 \001(\0132$.google." - + "cloud.alloydb.v1beta.ClusterB\004\342A\001\002\022\030\n\nre" - + "quest_id\030\003 \001(\tB\004\342A\001\001\022\033\n\rvalidate_only\030\004 " - + "\001(\010B\004\342A\001\001\022\033\n\rallow_missing\030\005 \001(\010B\004\342A\001\001\"\255" - + "\001\n\024DeleteClusterRequest\0225\n\004name\030\001 \001(\tB\'\342" + + "\"\210\001\n\021GetClusterRequest\0225\n\004name\030\001 \001(\tB\'\342A" + + "\001\002\372A \n\036alloydb.googleapis.com/Cluster\022<\n" + + "\004view\030\002 \001(\0162(.google.cloud.alloydb.v1bet" + + "a.ClusterViewB\004\342A\001\001\"\346\001\n\035CreateSecondaryC" + + "lusterRequest\0227\n\006parent\030\001 \001(\tB\'\342A\001\002\372A \022\036" + + "alloydb.googleapis.com/Cluster\022\030\n\ncluste" + + "r_id\030\002 \001(\tB\004\342A\001\002\022;\n\007cluster\030\003 \001(\0132$.goog" + + "le.cloud.alloydb.v1beta.ClusterB\004\342A\001\002\022\030\n" + + "\nrequest_id\030\005 \001(\tB\004\342A\001\001\022\033\n\rvalidate_only" + + "\030\006 \001(\010B\004\342A\001\001\"\335\001\n\024CreateClusterRequest\0227\n" + + "\006parent\030\001 \001(\tB\'\342A\001\002\372A \022\036alloydb.googleap" + + "is.com/Cluster\022\030\n\ncluster_id\030\002 \001(\tB\004\342A\001\002" + + "\022;\n\007cluster\030\003 \001(\0132$.google.cloud.alloydb" + + ".v1beta.ClusterB\004\342A\001\002\022\030\n\nrequest_id\030\004 \001(" + + "\tB\004\342A\001\001\022\033\n\rvalidate_only\030\005 \001(\010B\004\342A\001\001\"\336\001\n" + + "\024UpdateClusterRequest\0225\n\013update_mask\030\001 \001" + + "(\0132\032.google.protobuf.FieldMaskB\004\342A\001\001\022;\n\007" + + "cluster\030\002 \001(\0132$.google.cloud.alloydb.v1b" + + "eta.ClusterB\004\342A\001\002\022\030\n\nrequest_id\030\003 \001(\tB\004\342" + + "A\001\001\022\033\n\rvalidate_only\030\004 \001(\010B\004\342A\001\001\022\033\n\rallo" + + "w_missing\030\005 \001(\010B\004\342A\001\001\"\255\001\n\024DeleteClusterR" + + "equest\0225\n\004name\030\001 \001(\tB\'\342A\001\002\372A \n\036alloydb.g" + + "oogleapis.com/Cluster\022\030\n\nrequest_id\030\002 \001(" + + "\tB\004\342A\001\001\022\022\n\004etag\030\003 \001(\tB\004\342A\001\001\022\033\n\rvalidate_" + + "only\030\004 \001(\010B\004\342A\001\001\022\023\n\005force\030\005 \001(\010B\004\342A\001\001\"\231\001" + + "\n\025PromoteClusterRequest\0225\n\004name\030\001 \001(\tB\'\342" + "A\001\002\372A \n\036alloydb.googleapis.com/Cluster\022\030" + "\n\nrequest_id\030\002 \001(\tB\004\342A\001\001\022\022\n\004etag\030\003 \001(\tB\004" - + "\342A\001\001\022\033\n\rvalidate_only\030\004 \001(\010B\004\342A\001\001\022\023\n\005for" - + "ce\030\005 \001(\010B\004\342A\001\001\"\231\001\n\025PromoteClusterRequest" - + "\0225\n\004name\030\001 \001(\tB\'\342A\001\002\372A \n\036alloydb.googlea" - + "pis.com/Cluster\022\030\n\nrequest_id\030\002 \001(\tB\004\342A\001" - + "\001\022\022\n\004etag\030\003 \001(\tB\004\342A\001\001\022\033\n\rvalidate_only\030\004" - + " \001(\010B\004\342A\001\001\"\205\003\n\025RestoreClusterRequest\022B\n\r" - + "backup_source\030\004 \001(\0132).google.cloud.alloy" - + "db.v1beta.BackupSourceH\000\022W\n\030continuous_b" - + "ackup_source\030\010 \001(\01323.google.cloud.alloyd" - + "b.v1beta.ContinuousBackupSourceH\000\0227\n\006par" - + "ent\030\001 \001(\tB\'\342A\001\002\372A \022\036alloydb.googleapis.c" - + "om/Cluster\022\030\n\ncluster_id\030\002 \001(\tB\004\342A\001\002\022;\n\007" - + "cluster\030\003 \001(\0132$.google.cloud.alloydb.v1b" - + "eta.ClusterB\004\342A\001\002\022\030\n\nrequest_id\030\005 \001(\tB\004\342" - + "A\001\001\022\033\n\rvalidate_only\030\006 \001(\010B\004\342A\001\001B\010\n\006sour" - + "ce\"\253\001\n\024ListInstancesRequest\0228\n\006parent\030\001 " - + "\001(\tB(\342A\001\002\372A!\022\037alloydb.googleapis.com/Ins" - + "tance\022\027\n\tpage_size\030\002 \001(\005B\004\342A\001\001\022\022\n\npage_t" - + "oken\030\003 \001(\t\022\024\n\006filter\030\004 \001(\tB\004\342A\001\001\022\026\n\010orde" - + "r_by\030\005 \001(\tB\004\342A\001\001\"\177\n\025ListInstancesRespons" - + "e\0228\n\tinstances\030\001 \003(\0132%.google.cloud.allo" - + "ydb.v1beta.Instance\022\027\n\017next_page_token\030\002" - + " \001(\t\022\023\n\013unreachable\030\003 \003(\t\"\205\001\n\022GetInstanc" - + "eRequest\0226\n\004name\030\001 \001(\tB(\342A\001\002\372A!\n\037alloydb" - + ".googleapis.com/Instance\0227\n\004view\030\002 \001(\0162)" - + ".google.cloud.alloydb.v1beta.InstanceVie" - + "w\"\342\001\n\025CreateInstanceRequest\0228\n\006parent\030\001 " - + "\001(\tB(\342A\001\002\372A!\022\037alloydb.googleapis.com/Ins" - + "tance\022\031\n\013instance_id\030\002 \001(\tB\004\342A\001\002\022=\n\010inst" - + "ance\030\003 \001(\0132%.google.cloud.alloydb.v1beta" - + ".InstanceB\004\342A\001\002\022\030\n\nrequest_id\030\004 \001(\tB\004\342A\001" - + "\001\022\033\n\rvalidate_only\030\005 \001(\010B\004\342A\001\001\"\353\001\n\036Creat" - + "eSecondaryInstanceRequest\0228\n\006parent\030\001 \001(" - + "\tB(\342A\001\002\372A!\022\037alloydb.googleapis.com/Insta" - + "nce\022\031\n\013instance_id\030\002 \001(\tB\004\342A\001\002\022=\n\010instan" - + "ce\030\003 \001(\0132%.google.cloud.alloydb.v1beta.I" - + "nstanceB\004\342A\001\002\022\030\n\nrequest_id\030\004 \001(\tB\004\342A\001\001\022" - + "\033\n\rvalidate_only\030\005 \001(\010B\004\342A\001\001\"t\n\026CreateIn" - + "stanceRequests\022Z\n\030create_instance_reques" - + "ts\030\001 \003(\01322.google.cloud.alloydb.v1beta.C" - + "reateInstanceRequestB\004\342A\001\002\"\276\001\n\033BatchCrea" - + "teInstancesRequest\0228\n\006parent\030\001 \001(\tB(\342A\001\002" - + "\372A!\022\037alloydb.googleapis.com/Instance\022K\n\010" - + "requests\030\002 \001(\01323.google.cloud.alloydb.v1" - + "beta.CreateInstanceRequestsB\004\342A\001\002\022\030\n\nreq" - + "uest_id\030\003 \001(\tB\004\342A\001\001\"X\n\034BatchCreateInstan" - + "cesResponse\0228\n\tinstances\030\001 \003(\0132%.google." - + "cloud.alloydb.v1beta.Instance\"\225\002\n\034BatchC" - + "reateInstancesMetadata\022\030\n\020instance_targe" - + "ts\030\001 \003(\t\022j\n\021instance_statuses\030\002 \003(\0132O.go" - + "ogle.cloud.alloydb.v1beta.BatchCreateIns" - + "tancesMetadata.InstanceStatusesEntry\032o\n\025" - + "InstanceStatusesEntry\022\013\n\003key\030\001 \001(\t\022E\n\005va" - + "lue\030\002 \001(\01326.google.cloud.alloydb.v1beta." - + "BatchCreateInstanceStatus:\0028\001\"\330\002\n\031BatchC" - + "reateInstanceStatus\022K\n\005state\030\001 \001(\0162<.goo" - + "gle.cloud.alloydb.v1beta.BatchCreateInst" - + "anceStatus.State\022\021\n\terror_msg\030\002 \001(\t\022!\n\005e" - + "rror\030\004 \001(\0132\022.google.rpc.Status\022@\n\004type\030\003" - + " \001(\01622.google.cloud.alloydb.v1beta.Insta" - + "nce.InstanceType\"v\n\005State\022\025\n\021STATE_UNSPE" - + "CIFIED\020\000\022\022\n\016PENDING_CREATE\020\001\022\t\n\005READY\020\002\022" - + "\014\n\010CREATING\020\003\022\014\n\010DELETING\020\004\022\n\n\006FAILED\020\005\022" - + "\017\n\013ROLLED_BACK\020\006\"\341\001\n\025UpdateInstanceReque" - + "st\0225\n\013update_mask\030\001 \001(\0132\032.google.protobu" - + "f.FieldMaskB\004\342A\001\001\022=\n\010instance\030\002 \001(\0132%.go" - + "ogle.cloud.alloydb.v1beta.InstanceB\004\342A\001\002" + + "\342A\001\001\022\033\n\rvalidate_only\030\004 \001(\010B\004\342A\001\001\"\205\003\n\025Re" + + "storeClusterRequest\022B\n\rbackup_source\030\004 \001" + + "(\0132).google.cloud.alloydb.v1beta.BackupS" + + "ourceH\000\022W\n\030continuous_backup_source\030\010 \001(" + + "\01323.google.cloud.alloydb.v1beta.Continuo" + + "usBackupSourceH\000\0227\n\006parent\030\001 \001(\tB\'\342A\001\002\372A" + + " \022\036alloydb.googleapis.com/Cluster\022\030\n\nclu" + + "ster_id\030\002 \001(\tB\004\342A\001\002\022;\n\007cluster\030\003 \001(\0132$.g" + + "oogle.cloud.alloydb.v1beta.ClusterB\004\342A\001\002" + + "\022\030\n\nrequest_id\030\005 \001(\tB\004\342A\001\001\022\033\n\rvalidate_o" + + "nly\030\006 \001(\010B\004\342A\001\001B\010\n\006source\"\253\001\n\024ListInstan" + + "cesRequest\0228\n\006parent\030\001 \001(\tB(\342A\001\002\372A!\022\037all" + + "oydb.googleapis.com/Instance\022\027\n\tpage_siz" + + "e\030\002 \001(\005B\004\342A\001\001\022\022\n\npage_token\030\003 \001(\t\022\024\n\006fil" + + "ter\030\004 \001(\tB\004\342A\001\001\022\026\n\010order_by\030\005 \001(\tB\004\342A\001\001\"" + + "\177\n\025ListInstancesResponse\0228\n\tinstances\030\001 " + + "\003(\0132%.google.cloud.alloydb.v1beta.Instan" + + "ce\022\027\n\017next_page_token\030\002 \001(\t\022\023\n\013unreachab" + + "le\030\003 \003(\t\"\205\001\n\022GetInstanceRequest\0226\n\004name\030" + + "\001 \001(\tB(\342A\001\002\372A!\n\037alloydb.googleapis.com/I" + + "nstance\0227\n\004view\030\002 \001(\0162).google.cloud.all" + + "oydb.v1beta.InstanceView\"\342\001\n\025CreateInsta" + + "nceRequest\0228\n\006parent\030\001 \001(\tB(\342A\001\002\372A!\022\037all" + + "oydb.googleapis.com/Instance\022\031\n\013instance" + + "_id\030\002 \001(\tB\004\342A\001\002\022=\n\010instance\030\003 \001(\0132%.goog" + + "le.cloud.alloydb.v1beta.InstanceB\004\342A\001\002\022\030" + + "\n\nrequest_id\030\004 \001(\tB\004\342A\001\001\022\033\n\rvalidate_onl" + + "y\030\005 \001(\010B\004\342A\001\001\"\353\001\n\036CreateSecondaryInstanc" + + "eRequest\0228\n\006parent\030\001 \001(\tB(\342A\001\002\372A!\022\037alloy" + + "db.googleapis.com/Instance\022\031\n\013instance_i" + + "d\030\002 \001(\tB\004\342A\001\002\022=\n\010instance\030\003 \001(\0132%.google" + + ".cloud.alloydb.v1beta.InstanceB\004\342A\001\002\022\030\n\n" + + "request_id\030\004 \001(\tB\004\342A\001\001\022\033\n\rvalidate_only\030" + + "\005 \001(\010B\004\342A\001\001\"t\n\026CreateInstanceRequests\022Z\n" + + "\030create_instance_requests\030\001 \003(\01322.google" + + ".cloud.alloydb.v1beta.CreateInstanceRequ" + + "estB\004\342A\001\002\"\276\001\n\033BatchCreateInstancesReques" + + "t\0228\n\006parent\030\001 \001(\tB(\342A\001\002\372A!\022\037alloydb.goog" + + "leapis.com/Instance\022K\n\010requests\030\002 \001(\01323." + + "google.cloud.alloydb.v1beta.CreateInstan" + + "ceRequestsB\004\342A\001\002\022\030\n\nrequest_id\030\003 \001(\tB\004\342A" + + "\001\001\"X\n\034BatchCreateInstancesResponse\0228\n\tin" + + "stances\030\001 \003(\0132%.google.cloud.alloydb.v1b" + + "eta.Instance\"\225\002\n\034BatchCreateInstancesMet" + + "adata\022\030\n\020instance_targets\030\001 \003(\t\022j\n\021insta" + + "nce_statuses\030\002 \003(\0132O.google.cloud.alloyd" + + "b.v1beta.BatchCreateInstancesMetadata.In" + + "stanceStatusesEntry\032o\n\025InstanceStatusesE" + + "ntry\022\013\n\003key\030\001 \001(\t\022E\n\005value\030\002 \001(\01326.googl" + + "e.cloud.alloydb.v1beta.BatchCreateInstan" + + "ceStatus:\0028\001\"\330\002\n\031BatchCreateInstanceStat" + + "us\022K\n\005state\030\001 \001(\0162<.google.cloud.alloydb" + + ".v1beta.BatchCreateInstanceStatus.State\022" + + "\021\n\terror_msg\030\002 \001(\t\022!\n\005error\030\004 \001(\0132\022.goog" + + "le.rpc.Status\022@\n\004type\030\003 \001(\01622.google.clo" + + "ud.alloydb.v1beta.Instance.InstanceType\"" + + "v\n\005State\022\025\n\021STATE_UNSPECIFIED\020\000\022\022\n\016PENDI" + + "NG_CREATE\020\001\022\t\n\005READY\020\002\022\014\n\010CREATING\020\003\022\014\n\010" + + "DELETING\020\004\022\n\n\006FAILED\020\005\022\017\n\013ROLLED_BACK\020\006\"" + + "\341\001\n\025UpdateInstanceRequest\0225\n\013update_mask" + + "\030\001 \001(\0132\032.google.protobuf.FieldMaskB\004\342A\001\001" + + "\022=\n\010instance\030\002 \001(\0132%.google.cloud.alloyd" + + "b.v1beta.InstanceB\004\342A\001\002\022\030\n\nrequest_id\030\003 " + + "\001(\tB\004\342A\001\001\022\033\n\rvalidate_only\030\004 \001(\010B\004\342A\001\001\022\033" + + "\n\rallow_missing\030\005 \001(\010B\004\342A\001\001\"\232\001\n\025DeleteIn" + + "stanceRequest\0226\n\004name\030\001 \001(\tB(\342A\001\002\372A!\n\037al" + + "loydb.googleapis.com/Instance\022\030\n\nrequest" + + "_id\030\002 \001(\tB\004\342A\001\001\022\022\n\004etag\030\003 \001(\tB\004\342A\001\001\022\033\n\rv" + + "alidate_only\030\004 \001(\010B\004\342A\001\001\"\210\001\n\027FailoverIns" + + "tanceRequest\0226\n\004name\030\001 \001(\tB(\342A\001\002\372A!\n\037all" + + "oydb.googleapis.com/Instance\022\030\n\nrequest_" + + "id\030\002 \001(\tB\004\342A\001\001\022\033\n\rvalidate_only\030\003 \001(\010B\004\342" + + "A\001\001\"\216\002\n\022InjectFaultRequest\022S\n\nfault_type" + + "\030\001 \001(\01629.google.cloud.alloydb.v1beta.Inj" + + "ectFaultRequest.FaultTypeB\004\342A\001\002\0226\n\004name\030" + + "\002 \001(\tB(\342A\001\002\372A!\n\037alloydb.googleapis.com/I" + + "nstance\022\030\n\nrequest_id\030\003 \001(\tB\004\342A\001\001\022\033\n\rval" + + "idate_only\030\004 \001(\010B\004\342A\001\001\"4\n\tFaultType\022\032\n\026F" + + "AULT_TYPE_UNSPECIFIED\020\000\022\013\n\007STOP_VM\020\001\"\207\001\n" + + "\026RestartInstanceRequest\0226\n\004name\030\001 \001(\tB(\342" + + "A\001\002\372A!\n\037alloydb.googleapis.com/Instance\022" + + "\030\n\nrequest_id\030\002 \001(\tB\004\342A\001\001\022\033\n\rvalidate_on" + + "ly\030\003 \001(\010B\004\342A\001\001\"\225\001\n\022ListBackupsRequest\0226\n" + + "\006parent\030\001 \001(\tB&\342A\001\002\372A\037\022\035alloydb.googleap" + + "is.com/Backup\022\021\n\tpage_size\030\002 \001(\005\022\022\n\npage" + + "_token\030\003 \001(\t\022\016\n\006filter\030\004 \001(\t\022\020\n\010order_by" + + "\030\005 \001(\t\"y\n\023ListBackupsResponse\0224\n\007backups" + + "\030\001 \003(\0132#.google.cloud.alloydb.v1beta.Bac" + + "kup\022\027\n\017next_page_token\030\002 \001(\t\022\023\n\013unreacha" + + "ble\030\003 \003(\t\"H\n\020GetBackupRequest\0224\n\004name\030\001 " + + "\001(\tB&\342A\001\002\372A\037\n\035alloydb.googleapis.com/Bac" + + "kup\"\330\001\n\023CreateBackupRequest\0226\n\006parent\030\001 " + + "\001(\tB&\342A\001\002\372A\037\022\035alloydb.googleapis.com/Bac" + + "kup\022\027\n\tbackup_id\030\002 \001(\tB\004\342A\001\002\0229\n\006backup\030\003" + + " \001(\0132#.google.cloud.alloydb.v1beta.Backu" + + "pB\004\342A\001\002\022\030\n\nrequest_id\030\004 \001(\tB\004\342A\001\001\022\033\n\rval" + + "idate_only\030\005 \001(\010B\004\342A\001\001\"\333\001\n\023UpdateBackupR" + + "equest\0225\n\013update_mask\030\001 \001(\0132\032.google.pro" + + "tobuf.FieldMaskB\004\342A\001\001\0229\n\006backup\030\002 \001(\0132#." + + "google.cloud.alloydb.v1beta.BackupB\004\342A\001\002" + "\022\030\n\nrequest_id\030\003 \001(\tB\004\342A\001\001\022\033\n\rvalidate_o" + "nly\030\004 \001(\010B\004\342A\001\001\022\033\n\rallow_missing\030\005 \001(\010B\004" - + "\342A\001\001\"\232\001\n\025DeleteInstanceRequest\0226\n\004name\030\001" - + " \001(\tB(\342A\001\002\372A!\n\037alloydb.googleapis.com/In" - + "stance\022\030\n\nrequest_id\030\002 \001(\tB\004\342A\001\001\022\022\n\004etag" - + "\030\003 \001(\tB\004\342A\001\001\022\033\n\rvalidate_only\030\004 \001(\010B\004\342A\001" - + "\001\"\210\001\n\027FailoverInstanceRequest\0226\n\004name\030\001 " - + "\001(\tB(\342A\001\002\372A!\n\037alloydb.googleapis.com/Ins" - + "tance\022\030\n\nrequest_id\030\002 \001(\tB\004\342A\001\001\022\033\n\rvalid" - + "ate_only\030\003 \001(\010B\004\342A\001\001\"\207\001\n\026RestartInstance" - + "Request\0226\n\004name\030\001 \001(\tB(\342A\001\002\372A!\n\037alloydb." - + "googleapis.com/Instance\022\030\n\nrequest_id\030\002 " - + "\001(\tB\004\342A\001\001\022\033\n\rvalidate_only\030\003 \001(\010B\004\342A\001\001\"\225" - + "\001\n\022ListBackupsRequest\0226\n\006parent\030\001 \001(\tB&\342" - + "A\001\002\372A\037\022\035alloydb.googleapis.com/Backup\022\021\n" - + "\tpage_size\030\002 \001(\005\022\022\n\npage_token\030\003 \001(\t\022\016\n\006" - + "filter\030\004 \001(\t\022\020\n\010order_by\030\005 \001(\t\"y\n\023ListBa" - + "ckupsResponse\0224\n\007backups\030\001 \003(\0132#.google." - + "cloud.alloydb.v1beta.Backup\022\027\n\017next_page" - + "_token\030\002 \001(\t\022\023\n\013unreachable\030\003 \003(\t\"H\n\020Get" - + "BackupRequest\0224\n\004name\030\001 \001(\tB&\342A\001\002\372A\037\n\035al" - + "loydb.googleapis.com/Backup\"\330\001\n\023CreateBa" - + "ckupRequest\0226\n\006parent\030\001 \001(\tB&\342A\001\002\372A\037\022\035al" - + "loydb.googleapis.com/Backup\022\027\n\tbackup_id" - + "\030\002 \001(\tB\004\342A\001\002\0229\n\006backup\030\003 \001(\0132#.google.cl" - + "oud.alloydb.v1beta.BackupB\004\342A\001\002\022\030\n\nreque" - + "st_id\030\004 \001(\tB\004\342A\001\001\022\033\n\rvalidate_only\030\005 \001(\010" - + "B\004\342A\001\001\"\333\001\n\023UpdateBackupRequest\0225\n\013update" - + "_mask\030\001 \001(\0132\032.google.protobuf.FieldMaskB" - + "\004\342A\001\001\0229\n\006backup\030\002 \001(\0132#.google.cloud.all" - + "oydb.v1beta.BackupB\004\342A\001\002\022\030\n\nrequest_id\030\003" - + " \001(\tB\004\342A\001\001\022\033\n\rvalidate_only\030\004 \001(\010B\004\342A\001\001\022" - + "\033\n\rallow_missing\030\005 \001(\010B\004\342A\001\001\"\226\001\n\023DeleteB" - + "ackupRequest\0224\n\004name\030\001 \001(\tB&\342A\001\002\372A\037\n\035all" - + "oydb.googleapis.com/Backup\022\030\n\nrequest_id" - + "\030\002 \001(\tB\004\342A\001\001\022\033\n\rvalidate_only\030\003 \001(\010B\004\342A\001" - + "\001\022\022\n\004etag\030\004 \001(\tB\004\342A\001\001\"\221\001\n!ListSupportedD" - + "atabaseFlagsRequest\022E\n\006parent\030\001 \001(\tB5\342A\001" - + "\002\372A.\022,alloydb.googleapis.com/SupportedDa" - + "tabaseFlag\022\021\n\tpage_size\030\002 \001(\005\022\022\n\npage_to" - + "ken\030\003 \001(\t\"\223\001\n\"ListSupportedDatabaseFlags" - + "Response\022T\n\030supported_database_flags\030\001 \003" - + "(\01322.google.cloud.alloydb.v1beta.Support" - + "edDatabaseFlag\022\027\n\017next_page_token\030\002 \001(\t\"" - + "\304\001\n GenerateClientCertificateRequest\0227\n\006" - + "parent\030\001 \001(\tB\'\342A\001\002\372A \n\036alloydb.googleapi" - + "s.com/Cluster\022\030\n\nrequest_id\030\002 \001(\tB\004\342A\001\001\022" - + "\025\n\007pem_csr\030\003 \001(\tB\004\342A\001\001\0226\n\rcert_duration\030" - + "\004 \001(\0132\031.google.protobuf.DurationB\004\342A\001\001\"g" - + "\n!GenerateClientCertificateResponse\022\035\n\017p" - + "em_certificate\030\001 \001(\tB\004\342A\001\003\022#\n\025pem_certif" - + "icate_chain\030\002 \003(\tB\004\342A\001\003\"n\n\030GetConnection" - + "InfoRequest\0228\n\006parent\030\001 \001(\tB(\342A\001\002\372A!\n\037al" - + "loydb.googleapis.com/Instance\022\030\n\nrequest" - + "_id\030\002 \001(\tB\004\342A\001\001\"\207\003\n\021OperationMetadata\022j\n" - + "\037batch_create_instances_metadata\030\010 \001(\01329" - + ".google.cloud.alloydb.v1beta.BatchCreate" - + "InstancesMetadataB\004\342A\001\003H\000\0225\n\013create_time" - + "\030\001 \001(\0132\032.google.protobuf.TimestampB\004\342A\001\003" - + "\0222\n\010end_time\030\002 \001(\0132\032.google.protobuf.Tim" - + "estampB\004\342A\001\003\022\024\n\006target\030\003 \001(\tB\004\342A\001\003\022\022\n\004ve" - + "rb\030\004 \001(\tB\004\342A\001\003\022\034\n\016status_message\030\005 \001(\tB\004" - + "\342A\001\003\022$\n\026requested_cancellation\030\006 \001(\010B\004\342A" - + "\001\003\022\031\n\013api_version\030\007 \001(\tB\004\342A\001\003B\022\n\020request" - + "_specific2\277+\n\014AlloyDBAdmin\022\266\001\n\014ListClust" - + "ers\0220.google.cloud.alloydb.v1beta.ListCl" - + "ustersRequest\0321.google.cloud.alloydb.v1b" - + "eta.ListClustersResponse\"A\332A\006parent\202\323\344\223\002" - + "2\0220/v1beta/{parent=projects/*/locations/" - + "*}/clusters\022\243\001\n\nGetCluster\022..google.clou" - + "d.alloydb.v1beta.GetClusterRequest\032$.goo" - + "gle.cloud.alloydb.v1beta.Cluster\"?\332A\004nam" - + "e\202\323\344\223\0022\0220/v1beta/{name=projects/*/locati" - + "ons/*/clusters/*}\022\337\001\n\rCreateCluster\0221.go" - + "ogle.cloud.alloydb.v1beta.CreateClusterR" - + "equest\032\035.google.longrunning.Operation\"|\312" - + "A\034\n\007Cluster\022\021OperationMetadata\332A\031parent," - + "cluster,cluster_id\202\323\344\223\002;\"0/v1beta/{paren" - + "t=projects/*/locations/*}/clusters:\007clus" - + "ter\022\341\001\n\rUpdateCluster\0221.google.cloud.all" - + "oydb.v1beta.UpdateClusterRequest\032\035.googl" - + "e.longrunning.Operation\"~\312A\034\n\007Cluster\022\021O" - + "perationMetadata\332A\023cluster,update_mask\202\323" - + "\344\223\002C28/v1beta/{cluster.name=projects/*/l" - + "ocations/*/clusters/*}:\007cluster\022\317\001\n\rDele" - + "teCluster\0221.google.cloud.alloydb.v1beta." - + "DeleteClusterRequest\032\035.google.longrunnin" - + "g.Operation\"l\312A*\n\025google.protobuf.Empty\022" - + "\021OperationMetadata\332A\004name\202\323\344\223\0022*0/v1beta" + + "\342A\001\001\"\226\001\n\023DeleteBackupRequest\0224\n\004name\030\001 \001" + + "(\tB&\342A\001\002\372A\037\n\035alloydb.googleapis.com/Back" + + "up\022\030\n\nrequest_id\030\002 \001(\tB\004\342A\001\001\022\033\n\rvalidate" + + "_only\030\003 \001(\010B\004\342A\001\001\022\022\n\004etag\030\004 \001(\tB\004\342A\001\001\"\221\001" + + "\n!ListSupportedDatabaseFlagsRequest\022E\n\006p" + + "arent\030\001 \001(\tB5\342A\001\002\372A.\022,alloydb.googleapis" + + ".com/SupportedDatabaseFlag\022\021\n\tpage_size\030" + + "\002 \001(\005\022\022\n\npage_token\030\003 \001(\t\"\223\001\n\"ListSuppor" + + "tedDatabaseFlagsResponse\022T\n\030supported_da" + + "tabase_flags\030\001 \003(\01322.google.cloud.alloyd" + + "b.v1beta.SupportedDatabaseFlag\022\027\n\017next_p" + + "age_token\030\002 \001(\t\"\340\001\n GenerateClientCertif" + + "icateRequest\0227\n\006parent\030\001 \001(\tB\'\342A\001\002\372A \n\036a" + + "lloydb.googleapis.com/Cluster\022\030\n\nrequest" + + "_id\030\002 \001(\tB\004\342A\001\001\022\027\n\007pem_csr\030\003 \001(\tB\006\030\001\342A\001\001" + + "\0226\n\rcert_duration\030\004 \001(\0132\031.google.protobu" + + "f.DurationB\004\342A\001\001\022\030\n\npublic_key\030\005 \001(\tB\004\342A" + + "\001\001\"~\n!GenerateClientCertificateResponse\022" + + "\035\n\017pem_certificate\030\001 \001(\tB\004\342A\001\003\022#\n\025pem_ce" + + "rtificate_chain\030\002 \003(\tB\004\342A\001\003\022\025\n\007ca_cert\030\003" + + " \001(\tB\004\342A\001\001\"n\n\030GetConnectionInfoRequest\0228" + + "\n\006parent\030\001 \001(\tB(\342A\001\002\372A!\n\037alloydb.googlea" + + "pis.com/Instance\022\030\n\nrequest_id\030\002 \001(\tB\004\342A" + + "\001\001\"\207\003\n\021OperationMetadata\022j\n\037batch_create" + + "_instances_metadata\030\010 \001(\01329.google.cloud" + + ".alloydb.v1beta.BatchCreateInstancesMeta" + + "dataB\004\342A\001\003H\000\0225\n\013create_time\030\001 \001(\0132\032.goog" + + "le.protobuf.TimestampB\004\342A\001\003\0222\n\010end_time\030" + + "\002 \001(\0132\032.google.protobuf.TimestampB\004\342A\001\003\022" + + "\024\n\006target\030\003 \001(\tB\004\342A\001\003\022\022\n\004verb\030\004 \001(\tB\004\342A\001" + + "\003\022\034\n\016status_message\030\005 \001(\tB\004\342A\001\003\022$\n\026reque" + + "sted_cancellation\030\006 \001(\010B\004\342A\001\003\022\031\n\013api_ver" + + "sion\030\007 \001(\tB\004\342A\001\003B\022\n\020request_specific\"\251\001\n" + + "\020ListUsersRequest\0224\n\006parent\030\001 \001(\tB$\342A\001\002\372" + + "A\035\022\033alloydb.googleapis.com/User\022\027\n\tpage_" + + "size\030\002 \001(\005B\004\342A\001\001\022\030\n\npage_token\030\003 \001(\tB\004\342A" + + "\001\001\022\024\n\006filter\030\004 \001(\tB\004\342A\001\001\022\026\n\010order_by\030\005 \001" + + "(\tB\004\342A\001\001\"s\n\021ListUsersResponse\0220\n\005users\030\001" + + " \003(\0132!.google.cloud.alloydb.v1beta.User\022" + + "\027\n\017next_page_token\030\002 \001(\t\022\023\n\013unreachable\030" + + "\003 \003(\t\"D\n\016GetUserRequest\0222\n\004name\030\001 \001(\tB$\342" + + "A\001\002\372A\035\n\033alloydb.googleapis.com/User\"\316\001\n\021" + + "CreateUserRequest\0224\n\006parent\030\001 \001(\tB$\342A\001\002\372" + + "A\035\022\033alloydb.googleapis.com/User\022\025\n\007user_" + + "id\030\002 \001(\tB\004\342A\001\002\0225\n\004user\030\003 \001(\0132!.google.cl" + + "oud.alloydb.v1beta.UserB\004\342A\001\002\022\030\n\nrequest" + + "_id\030\004 \001(\tB\004\342A\001\001\022\033\n\rvalidate_only\030\005 \001(\010B\004" + + "\342A\001\001\"\325\001\n\021UpdateUserRequest\0225\n\013update_mas" + + "k\030\001 \001(\0132\032.google.protobuf.FieldMaskB\004\342A\001" + + "\001\0225\n\004user\030\002 \001(\0132!.google.cloud.alloydb.v" + + "1beta.UserB\004\342A\001\002\022\030\n\nrequest_id\030\003 \001(\tB\004\342A" + + "\001\001\022\033\n\rvalidate_only\030\004 \001(\010B\004\342A\001\001\022\033\n\rallow" + + "_missing\030\005 \001(\010B\004\342A\001\001\"~\n\021DeleteUserReques" + + "t\0222\n\004name\030\001 \001(\tB$\342A\001\002\372A\035\n\033alloydb.google" + + "apis.com/User\022\030\n\nrequest_id\030\002 \001(\tB\004\342A\001\001\022" + + "\033\n\rvalidate_only\030\003 \001(\010B\004\342A\001\0012\2464\n\014AlloyDB" + + "Admin\022\266\001\n\014ListClusters\0220.google.cloud.al" + + "loydb.v1beta.ListClustersRequest\0321.googl" + + "e.cloud.alloydb.v1beta.ListClustersRespo" + + "nse\"A\332A\006parent\202\323\344\223\0022\0220/v1beta/{parent=pr" + + "ojects/*/locations/*}/clusters\022\243\001\n\nGetCl" + + "uster\022..google.cloud.alloydb.v1beta.GetC" + + "lusterRequest\032$.google.cloud.alloydb.v1b" + + "eta.Cluster\"?\332A\004name\202\323\344\223\0022\0220/v1beta/{nam" + + "e=projects/*/locations/*/clusters/*}\022\337\001\n" + + "\rCreateCluster\0221.google.cloud.alloydb.v1" + + "beta.CreateClusterRequest\032\035.google.longr" + + "unning.Operation\"|\312A\034\n\007Cluster\022\021Operatio" + + "nMetadata\332A\031parent,cluster,cluster_id\202\323\344" + + "\223\002;\"0/v1beta/{parent=projects/*/location" + + "s/*}/clusters:\007cluster\022\341\001\n\rUpdateCluster" + + "\0221.google.cloud.alloydb.v1beta.UpdateClu" + + "sterRequest\032\035.google.longrunning.Operati" + + "on\"~\312A\034\n\007Cluster\022\021OperationMetadata\332A\023cl" + + "uster,update_mask\202\323\344\223\002C28/v1beta/{cluste" + + "r.name=projects/*/locations/*/clusters/*" + + "}:\007cluster\022\317\001\n\rDeleteCluster\0221.google.cl" + + "oud.alloydb.v1beta.DeleteClusterRequest\032" + + "\035.google.longrunning.Operation\"l\312A*\n\025goo" + + "gle.protobuf.Empty\022\021OperationMetadata\332A\004" + + "name\202\323\344\223\0022*0/v1beta/{name=projects/*/loc" + + "ations/*/clusters/*}\022\316\001\n\016PromoteCluster\022" + + "2.google.cloud.alloydb.v1beta.PromoteClu" + + "sterRequest\032\035.google.longrunning.Operati" + + "on\"i\312A\034\n\007Cluster\022\021OperationMetadata\332A\004na" + + "me\202\323\344\223\002=\"8/v1beta/{name=projects/*/locat" + + "ions/*/clusters/*}:promote:\001*\022\307\001\n\016Restor" + + "eCluster\0222.google.cloud.alloydb.v1beta.R" + + "estoreClusterRequest\032\035.google.longrunnin" + + "g.Operation\"b\312A\034\n\007Cluster\022\021OperationMeta" + + "data\202\323\344\223\002=\"8/v1beta/{parent=projects/*/l" + + "ocations/*}/clusters:restore:\001*\022\202\002\n\026Crea" + + "teSecondaryCluster\022:.google.cloud.alloyd" + + "b.v1beta.CreateSecondaryClusterRequest\032\035" + + ".google.longrunning.Operation\"\214\001\312A\034\n\007Clu" + + "ster\022\021OperationMetadata\332A\031parent,cluster" + + ",cluster_id\202\323\344\223\002K\"@/v1beta/{parent=proje" + + "cts/*/locations/*}/clusters:createsecond" + + "ary:\007cluster\022\305\001\n\rListInstances\0221.google." + + "cloud.alloydb.v1beta.ListInstancesReques" + + "t\0322.google.cloud.alloydb.v1beta.ListInst" + + "ancesResponse\"M\332A\006parent\202\323\344\223\002>\022\022*\332A\004name\202\323\344\223\0021\022//v1beta/{name=" + + "projects/*/locations/*/backups/*}\022\330\001\n\014Cr" + + "eateBackup\0220.google.cloud.alloydb.v1beta" + + ".CreateBackupRequest\032\035.google.longrunnin" + + "g.Operation\"w\312A\033\n\006Backup\022\021OperationMetad" + + "ata\332A\027parent,backup,backup_id\202\323\344\223\0029\"//v1" + + "beta/{parent=projects/*/locations/*}/bac" + + "kups:\006backup\022\332\001\n\014UpdateBackup\0220.google.c" + + "loud.alloydb.v1beta.UpdateBackupRequest\032" + + "\035.google.longrunning.Operation\"y\312A\033\n\006Bac" + + "kup\022\021OperationMetadata\332A\022backup,update_m" + + "ask\202\323\344\223\002@26/v1beta/{backup.name=projects" + + "/*/locations/*/backups/*}:\006backup\022\314\001\n\014De" + + "leteBackup\0220.google.cloud.alloydb.v1beta" + + ".DeleteBackupRequest\032\035.google.longrunnin" + + "g.Operation\"k\312A*\n\025google.protobuf.Empty\022" + + "\021OperationMetadata\332A\004name\202\323\344\223\0021*//v1beta" + + "/{name=projects/*/locations/*/backups/*}" + + "\022\356\001\n\032ListSupportedDatabaseFlags\022>.google" + + ".cloud.alloydb.v1beta.ListSupportedDatab" + + "aseFlagsRequest\032?.google.cloud.alloydb.v" + + "1beta.ListSupportedDatabaseFlagsResponse" + + "\"O\332A\006parent\202\323\344\223\002@\022>/v1beta/{parent=proje" + + "cts/*/locations/*}/supportedDatabaseFlag" + + "s\022\374\001\n\031GenerateClientCertificate\022=.google" + + ".cloud.alloydb.v1beta.GenerateClientCert" + + "ificateRequest\032>.google.cloud.alloydb.v1" + + "beta.GenerateClientCertificateResponse\"`" + + "\332A\006parent\202\323\344\223\002Q\"L/v1beta/{parent=project" + + "s/*/locations/*/clusters/*}:generateClie" + + "ntCertificate:\001*\022\327\001\n\021GetConnectionInfo\0225" + + ".google.cloud.alloydb.v1beta.GetConnecti" + + "onInfoRequest\032+.google.cloud.alloydb.v1b" + + "eta.ConnectionInfo\"^\332A\006parent\202\323\344\223\002O\022M/v1" + + "beta/{parent=projects/*/locations/*/clus" + + "ters/*/instances/*}/connectionInfo\022\265\001\n\tL" + + "istUsers\022-.google.cloud.alloydb.v1beta.L" + + "istUsersRequest\032..google.cloud.alloydb.v" + + "1beta.ListUsersResponse\"I\332A\006parent\202\323\344\223\002:" + + "\0228/v1beta/{parent=projects/*/locations/*" + + "/clusters/*}/users\022\242\001\n\007GetUser\022+.google." + + "cloud.alloydb.v1beta.GetUserRequest\032!.go" + + "ogle.cloud.alloydb.v1beta.User\"G\332A\004name\202" + + "\323\344\223\002:\0228/v1beta/{name=projects/*/location" + + "s/*/clusters/*/users/*}\022\275\001\n\nCreateUser\022." + + ".google.cloud.alloydb.v1beta.CreateUserR" + + "equest\032!.google.cloud.alloydb.v1beta.Use" + + "r\"\\\332A\023parent,user,user_id\202\323\344\223\002@\"8/v1beta" + + "/{parent=projects/*/locations/*/clusters" + + "/*}/users:\004user\022\277\001\n\nUpdateUser\022..google." + + "cloud.alloydb.v1beta.UpdateUserRequest\032!" + + ".google.cloud.alloydb.v1beta.User\"^\332A\020us" + + "er,update_mask\202\323\344\223\002E2=/v1beta/{user.name" + + "=projects/*/locations/*/clusters/*/users" + + "/*}:\004user\022\235\001\n\nDeleteUser\022..google.cloud." + + "alloydb.v1beta.DeleteUserRequest\032\026.googl" + + "e.protobuf.Empty\"G\332A\004name\202\323\344\223\002:*8/v1beta" + "/{name=projects/*/locations/*/clusters/*" - + "}\022\316\001\n\016PromoteCluster\0222.google.cloud.allo" - + "ydb.v1beta.PromoteClusterRequest\032\035.googl" - + "e.longrunning.Operation\"i\312A\034\n\007Cluster\022\021O" - + "perationMetadata\332A\004name\202\323\344\223\002=\"8/v1beta/{" - + "name=projects/*/locations/*/clusters/*}:" - + "promote:\001*\022\307\001\n\016RestoreCluster\0222.google.c" - + "loud.alloydb.v1beta.RestoreClusterReques" - + "t\032\035.google.longrunning.Operation\"b\312A\034\n\007C" - + "luster\022\021OperationMetadata\202\323\344\223\002=\"8/v1beta" - + "/{parent=projects/*/locations/*}/cluster" - + "s:restore:\001*\022\202\002\n\026CreateSecondaryCluster\022" - + ":.google.cloud.alloydb.v1beta.CreateSeco" - + "ndaryClusterRequest\032\035.google.longrunning" - + ".Operation\"\214\001\312A\034\n\007Cluster\022\021OperationMeta" - + "data\332A\031parent,cluster,cluster_id\202\323\344\223\002K\"@" - + "/v1beta/{parent=projects/*/locations/*}/" - + "clusters:createsecondary:\007cluster\022\305\001\n\rLi" - + "stInstances\0221.google.cloud.alloydb.v1bet" - + "a.ListInstancesRequest\0322.google.cloud.al" - + "loydb.v1beta.ListInstancesResponse\"M\332A\006p" - + "arent\202\323\344\223\002>\022\022*" - + "\332A\004name\202\323\344\223\0021\022//v1beta/{name=projects/*/" - + "locations/*/backups/*}\022\330\001\n\014CreateBackup\022" - + "0.google.cloud.alloydb.v1beta.CreateBack" - + "upRequest\032\035.google.longrunning.Operation" - + "\"w\312A\033\n\006Backup\022\021OperationMetadata\332A\027paren" - + "t,backup,backup_id\202\323\344\223\0029\"//v1beta/{paren" - + "t=projects/*/locations/*}/backups:\006backu" - + "p\022\332\001\n\014UpdateBackup\0220.google.cloud.alloyd" - + "b.v1beta.UpdateBackupRequest\032\035.google.lo" - + "ngrunning.Operation\"y\312A\033\n\006Backup\022\021Operat" - + "ionMetadata\332A\022backup,update_mask\202\323\344\223\002@26" - + "/v1beta/{backup.name=projects/*/location" - + "s/*/backups/*}:\006backup\022\314\001\n\014DeleteBackup\022" - + "0.google.cloud.alloydb.v1beta.DeleteBack" - + "upRequest\032\035.google.longrunning.Operation" - + "\"k\312A*\n\025google.protobuf.Empty\022\021OperationM" - + "etadata\332A\004name\202\323\344\223\0021*//v1beta/{name=proj" - + "ects/*/locations/*/backups/*}\022\356\001\n\032ListSu" - + "pportedDatabaseFlags\022>.google.cloud.allo" - + "ydb.v1beta.ListSupportedDatabaseFlagsReq" - + "uest\032?.google.cloud.alloydb.v1beta.ListS" - + "upportedDatabaseFlagsResponse\"O\332A\006parent" - + "\202\323\344\223\002@\022>/v1beta/{parent=projects/*/locat" - + "ions/*}/supportedDatabaseFlags\022\374\001\n\031Gener" - + "ateClientCertificate\022=.google.cloud.allo" - + "ydb.v1beta.GenerateClientCertificateRequ" - + "est\032>.google.cloud.alloydb.v1beta.Genera" - + "teClientCertificateResponse\"`\332A\006parent\202\323" - + "\344\223\002Q\"L/v1beta/{parent=projects/*/locatio" - + "ns/*/clusters/*}:generateClientCertifica" - + "te:\001*\022\327\001\n\021GetConnectionInfo\0225.google.clo" - + "ud.alloydb.v1beta.GetConnectionInfoReque" - + "st\032+.google.cloud.alloydb.v1beta.Connect" - + "ionInfo\"^\332A\006parent\202\323\344\223\002O\022M/v1beta/{paren" - + "t=projects/*/locations/*/clusters/*/inst" - + "ances/*}/connectionInfo\032J\312A\026alloydb.goog" - + "leapis.com\322A.https://www.googleapis.com/" - + "auth/cloud-platformB\311\001\n\037com.google.cloud" - + ".alloydb.v1betaB\014ServiceProtoP\001Z9cloud.g" - + "oogle.com/go/alloydb/apiv1beta/alloydbpb" - + ";alloydbpb\252\002\033Google.Cloud.AlloyDb.V1Beta" - + "\312\002\033Google\\Cloud\\AlloyDb\\V1beta\352\002\036Google:" - + ":Cloud::AlloyDB::V1betab\006proto3" + + "/users/*}\032J\312A\026alloydb.googleapis.com\322A.h" + + "ttps://www.googleapis.com/auth/cloud-pla" + + "tformB\311\001\n\037com.google.cloud.alloydb.v1bet" + + "aB\014ServiceProtoP\001Z9cloud.google.com/go/a" + + "lloydb/apiv1beta/alloydbpb;alloydbpb\252\002\033G" + + "oogle.Cloud.AlloyDb.V1Beta\312\002\033Google\\Clou" + + "d\\AlloyDb\\V1beta\352\002\036Google::Cloud::AlloyD" + + "B::V1betab\006proto3" }; descriptor = com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( @@ -535,7 +624,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_alloydb_v1beta_GetClusterRequest_descriptor, new java.lang.String[] { - "Name", + "Name", "View", }); internal_static_google_cloud_alloydb_v1beta_CreateSecondaryClusterRequest_descriptor = getDescriptor().getMessageTypes().get(3); @@ -706,8 +795,16 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { new java.lang.String[] { "Name", "RequestId", "ValidateOnly", }); - internal_static_google_cloud_alloydb_v1beta_RestartInstanceRequest_descriptor = + internal_static_google_cloud_alloydb_v1beta_InjectFaultRequest_descriptor = getDescriptor().getMessageTypes().get(22); + internal_static_google_cloud_alloydb_v1beta_InjectFaultRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_alloydb_v1beta_InjectFaultRequest_descriptor, + new java.lang.String[] { + "FaultType", "Name", "RequestId", "ValidateOnly", + }); + internal_static_google_cloud_alloydb_v1beta_RestartInstanceRequest_descriptor = + getDescriptor().getMessageTypes().get(23); internal_static_google_cloud_alloydb_v1beta_RestartInstanceRequest_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_alloydb_v1beta_RestartInstanceRequest_descriptor, @@ -715,7 +812,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "Name", "RequestId", "ValidateOnly", }); internal_static_google_cloud_alloydb_v1beta_ListBackupsRequest_descriptor = - getDescriptor().getMessageTypes().get(23); + getDescriptor().getMessageTypes().get(24); internal_static_google_cloud_alloydb_v1beta_ListBackupsRequest_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_alloydb_v1beta_ListBackupsRequest_descriptor, @@ -723,7 +820,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "Parent", "PageSize", "PageToken", "Filter", "OrderBy", }); internal_static_google_cloud_alloydb_v1beta_ListBackupsResponse_descriptor = - getDescriptor().getMessageTypes().get(24); + getDescriptor().getMessageTypes().get(25); internal_static_google_cloud_alloydb_v1beta_ListBackupsResponse_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_alloydb_v1beta_ListBackupsResponse_descriptor, @@ -731,7 +828,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "Backups", "NextPageToken", "Unreachable", }); internal_static_google_cloud_alloydb_v1beta_GetBackupRequest_descriptor = - getDescriptor().getMessageTypes().get(25); + getDescriptor().getMessageTypes().get(26); internal_static_google_cloud_alloydb_v1beta_GetBackupRequest_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_alloydb_v1beta_GetBackupRequest_descriptor, @@ -739,7 +836,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "Name", }); internal_static_google_cloud_alloydb_v1beta_CreateBackupRequest_descriptor = - getDescriptor().getMessageTypes().get(26); + getDescriptor().getMessageTypes().get(27); internal_static_google_cloud_alloydb_v1beta_CreateBackupRequest_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_alloydb_v1beta_CreateBackupRequest_descriptor, @@ -747,7 +844,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "Parent", "BackupId", "Backup", "RequestId", "ValidateOnly", }); internal_static_google_cloud_alloydb_v1beta_UpdateBackupRequest_descriptor = - getDescriptor().getMessageTypes().get(27); + getDescriptor().getMessageTypes().get(28); internal_static_google_cloud_alloydb_v1beta_UpdateBackupRequest_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_alloydb_v1beta_UpdateBackupRequest_descriptor, @@ -755,7 +852,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "UpdateMask", "Backup", "RequestId", "ValidateOnly", "AllowMissing", }); internal_static_google_cloud_alloydb_v1beta_DeleteBackupRequest_descriptor = - getDescriptor().getMessageTypes().get(28); + getDescriptor().getMessageTypes().get(29); internal_static_google_cloud_alloydb_v1beta_DeleteBackupRequest_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_alloydb_v1beta_DeleteBackupRequest_descriptor, @@ -763,7 +860,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "Name", "RequestId", "ValidateOnly", "Etag", }); internal_static_google_cloud_alloydb_v1beta_ListSupportedDatabaseFlagsRequest_descriptor = - getDescriptor().getMessageTypes().get(29); + getDescriptor().getMessageTypes().get(30); internal_static_google_cloud_alloydb_v1beta_ListSupportedDatabaseFlagsRequest_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_alloydb_v1beta_ListSupportedDatabaseFlagsRequest_descriptor, @@ -771,7 +868,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "Parent", "PageSize", "PageToken", }); internal_static_google_cloud_alloydb_v1beta_ListSupportedDatabaseFlagsResponse_descriptor = - getDescriptor().getMessageTypes().get(30); + getDescriptor().getMessageTypes().get(31); internal_static_google_cloud_alloydb_v1beta_ListSupportedDatabaseFlagsResponse_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_alloydb_v1beta_ListSupportedDatabaseFlagsResponse_descriptor, @@ -779,23 +876,23 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "SupportedDatabaseFlags", "NextPageToken", }); internal_static_google_cloud_alloydb_v1beta_GenerateClientCertificateRequest_descriptor = - getDescriptor().getMessageTypes().get(31); + getDescriptor().getMessageTypes().get(32); internal_static_google_cloud_alloydb_v1beta_GenerateClientCertificateRequest_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_alloydb_v1beta_GenerateClientCertificateRequest_descriptor, new java.lang.String[] { - "Parent", "RequestId", "PemCsr", "CertDuration", + "Parent", "RequestId", "PemCsr", "CertDuration", "PublicKey", }); internal_static_google_cloud_alloydb_v1beta_GenerateClientCertificateResponse_descriptor = - getDescriptor().getMessageTypes().get(32); + getDescriptor().getMessageTypes().get(33); internal_static_google_cloud_alloydb_v1beta_GenerateClientCertificateResponse_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_alloydb_v1beta_GenerateClientCertificateResponse_descriptor, new java.lang.String[] { - "PemCertificate", "PemCertificateChain", + "PemCertificate", "PemCertificateChain", "CaCert", }); internal_static_google_cloud_alloydb_v1beta_GetConnectionInfoRequest_descriptor = - getDescriptor().getMessageTypes().get(33); + getDescriptor().getMessageTypes().get(34); internal_static_google_cloud_alloydb_v1beta_GetConnectionInfoRequest_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_alloydb_v1beta_GetConnectionInfoRequest_descriptor, @@ -803,7 +900,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "Parent", "RequestId", }); internal_static_google_cloud_alloydb_v1beta_OperationMetadata_descriptor = - getDescriptor().getMessageTypes().get(34); + getDescriptor().getMessageTypes().get(35); internal_static_google_cloud_alloydb_v1beta_OperationMetadata_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_alloydb_v1beta_OperationMetadata_descriptor, @@ -818,6 +915,54 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "ApiVersion", "RequestSpecific", }); + internal_static_google_cloud_alloydb_v1beta_ListUsersRequest_descriptor = + getDescriptor().getMessageTypes().get(36); + internal_static_google_cloud_alloydb_v1beta_ListUsersRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_alloydb_v1beta_ListUsersRequest_descriptor, + new java.lang.String[] { + "Parent", "PageSize", "PageToken", "Filter", "OrderBy", + }); + internal_static_google_cloud_alloydb_v1beta_ListUsersResponse_descriptor = + getDescriptor().getMessageTypes().get(37); + internal_static_google_cloud_alloydb_v1beta_ListUsersResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_alloydb_v1beta_ListUsersResponse_descriptor, + new java.lang.String[] { + "Users", "NextPageToken", "Unreachable", + }); + internal_static_google_cloud_alloydb_v1beta_GetUserRequest_descriptor = + getDescriptor().getMessageTypes().get(38); + internal_static_google_cloud_alloydb_v1beta_GetUserRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_alloydb_v1beta_GetUserRequest_descriptor, + new java.lang.String[] { + "Name", + }); + internal_static_google_cloud_alloydb_v1beta_CreateUserRequest_descriptor = + getDescriptor().getMessageTypes().get(39); + internal_static_google_cloud_alloydb_v1beta_CreateUserRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_alloydb_v1beta_CreateUserRequest_descriptor, + new java.lang.String[] { + "Parent", "UserId", "User", "RequestId", "ValidateOnly", + }); + internal_static_google_cloud_alloydb_v1beta_UpdateUserRequest_descriptor = + getDescriptor().getMessageTypes().get(40); + internal_static_google_cloud_alloydb_v1beta_UpdateUserRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_alloydb_v1beta_UpdateUserRequest_descriptor, + new java.lang.String[] { + "UpdateMask", "User", "RequestId", "ValidateOnly", "AllowMissing", + }); + internal_static_google_cloud_alloydb_v1beta_DeleteUserRequest_descriptor = + getDescriptor().getMessageTypes().get(41); + internal_static_google_cloud_alloydb_v1beta_DeleteUserRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_alloydb_v1beta_DeleteUserRequest_descriptor, + new java.lang.String[] { + "Name", "RequestId", "ValidateOnly", + }); com.google.protobuf.ExtensionRegistry registry = com.google.protobuf.ExtensionRegistry.newInstance(); registry.add(com.google.api.ClientProto.defaultHost); diff --git a/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/SslConfig.java b/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/SslConfig.java index 44f3f96e6594..d58d8b6aaf93 100644 --- a/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/SslConfig.java +++ b/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/SslConfig.java @@ -22,7 +22,7 @@ * * *
- * SSL configuration for an AlloyDB Cluster.
+ * SSL configuration.
  * 
* * Protobuf type {@code google.cloud.alloydb.v1beta.SslConfig} @@ -77,7 +77,7 @@ public enum SslMode implements com.google.protobuf.ProtocolMessageEnum { * * *
-     * SSL mode not specified. Defaults to SSL_MODE_ALLOW.
+     * SSL mode not specified. Defaults to ENCRYPTED_ONLY.
      * 
* * SSL_MODE_UNSPECIFIED = 0; @@ -90,8 +90,9 @@ public enum SslMode implements com.google.protobuf.ProtocolMessageEnum { * SSL connections are optional. CA verification not enforced. * * - * SSL_MODE_ALLOW = 1; + * SSL_MODE_ALLOW = 1 [deprecated = true]; */ + @java.lang.Deprecated SSL_MODE_ALLOW(1), /** * @@ -102,8 +103,9 @@ public enum SslMode implements com.google.protobuf.ProtocolMessageEnum { * behavior). * * - * SSL_MODE_REQUIRE = 2; + * SSL_MODE_REQUIRE = 2 [deprecated = true]; */ + @java.lang.Deprecated SSL_MODE_REQUIRE(2), /** * @@ -114,9 +116,30 @@ public enum SslMode implements com.google.protobuf.ProtocolMessageEnum { * GenerateClientCertificate. * * - * SSL_MODE_VERIFY_CA = 3; + * SSL_MODE_VERIFY_CA = 3 [deprecated = true]; */ + @java.lang.Deprecated SSL_MODE_VERIFY_CA(3), + /** + * + * + *
+     * SSL connections are optional. CA verification not enforced.
+     * 
+ * + * ALLOW_UNENCRYPTED_AND_ENCRYPTED = 4; + */ + ALLOW_UNENCRYPTED_AND_ENCRYPTED(4), + /** + * + * + *
+     * SSL connections are required. CA verification not enforced.
+     * 
+ * + * ENCRYPTED_ONLY = 5; + */ + ENCRYPTED_ONLY(5), UNRECOGNIZED(-1), ; @@ -124,7 +147,7 @@ public enum SslMode implements com.google.protobuf.ProtocolMessageEnum { * * *
-     * SSL mode not specified. Defaults to SSL_MODE_ALLOW.
+     * SSL mode not specified. Defaults to ENCRYPTED_ONLY.
      * 
* * SSL_MODE_UNSPECIFIED = 0; @@ -137,9 +160,9 @@ public enum SslMode implements com.google.protobuf.ProtocolMessageEnum { * SSL connections are optional. CA verification not enforced. * * - * SSL_MODE_ALLOW = 1; + * SSL_MODE_ALLOW = 1 [deprecated = true]; */ - public static final int SSL_MODE_ALLOW_VALUE = 1; + @java.lang.Deprecated public static final int SSL_MODE_ALLOW_VALUE = 1; /** * * @@ -149,9 +172,9 @@ public enum SslMode implements com.google.protobuf.ProtocolMessageEnum { * behavior). * * - * SSL_MODE_REQUIRE = 2; + * SSL_MODE_REQUIRE = 2 [deprecated = true]; */ - public static final int SSL_MODE_REQUIRE_VALUE = 2; + @java.lang.Deprecated public static final int SSL_MODE_REQUIRE_VALUE = 2; /** * * @@ -161,9 +184,29 @@ public enum SslMode implements com.google.protobuf.ProtocolMessageEnum { * GenerateClientCertificate. * * - * SSL_MODE_VERIFY_CA = 3; + * SSL_MODE_VERIFY_CA = 3 [deprecated = true]; + */ + @java.lang.Deprecated public static final int SSL_MODE_VERIFY_CA_VALUE = 3; + /** + * + * + *
+     * SSL connections are optional. CA verification not enforced.
+     * 
+ * + * ALLOW_UNENCRYPTED_AND_ENCRYPTED = 4; + */ + public static final int ALLOW_UNENCRYPTED_AND_ENCRYPTED_VALUE = 4; + /** + * + * + *
+     * SSL connections are required. CA verification not enforced.
+     * 
+ * + * ENCRYPTED_ONLY = 5; */ - public static final int SSL_MODE_VERIFY_CA_VALUE = 3; + public static final int ENCRYPTED_ONLY_VALUE = 5; public final int getNumber() { if (this == UNRECOGNIZED) { @@ -197,6 +240,10 @@ public static SslMode forNumber(int value) { return SSL_MODE_REQUIRE; case 3: return SSL_MODE_VERIFY_CA; + case 4: + return ALLOW_UNENCRYPTED_AND_ENCRYPTED; + case 5: + return ENCRYPTED_ONLY; default: return null; } @@ -645,7 +692,7 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build * * *
-   * SSL configuration for an AlloyDB Cluster.
+   * SSL configuration.
    * 
* * Protobuf type {@code google.cloud.alloydb.v1beta.SslConfig} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/UpdateUserRequest.java b/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/UpdateUserRequest.java new file mode 100644 index 000000000000..8af4b0d65d09 --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/UpdateUserRequest.java @@ -0,0 +1,1486 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/alloydb/v1beta/service.proto + +package com.google.cloud.alloydb.v1beta; + +/** + * + * + *
+ * Message for updating a User
+ * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1beta.UpdateUserRequest} + */ +public final class UpdateUserRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.alloydb.v1beta.UpdateUserRequest) + UpdateUserRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use UpdateUserRequest.newBuilder() to construct. + private UpdateUserRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private UpdateUserRequest() { + requestId_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new UpdateUserRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.alloydb.v1beta.ServiceProto + .internal_static_google_cloud_alloydb_v1beta_UpdateUserRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1beta.ServiceProto + .internal_static_google_cloud_alloydb_v1beta_UpdateUserRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1beta.UpdateUserRequest.class, + com.google.cloud.alloydb.v1beta.UpdateUserRequest.Builder.class); + } + + public static final int UPDATE_MASK_FIELD_NUMBER = 1; + private com.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.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the updateMask field is set. + */ + @java.lang.Override + public boolean hasUpdateMask() { + return updateMask_ != null; + } + /** + * + * + *
+   * 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.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The updateMask. + */ + @java.lang.Override + public com.google.protobuf.FieldMask getUpdateMask() { + return updateMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : 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.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { + return updateMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : updateMask_; + } + + public static final int USER_FIELD_NUMBER = 2; + private com.google.cloud.alloydb.v1beta.User user_; + /** + * + * + *
+   * Required. The resource being updated
+   * 
+ * + * .google.cloud.alloydb.v1beta.User user = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the user field is set. + */ + @java.lang.Override + public boolean hasUser() { + return user_ != null; + } + /** + * + * + *
+   * Required. The resource being updated
+   * 
+ * + * .google.cloud.alloydb.v1beta.User user = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The user. + */ + @java.lang.Override + public com.google.cloud.alloydb.v1beta.User getUser() { + return user_ == null ? com.google.cloud.alloydb.v1beta.User.getDefaultInstance() : user_; + } + /** + * + * + *
+   * Required. The resource being updated
+   * 
+ * + * .google.cloud.alloydb.v1beta.User user = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.alloydb.v1beta.UserOrBuilder getUserOrBuilder() { + return user_ == null ? com.google.cloud.alloydb.v1beta.User.getDefaultInstance() : user_; + } + + public static final int REQUEST_ID_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object 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).
+   * 
+ * + * string request_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The requestId. + */ + @java.lang.Override + public java.lang.String getRequestId() { + java.lang.Object ref = requestId_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + requestId_ = s; + return s; + } + } + /** + * + * + *
+   * Optional. An optional request ID to identify requests. Specify a unique
+   * request ID so that if you must retry your request, the server will know to
+   * ignore the request if it has already been completed. The server will
+   * guarantee that for at least 60 minutes since the first request.
+   *
+   * For example, consider a situation where you make an initial request and
+   * the request times out. If you make the request again with the same request
+   * ID, the server can check if original operation with the same request ID
+   * was received, and if so, will ignore the second request. This prevents
+   * clients from accidentally creating duplicate commitments.
+   *
+   * The request ID must be a valid UUID with the exception that zero UUID is
+   * not supported (00000000-0000-0000-0000-000000000000).
+   * 
+ * + * string request_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for requestId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getRequestIdBytes() { + java.lang.Object ref = requestId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + requestId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int VALIDATE_ONLY_FIELD_NUMBER = 4; + private boolean validateOnly_ = false; + /** + * + * + *
+   * Optional. If set, the backend validates the request, but doesn't actually
+   * execute it.
+   * 
+ * + * bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The validateOnly. + */ + @java.lang.Override + public boolean getValidateOnly() { + return validateOnly_; + } + + public static final int ALLOW_MISSING_FIELD_NUMBER = 5; + private boolean allowMissing_ = false; + /** + * + * + *
+   * Optional. Allow missing fields in the update mask.
+   * 
+ * + * bool allow_missing = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The allowMissing. + */ + @java.lang.Override + public boolean getAllowMissing() { + return allowMissing_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (updateMask_ != null) { + output.writeMessage(1, getUpdateMask()); + } + if (user_ != null) { + output.writeMessage(2, getUser()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(requestId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, requestId_); + } + if (validateOnly_ != false) { + output.writeBool(4, validateOnly_); + } + if (allowMissing_ != false) { + output.writeBool(5, allowMissing_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (updateMask_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getUpdateMask()); + } + if (user_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getUser()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(requestId_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, requestId_); + } + if (validateOnly_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(4, validateOnly_); + } + if (allowMissing_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(5, allowMissing_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.alloydb.v1beta.UpdateUserRequest)) { + return super.equals(obj); + } + com.google.cloud.alloydb.v1beta.UpdateUserRequest other = + (com.google.cloud.alloydb.v1beta.UpdateUserRequest) obj; + + if (hasUpdateMask() != other.hasUpdateMask()) return false; + if (hasUpdateMask()) { + if (!getUpdateMask().equals(other.getUpdateMask())) return false; + } + if (hasUser() != other.hasUser()) return false; + if (hasUser()) { + if (!getUser().equals(other.getUser())) return false; + } + if (!getRequestId().equals(other.getRequestId())) return false; + if (getValidateOnly() != other.getValidateOnly()) return false; + if (getAllowMissing() != other.getAllowMissing()) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasUpdateMask()) { + hash = (37 * hash) + UPDATE_MASK_FIELD_NUMBER; + hash = (53 * hash) + getUpdateMask().hashCode(); + } + if (hasUser()) { + hash = (37 * hash) + USER_FIELD_NUMBER; + hash = (53 * hash) + getUser().hashCode(); + } + hash = (37 * hash) + REQUEST_ID_FIELD_NUMBER; + hash = (53 * hash) + getRequestId().hashCode(); + hash = (37 * hash) + VALIDATE_ONLY_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getValidateOnly()); + hash = (37 * hash) + ALLOW_MISSING_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getAllowMissing()); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.alloydb.v1beta.UpdateUserRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1beta.UpdateUserRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.alloydb.v1beta.UpdateUserRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1beta.UpdateUserRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.alloydb.v1beta.UpdateUserRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1beta.UpdateUserRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.alloydb.v1beta.UpdateUserRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1beta.UpdateUserRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.alloydb.v1beta.UpdateUserRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1beta.UpdateUserRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.alloydb.v1beta.UpdateUserRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1beta.UpdateUserRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.alloydb.v1beta.UpdateUserRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Message for updating a User
+   * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1beta.UpdateUserRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.alloydb.v1beta.UpdateUserRequest) + com.google.cloud.alloydb.v1beta.UpdateUserRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.alloydb.v1beta.ServiceProto + .internal_static_google_cloud_alloydb_v1beta_UpdateUserRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1beta.ServiceProto + .internal_static_google_cloud_alloydb_v1beta_UpdateUserRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1beta.UpdateUserRequest.class, + com.google.cloud.alloydb.v1beta.UpdateUserRequest.Builder.class); + } + + // Construct using com.google.cloud.alloydb.v1beta.UpdateUserRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + updateMask_ = null; + if (updateMaskBuilder_ != null) { + updateMaskBuilder_.dispose(); + updateMaskBuilder_ = null; + } + user_ = null; + if (userBuilder_ != null) { + userBuilder_.dispose(); + userBuilder_ = null; + } + requestId_ = ""; + validateOnly_ = false; + allowMissing_ = false; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.alloydb.v1beta.ServiceProto + .internal_static_google_cloud_alloydb_v1beta_UpdateUserRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1beta.UpdateUserRequest getDefaultInstanceForType() { + return com.google.cloud.alloydb.v1beta.UpdateUserRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.alloydb.v1beta.UpdateUserRequest build() { + com.google.cloud.alloydb.v1beta.UpdateUserRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1beta.UpdateUserRequest buildPartial() { + com.google.cloud.alloydb.v1beta.UpdateUserRequest result = + new com.google.cloud.alloydb.v1beta.UpdateUserRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.alloydb.v1beta.UpdateUserRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.updateMask_ = updateMaskBuilder_ == null ? updateMask_ : updateMaskBuilder_.build(); + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.user_ = userBuilder_ == null ? user_ : userBuilder_.build(); + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.requestId_ = requestId_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.validateOnly_ = validateOnly_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.allowMissing_ = allowMissing_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.alloydb.v1beta.UpdateUserRequest) { + return mergeFrom((com.google.cloud.alloydb.v1beta.UpdateUserRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.alloydb.v1beta.UpdateUserRequest other) { + if (other == com.google.cloud.alloydb.v1beta.UpdateUserRequest.getDefaultInstance()) + return this; + if (other.hasUpdateMask()) { + mergeUpdateMask(other.getUpdateMask()); + } + if (other.hasUser()) { + mergeUser(other.getUser()); + } + if (!other.getRequestId().isEmpty()) { + requestId_ = other.requestId_; + bitField0_ |= 0x00000004; + onChanged(); + } + if (other.getValidateOnly() != false) { + setValidateOnly(other.getValidateOnly()); + } + if (other.getAllowMissing() != false) { + setAllowMissing(other.getAllowMissing()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + input.readMessage(getUpdateMaskFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + input.readMessage(getUserFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + requestId_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 32: + { + validateOnly_ = input.readBool(); + bitField0_ |= 0x00000008; + break; + } // case 32 + case 40: + { + allowMissing_ = input.readBool(); + bitField0_ |= 0x00000010; + break; + } // case 40 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private com.google.protobuf.FieldMask updateMask_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder> + updateMaskBuilder_; + /** + * + * + *
+     * 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.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the updateMask field is set. + */ + public boolean hasUpdateMask() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+     * 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.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The updateMask. + */ + public com.google.protobuf.FieldMask getUpdateMask() { + if (updateMaskBuilder_ == null) { + return updateMask_ == null + ? com.google.protobuf.FieldMask.getDefaultInstance() + : updateMask_; + } else { + return updateMaskBuilder_.getMessage(); + } + } + /** + * + * + *
+     * 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.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setUpdateMask(com.google.protobuf.FieldMask value) { + if (updateMaskBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + updateMask_ = value; + } else { + updateMaskBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * 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.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setUpdateMask(com.google.protobuf.FieldMask.Builder builderForValue) { + if (updateMaskBuilder_ == null) { + updateMask_ = builderForValue.build(); + } else { + updateMaskBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * 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.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder mergeUpdateMask(com.google.protobuf.FieldMask value) { + if (updateMaskBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && updateMask_ != null + && updateMask_ != com.google.protobuf.FieldMask.getDefaultInstance()) { + getUpdateMaskBuilder().mergeFrom(value); + } else { + updateMask_ = value; + } + } else { + updateMaskBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * 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.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder clearUpdateMask() { + bitField0_ = (bitField0_ & ~0x00000001); + updateMask_ = null; + if (updateMaskBuilder_ != null) { + updateMaskBuilder_.dispose(); + updateMaskBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * 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.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.protobuf.FieldMask.Builder getUpdateMaskBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return getUpdateMaskFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * 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.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { + if (updateMaskBuilder_ != null) { + return updateMaskBuilder_.getMessageOrBuilder(); + } else { + return updateMask_ == null + ? com.google.protobuf.FieldMask.getDefaultInstance() + : 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.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder> + getUpdateMaskFieldBuilder() { + if (updateMaskBuilder_ == null) { + updateMaskBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder>( + getUpdateMask(), getParentForChildren(), isClean()); + updateMask_ = null; + } + return updateMaskBuilder_; + } + + private com.google.cloud.alloydb.v1beta.User user_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1beta.User, + com.google.cloud.alloydb.v1beta.User.Builder, + com.google.cloud.alloydb.v1beta.UserOrBuilder> + userBuilder_; + /** + * + * + *
+     * Required. The resource being updated
+     * 
+ * + * .google.cloud.alloydb.v1beta.User user = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the user field is set. + */ + public boolean hasUser() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+     * Required. The resource being updated
+     * 
+ * + * .google.cloud.alloydb.v1beta.User user = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The user. + */ + public com.google.cloud.alloydb.v1beta.User getUser() { + if (userBuilder_ == null) { + return user_ == null ? com.google.cloud.alloydb.v1beta.User.getDefaultInstance() : user_; + } else { + return userBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. The resource being updated
+     * 
+ * + * .google.cloud.alloydb.v1beta.User user = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setUser(com.google.cloud.alloydb.v1beta.User value) { + if (userBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + user_ = value; + } else { + userBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The resource being updated
+     * 
+ * + * .google.cloud.alloydb.v1beta.User user = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setUser(com.google.cloud.alloydb.v1beta.User.Builder builderForValue) { + if (userBuilder_ == null) { + user_ = builderForValue.build(); + } else { + userBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The resource being updated
+     * 
+ * + * .google.cloud.alloydb.v1beta.User user = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeUser(com.google.cloud.alloydb.v1beta.User value) { + if (userBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && user_ != null + && user_ != com.google.cloud.alloydb.v1beta.User.getDefaultInstance()) { + getUserBuilder().mergeFrom(value); + } else { + user_ = value; + } + } else { + userBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The resource being updated
+     * 
+ * + * .google.cloud.alloydb.v1beta.User user = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearUser() { + bitField0_ = (bitField0_ & ~0x00000002); + user_ = null; + if (userBuilder_ != null) { + userBuilder_.dispose(); + userBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The resource being updated
+     * 
+ * + * .google.cloud.alloydb.v1beta.User user = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.alloydb.v1beta.User.Builder getUserBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return getUserFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. The resource being updated
+     * 
+ * + * .google.cloud.alloydb.v1beta.User user = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.alloydb.v1beta.UserOrBuilder getUserOrBuilder() { + if (userBuilder_ != null) { + return userBuilder_.getMessageOrBuilder(); + } else { + return user_ == null ? com.google.cloud.alloydb.v1beta.User.getDefaultInstance() : user_; + } + } + /** + * + * + *
+     * Required. The resource being updated
+     * 
+ * + * .google.cloud.alloydb.v1beta.User user = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1beta.User, + com.google.cloud.alloydb.v1beta.User.Builder, + com.google.cloud.alloydb.v1beta.UserOrBuilder> + getUserFieldBuilder() { + if (userBuilder_ == null) { + userBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.alloydb.v1beta.User, + com.google.cloud.alloydb.v1beta.User.Builder, + com.google.cloud.alloydb.v1beta.UserOrBuilder>( + getUser(), getParentForChildren(), isClean()); + user_ = null; + } + return userBuilder_; + } + + private java.lang.Object 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).
+     * 
+ * + * string request_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The requestId. + */ + public java.lang.String getRequestId() { + java.lang.Object ref = requestId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + requestId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes since the first request.
+     *
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     *
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for requestId. + */ + public com.google.protobuf.ByteString getRequestIdBytes() { + java.lang.Object ref = requestId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + requestId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes since the first request.
+     *
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     *
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The requestId to set. + * @return This builder for chaining. + */ + public Builder setRequestId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + requestId_ = value; + bitField0_ |= 0x00000004; + onChanged(); + 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).
+     * 
+ * + * string request_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearRequestId() { + requestId_ = getDefaultInstance().getRequestId(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + 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).
+     * 
+ * + * string request_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for requestId to set. + * @return This builder for chaining. + */ + public Builder setRequestIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + requestId_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + private boolean validateOnly_; + /** + * + * + *
+     * Optional. If set, the backend validates the request, but doesn't actually
+     * execute it.
+     * 
+ * + * bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The validateOnly. + */ + @java.lang.Override + public boolean getValidateOnly() { + return validateOnly_; + } + /** + * + * + *
+     * Optional. If set, the backend validates the request, but doesn't actually
+     * execute it.
+     * 
+ * + * bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The validateOnly to set. + * @return This builder for chaining. + */ + public Builder setValidateOnly(boolean value) { + + validateOnly_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. If set, the backend validates the request, but doesn't actually
+     * execute it.
+     * 
+ * + * bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearValidateOnly() { + bitField0_ = (bitField0_ & ~0x00000008); + validateOnly_ = false; + onChanged(); + return this; + } + + private boolean allowMissing_; + /** + * + * + *
+     * Optional. Allow missing fields in the update mask.
+     * 
+ * + * bool allow_missing = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The allowMissing. + */ + @java.lang.Override + public boolean getAllowMissing() { + return allowMissing_; + } + /** + * + * + *
+     * Optional. Allow missing fields in the update mask.
+     * 
+ * + * bool allow_missing = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The allowMissing to set. + * @return This builder for chaining. + */ + public Builder setAllowMissing(boolean value) { + + allowMissing_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Allow missing fields in the update mask.
+     * 
+ * + * bool allow_missing = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearAllowMissing() { + bitField0_ = (bitField0_ & ~0x00000010); + allowMissing_ = false; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.alloydb.v1beta.UpdateUserRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.alloydb.v1beta.UpdateUserRequest) + private static final com.google.cloud.alloydb.v1beta.UpdateUserRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.alloydb.v1beta.UpdateUserRequest(); + } + + public static com.google.cloud.alloydb.v1beta.UpdateUserRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public UpdateUserRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1beta.UpdateUserRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/UpdateUserRequestOrBuilder.java b/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/UpdateUserRequestOrBuilder.java new file mode 100644 index 000000000000..1e5da63eed22 --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/UpdateUserRequestOrBuilder.java @@ -0,0 +1,189 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/alloydb/v1beta/service.proto + +package com.google.cloud.alloydb.v1beta; + +public interface UpdateUserRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.alloydb.v1beta.UpdateUserRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * 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.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the updateMask field is set. + */ + boolean hasUpdateMask(); + /** + * + * + *
+   * 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.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The updateMask. + */ + com.google.protobuf.FieldMask getUpdateMask(); + /** + * + * + *
+   * 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.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder(); + + /** + * + * + *
+   * Required. The resource being updated
+   * 
+ * + * .google.cloud.alloydb.v1beta.User user = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the user field is set. + */ + boolean hasUser(); + /** + * + * + *
+   * Required. The resource being updated
+   * 
+ * + * .google.cloud.alloydb.v1beta.User user = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The user. + */ + com.google.cloud.alloydb.v1beta.User getUser(); + /** + * + * + *
+   * Required. The resource being updated
+   * 
+ * + * .google.cloud.alloydb.v1beta.User user = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.alloydb.v1beta.UserOrBuilder getUserOrBuilder(); + + /** + * + * + *
+   * Optional. An optional request ID to identify requests. Specify a unique
+   * request ID so that if you must retry your request, the server will know to
+   * ignore the request if it has already been completed. The server will
+   * guarantee that for at least 60 minutes since the first request.
+   *
+   * For example, consider a situation where you make an initial request and
+   * the request times out. If you make the request again with the same request
+   * ID, the server can check if original operation with the same request ID
+   * was received, and if so, will ignore the second request. This prevents
+   * clients from accidentally creating duplicate commitments.
+   *
+   * The request ID must be a valid UUID with the exception that zero UUID is
+   * not supported (00000000-0000-0000-0000-000000000000).
+   * 
+ * + * string request_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The requestId. + */ + java.lang.String getRequestId(); + /** + * + * + *
+   * Optional. An optional request ID to identify requests. Specify a unique
+   * request ID so that if you must retry your request, the server will know to
+   * ignore the request if it has already been completed. The server will
+   * guarantee that for at least 60 minutes since the first request.
+   *
+   * For example, consider a situation where you make an initial request and
+   * the request times out. If you make the request again with the same request
+   * ID, the server can check if original operation with the same request ID
+   * was received, and if so, will ignore the second request. This prevents
+   * clients from accidentally creating duplicate commitments.
+   *
+   * The request ID must be a valid UUID with the exception that zero UUID is
+   * not supported (00000000-0000-0000-0000-000000000000).
+   * 
+ * + * string request_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for requestId. + */ + com.google.protobuf.ByteString getRequestIdBytes(); + + /** + * + * + *
+   * Optional. If set, the backend validates the request, but doesn't actually
+   * execute it.
+   * 
+ * + * bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The validateOnly. + */ + boolean getValidateOnly(); + + /** + * + * + *
+   * Optional. Allow missing fields in the update mask.
+   * 
+ * + * bool allow_missing = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The allowMissing. + */ + boolean getAllowMissing(); +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/User.java b/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/User.java new file mode 100644 index 000000000000..e06ecc642075 --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/User.java @@ -0,0 +1,1422 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/alloydb/v1beta/resources.proto + +package com.google.cloud.alloydb.v1beta; + +/** + * + * + *
+ * Message describing User object.
+ * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1beta.User} + */ +public final class User extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.alloydb.v1beta.User) + UserOrBuilder { + private static final long serialVersionUID = 0L; + // Use User.newBuilder() to construct. + private User(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private User() { + name_ = ""; + password_ = ""; + databaseRoles_ = com.google.protobuf.LazyStringArrayList.emptyList(); + userType_ = 0; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new User(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.alloydb.v1beta.ResourcesProto + .internal_static_google_cloud_alloydb_v1beta_User_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1beta.ResourcesProto + .internal_static_google_cloud_alloydb_v1beta_User_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1beta.User.class, + com.google.cloud.alloydb.v1beta.User.Builder.class); + } + + /** + * + * + *
+   * Enum that details the user type.
+   * 
+ * + * Protobuf enum {@code google.cloud.alloydb.v1beta.User.UserType} + */ + public enum UserType implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * Unspecified user type.
+     * 
+ * + * USER_TYPE_UNSPECIFIED = 0; + */ + USER_TYPE_UNSPECIFIED(0), + /** + * + * + *
+     * The default user type that authenticates via password-based
+     * authentication.
+     * 
+ * + * ALLOYDB_BUILT_IN = 1; + */ + ALLOYDB_BUILT_IN(1), + /** + * + * + *
+     * Database user that can authenticate via IAM-Based authentication.
+     * 
+ * + * ALLOYDB_IAM_USER = 2; + */ + ALLOYDB_IAM_USER(2), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * Unspecified user type.
+     * 
+ * + * USER_TYPE_UNSPECIFIED = 0; + */ + public static final int USER_TYPE_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * The default user type that authenticates via password-based
+     * authentication.
+     * 
+ * + * ALLOYDB_BUILT_IN = 1; + */ + public static final int ALLOYDB_BUILT_IN_VALUE = 1; + /** + * + * + *
+     * Database user that can authenticate via IAM-Based authentication.
+     * 
+ * + * ALLOYDB_IAM_USER = 2; + */ + public static final int ALLOYDB_IAM_USER_VALUE = 2; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static UserType valueOf(int value) { + return forNumber(value); + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + */ + public static UserType forNumber(int value) { + switch (value) { + case 0: + return USER_TYPE_UNSPECIFIED; + case 1: + return ALLOYDB_BUILT_IN; + case 2: + return ALLOYDB_IAM_USER; + default: + return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap internalGetValueMap() { + return internalValueMap; + } + + private static final com.google.protobuf.Internal.EnumLiteMap internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public UserType findValueByNumber(int number) { + return UserType.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + return getDescriptor().getValues().get(ordinal()); + } + + public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { + return getDescriptor(); + } + + public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.cloud.alloydb.v1beta.User.getDescriptor().getEnumTypes().get(0); + } + + private static final UserType[] VALUES = values(); + + public static UserType valueOf(com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException("EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private UserType(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.alloydb.v1beta.User.UserType) + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + * + * + *
+   * Output only. Name of the resource in the form of
+   * projects/{project}/locations/{location}/cluster/{cluster}/users/{user}.
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * Output only. Name of the resource in the form of
+   * projects/{project}/locations/{location}/cluster/{cluster}/users/{user}.
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PASSWORD_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object password_ = ""; + /** + * + * + *
+   * Input only. Password for the user.
+   * 
+ * + * string password = 2 [(.google.api.field_behavior) = INPUT_ONLY]; + * + * @return The password. + */ + @java.lang.Override + public java.lang.String getPassword() { + java.lang.Object ref = password_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + password_ = s; + return s; + } + } + /** + * + * + *
+   * Input only. Password for the user.
+   * 
+ * + * string password = 2 [(.google.api.field_behavior) = INPUT_ONLY]; + * + * @return The bytes for password. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPasswordBytes() { + java.lang.Object ref = password_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + password_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DATABASE_ROLES_FIELD_NUMBER = 4; + + @SuppressWarnings("serial") + private com.google.protobuf.LazyStringArrayList databaseRoles_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + /** + * + * + *
+   * Optional. List of database roles this user has.
+   * The database role strings are subject to the PostgreSQL naming conventions.
+   * 
+ * + * repeated string database_roles = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return A list containing the databaseRoles. + */ + public com.google.protobuf.ProtocolStringList getDatabaseRolesList() { + return databaseRoles_; + } + /** + * + * + *
+   * Optional. List of database roles this user has.
+   * The database role strings are subject to the PostgreSQL naming conventions.
+   * 
+ * + * repeated string database_roles = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The count of databaseRoles. + */ + public int getDatabaseRolesCount() { + return databaseRoles_.size(); + } + /** + * + * + *
+   * Optional. List of database roles this user has.
+   * The database role strings are subject to the PostgreSQL naming conventions.
+   * 
+ * + * repeated string database_roles = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param index The index of the element to return. + * @return The databaseRoles at the given index. + */ + public java.lang.String getDatabaseRoles(int index) { + return databaseRoles_.get(index); + } + /** + * + * + *
+   * Optional. List of database roles this user has.
+   * The database role strings are subject to the PostgreSQL naming conventions.
+   * 
+ * + * repeated string database_roles = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param index The index of the value to return. + * @return The bytes of the databaseRoles at the given index. + */ + public com.google.protobuf.ByteString getDatabaseRolesBytes(int index) { + return databaseRoles_.getByteString(index); + } + + public static final int USER_TYPE_FIELD_NUMBER = 5; + private int userType_ = 0; + /** + * + * + *
+   * Optional. Type of this user.
+   * 
+ * + * + * .google.cloud.alloydb.v1beta.User.UserType user_type = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The enum numeric value on the wire for userType. + */ + @java.lang.Override + public int getUserTypeValue() { + return userType_; + } + /** + * + * + *
+   * Optional. Type of this user.
+   * 
+ * + * + * .google.cloud.alloydb.v1beta.User.UserType user_type = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The userType. + */ + @java.lang.Override + public com.google.cloud.alloydb.v1beta.User.UserType getUserType() { + com.google.cloud.alloydb.v1beta.User.UserType result = + com.google.cloud.alloydb.v1beta.User.UserType.forNumber(userType_); + return result == null ? com.google.cloud.alloydb.v1beta.User.UserType.UNRECOGNIZED : result; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(password_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, password_); + } + for (int i = 0; i < databaseRoles_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, databaseRoles_.getRaw(i)); + } + if (userType_ + != com.google.cloud.alloydb.v1beta.User.UserType.USER_TYPE_UNSPECIFIED.getNumber()) { + output.writeEnum(5, userType_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(password_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, password_); + } + { + int dataSize = 0; + for (int i = 0; i < databaseRoles_.size(); i++) { + dataSize += computeStringSizeNoTag(databaseRoles_.getRaw(i)); + } + size += dataSize; + size += 1 * getDatabaseRolesList().size(); + } + if (userType_ + != com.google.cloud.alloydb.v1beta.User.UserType.USER_TYPE_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(5, userType_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.alloydb.v1beta.User)) { + return super.equals(obj); + } + com.google.cloud.alloydb.v1beta.User other = (com.google.cloud.alloydb.v1beta.User) obj; + + if (!getName().equals(other.getName())) return false; + if (!getPassword().equals(other.getPassword())) return false; + if (!getDatabaseRolesList().equals(other.getDatabaseRolesList())) return false; + if (userType_ != other.userType_) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (37 * hash) + PASSWORD_FIELD_NUMBER; + hash = (53 * hash) + getPassword().hashCode(); + if (getDatabaseRolesCount() > 0) { + hash = (37 * hash) + DATABASE_ROLES_FIELD_NUMBER; + hash = (53 * hash) + getDatabaseRolesList().hashCode(); + } + hash = (37 * hash) + USER_TYPE_FIELD_NUMBER; + hash = (53 * hash) + userType_; + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.alloydb.v1beta.User parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1beta.User parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.alloydb.v1beta.User parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1beta.User parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.alloydb.v1beta.User parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.alloydb.v1beta.User parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.alloydb.v1beta.User parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1beta.User parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.alloydb.v1beta.User parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1beta.User parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.alloydb.v1beta.User parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.alloydb.v1beta.User parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.alloydb.v1beta.User prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Message describing User object.
+   * 
+ * + * Protobuf type {@code google.cloud.alloydb.v1beta.User} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.alloydb.v1beta.User) + com.google.cloud.alloydb.v1beta.UserOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.alloydb.v1beta.ResourcesProto + .internal_static_google_cloud_alloydb_v1beta_User_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.alloydb.v1beta.ResourcesProto + .internal_static_google_cloud_alloydb_v1beta_User_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.alloydb.v1beta.User.class, + com.google.cloud.alloydb.v1beta.User.Builder.class); + } + + // Construct using com.google.cloud.alloydb.v1beta.User.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + password_ = ""; + databaseRoles_ = com.google.protobuf.LazyStringArrayList.emptyList(); + userType_ = 0; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.alloydb.v1beta.ResourcesProto + .internal_static_google_cloud_alloydb_v1beta_User_descriptor; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1beta.User getDefaultInstanceForType() { + return com.google.cloud.alloydb.v1beta.User.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.alloydb.v1beta.User build() { + com.google.cloud.alloydb.v1beta.User result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1beta.User buildPartial() { + com.google.cloud.alloydb.v1beta.User result = new com.google.cloud.alloydb.v1beta.User(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.alloydb.v1beta.User result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.password_ = password_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + databaseRoles_.makeImmutable(); + result.databaseRoles_ = databaseRoles_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.userType_ = userType_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.alloydb.v1beta.User) { + return mergeFrom((com.google.cloud.alloydb.v1beta.User) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.alloydb.v1beta.User other) { + if (other == com.google.cloud.alloydb.v1beta.User.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getPassword().isEmpty()) { + password_ = other.password_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (!other.databaseRoles_.isEmpty()) { + if (databaseRoles_.isEmpty()) { + databaseRoles_ = other.databaseRoles_; + bitField0_ |= 0x00000004; + } else { + ensureDatabaseRolesIsMutable(); + databaseRoles_.addAll(other.databaseRoles_); + } + onChanged(); + } + if (other.userType_ != 0) { + setUserTypeValue(other.getUserTypeValue()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + password_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 34: + { + java.lang.String s = input.readStringRequireUtf8(); + ensureDatabaseRolesIsMutable(); + databaseRoles_.add(s); + break; + } // case 34 + case 40: + { + userType_ = input.readEnum(); + bitField0_ |= 0x00000008; + break; + } // case 40 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Output only. Name of the resource in the form of
+     * projects/{project}/locations/{location}/cluster/{cluster}/users/{user}.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Output only. Name of the resource in the form of
+     * projects/{project}/locations/{location}/cluster/{cluster}/users/{user}.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Output only. Name of the resource in the form of
+     * projects/{project}/locations/{location}/cluster/{cluster}/users/{user}.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Name of the resource in the form of
+     * projects/{project}/locations/{location}/cluster/{cluster}/users/{user}.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Name of the resource in the form of
+     * projects/{project}/locations/{location}/cluster/{cluster}/users/{user}.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object password_ = ""; + /** + * + * + *
+     * Input only. Password for the user.
+     * 
+ * + * string password = 2 [(.google.api.field_behavior) = INPUT_ONLY]; + * + * @return The password. + */ + public java.lang.String getPassword() { + java.lang.Object ref = password_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + password_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Input only. Password for the user.
+     * 
+ * + * string password = 2 [(.google.api.field_behavior) = INPUT_ONLY]; + * + * @return The bytes for password. + */ + public com.google.protobuf.ByteString getPasswordBytes() { + java.lang.Object ref = password_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + password_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Input only. Password for the user.
+     * 
+ * + * string password = 2 [(.google.api.field_behavior) = INPUT_ONLY]; + * + * @param value The password to set. + * @return This builder for chaining. + */ + public Builder setPassword(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + password_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Input only. Password for the user.
+     * 
+ * + * string password = 2 [(.google.api.field_behavior) = INPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearPassword() { + password_ = getDefaultInstance().getPassword(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * Input only. Password for the user.
+     * 
+ * + * string password = 2 [(.google.api.field_behavior) = INPUT_ONLY]; + * + * @param value The bytes for password to set. + * @return This builder for chaining. + */ + public Builder setPasswordBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + password_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringArrayList databaseRoles_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + + private void ensureDatabaseRolesIsMutable() { + if (!databaseRoles_.isModifiable()) { + databaseRoles_ = new com.google.protobuf.LazyStringArrayList(databaseRoles_); + } + bitField0_ |= 0x00000004; + } + /** + * + * + *
+     * Optional. List of database roles this user has.
+     * The database role strings are subject to the PostgreSQL naming conventions.
+     * 
+ * + * repeated string database_roles = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return A list containing the databaseRoles. + */ + public com.google.protobuf.ProtocolStringList getDatabaseRolesList() { + databaseRoles_.makeImmutable(); + return databaseRoles_; + } + /** + * + * + *
+     * Optional. List of database roles this user has.
+     * The database role strings are subject to the PostgreSQL naming conventions.
+     * 
+ * + * repeated string database_roles = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The count of databaseRoles. + */ + public int getDatabaseRolesCount() { + return databaseRoles_.size(); + } + /** + * + * + *
+     * Optional. List of database roles this user has.
+     * The database role strings are subject to the PostgreSQL naming conventions.
+     * 
+ * + * repeated string database_roles = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param index The index of the element to return. + * @return The databaseRoles at the given index. + */ + public java.lang.String getDatabaseRoles(int index) { + return databaseRoles_.get(index); + } + /** + * + * + *
+     * Optional. List of database roles this user has.
+     * The database role strings are subject to the PostgreSQL naming conventions.
+     * 
+ * + * repeated string database_roles = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param index The index of the value to return. + * @return The bytes of the databaseRoles at the given index. + */ + public com.google.protobuf.ByteString getDatabaseRolesBytes(int index) { + return databaseRoles_.getByteString(index); + } + /** + * + * + *
+     * Optional. List of database roles this user has.
+     * The database role strings are subject to the PostgreSQL naming conventions.
+     * 
+ * + * repeated string database_roles = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param index The index to set the value at. + * @param value The databaseRoles to set. + * @return This builder for chaining. + */ + public Builder setDatabaseRoles(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureDatabaseRolesIsMutable(); + databaseRoles_.set(index, value); + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. List of database roles this user has.
+     * The database role strings are subject to the PostgreSQL naming conventions.
+     * 
+ * + * repeated string database_roles = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The databaseRoles to add. + * @return This builder for chaining. + */ + public Builder addDatabaseRoles(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureDatabaseRolesIsMutable(); + databaseRoles_.add(value); + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. List of database roles this user has.
+     * The database role strings are subject to the PostgreSQL naming conventions.
+     * 
+ * + * repeated string database_roles = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param values The databaseRoles to add. + * @return This builder for chaining. + */ + public Builder addAllDatabaseRoles(java.lang.Iterable values) { + ensureDatabaseRolesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, databaseRoles_); + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. List of database roles this user has.
+     * The database role strings are subject to the PostgreSQL naming conventions.
+     * 
+ * + * repeated string database_roles = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearDatabaseRoles() { + databaseRoles_ = com.google.protobuf.LazyStringArrayList.emptyList(); + bitField0_ = (bitField0_ & ~0x00000004); + ; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. List of database roles this user has.
+     * The database role strings are subject to the PostgreSQL naming conventions.
+     * 
+ * + * repeated string database_roles = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes of the databaseRoles to add. + * @return This builder for chaining. + */ + public Builder addDatabaseRolesBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureDatabaseRolesIsMutable(); + databaseRoles_.add(value); + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + private int userType_ = 0; + /** + * + * + *
+     * Optional. Type of this user.
+     * 
+ * + * + * .google.cloud.alloydb.v1beta.User.UserType user_type = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The enum numeric value on the wire for userType. + */ + @java.lang.Override + public int getUserTypeValue() { + return userType_; + } + /** + * + * + *
+     * Optional. Type of this user.
+     * 
+ * + * + * .google.cloud.alloydb.v1beta.User.UserType user_type = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param value The enum numeric value on the wire for userType to set. + * @return This builder for chaining. + */ + public Builder setUserTypeValue(int value) { + userType_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Type of this user.
+     * 
+ * + * + * .google.cloud.alloydb.v1beta.User.UserType user_type = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The userType. + */ + @java.lang.Override + public com.google.cloud.alloydb.v1beta.User.UserType getUserType() { + com.google.cloud.alloydb.v1beta.User.UserType result = + com.google.cloud.alloydb.v1beta.User.UserType.forNumber(userType_); + return result == null ? com.google.cloud.alloydb.v1beta.User.UserType.UNRECOGNIZED : result; + } + /** + * + * + *
+     * Optional. Type of this user.
+     * 
+ * + * + * .google.cloud.alloydb.v1beta.User.UserType user_type = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param value The userType to set. + * @return This builder for chaining. + */ + public Builder setUserType(com.google.cloud.alloydb.v1beta.User.UserType value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000008; + userType_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Type of this user.
+     * 
+ * + * + * .google.cloud.alloydb.v1beta.User.UserType user_type = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return This builder for chaining. + */ + public Builder clearUserType() { + bitField0_ = (bitField0_ & ~0x00000008); + userType_ = 0; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.alloydb.v1beta.User) + } + + // @@protoc_insertion_point(class_scope:google.cloud.alloydb.v1beta.User) + private static final com.google.cloud.alloydb.v1beta.User DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.alloydb.v1beta.User(); + } + + public static com.google.cloud.alloydb.v1beta.User getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public User parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.alloydb.v1beta.User getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/UserName.java b/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/UserName.java new file mode 100644 index 000000000000..0aee0f2b49be --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/UserName.java @@ -0,0 +1,257 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.alloydb.v1beta; + +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +@Generated("by gapic-generator-java") +public class UserName implements ResourceName { + private static final PathTemplate PROJECT_LOCATION_CLUSTER_USER = + PathTemplate.createWithoutUrlEncoding( + "projects/{project}/locations/{location}/clusters/{cluster}/users/{user}"); + private volatile Map fieldValuesMap; + private final String project; + private final String location; + private final String cluster; + private final String user; + + @Deprecated + protected UserName() { + project = null; + location = null; + cluster = null; + user = null; + } + + private UserName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + location = Preconditions.checkNotNull(builder.getLocation()); + cluster = Preconditions.checkNotNull(builder.getCluster()); + user = Preconditions.checkNotNull(builder.getUser()); + } + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getCluster() { + return cluster; + } + + public String getUser() { + return user; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + public static UserName of(String project, String location, String cluster, String user) { + return newBuilder() + .setProject(project) + .setLocation(location) + .setCluster(cluster) + .setUser(user) + .build(); + } + + public static String format(String project, String location, String cluster, String user) { + return newBuilder() + .setProject(project) + .setLocation(location) + .setCluster(cluster) + .setUser(user) + .build() + .toString(); + } + + public static UserName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + PROJECT_LOCATION_CLUSTER_USER.validatedMatch( + formattedString, "UserName.parse: formattedString not in valid format"); + return of( + matchMap.get("project"), + matchMap.get("location"), + matchMap.get("cluster"), + matchMap.get("user")); + } + + public static List parseList(List formattedStrings) { + List list = new ArrayList<>(formattedStrings.size()); + for (String formattedString : formattedStrings) { + list.add(parse(formattedString)); + } + return list; + } + + public static List toStringList(List values) { + List list = new ArrayList<>(values.size()); + for (UserName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return PROJECT_LOCATION_CLUSTER_USER.matches(formattedString); + } + + @Override + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + if (project != null) { + fieldMapBuilder.put("project", project); + } + if (location != null) { + fieldMapBuilder.put("location", location); + } + if (cluster != null) { + fieldMapBuilder.put("cluster", cluster); + } + if (user != null) { + fieldMapBuilder.put("user", user); + } + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return PROJECT_LOCATION_CLUSTER_USER.instantiate( + "project", project, "location", location, "cluster", cluster, "user", user); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null || getClass() == o.getClass()) { + UserName that = ((UserName) o); + return Objects.equals(this.project, that.project) + && Objects.equals(this.location, that.location) + && Objects.equals(this.cluster, that.cluster) + && Objects.equals(this.user, that.user); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= Objects.hashCode(project); + h *= 1000003; + h ^= Objects.hashCode(location); + h *= 1000003; + h ^= Objects.hashCode(cluster); + h *= 1000003; + h ^= Objects.hashCode(user); + return h; + } + + /** Builder for projects/{project}/locations/{location}/clusters/{cluster}/users/{user}. */ + public static class Builder { + private String project; + private String location; + private String cluster; + private String user; + + protected Builder() {} + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getCluster() { + return cluster; + } + + public String getUser() { + return user; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public Builder setLocation(String location) { + this.location = location; + return this; + } + + public Builder setCluster(String cluster) { + this.cluster = cluster; + return this; + } + + public Builder setUser(String user) { + this.user = user; + return this; + } + + private Builder(UserName userName) { + this.project = userName.project; + this.location = userName.location; + this.cluster = userName.cluster; + this.user = userName.user; + } + + public UserName build() { + return new UserName(this); + } + } +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/UserOrBuilder.java b/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/UserOrBuilder.java new file mode 100644 index 000000000000..21804572825c --- /dev/null +++ b/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/java/com/google/cloud/alloydb/v1beta/UserOrBuilder.java @@ -0,0 +1,161 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/alloydb/v1beta/resources.proto + +package com.google.cloud.alloydb.v1beta; + +public interface UserOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.alloydb.v1beta.User) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Output only. Name of the resource in the form of
+   * projects/{project}/locations/{location}/cluster/{cluster}/users/{user}.
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Output only. Name of the resource in the form of
+   * projects/{project}/locations/{location}/cluster/{cluster}/users/{user}.
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * Input only. Password for the user.
+   * 
+ * + * string password = 2 [(.google.api.field_behavior) = INPUT_ONLY]; + * + * @return The password. + */ + java.lang.String getPassword(); + /** + * + * + *
+   * Input only. Password for the user.
+   * 
+ * + * string password = 2 [(.google.api.field_behavior) = INPUT_ONLY]; + * + * @return The bytes for password. + */ + com.google.protobuf.ByteString getPasswordBytes(); + + /** + * + * + *
+   * Optional. List of database roles this user has.
+   * The database role strings are subject to the PostgreSQL naming conventions.
+   * 
+ * + * repeated string database_roles = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return A list containing the databaseRoles. + */ + java.util.List getDatabaseRolesList(); + /** + * + * + *
+   * Optional. List of database roles this user has.
+   * The database role strings are subject to the PostgreSQL naming conventions.
+   * 
+ * + * repeated string database_roles = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The count of databaseRoles. + */ + int getDatabaseRolesCount(); + /** + * + * + *
+   * Optional. List of database roles this user has.
+   * The database role strings are subject to the PostgreSQL naming conventions.
+   * 
+ * + * repeated string database_roles = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param index The index of the element to return. + * @return The databaseRoles at the given index. + */ + java.lang.String getDatabaseRoles(int index); + /** + * + * + *
+   * Optional. List of database roles this user has.
+   * The database role strings are subject to the PostgreSQL naming conventions.
+   * 
+ * + * repeated string database_roles = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param index The index of the value to return. + * @return The bytes of the databaseRoles at the given index. + */ + com.google.protobuf.ByteString getDatabaseRolesBytes(int index); + + /** + * + * + *
+   * Optional. Type of this user.
+   * 
+ * + * + * .google.cloud.alloydb.v1beta.User.UserType user_type = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The enum numeric value on the wire for userType. + */ + int getUserTypeValue(); + /** + * + * + *
+   * Optional. Type of this user.
+   * 
+ * + * + * .google.cloud.alloydb.v1beta.User.UserType user_type = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The userType. + */ + com.google.cloud.alloydb.v1beta.User.UserType getUserType(); +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/proto/google/cloud/alloydb/v1beta/resources.proto b/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/proto/google/cloud/alloydb/v1beta/resources.proto index be1ce9a80301..eb98358425e6 100644 --- a/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/proto/google/cloud/alloydb/v1beta/resources.proto +++ b/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/proto/google/cloud/alloydb/v1beta/resources.proto @@ -1,4 +1,4 @@ -// Copyright 2022 Google LLC +// Copyright 2023 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -40,18 +40,6 @@ option (google.api.resource_definition) = { pattern: "projects/{project}/global/networks/{network}" }; -// The supported database engine versions. -enum DatabaseVersion { - // This is an unknown database version. - DATABASE_VERSION_UNSPECIFIED = 0; - - // DEPRECATED - The database version is Postgres 13. - POSTGRES_13 = 1 [deprecated = true]; - - // The database version is Postgres 14. - POSTGRES_14 = 2; -} - // View on Instance. Pass this enum to rpcs that returns an Instance message to // control which subsets of fields to get. enum InstanceView { @@ -68,6 +56,35 @@ enum InstanceView { INSTANCE_VIEW_FULL = 2; } +// View on Cluster. Pass this enum to rpcs that returns a cluster message to +// control which subsets of fields to get. +enum ClusterView { + // CLUSTER_VIEW_UNSPECIFIED Not specified, equivalent to BASIC. + 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. + 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. + CLUSTER_VIEW_CONTINUOUS_BACKUP = 2; +} + +// The supported database engine versions. +enum DatabaseVersion { + // This is an unknown database version. + DATABASE_VERSION_UNSPECIFIED = 0; + + // DEPRECATED - The database version is Postgres 13. + POSTGRES_13 = 1 [deprecated = true]; + + // The database version is Postgres 14. + POSTGRES_14 = 2; +} + // The username/password for a database user. Used for specifying initial // users at cluster creation time. message UserPassword { @@ -141,25 +158,31 @@ message EncryptionInfo { ]; } -// SSL configuration for an AlloyDB Cluster. +// SSL configuration. message SslConfig { // SSL mode options. enum SslMode { - // SSL mode not specified. Defaults to SSL_MODE_ALLOW. + // SSL mode not specified. Defaults to ENCRYPTED_ONLY. SSL_MODE_UNSPECIFIED = 0; // SSL connections are optional. CA verification not enforced. - SSL_MODE_ALLOW = 1; + SSL_MODE_ALLOW = 1 [deprecated = true]; // SSL connections are required. CA verification not enforced. // Clients may use locally self-signed certificates (default psql client // behavior). - SSL_MODE_REQUIRE = 2; + SSL_MODE_REQUIRE = 2 [deprecated = true]; // SSL connections are required. CA verification enforced. // Clients must have certificates signed by a Cluster CA, e.g. via // GenerateClientCertificate. - SSL_MODE_VERIFY_CA = 3; + SSL_MODE_VERIFY_CA = 3 [deprecated = true]; + + // SSL connections are optional. CA verification not enforced. + ALLOW_UNENCRYPTED_AND_ENCRYPTED = 4; + + // SSL connections are required. CA verification not enforced. + ENCRYPTED_ONLY = 5; } // Certificate Authority (CA) source for SSL/TLS certificates. @@ -314,6 +337,11 @@ message ContinuousBackupInfo { // only field. Ignored if passed into the request. repeated google.type.DayOfWeek schedule = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The earliest restorable time that can be restored to. Output + // only field. + google.protobuf.Timestamp earliest_restorable_time = 4 + [(google.api.field_behavior) = OUTPUT_ONLY]; } // Message describing a BackupSource. @@ -353,6 +381,32 @@ message Cluster { style: DECLARATIVE_FRIENDLY }; + // Metadata related to network configuration. + message NetworkConfig { + // 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. It can be updated, but it cannot be + // removed. + string network = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "compute.googleapis.com/Network" + } + ]; + + // Optional. The 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. + string allocated_ip_range = 2 [(google.api.field_behavior) = OPTIONAL]; + } + // Configuration information for the secondary cluster. This should be set // if and only if the cluster is of type SECONDARY. message SecondaryConfig { @@ -481,6 +535,8 @@ message Cluster { DatabaseVersion database_version = 9 [(google.api.field_behavior) = OUTPUT_ONLY]; + NetworkConfig network_config = 29 [(google.api.field_behavior) = OPTIONAL]; + // 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 @@ -519,8 +575,8 @@ message Cluster { // documentation for the message type. AutomatedBackupPolicy automated_backup_policy = 17; - // SSL configuration for this AlloyDB Cluster. - SslConfig ssl_config = 18; + // SSL configuration for this AlloyDB cluster. + SslConfig ssl_config = 18 [deprecated = true]; // Optional. The encryption config can be specified to encrypt the data disks // and other persistent data resources of a cluster with a @@ -610,6 +666,25 @@ message Instance { int32 node_count = 1; } + // Policy to be used while updating the instance. + message UpdatePolicy { + // Specifies the available modes of update. + enum Mode { + // Mode is unknown. + MODE_UNSPECIFIED = 0; + + // Least disruptive way to apply the update. + DEFAULT = 1; + + // Performs a forced update when applicable. This will be fast but may + // incur a downtime. + FORCE_APPLY = 2; + } + + // Mode for updating the instance. + Mode mode = 1; + } + // Instance State enum State { // The state of the instance is unknown. @@ -667,10 +742,11 @@ message Instance { } // The Availability type of an instance. Potential values: + // // - ZONAL: The instance serves data from only one zone. Outages in that - // zone affect instance availability. + // zone affect instance availability. // - REGIONAL: The instance can serve data from more than one zone in a - // region (it is highly available). + // region (it is highly available). enum AvailabilityType { // This is an unknown Availability type. AVAILABILITY_TYPE_UNSPECIFIED = 0; @@ -726,8 +802,11 @@ message Instance { MachineConfig machine_config = 10; // Availability type of an Instance. - // Defaults to REGIONAL for both primary and read instances. - // Note that primary and read instances can have different availability types. + // 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). AvailabilityType availability_type = 11; // The Compute Engine zone that the instance should serve from, per @@ -786,6 +865,12 @@ message Instance { // This is distinct from labels. // https://google.aip.dev/128 map annotations = 18; + + // 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. + UpdatePolicy update_policy = 22; } // ConnectionInfo singleton resource. @@ -808,7 +893,7 @@ message ConnectionInfo { // 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. repeated string pem_certificate_chain = 3 - [(google.api.field_behavior) = OUTPUT_ONLY]; + [deprecated = true, (google.api.field_behavior) = OUTPUT_ONLY]; // Output only. The unique ID of the Instance. string instance_uid = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; @@ -905,7 +990,7 @@ message Backup { string cluster_uid = 18 [(google.api.field_behavior) = OUTPUT_ONLY]; // Required. The full resource name of the backup source cluster - // (e.g., projects//locations//clusters/). + // (e.g., projects/{project}/locations/{region}/clusters/{cluster_id}). string cluster_name = 10 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { type: "alloydb.googleapis.com/Cluster" } @@ -1026,3 +1111,39 @@ message SupportedDatabaseFlag { // availability SLO's). bool requires_db_restart = 6; } + +// Message describing User object. +message User { + option (google.api.resource) = { + type: "alloydb.googleapis.com/User" + pattern: "projects/{project}/locations/{location}/clusters/{cluster}/users/{user}" + style: DECLARATIVE_FRIENDLY + }; + + // Enum that details the user type. + enum UserType { + // Unspecified user type. + USER_TYPE_UNSPECIFIED = 0; + + // The default user type that authenticates via password-based + // authentication. + ALLOYDB_BUILT_IN = 1; + + // Database user that can authenticate via IAM-Based authentication. + ALLOYDB_IAM_USER = 2; + } + + // Output only. Name of the resource in the form of + // projects/{project}/locations/{location}/cluster/{cluster}/users/{user}. + string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Input only. Password for the user. + string password = 2 [(google.api.field_behavior) = INPUT_ONLY]; + + // Optional. List of database roles this user has. + // The database role strings are subject to the PostgreSQL naming conventions. + repeated string database_roles = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Type of this user. + UserType user_type = 5 [(google.api.field_behavior) = OPTIONAL]; +} diff --git a/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/proto/google/cloud/alloydb/v1beta/service.proto b/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/proto/google/cloud/alloydb/v1beta/service.proto index ff38b08c46b8..f262636186f4 100644 --- a/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/proto/google/cloud/alloydb/v1beta/service.proto +++ b/java-alloydb/proto-google-cloud-alloydb-v1beta/src/main/proto/google/cloud/alloydb/v1beta/service.proto @@ -1,4 +1,4 @@ -// Copyright 2022 Google LLC +// Copyright 2023 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -255,6 +255,20 @@ service AlloyDBAdmin { }; } + // Injects fault in an instance. + // Imperative only. + rpc InjectFault(InjectFaultRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1beta/{name=projects/*/locations/*/clusters/*/instances/*}:injectFault" + body: "*" + }; + option (google.api.method_signature) = "fault_type,name"; + option (google.longrunning.operation_info) = { + response_type: "Instance" + metadata_type: "OperationMetadata" + }; + } + // Restart an Instance in a cluster. // Imperative only. rpc RestartInstance(RestartInstanceRequest) @@ -354,6 +368,48 @@ service AlloyDBAdmin { }; option (google.api.method_signature) = "parent"; } + + // Lists Users in a given project and location. + rpc ListUsers(ListUsersRequest) returns (ListUsersResponse) { + option (google.api.http) = { + get: "/v1beta/{parent=projects/*/locations/*/clusters/*}/users" + }; + option (google.api.method_signature) = "parent"; + } + + // Gets details of a single User. + rpc GetUser(GetUserRequest) returns (User) { + option (google.api.http) = { + get: "/v1beta/{name=projects/*/locations/*/clusters/*/users/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Creates a new User in a given project, location, and cluster. + rpc CreateUser(CreateUserRequest) returns (User) { + option (google.api.http) = { + post: "/v1beta/{parent=projects/*/locations/*/clusters/*}/users" + body: "user" + }; + option (google.api.method_signature) = "parent,user,user_id"; + } + + // Updates the parameters of a single User. + rpc UpdateUser(UpdateUserRequest) returns (User) { + option (google.api.http) = { + patch: "/v1beta/{user.name=projects/*/locations/*/clusters/*/users/*}" + body: "user" + }; + option (google.api.method_signature) = "user,update_mask"; + } + + // Deletes a single User. + rpc DeleteUser(DeleteUserRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v1beta/{name=projects/*/locations/*/clusters/*/users/*}" + }; + option (google.api.method_signature) = "name"; + } } // Message for requesting list of Clusters @@ -403,11 +459,15 @@ message GetClusterRequest { (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { type: "alloydb.googleapis.com/Cluster" } ]; + + // Optional. The view of the cluster to return. Returns all default fields if + // not set. + ClusterView view = 2 [(google.api.field_behavior) = OPTIONAL]; } message CreateSecondaryClusterRequest { - // Required. The name of the parent resource (the primary cluster). For the - // required format, see the comment on the Cluster.name field. + // Required. The location of the new cluster. For the required + // format, see the comment on the Cluster.name field. string parent = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { @@ -444,7 +504,7 @@ message CreateSecondaryClusterRequest { // Message for creating a Cluster message CreateClusterRequest { - // Required. The name of the parent resource. For the required format, see the + // Required. The location of the new cluster. For the required format, see the // comment on the Cluster.name field. string parent = 1 [ (google.api.field_behavior) = REQUIRED, @@ -815,6 +875,7 @@ message BatchCreateInstancesResponse { } // Message for metadata that is specific to BatchCreateInstances API. +// NEXT_ID: 3 message BatchCreateInstancesMetadata { // 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 @@ -842,6 +903,7 @@ message BatchCreateInstancesMetadata { // 2. Instance2 = ROLLED_BACK // 3. Instance3 = FAILED // 4. Instance4 = FAILED +// // However, while the operation is running, the instance might be in other // states including PENDING_CREATE, ACTIVE, DELETING and CREATING. The states // / do not get further updated once the operation is done. @@ -1001,6 +1063,51 @@ message FailoverInstanceRequest { bool validate_only = 3 [(google.api.field_behavior) = OPTIONAL]; } +// Message for triggering fault injection on an instance +message InjectFaultRequest { + // FaultType contains all valid types of faults that can be injected to an + // instance. + enum FaultType { + // The fault type is unknown. + FAULT_TYPE_UNSPECIFIED = 0; + + // Stop the VM + STOP_VM = 1; + } + + // Required. The type of fault to be injected in an instance. + FaultType fault_type = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The name of the resource. For the required format, see the + // comment on the Instance.name field. + string name = 2 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "alloydb.googleapis.com/Instance" + } + ]; + + // Optional. An optional request ID to identify requests. Specify a unique + // request ID so that if you must retry your request, the server will know to + // ignore the request if it has already been completed. The server will + // guarantee that for at least 60 minutes after the first request. + // + // For example, consider a situation where you make an initial request and + // the request times out. If you make the request again with the same request + // ID, the server can check if original operation with the same request ID + // was received, and if so, will ignore the second request. This prevents + // clients from accidentally creating duplicate commitments. + // + // The request ID must be a valid UUID with the exception that zero UUID is + // not supported (00000000-0000-0000-0000-000000000000). + string request_id = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If set, performs request validation (e.g. permission checks and + // any other type of validation), but do not actually execute the fault + // injection. + bool validate_only = 4 [(google.api.field_behavior) = OPTIONAL]; +} + message RestartInstanceRequest { // Required. The name of the resource. For the required format, see the // comment on the Instance.name field. @@ -1242,7 +1349,8 @@ message GenerateClientCertificateRequest { string request_id = 2 [(google.api.field_behavior) = OPTIONAL]; // Optional. A pem-encoded X.509 certificate signing request (CSR). - string pem_csr = 3 [(google.api.field_behavior) = OPTIONAL]; + string pem_csr = 3 + [deprecated = true, (google.api.field_behavior) = OPTIONAL]; // Optional. An optional hint to the endpoint to generate the client // certificate with the requested duration. The duration can be from 1 hour to @@ -1251,6 +1359,9 @@ message GenerateClientCertificateRequest { // default duration. google.protobuf.Duration cert_duration = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The public key from the client. + string public_key = 5 [(google.api.field_behavior) = OPTIONAL]; } // Message returned by a GenerateClientCertificate operation. @@ -1262,6 +1373,9 @@ message GenerateClientCertificateResponse { // certificate. Expected to be in issuer-to-root order according to RFC 5246. repeated string pem_certificate_chain = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. The pem-encoded cluster ca X.509 certificate. + string ca_cert = 3 [(google.api.field_behavior) = OPTIONAL]; } // Request message for GetConnectionInfo. @@ -1327,3 +1441,150 @@ message OperationMetadata { // Output only. API version used to start the operation. string api_version = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; } + +// Message for requesting list of Users +message ListUsersRequest { + // Required. Parent value for ListUsersRequest + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "alloydb.googleapis.com/User" + } + ]; + + // Optional. Requested page size. Server may return fewer items than + // requested. If unspecified, server will pick an appropriate default. + int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A token identifying a page of results the server should return. + string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Filtering results + string filter = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Hint for how to order the results + string order_by = 5 [(google.api.field_behavior) = OPTIONAL]; +} + +// Message for response to listing Users +message ListUsersResponse { + // The list of User + repeated User users = 1; + + // A token identifying a page of results the server should return. + string next_page_token = 2; + + // Locations that could not be reached. + repeated string unreachable = 3; +} + +// Message for getting a User +message GetUserRequest { + // Required. The name of the resource. For the required format, see the + // comment on the User.name field. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "alloydb.googleapis.com/User" } + ]; +} + +// Message for creating a User +message CreateUserRequest { + // Required. Value for parent. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "alloydb.googleapis.com/User" + } + ]; + + // Required. ID of the requesting object. + string user_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The resource being created + User user = 3 [(google.api.field_behavior) = REQUIRED]; + + // Optional. An optional request ID to identify requests. Specify a unique + // request ID so that if you must retry your request, the server will know to + // ignore the request if it has already been completed. The server will + // guarantee that for at least 60 minutes since the first request. + // + // For example, consider a situation where you make an initial request and + // the request times out. If you make the request again with the same request + // ID, the server can check if original operation with the same request ID + // was received, and if so, will ignore the second request. This prevents + // clients from accidentally creating duplicate commitments. + // + // The request ID must be a valid UUID with the exception that zero UUID is + // not supported (00000000-0000-0000-0000-000000000000). + string request_id = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If set, the backend validates the request, but doesn't actually + // execute it. + bool validate_only = 5 [(google.api.field_behavior) = OPTIONAL]; +} + +// Message for updating a User +message UpdateUserRequest { + // 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. + google.protobuf.FieldMask update_mask = 1 + [(google.api.field_behavior) = OPTIONAL]; + + // Required. The resource being updated + User user = 2 [(google.api.field_behavior) = REQUIRED]; + + // Optional. An optional request ID to identify requests. Specify a unique + // request ID so that if you must retry your request, the server will know to + // ignore the request if it has already been completed. The server will + // guarantee that for at least 60 minutes since the first request. + // + // For example, consider a situation where you make an initial request and + // the request times out. If you make the request again with the same request + // ID, the server can check if original operation with the same request ID + // was received, and if so, will ignore the second request. This prevents + // clients from accidentally creating duplicate commitments. + // + // The request ID must be a valid UUID with the exception that zero UUID is + // not supported (00000000-0000-0000-0000-000000000000). + string request_id = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If set, the backend validates the request, but doesn't actually + // execute it. + bool validate_only = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Allow missing fields in the update mask. + bool allow_missing = 5 [(google.api.field_behavior) = OPTIONAL]; +} + +// Message for deleting a User +message DeleteUserRequest { + // Required. The name of the resource. For the required format, see the + // comment on the User.name field. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "alloydb.googleapis.com/User" } + ]; + + // Optional. An optional request ID to identify requests. Specify a unique + // request ID so that if you must retry your request, the server will know to + // ignore the request if it has already been completed. The server will + // guarantee that for at least 60 minutes after the first request. + // + // For example, consider a situation where you make an initial request and + // the request times out. If you make the request again with the same request + // ID, the server can check if original operation with the same request ID + // was received, and if so, will ignore the second request. This prevents + // clients from accidentally creating duplicate commitments. + // + // The request ID must be a valid UUID with the exception that zero UUID is + // not supported (00000000-0000-0000-0000-000000000000). + string request_id = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If set, the backend validates the request, but doesn't actually + // execute it. + bool validate_only = 3 [(google.api.field_behavior) = OPTIONAL]; +} diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/createsecondarycluster/AsyncCreateSecondaryCluster.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/createsecondarycluster/AsyncCreateSecondaryCluster.java new file mode 100644 index 000000000000..5e13a9691cd4 --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/createsecondarycluster/AsyncCreateSecondaryCluster.java @@ -0,0 +1,55 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.alloydb.v1.samples; + +// [START alloydb_v1_generated_AlloyDBAdmin_CreateSecondaryCluster_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.alloydb.v1.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1.Cluster; +import com.google.cloud.alloydb.v1.CreateSecondaryClusterRequest; +import com.google.cloud.alloydb.v1.LocationName; +import com.google.longrunning.Operation; + +public class AsyncCreateSecondaryCluster { + + public static void main(String[] args) throws Exception { + asyncCreateSecondaryCluster(); + } + + public static void asyncCreateSecondaryCluster() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + CreateSecondaryClusterRequest request = + CreateSecondaryClusterRequest.newBuilder() + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .setClusterId("clusterId561939637") + .setCluster(Cluster.newBuilder().build()) + .setRequestId("requestId693933066") + .setValidateOnly(true) + .build(); + ApiFuture future = + alloyDBAdminClient.createSecondaryClusterCallable().futureCall(request); + // Do something. + Operation response = future.get(); + } + } +} +// [END alloydb_v1_generated_AlloyDBAdmin_CreateSecondaryCluster_async] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/createsecondarycluster/AsyncCreateSecondaryClusterLRO.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/createsecondarycluster/AsyncCreateSecondaryClusterLRO.java new file mode 100644 index 000000000000..40c9186b4373 --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/createsecondarycluster/AsyncCreateSecondaryClusterLRO.java @@ -0,0 +1,55 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.alloydb.v1.samples; + +// [START alloydb_v1_generated_AlloyDBAdmin_CreateSecondaryCluster_LRO_async] +import com.google.api.gax.longrunning.OperationFuture; +import com.google.cloud.alloydb.v1.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1.Cluster; +import com.google.cloud.alloydb.v1.CreateSecondaryClusterRequest; +import com.google.cloud.alloydb.v1.LocationName; +import com.google.cloud.alloydb.v1.OperationMetadata; + +public class AsyncCreateSecondaryClusterLRO { + + public static void main(String[] args) throws Exception { + asyncCreateSecondaryClusterLRO(); + } + + public static void asyncCreateSecondaryClusterLRO() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + CreateSecondaryClusterRequest request = + CreateSecondaryClusterRequest.newBuilder() + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .setClusterId("clusterId561939637") + .setCluster(Cluster.newBuilder().build()) + .setRequestId("requestId693933066") + .setValidateOnly(true) + .build(); + OperationFuture future = + alloyDBAdminClient.createSecondaryClusterOperationCallable().futureCall(request); + // Do something. + Cluster response = future.get(); + } + } +} +// [END alloydb_v1_generated_AlloyDBAdmin_CreateSecondaryCluster_LRO_async] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/createsecondarycluster/SyncCreateSecondaryCluster.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/createsecondarycluster/SyncCreateSecondaryCluster.java new file mode 100644 index 000000000000..d24343c48f94 --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/createsecondarycluster/SyncCreateSecondaryCluster.java @@ -0,0 +1,50 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.alloydb.v1.samples; + +// [START alloydb_v1_generated_AlloyDBAdmin_CreateSecondaryCluster_sync] +import com.google.cloud.alloydb.v1.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1.Cluster; +import com.google.cloud.alloydb.v1.CreateSecondaryClusterRequest; +import com.google.cloud.alloydb.v1.LocationName; + +public class SyncCreateSecondaryCluster { + + public static void main(String[] args) throws Exception { + syncCreateSecondaryCluster(); + } + + public static void syncCreateSecondaryCluster() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + CreateSecondaryClusterRequest request = + CreateSecondaryClusterRequest.newBuilder() + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .setClusterId("clusterId561939637") + .setCluster(Cluster.newBuilder().build()) + .setRequestId("requestId693933066") + .setValidateOnly(true) + .build(); + Cluster response = alloyDBAdminClient.createSecondaryClusterAsync(request).get(); + } + } +} +// [END alloydb_v1_generated_AlloyDBAdmin_CreateSecondaryCluster_sync] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/createsecondarycluster/SyncCreateSecondaryClusterLocationnameClusterString.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/createsecondarycluster/SyncCreateSecondaryClusterLocationnameClusterString.java new file mode 100644 index 000000000000..5cc25e91d531 --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/createsecondarycluster/SyncCreateSecondaryClusterLocationnameClusterString.java @@ -0,0 +1,45 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.alloydb.v1.samples; + +// [START alloydb_v1_generated_AlloyDBAdmin_CreateSecondaryCluster_LocationnameClusterString_sync] +import com.google.cloud.alloydb.v1.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1.Cluster; +import com.google.cloud.alloydb.v1.LocationName; + +public class SyncCreateSecondaryClusterLocationnameClusterString { + + public static void main(String[] args) throws Exception { + syncCreateSecondaryClusterLocationnameClusterString(); + } + + public static void syncCreateSecondaryClusterLocationnameClusterString() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + Cluster cluster = Cluster.newBuilder().build(); + String clusterId = "clusterId561939637"; + Cluster response = + alloyDBAdminClient.createSecondaryClusterAsync(parent, cluster, clusterId).get(); + } + } +} +// [END alloydb_v1_generated_AlloyDBAdmin_CreateSecondaryCluster_LocationnameClusterString_sync] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/createsecondarycluster/SyncCreateSecondaryClusterStringClusterString.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/createsecondarycluster/SyncCreateSecondaryClusterStringClusterString.java new file mode 100644 index 000000000000..51e372be26d9 --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/createsecondarycluster/SyncCreateSecondaryClusterStringClusterString.java @@ -0,0 +1,45 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.alloydb.v1.samples; + +// [START alloydb_v1_generated_AlloyDBAdmin_CreateSecondaryCluster_StringClusterString_sync] +import com.google.cloud.alloydb.v1.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1.Cluster; +import com.google.cloud.alloydb.v1.LocationName; + +public class SyncCreateSecondaryClusterStringClusterString { + + public static void main(String[] args) throws Exception { + syncCreateSecondaryClusterStringClusterString(); + } + + public static void syncCreateSecondaryClusterStringClusterString() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString(); + Cluster cluster = Cluster.newBuilder().build(); + String clusterId = "clusterId561939637"; + Cluster response = + alloyDBAdminClient.createSecondaryClusterAsync(parent, cluster, clusterId).get(); + } + } +} +// [END alloydb_v1_generated_AlloyDBAdmin_CreateSecondaryCluster_StringClusterString_sync] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/createsecondaryinstance/AsyncCreateSecondaryInstance.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/createsecondaryinstance/AsyncCreateSecondaryInstance.java new file mode 100644 index 000000000000..dc9b0db70478 --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/createsecondaryinstance/AsyncCreateSecondaryInstance.java @@ -0,0 +1,55 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.alloydb.v1.samples; + +// [START alloydb_v1_generated_AlloyDBAdmin_CreateSecondaryInstance_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.alloydb.v1.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1.ClusterName; +import com.google.cloud.alloydb.v1.CreateSecondaryInstanceRequest; +import com.google.cloud.alloydb.v1.Instance; +import com.google.longrunning.Operation; + +public class AsyncCreateSecondaryInstance { + + public static void main(String[] args) throws Exception { + asyncCreateSecondaryInstance(); + } + + public static void asyncCreateSecondaryInstance() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + CreateSecondaryInstanceRequest request = + CreateSecondaryInstanceRequest.newBuilder() + .setParent(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString()) + .setInstanceId("instanceId902024336") + .setInstance(Instance.newBuilder().build()) + .setRequestId("requestId693933066") + .setValidateOnly(true) + .build(); + ApiFuture future = + alloyDBAdminClient.createSecondaryInstanceCallable().futureCall(request); + // Do something. + Operation response = future.get(); + } + } +} +// [END alloydb_v1_generated_AlloyDBAdmin_CreateSecondaryInstance_async] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/createsecondaryinstance/AsyncCreateSecondaryInstanceLRO.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/createsecondaryinstance/AsyncCreateSecondaryInstanceLRO.java new file mode 100644 index 000000000000..aab38cb66c98 --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/createsecondaryinstance/AsyncCreateSecondaryInstanceLRO.java @@ -0,0 +1,55 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.alloydb.v1.samples; + +// [START alloydb_v1_generated_AlloyDBAdmin_CreateSecondaryInstance_LRO_async] +import com.google.api.gax.longrunning.OperationFuture; +import com.google.cloud.alloydb.v1.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1.ClusterName; +import com.google.cloud.alloydb.v1.CreateSecondaryInstanceRequest; +import com.google.cloud.alloydb.v1.Instance; +import com.google.cloud.alloydb.v1.OperationMetadata; + +public class AsyncCreateSecondaryInstanceLRO { + + public static void main(String[] args) throws Exception { + asyncCreateSecondaryInstanceLRO(); + } + + public static void asyncCreateSecondaryInstanceLRO() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + CreateSecondaryInstanceRequest request = + CreateSecondaryInstanceRequest.newBuilder() + .setParent(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString()) + .setInstanceId("instanceId902024336") + .setInstance(Instance.newBuilder().build()) + .setRequestId("requestId693933066") + .setValidateOnly(true) + .build(); + OperationFuture future = + alloyDBAdminClient.createSecondaryInstanceOperationCallable().futureCall(request); + // Do something. + Instance response = future.get(); + } + } +} +// [END alloydb_v1_generated_AlloyDBAdmin_CreateSecondaryInstance_LRO_async] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/createsecondaryinstance/SyncCreateSecondaryInstance.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/createsecondaryinstance/SyncCreateSecondaryInstance.java new file mode 100644 index 000000000000..30c9783fcfc4 --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/createsecondaryinstance/SyncCreateSecondaryInstance.java @@ -0,0 +1,50 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.alloydb.v1.samples; + +// [START alloydb_v1_generated_AlloyDBAdmin_CreateSecondaryInstance_sync] +import com.google.cloud.alloydb.v1.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1.ClusterName; +import com.google.cloud.alloydb.v1.CreateSecondaryInstanceRequest; +import com.google.cloud.alloydb.v1.Instance; + +public class SyncCreateSecondaryInstance { + + public static void main(String[] args) throws Exception { + syncCreateSecondaryInstance(); + } + + public static void syncCreateSecondaryInstance() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + CreateSecondaryInstanceRequest request = + CreateSecondaryInstanceRequest.newBuilder() + .setParent(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString()) + .setInstanceId("instanceId902024336") + .setInstance(Instance.newBuilder().build()) + .setRequestId("requestId693933066") + .setValidateOnly(true) + .build(); + Instance response = alloyDBAdminClient.createSecondaryInstanceAsync(request).get(); + } + } +} +// [END alloydb_v1_generated_AlloyDBAdmin_CreateSecondaryInstance_sync] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/createsecondaryinstance/SyncCreateSecondaryInstanceClusternameInstanceString.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/createsecondaryinstance/SyncCreateSecondaryInstanceClusternameInstanceString.java new file mode 100644 index 000000000000..68e5a70fa6d5 --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/createsecondaryinstance/SyncCreateSecondaryInstanceClusternameInstanceString.java @@ -0,0 +1,45 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.alloydb.v1.samples; + +// [START alloydb_v1_generated_AlloyDBAdmin_CreateSecondaryInstance_ClusternameInstanceString_sync] +import com.google.cloud.alloydb.v1.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1.ClusterName; +import com.google.cloud.alloydb.v1.Instance; + +public class SyncCreateSecondaryInstanceClusternameInstanceString { + + public static void main(String[] args) throws Exception { + syncCreateSecondaryInstanceClusternameInstanceString(); + } + + public static void syncCreateSecondaryInstanceClusternameInstanceString() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + ClusterName parent = ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]"); + Instance instance = Instance.newBuilder().build(); + String instanceId = "instanceId902024336"; + Instance response = + alloyDBAdminClient.createSecondaryInstanceAsync(parent, instance, instanceId).get(); + } + } +} +// [END alloydb_v1_generated_AlloyDBAdmin_CreateSecondaryInstance_ClusternameInstanceString_sync] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/createsecondaryinstance/SyncCreateSecondaryInstanceStringInstanceString.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/createsecondaryinstance/SyncCreateSecondaryInstanceStringInstanceString.java new file mode 100644 index 000000000000..8d88b2badbc0 --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/createsecondaryinstance/SyncCreateSecondaryInstanceStringInstanceString.java @@ -0,0 +1,45 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.alloydb.v1.samples; + +// [START alloydb_v1_generated_AlloyDBAdmin_CreateSecondaryInstance_StringInstanceString_sync] +import com.google.cloud.alloydb.v1.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1.ClusterName; +import com.google.cloud.alloydb.v1.Instance; + +public class SyncCreateSecondaryInstanceStringInstanceString { + + public static void main(String[] args) throws Exception { + syncCreateSecondaryInstanceStringInstanceString(); + } + + public static void syncCreateSecondaryInstanceStringInstanceString() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + String parent = ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString(); + Instance instance = Instance.newBuilder().build(); + String instanceId = "instanceId902024336"; + Instance response = + alloyDBAdminClient.createSecondaryInstanceAsync(parent, instance, instanceId).get(); + } + } +} +// [END alloydb_v1_generated_AlloyDBAdmin_CreateSecondaryInstance_StringInstanceString_sync] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/createuser/AsyncCreateUser.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/createuser/AsyncCreateUser.java new file mode 100644 index 000000000000..eaddbd9a57c0 --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/createuser/AsyncCreateUser.java @@ -0,0 +1,53 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.alloydb.v1.samples; + +// [START alloydb_v1_generated_AlloyDBAdmin_CreateUser_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.alloydb.v1.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1.ClusterName; +import com.google.cloud.alloydb.v1.CreateUserRequest; +import com.google.cloud.alloydb.v1.User; + +public class AsyncCreateUser { + + public static void main(String[] args) throws Exception { + asyncCreateUser(); + } + + public static void asyncCreateUser() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + CreateUserRequest request = + CreateUserRequest.newBuilder() + .setParent(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString()) + .setUserId("userId-836030906") + .setUser(User.newBuilder().build()) + .setRequestId("requestId693933066") + .setValidateOnly(true) + .build(); + ApiFuture future = alloyDBAdminClient.createUserCallable().futureCall(request); + // Do something. + User response = future.get(); + } + } +} +// [END alloydb_v1_generated_AlloyDBAdmin_CreateUser_async] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/createuser/SyncCreateUser.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/createuser/SyncCreateUser.java new file mode 100644 index 000000000000..628d1f2f2b80 --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/createuser/SyncCreateUser.java @@ -0,0 +1,50 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.alloydb.v1.samples; + +// [START alloydb_v1_generated_AlloyDBAdmin_CreateUser_sync] +import com.google.cloud.alloydb.v1.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1.ClusterName; +import com.google.cloud.alloydb.v1.CreateUserRequest; +import com.google.cloud.alloydb.v1.User; + +public class SyncCreateUser { + + public static void main(String[] args) throws Exception { + syncCreateUser(); + } + + public static void syncCreateUser() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + CreateUserRequest request = + CreateUserRequest.newBuilder() + .setParent(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString()) + .setUserId("userId-836030906") + .setUser(User.newBuilder().build()) + .setRequestId("requestId693933066") + .setValidateOnly(true) + .build(); + User response = alloyDBAdminClient.createUser(request); + } + } +} +// [END alloydb_v1_generated_AlloyDBAdmin_CreateUser_sync] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/createuser/SyncCreateUserClusternameUserString.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/createuser/SyncCreateUserClusternameUserString.java new file mode 100644 index 000000000000..d5534e459c42 --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/createuser/SyncCreateUserClusternameUserString.java @@ -0,0 +1,44 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.alloydb.v1.samples; + +// [START alloydb_v1_generated_AlloyDBAdmin_CreateUser_ClusternameUserString_sync] +import com.google.cloud.alloydb.v1.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1.ClusterName; +import com.google.cloud.alloydb.v1.User; + +public class SyncCreateUserClusternameUserString { + + public static void main(String[] args) throws Exception { + syncCreateUserClusternameUserString(); + } + + public static void syncCreateUserClusternameUserString() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + ClusterName parent = ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]"); + User user = User.newBuilder().build(); + String userId = "userId-836030906"; + User response = alloyDBAdminClient.createUser(parent, user, userId); + } + } +} +// [END alloydb_v1_generated_AlloyDBAdmin_CreateUser_ClusternameUserString_sync] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/createuser/SyncCreateUserStringUserString.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/createuser/SyncCreateUserStringUserString.java new file mode 100644 index 000000000000..3bed6fc4cc7e --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/createuser/SyncCreateUserStringUserString.java @@ -0,0 +1,44 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.alloydb.v1.samples; + +// [START alloydb_v1_generated_AlloyDBAdmin_CreateUser_StringUserString_sync] +import com.google.cloud.alloydb.v1.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1.ClusterName; +import com.google.cloud.alloydb.v1.User; + +public class SyncCreateUserStringUserString { + + public static void main(String[] args) throws Exception { + syncCreateUserStringUserString(); + } + + public static void syncCreateUserStringUserString() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + String parent = ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString(); + User user = User.newBuilder().build(); + String userId = "userId-836030906"; + User response = alloyDBAdminClient.createUser(parent, user, userId); + } + } +} +// [END alloydb_v1_generated_AlloyDBAdmin_CreateUser_StringUserString_sync] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/deleteuser/AsyncDeleteUser.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/deleteuser/AsyncDeleteUser.java new file mode 100644 index 000000000000..2bbeef709a92 --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/deleteuser/AsyncDeleteUser.java @@ -0,0 +1,51 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.alloydb.v1.samples; + +// [START alloydb_v1_generated_AlloyDBAdmin_DeleteUser_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.alloydb.v1.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1.DeleteUserRequest; +import com.google.cloud.alloydb.v1.UserName; +import com.google.protobuf.Empty; + +public class AsyncDeleteUser { + + public static void main(String[] args) throws Exception { + asyncDeleteUser(); + } + + public static void asyncDeleteUser() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + DeleteUserRequest request = + DeleteUserRequest.newBuilder() + .setName(UserName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[USER]").toString()) + .setRequestId("requestId693933066") + .setValidateOnly(true) + .build(); + ApiFuture future = alloyDBAdminClient.deleteUserCallable().futureCall(request); + // Do something. + future.get(); + } + } +} +// [END alloydb_v1_generated_AlloyDBAdmin_DeleteUser_async] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/deleteuser/SyncDeleteUser.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/deleteuser/SyncDeleteUser.java new file mode 100644 index 000000000000..339b35b71e76 --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/deleteuser/SyncDeleteUser.java @@ -0,0 +1,48 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.alloydb.v1.samples; + +// [START alloydb_v1_generated_AlloyDBAdmin_DeleteUser_sync] +import com.google.cloud.alloydb.v1.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1.DeleteUserRequest; +import com.google.cloud.alloydb.v1.UserName; +import com.google.protobuf.Empty; + +public class SyncDeleteUser { + + public static void main(String[] args) throws Exception { + syncDeleteUser(); + } + + public static void syncDeleteUser() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + DeleteUserRequest request = + DeleteUserRequest.newBuilder() + .setName(UserName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[USER]").toString()) + .setRequestId("requestId693933066") + .setValidateOnly(true) + .build(); + alloyDBAdminClient.deleteUser(request); + } + } +} +// [END alloydb_v1_generated_AlloyDBAdmin_DeleteUser_sync] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/deleteuser/SyncDeleteUserString.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/deleteuser/SyncDeleteUserString.java new file mode 100644 index 000000000000..25bbe135b9ec --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/deleteuser/SyncDeleteUserString.java @@ -0,0 +1,42 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.alloydb.v1.samples; + +// [START alloydb_v1_generated_AlloyDBAdmin_DeleteUser_String_sync] +import com.google.cloud.alloydb.v1.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1.UserName; +import com.google.protobuf.Empty; + +public class SyncDeleteUserString { + + public static void main(String[] args) throws Exception { + syncDeleteUserString(); + } + + public static void syncDeleteUserString() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + String name = UserName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[USER]").toString(); + alloyDBAdminClient.deleteUser(name); + } + } +} +// [END alloydb_v1_generated_AlloyDBAdmin_DeleteUser_String_sync] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/deleteuser/SyncDeleteUserUsername.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/deleteuser/SyncDeleteUserUsername.java new file mode 100644 index 000000000000..c4d8c7052deb --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/deleteuser/SyncDeleteUserUsername.java @@ -0,0 +1,42 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.alloydb.v1.samples; + +// [START alloydb_v1_generated_AlloyDBAdmin_DeleteUser_Username_sync] +import com.google.cloud.alloydb.v1.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1.UserName; +import com.google.protobuf.Empty; + +public class SyncDeleteUserUsername { + + public static void main(String[] args) throws Exception { + syncDeleteUserUsername(); + } + + public static void syncDeleteUserUsername() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + UserName name = UserName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[USER]"); + alloyDBAdminClient.deleteUser(name); + } + } +} +// [END alloydb_v1_generated_AlloyDBAdmin_DeleteUser_Username_sync] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/getcluster/AsyncGetCluster.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/getcluster/AsyncGetCluster.java index 4008d7fad048..d2f48a6055de 100644 --- a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/getcluster/AsyncGetCluster.java +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/getcluster/AsyncGetCluster.java @@ -21,6 +21,7 @@ import com.google.cloud.alloydb.v1.AlloyDBAdminClient; import com.google.cloud.alloydb.v1.Cluster; import com.google.cloud.alloydb.v1.ClusterName; +import com.google.cloud.alloydb.v1.ClusterView; import com.google.cloud.alloydb.v1.GetClusterRequest; public class AsyncGetCluster { @@ -39,6 +40,7 @@ public static void asyncGetCluster() throws Exception { GetClusterRequest request = GetClusterRequest.newBuilder() .setName(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString()) + .setView(ClusterView.forNumber(0)) .build(); ApiFuture future = alloyDBAdminClient.getClusterCallable().futureCall(request); // Do something. diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/getcluster/SyncGetCluster.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/getcluster/SyncGetCluster.java index e91fe19311ff..349ee80a827a 100644 --- a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/getcluster/SyncGetCluster.java +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/getcluster/SyncGetCluster.java @@ -20,6 +20,7 @@ import com.google.cloud.alloydb.v1.AlloyDBAdminClient; import com.google.cloud.alloydb.v1.Cluster; import com.google.cloud.alloydb.v1.ClusterName; +import com.google.cloud.alloydb.v1.ClusterView; import com.google.cloud.alloydb.v1.GetClusterRequest; public class SyncGetCluster { @@ -38,6 +39,7 @@ public static void syncGetCluster() throws Exception { GetClusterRequest request = GetClusterRequest.newBuilder() .setName(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString()) + .setView(ClusterView.forNumber(0)) .build(); Cluster response = alloyDBAdminClient.getCluster(request); } diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/getuser/AsyncGetUser.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/getuser/AsyncGetUser.java new file mode 100644 index 000000000000..b317c099f280 --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/getuser/AsyncGetUser.java @@ -0,0 +1,49 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.alloydb.v1.samples; + +// [START alloydb_v1_generated_AlloyDBAdmin_GetUser_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.alloydb.v1.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1.GetUserRequest; +import com.google.cloud.alloydb.v1.User; +import com.google.cloud.alloydb.v1.UserName; + +public class AsyncGetUser { + + public static void main(String[] args) throws Exception { + asyncGetUser(); + } + + public static void asyncGetUser() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + GetUserRequest request = + GetUserRequest.newBuilder() + .setName(UserName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[USER]").toString()) + .build(); + ApiFuture future = alloyDBAdminClient.getUserCallable().futureCall(request); + // Do something. + User response = future.get(); + } + } +} +// [END alloydb_v1_generated_AlloyDBAdmin_GetUser_async] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/getuser/SyncGetUser.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/getuser/SyncGetUser.java new file mode 100644 index 000000000000..3fd545c81091 --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/getuser/SyncGetUser.java @@ -0,0 +1,46 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.alloydb.v1.samples; + +// [START alloydb_v1_generated_AlloyDBAdmin_GetUser_sync] +import com.google.cloud.alloydb.v1.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1.GetUserRequest; +import com.google.cloud.alloydb.v1.User; +import com.google.cloud.alloydb.v1.UserName; + +public class SyncGetUser { + + public static void main(String[] args) throws Exception { + syncGetUser(); + } + + public static void syncGetUser() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + GetUserRequest request = + GetUserRequest.newBuilder() + .setName(UserName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[USER]").toString()) + .build(); + User response = alloyDBAdminClient.getUser(request); + } + } +} +// [END alloydb_v1_generated_AlloyDBAdmin_GetUser_sync] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/getuser/SyncGetUserString.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/getuser/SyncGetUserString.java new file mode 100644 index 000000000000..92d53d2fb70c --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/getuser/SyncGetUserString.java @@ -0,0 +1,42 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.alloydb.v1.samples; + +// [START alloydb_v1_generated_AlloyDBAdmin_GetUser_String_sync] +import com.google.cloud.alloydb.v1.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1.User; +import com.google.cloud.alloydb.v1.UserName; + +public class SyncGetUserString { + + public static void main(String[] args) throws Exception { + syncGetUserString(); + } + + public static void syncGetUserString() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + String name = UserName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[USER]").toString(); + User response = alloyDBAdminClient.getUser(name); + } + } +} +// [END alloydb_v1_generated_AlloyDBAdmin_GetUser_String_sync] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/getuser/SyncGetUserUsername.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/getuser/SyncGetUserUsername.java new file mode 100644 index 000000000000..59955d735aeb --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/getuser/SyncGetUserUsername.java @@ -0,0 +1,42 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.alloydb.v1.samples; + +// [START alloydb_v1_generated_AlloyDBAdmin_GetUser_Username_sync] +import com.google.cloud.alloydb.v1.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1.User; +import com.google.cloud.alloydb.v1.UserName; + +public class SyncGetUserUsername { + + public static void main(String[] args) throws Exception { + syncGetUserUsername(); + } + + public static void syncGetUserUsername() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + UserName name = UserName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[USER]"); + User response = alloyDBAdminClient.getUser(name); + } + } +} +// [END alloydb_v1_generated_AlloyDBAdmin_GetUser_Username_sync] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/injectfault/AsyncInjectFault.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/injectfault/AsyncInjectFault.java new file mode 100644 index 000000000000..1bdf67f2c537 --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/injectfault/AsyncInjectFault.java @@ -0,0 +1,52 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.alloydb.v1.samples; + +// [START alloydb_v1_generated_AlloyDBAdmin_InjectFault_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.alloydb.v1.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1.InjectFaultRequest; +import com.google.cloud.alloydb.v1.InstanceName; +import com.google.longrunning.Operation; + +public class AsyncInjectFault { + + public static void main(String[] args) throws Exception { + asyncInjectFault(); + } + + public static void asyncInjectFault() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + InjectFaultRequest request = + InjectFaultRequest.newBuilder() + .setName( + InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]").toString()) + .setRequestId("requestId693933066") + .setValidateOnly(true) + .build(); + ApiFuture future = alloyDBAdminClient.injectFaultCallable().futureCall(request); + // Do something. + Operation response = future.get(); + } + } +} +// [END alloydb_v1_generated_AlloyDBAdmin_InjectFault_async] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/injectfault/AsyncInjectFaultLRO.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/injectfault/AsyncInjectFaultLRO.java new file mode 100644 index 000000000000..832c2bc6e2e5 --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/injectfault/AsyncInjectFaultLRO.java @@ -0,0 +1,54 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.alloydb.v1.samples; + +// [START alloydb_v1_generated_AlloyDBAdmin_InjectFault_LRO_async] +import com.google.api.gax.longrunning.OperationFuture; +import com.google.cloud.alloydb.v1.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1.InjectFaultRequest; +import com.google.cloud.alloydb.v1.Instance; +import com.google.cloud.alloydb.v1.InstanceName; +import com.google.cloud.alloydb.v1.OperationMetadata; + +public class AsyncInjectFaultLRO { + + public static void main(String[] args) throws Exception { + asyncInjectFaultLRO(); + } + + public static void asyncInjectFaultLRO() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + InjectFaultRequest request = + InjectFaultRequest.newBuilder() + .setName( + InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]").toString()) + .setRequestId("requestId693933066") + .setValidateOnly(true) + .build(); + OperationFuture future = + alloyDBAdminClient.injectFaultOperationCallable().futureCall(request); + // Do something. + Instance response = future.get(); + } + } +} +// [END alloydb_v1_generated_AlloyDBAdmin_InjectFault_LRO_async] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/injectfault/SyncInjectFault.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/injectfault/SyncInjectFault.java new file mode 100644 index 000000000000..5ccca0f25793 --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/injectfault/SyncInjectFault.java @@ -0,0 +1,49 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.alloydb.v1.samples; + +// [START alloydb_v1_generated_AlloyDBAdmin_InjectFault_sync] +import com.google.cloud.alloydb.v1.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1.InjectFaultRequest; +import com.google.cloud.alloydb.v1.Instance; +import com.google.cloud.alloydb.v1.InstanceName; + +public class SyncInjectFault { + + public static void main(String[] args) throws Exception { + syncInjectFault(); + } + + public static void syncInjectFault() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + InjectFaultRequest request = + InjectFaultRequest.newBuilder() + .setName( + InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]").toString()) + .setRequestId("requestId693933066") + .setValidateOnly(true) + .build(); + Instance response = alloyDBAdminClient.injectFaultAsync(request).get(); + } + } +} +// [END alloydb_v1_generated_AlloyDBAdmin_InjectFault_sync] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/injectfault/SyncInjectFaultInjectfaultrequestfaulttypeInstancename.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/injectfault/SyncInjectFaultInjectfaultrequestfaulttypeInstancename.java new file mode 100644 index 000000000000..47952f77738f --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/injectfault/SyncInjectFaultInjectfaultrequestfaulttypeInstancename.java @@ -0,0 +1,44 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.alloydb.v1.samples; + +// [START alloydb_v1_generated_AlloyDBAdmin_InjectFault_InjectfaultrequestfaulttypeInstancename_sync] +import com.google.cloud.alloydb.v1.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1.InjectFaultRequest; +import com.google.cloud.alloydb.v1.Instance; +import com.google.cloud.alloydb.v1.InstanceName; + +public class SyncInjectFaultInjectfaultrequestfaulttypeInstancename { + + public static void main(String[] args) throws Exception { + syncInjectFaultInjectfaultrequestfaulttypeInstancename(); + } + + public static void syncInjectFaultInjectfaultrequestfaulttypeInstancename() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + InjectFaultRequest.FaultType faultType = InjectFaultRequest.FaultType.forNumber(0); + InstanceName name = InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]"); + Instance response = alloyDBAdminClient.injectFaultAsync(faultType, name).get(); + } + } +} +// [END alloydb_v1_generated_AlloyDBAdmin_InjectFault_InjectfaultrequestfaulttypeInstancename_sync] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/injectfault/SyncInjectFaultInjectfaultrequestfaulttypeString.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/injectfault/SyncInjectFaultInjectfaultrequestfaulttypeString.java new file mode 100644 index 000000000000..cf2e317cd184 --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/injectfault/SyncInjectFaultInjectfaultrequestfaulttypeString.java @@ -0,0 +1,45 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.alloydb.v1.samples; + +// [START alloydb_v1_generated_AlloyDBAdmin_InjectFault_InjectfaultrequestfaulttypeString_sync] +import com.google.cloud.alloydb.v1.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1.InjectFaultRequest; +import com.google.cloud.alloydb.v1.Instance; +import com.google.cloud.alloydb.v1.InstanceName; + +public class SyncInjectFaultInjectfaultrequestfaulttypeString { + + public static void main(String[] args) throws Exception { + syncInjectFaultInjectfaultrequestfaulttypeString(); + } + + public static void syncInjectFaultInjectfaultrequestfaulttypeString() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + InjectFaultRequest.FaultType faultType = InjectFaultRequest.FaultType.forNumber(0); + String name = + InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]").toString(); + Instance response = alloyDBAdminClient.injectFaultAsync(faultType, name).get(); + } + } +} +// [END alloydb_v1_generated_AlloyDBAdmin_InjectFault_InjectfaultrequestfaulttypeString_sync] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/listusers/AsyncListUsers.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/listusers/AsyncListUsers.java new file mode 100644 index 000000000000..f4e21145d2a8 --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/listusers/AsyncListUsers.java @@ -0,0 +1,55 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.alloydb.v1.samples; + +// [START alloydb_v1_generated_AlloyDBAdmin_ListUsers_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.alloydb.v1.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1.ClusterName; +import com.google.cloud.alloydb.v1.ListUsersRequest; +import com.google.cloud.alloydb.v1.User; + +public class AsyncListUsers { + + public static void main(String[] args) throws Exception { + asyncListUsers(); + } + + public static void asyncListUsers() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + ListUsersRequest request = + ListUsersRequest.newBuilder() + .setParent(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .setFilter("filter-1274492040") + .setOrderBy("orderBy-1207110587") + .build(); + ApiFuture future = alloyDBAdminClient.listUsersPagedCallable().futureCall(request); + // Do something. + for (User element : future.get().iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END alloydb_v1_generated_AlloyDBAdmin_ListUsers_async] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/listusers/AsyncListUsersPaged.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/listusers/AsyncListUsersPaged.java new file mode 100644 index 000000000000..3b8dfd8aaeee --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/listusers/AsyncListUsersPaged.java @@ -0,0 +1,63 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.alloydb.v1.samples; + +// [START alloydb_v1_generated_AlloyDBAdmin_ListUsers_Paged_async] +import com.google.cloud.alloydb.v1.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1.ClusterName; +import com.google.cloud.alloydb.v1.ListUsersRequest; +import com.google.cloud.alloydb.v1.ListUsersResponse; +import com.google.cloud.alloydb.v1.User; +import com.google.common.base.Strings; + +public class AsyncListUsersPaged { + + public static void main(String[] args) throws Exception { + asyncListUsersPaged(); + } + + public static void asyncListUsersPaged() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + ListUsersRequest request = + ListUsersRequest.newBuilder() + .setParent(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .setFilter("filter-1274492040") + .setOrderBy("orderBy-1207110587") + .build(); + while (true) { + ListUsersResponse response = alloyDBAdminClient.listUsersCallable().call(request); + for (User element : response.getUsersList()) { + // doThingsWith(element); + } + String nextPageToken = response.getNextPageToken(); + if (!Strings.isNullOrEmpty(nextPageToken)) { + request = request.toBuilder().setPageToken(nextPageToken).build(); + } else { + break; + } + } + } + } +} +// [END alloydb_v1_generated_AlloyDBAdmin_ListUsers_Paged_async] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/listusers/SyncListUsers.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/listusers/SyncListUsers.java new file mode 100644 index 000000000000..f36487d6e997 --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/listusers/SyncListUsers.java @@ -0,0 +1,52 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.alloydb.v1.samples; + +// [START alloydb_v1_generated_AlloyDBAdmin_ListUsers_sync] +import com.google.cloud.alloydb.v1.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1.ClusterName; +import com.google.cloud.alloydb.v1.ListUsersRequest; +import com.google.cloud.alloydb.v1.User; + +public class SyncListUsers { + + public static void main(String[] args) throws Exception { + syncListUsers(); + } + + public static void syncListUsers() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + ListUsersRequest request = + ListUsersRequest.newBuilder() + .setParent(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .setFilter("filter-1274492040") + .setOrderBy("orderBy-1207110587") + .build(); + for (User element : alloyDBAdminClient.listUsers(request).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END alloydb_v1_generated_AlloyDBAdmin_ListUsers_sync] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/listusers/SyncListUsersClustername.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/listusers/SyncListUsersClustername.java new file mode 100644 index 000000000000..95cdb37bf12b --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/listusers/SyncListUsersClustername.java @@ -0,0 +1,44 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.alloydb.v1.samples; + +// [START alloydb_v1_generated_AlloyDBAdmin_ListUsers_Clustername_sync] +import com.google.cloud.alloydb.v1.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1.ClusterName; +import com.google.cloud.alloydb.v1.User; + +public class SyncListUsersClustername { + + public static void main(String[] args) throws Exception { + syncListUsersClustername(); + } + + public static void syncListUsersClustername() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + ClusterName parent = ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]"); + for (User element : alloyDBAdminClient.listUsers(parent).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END alloydb_v1_generated_AlloyDBAdmin_ListUsers_Clustername_sync] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/listusers/SyncListUsersString.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/listusers/SyncListUsersString.java new file mode 100644 index 000000000000..019a5b700641 --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/listusers/SyncListUsersString.java @@ -0,0 +1,44 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.alloydb.v1.samples; + +// [START alloydb_v1_generated_AlloyDBAdmin_ListUsers_String_sync] +import com.google.cloud.alloydb.v1.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1.ClusterName; +import com.google.cloud.alloydb.v1.User; + +public class SyncListUsersString { + + public static void main(String[] args) throws Exception { + syncListUsersString(); + } + + public static void syncListUsersString() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + String parent = ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString(); + for (User element : alloyDBAdminClient.listUsers(parent).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END alloydb_v1_generated_AlloyDBAdmin_ListUsers_String_sync] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/promotecluster/AsyncPromoteCluster.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/promotecluster/AsyncPromoteCluster.java new file mode 100644 index 000000000000..3ccefa68bf1f --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/promotecluster/AsyncPromoteCluster.java @@ -0,0 +1,52 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.alloydb.v1.samples; + +// [START alloydb_v1_generated_AlloyDBAdmin_PromoteCluster_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.alloydb.v1.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1.ClusterName; +import com.google.cloud.alloydb.v1.PromoteClusterRequest; +import com.google.longrunning.Operation; + +public class AsyncPromoteCluster { + + public static void main(String[] args) throws Exception { + asyncPromoteCluster(); + } + + public static void asyncPromoteCluster() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + PromoteClusterRequest request = + PromoteClusterRequest.newBuilder() + .setName(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString()) + .setRequestId("requestId693933066") + .setEtag("etag3123477") + .setValidateOnly(true) + .build(); + ApiFuture future = alloyDBAdminClient.promoteClusterCallable().futureCall(request); + // Do something. + Operation response = future.get(); + } + } +} +// [END alloydb_v1_generated_AlloyDBAdmin_PromoteCluster_async] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/promotecluster/AsyncPromoteClusterLRO.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/promotecluster/AsyncPromoteClusterLRO.java new file mode 100644 index 000000000000..3c03eac2f512 --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/promotecluster/AsyncPromoteClusterLRO.java @@ -0,0 +1,54 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.alloydb.v1.samples; + +// [START alloydb_v1_generated_AlloyDBAdmin_PromoteCluster_LRO_async] +import com.google.api.gax.longrunning.OperationFuture; +import com.google.cloud.alloydb.v1.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1.Cluster; +import com.google.cloud.alloydb.v1.ClusterName; +import com.google.cloud.alloydb.v1.OperationMetadata; +import com.google.cloud.alloydb.v1.PromoteClusterRequest; + +public class AsyncPromoteClusterLRO { + + public static void main(String[] args) throws Exception { + asyncPromoteClusterLRO(); + } + + public static void asyncPromoteClusterLRO() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + PromoteClusterRequest request = + PromoteClusterRequest.newBuilder() + .setName(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString()) + .setRequestId("requestId693933066") + .setEtag("etag3123477") + .setValidateOnly(true) + .build(); + OperationFuture future = + alloyDBAdminClient.promoteClusterOperationCallable().futureCall(request); + // Do something. + Cluster response = future.get(); + } + } +} +// [END alloydb_v1_generated_AlloyDBAdmin_PromoteCluster_LRO_async] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/promotecluster/SyncPromoteCluster.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/promotecluster/SyncPromoteCluster.java new file mode 100644 index 000000000000..5bc457d463d9 --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/promotecluster/SyncPromoteCluster.java @@ -0,0 +1,49 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.alloydb.v1.samples; + +// [START alloydb_v1_generated_AlloyDBAdmin_PromoteCluster_sync] +import com.google.cloud.alloydb.v1.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1.Cluster; +import com.google.cloud.alloydb.v1.ClusterName; +import com.google.cloud.alloydb.v1.PromoteClusterRequest; + +public class SyncPromoteCluster { + + public static void main(String[] args) throws Exception { + syncPromoteCluster(); + } + + public static void syncPromoteCluster() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + PromoteClusterRequest request = + PromoteClusterRequest.newBuilder() + .setName(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString()) + .setRequestId("requestId693933066") + .setEtag("etag3123477") + .setValidateOnly(true) + .build(); + Cluster response = alloyDBAdminClient.promoteClusterAsync(request).get(); + } + } +} +// [END alloydb_v1_generated_AlloyDBAdmin_PromoteCluster_sync] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/promotecluster/SyncPromoteClusterClustername.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/promotecluster/SyncPromoteClusterClustername.java new file mode 100644 index 000000000000..8aa5d1a6da68 --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/promotecluster/SyncPromoteClusterClustername.java @@ -0,0 +1,42 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.alloydb.v1.samples; + +// [START alloydb_v1_generated_AlloyDBAdmin_PromoteCluster_Clustername_sync] +import com.google.cloud.alloydb.v1.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1.Cluster; +import com.google.cloud.alloydb.v1.ClusterName; + +public class SyncPromoteClusterClustername { + + public static void main(String[] args) throws Exception { + syncPromoteClusterClustername(); + } + + public static void syncPromoteClusterClustername() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + ClusterName name = ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]"); + Cluster response = alloyDBAdminClient.promoteClusterAsync(name).get(); + } + } +} +// [END alloydb_v1_generated_AlloyDBAdmin_PromoteCluster_Clustername_sync] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/promotecluster/SyncPromoteClusterString.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/promotecluster/SyncPromoteClusterString.java new file mode 100644 index 000000000000..b1da88e6e913 --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/promotecluster/SyncPromoteClusterString.java @@ -0,0 +1,42 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.alloydb.v1.samples; + +// [START alloydb_v1_generated_AlloyDBAdmin_PromoteCluster_String_sync] +import com.google.cloud.alloydb.v1.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1.Cluster; +import com.google.cloud.alloydb.v1.ClusterName; + +public class SyncPromoteClusterString { + + public static void main(String[] args) throws Exception { + syncPromoteClusterString(); + } + + public static void syncPromoteClusterString() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + String name = ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString(); + Cluster response = alloyDBAdminClient.promoteClusterAsync(name).get(); + } + } +} +// [END alloydb_v1_generated_AlloyDBAdmin_PromoteCluster_String_sync] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/updateuser/AsyncUpdateUser.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/updateuser/AsyncUpdateUser.java new file mode 100644 index 000000000000..af39752ce8f7 --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/updateuser/AsyncUpdateUser.java @@ -0,0 +1,53 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.alloydb.v1.samples; + +// [START alloydb_v1_generated_AlloyDBAdmin_UpdateUser_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.alloydb.v1.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1.UpdateUserRequest; +import com.google.cloud.alloydb.v1.User; +import com.google.protobuf.FieldMask; + +public class AsyncUpdateUser { + + public static void main(String[] args) throws Exception { + asyncUpdateUser(); + } + + public static void asyncUpdateUser() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + UpdateUserRequest request = + UpdateUserRequest.newBuilder() + .setUpdateMask(FieldMask.newBuilder().build()) + .setUser(User.newBuilder().build()) + .setRequestId("requestId693933066") + .setValidateOnly(true) + .setAllowMissing(true) + .build(); + ApiFuture future = alloyDBAdminClient.updateUserCallable().futureCall(request); + // Do something. + User response = future.get(); + } + } +} +// [END alloydb_v1_generated_AlloyDBAdmin_UpdateUser_async] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/updateuser/SyncUpdateUser.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/updateuser/SyncUpdateUser.java new file mode 100644 index 000000000000..03965e2cc5b5 --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/updateuser/SyncUpdateUser.java @@ -0,0 +1,50 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.alloydb.v1.samples; + +// [START alloydb_v1_generated_AlloyDBAdmin_UpdateUser_sync] +import com.google.cloud.alloydb.v1.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1.UpdateUserRequest; +import com.google.cloud.alloydb.v1.User; +import com.google.protobuf.FieldMask; + +public class SyncUpdateUser { + + public static void main(String[] args) throws Exception { + syncUpdateUser(); + } + + public static void syncUpdateUser() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + UpdateUserRequest request = + UpdateUserRequest.newBuilder() + .setUpdateMask(FieldMask.newBuilder().build()) + .setUser(User.newBuilder().build()) + .setRequestId("requestId693933066") + .setValidateOnly(true) + .setAllowMissing(true) + .build(); + User response = alloyDBAdminClient.updateUser(request); + } + } +} +// [END alloydb_v1_generated_AlloyDBAdmin_UpdateUser_sync] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/updateuser/SyncUpdateUserUserFieldmask.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/updateuser/SyncUpdateUserUserFieldmask.java new file mode 100644 index 000000000000..2ad0b5a4a83a --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1/alloydbadmin/updateuser/SyncUpdateUserUserFieldmask.java @@ -0,0 +1,43 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.alloydb.v1.samples; + +// [START alloydb_v1_generated_AlloyDBAdmin_UpdateUser_UserFieldmask_sync] +import com.google.cloud.alloydb.v1.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1.User; +import com.google.protobuf.FieldMask; + +public class SyncUpdateUserUserFieldmask { + + public static void main(String[] args) throws Exception { + syncUpdateUserUserFieldmask(); + } + + public static void syncUpdateUserUserFieldmask() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + User user = User.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + User response = alloyDBAdminClient.updateUser(user, updateMask); + } + } +} +// [END alloydb_v1_generated_AlloyDBAdmin_UpdateUser_UserFieldmask_sync] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/createuser/AsyncCreateUser.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/createuser/AsyncCreateUser.java new file mode 100644 index 000000000000..1eb0e179f869 --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/createuser/AsyncCreateUser.java @@ -0,0 +1,53 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.alloydb.v1alpha.samples; + +// [START alloydb_v1alpha_generated_AlloyDBAdmin_CreateUser_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.alloydb.v1alpha.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1alpha.ClusterName; +import com.google.cloud.alloydb.v1alpha.CreateUserRequest; +import com.google.cloud.alloydb.v1alpha.User; + +public class AsyncCreateUser { + + public static void main(String[] args) throws Exception { + asyncCreateUser(); + } + + public static void asyncCreateUser() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + CreateUserRequest request = + CreateUserRequest.newBuilder() + .setParent(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString()) + .setUserId("userId-836030906") + .setUser(User.newBuilder().build()) + .setRequestId("requestId693933066") + .setValidateOnly(true) + .build(); + ApiFuture future = alloyDBAdminClient.createUserCallable().futureCall(request); + // Do something. + User response = future.get(); + } + } +} +// [END alloydb_v1alpha_generated_AlloyDBAdmin_CreateUser_async] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/createuser/SyncCreateUser.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/createuser/SyncCreateUser.java new file mode 100644 index 000000000000..f6cd0878fccd --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/createuser/SyncCreateUser.java @@ -0,0 +1,50 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.alloydb.v1alpha.samples; + +// [START alloydb_v1alpha_generated_AlloyDBAdmin_CreateUser_sync] +import com.google.cloud.alloydb.v1alpha.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1alpha.ClusterName; +import com.google.cloud.alloydb.v1alpha.CreateUserRequest; +import com.google.cloud.alloydb.v1alpha.User; + +public class SyncCreateUser { + + public static void main(String[] args) throws Exception { + syncCreateUser(); + } + + public static void syncCreateUser() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + CreateUserRequest request = + CreateUserRequest.newBuilder() + .setParent(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString()) + .setUserId("userId-836030906") + .setUser(User.newBuilder().build()) + .setRequestId("requestId693933066") + .setValidateOnly(true) + .build(); + User response = alloyDBAdminClient.createUser(request); + } + } +} +// [END alloydb_v1alpha_generated_AlloyDBAdmin_CreateUser_sync] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/createuser/SyncCreateUserClusternameUserString.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/createuser/SyncCreateUserClusternameUserString.java new file mode 100644 index 000000000000..5305f2fc4ba0 --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/createuser/SyncCreateUserClusternameUserString.java @@ -0,0 +1,44 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.alloydb.v1alpha.samples; + +// [START alloydb_v1alpha_generated_AlloyDBAdmin_CreateUser_ClusternameUserString_sync] +import com.google.cloud.alloydb.v1alpha.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1alpha.ClusterName; +import com.google.cloud.alloydb.v1alpha.User; + +public class SyncCreateUserClusternameUserString { + + public static void main(String[] args) throws Exception { + syncCreateUserClusternameUserString(); + } + + public static void syncCreateUserClusternameUserString() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + ClusterName parent = ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]"); + User user = User.newBuilder().build(); + String userId = "userId-836030906"; + User response = alloyDBAdminClient.createUser(parent, user, userId); + } + } +} +// [END alloydb_v1alpha_generated_AlloyDBAdmin_CreateUser_ClusternameUserString_sync] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/createuser/SyncCreateUserStringUserString.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/createuser/SyncCreateUserStringUserString.java new file mode 100644 index 000000000000..b567acb783f7 --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/createuser/SyncCreateUserStringUserString.java @@ -0,0 +1,44 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.alloydb.v1alpha.samples; + +// [START alloydb_v1alpha_generated_AlloyDBAdmin_CreateUser_StringUserString_sync] +import com.google.cloud.alloydb.v1alpha.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1alpha.ClusterName; +import com.google.cloud.alloydb.v1alpha.User; + +public class SyncCreateUserStringUserString { + + public static void main(String[] args) throws Exception { + syncCreateUserStringUserString(); + } + + public static void syncCreateUserStringUserString() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + String parent = ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString(); + User user = User.newBuilder().build(); + String userId = "userId-836030906"; + User response = alloyDBAdminClient.createUser(parent, user, userId); + } + } +} +// [END alloydb_v1alpha_generated_AlloyDBAdmin_CreateUser_StringUserString_sync] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/deleteuser/AsyncDeleteUser.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/deleteuser/AsyncDeleteUser.java new file mode 100644 index 000000000000..c31de497f4ac --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/deleteuser/AsyncDeleteUser.java @@ -0,0 +1,51 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.alloydb.v1alpha.samples; + +// [START alloydb_v1alpha_generated_AlloyDBAdmin_DeleteUser_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.alloydb.v1alpha.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1alpha.DeleteUserRequest; +import com.google.cloud.alloydb.v1alpha.UserName; +import com.google.protobuf.Empty; + +public class AsyncDeleteUser { + + public static void main(String[] args) throws Exception { + asyncDeleteUser(); + } + + public static void asyncDeleteUser() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + DeleteUserRequest request = + DeleteUserRequest.newBuilder() + .setName(UserName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[USER]").toString()) + .setRequestId("requestId693933066") + .setValidateOnly(true) + .build(); + ApiFuture future = alloyDBAdminClient.deleteUserCallable().futureCall(request); + // Do something. + future.get(); + } + } +} +// [END alloydb_v1alpha_generated_AlloyDBAdmin_DeleteUser_async] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/deleteuser/SyncDeleteUser.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/deleteuser/SyncDeleteUser.java new file mode 100644 index 000000000000..34b2159ef43a --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/deleteuser/SyncDeleteUser.java @@ -0,0 +1,48 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.alloydb.v1alpha.samples; + +// [START alloydb_v1alpha_generated_AlloyDBAdmin_DeleteUser_sync] +import com.google.cloud.alloydb.v1alpha.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1alpha.DeleteUserRequest; +import com.google.cloud.alloydb.v1alpha.UserName; +import com.google.protobuf.Empty; + +public class SyncDeleteUser { + + public static void main(String[] args) throws Exception { + syncDeleteUser(); + } + + public static void syncDeleteUser() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + DeleteUserRequest request = + DeleteUserRequest.newBuilder() + .setName(UserName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[USER]").toString()) + .setRequestId("requestId693933066") + .setValidateOnly(true) + .build(); + alloyDBAdminClient.deleteUser(request); + } + } +} +// [END alloydb_v1alpha_generated_AlloyDBAdmin_DeleteUser_sync] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/deleteuser/SyncDeleteUserString.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/deleteuser/SyncDeleteUserString.java new file mode 100644 index 000000000000..1e3a934b1910 --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/deleteuser/SyncDeleteUserString.java @@ -0,0 +1,42 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.alloydb.v1alpha.samples; + +// [START alloydb_v1alpha_generated_AlloyDBAdmin_DeleteUser_String_sync] +import com.google.cloud.alloydb.v1alpha.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1alpha.UserName; +import com.google.protobuf.Empty; + +public class SyncDeleteUserString { + + public static void main(String[] args) throws Exception { + syncDeleteUserString(); + } + + public static void syncDeleteUserString() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + String name = UserName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[USER]").toString(); + alloyDBAdminClient.deleteUser(name); + } + } +} +// [END alloydb_v1alpha_generated_AlloyDBAdmin_DeleteUser_String_sync] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/deleteuser/SyncDeleteUserUsername.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/deleteuser/SyncDeleteUserUsername.java new file mode 100644 index 000000000000..4ba4e4543746 --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/deleteuser/SyncDeleteUserUsername.java @@ -0,0 +1,42 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.alloydb.v1alpha.samples; + +// [START alloydb_v1alpha_generated_AlloyDBAdmin_DeleteUser_Username_sync] +import com.google.cloud.alloydb.v1alpha.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1alpha.UserName; +import com.google.protobuf.Empty; + +public class SyncDeleteUserUsername { + + public static void main(String[] args) throws Exception { + syncDeleteUserUsername(); + } + + public static void syncDeleteUserUsername() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + UserName name = UserName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[USER]"); + alloyDBAdminClient.deleteUser(name); + } + } +} +// [END alloydb_v1alpha_generated_AlloyDBAdmin_DeleteUser_Username_sync] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/generateclientcertificate/AsyncGenerateClientCertificate.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/generateclientcertificate/AsyncGenerateClientCertificate.java index 94f5ab8aaa36..4bb88f26cad5 100644 --- a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/generateclientcertificate/AsyncGenerateClientCertificate.java +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/generateclientcertificate/AsyncGenerateClientCertificate.java @@ -43,6 +43,7 @@ public static void asyncGenerateClientCertificate() throws Exception { .setRequestId("requestId693933066") .setPemCsr("pemCsr-991911478") .setCertDuration(Duration.newBuilder().build()) + .setPublicKey("publicKey1446899510") .build(); ApiFuture future = alloyDBAdminClient.generateClientCertificateCallable().futureCall(request); diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/generateclientcertificate/SyncGenerateClientCertificate.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/generateclientcertificate/SyncGenerateClientCertificate.java index e828f22ef8d3..9bb69db6647e 100644 --- a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/generateclientcertificate/SyncGenerateClientCertificate.java +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/generateclientcertificate/SyncGenerateClientCertificate.java @@ -42,6 +42,7 @@ public static void syncGenerateClientCertificate() throws Exception { .setRequestId("requestId693933066") .setPemCsr("pemCsr-991911478") .setCertDuration(Duration.newBuilder().build()) + .setPublicKey("publicKey1446899510") .build(); GenerateClientCertificateResponse response = alloyDBAdminClient.generateClientCertificate(request); diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/getcluster/AsyncGetCluster.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/getcluster/AsyncGetCluster.java index 64d22460a645..9a6a774c11cf 100644 --- a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/getcluster/AsyncGetCluster.java +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/getcluster/AsyncGetCluster.java @@ -21,6 +21,7 @@ import com.google.cloud.alloydb.v1alpha.AlloyDBAdminClient; import com.google.cloud.alloydb.v1alpha.Cluster; import com.google.cloud.alloydb.v1alpha.ClusterName; +import com.google.cloud.alloydb.v1alpha.ClusterView; import com.google.cloud.alloydb.v1alpha.GetClusterRequest; public class AsyncGetCluster { @@ -39,6 +40,7 @@ public static void asyncGetCluster() throws Exception { GetClusterRequest request = GetClusterRequest.newBuilder() .setName(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString()) + .setView(ClusterView.forNumber(0)) .build(); ApiFuture future = alloyDBAdminClient.getClusterCallable().futureCall(request); // Do something. diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/getcluster/SyncGetCluster.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/getcluster/SyncGetCluster.java index 63d63b7c98ef..06b38f04f0b3 100644 --- a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/getcluster/SyncGetCluster.java +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/getcluster/SyncGetCluster.java @@ -20,6 +20,7 @@ import com.google.cloud.alloydb.v1alpha.AlloyDBAdminClient; import com.google.cloud.alloydb.v1alpha.Cluster; import com.google.cloud.alloydb.v1alpha.ClusterName; +import com.google.cloud.alloydb.v1alpha.ClusterView; import com.google.cloud.alloydb.v1alpha.GetClusterRequest; public class SyncGetCluster { @@ -38,6 +39,7 @@ public static void syncGetCluster() throws Exception { GetClusterRequest request = GetClusterRequest.newBuilder() .setName(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString()) + .setView(ClusterView.forNumber(0)) .build(); Cluster response = alloyDBAdminClient.getCluster(request); } diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/getuser/AsyncGetUser.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/getuser/AsyncGetUser.java new file mode 100644 index 000000000000..221d1ecab818 --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/getuser/AsyncGetUser.java @@ -0,0 +1,49 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.alloydb.v1alpha.samples; + +// [START alloydb_v1alpha_generated_AlloyDBAdmin_GetUser_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.alloydb.v1alpha.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1alpha.GetUserRequest; +import com.google.cloud.alloydb.v1alpha.User; +import com.google.cloud.alloydb.v1alpha.UserName; + +public class AsyncGetUser { + + public static void main(String[] args) throws Exception { + asyncGetUser(); + } + + public static void asyncGetUser() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + GetUserRequest request = + GetUserRequest.newBuilder() + .setName(UserName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[USER]").toString()) + .build(); + ApiFuture future = alloyDBAdminClient.getUserCallable().futureCall(request); + // Do something. + User response = future.get(); + } + } +} +// [END alloydb_v1alpha_generated_AlloyDBAdmin_GetUser_async] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/getuser/SyncGetUser.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/getuser/SyncGetUser.java new file mode 100644 index 000000000000..29030e1ac451 --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/getuser/SyncGetUser.java @@ -0,0 +1,46 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.alloydb.v1alpha.samples; + +// [START alloydb_v1alpha_generated_AlloyDBAdmin_GetUser_sync] +import com.google.cloud.alloydb.v1alpha.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1alpha.GetUserRequest; +import com.google.cloud.alloydb.v1alpha.User; +import com.google.cloud.alloydb.v1alpha.UserName; + +public class SyncGetUser { + + public static void main(String[] args) throws Exception { + syncGetUser(); + } + + public static void syncGetUser() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + GetUserRequest request = + GetUserRequest.newBuilder() + .setName(UserName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[USER]").toString()) + .build(); + User response = alloyDBAdminClient.getUser(request); + } + } +} +// [END alloydb_v1alpha_generated_AlloyDBAdmin_GetUser_sync] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/getuser/SyncGetUserString.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/getuser/SyncGetUserString.java new file mode 100644 index 000000000000..61b92b1589ec --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/getuser/SyncGetUserString.java @@ -0,0 +1,42 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.alloydb.v1alpha.samples; + +// [START alloydb_v1alpha_generated_AlloyDBAdmin_GetUser_String_sync] +import com.google.cloud.alloydb.v1alpha.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1alpha.User; +import com.google.cloud.alloydb.v1alpha.UserName; + +public class SyncGetUserString { + + public static void main(String[] args) throws Exception { + syncGetUserString(); + } + + public static void syncGetUserString() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + String name = UserName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[USER]").toString(); + User response = alloyDBAdminClient.getUser(name); + } + } +} +// [END alloydb_v1alpha_generated_AlloyDBAdmin_GetUser_String_sync] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/getuser/SyncGetUserUsername.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/getuser/SyncGetUserUsername.java new file mode 100644 index 000000000000..81354186647d --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/getuser/SyncGetUserUsername.java @@ -0,0 +1,42 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.alloydb.v1alpha.samples; + +// [START alloydb_v1alpha_generated_AlloyDBAdmin_GetUser_Username_sync] +import com.google.cloud.alloydb.v1alpha.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1alpha.User; +import com.google.cloud.alloydb.v1alpha.UserName; + +public class SyncGetUserUsername { + + public static void main(String[] args) throws Exception { + syncGetUserUsername(); + } + + public static void syncGetUserUsername() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + UserName name = UserName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[USER]"); + User response = alloyDBAdminClient.getUser(name); + } + } +} +// [END alloydb_v1alpha_generated_AlloyDBAdmin_GetUser_Username_sync] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/injectfault/AsyncInjectFault.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/injectfault/AsyncInjectFault.java new file mode 100644 index 000000000000..e487586f8f10 --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/injectfault/AsyncInjectFault.java @@ -0,0 +1,52 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.alloydb.v1alpha.samples; + +// [START alloydb_v1alpha_generated_AlloyDBAdmin_InjectFault_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.alloydb.v1alpha.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1alpha.InjectFaultRequest; +import com.google.cloud.alloydb.v1alpha.InstanceName; +import com.google.longrunning.Operation; + +public class AsyncInjectFault { + + public static void main(String[] args) throws Exception { + asyncInjectFault(); + } + + public static void asyncInjectFault() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + InjectFaultRequest request = + InjectFaultRequest.newBuilder() + .setName( + InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]").toString()) + .setRequestId("requestId693933066") + .setValidateOnly(true) + .build(); + ApiFuture future = alloyDBAdminClient.injectFaultCallable().futureCall(request); + // Do something. + Operation response = future.get(); + } + } +} +// [END alloydb_v1alpha_generated_AlloyDBAdmin_InjectFault_async] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/injectfault/AsyncInjectFaultLRO.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/injectfault/AsyncInjectFaultLRO.java new file mode 100644 index 000000000000..0a5c5bd57a85 --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/injectfault/AsyncInjectFaultLRO.java @@ -0,0 +1,54 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.alloydb.v1alpha.samples; + +// [START alloydb_v1alpha_generated_AlloyDBAdmin_InjectFault_LRO_async] +import com.google.api.gax.longrunning.OperationFuture; +import com.google.cloud.alloydb.v1alpha.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1alpha.InjectFaultRequest; +import com.google.cloud.alloydb.v1alpha.Instance; +import com.google.cloud.alloydb.v1alpha.InstanceName; +import com.google.cloud.alloydb.v1alpha.OperationMetadata; + +public class AsyncInjectFaultLRO { + + public static void main(String[] args) throws Exception { + asyncInjectFaultLRO(); + } + + public static void asyncInjectFaultLRO() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + InjectFaultRequest request = + InjectFaultRequest.newBuilder() + .setName( + InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]").toString()) + .setRequestId("requestId693933066") + .setValidateOnly(true) + .build(); + OperationFuture future = + alloyDBAdminClient.injectFaultOperationCallable().futureCall(request); + // Do something. + Instance response = future.get(); + } + } +} +// [END alloydb_v1alpha_generated_AlloyDBAdmin_InjectFault_LRO_async] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/injectfault/SyncInjectFault.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/injectfault/SyncInjectFault.java new file mode 100644 index 000000000000..bc06d7c41c74 --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/injectfault/SyncInjectFault.java @@ -0,0 +1,49 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.alloydb.v1alpha.samples; + +// [START alloydb_v1alpha_generated_AlloyDBAdmin_InjectFault_sync] +import com.google.cloud.alloydb.v1alpha.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1alpha.InjectFaultRequest; +import com.google.cloud.alloydb.v1alpha.Instance; +import com.google.cloud.alloydb.v1alpha.InstanceName; + +public class SyncInjectFault { + + public static void main(String[] args) throws Exception { + syncInjectFault(); + } + + public static void syncInjectFault() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + InjectFaultRequest request = + InjectFaultRequest.newBuilder() + .setName( + InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]").toString()) + .setRequestId("requestId693933066") + .setValidateOnly(true) + .build(); + Instance response = alloyDBAdminClient.injectFaultAsync(request).get(); + } + } +} +// [END alloydb_v1alpha_generated_AlloyDBAdmin_InjectFault_sync] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/injectfault/SyncInjectFaultInjectfaultrequestfaulttypeInstancename.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/injectfault/SyncInjectFaultInjectfaultrequestfaulttypeInstancename.java new file mode 100644 index 000000000000..22187b44bb26 --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/injectfault/SyncInjectFaultInjectfaultrequestfaulttypeInstancename.java @@ -0,0 +1,44 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.alloydb.v1alpha.samples; + +// [START alloydb_v1alpha_generated_AlloyDBAdmin_InjectFault_InjectfaultrequestfaulttypeInstancename_sync] +import com.google.cloud.alloydb.v1alpha.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1alpha.InjectFaultRequest; +import com.google.cloud.alloydb.v1alpha.Instance; +import com.google.cloud.alloydb.v1alpha.InstanceName; + +public class SyncInjectFaultInjectfaultrequestfaulttypeInstancename { + + public static void main(String[] args) throws Exception { + syncInjectFaultInjectfaultrequestfaulttypeInstancename(); + } + + public static void syncInjectFaultInjectfaultrequestfaulttypeInstancename() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + InjectFaultRequest.FaultType faultType = InjectFaultRequest.FaultType.forNumber(0); + InstanceName name = InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]"); + Instance response = alloyDBAdminClient.injectFaultAsync(faultType, name).get(); + } + } +} +// [END alloydb_v1alpha_generated_AlloyDBAdmin_InjectFault_InjectfaultrequestfaulttypeInstancename_sync] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/injectfault/SyncInjectFaultInjectfaultrequestfaulttypeString.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/injectfault/SyncInjectFaultInjectfaultrequestfaulttypeString.java new file mode 100644 index 000000000000..27e5675668c1 --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/injectfault/SyncInjectFaultInjectfaultrequestfaulttypeString.java @@ -0,0 +1,45 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.alloydb.v1alpha.samples; + +// [START alloydb_v1alpha_generated_AlloyDBAdmin_InjectFault_InjectfaultrequestfaulttypeString_sync] +import com.google.cloud.alloydb.v1alpha.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1alpha.InjectFaultRequest; +import com.google.cloud.alloydb.v1alpha.Instance; +import com.google.cloud.alloydb.v1alpha.InstanceName; + +public class SyncInjectFaultInjectfaultrequestfaulttypeString { + + public static void main(String[] args) throws Exception { + syncInjectFaultInjectfaultrequestfaulttypeString(); + } + + public static void syncInjectFaultInjectfaultrequestfaulttypeString() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + InjectFaultRequest.FaultType faultType = InjectFaultRequest.FaultType.forNumber(0); + String name = + InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]").toString(); + Instance response = alloyDBAdminClient.injectFaultAsync(faultType, name).get(); + } + } +} +// [END alloydb_v1alpha_generated_AlloyDBAdmin_InjectFault_InjectfaultrequestfaulttypeString_sync] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/listusers/AsyncListUsers.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/listusers/AsyncListUsers.java new file mode 100644 index 000000000000..07ddd8ff3d94 --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/listusers/AsyncListUsers.java @@ -0,0 +1,55 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.alloydb.v1alpha.samples; + +// [START alloydb_v1alpha_generated_AlloyDBAdmin_ListUsers_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.alloydb.v1alpha.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1alpha.ClusterName; +import com.google.cloud.alloydb.v1alpha.ListUsersRequest; +import com.google.cloud.alloydb.v1alpha.User; + +public class AsyncListUsers { + + public static void main(String[] args) throws Exception { + asyncListUsers(); + } + + public static void asyncListUsers() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + ListUsersRequest request = + ListUsersRequest.newBuilder() + .setParent(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .setFilter("filter-1274492040") + .setOrderBy("orderBy-1207110587") + .build(); + ApiFuture future = alloyDBAdminClient.listUsersPagedCallable().futureCall(request); + // Do something. + for (User element : future.get().iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END alloydb_v1alpha_generated_AlloyDBAdmin_ListUsers_async] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/listusers/AsyncListUsersPaged.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/listusers/AsyncListUsersPaged.java new file mode 100644 index 000000000000..81a3afb984c8 --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/listusers/AsyncListUsersPaged.java @@ -0,0 +1,63 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.alloydb.v1alpha.samples; + +// [START alloydb_v1alpha_generated_AlloyDBAdmin_ListUsers_Paged_async] +import com.google.cloud.alloydb.v1alpha.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1alpha.ClusterName; +import com.google.cloud.alloydb.v1alpha.ListUsersRequest; +import com.google.cloud.alloydb.v1alpha.ListUsersResponse; +import com.google.cloud.alloydb.v1alpha.User; +import com.google.common.base.Strings; + +public class AsyncListUsersPaged { + + public static void main(String[] args) throws Exception { + asyncListUsersPaged(); + } + + public static void asyncListUsersPaged() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + ListUsersRequest request = + ListUsersRequest.newBuilder() + .setParent(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .setFilter("filter-1274492040") + .setOrderBy("orderBy-1207110587") + .build(); + while (true) { + ListUsersResponse response = alloyDBAdminClient.listUsersCallable().call(request); + for (User element : response.getUsersList()) { + // doThingsWith(element); + } + String nextPageToken = response.getNextPageToken(); + if (!Strings.isNullOrEmpty(nextPageToken)) { + request = request.toBuilder().setPageToken(nextPageToken).build(); + } else { + break; + } + } + } + } +} +// [END alloydb_v1alpha_generated_AlloyDBAdmin_ListUsers_Paged_async] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/listusers/SyncListUsers.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/listusers/SyncListUsers.java new file mode 100644 index 000000000000..503a09f1f241 --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/listusers/SyncListUsers.java @@ -0,0 +1,52 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.alloydb.v1alpha.samples; + +// [START alloydb_v1alpha_generated_AlloyDBAdmin_ListUsers_sync] +import com.google.cloud.alloydb.v1alpha.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1alpha.ClusterName; +import com.google.cloud.alloydb.v1alpha.ListUsersRequest; +import com.google.cloud.alloydb.v1alpha.User; + +public class SyncListUsers { + + public static void main(String[] args) throws Exception { + syncListUsers(); + } + + public static void syncListUsers() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + ListUsersRequest request = + ListUsersRequest.newBuilder() + .setParent(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .setFilter("filter-1274492040") + .setOrderBy("orderBy-1207110587") + .build(); + for (User element : alloyDBAdminClient.listUsers(request).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END alloydb_v1alpha_generated_AlloyDBAdmin_ListUsers_sync] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/listusers/SyncListUsersClustername.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/listusers/SyncListUsersClustername.java new file mode 100644 index 000000000000..22f359d9821b --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/listusers/SyncListUsersClustername.java @@ -0,0 +1,44 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.alloydb.v1alpha.samples; + +// [START alloydb_v1alpha_generated_AlloyDBAdmin_ListUsers_Clustername_sync] +import com.google.cloud.alloydb.v1alpha.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1alpha.ClusterName; +import com.google.cloud.alloydb.v1alpha.User; + +public class SyncListUsersClustername { + + public static void main(String[] args) throws Exception { + syncListUsersClustername(); + } + + public static void syncListUsersClustername() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + ClusterName parent = ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]"); + for (User element : alloyDBAdminClient.listUsers(parent).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END alloydb_v1alpha_generated_AlloyDBAdmin_ListUsers_Clustername_sync] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/listusers/SyncListUsersString.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/listusers/SyncListUsersString.java new file mode 100644 index 000000000000..57637c2d6b37 --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/listusers/SyncListUsersString.java @@ -0,0 +1,44 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.alloydb.v1alpha.samples; + +// [START alloydb_v1alpha_generated_AlloyDBAdmin_ListUsers_String_sync] +import com.google.cloud.alloydb.v1alpha.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1alpha.ClusterName; +import com.google.cloud.alloydb.v1alpha.User; + +public class SyncListUsersString { + + public static void main(String[] args) throws Exception { + syncListUsersString(); + } + + public static void syncListUsersString() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + String parent = ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString(); + for (User element : alloyDBAdminClient.listUsers(parent).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END alloydb_v1alpha_generated_AlloyDBAdmin_ListUsers_String_sync] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/updateuser/AsyncUpdateUser.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/updateuser/AsyncUpdateUser.java new file mode 100644 index 000000000000..35de0e86dae0 --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/updateuser/AsyncUpdateUser.java @@ -0,0 +1,53 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.alloydb.v1alpha.samples; + +// [START alloydb_v1alpha_generated_AlloyDBAdmin_UpdateUser_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.alloydb.v1alpha.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1alpha.UpdateUserRequest; +import com.google.cloud.alloydb.v1alpha.User; +import com.google.protobuf.FieldMask; + +public class AsyncUpdateUser { + + public static void main(String[] args) throws Exception { + asyncUpdateUser(); + } + + public static void asyncUpdateUser() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + UpdateUserRequest request = + UpdateUserRequest.newBuilder() + .setUpdateMask(FieldMask.newBuilder().build()) + .setUser(User.newBuilder().build()) + .setRequestId("requestId693933066") + .setValidateOnly(true) + .setAllowMissing(true) + .build(); + ApiFuture future = alloyDBAdminClient.updateUserCallable().futureCall(request); + // Do something. + User response = future.get(); + } + } +} +// [END alloydb_v1alpha_generated_AlloyDBAdmin_UpdateUser_async] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/updateuser/SyncUpdateUser.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/updateuser/SyncUpdateUser.java new file mode 100644 index 000000000000..ff90b989c3ab --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/updateuser/SyncUpdateUser.java @@ -0,0 +1,50 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.alloydb.v1alpha.samples; + +// [START alloydb_v1alpha_generated_AlloyDBAdmin_UpdateUser_sync] +import com.google.cloud.alloydb.v1alpha.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1alpha.UpdateUserRequest; +import com.google.cloud.alloydb.v1alpha.User; +import com.google.protobuf.FieldMask; + +public class SyncUpdateUser { + + public static void main(String[] args) throws Exception { + syncUpdateUser(); + } + + public static void syncUpdateUser() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + UpdateUserRequest request = + UpdateUserRequest.newBuilder() + .setUpdateMask(FieldMask.newBuilder().build()) + .setUser(User.newBuilder().build()) + .setRequestId("requestId693933066") + .setValidateOnly(true) + .setAllowMissing(true) + .build(); + User response = alloyDBAdminClient.updateUser(request); + } + } +} +// [END alloydb_v1alpha_generated_AlloyDBAdmin_UpdateUser_sync] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/updateuser/SyncUpdateUserUserFieldmask.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/updateuser/SyncUpdateUserUserFieldmask.java new file mode 100644 index 000000000000..3d547aea158b --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1alpha/alloydbadmin/updateuser/SyncUpdateUserUserFieldmask.java @@ -0,0 +1,43 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.alloydb.v1alpha.samples; + +// [START alloydb_v1alpha_generated_AlloyDBAdmin_UpdateUser_UserFieldmask_sync] +import com.google.cloud.alloydb.v1alpha.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1alpha.User; +import com.google.protobuf.FieldMask; + +public class SyncUpdateUserUserFieldmask { + + public static void main(String[] args) throws Exception { + syncUpdateUserUserFieldmask(); + } + + public static void syncUpdateUserUserFieldmask() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + User user = User.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + User response = alloyDBAdminClient.updateUser(user, updateMask); + } + } +} +// [END alloydb_v1alpha_generated_AlloyDBAdmin_UpdateUser_UserFieldmask_sync] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/createuser/AsyncCreateUser.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/createuser/AsyncCreateUser.java new file mode 100644 index 000000000000..45b315f78d60 --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/createuser/AsyncCreateUser.java @@ -0,0 +1,53 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.alloydb.v1beta.samples; + +// [START alloydb_v1beta_generated_AlloyDBAdmin_CreateUser_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.alloydb.v1beta.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1beta.ClusterName; +import com.google.cloud.alloydb.v1beta.CreateUserRequest; +import com.google.cloud.alloydb.v1beta.User; + +public class AsyncCreateUser { + + public static void main(String[] args) throws Exception { + asyncCreateUser(); + } + + public static void asyncCreateUser() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + CreateUserRequest request = + CreateUserRequest.newBuilder() + .setParent(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString()) + .setUserId("userId-836030906") + .setUser(User.newBuilder().build()) + .setRequestId("requestId693933066") + .setValidateOnly(true) + .build(); + ApiFuture future = alloyDBAdminClient.createUserCallable().futureCall(request); + // Do something. + User response = future.get(); + } + } +} +// [END alloydb_v1beta_generated_AlloyDBAdmin_CreateUser_async] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/createuser/SyncCreateUser.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/createuser/SyncCreateUser.java new file mode 100644 index 000000000000..cc1e981b830a --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/createuser/SyncCreateUser.java @@ -0,0 +1,50 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.alloydb.v1beta.samples; + +// [START alloydb_v1beta_generated_AlloyDBAdmin_CreateUser_sync] +import com.google.cloud.alloydb.v1beta.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1beta.ClusterName; +import com.google.cloud.alloydb.v1beta.CreateUserRequest; +import com.google.cloud.alloydb.v1beta.User; + +public class SyncCreateUser { + + public static void main(String[] args) throws Exception { + syncCreateUser(); + } + + public static void syncCreateUser() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + CreateUserRequest request = + CreateUserRequest.newBuilder() + .setParent(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString()) + .setUserId("userId-836030906") + .setUser(User.newBuilder().build()) + .setRequestId("requestId693933066") + .setValidateOnly(true) + .build(); + User response = alloyDBAdminClient.createUser(request); + } + } +} +// [END alloydb_v1beta_generated_AlloyDBAdmin_CreateUser_sync] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/createuser/SyncCreateUserClusternameUserString.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/createuser/SyncCreateUserClusternameUserString.java new file mode 100644 index 000000000000..8895662c0272 --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/createuser/SyncCreateUserClusternameUserString.java @@ -0,0 +1,44 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.alloydb.v1beta.samples; + +// [START alloydb_v1beta_generated_AlloyDBAdmin_CreateUser_ClusternameUserString_sync] +import com.google.cloud.alloydb.v1beta.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1beta.ClusterName; +import com.google.cloud.alloydb.v1beta.User; + +public class SyncCreateUserClusternameUserString { + + public static void main(String[] args) throws Exception { + syncCreateUserClusternameUserString(); + } + + public static void syncCreateUserClusternameUserString() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + ClusterName parent = ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]"); + User user = User.newBuilder().build(); + String userId = "userId-836030906"; + User response = alloyDBAdminClient.createUser(parent, user, userId); + } + } +} +// [END alloydb_v1beta_generated_AlloyDBAdmin_CreateUser_ClusternameUserString_sync] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/createuser/SyncCreateUserStringUserString.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/createuser/SyncCreateUserStringUserString.java new file mode 100644 index 000000000000..1343d90e0e48 --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/createuser/SyncCreateUserStringUserString.java @@ -0,0 +1,44 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.alloydb.v1beta.samples; + +// [START alloydb_v1beta_generated_AlloyDBAdmin_CreateUser_StringUserString_sync] +import com.google.cloud.alloydb.v1beta.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1beta.ClusterName; +import com.google.cloud.alloydb.v1beta.User; + +public class SyncCreateUserStringUserString { + + public static void main(String[] args) throws Exception { + syncCreateUserStringUserString(); + } + + public static void syncCreateUserStringUserString() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + String parent = ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString(); + User user = User.newBuilder().build(); + String userId = "userId-836030906"; + User response = alloyDBAdminClient.createUser(parent, user, userId); + } + } +} +// [END alloydb_v1beta_generated_AlloyDBAdmin_CreateUser_StringUserString_sync] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/deleteuser/AsyncDeleteUser.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/deleteuser/AsyncDeleteUser.java new file mode 100644 index 000000000000..0296949124de --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/deleteuser/AsyncDeleteUser.java @@ -0,0 +1,51 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.alloydb.v1beta.samples; + +// [START alloydb_v1beta_generated_AlloyDBAdmin_DeleteUser_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.alloydb.v1beta.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1beta.DeleteUserRequest; +import com.google.cloud.alloydb.v1beta.UserName; +import com.google.protobuf.Empty; + +public class AsyncDeleteUser { + + public static void main(String[] args) throws Exception { + asyncDeleteUser(); + } + + public static void asyncDeleteUser() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + DeleteUserRequest request = + DeleteUserRequest.newBuilder() + .setName(UserName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[USER]").toString()) + .setRequestId("requestId693933066") + .setValidateOnly(true) + .build(); + ApiFuture future = alloyDBAdminClient.deleteUserCallable().futureCall(request); + // Do something. + future.get(); + } + } +} +// [END alloydb_v1beta_generated_AlloyDBAdmin_DeleteUser_async] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/deleteuser/SyncDeleteUser.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/deleteuser/SyncDeleteUser.java new file mode 100644 index 000000000000..2f177b12a86f --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/deleteuser/SyncDeleteUser.java @@ -0,0 +1,48 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.alloydb.v1beta.samples; + +// [START alloydb_v1beta_generated_AlloyDBAdmin_DeleteUser_sync] +import com.google.cloud.alloydb.v1beta.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1beta.DeleteUserRequest; +import com.google.cloud.alloydb.v1beta.UserName; +import com.google.protobuf.Empty; + +public class SyncDeleteUser { + + public static void main(String[] args) throws Exception { + syncDeleteUser(); + } + + public static void syncDeleteUser() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + DeleteUserRequest request = + DeleteUserRequest.newBuilder() + .setName(UserName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[USER]").toString()) + .setRequestId("requestId693933066") + .setValidateOnly(true) + .build(); + alloyDBAdminClient.deleteUser(request); + } + } +} +// [END alloydb_v1beta_generated_AlloyDBAdmin_DeleteUser_sync] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/deleteuser/SyncDeleteUserString.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/deleteuser/SyncDeleteUserString.java new file mode 100644 index 000000000000..90e549609ae5 --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/deleteuser/SyncDeleteUserString.java @@ -0,0 +1,42 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.alloydb.v1beta.samples; + +// [START alloydb_v1beta_generated_AlloyDBAdmin_DeleteUser_String_sync] +import com.google.cloud.alloydb.v1beta.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1beta.UserName; +import com.google.protobuf.Empty; + +public class SyncDeleteUserString { + + public static void main(String[] args) throws Exception { + syncDeleteUserString(); + } + + public static void syncDeleteUserString() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + String name = UserName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[USER]").toString(); + alloyDBAdminClient.deleteUser(name); + } + } +} +// [END alloydb_v1beta_generated_AlloyDBAdmin_DeleteUser_String_sync] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/deleteuser/SyncDeleteUserUsername.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/deleteuser/SyncDeleteUserUsername.java new file mode 100644 index 000000000000..19b63b76eb01 --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/deleteuser/SyncDeleteUserUsername.java @@ -0,0 +1,42 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.alloydb.v1beta.samples; + +// [START alloydb_v1beta_generated_AlloyDBAdmin_DeleteUser_Username_sync] +import com.google.cloud.alloydb.v1beta.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1beta.UserName; +import com.google.protobuf.Empty; + +public class SyncDeleteUserUsername { + + public static void main(String[] args) throws Exception { + syncDeleteUserUsername(); + } + + public static void syncDeleteUserUsername() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + UserName name = UserName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[USER]"); + alloyDBAdminClient.deleteUser(name); + } + } +} +// [END alloydb_v1beta_generated_AlloyDBAdmin_DeleteUser_Username_sync] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/generateclientcertificate/AsyncGenerateClientCertificate.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/generateclientcertificate/AsyncGenerateClientCertificate.java index 74c53b9d7c13..3889864458c7 100644 --- a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/generateclientcertificate/AsyncGenerateClientCertificate.java +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/generateclientcertificate/AsyncGenerateClientCertificate.java @@ -43,6 +43,7 @@ public static void asyncGenerateClientCertificate() throws Exception { .setRequestId("requestId693933066") .setPemCsr("pemCsr-991911478") .setCertDuration(Duration.newBuilder().build()) + .setPublicKey("publicKey1446899510") .build(); ApiFuture future = alloyDBAdminClient.generateClientCertificateCallable().futureCall(request); diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/generateclientcertificate/SyncGenerateClientCertificate.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/generateclientcertificate/SyncGenerateClientCertificate.java index 6b4aaca086ae..463458ba69c1 100644 --- a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/generateclientcertificate/SyncGenerateClientCertificate.java +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/generateclientcertificate/SyncGenerateClientCertificate.java @@ -42,6 +42,7 @@ public static void syncGenerateClientCertificate() throws Exception { .setRequestId("requestId693933066") .setPemCsr("pemCsr-991911478") .setCertDuration(Duration.newBuilder().build()) + .setPublicKey("publicKey1446899510") .build(); GenerateClientCertificateResponse response = alloyDBAdminClient.generateClientCertificate(request); diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/getcluster/AsyncGetCluster.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/getcluster/AsyncGetCluster.java index 800806136c46..916fa4047f09 100644 --- a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/getcluster/AsyncGetCluster.java +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/getcluster/AsyncGetCluster.java @@ -21,6 +21,7 @@ import com.google.cloud.alloydb.v1beta.AlloyDBAdminClient; import com.google.cloud.alloydb.v1beta.Cluster; import com.google.cloud.alloydb.v1beta.ClusterName; +import com.google.cloud.alloydb.v1beta.ClusterView; import com.google.cloud.alloydb.v1beta.GetClusterRequest; public class AsyncGetCluster { @@ -39,6 +40,7 @@ public static void asyncGetCluster() throws Exception { GetClusterRequest request = GetClusterRequest.newBuilder() .setName(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString()) + .setView(ClusterView.forNumber(0)) .build(); ApiFuture future = alloyDBAdminClient.getClusterCallable().futureCall(request); // Do something. diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/getcluster/SyncGetCluster.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/getcluster/SyncGetCluster.java index 8412a2ece5aa..b41788962a2a 100644 --- a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/getcluster/SyncGetCluster.java +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/getcluster/SyncGetCluster.java @@ -20,6 +20,7 @@ import com.google.cloud.alloydb.v1beta.AlloyDBAdminClient; import com.google.cloud.alloydb.v1beta.Cluster; import com.google.cloud.alloydb.v1beta.ClusterName; +import com.google.cloud.alloydb.v1beta.ClusterView; import com.google.cloud.alloydb.v1beta.GetClusterRequest; public class SyncGetCluster { @@ -38,6 +39,7 @@ public static void syncGetCluster() throws Exception { GetClusterRequest request = GetClusterRequest.newBuilder() .setName(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString()) + .setView(ClusterView.forNumber(0)) .build(); Cluster response = alloyDBAdminClient.getCluster(request); } diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/getuser/AsyncGetUser.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/getuser/AsyncGetUser.java new file mode 100644 index 000000000000..2c38c00e52e6 --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/getuser/AsyncGetUser.java @@ -0,0 +1,49 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.alloydb.v1beta.samples; + +// [START alloydb_v1beta_generated_AlloyDBAdmin_GetUser_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.alloydb.v1beta.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1beta.GetUserRequest; +import com.google.cloud.alloydb.v1beta.User; +import com.google.cloud.alloydb.v1beta.UserName; + +public class AsyncGetUser { + + public static void main(String[] args) throws Exception { + asyncGetUser(); + } + + public static void asyncGetUser() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + GetUserRequest request = + GetUserRequest.newBuilder() + .setName(UserName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[USER]").toString()) + .build(); + ApiFuture future = alloyDBAdminClient.getUserCallable().futureCall(request); + // Do something. + User response = future.get(); + } + } +} +// [END alloydb_v1beta_generated_AlloyDBAdmin_GetUser_async] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/getuser/SyncGetUser.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/getuser/SyncGetUser.java new file mode 100644 index 000000000000..de7fbb6f9245 --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/getuser/SyncGetUser.java @@ -0,0 +1,46 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.alloydb.v1beta.samples; + +// [START alloydb_v1beta_generated_AlloyDBAdmin_GetUser_sync] +import com.google.cloud.alloydb.v1beta.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1beta.GetUserRequest; +import com.google.cloud.alloydb.v1beta.User; +import com.google.cloud.alloydb.v1beta.UserName; + +public class SyncGetUser { + + public static void main(String[] args) throws Exception { + syncGetUser(); + } + + public static void syncGetUser() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + GetUserRequest request = + GetUserRequest.newBuilder() + .setName(UserName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[USER]").toString()) + .build(); + User response = alloyDBAdminClient.getUser(request); + } + } +} +// [END alloydb_v1beta_generated_AlloyDBAdmin_GetUser_sync] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/getuser/SyncGetUserString.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/getuser/SyncGetUserString.java new file mode 100644 index 000000000000..e9c889fd5a3f --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/getuser/SyncGetUserString.java @@ -0,0 +1,42 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.alloydb.v1beta.samples; + +// [START alloydb_v1beta_generated_AlloyDBAdmin_GetUser_String_sync] +import com.google.cloud.alloydb.v1beta.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1beta.User; +import com.google.cloud.alloydb.v1beta.UserName; + +public class SyncGetUserString { + + public static void main(String[] args) throws Exception { + syncGetUserString(); + } + + public static void syncGetUserString() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + String name = UserName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[USER]").toString(); + User response = alloyDBAdminClient.getUser(name); + } + } +} +// [END alloydb_v1beta_generated_AlloyDBAdmin_GetUser_String_sync] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/getuser/SyncGetUserUsername.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/getuser/SyncGetUserUsername.java new file mode 100644 index 000000000000..15deab49c9e4 --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/getuser/SyncGetUserUsername.java @@ -0,0 +1,42 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.alloydb.v1beta.samples; + +// [START alloydb_v1beta_generated_AlloyDBAdmin_GetUser_Username_sync] +import com.google.cloud.alloydb.v1beta.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1beta.User; +import com.google.cloud.alloydb.v1beta.UserName; + +public class SyncGetUserUsername { + + public static void main(String[] args) throws Exception { + syncGetUserUsername(); + } + + public static void syncGetUserUsername() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + UserName name = UserName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[USER]"); + User response = alloyDBAdminClient.getUser(name); + } + } +} +// [END alloydb_v1beta_generated_AlloyDBAdmin_GetUser_Username_sync] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/injectfault/AsyncInjectFault.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/injectfault/AsyncInjectFault.java new file mode 100644 index 000000000000..08ec81bf902e --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/injectfault/AsyncInjectFault.java @@ -0,0 +1,52 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.alloydb.v1beta.samples; + +// [START alloydb_v1beta_generated_AlloyDBAdmin_InjectFault_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.alloydb.v1beta.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1beta.InjectFaultRequest; +import com.google.cloud.alloydb.v1beta.InstanceName; +import com.google.longrunning.Operation; + +public class AsyncInjectFault { + + public static void main(String[] args) throws Exception { + asyncInjectFault(); + } + + public static void asyncInjectFault() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + InjectFaultRequest request = + InjectFaultRequest.newBuilder() + .setName( + InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]").toString()) + .setRequestId("requestId693933066") + .setValidateOnly(true) + .build(); + ApiFuture future = alloyDBAdminClient.injectFaultCallable().futureCall(request); + // Do something. + Operation response = future.get(); + } + } +} +// [END alloydb_v1beta_generated_AlloyDBAdmin_InjectFault_async] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/injectfault/AsyncInjectFaultLRO.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/injectfault/AsyncInjectFaultLRO.java new file mode 100644 index 000000000000..fe83bb3c503b --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/injectfault/AsyncInjectFaultLRO.java @@ -0,0 +1,54 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.alloydb.v1beta.samples; + +// [START alloydb_v1beta_generated_AlloyDBAdmin_InjectFault_LRO_async] +import com.google.api.gax.longrunning.OperationFuture; +import com.google.cloud.alloydb.v1beta.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1beta.InjectFaultRequest; +import com.google.cloud.alloydb.v1beta.Instance; +import com.google.cloud.alloydb.v1beta.InstanceName; +import com.google.cloud.alloydb.v1beta.OperationMetadata; + +public class AsyncInjectFaultLRO { + + public static void main(String[] args) throws Exception { + asyncInjectFaultLRO(); + } + + public static void asyncInjectFaultLRO() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + InjectFaultRequest request = + InjectFaultRequest.newBuilder() + .setName( + InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]").toString()) + .setRequestId("requestId693933066") + .setValidateOnly(true) + .build(); + OperationFuture future = + alloyDBAdminClient.injectFaultOperationCallable().futureCall(request); + // Do something. + Instance response = future.get(); + } + } +} +// [END alloydb_v1beta_generated_AlloyDBAdmin_InjectFault_LRO_async] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/injectfault/SyncInjectFault.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/injectfault/SyncInjectFault.java new file mode 100644 index 000000000000..8b87a74d5d0d --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/injectfault/SyncInjectFault.java @@ -0,0 +1,49 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.alloydb.v1beta.samples; + +// [START alloydb_v1beta_generated_AlloyDBAdmin_InjectFault_sync] +import com.google.cloud.alloydb.v1beta.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1beta.InjectFaultRequest; +import com.google.cloud.alloydb.v1beta.Instance; +import com.google.cloud.alloydb.v1beta.InstanceName; + +public class SyncInjectFault { + + public static void main(String[] args) throws Exception { + syncInjectFault(); + } + + public static void syncInjectFault() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + InjectFaultRequest request = + InjectFaultRequest.newBuilder() + .setName( + InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]").toString()) + .setRequestId("requestId693933066") + .setValidateOnly(true) + .build(); + Instance response = alloyDBAdminClient.injectFaultAsync(request).get(); + } + } +} +// [END alloydb_v1beta_generated_AlloyDBAdmin_InjectFault_sync] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/injectfault/SyncInjectFaultInjectfaultrequestfaulttypeInstancename.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/injectfault/SyncInjectFaultInjectfaultrequestfaulttypeInstancename.java new file mode 100644 index 000000000000..4ae187659c53 --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/injectfault/SyncInjectFaultInjectfaultrequestfaulttypeInstancename.java @@ -0,0 +1,44 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.alloydb.v1beta.samples; + +// [START alloydb_v1beta_generated_AlloyDBAdmin_InjectFault_InjectfaultrequestfaulttypeInstancename_sync] +import com.google.cloud.alloydb.v1beta.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1beta.InjectFaultRequest; +import com.google.cloud.alloydb.v1beta.Instance; +import com.google.cloud.alloydb.v1beta.InstanceName; + +public class SyncInjectFaultInjectfaultrequestfaulttypeInstancename { + + public static void main(String[] args) throws Exception { + syncInjectFaultInjectfaultrequestfaulttypeInstancename(); + } + + public static void syncInjectFaultInjectfaultrequestfaulttypeInstancename() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + InjectFaultRequest.FaultType faultType = InjectFaultRequest.FaultType.forNumber(0); + InstanceName name = InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]"); + Instance response = alloyDBAdminClient.injectFaultAsync(faultType, name).get(); + } + } +} +// [END alloydb_v1beta_generated_AlloyDBAdmin_InjectFault_InjectfaultrequestfaulttypeInstancename_sync] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/injectfault/SyncInjectFaultInjectfaultrequestfaulttypeString.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/injectfault/SyncInjectFaultInjectfaultrequestfaulttypeString.java new file mode 100644 index 000000000000..ba8780444b17 --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/injectfault/SyncInjectFaultInjectfaultrequestfaulttypeString.java @@ -0,0 +1,45 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.alloydb.v1beta.samples; + +// [START alloydb_v1beta_generated_AlloyDBAdmin_InjectFault_InjectfaultrequestfaulttypeString_sync] +import com.google.cloud.alloydb.v1beta.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1beta.InjectFaultRequest; +import com.google.cloud.alloydb.v1beta.Instance; +import com.google.cloud.alloydb.v1beta.InstanceName; + +public class SyncInjectFaultInjectfaultrequestfaulttypeString { + + public static void main(String[] args) throws Exception { + syncInjectFaultInjectfaultrequestfaulttypeString(); + } + + public static void syncInjectFaultInjectfaultrequestfaulttypeString() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + InjectFaultRequest.FaultType faultType = InjectFaultRequest.FaultType.forNumber(0); + String name = + InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]").toString(); + Instance response = alloyDBAdminClient.injectFaultAsync(faultType, name).get(); + } + } +} +// [END alloydb_v1beta_generated_AlloyDBAdmin_InjectFault_InjectfaultrequestfaulttypeString_sync] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/listusers/AsyncListUsers.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/listusers/AsyncListUsers.java new file mode 100644 index 000000000000..cd36368825de --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/listusers/AsyncListUsers.java @@ -0,0 +1,55 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.alloydb.v1beta.samples; + +// [START alloydb_v1beta_generated_AlloyDBAdmin_ListUsers_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.alloydb.v1beta.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1beta.ClusterName; +import com.google.cloud.alloydb.v1beta.ListUsersRequest; +import com.google.cloud.alloydb.v1beta.User; + +public class AsyncListUsers { + + public static void main(String[] args) throws Exception { + asyncListUsers(); + } + + public static void asyncListUsers() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + ListUsersRequest request = + ListUsersRequest.newBuilder() + .setParent(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .setFilter("filter-1274492040") + .setOrderBy("orderBy-1207110587") + .build(); + ApiFuture future = alloyDBAdminClient.listUsersPagedCallable().futureCall(request); + // Do something. + for (User element : future.get().iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END alloydb_v1beta_generated_AlloyDBAdmin_ListUsers_async] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/listusers/AsyncListUsersPaged.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/listusers/AsyncListUsersPaged.java new file mode 100644 index 000000000000..1c9c43921142 --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/listusers/AsyncListUsersPaged.java @@ -0,0 +1,63 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.alloydb.v1beta.samples; + +// [START alloydb_v1beta_generated_AlloyDBAdmin_ListUsers_Paged_async] +import com.google.cloud.alloydb.v1beta.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1beta.ClusterName; +import com.google.cloud.alloydb.v1beta.ListUsersRequest; +import com.google.cloud.alloydb.v1beta.ListUsersResponse; +import com.google.cloud.alloydb.v1beta.User; +import com.google.common.base.Strings; + +public class AsyncListUsersPaged { + + public static void main(String[] args) throws Exception { + asyncListUsersPaged(); + } + + public static void asyncListUsersPaged() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + ListUsersRequest request = + ListUsersRequest.newBuilder() + .setParent(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .setFilter("filter-1274492040") + .setOrderBy("orderBy-1207110587") + .build(); + while (true) { + ListUsersResponse response = alloyDBAdminClient.listUsersCallable().call(request); + for (User element : response.getUsersList()) { + // doThingsWith(element); + } + String nextPageToken = response.getNextPageToken(); + if (!Strings.isNullOrEmpty(nextPageToken)) { + request = request.toBuilder().setPageToken(nextPageToken).build(); + } else { + break; + } + } + } + } +} +// [END alloydb_v1beta_generated_AlloyDBAdmin_ListUsers_Paged_async] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/listusers/SyncListUsers.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/listusers/SyncListUsers.java new file mode 100644 index 000000000000..77391cbf8bce --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/listusers/SyncListUsers.java @@ -0,0 +1,52 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.alloydb.v1beta.samples; + +// [START alloydb_v1beta_generated_AlloyDBAdmin_ListUsers_sync] +import com.google.cloud.alloydb.v1beta.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1beta.ClusterName; +import com.google.cloud.alloydb.v1beta.ListUsersRequest; +import com.google.cloud.alloydb.v1beta.User; + +public class SyncListUsers { + + public static void main(String[] args) throws Exception { + syncListUsers(); + } + + public static void syncListUsers() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + ListUsersRequest request = + ListUsersRequest.newBuilder() + .setParent(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .setFilter("filter-1274492040") + .setOrderBy("orderBy-1207110587") + .build(); + for (User element : alloyDBAdminClient.listUsers(request).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END alloydb_v1beta_generated_AlloyDBAdmin_ListUsers_sync] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/listusers/SyncListUsersClustername.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/listusers/SyncListUsersClustername.java new file mode 100644 index 000000000000..9b0b847dff18 --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/listusers/SyncListUsersClustername.java @@ -0,0 +1,44 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.alloydb.v1beta.samples; + +// [START alloydb_v1beta_generated_AlloyDBAdmin_ListUsers_Clustername_sync] +import com.google.cloud.alloydb.v1beta.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1beta.ClusterName; +import com.google.cloud.alloydb.v1beta.User; + +public class SyncListUsersClustername { + + public static void main(String[] args) throws Exception { + syncListUsersClustername(); + } + + public static void syncListUsersClustername() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + ClusterName parent = ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]"); + for (User element : alloyDBAdminClient.listUsers(parent).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END alloydb_v1beta_generated_AlloyDBAdmin_ListUsers_Clustername_sync] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/listusers/SyncListUsersString.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/listusers/SyncListUsersString.java new file mode 100644 index 000000000000..ada26bdaddc9 --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/listusers/SyncListUsersString.java @@ -0,0 +1,44 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.alloydb.v1beta.samples; + +// [START alloydb_v1beta_generated_AlloyDBAdmin_ListUsers_String_sync] +import com.google.cloud.alloydb.v1beta.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1beta.ClusterName; +import com.google.cloud.alloydb.v1beta.User; + +public class SyncListUsersString { + + public static void main(String[] args) throws Exception { + syncListUsersString(); + } + + public static void syncListUsersString() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + String parent = ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString(); + for (User element : alloyDBAdminClient.listUsers(parent).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END alloydb_v1beta_generated_AlloyDBAdmin_ListUsers_String_sync] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/updateuser/AsyncUpdateUser.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/updateuser/AsyncUpdateUser.java new file mode 100644 index 000000000000..3d326a4a2f72 --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/updateuser/AsyncUpdateUser.java @@ -0,0 +1,53 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.alloydb.v1beta.samples; + +// [START alloydb_v1beta_generated_AlloyDBAdmin_UpdateUser_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.alloydb.v1beta.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1beta.UpdateUserRequest; +import com.google.cloud.alloydb.v1beta.User; +import com.google.protobuf.FieldMask; + +public class AsyncUpdateUser { + + public static void main(String[] args) throws Exception { + asyncUpdateUser(); + } + + public static void asyncUpdateUser() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + UpdateUserRequest request = + UpdateUserRequest.newBuilder() + .setUpdateMask(FieldMask.newBuilder().build()) + .setUser(User.newBuilder().build()) + .setRequestId("requestId693933066") + .setValidateOnly(true) + .setAllowMissing(true) + .build(); + ApiFuture future = alloyDBAdminClient.updateUserCallable().futureCall(request); + // Do something. + User response = future.get(); + } + } +} +// [END alloydb_v1beta_generated_AlloyDBAdmin_UpdateUser_async] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/updateuser/SyncUpdateUser.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/updateuser/SyncUpdateUser.java new file mode 100644 index 000000000000..38e5141521c2 --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/updateuser/SyncUpdateUser.java @@ -0,0 +1,50 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.alloydb.v1beta.samples; + +// [START alloydb_v1beta_generated_AlloyDBAdmin_UpdateUser_sync] +import com.google.cloud.alloydb.v1beta.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1beta.UpdateUserRequest; +import com.google.cloud.alloydb.v1beta.User; +import com.google.protobuf.FieldMask; + +public class SyncUpdateUser { + + public static void main(String[] args) throws Exception { + syncUpdateUser(); + } + + public static void syncUpdateUser() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + UpdateUserRequest request = + UpdateUserRequest.newBuilder() + .setUpdateMask(FieldMask.newBuilder().build()) + .setUser(User.newBuilder().build()) + .setRequestId("requestId693933066") + .setValidateOnly(true) + .setAllowMissing(true) + .build(); + User response = alloyDBAdminClient.updateUser(request); + } + } +} +// [END alloydb_v1beta_generated_AlloyDBAdmin_UpdateUser_sync] diff --git a/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/updateuser/SyncUpdateUserUserFieldmask.java b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/updateuser/SyncUpdateUserUserFieldmask.java new file mode 100644 index 000000000000..0a2d3a9f2309 --- /dev/null +++ b/java-alloydb/samples/snippets/generated/com/google/cloud/alloydb/v1beta/alloydbadmin/updateuser/SyncUpdateUserUserFieldmask.java @@ -0,0 +1,43 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.alloydb.v1beta.samples; + +// [START alloydb_v1beta_generated_AlloyDBAdmin_UpdateUser_UserFieldmask_sync] +import com.google.cloud.alloydb.v1beta.AlloyDBAdminClient; +import com.google.cloud.alloydb.v1beta.User; +import com.google.protobuf.FieldMask; + +public class SyncUpdateUserUserFieldmask { + + public static void main(String[] args) throws Exception { + syncUpdateUserUserFieldmask(); + } + + public static void syncUpdateUserUserFieldmask() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) { + User user = User.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + User response = alloyDBAdminClient.updateUser(user, updateMask); + } + } +} +// [END alloydb_v1beta_generated_AlloyDBAdmin_UpdateUser_UserFieldmask_sync]