Skip to content
Permalink
Browse files
fix: set resource type for database parameter of Backup (#174)
PiperOrigin-RevId: 306557455

Source-Author: Google APIs <noreply@google.com>
Source-Date: Tue Apr 14 18:46:18 2020 -0700
Source-Repo: googleapis/googleapis
Source-Sha: ab5d07c2883026eec395d73ff59a17f4ad0153db
Source-Link: googleapis/googleapis@ab5d07c
  • Loading branch information
yoshi-automation committed May 5, 2020
1 parent 6657436 commit bb4d7cf4a363cf4980e22be97d2b5e4267368a7d
@@ -459,12 +459,12 @@ public void testIamPermissionsExceptionTest() throws Exception {
@Test
@SuppressWarnings("all")
public void createBackupTest() throws Exception {
String database = "database1789464955";
DatabaseName database = DatabaseName.of("[PROJECT]", "[INSTANCE]", "[DATABASE]");
BackupName name = BackupName.of("[PROJECT]", "[INSTANCE]", "[BACKUP]");
long sizeBytes = 1796325715L;
Backup expectedResponse =
Backup.newBuilder()
.setDatabase(database)
.setDatabase(database.toString())
.setName(name.toString())
.setSizeBytes(sizeBytes)
.build();
@@ -519,12 +519,12 @@ public void createBackupExceptionTest() throws Exception {
@Test
@SuppressWarnings("all")
public void getBackupTest() {
String database = "database1789464955";
DatabaseName database = DatabaseName.of("[PROJECT]", "[INSTANCE]", "[DATABASE]");
BackupName name2 = BackupName.of("[PROJECT]", "[INSTANCE]", "[BACKUP]");
long sizeBytes = 1796325715L;
Backup expectedResponse =
Backup.newBuilder()
.setDatabase(database)
.setDatabase(database.toString())
.setName(name2.toString())
.setSizeBytes(sizeBytes)
.build();
@@ -565,12 +565,12 @@ public void getBackupExceptionTest() throws Exception {
@Test
@SuppressWarnings("all")
public void updateBackupTest() {
String database = "database1789464955";
DatabaseName database = DatabaseName.of("[PROJECT]", "[INSTANCE]", "[DATABASE]");
BackupName name = BackupName.of("[PROJECT]", "[INSTANCE]", "[BACKUP]");
long sizeBytes = 1796325715L;
Backup expectedResponse =
Backup.newBuilder()
.setDatabase(database)
.setDatabase(database.toString())
.setName(name.toString())
.setSizeBytes(sizeBytes)
.build();
@@ -345,7 +345,7 @@ private State(int value) {
* `projects/&lt;project&gt;/instances/&lt;instance&gt;/databases/&lt;database&gt;`.
* </pre>
*
* <code>string database = 2;</code>
* <code>string database = 2 [(.google.api.resource_reference) = { ... }</code>
*
* @return The database.
*/
@@ -371,7 +371,7 @@ public java.lang.String getDatabase() {
* `projects/&lt;project&gt;/instances/&lt;instance&gt;/databases/&lt;database&gt;`.
* </pre>
*
* <code>string database = 2;</code>
* <code>string database = 2 [(.google.api.resource_reference) = { ... }</code>
*
* @return The bytes for database.
*/
@@ -1178,7 +1178,7 @@ public Builder mergeFrom(
* `projects/&lt;project&gt;/instances/&lt;instance&gt;/databases/&lt;database&gt;`.
* </pre>
*
* <code>string database = 2;</code>
* <code>string database = 2 [(.google.api.resource_reference) = { ... }</code>
*
* @return The database.
*/
@@ -1204,7 +1204,7 @@ public java.lang.String getDatabase() {
* `projects/&lt;project&gt;/instances/&lt;instance&gt;/databases/&lt;database&gt;`.
* </pre>
*
* <code>string database = 2;</code>
* <code>string database = 2 [(.google.api.resource_reference) = { ... }</code>
*
* @return The bytes for database.
*/
@@ -1230,7 +1230,7 @@ public com.google.protobuf.ByteString getDatabaseBytes() {
* `projects/&lt;project&gt;/instances/&lt;instance&gt;/databases/&lt;database&gt;`.
* </pre>
*
* <code>string database = 2;</code>
* <code>string database = 2 [(.google.api.resource_reference) = { ... }</code>
*
* @param value The database to set.
* @return This builder for chaining.
@@ -1255,7 +1255,7 @@ public Builder setDatabase(java.lang.String value) {
* `projects/&lt;project&gt;/instances/&lt;instance&gt;/databases/&lt;database&gt;`.
* </pre>
*
* <code>string database = 2;</code>
* <code>string database = 2 [(.google.api.resource_reference) = { ... }</code>
*
* @return This builder for chaining.
*/
@@ -1276,7 +1276,7 @@ public Builder clearDatabase() {
* `projects/&lt;project&gt;/instances/&lt;instance&gt;/databases/&lt;database&gt;`.
* </pre>
*
* <code>string database = 2;</code>
* <code>string database = 2 [(.google.api.resource_reference) = { ... }</code>
*
* @param value The bytes for database to set.
* @return This builder for chaining.
@@ -34,7 +34,7 @@
* `projects/&lt;project&gt;/instances/&lt;instance&gt;/databases/&lt;database&gt;`.
* </pre>
*
* <code>string database = 2;</code>
* <code>string database = 2 [(.google.api.resource_reference) = { ... }</code>
*
* @return The database.
*/
@@ -50,7 +50,7 @@
* `projects/&lt;project&gt;/instances/&lt;instance&gt;/databases/&lt;database&gt;`.
* </pre>
*
* <code>string database = 2;</code>
* <code>string database = 2 [(.google.api.resource_reference) = { ... }</code>
*
* @return The bytes for database.
*/
@@ -88,54 +88,54 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() {
+ "d_mask.proto\032\037google/protobuf/timestamp."
+ "proto\032-google/spanner/admin/database/v1/"
+ "common.proto\032\034google/api/annotations.pro"
+ "to\"\247\003\n\006Backup\022\020\n\010database\030\002 \001(\t\022/\n\013expir"
+ "e_time\030\003 \001(\0132\032.google.protobuf.Timestamp"
+ "\022\014\n\004name\030\001 \001(\t\0224\n\013create_time\030\004 \001(\0132\032.go"
+ "ogle.protobuf.TimestampB\003\340A\003\022\027\n\nsize_byt"
+ "es\030\005 \001(\003B\003\340A\003\022B\n\005state\030\006 \001(\0162..google.sp"
+ "anner.admin.database.v1.Backup.StateB\003\340A"
+ "\003\022\"\n\025referencing_databases\030\007 \003(\tB\003\340A\003\"7\n"
+ "\005State\022\025\n\021STATE_UNSPECIFIED\020\000\022\014\n\010CREATIN"
+ "G\020\001\022\t\n\005READY\020\002:\\\352AY\n\035spanner.googleapis."
+ "com/Backup\0228projects/{project}/instances"
+ "/{instance}/backups/{backup}\"\245\001\n\023CreateB"
+ "ackupRequest\0227\n\006parent\030\001 \001(\tB\'\340A\002\372A!\n\037sp"
+ "anner.googleapis.com/Instance\022\026\n\tbackup_"
+ "id\030\002 \001(\tB\003\340A\002\022=\n\006backup\030\003 \001(\0132(.google.s"
+ "panner.admin.database.v1.BackupB\003\340A\002\"\256\001\n"
+ "\024CreateBackupMetadata\022\014\n\004name\030\001 \001(\t\022\020\n\010d"
+ "atabase\030\002 \001(\t\022E\n\010progress\030\003 \001(\01323.google"
+ ".spanner.admin.database.v1.OperationProg"
+ "ress\022/\n\013cancel_time\030\004 \001(\0132\032.google.proto"
+ "buf.Timestamp\"\212\001\n\023UpdateBackupRequest\022=\n"
+ "\006backup\030\001 \001(\0132(.google.spanner.admin.dat"
+ "abase.v1.BackupB\003\340A\002\0224\n\013update_mask\030\002 \001("
+ "\0132\032.google.protobuf.FieldMaskB\003\340A\002\"G\n\020Ge"
+ "tBackupRequest\0223\n\004name\030\001 \001(\tB%\340A\002\372A\037\n\035sp"
+ "anner.googleapis.com/Backup\"J\n\023DeleteBac"
+ "kupRequest\0223\n\004name\030\001 \001(\tB%\340A\002\372A\037\n\035spanne"
+ "r.googleapis.com/Backup\"\204\001\n\022ListBackupsR"
+ "equest\0227\n\006parent\030\001 \001(\tB\'\340A\002\372A!\n\037spanner."
+ "googleapis.com/Instance\022\016\n\006filter\030\002 \001(\t\022"
+ "\021\n\tpage_size\030\003 \001(\005\022\022\n\npage_token\030\004 \001(\t\"i"
+ "\n\023ListBackupsResponse\0229\n\007backups\030\001 \003(\0132("
+ ".google.spanner.admin.database.v1.Backup"
+ "\022\027\n\017next_page_token\030\002 \001(\t\"\215\001\n\033ListBackup"
+ "OperationsRequest\0227\n\006parent\030\001 \001(\tB\'\340A\002\372A"
+ "!\n\037spanner.googleapis.com/Instance\022\016\n\006fi"
+ "lter\030\002 \001(\t\022\021\n\tpage_size\030\003 \001(\005\022\022\n\npage_to"
+ "ken\030\004 \001(\t\"j\n\034ListBackupOperationsRespons"
+ "e\0221\n\noperations\030\001 \003(\0132\035.google.longrunni"
+ "ng.Operation\022\027\n\017next_page_token\030\002 \001(\t\"f\n"
+ "\nBackupInfo\022\016\n\006backup\030\001 \001(\t\022/\n\013create_ti"
+ "me\030\002 \001(\0132\032.google.protobuf.Timestamp\022\027\n\017"
+ "source_database\030\003 \001(\tB\321\001\n$com.google.spa"
+ "nner.admin.database.v1B\013BackupProtoP\001ZHg"
+ "oogle.golang.org/genproto/googleapis/spa"
+ "nner/admin/database/v1;database\252\002&Google"
+ ".Cloud.Spanner.Admin.Database.V1\312\002&Googl"
+ "e\\Cloud\\Spanner\\Admin\\Database\\V1b\006proto"
+ "3"
+ "to\"\315\003\n\006Backup\0226\n\010database\030\002 \001(\tB$\372A!\n\037sp"
+ "anner.googleapis.com/Database\022/\n\013expire_"
+ "time\030\003 \001(\0132\032.google.protobuf.Timestamp\022\014"
+ "\n\004name\030\001 \001(\t\0224\n\013create_time\030\004 \001(\0132\032.goog"
+ "le.protobuf.TimestampB\003\340A\003\022\027\n\nsize_bytes"
+ "\030\005 \001(\003B\003\340A\003\022B\n\005state\030\006 \001(\0162..google.span"
+ "ner.admin.database.v1.Backup.StateB\003\340A\003\022"
+ "\"\n\025referencing_databases\030\007 \003(\tB\003\340A\003\"7\n\005S"
+ "tate\022\025\n\021STATE_UNSPECIFIED\020\000\022\014\n\010CREATING\020"
+ "\001\022\t\n\005READY\020\002:\\\352AY\n\035spanner.googleapis.co"
+ "m/Backup\0228projects/{project}/instances/{"
+ "instance}/backups/{backup}\"\245\001\n\023CreateBac"
+ "kupRequest\0227\n\006parent\030\001 \001(\tB\'\340A\002\372A!\n\037span"
+ "ner.googleapis.com/Instance\022\026\n\tbackup_id"
+ "\030\002 \001(\tB\003\340A\002\022=\n\006backup\030\003 \001(\0132(.google.spa"
+ "nner.admin.database.v1.BackupB\003\340A\002\"\256\001\n\024C"
+ "reateBackupMetadata\022\014\n\004name\030\001 \001(\t\022\020\n\010dat"
+ "abase\030\002 \001(\t\022E\n\010progress\030\003 \001(\01323.google.s"
+ "panner.admin.database.v1.OperationProgre"
+ "ss\022/\n\013cancel_time\030\004 \001(\0132\032.google.protobu"
+ "f.Timestamp\"\212\001\n\023UpdateBackupRequest\022=\n\006b"
+ "ackup\030\001 \001(\0132(.google.spanner.admin.datab"
+ "ase.v1.BackupB\003\340A\002\0224\n\013update_mask\030\002 \001(\0132"
+ "\032.google.protobuf.FieldMaskB\003\340A\002\"G\n\020GetB"
+ "ackupRequest\0223\n\004name\030\001 \001(\tB%\340A\002\372A\037\n\035span"
+ "ner.googleapis.com/Backup\"J\n\023DeleteBacku"
+ "pRequest\0223\n\004name\030\001 \001(\tB%\340A\002\372A\037\n\035spanner."
+ "googleapis.com/Backup\"\204\001\n\022ListBackupsReq"
+ "uest\0227\n\006parent\030\001 \001(\tB\'\340A\002\372A!\n\037spanner.go"
+ "ogleapis.com/Instance\022\016\n\006filter\030\002 \001(\t\022\021\n"
+ "\tpage_size\030\003 \001(\005\022\022\n\npage_token\030\004 \001(\t\"i\n\023"
+ "ListBackupsResponse\0229\n\007backups\030\001 \003(\0132(.g"
+ "oogle.spanner.admin.database.v1.Backup\022\027"
+ "\n\017next_page_token\030\002 \001(\t\"\215\001\n\033ListBackupOp"
+ "erationsRequest\0227\n\006parent\030\001 \001(\tB\'\340A\002\372A!\n"
+ "\037spanner.googleapis.com/Instance\022\016\n\006filt"
+ "er\030\002 \001(\t\022\021\n\tpage_size\030\003 \001(\005\022\022\n\npage_toke"
+ "n\030\004 \001(\t\"j\n\034ListBackupOperationsResponse\022"
+ "1\n\noperations\030\001 \003(\0132\035.google.longrunning"
+ ".Operation\022\027\n\017next_page_token\030\002 \001(\t\"f\n\nB"
+ "ackupInfo\022\016\n\006backup\030\001 \001(\t\022/\n\013create_time"
+ "\030\002 \001(\0132\032.google.protobuf.Timestamp\022\027\n\017so"
+ "urce_database\030\003 \001(\tB\321\001\n$com.google.spann"
+ "er.admin.database.v1B\013BackupProtoP\001ZHgoo"
+ "gle.golang.org/genproto/googleapis/spann"
+ "er/admin/database/v1;database\252\002&Google.C"
+ "loud.Spanner.Admin.Database.V1\312\002&Google\\"
+ "Cloud\\Spanner\\Admin\\Database\\V1b\006proto3"
};
descriptor =
com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom(
@@ -56,7 +56,9 @@ message Backup {
// created. This needs to be in the same instance as the backup.
// Values are of the form
// `projects/<project>/instances/<instance>/databases/<database>`.
string database = 2;
string database = 2 [(google.api.resource_reference) = {
type: "spanner.googleapis.com/Database"
}];

// Required for the [CreateBackup][google.spanner.admin.database.v1.DatabaseAdmin.CreateBackup]
// operation. The expiration time of the backup, with microseconds
@@ -4,15 +4,15 @@
"git": {
"name": ".",
"remote": "https://github.com/googleapis/java-spanner.git",
"sha": "9e5a1cdaacf71147b67681861f063c3276705f44"
"sha": "5806b0e1c7c5bfe7891283ae515b114b3ef814d9"
}
},
{
"git": {
"name": "googleapis",
"remote": "https://github.com/googleapis/googleapis.git",
"sha": "ee4ea76504aa60c2bff9b7c11269c155d8c21e0d",
"internalRef": "305619145"
"sha": "ab5d07c2883026eec395d73ff59a17f4ad0153db",
"internalRef": "306557455"
}
},
{

0 comments on commit bb4d7cf

Please sign in to comment.