google-cloud-googleapis 0.16.1

Google Cloud Platform rust client.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
// Copyright 2024 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
//
//     http://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.

syntax = "proto3";

package google.spanner.executor.v1;

import "google/api/client.proto";
import "google/api/field_behavior.proto";
import "google/longrunning/operations.proto";
import "google/protobuf/timestamp.proto";
import "google/rpc/status.proto";
import "google/spanner/admin/database/v1/backup.proto";
import "google/spanner/admin/database/v1/common.proto";
import "google/spanner/admin/database/v1/spanner_database_admin.proto";
import "google/spanner/admin/instance/v1/spanner_instance_admin.proto";
import "google/spanner/v1/spanner.proto";
import "google/spanner/v1/type.proto";

option go_package = "cloud.google.com/go/spanner/executor/apiv1/executorpb;executorpb";
option java_multiple_files = true;
option java_outer_classname = "CloudExecutorProto";
option java_package = "com.google.spanner.executor.v1";

// Service that executes SpannerActions asynchronously.
service SpannerExecutorProxy {
  option (google.api.default_host) = "spanner-cloud-executor.googleapis.com";

  // ExecuteActionAsync is a streaming call that starts executing a new Spanner
  // action.
  //
  // For each request, the server will reply with one or more responses, but
  // only the last response will contain status in the outcome.
  //
  // Responses can be matched to requests by action_id. It is allowed to have
  // multiple actions in flight--in that case, actions are be executed in
  // parallel.
  rpc ExecuteActionAsync(stream SpannerAsyncActionRequest)
      returns (stream SpannerAsyncActionResponse) {}
}

// Request to executor service that start a new Spanner action.
message SpannerAsyncActionRequest {
  // Action id to uniquely identify this action request.
  int32 action_id = 1;

  // The actual SpannerAction to perform.
  SpannerAction action = 2;
}

// Response from executor service.
message SpannerAsyncActionResponse {
  // Action id corresponds to the request.
  int32 action_id = 1;

  // If action results are split into multiple responses, only the last response
  // can and should contain status.
  SpannerActionOutcome outcome = 2;
}

// SpannerAction defines a primitive action that can be performed against
// Spanner, such as begin or commit a transaction, or perform a read or
// mutation.
message SpannerAction {
  // Database against which to perform action.
  // In a context where a series of actions take place, an action may omit
  // database path if it applies to the same database as the previous action.
  string database_path = 1;

  // Configuration options for Spanner backend
  SpannerOptions spanner_options = 2;

  // Action represents a spanner action kind, there will only be one action kind
  // per SpannerAction.
  oneof action {
    // Action to start a transaction.
    StartTransactionAction start = 10;

    // Action to finish a transaction.
    FinishTransactionAction finish = 11;

    // Action to do a normal read.
    ReadAction read = 20;

    // Action to do a query.
    QueryAction query = 21;

    // Action to buffer a mutation.
    MutationAction mutation = 22;

    // Action to a DML.
    DmlAction dml = 23;

    // Action to a batch DML.
    BatchDmlAction batch_dml = 24;

    // Action to write a mutation.
    WriteMutationsAction write = 25;

    // Action to a partitioned update.
    PartitionedUpdateAction partitioned_update = 27;

    // Action that contains any administrative operation, like database,
    // instance manipulation.
    AdminAction admin = 30;

    // Action to start a batch transaction.
    StartBatchTransactionAction start_batch_txn = 40;

    // Action to close a batch transaction.
    CloseBatchTransactionAction close_batch_txn = 41;

    // Action to generate database partitions for batch read.
    GenerateDbPartitionsForReadAction generate_db_partitions_read = 42;

    // Action to generate database partitions for batch query.
    GenerateDbPartitionsForQueryAction generate_db_partitions_query = 43;

    // Action to execute batch actions on generated partitions.
    ExecutePartitionAction execute_partition = 44;

    // Action to execute change stream query.
    ExecuteChangeStreamQuery execute_change_stream_query = 50;

    // Query cancellation action for testing the cancellation of a query.
    QueryCancellationAction query_cancellation = 51;
  }
}

// A single read request.
message ReadAction {
  // The table to read at.
  string table = 1;

  // The index to read at if it's an index read.
  optional string index = 2;

  // List of columns must begin with the key columns used for the read.
  repeated string column = 3;

  // Keys for performing this read.
  KeySet keys = 4;

  // Limit on number of rows to read. If set, must be positive.
  int32 limit = 5;
}

// A SQL query request.
message QueryAction {
  // Parameter that bind to placeholders in the SQL string
  message Parameter {
    // Name of the parameter (with no leading @).
    string name = 1;

    // Type of the parameter.
    google.spanner.v1.Type type = 2;

    // Value of the parameter.
    Value value = 3;
  }

  // The SQL string.
  string sql = 1;

  // Parameters for the SQL string.
  repeated Parameter params = 2;
}

// A single DML statement.
message DmlAction {
  // DML statement.
  QueryAction update = 1;

  // Whether to autocommit the transaction after executing the DML statement,
  // if the Executor supports autocommit.
  optional bool autocommit_if_supported = 2;
}

// Batch of DML statements invoked using batched execution.
message BatchDmlAction {
  // DML statements.
  repeated QueryAction updates = 1;
}

// Value represents a single value that can be read or written to/from
// Spanner.
message Value {
  // Exactly one of the following fields will be present.
  oneof value_type {
    // If is_null is set, then this value is null.
    bool is_null = 1;

    // Int type value. It's used for all integer number types, like int32 and
    // int64.
    int64 int_value = 2;

    // Bool type value.
    bool bool_value = 3;

    // Double type value. It's used for all float point types, like float and
    // double.
    double double_value = 4;

    // Bytes type value, stored in CORD. It's also used for PROTO type value.
    bytes bytes_value = 5;

    // String type value, stored in CORD.
    string string_value = 6;

    // Struct type value. It contains a ValueList representing the values in
    // this struct.
    ValueList struct_value = 7;

    // Timestamp type value.
    google.protobuf.Timestamp timestamp_value = 8;

    // Date type value. Date is specified as a number of days since Unix epoch.
    int32 date_days_value = 9;

    // If set, holds the sentinel value for the transaction CommitTimestamp.
    bool is_commit_timestamp = 10;

    // Array type value. The underlying Valuelist should have values that have
    // the same type.
    ValueList array_value = 11;
  }

  // Type of array element. Only set if value is an array.
  optional google.spanner.v1.Type array_type = 12;
}

// KeyRange represents a range of rows in a table or index.
//
// A range has a start key and an end key. These keys can be open or
// closed, indicating if the range includes rows with that key.
//
// Keys are represented by "ValueList", where the ith value in the list
// corresponds to the ith component of the table or index primary key.
message KeyRange {
  // Type controls whether "start" and "limit" are open or closed. By default,
  // "start" is closed, and "limit" is open.
  enum Type {
    // "TYPE_UNSPECIFIED" is equivalent to "CLOSED_OPEN".
    TYPE_UNSPECIFIED = 0;

    // [start,limit]
    CLOSED_CLOSED = 1;

    // [start,limit)
    CLOSED_OPEN = 2;

    // (start,limit]
    OPEN_CLOSED = 3;

    // (start,limit)
    OPEN_OPEN = 4;
  }

  // "start" and "limit" must have the same number of key parts,
  // though they may name only a prefix of the table or index key.
  // The start key of this KeyRange.
  ValueList start = 1;

  // The end key of this KeyRange.
  ValueList limit = 2;

  // "start" and "limit" type for this KeyRange.
  optional Type type = 3;
}

// KeySet defines a collection of Spanner keys and/or key ranges. All
// the keys are expected to be in the same table. The keys need not be
// sorted in any particular way.
message KeySet {
  // A list of specific keys. Entries in "keys" should have exactly as
  // many elements as there are columns in the primary or index key
  // with which this "KeySet" is used.
  repeated ValueList point = 1;

  // A list of key ranges.
  repeated KeyRange range = 2;

  // For convenience "all" can be set to "true" to indicate that this
  // "KeySet" matches all keys in the table or index. Note that any keys
  // specified in "keys" or "ranges" are only yielded once.
  bool all = 3;
}

// List of values.
message ValueList {
  // Values contained in this ValueList.
  repeated Value value = 1;
}

// A single mutation request.
message MutationAction {
  // Arguments to Insert, InsertOrUpdate, and Replace operations.
  message InsertArgs {
    // The names of the columns to be written.
    repeated string column = 1;

    // Type information for the "values" entries below.
    repeated google.spanner.v1.Type type = 2;

    // The values to be written.
    repeated ValueList values = 3;
  }

  // Arguments to Update.
  message UpdateArgs {
    // The columns to be updated. Identical to InsertArgs.column.
    repeated string column = 1;

    // Type information for "values". Identical to InsertArgs.type.
    repeated google.spanner.v1.Type type = 2;

    // The values to be updated. Identical to InsertArgs.values.
    repeated ValueList values = 3;
  }

  // Mod represents the write action that will be perform to a table. Each mod
  // will specify exactly one action, from insert, update, insert_or_update,
  // replace and delete.
  message Mod {
    // The table to write.
    string table = 1;

    // Exactly one of the remaining elements may be present.
    // Insert new rows into "table".
    InsertArgs insert = 2;

    // Update columns stored in existing rows of "table".
    UpdateArgs update = 3;

    // Insert or update existing rows of "table".
    InsertArgs insert_or_update = 4;

    // Replace existing rows of "table".
    InsertArgs replace = 5;

    // Delete rows from "table".
    KeySet delete_keys = 6;
  }

  // Mods that contained in this mutation.
  repeated Mod mod = 1;
}

// WriteMutationAction defines an action of flushing the mutation so they
// are visible to subsequent operations in the transaction.
message WriteMutationsAction {
  // The mutation to write.
  MutationAction mutation = 1;
}

// PartitionedUpdateAction defines an action to execute a partitioned DML
// which runs different partitions in parallel.
message PartitionedUpdateAction {
  message ExecutePartitionedUpdateOptions {
    // RPC Priority
    optional google.spanner.v1.RequestOptions.Priority rpc_priority = 1;

    // Transaction tag
    optional string tag = 2;
  }

  // Options for partitioned update.
  optional ExecutePartitionedUpdateOptions options = 1;

  // Partitioned dml query.
  QueryAction update = 2;
}

// StartTransactionAction defines an action of initializing a transaction.
message StartTransactionAction {
  // Concurrency is for read-only transactions and must be omitted for
  // read-write transactions.
  optional Concurrency concurrency = 1;

  // Metadata about tables and columns that will be involved in this
  // transaction. It is to convert values of key parts correctly.
  repeated TableMetadata table = 2;

  // Transaction_seed contains workid and op pair for this transaction, used for
  // testing.
  string transaction_seed = 3;

  // Execution options (e.g., whether transaction is opaque, optimistic).
  optional TransactionExecutionOptions execution_options = 4;
}

// Concurrency for read-only transactions.
message Concurrency {
  // Concurrency mode set for read-only transactions, exactly one mode below
  // should be set.
  oneof concurrency_mode {
    // Indicates a read at a consistent timestamp that is specified relative to
    // now. That is, if the caller has specified an exact staleness of s
    // seconds, we will read at now - s.
    double staleness_seconds = 1;

    // Indicates a boundedly stale read that reads at a timestamp >= T.
    int64 min_read_timestamp_micros = 2;

    // Indicates a boundedly stale read that is at most N seconds stale.
    double max_staleness_seconds = 3;

    // Indicates a read at a consistent timestamp.
    int64 exact_timestamp_micros = 4;

    // Indicates a strong read, must only be set to true, or unset.
    bool strong = 5;

    // Indicates a batch read, must only be set to true, or unset.
    bool batch = 6;
  }

  // True if exact_timestamp_micros is set, and the chosen timestamp is that of
  // a snapshot epoch.
  bool snapshot_epoch_read = 7;

  // If set, this is a snapshot epoch read constrained to read only the
  // specified log scope root table, and its children. Will not be set for full
  // database epochs.
  string snapshot_epoch_root_table = 8;

  // Set only when batch is true.
  int64 batch_read_timestamp_micros = 9;
}

// TableMetadata contains metadata of a single table.
message TableMetadata {
  // Table name.
  string name = 1;

  // Columns, in the same order as in the schema.
  repeated ColumnMetadata column = 2;

  // Keys, in order. Column name is currently not populated.
  repeated ColumnMetadata key_column = 3;
}

// ColumnMetadata represents metadata of a single column.
message ColumnMetadata {
  // Column name.
  string name = 1;

  // Column type.
  google.spanner.v1.Type type = 2;
}

// Options for executing the transaction.
message TransactionExecutionOptions {
  // Whether optimistic concurrency should be used to execute this transaction.
  bool optimistic = 1;
}

// FinishTransactionAction defines an action of finishing a transaction.
message FinishTransactionAction {
  // Mode indicates how the transaction should be finished.
  enum Mode {
    // "MODE_UNSPECIFIED" is equivalent to "COMMIT".
    MODE_UNSPECIFIED = 0;

    // Commit the transaction.
    COMMIT = 1;

    // Drop the transaction without committing it.
    ABANDON = 2;
  }

  // Defines how exactly the transaction should be completed, e.g. with
  // commit or abortion.
  Mode mode = 1;
}

// AdminAction defines all the cloud spanner admin actions, including
// instance/database admin ops, backup ops and operation actions.
message AdminAction {
  // Exactly one of the actions below will be performed in AdminAction.
  oneof action {
    // Action that creates a user instance config.
    CreateUserInstanceConfigAction create_user_instance_config = 1;

    // Action that updates a user instance config.
    UpdateUserInstanceConfigAction update_user_instance_config = 2;

    // Action that deletes a user instance config.
    DeleteUserInstanceConfigAction delete_user_instance_config = 3;

    // Action that gets a user instance config.
    GetCloudInstanceConfigAction get_cloud_instance_config = 4;

    // Action that lists user instance configs.
    ListCloudInstanceConfigsAction list_instance_configs = 5;

    // Action that creates a Cloud Spanner instance.
    CreateCloudInstanceAction create_cloud_instance = 6;

    // Action that updates a Cloud Spanner instance.
    UpdateCloudInstanceAction update_cloud_instance = 7;

    // Action that deletes a Cloud Spanner instance.
    DeleteCloudInstanceAction delete_cloud_instance = 8;

    // Action that lists Cloud Spanner instances.
    ListCloudInstancesAction list_cloud_instances = 9;

    // Action that retrieves a Cloud Spanner instance.
    GetCloudInstanceAction get_cloud_instance = 10;

    // Action that creates a Cloud Spanner database.
    CreateCloudDatabaseAction create_cloud_database = 11;

    // Action that updates the schema of a Cloud Spanner database.
    UpdateCloudDatabaseDdlAction update_cloud_database_ddl = 12;

    // Action that updates the schema of a Cloud Spanner database.
    UpdateCloudDatabaseAction update_cloud_database = 27;

    // Action that drops a Cloud Spanner database.
    DropCloudDatabaseAction drop_cloud_database = 13;

    // Action that lists Cloud Spanner databases.
    ListCloudDatabasesAction list_cloud_databases = 14;

    // Action that lists Cloud Spanner database operations.
    ListCloudDatabaseOperationsAction list_cloud_database_operations = 15;

    // Action that restores a Cloud Spanner database from a backup.
    RestoreCloudDatabaseAction restore_cloud_database = 16;

    // Action that gets a Cloud Spanner database.
    GetCloudDatabaseAction get_cloud_database = 17;

    // Action that creates a Cloud Spanner database backup.
    CreateCloudBackupAction create_cloud_backup = 18;

    // Action that copies a Cloud Spanner database backup.
    CopyCloudBackupAction copy_cloud_backup = 19;

    // Action that gets a Cloud Spanner database backup.
    GetCloudBackupAction get_cloud_backup = 20;

    // Action that updates a Cloud Spanner database backup.
    UpdateCloudBackupAction update_cloud_backup = 21;

    // Action that deletes a Cloud Spanner database backup.
    DeleteCloudBackupAction delete_cloud_backup = 22;

    // Action that lists Cloud Spanner database backups.
    ListCloudBackupsAction list_cloud_backups = 23;

    // Action that lists Cloud Spanner database backup operations.
    ListCloudBackupOperationsAction list_cloud_backup_operations = 24;

    // Action that gets an operation.
    GetOperationAction get_operation = 25;

    // Action that cancels an operation.
    CancelOperationAction cancel_operation = 26;

    // Action that changes quorum of a Cloud Spanner database.
    ChangeQuorumCloudDatabaseAction change_quorum_cloud_database = 28;
  }
}

// Action that creates a user instance config.
message CreateUserInstanceConfigAction {
  // User instance config ID (not path), e.g. "custom-config".
  string user_config_id = 1;

  // Cloud project ID, e.g. "spanner-cloud-systest".
  string project_id = 2;

  // Base config ID, e.g. "test-config".
  string base_config_id = 3;

  // Replicas that should be included in the user config.
  repeated google.spanner.admin.instance.v1.ReplicaInfo replicas = 4;
}

// Action that updates a user instance config.
message UpdateUserInstanceConfigAction {
  // User instance config ID (not path), e.g. "custom-config".
  string user_config_id = 1;

  // Cloud project ID, e.g. "spanner-cloud-systest".
  string project_id = 2;

  // The descriptive name for this instance config as it appears in UIs.
  optional string display_name = 3;

  // labels.
  map<string, string> labels = 4;
}

// Action that gets a user instance config.
message GetCloudInstanceConfigAction {
  // Instance config ID (not path), e.g. "custom-config".
  string instance_config_id = 1;

  // Cloud project ID, e.g. "spanner-cloud-systest".
  string project_id = 2;
}

// Action that deletes a user instance configs.
message DeleteUserInstanceConfigAction {
  // User instance config ID (not path), e.g. "custom-config".
  string user_config_id = 1;

  // Cloud project ID, e.g. "spanner-cloud-systest".
  string project_id = 2;
}

// Action that lists user instance configs.
message ListCloudInstanceConfigsAction {
  // Cloud project ID, e.g. "spanner-cloud-systest".
  string project_id = 1;

  // Number of instance configs to be returned in the response. If 0 or
  // less, defaults to the server's maximum allowed page size.
  optional int32 page_size = 2;

  // If non-empty, "page_token" should contain a next_page_token
  // from a previous ListInstanceConfigsResponse to the same "parent".
  optional string page_token = 3;
}

// Action that creates a Cloud Spanner instance.
message CreateCloudInstanceAction {
  // Cloud instance ID (not path), e.g. "test-instance".
  string instance_id = 1;

  // Cloud project ID, e.g. "spanner-cloud-systest".
  string project_id = 2;

  // Instance config ID, e.g. "test-config".
  string instance_config_id = 3;

  // Number of nodes (processing_units should not be set or set to 0 if used).
  optional int32 node_count = 4;

  // Number of processing units (node_count should be set to 0 if used).
  optional int32 processing_units = 6;

  // The autoscaling config for this instance. If non-empty, an autoscaling
  // instance will be created (processing_units and node_count should be set to
  // 0 if used).
  optional google.spanner.admin.instance.v1.AutoscalingConfig
      autoscaling_config = 7;

  // labels.
  map<string, string> labels = 5;
}

// Action that updates a Cloud Spanner instance.
message UpdateCloudInstanceAction {
  // Cloud instance ID (not path), e.g. "test-instance".
  string instance_id = 1;

  // Cloud project ID, e.g. "spanner-cloud-systest".
  string project_id = 2;

  // The descriptive name for this instance as it appears in UIs.
  // Must be unique per project and between 4 and 30 characters in length.
  optional string display_name = 3;

  // The number of nodes allocated to this instance. At most one of either
  // node_count or processing_units should be present in the message.
  optional int32 node_count = 4;

  // The number of processing units allocated to this instance. At most one of
  // processing_units or node_count should be present in the message.
  optional int32 processing_units = 5;

  // The autoscaling config for this instance. If non-empty, this instance is
  // using autoscaling (processing_units and node_count should be set to
  // 0 if used).
  optional google.spanner.admin.instance.v1.AutoscalingConfig
      autoscaling_config = 7;

  // labels.
  map<string, string> labels = 6;
}

// Action that deletes a Cloud Spanner instance.
message DeleteCloudInstanceAction {
  // Cloud instance ID (not path), e.g. "test-instance".
  string instance_id = 1;

  // Cloud project ID, e.g. "spanner-cloud-systest".
  string project_id = 2;
}

// Action that creates a Cloud Spanner database.
message CreateCloudDatabaseAction {
  // Cloud instance ID (not path), e.g. "test-instance".
  string instance_id = 1;

  // Cloud project ID, e.g. "spanner-cloud-systest".
  string project_id = 2;

  // Cloud database ID (not full path), e.g. "db0".
  string database_id = 3;

  // SDL statements to apply to the new database.
  repeated string sdl_statement = 4;

  // The KMS key used to encrypt the database to be created if the database
  // should be CMEK protected.
  google.spanner.admin.database.v1.EncryptionConfig encryption_config = 5;

  // Optional SQL dialect (GOOGLESQL or POSTGRESQL).  Default: GOOGLESQL.
  optional string dialect = 6;

  optional bytes proto_descriptors = 7;
}

// Action that updates the schema of a Cloud Spanner database.
message UpdateCloudDatabaseDdlAction {
  // Cloud instance ID (not path), e.g. "test-instance".
  string instance_id = 1;

  // Cloud project ID, e.g. "spanner-cloud-systest".
  string project_id = 2;

  // Cloud database ID (not full path), e.g. "db0".
  string database_id = 3;

  // SDL statements to apply to the database.
  repeated string sdl_statement = 4;

  // Op ID can be used to track progress of the update. If set, it must be
  // unique per database. If not set, Cloud Spanner will generate operation ID
  // automatically.
  string operation_id = 5;

  optional bytes proto_descriptors = 6;
}

// Action that updates a Cloud Spanner database.
message UpdateCloudDatabaseAction {
  // Cloud instance ID (not path), e.g. "test-instance".
  string instance_id = 1;

  // Cloud project ID, e.g. "spanner-cloud-systest".
  string project_id = 2;

  // Cloud database name (not full path), e.g. "db0".
  string database_name = 3;

  // Updated value of enable_drop_protection, this is the only field that has
  // supported to be updated.
  bool enable_drop_protection = 4;
}

// Action that drops a Cloud Spanner database.
message DropCloudDatabaseAction {
  // Cloud instance ID (not path), e.g. "test-instance".
  string instance_id = 1;

  // Cloud project ID, e.g. "spanner-cloud-systest".
  string project_id = 2;

  // Cloud database ID (not full path), e.g. "db0".
  string database_id = 3;
}

// Action that changes quorum of a Cloud Spanner database.
message ChangeQuorumCloudDatabaseAction {
  // The fully qualified uri of the database whose quorum has to be changed.
  optional string database_uri = 1;

  // The locations of the serving regions, e.g. "asia-south1".
  repeated string serving_locations = 2;
}

// Action that lists Cloud Spanner databases.
message ListCloudDatabasesAction {
  // Cloud project ID, e.g. "spanner-cloud-systest".
  string project_id = 1;

  // Cloud instance ID (not path) to list databases from, e.g. "test-instance".
  string instance_id = 2;

  // Number of databases to be returned in the response. If 0 or
  // less, defaults to the server's maximum allowed page size.
  int32 page_size = 3;

  // If non-empty, "page_token" should contain a next_page_token
  // from a previous ListDatabasesResponse to the same "parent"
  // and with the same "filter".
  string page_token = 4;
}

// Action that lists Cloud Spanner databases.
message ListCloudInstancesAction {
  // Cloud project ID, e.g. "spanner-cloud-systest".
  string project_id = 1;

  // A filter expression that filters what operations are returned in the
  // response.
  // The expression must specify the field name, a comparison operator,
  // and the value that you want to use for filtering.
  // Refer spanner_instance_admin.proto.ListInstancesRequest for
  // detail.
  optional string filter = 2;

  // Number of instances to be returned in the response. If 0 or
  // less, defaults to the server's maximum allowed page size.
  optional int32 page_size = 3;

  // If non-empty, "page_token" should contain a next_page_token
  // from a previous ListInstancesResponse to the same "parent"
  // and with the same "filter".
  optional string page_token = 4;
}

// Action that retrieves a Cloud Spanner instance.
message GetCloudInstanceAction {
  // Cloud project ID, e.g. "spanner-cloud-systest".
  string project_id = 1;

  // Cloud instance ID (not path) to retrieve the instance from,
  // e.g. "test-instance".
  string instance_id = 2;
}

// Action that lists Cloud Spanner database operations.
message ListCloudDatabaseOperationsAction {
  // Cloud project ID, e.g. "spanner-cloud-systest".
  string project_id = 1;

  // Cloud instance ID (not path) to list database operations from,
  // e.g. "test-instance".
  string instance_id = 2;

  // A filter expression that filters what operations are returned in the
  // response.
  // The expression must specify the field name, a comparison operator,
  // and the value that you want to use for filtering.
  // Refer spanner_database_admin.proto.ListDatabaseOperationsRequest for
  // detail.
  string filter = 3;

  // Number of databases to be returned in the response. If 0 or
  // less, defaults to the server's maximum allowed page size.
  int32 page_size = 4;

  // If non-empty, "page_token" should contain a next_page_token
  // from a previous ListDatabaseOperationsResponse to the same "parent"
  // and with the same "filter".
  string page_token = 5;
}

// Action that restores a Cloud Spanner database from a backup.
message RestoreCloudDatabaseAction {
  // Cloud project ID, e.g. "spanner-cloud-systest".
  string project_id = 1;

  // Cloud instance ID (not path) containing the backup, e.g. "backup-instance".
  string backup_instance_id = 2;

  // The id of the backup from which to restore, e.g. "test-backup".
  string backup_id = 3;

  // Cloud instance ID (not path) containing the database, e.g.
  // "database-instance".
  string database_instance_id = 4;

  // The id of the database to create and restore to, e.g. "db0". Note that this
  // database must not already exist.
  string database_id = 5;

  // The KMS key(s) used to encrypt the restored database to be created if the
  // restored database should be CMEK protected.
  google.spanner.admin.database.v1.EncryptionConfig encryption_config = 7;
}

// Action that gets a Cloud Spanner database.
message GetCloudDatabaseAction {
  // Cloud project ID, e.g. "spanner-cloud-systest".
  string project_id = 1;

  // Cloud instance ID (not path), e.g. "test-instance".
  string instance_id = 2;

  // The id of the database to get, e.g. "db0".
  string database_id = 3;
}

// Action that creates a Cloud Spanner database backup.
message CreateCloudBackupAction {
  // Cloud project ID, e.g. "spanner-cloud-systest".
  string project_id = 1;

  // Cloud instance ID (not path), e.g. "test-instance".
  string instance_id = 2;

  // The id of the backup to be created, e.g. "test-backup".
  string backup_id = 3;

  // The id of the database from which this backup was
  // created, e.g. "db0". Note that this needs to be in the
  // same instance as the backup.
  string database_id = 4;

  // Output only. The expiration time of the backup, which must be at least 6
  // hours and at most 366 days from the time the request is received.
  google.protobuf.Timestamp expire_time = 5
      [(google.api.field_behavior) = OUTPUT_ONLY];

  // The version time of the backup, which must be within the time range of
  // [earliest_version_time, NOW], where earliest_version_time is retrieved by
  // cloud spanner frontend API (See details: go/cs-pitr-lite-design).
  optional google.protobuf.Timestamp version_time = 6;

  // The KMS key(s) used to encrypt the backup to be created if the backup
  // should be CMEK protected.
  google.spanner.admin.database.v1.EncryptionConfig encryption_config = 7;
}

// Action that copies a Cloud Spanner database backup.
message CopyCloudBackupAction {
  // Cloud project ID, e.g. "spanner-cloud-systest".
  string project_id = 1;

  // Cloud instance ID (not path), e.g. "test-instance".
  string instance_id = 2;

  // The id of the backup to be created, e.g. "test-backup".
  string backup_id = 3;

  // The fully qualified uri of the source backup from which this
  // backup was copied. eg.
  // "projects/<project_id>/instances/<instance_id>/backups/<backup_id>".
  string source_backup = 4;

  // Output only. The expiration time of the backup, which must be at least 6
  // hours and at most 366 days from the time the request is received.
  google.protobuf.Timestamp expire_time = 5
      [(google.api.field_behavior) = OUTPUT_ONLY];
}

// Action that gets a Cloud Spanner database backup.
message GetCloudBackupAction {
  // Cloud project ID, e.g. "spanner-cloud-systest".
  string project_id = 1;

  // Cloud instance ID (not path), e.g. "test-instance".
  string instance_id = 2;

  // The id of the backup to get, e.g. "test-backup".
  string backup_id = 3;
}

// Action that updates a Cloud Spanner database backup.
message UpdateCloudBackupAction {
  // Cloud project ID, e.g. "spanner-cloud-systest".
  string project_id = 1;

  // Cloud instance ID (not path), e.g. "test-instance".
  string instance_id = 2;

  // The id of the backup to update, e.g. "test-backup".
  string backup_id = 3;

  // Output only. Updated value of expire_time, this is the only field
  // that supported to be updated.
  google.protobuf.Timestamp expire_time = 4
      [(google.api.field_behavior) = OUTPUT_ONLY];
}

// Action that deletes a Cloud Spanner database backup.
message DeleteCloudBackupAction {
  // Cloud project ID, e.g. "spanner-cloud-systest".
  string project_id = 1;

  // Cloud instance ID (not path), e.g. "test-instance".
  string instance_id = 2;

  // The id of the backup to delete, e.g. "test-backup".
  string backup_id = 3;
}

// Action that lists Cloud Spanner database backups.
message ListCloudBackupsAction {
  // Cloud project ID, e.g. "spanner-cloud-systest".
  string project_id = 1;

  // Cloud instance ID (not path) to list backups from, e.g. "test-instance".
  string instance_id = 2;

  // A filter expression that filters backups listed in the response.
  // The expression must specify the field name, a comparison operator,
  // and the value that you want to use for filtering.
  // Refer backup.proto.ListBackupsRequest for detail.
  string filter = 3;

  // Number of backups to be returned in the response. If 0 or
  // less, defaults to the server's maximum allowed page size.
  int32 page_size = 4;

  // If non-empty, "page_token" should contain a next_page_token
  // from a previous ListBackupsResponse to the same "parent"
  // and with the same "filter".
  string page_token = 5;
}

// Action that lists Cloud Spanner database backup operations.
message ListCloudBackupOperationsAction {
  // Cloud project ID, e.g. "spanner-cloud-systest".
  string project_id = 1;

  // Cloud instance ID (not path) to list backup operations from,
  // e.g. "test-instance".
  string instance_id = 2;

  // A filter expression that filters what operations are returned in the
  // response.
  // The expression must specify the field name, a comparison operator,
  // and the value that you want to use for filtering.
  // Refer backup.proto.ListBackupOperationsRequest for detail.
  string filter = 3;

  // Number of backups to be returned in the response. If 0 or
  // less, defaults to the server's maximum allowed page size.
  int32 page_size = 4;

  // If non-empty, "page_token" should contain a next_page_token
  // from a previous ListBackupOperationsResponse to the same "parent"
  // and with the same "filter".
  string page_token = 5;
}

// Action that gets an operation.
message GetOperationAction {
  // The name of the operation resource.
  string operation = 1;
}

// Query cancellation action defines the long running query and the cancel query
// format depening on the Cloud database dialect.
message QueryCancellationAction {
  // Long running query.
  string long_running_sql = 1;

  // Format of the cancel query for the cloud database dialect.
  string cancel_query = 2;
}

// Action that cancels an operation.
message CancelOperationAction {
  // The name of the operation resource to be cancelled.
  string operation = 1;
}

// Starts a batch read-only transaction in executor. Successful outcomes of this
// action will contain batch_txn_id--the identificator that can be used to start
// the same transaction in other Executors to parallelize partition processing.
//
// Example of a batch read flow:
// 1. Start batch transaction with a timestamp (StartBatchTransactionAction)
// 2. Generate database partitions for a read or query
// (GenerateDbPartitionsForReadAction/GenerateDbPartitionsForQueryAction)
// 3. Call ExecutePartitionAction for some or all partitions, process rows
// 4. Clean up the transaction (CloseBatchTransactionAction).
//
// More sophisticated example, with parallel processing:
// 1. Start batch transaction with a timestamp (StartBatchTransactionAction),
// note the returned BatchTransactionId
// 2. Generate database partitions for a read or query
// (GenerateDbPartitionsForReadAction/GenerateDbPartitionsForQueryAction)
// 3. Distribute the partitions over a pool of workers, along with the
// transaction ID.
//
// In each worker:
// 4-1. StartBatchTransactionAction with the given transaction ID
// 4-2. ExecutePartitionAction for each partition it got, process read results
// 4-3. Close (not cleanup) the transaction (CloseBatchTransactionAction).
//
// When all workers are done:
// 5. Cleanup the transaction (CloseBatchTransactionAction). This can be done
// either by the last worker to finish the job, or by the main Executor that
// initialized this transaction in the first place. It is also possible to clean
// it up with a brand new Executor -- just execute StartBatchTransactionAction
// with the ID, then clean it up right away.
//
// Cleaning up is optional, but recommended.
message StartBatchTransactionAction {
  // To start a new transaction, specify an exact timestamp. Alternatively, an
  // existing batch transaction ID can be used. Either one of two must be
  // set.
  oneof param {
    // The exact timestamp to start the batch transaction.
    google.protobuf.Timestamp batch_txn_time = 1;

    // ID of a batch read-only transaction. It can be used to start the same
    // batch transaction on multiple executors and parallelize partition
    // processing.
    bytes tid = 2;
  }

  // Database role to assume while performing this action. Setting the
  // database_role will enforce additional role-based access checks on this
  // action.
  string cloud_database_role = 3;
}

// Closes or cleans up the currently opened batch read-only transaction.
//
// Once a transaction is closed, the Executor can be disposed of or used to
// start start another transaction. Closing a batch transaction in one Executor
// doesn't affect the transaction's state in other Executors that also read from
// it.
//
// When a transaction is cleaned up, it becomes globally invalid. Cleaning up is
// optional, but recommended.
message CloseBatchTransactionAction {
  // Indicates whether the transaction needs to be cleaned up.
  bool cleanup = 1;
}

// Generate database partitions for the given read. Successful outcomes will
// contain database partitions in the db_partition field.
message GenerateDbPartitionsForReadAction {
  // Read to generate partitions for.
  ReadAction read = 1;

  // Metadata related to the tables involved in the read.
  repeated TableMetadata table = 2;

  // Desired size of data in each partition. Spanner doesn't guarantee to
  // respect this value.
  optional int64 desired_bytes_per_partition = 3;

  // If set, the desired max number of partitions. Spanner doesn't guarantee to
  // respect this value.
  optional int64 max_partition_count = 4;
}

// Generate database partitions for the given query. Successful outcomes will
// contain database partitions in the db_partition field.
message GenerateDbPartitionsForQueryAction {
  // Query to generate partitions for.
  QueryAction query = 1;

  // Desired size of data in each partition. Spanner doesn't guarantee to
  // respect this value.
  optional int64 desired_bytes_per_partition = 2;
}

// Identifies a database partition generated for a particular read or query. To
// read rows from the partition, use ExecutePartitionAction.
message BatchPartition {
  // Serialized Partition instance.
  bytes partition = 1;

  // The partition token decrypted from partition.
  bytes partition_token = 2;

  // Table name is set iff the partition was generated for a read (as opposed to
  // a query).
  optional string table = 3;

  // Index name if the partition was generated for an index read.
  optional string index = 4;
}

// Performs a read or query for the given partitions. This action must be
// executed in the context of the same transaction that was used to generate
// given partitions.
message ExecutePartitionAction {
  // Batch partition to execute on.
  BatchPartition partition = 1;
}

// Execute a change stream TVF query.
message ExecuteChangeStreamQuery {
  // Name for this change stream.
  string name = 1;

  // Specifies that records with commit_timestamp greater than or equal to
  // start_time should be returned.
  google.protobuf.Timestamp start_time = 2;

  // Specifies that records with commit_timestamp less than or equal to
  // end_time should be returned.
  optional google.protobuf.Timestamp end_time = 3;

  // Specifies which change stream partition to query, based on the content of
  // child partitions records.
  optional string partition_token = 4;

  // Read options for this change stream query.
  repeated string read_options = 5;

  // Determines how frequently a heartbeat ChangeRecord will be returned in case
  // there are no transactions committed in this partition, in milliseconds.
  optional int32 heartbeat_milliseconds = 6;

  // Deadline for this change stream query, in seconds.
  optional int64 deadline_seconds = 7;

  // Database role to assume while performing this action. This should only be
  // set for cloud requests. Setting the database role will enforce additional
  // role-based access checks on this action.
  optional string cloud_database_role = 8;
}

// SpannerActionOutcome defines a result of execution of a single SpannerAction.
message SpannerActionOutcome {
  // If an outcome is split into multiple parts, status will be set only in the
  // last part.
  optional google.rpc.Status status = 1;

  // Transaction timestamp. It must be set for successful committed actions.
  optional google.protobuf.Timestamp commit_time = 2;

  // Result of a ReadAction. This field must be set for ReadActions even if
  // no rows were read.
  optional ReadResult read_result = 3;

  // Result of a Query. This field must be set for Queries even if no rows were
  // read.
  optional QueryResult query_result = 4;

  // This bit indicates that Spanner has restarted the current transaction. It
  // means that the client should replay all the reads and writes.
  // Setting it to true is only valid in the context of a read-write
  // transaction, as an outcome of a committing FinishTransactionAction.
  optional bool transaction_restarted = 5;

  // In successful StartBatchTransactionAction outcomes, this contains the ID of
  // the transaction.
  optional bytes batch_txn_id = 6;

  // Generated database partitions (result of a
  // GenetageDbPartitionsForReadAction/GenerateDbPartitionsForQueryAction).
  repeated BatchPartition db_partition = 7;

  // Result of admin related actions.
  optional AdminResult admin_result = 8;

  // Stores rows modified by query in single DML or batch DML action.
  // In case of batch DML action, stores 0 as row count of errored DML query.
  repeated int64 dml_rows_modified = 9;

  // Change stream records returned by a change stream query.
  repeated ChangeStreamRecord change_stream_records = 10;
}

// AdminResult contains admin action results, for database/backup/operation.
message AdminResult {
  // Results of cloud backup related actions.
  CloudBackupResponse backup_response = 1;

  // Results of operation related actions.
  OperationResponse operation_response = 2;

  // Results of database related actions.
  CloudDatabaseResponse database_response = 3;

  // Results of instance related actions.
  CloudInstanceResponse instance_response = 4;

  // Results of instance config related actions.
  CloudInstanceConfigResponse instance_config_response = 5;
}

// CloudBackupResponse contains results returned by cloud backup related
// actions.
message CloudBackupResponse {
  // List of backups returned by ListCloudBackupsAction.
  repeated google.spanner.admin.database.v1.Backup listed_backups = 1;

  // List of operations returned by ListCloudBackupOperationsAction.
  repeated google.longrunning.Operation listed_backup_operations = 2;

  // "next_page_token" can be sent in a subsequent list action
  // to fetch more of the matching data.
  string next_page_token = 3;

  // Backup returned by GetCloudBackupAction/UpdateCloudBackupAction.
  google.spanner.admin.database.v1.Backup backup = 4;
}

// OperationResponse contains results returned by operation related actions.
message OperationResponse {
  // List of operations returned by ListOperationsAction.
  repeated google.longrunning.Operation listed_operations = 1;

  // "next_page_token" can be sent in a subsequent list action
  // to fetch more of the matching data.
  string next_page_token = 2;

  // Operation returned by GetOperationAction.
  google.longrunning.Operation operation = 3;
}

// CloudInstanceResponse contains results returned by cloud instance related
// actions.
message CloudInstanceResponse {
  // List of instances returned by ListCloudInstancesAction.
  repeated google.spanner.admin.instance.v1.Instance listed_instances = 1;

  // "next_page_token" can be sent in a subsequent list action
  // to fetch more of the matching data.
  string next_page_token = 2;

  // Instance returned by GetCloudInstanceAction
  google.spanner.admin.instance.v1.Instance instance = 3;
}

// CloudInstanceConfigResponse contains results returned by cloud instance
// config related actions.
message CloudInstanceConfigResponse {
  // List of instance configs returned by ListCloudInstanceConfigsAction.
  repeated google.spanner.admin.instance.v1.InstanceConfig
      listed_instance_configs = 1;

  // "next_page_token" can be sent in a subsequent list action
  // to fetch more of the matching data.
  string next_page_token = 2;

  // Instance config returned by GetCloudInstanceConfigAction.
  google.spanner.admin.instance.v1.InstanceConfig instance_config = 3;
}

// CloudDatabaseResponse contains results returned by cloud database related
// actions.
message CloudDatabaseResponse {
  // List of databases returned by ListCloudDatabasesAction.
  repeated google.spanner.admin.database.v1.Database listed_databases = 1;

  // List of operations returned by ListCloudDatabaseOperationsAction.
  repeated google.longrunning.Operation listed_database_operations = 2;

  // "next_page_token" can be sent in a subsequent list action
  // to fetch more of the matching data.
  string next_page_token = 3;

  // Database returned by GetCloudDatabaseAction
  google.spanner.admin.database.v1.Database database = 4;
}

// ReadResult contains rows read.
message ReadResult {
  // Table name.
  string table = 1;

  // Index name, if read from an index.
  optional string index = 2;

  // Request index (multiread only).
  optional int32 request_index = 3;

  // Rows read. Each row is a struct with multiple fields, one for each column
  // in read result. All rows have the same type.
  repeated ValueList row = 4;

  // The type of rows read. It must be set if at least one row was read.
  optional google.spanner.v1.StructType row_type = 5;
}

// QueryResult contains result of a Query.
message QueryResult {
  // Rows read. Each row is a struct with multiple fields, one for each column
  // in read result. All rows have the same type.
  repeated ValueList row = 1;

  // The type of rows read. It must be set if at least one row was read.
  optional google.spanner.v1.StructType row_type = 2;
}

// Raw ChangeStream records.
// Encodes one of: DataChangeRecord, HeartbeatRecord, ChildPartitionsRecord
// returned from the ChangeStream API.
message ChangeStreamRecord {
  // Record represents one type of the change stream record.
  oneof record {
    // Data change record.
    DataChangeRecord data_change = 1;

    // Child partitions record.
    ChildPartitionsRecord child_partition = 2;

    // Heartbeat record.
    HeartbeatRecord heartbeat = 3;
  }
}

// ChangeStream data change record.
message DataChangeRecord {
  // Column types.
  message ColumnType {
    // Column name.
    string name = 1;

    // Column type in JSON.
    string type = 2;

    // Whether the column is a primary key column.
    bool is_primary_key = 3;

    // The position of the column as defined in the schema.
    int64 ordinal_position = 4;
  }

  // Describes the changes that were made.
  message Mod {
    // The primary key values in JSON.
    string keys = 1;

    // The new values of the changed columns in JSON. Only contain the non-key
    // columns.
    string new_values = 2;

    // The old values of the changed columns in JSON. Only contain the non-key
    // columns.
    string old_values = 3;
  }

  // The timestamp in which the change was committed.
  google.protobuf.Timestamp commit_time = 1;

  // The sequence number for the record within the transaction.
  string record_sequence = 2;

  // A globally unique string that represents the transaction in which the
  // change was committed.
  string transaction_id = 3;

  // Indicates whether this is the last record for a transaction in the current
  // partition.
  bool is_last_record = 4;

  // Name of the table affected by the change.
  string table = 5;

  // Column types defined in the schema.
  repeated ColumnType column_types = 6;

  // Changes made in the transaction.
  repeated Mod mods = 7;

  // Describes the type of change. One of INSERT, UPDATE or DELETE.
  string mod_type = 8;

  // One of value capture type: NEW_VALUES, OLD_VALUES, OLD_AND_NEW_VALUES.
  string value_capture_type = 9;

  // Number of records in transactions.
  int64 record_count = 10;

  // Number of partitions in transactions.
  int64 partition_count = 11;

  // Transaction tag info.
  string transaction_tag = 12;

  // Whether the transaction is a system transactionn.
  bool is_system_transaction = 13;
}

// ChangeStream child partition record.
message ChildPartitionsRecord {
  // A single child partition.
  message ChildPartition {
    // Partition token string used to identify the child partition in queries.
    string token = 1;

    // Parent partition tokens of this child partition.
    repeated string parent_partition_tokens = 2;
  }

  // Data change records returned from child partitions in this child partitions
  // record will have a commit timestamp greater than or equal to start_time.
  google.protobuf.Timestamp start_time = 1;

  // A monotonically increasing sequence number that can be used to define the
  // ordering of the child partitions record when there are multiple child
  // partitions records returned with the same start_time in a particular
  // partition.
  string record_sequence = 2;

  // A set of child partitions and their associated information.
  repeated ChildPartition child_partitions = 3;
}

// ChangeStream heartbeat record.
message HeartbeatRecord {
  // Timestamp for this heartbeat check.
  google.protobuf.Timestamp heartbeat_time = 1;
}

// Options for Cloud Spanner Service.
message SpannerOptions {
  // Options for configuring the session pool
  SessionPoolOptions session_pool_options = 1;
}

// Options for the session pool used by the DatabaseClient.
message SessionPoolOptions {
  // passing this as true, will make applicable RPCs use multiplexed sessions
  // instead of regular sessions
  bool use_multiplexed = 1;
}