+ * SET TRANSACTION READ ONLY
+ *
+ * @return a string representation of this {@link TransactionMode} that can be used in a SQL
+ * statement to set the transaction mode.
+ */
+ public String getStatementString() {
+ return statementString;
+ }
+
+ public String getShortStatementString() {
+ return shortStatementString;
+ }
+
+ @Override
+ public String toString() {
+ return statementString;
+ }
}
- /**
- * Use this method to get the correct format for use in a SQL statement. The SQL statement for
- * setting the mode to read-only should for example be without the underscore:
- * SET TRANSACTION READ ONLY
- *
- * @return a string representation of this {@link TransactionMode} that can be used in a SQL
- * statement to set the transaction mode.
- */
- public String getStatementString() {
- return statementString;
+ private AccessMode accessMode;
+ private IsolationLevel isolationLevel;
+
+ PgTransactionMode() {}
+
+ AccessMode getAccessMode() {
+ return this.accessMode;
+ }
+
+ void setAccessMode(AccessMode accessMode) {
+ this.accessMode = accessMode;
+ }
+
+ IsolationLevel getIsolationLevel() {
+ return this.isolationLevel;
+ }
+
+ void setIsolationLevel(IsolationLevel isolationLevel) {
+ this.isolationLevel = isolationLevel;
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(this.accessMode, this.isolationLevel);
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (!(o instanceof PgTransactionMode)) {
+ return false;
+ }
+ PgTransactionMode other = (PgTransactionMode) o;
+ return Objects.equals(this.accessMode, other.accessMode)
+ && Objects.equals(this.isolationLevel, other.isolationLevel);
}
@Override
public String toString() {
- return statementString;
+ StringBuilder result = new StringBuilder();
+ if (accessMode != null) {
+ result.append(accessMode.statementString);
+ }
+ if (isolationLevel != null) {
+ if (accessMode != null) {
+ result.append(' ');
+ }
+ result.append(isolationLevel.statementString);
+ }
+ return result.toString();
}
}
diff --git a/google-cloud-spanner/src/main/java/com/google/cloud/spanner/connection/StatementResult.java b/google-cloud-spanner/src/main/java/com/google/cloud/spanner/connection/StatementResult.java
index dea97b2b1f6..a489f3f1993 100644
--- a/google-cloud-spanner/src/main/java/com/google/cloud/spanner/connection/StatementResult.java
+++ b/google-cloud-spanner/src/main/java/com/google/cloud/spanner/connection/StatementResult.java
@@ -77,6 +77,7 @@ enum ClientSideStatementType {
COMMIT,
ROLLBACK,
SET_TRANSACTION_MODE,
+ SET_DEFAULT_TRANSACTION_ISOLATION,
START_BATCH_DDL,
START_BATCH_DML,
RUN_BATCH,
diff --git a/google-cloud-spanner/src/main/resources/com/google/cloud/spanner/connection/PG_ClientSideStatements.json b/google-cloud-spanner/src/main/resources/com/google/cloud/spanner/connection/PG_ClientSideStatements.json
index 9e9ce15998f..cd1e7362ea5 100644
--- a/google-cloud-spanner/src/main/resources/com/google/cloud/spanner/connection/PG_ClientSideStatements.json
+++ b/google-cloud-spanner/src/main/resources/com/google/cloud/spanner/connection/PG_ClientSideStatements.json
@@ -159,18 +159,21 @@
"exampleStatements": []
},
{
- "name": "{START | BEGIN} [TRANSACTION | WORK] [{ (READ ONLY|READ WRITE) | (ISOLATION LEVEL (DEFAULT|SERIALIZABLE)) }]",
+ "name": "{START | BEGIN} [TRANSACTION | WORK] [{ (READ ONLY|READ WRITE) [[,] (ISOLATION LEVEL (DEFAULT|SERIALIZABLE))] }]",
"executorName": "ClientSideStatementPgBeginExecutor",
"resultType": "NO_RESULT",
"statementType": "BEGIN",
- "regex": "(?is)\\A\\s*(?:begin|start)(?:\\s+transaction|\\s+work)?(\\s+read\\s+only|\\s+read\\s+write|\\s+isolation\\s+level\\s+default|\\s+isolation\\s+level\\s+serializable)?\\s*\\z",
+ "regex": "(?is)\\A\\s*(?:begin|start)(?:\\s+transaction|\\s+work)?((?:(?:\\s+|\\s*,\\s*)read\\s+only|(?:\\s+|\\s*,\\s*)read\\s+write|(?:\\s+|\\s*,\\s*)isolation\\s+level\\s+default|(?:\\s+|\\s*,\\s*)isolation\\s+level\\s+serializable)*)?\\s*\\z",
"method": "statementBeginPgTransaction",
"exampleStatements": [
"begin", "start", "begin transaction", "start transaction", "begin work", "start work",
"begin read only", "start read only", "begin transaction read only", "start transaction read only", "begin work read only", "start work read only",
"begin read write", "start read write", "begin transaction read write", "start transaction read write", "begin work read write", "start work read write",
"begin isolation level default", "start isolation level default", "begin transaction isolation level default", "start transaction isolation level default", "begin work isolation level default", "start work isolation level default",
- "begin isolation level serializable", "start isolation level serializable", "begin transaction isolation level serializable", "start transaction isolation level serializable", "begin work isolation level serializable", "start work isolation level serializable"
+ "begin isolation level serializable", "start isolation level serializable", "begin transaction isolation level serializable", "start transaction isolation level serializable", "begin work isolation level serializable", "start work isolation level serializable",
+ "begin isolation level default read write", "start isolation level default read only", "begin transaction isolation level default read only", "start transaction isolation level default read write", "begin work isolation level default read write", "start work isolation level default read only",
+ "begin isolation level serializable read write", "start isolation level serializable read write", "begin transaction isolation level serializable read only", "start transaction isolation level serializable read write", "begin work isolation level serializable read write", "start work isolation level serializable read only",
+ "begin isolation level serializable, read write", "start isolation level serializable, read write", "begin transaction isolation level serializable, read only", "start transaction isolation level serializable, read write", "begin work isolation level serializable, read write", "start work isolation level serializable, read only"
]
},
{
@@ -326,7 +329,7 @@
}
},
{
- "name": "SET TRANSACTION { (READ ONLY|READ WRITE) | (ISOLATION LEVEL (DEFAULT|SERIALIZABLE)) }",
+ "name": "SET TRANSACTION { (READ ONLY|READ WRITE) [[,] (ISOLATION LEVEL (DEFAULT|SERIALIZABLE))] }",
"executorName": "ClientSideStatementSetExecutor",
"resultType": "NO_RESULT",
"statementType": "SET_TRANSACTION_MODE",
@@ -337,12 +340,12 @@
"setStatement": {
"propertyName": "TRANSACTION",
"separator": "\\s+",
- "allowedValues": "(READ\\s+ONLY|READ\\s+WRITE|ISOLATION\\s+LEVEL\\s+DEFAULT|ISOLATION\\s+LEVEL\\s+SERIALIZABLE)",
+ "allowedValues": "(((?:\\s*|\\s*,\\s*)READ\\s+ONLY|(?:\\s*|\\s*,\\s*)READ\\s+WRITE|(?:\\s*|\\s*,\\s*)ISOLATION\\s+LEVEL\\s+DEFAULT|(?:\\s*|\\s*,\\s*)ISOLATION\\s+LEVEL\\s+SERIALIZABLE)+)",
"converterName": "ClientSideStatementValueConverters$PgTransactionModeConverter"
}
},
{
- "name": "SET SESSION CHARACTERISTICS AS TRANSACTION { (READ ONLY|READ WRITE) | (ISOLATION LEVEL (DEFAULT|SERIALIZABLE)) }",
+ "name": "SET SESSION CHARACTERISTICS AS TRANSACTION { (READ ONLY|READ WRITE) [[,] (ISOLATION LEVEL (DEFAULT|SERIALIZABLE))] }",
"executorName": "ClientSideStatementSetExecutor",
"resultType": "NO_RESULT",
"statementType": "SET_READONLY",
@@ -352,10 +355,61 @@
"setStatement": {
"propertyName": "SESSION\\s+CHARACTERISTICS\\s+AS\\s+TRANSACTION",
"separator": "\\s+",
- "allowedValues": "(READ\\s+ONLY|READ\\s+WRITE|ISOLATION\\s+LEVEL\\s+DEFAULT|ISOLATION\\s+LEVEL\\s+SERIALIZABLE)",
+ "allowedValues": "(((?:\\s*|\\s*,\\s*)READ\\s+ONLY|(?:\\s*|\\s*,\\s*)READ\\s+WRITE|(?:\\s*|\\s*,\\s*)ISOLATION\\s+LEVEL\\s+DEFAULT|(?:\\s*|\\s*,\\s*)ISOLATION\\s+LEVEL\\s+SERIALIZABLE)+)",
"converterName": "ClientSideStatementValueConverters$PgTransactionModeConverter"
}
},
+ {
+ "name": "SET DEFAULT_TRANSACTION_ISOLATION =|TO 'SERIALIZABLE'|SERIALIZABLE",
+ "executorName": "ClientSideStatementSetExecutor",
+ "resultType": "NO_RESULT",
+ "statementType": "SET_READONLY",
+ "regex": "(?is)\\A\\s*set\\s+default_transaction_isolation(?:\\s*=\\s*|\\s+to\\s+)(.*)\\z",
+ "method": "statementSetPgDefaultTransactionIsolation",
+ "exampleStatements": [
+ "set default_transaction_isolation=serializable",
+ "set default_transaction_isolation to serializable",
+ "set default_transaction_isolation to 'serializable'",
+ "set default_transaction_isolation = 'serializable'",
+ "set default_transaction_isolation = \"SERIALIZABLE\""
+ ],
+ "setStatement": {
+ "propertyName": "default_transaction_isolation",
+ "separator": "(?:=|\\s+TO\\s+)",
+ "allowedValues": "(SERIALIZABLE|'SERIALIZABLE'|\"SERIALIZABLE\")",
+ "converterName": "ClientSideStatementValueConverters$PgTransactionIsolationConverter"
+ }
+ },
+ {
+ "name": "SET DEFAULT_TRANSACTION_READ_ONLY =|TO TRUE|FALSE",
+ "executorName": "ClientSideStatementSetExecutor",
+ "resultType": "NO_RESULT",
+ "statementType": "SET_READONLY",
+ "regex": "(?is)\\A\\s*set\\s+default_transaction_read_only(?:\\s*=\\s*|\\s+to\\s+)(.*)\\z",
+ "method": "statementSetReadOnly",
+ "exampleStatements": [
+ "set default_transaction_read_only = true",
+ "set default_transaction_read_only = false",
+ "set default_transaction_read_only = t",
+ "set default_transaction_read_only = f",
+ "set default_transaction_read_only to 't'",
+ "set default_transaction_read_only to \"f\"",
+ "set default_transaction_read_only = on",
+ "set default_transaction_read_only = off",
+ "set default_transaction_read_only = 1",
+ "set default_transaction_read_only = 0",
+ "set default_transaction_read_only = yes",
+ "set default_transaction_read_only = no",
+ "set default_transaction_read_only = y",
+ "set default_transaction_read_only = n"
+ ],
+ "setStatement": {
+ "propertyName": "DEFAULT_TRANSACTION_READ_ONLY",
+ "separator": "(?:=|\\s+TO\\s+)",
+ "allowedValues": "(.+)",
+ "converterName": "ClientSideStatementValueConverters$PgBooleanConverter"
+ }
+ },
{
"name": "SET SPANNER.READ_ONLY_STALENESS =|TO 'STRONG' | 'MIN_READ_TIMESTAMP Sample code: + * + *
{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * try (DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.create()) {
+ * DatabaseName parent = DatabaseName.of("[PROJECT]", "[INSTANCE]", "[DATABASE]");
+ * for (DatabaseRole element : databaseAdminClient.listDatabaseRoles(parent).iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ * }
+ *
+ * @param parent Required. The database whose roles should be listed. Values are of the form
+ * `projects/<project>/instances/<instance>/databases/<database>/databaseRoles`.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final ListDatabaseRolesPagedResponse listDatabaseRoles(DatabaseName parent) {
+ ListDatabaseRolesRequest request =
+ ListDatabaseRolesRequest.newBuilder()
+ .setParent(parent == null ? null : parent.toString())
+ .build();
+ return listDatabaseRoles(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Lists Cloud Spanner database roles.
+ *
+ * Sample code: + * + *
{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * try (DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.create()) {
+ * String parent = DatabaseName.of("[PROJECT]", "[INSTANCE]", "[DATABASE]").toString();
+ * for (DatabaseRole element : databaseAdminClient.listDatabaseRoles(parent).iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ * }
+ *
+ * @param parent Required. The database whose roles should be listed. Values are of the form
+ * `projects/<project>/instances/<instance>/databases/<database>/databaseRoles`.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final ListDatabaseRolesPagedResponse listDatabaseRoles(String parent) {
+ ListDatabaseRolesRequest request =
+ ListDatabaseRolesRequest.newBuilder().setParent(parent).build();
+ return listDatabaseRoles(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Lists Cloud Spanner database roles.
+ *
+ * Sample code: + * + *
{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * try (DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.create()) {
+ * ListDatabaseRolesRequest request =
+ * ListDatabaseRolesRequest.newBuilder()
+ * .setParent(DatabaseName.of("[PROJECT]", "[INSTANCE]", "[DATABASE]").toString())
+ * .setPageSize(883849137)
+ * .setPageToken("pageToken873572522")
+ * .build();
+ * for (DatabaseRole element : databaseAdminClient.listDatabaseRoles(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 ListDatabaseRolesPagedResponse listDatabaseRoles(ListDatabaseRolesRequest request) {
+ return listDatabaseRolesPagedCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Lists Cloud Spanner database roles.
+ *
+ * Sample code: + * + *
{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * try (DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.create()) {
+ * ListDatabaseRolesRequest request =
+ * ListDatabaseRolesRequest.newBuilder()
+ * .setParent(DatabaseName.of("[PROJECT]", "[INSTANCE]", "[DATABASE]").toString())
+ * .setPageSize(883849137)
+ * .setPageToken("pageToken873572522")
+ * .build();
+ * ApiFuture future =
+ * databaseAdminClient.listDatabaseRolesPagedCallable().futureCall(request);
+ * // Do something.
+ * for (DatabaseRole element : future.get().iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ * }
+ */
+ public final UnaryCallableSample code: + * + *
{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * try (DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.create()) {
+ * ListDatabaseRolesRequest request =
+ * ListDatabaseRolesRequest.newBuilder()
+ * .setParent(DatabaseName.of("[PROJECT]", "[INSTANCE]", "[DATABASE]").toString())
+ * .setPageSize(883849137)
+ * .setPageToken("pageToken873572522")
+ * .build();
+ * while (true) {
+ * ListDatabaseRolesResponse response =
+ * databaseAdminClient.listDatabaseRolesCallable().call(request);
+ * for (DatabaseRole element : response.getDatabaseRolesList()) {
+ * // doThingsWith(element);
+ * }
+ * String nextPageToken = response.getNextPageToken();
+ * if (!Strings.isNullOrEmpty(nextPageToken)) {
+ * request = request.toBuilder().setPageToken(nextPageToken).build();
+ * } else {
+ * break;
+ * }
+ * }
+ * }
+ * }
+ */
+ public final UnaryCallableThe interfaces provided are listed below, along with usage samples. * *
======================= DatabaseAdminClient =======================
*
diff --git a/google-cloud-spanner/src/main/java/com/google/cloud/spanner/admin/database/v1/stub/DatabaseAdminStub.java b/google-cloud-spanner/src/main/java/com/google/cloud/spanner/admin/database/v1/stub/DatabaseAdminStub.java
index fedc9d86e9f..4dbf5e3c212 100644
--- a/google-cloud-spanner/src/main/java/com/google/cloud/spanner/admin/database/v1/stub/DatabaseAdminStub.java
+++ b/google-cloud-spanner/src/main/java/com/google/cloud/spanner/admin/database/v1/stub/DatabaseAdminStub.java
@@ -19,6 +19,7 @@
import static com.google.cloud.spanner.admin.database.v1.DatabaseAdminClient.ListBackupOperationsPagedResponse;
import static com.google.cloud.spanner.admin.database.v1.DatabaseAdminClient.ListBackupsPagedResponse;
import static com.google.cloud.spanner.admin.database.v1.DatabaseAdminClient.ListDatabaseOperationsPagedResponse;
+import static com.google.cloud.spanner.admin.database.v1.DatabaseAdminClient.ListDatabaseRolesPagedResponse;
import static com.google.cloud.spanner.admin.database.v1.DatabaseAdminClient.ListDatabasesPagedResponse;
import com.google.api.gax.core.BackgroundResource;
@@ -52,6 +53,8 @@
import com.google.spanner.admin.database.v1.ListBackupsResponse;
import com.google.spanner.admin.database.v1.ListDatabaseOperationsRequest;
import com.google.spanner.admin.database.v1.ListDatabaseOperationsResponse;
+import com.google.spanner.admin.database.v1.ListDatabaseRolesRequest;
+import com.google.spanner.admin.database.v1.ListDatabaseRolesResponse;
import com.google.spanner.admin.database.v1.ListDatabasesRequest;
import com.google.spanner.admin.database.v1.ListDatabasesResponse;
import com.google.spanner.admin.database.v1.RestoreDatabaseMetadata;
@@ -199,6 +202,16 @@ public UnaryCallable
+ * Lists Cloud Spanner database roles.
+ *
+ */
+ public void listDatabaseRoles(
+ com.google.spanner.admin.database.v1.ListDatabaseRolesRequest request,
+ io.grpc.stub.StreamObserver
+ * Lists Cloud Spanner database roles.
+ *
+ */
+ public void listDatabaseRoles(
+ com.google.spanner.admin.database.v1.ListDatabaseRolesRequest request,
+ io.grpc.stub.StreamObserver
+ * Lists Cloud Spanner database roles.
+ *
+ */
+ public com.google.spanner.admin.database.v1.ListDatabaseRolesResponse listDatabaseRoles(
+ com.google.spanner.admin.database.v1.ListDatabaseRolesRequest request) {
+ return io.grpc.stub.ClientCalls.blockingUnaryCall(
+ getChannel(), getListDatabaseRolesMethod(), getCallOptions(), request);
+ }
}
/**
@@ -2503,6 +2602,20 @@ protected DatabaseAdminFutureStub build(
return io.grpc.stub.ClientCalls.futureUnaryCall(
getChannel().newCall(getListBackupOperationsMethod(), getCallOptions()), request);
}
+
+ /**
+ *
+ *
+ *
+ * Lists Cloud Spanner database roles.
+ *
+ */
+ public com.google.common.util.concurrent.ListenableFuture<
+ com.google.spanner.admin.database.v1.ListDatabaseRolesResponse>
+ listDatabaseRoles(com.google.spanner.admin.database.v1.ListDatabaseRolesRequest request) {
+ return io.grpc.stub.ClientCalls.futureUnaryCall(
+ getChannel().newCall(getListDatabaseRolesMethod(), getCallOptions()), request);
+ }
}
private static final int METHODID_LIST_DATABASES = 0;
@@ -2523,6 +2636,7 @@ protected DatabaseAdminFutureStub build(
private static final int METHODID_RESTORE_DATABASE = 15;
private static final int METHODID_LIST_DATABASE_OPERATIONS = 16;
private static final int METHODID_LIST_BACKUP_OPERATIONS = 17;
+ private static final int METHODID_LIST_DATABASE_ROLES = 18;
private static final class MethodHandlers
+ * A Cloud Spanner database role.
+ *
+ *
+ * Protobuf type {@code google.spanner.admin.database.v1.DatabaseRole}
+ */
+public final class DatabaseRole extends com.google.protobuf.GeneratedMessageV3
+ implements
+ // @@protoc_insertion_point(message_implements:google.spanner.admin.database.v1.DatabaseRole)
+ DatabaseRoleOrBuilder {
+ private static final long serialVersionUID = 0L;
+ // Use DatabaseRole.newBuilder() to construct.
+ private DatabaseRole(com.google.protobuf.GeneratedMessageV3.Builder> builder) {
+ super(builder);
+ }
+
+ private DatabaseRole() {
+ name_ = "";
+ }
+
+ @java.lang.Override
+ @SuppressWarnings({"unused"})
+ protected java.lang.Object newInstance(UnusedPrivateParameter unused) {
+ return new DatabaseRole();
+ }
+
+ @java.lang.Override
+ public final com.google.protobuf.UnknownFieldSet getUnknownFields() {
+ return this.unknownFields;
+ }
+
+ private DatabaseRole(
+ com.google.protobuf.CodedInputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ this();
+ if (extensionRegistry == null) {
+ throw new java.lang.NullPointerException();
+ }
+ com.google.protobuf.UnknownFieldSet.Builder unknownFields =
+ com.google.protobuf.UnknownFieldSet.newBuilder();
+ try {
+ boolean done = false;
+ while (!done) {
+ int tag = input.readTag();
+ switch (tag) {
+ case 0:
+ done = true;
+ break;
+ case 10:
+ {
+ java.lang.String s = input.readStringRequireUtf8();
+
+ name_ = s;
+ break;
+ }
+ default:
+ {
+ if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) {
+ done = true;
+ }
+ break;
+ }
+ }
+ }
+ } catch (com.google.protobuf.InvalidProtocolBufferException e) {
+ throw e.setUnfinishedMessage(this);
+ } catch (com.google.protobuf.UninitializedMessageException e) {
+ throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this);
+ } catch (java.io.IOException e) {
+ throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this);
+ } finally {
+ this.unknownFields = unknownFields.build();
+ makeExtensionsImmutable();
+ }
+ }
+
+ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
+ return com.google.spanner.admin.database.v1.SpannerDatabaseAdminProto
+ .internal_static_google_spanner_admin_database_v1_DatabaseRole_descriptor;
+ }
+
+ @java.lang.Override
+ protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
+ internalGetFieldAccessorTable() {
+ return com.google.spanner.admin.database.v1.SpannerDatabaseAdminProto
+ .internal_static_google_spanner_admin_database_v1_DatabaseRole_fieldAccessorTable
+ .ensureFieldAccessorsInitialized(
+ com.google.spanner.admin.database.v1.DatabaseRole.class,
+ com.google.spanner.admin.database.v1.DatabaseRole.Builder.class);
+ }
+
+ public static final int NAME_FIELD_NUMBER = 1;
+ private volatile java.lang.Object name_;
+ /**
+ *
+ *
+ *
+ * Required. The name of the database role. Values are of the form
+ * `projects/<project>/instances/<instance>/databases/<database>/databaseRoles/
+ * {role}`, where `<role>` is as specified in the `CREATE ROLE`
+ * DDL statement. This name can be passed to Get/Set IAMPolicy methods to
+ * identify the database role.
+ *
+ *
+ * string name = 1 [(.google.api.field_behavior) = REQUIRED];
+ *
+ * @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 database role. Values are of the form
+ * `projects/<project>/instances/<instance>/databases/<database>/databaseRoles/
+ * {role}`, where `<role>` is as specified in the `CREATE ROLE`
+ * DDL statement. This name can be passed to Get/Set IAMPolicy methods to
+ * identify the database role.
+ *
+ *
+ * string name = 1 [(.google.api.field_behavior) = REQUIRED];
+ *
+ * @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_);
+ }
+ unknownFields.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 += unknownFields.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.spanner.admin.database.v1.DatabaseRole)) {
+ return super.equals(obj);
+ }
+ com.google.spanner.admin.database.v1.DatabaseRole other =
+ (com.google.spanner.admin.database.v1.DatabaseRole) obj;
+
+ if (!getName().equals(other.getName())) return false;
+ if (!unknownFields.equals(other.unknownFields)) 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) + unknownFields.hashCode();
+ memoizedHashCode = hash;
+ return hash;
+ }
+
+ public static com.google.spanner.admin.database.v1.DatabaseRole parseFrom(
+ java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+
+ public static com.google.spanner.admin.database.v1.DatabaseRole parseFrom(
+ java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data, extensionRegistry);
+ }
+
+ public static com.google.spanner.admin.database.v1.DatabaseRole parseFrom(
+ com.google.protobuf.ByteString data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+
+ public static com.google.spanner.admin.database.v1.DatabaseRole 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.spanner.admin.database.v1.DatabaseRole parseFrom(byte[] data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+
+ public static com.google.spanner.admin.database.v1.DatabaseRole parseFrom(
+ byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data, extensionRegistry);
+ }
+
+ public static com.google.spanner.admin.database.v1.DatabaseRole parseFrom(
+ java.io.InputStream input) throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
+ }
+
+ public static com.google.spanner.admin.database.v1.DatabaseRole 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.spanner.admin.database.v1.DatabaseRole parseDelimitedFrom(
+ java.io.InputStream input) throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input);
+ }
+
+ public static com.google.spanner.admin.database.v1.DatabaseRole 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.spanner.admin.database.v1.DatabaseRole parseFrom(
+ com.google.protobuf.CodedInputStream input) throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
+ }
+
+ public static com.google.spanner.admin.database.v1.DatabaseRole 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.spanner.admin.database.v1.DatabaseRole 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;
+ }
+ /**
+ *
+ *
+ *
+ * A Cloud Spanner database role.
+ *
+ *
+ * Protobuf type {@code google.spanner.admin.database.v1.DatabaseRole}
+ */
+ public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder
+ * Required. The name of the database role. Values are of the form
+ * `projects/<project>/instances/<instance>/databases/<database>/databaseRoles/
+ * {role}`, where `<role>` is as specified in the `CREATE ROLE`
+ * DDL statement. This name can be passed to Get/Set IAMPolicy methods to
+ * identify the database role.
+ *
+ *
+ * string name = 1 [(.google.api.field_behavior) = REQUIRED];
+ *
+ * @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 database role. Values are of the form
+ * `projects/<project>/instances/<instance>/databases/<database>/databaseRoles/
+ * {role}`, where `<role>` is as specified in the `CREATE ROLE`
+ * DDL statement. This name can be passed to Get/Set IAMPolicy methods to
+ * identify the database role.
+ *
+ *
+ * string name = 1 [(.google.api.field_behavior) = REQUIRED];
+ *
+ * @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 database role. Values are of the form
+ * `projects/<project>/instances/<instance>/databases/<database>/databaseRoles/
+ * {role}`, where `<role>` is as specified in the `CREATE ROLE`
+ * DDL statement. This name can be passed to Get/Set IAMPolicy methods to
+ * identify the database role.
+ *
+ *
+ * string name = 1 [(.google.api.field_behavior) = REQUIRED];
+ *
+ * @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;
+ onChanged();
+ return this;
+ }
+ /**
+ *
+ *
+ *
+ * Required. The name of the database role. Values are of the form
+ * `projects/<project>/instances/<instance>/databases/<database>/databaseRoles/
+ * {role}`, where `<role>` is as specified in the `CREATE ROLE`
+ * DDL statement. This name can be passed to Get/Set IAMPolicy methods to
+ * identify the database role.
+ *
+ *
+ * string name = 1 [(.google.api.field_behavior) = REQUIRED];
+ *
+ * @return This builder for chaining.
+ */
+ public Builder clearName() {
+
+ name_ = getDefaultInstance().getName();
+ onChanged();
+ return this;
+ }
+ /**
+ *
+ *
+ *
+ * Required. The name of the database role. Values are of the form
+ * `projects/<project>/instances/<instance>/databases/<database>/databaseRoles/
+ * {role}`, where `<role>` is as specified in the `CREATE ROLE`
+ * DDL statement. This name can be passed to Get/Set IAMPolicy methods to
+ * identify the database role.
+ *
+ *
+ * string name = 1 [(.google.api.field_behavior) = REQUIRED];
+ *
+ * @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;
+ 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.spanner.admin.database.v1.DatabaseRole)
+ }
+
+ // @@protoc_insertion_point(class_scope:google.spanner.admin.database.v1.DatabaseRole)
+ private static final com.google.spanner.admin.database.v1.DatabaseRole DEFAULT_INSTANCE;
+
+ static {
+ DEFAULT_INSTANCE = new com.google.spanner.admin.database.v1.DatabaseRole();
+ }
+
+ public static com.google.spanner.admin.database.v1.DatabaseRole getDefaultInstance() {
+ return DEFAULT_INSTANCE;
+ }
+
+ private static final com.google.protobuf.Parser
+ * Required. The name of the database role. Values are of the form
+ * `projects/<project>/instances/<instance>/databases/<database>/databaseRoles/
+ * {role}`, where `<role>` is as specified in the `CREATE ROLE`
+ * DDL statement. This name can be passed to Get/Set IAMPolicy methods to
+ * identify the database role.
+ *
+ *
+ * string name = 1 [(.google.api.field_behavior) = REQUIRED];
+ *
+ * @return The name.
+ */
+ java.lang.String getName();
+ /**
+ *
+ *
+ *
+ * Required. The name of the database role. Values are of the form
+ * `projects/<project>/instances/<instance>/databases/<database>/databaseRoles/
+ * {role}`, where `<role>` is as specified in the `CREATE ROLE`
+ * DDL statement. This name can be passed to Get/Set IAMPolicy methods to
+ * identify the database role.
+ *
+ *
+ * string name = 1 [(.google.api.field_behavior) = REQUIRED];
+ *
+ * @return The bytes for name.
+ */
+ com.google.protobuf.ByteString getNameBytes();
+}
diff --git a/proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/ListDatabaseRolesRequest.java b/proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/ListDatabaseRolesRequest.java
new file mode 100644
index 00000000000..1b353b1d4c1
--- /dev/null
+++ b/proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/ListDatabaseRolesRequest.java
@@ -0,0 +1,958 @@
+/*
+ * Copyright 2020 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT 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/spanner/admin/database/v1/spanner_database_admin.proto
+
+package com.google.spanner.admin.database.v1;
+
+/**
+ *
+ *
+ *
+ * The request for [ListDatabaseRoles][google.spanner.admin.database.v1.DatabaseAdmin.ListDatabaseRoles].
+ *
+ *
+ * Protobuf type {@code google.spanner.admin.database.v1.ListDatabaseRolesRequest}
+ */
+public final class ListDatabaseRolesRequest extends com.google.protobuf.GeneratedMessageV3
+ implements
+ // @@protoc_insertion_point(message_implements:google.spanner.admin.database.v1.ListDatabaseRolesRequest)
+ ListDatabaseRolesRequestOrBuilder {
+ private static final long serialVersionUID = 0L;
+ // Use ListDatabaseRolesRequest.newBuilder() to construct.
+ private ListDatabaseRolesRequest(com.google.protobuf.GeneratedMessageV3.Builder> builder) {
+ super(builder);
+ }
+
+ private ListDatabaseRolesRequest() {
+ parent_ = "";
+ pageToken_ = "";
+ }
+
+ @java.lang.Override
+ @SuppressWarnings({"unused"})
+ protected java.lang.Object newInstance(UnusedPrivateParameter unused) {
+ return new ListDatabaseRolesRequest();
+ }
+
+ @java.lang.Override
+ public final com.google.protobuf.UnknownFieldSet getUnknownFields() {
+ return this.unknownFields;
+ }
+
+ private ListDatabaseRolesRequest(
+ com.google.protobuf.CodedInputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ this();
+ if (extensionRegistry == null) {
+ throw new java.lang.NullPointerException();
+ }
+ com.google.protobuf.UnknownFieldSet.Builder unknownFields =
+ com.google.protobuf.UnknownFieldSet.newBuilder();
+ try {
+ boolean done = false;
+ while (!done) {
+ int tag = input.readTag();
+ switch (tag) {
+ case 0:
+ done = true;
+ break;
+ case 10:
+ {
+ java.lang.String s = input.readStringRequireUtf8();
+
+ parent_ = s;
+ break;
+ }
+ case 16:
+ {
+ pageSize_ = input.readInt32();
+ break;
+ }
+ case 26:
+ {
+ java.lang.String s = input.readStringRequireUtf8();
+
+ pageToken_ = s;
+ break;
+ }
+ default:
+ {
+ if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) {
+ done = true;
+ }
+ break;
+ }
+ }
+ }
+ } catch (com.google.protobuf.InvalidProtocolBufferException e) {
+ throw e.setUnfinishedMessage(this);
+ } catch (com.google.protobuf.UninitializedMessageException e) {
+ throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this);
+ } catch (java.io.IOException e) {
+ throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this);
+ } finally {
+ this.unknownFields = unknownFields.build();
+ makeExtensionsImmutable();
+ }
+ }
+
+ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
+ return com.google.spanner.admin.database.v1.SpannerDatabaseAdminProto
+ .internal_static_google_spanner_admin_database_v1_ListDatabaseRolesRequest_descriptor;
+ }
+
+ @java.lang.Override
+ protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
+ internalGetFieldAccessorTable() {
+ return com.google.spanner.admin.database.v1.SpannerDatabaseAdminProto
+ .internal_static_google_spanner_admin_database_v1_ListDatabaseRolesRequest_fieldAccessorTable
+ .ensureFieldAccessorsInitialized(
+ com.google.spanner.admin.database.v1.ListDatabaseRolesRequest.class,
+ com.google.spanner.admin.database.v1.ListDatabaseRolesRequest.Builder.class);
+ }
+
+ public static final int PARENT_FIELD_NUMBER = 1;
+ private volatile java.lang.Object parent_;
+ /**
+ *
+ *
+ *
+ * Required. The database whose roles should be listed.
+ * Values are of the form
+ * `projects/<project>/instances/<instance>/databases/<database>/databaseRoles`.
+ *
+ *
+ *
+ * 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 database whose roles should be listed.
+ * Values are of the form
+ * `projects/<project>/instances/<instance>/databases/<database>/databaseRoles`.
+ *
+ *
+ *
+ * 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_;
+ /**
+ *
+ *
+ *
+ * Number of database roles to be returned in the response. If 0 or less,
+ * defaults to the server's maximum allowed page size.
+ *
+ *
+ * int32 page_size = 2;
+ *
+ * @return The pageSize.
+ */
+ @java.lang.Override
+ public int getPageSize() {
+ return pageSize_;
+ }
+
+ public static final int PAGE_TOKEN_FIELD_NUMBER = 3;
+ private volatile java.lang.Object pageToken_;
+ /**
+ *
+ *
+ *
+ * If non-empty, `page_token` should contain a
+ * [next_page_token][google.spanner.admin.database.v1.ListDatabaseRolesResponse.next_page_token] from a
+ * previous [ListDatabaseRolesResponse][google.spanner.admin.database.v1.ListDatabaseRolesResponse].
+ *
+ *
+ * string page_token = 3;
+ *
+ * @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;
+ }
+ }
+ /**
+ *
+ *
+ *
+ * If non-empty, `page_token` should contain a
+ * [next_page_token][google.spanner.admin.database.v1.ListDatabaseRolesResponse.next_page_token] from a
+ * previous [ListDatabaseRolesResponse][google.spanner.admin.database.v1.ListDatabaseRolesResponse].
+ *
+ *
+ * string page_token = 3;
+ *
+ * @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;
+ }
+ }
+
+ 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_);
+ }
+ unknownFields.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_);
+ }
+ size += unknownFields.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.spanner.admin.database.v1.ListDatabaseRolesRequest)) {
+ return super.equals(obj);
+ }
+ com.google.spanner.admin.database.v1.ListDatabaseRolesRequest other =
+ (com.google.spanner.admin.database.v1.ListDatabaseRolesRequest) obj;
+
+ if (!getParent().equals(other.getParent())) return false;
+ if (getPageSize() != other.getPageSize()) return false;
+ if (!getPageToken().equals(other.getPageToken())) return false;
+ if (!unknownFields.equals(other.unknownFields)) 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 = (29 * hash) + unknownFields.hashCode();
+ memoizedHashCode = hash;
+ return hash;
+ }
+
+ public static com.google.spanner.admin.database.v1.ListDatabaseRolesRequest parseFrom(
+ java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+
+ public static com.google.spanner.admin.database.v1.ListDatabaseRolesRequest parseFrom(
+ java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data, extensionRegistry);
+ }
+
+ public static com.google.spanner.admin.database.v1.ListDatabaseRolesRequest parseFrom(
+ com.google.protobuf.ByteString data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+
+ public static com.google.spanner.admin.database.v1.ListDatabaseRolesRequest 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.spanner.admin.database.v1.ListDatabaseRolesRequest parseFrom(byte[] data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+
+ public static com.google.spanner.admin.database.v1.ListDatabaseRolesRequest parseFrom(
+ byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data, extensionRegistry);
+ }
+
+ public static com.google.spanner.admin.database.v1.ListDatabaseRolesRequest parseFrom(
+ java.io.InputStream input) throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
+ }
+
+ public static com.google.spanner.admin.database.v1.ListDatabaseRolesRequest 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.spanner.admin.database.v1.ListDatabaseRolesRequest parseDelimitedFrom(
+ java.io.InputStream input) throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input);
+ }
+
+ public static com.google.spanner.admin.database.v1.ListDatabaseRolesRequest 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.spanner.admin.database.v1.ListDatabaseRolesRequest parseFrom(
+ com.google.protobuf.CodedInputStream input) throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
+ }
+
+ public static com.google.spanner.admin.database.v1.ListDatabaseRolesRequest 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.spanner.admin.database.v1.ListDatabaseRolesRequest 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;
+ }
+ /**
+ *
+ *
+ *
+ * The request for [ListDatabaseRoles][google.spanner.admin.database.v1.DatabaseAdmin.ListDatabaseRoles].
+ *
+ *
+ * Protobuf type {@code google.spanner.admin.database.v1.ListDatabaseRolesRequest}
+ */
+ public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder
+ * Required. The database whose roles should be listed.
+ * Values are of the form
+ * `projects/<project>/instances/<instance>/databases/<database>/databaseRoles`.
+ *
+ *
+ *
+ * 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 database whose roles should be listed.
+ * Values are of the form
+ * `projects/<project>/instances/<instance>/databases/<database>/databaseRoles`.
+ *
+ *
+ *
+ * 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 database whose roles should be listed.
+ * Values are of the form
+ * `projects/<project>/instances/<instance>/databases/<database>/databaseRoles`.
+ *
+ *
+ *
+ * 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;
+ onChanged();
+ return this;
+ }
+ /**
+ *
+ *
+ *
+ * Required. The database whose roles should be listed.
+ * Values are of the form
+ * `projects/<project>/instances/<instance>/databases/<database>/databaseRoles`.
+ *
+ *
+ *
+ * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }
+ *
+ *
+ * @return This builder for chaining.
+ */
+ public Builder clearParent() {
+
+ parent_ = getDefaultInstance().getParent();
+ onChanged();
+ return this;
+ }
+ /**
+ *
+ *
+ *
+ * Required. The database whose roles should be listed.
+ * Values are of the form
+ * `projects/<project>/instances/<instance>/databases/<database>/databaseRoles`.
+ *
+ *
+ *
+ * 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;
+ onChanged();
+ return this;
+ }
+
+ private int pageSize_;
+ /**
+ *
+ *
+ *
+ * Number of database roles to be returned in the response. If 0 or less,
+ * defaults to the server's maximum allowed page size.
+ *
+ *
+ * int32 page_size = 2;
+ *
+ * @return The pageSize.
+ */
+ @java.lang.Override
+ public int getPageSize() {
+ return pageSize_;
+ }
+ /**
+ *
+ *
+ *
+ * Number of database roles to be returned in the response. If 0 or less,
+ * defaults to the server's maximum allowed page size.
+ *
+ *
+ * int32 page_size = 2;
+ *
+ * @param value The pageSize to set.
+ * @return This builder for chaining.
+ */
+ public Builder setPageSize(int value) {
+
+ pageSize_ = value;
+ onChanged();
+ return this;
+ }
+ /**
+ *
+ *
+ *
+ * Number of database roles to be returned in the response. If 0 or less,
+ * defaults to the server's maximum allowed page size.
+ *
+ *
+ * int32 page_size = 2;
+ *
+ * @return This builder for chaining.
+ */
+ public Builder clearPageSize() {
+
+ pageSize_ = 0;
+ onChanged();
+ return this;
+ }
+
+ private java.lang.Object pageToken_ = "";
+ /**
+ *
+ *
+ *
+ * If non-empty, `page_token` should contain a
+ * [next_page_token][google.spanner.admin.database.v1.ListDatabaseRolesResponse.next_page_token] from a
+ * previous [ListDatabaseRolesResponse][google.spanner.admin.database.v1.ListDatabaseRolesResponse].
+ *
+ *
+ * string page_token = 3;
+ *
+ * @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;
+ }
+ }
+ /**
+ *
+ *
+ *
+ * If non-empty, `page_token` should contain a
+ * [next_page_token][google.spanner.admin.database.v1.ListDatabaseRolesResponse.next_page_token] from a
+ * previous [ListDatabaseRolesResponse][google.spanner.admin.database.v1.ListDatabaseRolesResponse].
+ *
+ *
+ * string page_token = 3;
+ *
+ * @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;
+ }
+ }
+ /**
+ *
+ *
+ *
+ * If non-empty, `page_token` should contain a
+ * [next_page_token][google.spanner.admin.database.v1.ListDatabaseRolesResponse.next_page_token] from a
+ * previous [ListDatabaseRolesResponse][google.spanner.admin.database.v1.ListDatabaseRolesResponse].
+ *
+ *
+ * string page_token = 3;
+ *
+ * @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;
+ onChanged();
+ return this;
+ }
+ /**
+ *
+ *
+ *
+ * If non-empty, `page_token` should contain a
+ * [next_page_token][google.spanner.admin.database.v1.ListDatabaseRolesResponse.next_page_token] from a
+ * previous [ListDatabaseRolesResponse][google.spanner.admin.database.v1.ListDatabaseRolesResponse].
+ *
+ *
+ * string page_token = 3;
+ *
+ * @return This builder for chaining.
+ */
+ public Builder clearPageToken() {
+
+ pageToken_ = getDefaultInstance().getPageToken();
+ onChanged();
+ return this;
+ }
+ /**
+ *
+ *
+ *
+ * If non-empty, `page_token` should contain a
+ * [next_page_token][google.spanner.admin.database.v1.ListDatabaseRolesResponse.next_page_token] from a
+ * previous [ListDatabaseRolesResponse][google.spanner.admin.database.v1.ListDatabaseRolesResponse].
+ *
+ *
+ * string page_token = 3;
+ *
+ * @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;
+ 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.spanner.admin.database.v1.ListDatabaseRolesRequest)
+ }
+
+ // @@protoc_insertion_point(class_scope:google.spanner.admin.database.v1.ListDatabaseRolesRequest)
+ private static final com.google.spanner.admin.database.v1.ListDatabaseRolesRequest
+ DEFAULT_INSTANCE;
+
+ static {
+ DEFAULT_INSTANCE = new com.google.spanner.admin.database.v1.ListDatabaseRolesRequest();
+ }
+
+ public static com.google.spanner.admin.database.v1.ListDatabaseRolesRequest getDefaultInstance() {
+ return DEFAULT_INSTANCE;
+ }
+
+ private static final com.google.protobuf.Parser
+ * Required. The database whose roles should be listed.
+ * Values are of the form
+ * `projects/<project>/instances/<instance>/databases/<database>/databaseRoles`.
+ *
+ *
+ *
+ * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }
+ *
+ *
+ * @return The parent.
+ */
+ java.lang.String getParent();
+ /**
+ *
+ *
+ *
+ * Required. The database whose roles should be listed.
+ * Values are of the form
+ * `projects/<project>/instances/<instance>/databases/<database>/databaseRoles`.
+ *
+ *
+ *
+ * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }
+ *
+ *
+ * @return The bytes for parent.
+ */
+ com.google.protobuf.ByteString getParentBytes();
+
+ /**
+ *
+ *
+ *
+ * Number of database roles to be returned in the response. If 0 or less,
+ * defaults to the server's maximum allowed page size.
+ *
+ *
+ * int32 page_size = 2;
+ *
+ * @return The pageSize.
+ */
+ int getPageSize();
+
+ /**
+ *
+ *
+ *
+ * If non-empty, `page_token` should contain a
+ * [next_page_token][google.spanner.admin.database.v1.ListDatabaseRolesResponse.next_page_token] from a
+ * previous [ListDatabaseRolesResponse][google.spanner.admin.database.v1.ListDatabaseRolesResponse].
+ *
+ *
+ * string page_token = 3;
+ *
+ * @return The pageToken.
+ */
+ java.lang.String getPageToken();
+ /**
+ *
+ *
+ *
+ * If non-empty, `page_token` should contain a
+ * [next_page_token][google.spanner.admin.database.v1.ListDatabaseRolesResponse.next_page_token] from a
+ * previous [ListDatabaseRolesResponse][google.spanner.admin.database.v1.ListDatabaseRolesResponse].
+ *
+ *
+ * string page_token = 3;
+ *
+ * @return The bytes for pageToken.
+ */
+ com.google.protobuf.ByteString getPageTokenBytes();
+}
diff --git a/proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/ListDatabaseRolesResponse.java b/proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/ListDatabaseRolesResponse.java
new file mode 100644
index 00000000000..2cd12f3b615
--- /dev/null
+++ b/proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/ListDatabaseRolesResponse.java
@@ -0,0 +1,1167 @@
+/*
+ * Copyright 2020 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT 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/spanner/admin/database/v1/spanner_database_admin.proto
+
+package com.google.spanner.admin.database.v1;
+
+/**
+ *
+ *
+ *
+ * The response for [ListDatabaseRoles][google.spanner.admin.database.v1.DatabaseAdmin.ListDatabaseRoles].
+ *
+ *
+ * Protobuf type {@code google.spanner.admin.database.v1.ListDatabaseRolesResponse}
+ */
+public final class ListDatabaseRolesResponse extends com.google.protobuf.GeneratedMessageV3
+ implements
+ // @@protoc_insertion_point(message_implements:google.spanner.admin.database.v1.ListDatabaseRolesResponse)
+ ListDatabaseRolesResponseOrBuilder {
+ private static final long serialVersionUID = 0L;
+ // Use ListDatabaseRolesResponse.newBuilder() to construct.
+ private ListDatabaseRolesResponse(com.google.protobuf.GeneratedMessageV3.Builder> builder) {
+ super(builder);
+ }
+
+ private ListDatabaseRolesResponse() {
+ databaseRoles_ = java.util.Collections.emptyList();
+ nextPageToken_ = "";
+ }
+
+ @java.lang.Override
+ @SuppressWarnings({"unused"})
+ protected java.lang.Object newInstance(UnusedPrivateParameter unused) {
+ return new ListDatabaseRolesResponse();
+ }
+
+ @java.lang.Override
+ public final com.google.protobuf.UnknownFieldSet getUnknownFields() {
+ return this.unknownFields;
+ }
+
+ private ListDatabaseRolesResponse(
+ com.google.protobuf.CodedInputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ this();
+ if (extensionRegistry == null) {
+ throw new java.lang.NullPointerException();
+ }
+ int mutable_bitField0_ = 0;
+ com.google.protobuf.UnknownFieldSet.Builder unknownFields =
+ com.google.protobuf.UnknownFieldSet.newBuilder();
+ try {
+ boolean done = false;
+ while (!done) {
+ int tag = input.readTag();
+ switch (tag) {
+ case 0:
+ done = true;
+ break;
+ case 10:
+ {
+ if (!((mutable_bitField0_ & 0x00000001) != 0)) {
+ databaseRoles_ =
+ new java.util.ArrayList
+ * Database roles that matched the request.
+ *
+ *
+ * repeated .google.spanner.admin.database.v1.DatabaseRole database_roles = 1;
+ */
+ @java.lang.Override
+ public java.util.List
+ * Database roles that matched the request.
+ *
+ *
+ * repeated .google.spanner.admin.database.v1.DatabaseRole database_roles = 1;
+ */
+ @java.lang.Override
+ public java.util.List extends com.google.spanner.admin.database.v1.DatabaseRoleOrBuilder>
+ getDatabaseRolesOrBuilderList() {
+ return databaseRoles_;
+ }
+ /**
+ *
+ *
+ *
+ * Database roles that matched the request.
+ *
+ *
+ * repeated .google.spanner.admin.database.v1.DatabaseRole database_roles = 1;
+ */
+ @java.lang.Override
+ public int getDatabaseRolesCount() {
+ return databaseRoles_.size();
+ }
+ /**
+ *
+ *
+ *
+ * Database roles that matched the request.
+ *
+ *
+ * repeated .google.spanner.admin.database.v1.DatabaseRole database_roles = 1;
+ */
+ @java.lang.Override
+ public com.google.spanner.admin.database.v1.DatabaseRole getDatabaseRoles(int index) {
+ return databaseRoles_.get(index);
+ }
+ /**
+ *
+ *
+ *
+ * Database roles that matched the request.
+ *
+ *
+ * repeated .google.spanner.admin.database.v1.DatabaseRole database_roles = 1;
+ */
+ @java.lang.Override
+ public com.google.spanner.admin.database.v1.DatabaseRoleOrBuilder getDatabaseRolesOrBuilder(
+ int index) {
+ return databaseRoles_.get(index);
+ }
+
+ public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 2;
+ private volatile java.lang.Object nextPageToken_;
+ /**
+ *
+ *
+ *
+ * `next_page_token` can be sent in a subsequent
+ * [ListDatabaseRoles][google.spanner.admin.database.v1.DatabaseAdmin.ListDatabaseRoles]
+ * call to fetch more of the matching roles.
+ *
+ *
+ * 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;
+ }
+ }
+ /**
+ *
+ *
+ *
+ * `next_page_token` can be sent in a subsequent
+ * [ListDatabaseRoles][google.spanner.admin.database.v1.DatabaseAdmin.ListDatabaseRoles]
+ * call to fetch more of the matching roles.
+ *
+ *
+ * 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;
+ }
+ }
+
+ 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 < databaseRoles_.size(); i++) {
+ output.writeMessage(1, databaseRoles_.get(i));
+ }
+ if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) {
+ com.google.protobuf.GeneratedMessageV3.writeString(output, 2, nextPageToken_);
+ }
+ unknownFields.writeTo(output);
+ }
+
+ @java.lang.Override
+ public int getSerializedSize() {
+ int size = memoizedSize;
+ if (size != -1) return size;
+
+ size = 0;
+ for (int i = 0; i < databaseRoles_.size(); i++) {
+ size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, databaseRoles_.get(i));
+ }
+ if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) {
+ size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, nextPageToken_);
+ }
+ size += unknownFields.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.spanner.admin.database.v1.ListDatabaseRolesResponse)) {
+ return super.equals(obj);
+ }
+ com.google.spanner.admin.database.v1.ListDatabaseRolesResponse other =
+ (com.google.spanner.admin.database.v1.ListDatabaseRolesResponse) obj;
+
+ if (!getDatabaseRolesList().equals(other.getDatabaseRolesList())) return false;
+ if (!getNextPageToken().equals(other.getNextPageToken())) return false;
+ if (!unknownFields.equals(other.unknownFields)) return false;
+ return true;
+ }
+
+ @java.lang.Override
+ public int hashCode() {
+ if (memoizedHashCode != 0) {
+ return memoizedHashCode;
+ }
+ int hash = 41;
+ hash = (19 * hash) + getDescriptor().hashCode();
+ if (getDatabaseRolesCount() > 0) {
+ hash = (37 * hash) + DATABASE_ROLES_FIELD_NUMBER;
+ hash = (53 * hash) + getDatabaseRolesList().hashCode();
+ }
+ hash = (37 * hash) + NEXT_PAGE_TOKEN_FIELD_NUMBER;
+ hash = (53 * hash) + getNextPageToken().hashCode();
+ hash = (29 * hash) + unknownFields.hashCode();
+ memoizedHashCode = hash;
+ return hash;
+ }
+
+ public static com.google.spanner.admin.database.v1.ListDatabaseRolesResponse parseFrom(
+ java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+
+ public static com.google.spanner.admin.database.v1.ListDatabaseRolesResponse parseFrom(
+ java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data, extensionRegistry);
+ }
+
+ public static com.google.spanner.admin.database.v1.ListDatabaseRolesResponse parseFrom(
+ com.google.protobuf.ByteString data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+
+ public static com.google.spanner.admin.database.v1.ListDatabaseRolesResponse 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.spanner.admin.database.v1.ListDatabaseRolesResponse parseFrom(
+ byte[] data) throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+
+ public static com.google.spanner.admin.database.v1.ListDatabaseRolesResponse parseFrom(
+ byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data, extensionRegistry);
+ }
+
+ public static com.google.spanner.admin.database.v1.ListDatabaseRolesResponse parseFrom(
+ java.io.InputStream input) throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
+ }
+
+ public static com.google.spanner.admin.database.v1.ListDatabaseRolesResponse 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.spanner.admin.database.v1.ListDatabaseRolesResponse parseDelimitedFrom(
+ java.io.InputStream input) throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input);
+ }
+
+ public static com.google.spanner.admin.database.v1.ListDatabaseRolesResponse 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.spanner.admin.database.v1.ListDatabaseRolesResponse parseFrom(
+ com.google.protobuf.CodedInputStream input) throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
+ }
+
+ public static com.google.spanner.admin.database.v1.ListDatabaseRolesResponse 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.spanner.admin.database.v1.ListDatabaseRolesResponse 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;
+ }
+ /**
+ *
+ *
+ *
+ * The response for [ListDatabaseRoles][google.spanner.admin.database.v1.DatabaseAdmin.ListDatabaseRoles].
+ *
+ *
+ * Protobuf type {@code google.spanner.admin.database.v1.ListDatabaseRolesResponse}
+ */
+ public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder
+ * Database roles that matched the request.
+ *
+ *
+ * repeated .google.spanner.admin.database.v1.DatabaseRole database_roles = 1;
+ */
+ public java.util.List
+ * Database roles that matched the request.
+ *
+ *
+ * repeated .google.spanner.admin.database.v1.DatabaseRole database_roles = 1;
+ */
+ public int getDatabaseRolesCount() {
+ if (databaseRolesBuilder_ == null) {
+ return databaseRoles_.size();
+ } else {
+ return databaseRolesBuilder_.getCount();
+ }
+ }
+ /**
+ *
+ *
+ *
+ * Database roles that matched the request.
+ *
+ *
+ * repeated .google.spanner.admin.database.v1.DatabaseRole database_roles = 1;
+ */
+ public com.google.spanner.admin.database.v1.DatabaseRole getDatabaseRoles(int index) {
+ if (databaseRolesBuilder_ == null) {
+ return databaseRoles_.get(index);
+ } else {
+ return databaseRolesBuilder_.getMessage(index);
+ }
+ }
+ /**
+ *
+ *
+ *
+ * Database roles that matched the request.
+ *
+ *
+ * repeated .google.spanner.admin.database.v1.DatabaseRole database_roles = 1;
+ */
+ public Builder setDatabaseRoles(
+ int index, com.google.spanner.admin.database.v1.DatabaseRole value) {
+ if (databaseRolesBuilder_ == null) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ ensureDatabaseRolesIsMutable();
+ databaseRoles_.set(index, value);
+ onChanged();
+ } else {
+ databaseRolesBuilder_.setMessage(index, value);
+ }
+ return this;
+ }
+ /**
+ *
+ *
+ *
+ * Database roles that matched the request.
+ *
+ *
+ * repeated .google.spanner.admin.database.v1.DatabaseRole database_roles = 1;
+ */
+ public Builder setDatabaseRoles(
+ int index, com.google.spanner.admin.database.v1.DatabaseRole.Builder builderForValue) {
+ if (databaseRolesBuilder_ == null) {
+ ensureDatabaseRolesIsMutable();
+ databaseRoles_.set(index, builderForValue.build());
+ onChanged();
+ } else {
+ databaseRolesBuilder_.setMessage(index, builderForValue.build());
+ }
+ return this;
+ }
+ /**
+ *
+ *
+ *
+ * Database roles that matched the request.
+ *
+ *
+ * repeated .google.spanner.admin.database.v1.DatabaseRole database_roles = 1;
+ */
+ public Builder addDatabaseRoles(com.google.spanner.admin.database.v1.DatabaseRole value) {
+ if (databaseRolesBuilder_ == null) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ ensureDatabaseRolesIsMutable();
+ databaseRoles_.add(value);
+ onChanged();
+ } else {
+ databaseRolesBuilder_.addMessage(value);
+ }
+ return this;
+ }
+ /**
+ *
+ *
+ *
+ * Database roles that matched the request.
+ *
+ *
+ * repeated .google.spanner.admin.database.v1.DatabaseRole database_roles = 1;
+ */
+ public Builder addDatabaseRoles(
+ int index, com.google.spanner.admin.database.v1.DatabaseRole value) {
+ if (databaseRolesBuilder_ == null) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ ensureDatabaseRolesIsMutable();
+ databaseRoles_.add(index, value);
+ onChanged();
+ } else {
+ databaseRolesBuilder_.addMessage(index, value);
+ }
+ return this;
+ }
+ /**
+ *
+ *
+ *
+ * Database roles that matched the request.
+ *
+ *
+ * repeated .google.spanner.admin.database.v1.DatabaseRole database_roles = 1;
+ */
+ public Builder addDatabaseRoles(
+ com.google.spanner.admin.database.v1.DatabaseRole.Builder builderForValue) {
+ if (databaseRolesBuilder_ == null) {
+ ensureDatabaseRolesIsMutable();
+ databaseRoles_.add(builderForValue.build());
+ onChanged();
+ } else {
+ databaseRolesBuilder_.addMessage(builderForValue.build());
+ }
+ return this;
+ }
+ /**
+ *
+ *
+ *
+ * Database roles that matched the request.
+ *
+ *
+ * repeated .google.spanner.admin.database.v1.DatabaseRole database_roles = 1;
+ */
+ public Builder addDatabaseRoles(
+ int index, com.google.spanner.admin.database.v1.DatabaseRole.Builder builderForValue) {
+ if (databaseRolesBuilder_ == null) {
+ ensureDatabaseRolesIsMutable();
+ databaseRoles_.add(index, builderForValue.build());
+ onChanged();
+ } else {
+ databaseRolesBuilder_.addMessage(index, builderForValue.build());
+ }
+ return this;
+ }
+ /**
+ *
+ *
+ *
+ * Database roles that matched the request.
+ *
+ *
+ * repeated .google.spanner.admin.database.v1.DatabaseRole database_roles = 1;
+ */
+ public Builder addAllDatabaseRoles(
+ java.lang.Iterable extends com.google.spanner.admin.database.v1.DatabaseRole> values) {
+ if (databaseRolesBuilder_ == null) {
+ ensureDatabaseRolesIsMutable();
+ com.google.protobuf.AbstractMessageLite.Builder.addAll(values, databaseRoles_);
+ onChanged();
+ } else {
+ databaseRolesBuilder_.addAllMessages(values);
+ }
+ return this;
+ }
+ /**
+ *
+ *
+ *
+ * Database roles that matched the request.
+ *
+ *
+ * repeated .google.spanner.admin.database.v1.DatabaseRole database_roles = 1;
+ */
+ public Builder clearDatabaseRoles() {
+ if (databaseRolesBuilder_ == null) {
+ databaseRoles_ = java.util.Collections.emptyList();
+ bitField0_ = (bitField0_ & ~0x00000001);
+ onChanged();
+ } else {
+ databaseRolesBuilder_.clear();
+ }
+ return this;
+ }
+ /**
+ *
+ *
+ *
+ * Database roles that matched the request.
+ *
+ *
+ * repeated .google.spanner.admin.database.v1.DatabaseRole database_roles = 1;
+ */
+ public Builder removeDatabaseRoles(int index) {
+ if (databaseRolesBuilder_ == null) {
+ ensureDatabaseRolesIsMutable();
+ databaseRoles_.remove(index);
+ onChanged();
+ } else {
+ databaseRolesBuilder_.remove(index);
+ }
+ return this;
+ }
+ /**
+ *
+ *
+ *
+ * Database roles that matched the request.
+ *
+ *
+ * repeated .google.spanner.admin.database.v1.DatabaseRole database_roles = 1;
+ */
+ public com.google.spanner.admin.database.v1.DatabaseRole.Builder getDatabaseRolesBuilder(
+ int index) {
+ return getDatabaseRolesFieldBuilder().getBuilder(index);
+ }
+ /**
+ *
+ *
+ *
+ * Database roles that matched the request.
+ *
+ *
+ * repeated .google.spanner.admin.database.v1.DatabaseRole database_roles = 1;
+ */
+ public com.google.spanner.admin.database.v1.DatabaseRoleOrBuilder getDatabaseRolesOrBuilder(
+ int index) {
+ if (databaseRolesBuilder_ == null) {
+ return databaseRoles_.get(index);
+ } else {
+ return databaseRolesBuilder_.getMessageOrBuilder(index);
+ }
+ }
+ /**
+ *
+ *
+ *
+ * Database roles that matched the request.
+ *
+ *
+ * repeated .google.spanner.admin.database.v1.DatabaseRole database_roles = 1;
+ */
+ public java.util.List extends com.google.spanner.admin.database.v1.DatabaseRoleOrBuilder>
+ getDatabaseRolesOrBuilderList() {
+ if (databaseRolesBuilder_ != null) {
+ return databaseRolesBuilder_.getMessageOrBuilderList();
+ } else {
+ return java.util.Collections.unmodifiableList(databaseRoles_);
+ }
+ }
+ /**
+ *
+ *
+ *
+ * Database roles that matched the request.
+ *
+ *
+ * repeated .google.spanner.admin.database.v1.DatabaseRole database_roles = 1;
+ */
+ public com.google.spanner.admin.database.v1.DatabaseRole.Builder addDatabaseRolesBuilder() {
+ return getDatabaseRolesFieldBuilder()
+ .addBuilder(com.google.spanner.admin.database.v1.DatabaseRole.getDefaultInstance());
+ }
+ /**
+ *
+ *
+ *
+ * Database roles that matched the request.
+ *
+ *
+ * repeated .google.spanner.admin.database.v1.DatabaseRole database_roles = 1;
+ */
+ public com.google.spanner.admin.database.v1.DatabaseRole.Builder addDatabaseRolesBuilder(
+ int index) {
+ return getDatabaseRolesFieldBuilder()
+ .addBuilder(
+ index, com.google.spanner.admin.database.v1.DatabaseRole.getDefaultInstance());
+ }
+ /**
+ *
+ *
+ *
+ * Database roles that matched the request.
+ *
+ *
+ * repeated .google.spanner.admin.database.v1.DatabaseRole database_roles = 1;
+ */
+ public java.util.List
+ * `next_page_token` can be sent in a subsequent
+ * [ListDatabaseRoles][google.spanner.admin.database.v1.DatabaseAdmin.ListDatabaseRoles]
+ * call to fetch more of the matching roles.
+ *
+ *
+ * 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;
+ }
+ }
+ /**
+ *
+ *
+ *
+ * `next_page_token` can be sent in a subsequent
+ * [ListDatabaseRoles][google.spanner.admin.database.v1.DatabaseAdmin.ListDatabaseRoles]
+ * call to fetch more of the matching roles.
+ *
+ *
+ * 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;
+ }
+ }
+ /**
+ *
+ *
+ *
+ * `next_page_token` can be sent in a subsequent
+ * [ListDatabaseRoles][google.spanner.admin.database.v1.DatabaseAdmin.ListDatabaseRoles]
+ * call to fetch more of the matching roles.
+ *
+ *
+ * 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;
+ onChanged();
+ return this;
+ }
+ /**
+ *
+ *
+ *
+ * `next_page_token` can be sent in a subsequent
+ * [ListDatabaseRoles][google.spanner.admin.database.v1.DatabaseAdmin.ListDatabaseRoles]
+ * call to fetch more of the matching roles.
+ *
+ *
+ * string next_page_token = 2;
+ *
+ * @return This builder for chaining.
+ */
+ public Builder clearNextPageToken() {
+
+ nextPageToken_ = getDefaultInstance().getNextPageToken();
+ onChanged();
+ return this;
+ }
+ /**
+ *
+ *
+ *
+ * `next_page_token` can be sent in a subsequent
+ * [ListDatabaseRoles][google.spanner.admin.database.v1.DatabaseAdmin.ListDatabaseRoles]
+ * call to fetch more of the matching roles.
+ *
+ *
+ * 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;
+ 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.spanner.admin.database.v1.ListDatabaseRolesResponse)
+ }
+
+ // @@protoc_insertion_point(class_scope:google.spanner.admin.database.v1.ListDatabaseRolesResponse)
+ private static final com.google.spanner.admin.database.v1.ListDatabaseRolesResponse
+ DEFAULT_INSTANCE;
+
+ static {
+ DEFAULT_INSTANCE = new com.google.spanner.admin.database.v1.ListDatabaseRolesResponse();
+ }
+
+ public static com.google.spanner.admin.database.v1.ListDatabaseRolesResponse
+ getDefaultInstance() {
+ return DEFAULT_INSTANCE;
+ }
+
+ private static final com.google.protobuf.Parser
+ * Database roles that matched the request.
+ *
+ *
+ * repeated .google.spanner.admin.database.v1.DatabaseRole database_roles = 1;
+ */
+ java.util.List
+ * Database roles that matched the request.
+ *
+ *
+ * repeated .google.spanner.admin.database.v1.DatabaseRole database_roles = 1;
+ */
+ com.google.spanner.admin.database.v1.DatabaseRole getDatabaseRoles(int index);
+ /**
+ *
+ *
+ *
+ * Database roles that matched the request.
+ *
+ *
+ * repeated .google.spanner.admin.database.v1.DatabaseRole database_roles = 1;
+ */
+ int getDatabaseRolesCount();
+ /**
+ *
+ *
+ *
+ * Database roles that matched the request.
+ *
+ *
+ * repeated .google.spanner.admin.database.v1.DatabaseRole database_roles = 1;
+ */
+ java.util.List extends com.google.spanner.admin.database.v1.DatabaseRoleOrBuilder>
+ getDatabaseRolesOrBuilderList();
+ /**
+ *
+ *
+ *
+ * Database roles that matched the request.
+ *
+ *
+ * repeated .google.spanner.admin.database.v1.DatabaseRole database_roles = 1;
+ */
+ com.google.spanner.admin.database.v1.DatabaseRoleOrBuilder getDatabaseRolesOrBuilder(int index);
+
+ /**
+ *
+ *
+ *
+ * `next_page_token` can be sent in a subsequent
+ * [ListDatabaseRoles][google.spanner.admin.database.v1.DatabaseAdmin.ListDatabaseRoles]
+ * call to fetch more of the matching roles.
+ *
+ *
+ * string next_page_token = 2;
+ *
+ * @return The nextPageToken.
+ */
+ java.lang.String getNextPageToken();
+ /**
+ *
+ *
+ *
+ * `next_page_token` can be sent in a subsequent
+ * [ListDatabaseRoles][google.spanner.admin.database.v1.DatabaseAdmin.ListDatabaseRoles]
+ * call to fetch more of the matching roles.
+ *
+ *
+ * string next_page_token = 2;
+ *
+ * @return The bytes for nextPageToken.
+ */
+ com.google.protobuf.ByteString getNextPageTokenBytes();
+}
diff --git a/proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/SpannerDatabaseAdminProto.java b/proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/SpannerDatabaseAdminProto.java
index 8aa471048a2..9a4c1888ef2 100644
--- a/proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/SpannerDatabaseAdminProto.java
+++ b/proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/SpannerDatabaseAdminProto.java
@@ -99,6 +99,18 @@ public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry r
internal_static_google_spanner_admin_database_v1_OptimizeRestoredDatabaseMetadata_descriptor;
static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_google_spanner_admin_database_v1_OptimizeRestoredDatabaseMetadata_fieldAccessorTable;
+ static final com.google.protobuf.Descriptors.Descriptor
+ internal_static_google_spanner_admin_database_v1_DatabaseRole_descriptor;
+ static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
+ internal_static_google_spanner_admin_database_v1_DatabaseRole_fieldAccessorTable;
+ static final com.google.protobuf.Descriptors.Descriptor
+ internal_static_google_spanner_admin_database_v1_ListDatabaseRolesRequest_descriptor;
+ static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
+ internal_static_google_spanner_admin_database_v1_ListDatabaseRolesRequest_fieldAccessorTable;
+ static final com.google.protobuf.Descriptors.Descriptor
+ internal_static_google_spanner_admin_database_v1_ListDatabaseRolesResponse_descriptor;
+ static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
+ internal_static_google_spanner_admin_database_v1_ListDatabaseRolesResponse_fieldAccessorTable;
public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() {
return descriptor;
@@ -212,125 +224,143 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() {
+ "OptimizeRestoredDatabaseMetadata\0222\n\004name"
+ "\030\001 \001(\tB$\372A!\n\037spanner.googleapis.com/Data"
+ "base\022E\n\010progress\030\002 \001(\01323.google.spanner."
- + "admin.database.v1.OperationProgress*5\n\021R"
- + "estoreSourceType\022\024\n\020TYPE_UNSPECIFIED\020\000\022\n"
- + "\n\006BACKUP\020\0012\302!\n\rDatabaseAdmin\022\300\001\n\rListDat"
- + "abases\0226.google.spanner.admin.database.v"
- + "1.ListDatabasesRequest\0327.google.spanner."
- + "admin.database.v1.ListDatabasesResponse\""
- + ">\202\323\344\223\002/\022-/v1/{parent=projects/*/instance"
- + "s/*}/databases\332A\006parent\022\244\002\n\016CreateDataba"
- + "se\0227.google.spanner.admin.database.v1.Cr"
- + "eateDatabaseRequest\032\035.google.longrunning"
- + ".Operation\"\271\001\202\323\344\223\0022\"-/v1/{parent=project"
- + "s/*/instances/*}/databases:\001*\332A\027parent,c"
- + "reate_statement\312Ad\n)google.spanner.admin"
- + ".database.v1.Database\0227google.spanner.ad"
- + "min.database.v1.CreateDatabaseMetadata\022\255"
- + "\001\n\013GetDatabase\0224.google.spanner.admin.da"
- + "tabase.v1.GetDatabaseRequest\032*.google.sp"
- + "anner.admin.database.v1.Database\"<\202\323\344\223\002/"
- + "\022-/v1/{name=projects/*/instances/*/datab"
- + "ases/*}\332A\004name\022\235\002\n\021UpdateDatabaseDdl\022:.g"
- + "oogle.spanner.admin.database.v1.UpdateDa"
- + "tabaseDdlRequest\032\035.google.longrunning.Op"
- + "eration\"\254\001\202\323\344\223\002:25/v1/{database=projects"
- + "/*/instances/*/databases/*}/ddl:\001*\332A\023dat"
- + "abase,statements\312AS\n\025google.protobuf.Emp"
- + "ty\022:google.spanner.admin.database.v1.Upd"
- + "ateDatabaseDdlMetadata\022\243\001\n\014DropDatabase\022"
- + "5.google.spanner.admin.database.v1.DropD"
- + "atabaseRequest\032\026.google.protobuf.Empty\"D"
- + "\202\323\344\223\0023*1/v1/{database=projects/*/instanc"
- + "es/*/databases/*}\332A\010database\022\315\001\n\016GetData"
- + "baseDdl\0227.google.spanner.admin.database."
- + "v1.GetDatabaseDdlRequest\0328.google.spanne"
- + "r.admin.database.v1.GetDatabaseDdlRespon"
- + "se\"H\202\323\344\223\0027\0225/v1/{database=projects/*/ins"
- + "tances/*/databases/*}/ddl\332A\010database\022\353\001\n"
- + "\014SetIamPolicy\022\".google.iam.v1.SetIamPoli"
- + "cyRequest\032\025.google.iam.v1.Policy\"\237\001\202\323\344\223\002"
- + "\206\001\">/v1/{resource=projects/*/instances/*"
- + "/databases/*}:setIamPolicy:\001*ZA\"/v1/{resource=projects/*/instances/*/d"
- + "atabases/*}:getIamPolicy:\001*ZA\".google.spanner.admin.database.v"
- + "1.ListBackupOperationsResponse\"E\202\323\344\223\0026\0224"
- + "/v1/{parent=projects/*/instances/*}/back"
- + "upOperations\332A\006parent\032x\312A\026spanner.google"
- + "apis.com\322A\\https://www.googleapis.com/au"
- + "th/cloud-platform,https://www.googleapis"
- + ".com/auth/spanner.adminB\332\002\n$com.google.s"
- + "panner.admin.database.v1B\031SpannerDatabas"
- + "eAdminProtoP\001ZHgoogle.golang.org/genprot"
- + "o/googleapis/spanner/admin/database/v1;d"
- + "atabase\252\002&Google.Cloud.Spanner.Admin.Dat"
- + "abase.V1\312\002&Google\\Cloud\\Spanner\\Admin\\Da"
- + "tabase\\V1\352\002+Google::Cloud::Spanner::Admi"
- + "n::Database::V1\352AJ\n\037spanner.googleapis.c"
- + "om/Instance\022\'projects/{project}/instance"
- + "s/{instance}b\006proto3"
+ + "admin.database.v1.OperationProgress\"\236\001\n\014"
+ + "DatabaseRole\022\021\n\004name\030\001 \001(\tB\003\340A\002:{\352Ax\n#sp"
+ + "anner.googleapis.com/DatabaseRole\022Qproje"
+ + "cts/{project}/instances/{instance}/datab"
+ + "ases/{database}/databaseRoles/{role}\"z\n\030"
+ + "ListDatabaseRolesRequest\0227\n\006parent\030\001 \001(\t"
+ + "B\'\340A\002\372A!\n\037spanner.googleapis.com/Databas"
+ + "e\022\021\n\tpage_size\030\002 \001(\005\022\022\n\npage_token\030\003 \001(\t"
+ + "\"|\n\031ListDatabaseRolesResponse\022F\n\016databas"
+ + "e_roles\030\001 \003(\0132..google.spanner.admin.dat"
+ + "abase.v1.DatabaseRole\022\027\n\017next_page_token"
+ + "\030\002 \001(\t*5\n\021RestoreSourceType\022\024\n\020TYPE_UNSP"
+ + "ECIFIED\020\000\022\n\n\006BACKUP\020\0012\374#\n\rDatabaseAdmin\022"
+ + "\300\001\n\rListDatabases\0226.google.spanner.admin"
+ + ".database.v1.ListDatabasesRequest\0327.goog"
+ + "le.spanner.admin.database.v1.ListDatabas"
+ + "esResponse\">\202\323\344\223\002/\022-/v1/{parent=projects"
+ + "/*/instances/*}/databases\332A\006parent\022\244\002\n\016C"
+ + "reateDatabase\0227.google.spanner.admin.dat"
+ + "abase.v1.CreateDatabaseRequest\032\035.google."
+ + "longrunning.Operation\"\271\001\202\323\344\223\0022\"-/v1/{par"
+ + "ent=projects/*/instances/*}/databases:\001*"
+ + "\332A\027parent,create_statement\312Ad\n)google.sp"
+ + "anner.admin.database.v1.Database\0227google"
+ + ".spanner.admin.database.v1.CreateDatabas"
+ + "eMetadata\022\255\001\n\013GetDatabase\0224.google.spann"
+ + "er.admin.database.v1.GetDatabaseRequest\032"
+ + "*.google.spanner.admin.database.v1.Datab"
+ + "ase\"<\202\323\344\223\002/\022-/v1/{name=projects/*/instan"
+ + "ces/*/databases/*}\332A\004name\022\235\002\n\021UpdateData"
+ + "baseDdl\022:.google.spanner.admin.database."
+ + "v1.UpdateDatabaseDdlRequest\032\035.google.lon"
+ + "grunning.Operation\"\254\001\202\323\344\223\002:25/v1/{databa"
+ + "se=projects/*/instances/*/databases/*}/d"
+ + "dl:\001*\332A\023database,statements\312AS\n\025google.p"
+ + "rotobuf.Empty\022:google.spanner.admin.data"
+ + "base.v1.UpdateDatabaseDdlMetadata\022\243\001\n\014Dr"
+ + "opDatabase\0225.google.spanner.admin.databa"
+ + "se.v1.DropDatabaseRequest\032\026.google.proto"
+ + "buf.Empty\"D\202\323\344\223\0023*1/v1/{database=project"
+ + "s/*/instances/*/databases/*}\332A\010database\022"
+ + "\315\001\n\016GetDatabaseDdl\0227.google.spanner.admi"
+ + "n.database.v1.GetDatabaseDdlRequest\0328.go"
+ + "ogle.spanner.admin.database.v1.GetDataba"
+ + "seDdlResponse\"H\202\323\344\223\0027\0225/v1/{database=pro"
+ + "jects/*/instances/*/databases/*}/ddl\332A\010d"
+ + "atabase\022\353\001\n\014SetIamPolicy\022\".google.iam.v1"
+ + ".SetIamPolicyRequest\032\025.google.iam.v1.Pol"
+ + "icy\"\237\001\202\323\344\223\002\206\001\">/v1/{resource=projects/*/"
+ + "instances/*/databases/*}:setIamPolicy:\001*"
+ + "ZA\"/v1/{resource=projects/*/in"
+ + "stances/*/databases/*}:getIamPolicy:\001*ZA"
+ + "\".google.sp"
+ + "anner.admin.database.v1.ListBackupOperat"
+ + "ionsResponse\"E\202\323\344\223\0026\0224/v1/{parent=projec"
+ + "ts/*/instances/*}/backupOperations\332A\006par"
+ + "ent\022\334\001\n\021ListDatabaseRoles\022:.google.spann"
+ + "er.admin.database.v1.ListDatabaseRolesRe"
+ + "quest\032;.google.spanner.admin.database.v1"
+ + ".ListDatabaseRolesResponse\"N\202\323\344\223\002?\022=/v1/"
+ + "{parent=projects/*/instances/*/databases"
+ + "/*}/databaseRoles\332A\006parent\032x\312A\026spanner.g"
+ + "oogleapis.com\322A\\https://www.googleapis.c"
+ + "om/auth/cloud-platform,https://www.googl"
+ + "eapis.com/auth/spanner.adminB\332\002\n$com.goo"
+ + "gle.spanner.admin.database.v1B\031SpannerDa"
+ + "tabaseAdminProtoP\001ZHgoogle.golang.org/ge"
+ + "nproto/googleapis/spanner/admin/database"
+ + "/v1;database\252\002&Google.Cloud.Spanner.Admi"
+ + "n.Database.V1\312\002&Google\\Cloud\\Spanner\\Adm"
+ + "in\\Database\\V1\352\002+Google::Cloud::Spanner:"
+ + ":Admin::Database::V1\352AJ\n\037spanner.googlea"
+ + "pis.com/Instance\022\'projects/{project}/ins"
+ + "tances/{instance}b\006proto3"
};
descriptor =
com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom(
@@ -507,6 +537,30 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() {
new java.lang.String[] {
"Name", "Progress",
});
+ internal_static_google_spanner_admin_database_v1_DatabaseRole_descriptor =
+ getDescriptor().getMessageTypes().get(18);
+ internal_static_google_spanner_admin_database_v1_DatabaseRole_fieldAccessorTable =
+ new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
+ internal_static_google_spanner_admin_database_v1_DatabaseRole_descriptor,
+ new java.lang.String[] {
+ "Name",
+ });
+ internal_static_google_spanner_admin_database_v1_ListDatabaseRolesRequest_descriptor =
+ getDescriptor().getMessageTypes().get(19);
+ internal_static_google_spanner_admin_database_v1_ListDatabaseRolesRequest_fieldAccessorTable =
+ new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
+ internal_static_google_spanner_admin_database_v1_ListDatabaseRolesRequest_descriptor,
+ new java.lang.String[] {
+ "Parent", "PageSize", "PageToken",
+ });
+ internal_static_google_spanner_admin_database_v1_ListDatabaseRolesResponse_descriptor =
+ getDescriptor().getMessageTypes().get(20);
+ internal_static_google_spanner_admin_database_v1_ListDatabaseRolesResponse_fieldAccessorTable =
+ new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
+ internal_static_google_spanner_admin_database_v1_ListDatabaseRolesResponse_descriptor,
+ new java.lang.String[] {
+ "DatabaseRoles", "NextPageToken",
+ });
com.google.protobuf.ExtensionRegistry registry =
com.google.protobuf.ExtensionRegistry.newInstance();
registry.add(com.google.api.ClientProto.defaultHost);
diff --git a/proto-google-cloud-spanner-admin-database-v1/src/main/proto/google/spanner/admin/database/v1/spanner_database_admin.proto b/proto-google-cloud-spanner-admin-database-v1/src/main/proto/google/spanner/admin/database/v1/spanner_database_admin.proto
index 38023e0721c..91489ae4b45 100644
--- a/proto-google-cloud-spanner-admin-database-v1/src/main/proto/google/spanner/admin/database/v1/spanner_database_admin.proto
+++ b/proto-google-cloud-spanner-admin-database-v1/src/main/proto/google/spanner/admin/database/v1/spanner_database_admin.proto
@@ -187,6 +187,10 @@ service DatabaseAdmin {
post: "/v1/{resource=projects/*/instances/*/backups/*}:testIamPermissions"
body: "*"
}
+ additional_bindings {
+ post: "/v1/{resource=projects/*/instances/*/databases/*/databaseRoles/*}:testIamPermissions"
+ body: "*"
+ }
};
option (google.api.method_signature) = "resource,permissions";
}
@@ -334,6 +338,14 @@ service DatabaseAdmin {
};
option (google.api.method_signature) = "parent";
}
+
+ // Lists Cloud Spanner database roles.
+ rpc ListDatabaseRoles(ListDatabaseRolesRequest) returns (ListDatabaseRolesResponse) {
+ option (google.api.http) = {
+ get: "/v1/{parent=projects/*/instances/*/databases/*}/databaseRoles"
+ };
+ option (google.api.method_signature) = "parent";
+ }
}
// Information about the database restore.
@@ -868,3 +880,51 @@ enum RestoreSourceType {
// A backup was used as the source of the restore.
BACKUP = 1;
}
+
+// A Cloud Spanner database role.
+message DatabaseRole {
+ option (google.api.resource) = {
+ type: "spanner.googleapis.com/DatabaseRole"
+ pattern: "projects/{project}/instances/{instance}/databases/{database}/databaseRoles/{role}"
+ };
+
+ // Required. The name of the database role. Values are of the form
+ // `projects/