fix!: annotating some fields as REQUIRED

These fields were actually always required by the backend, so annotation just documents status quo. I believe this change will not require major version bump for any language.

PiperOrigin-RevId: 429093810
pull/705/head
Google APIs 3 years ago committed by Copybara-Service
parent 1bbb5df67d
commit dc04c1c48a
  1. 13
      google/spanner/admin/instance/v1/spanner_instance_admin.proto
  2. 7
      google/spanner/v1/mutation.proto
  3. 6
      google/spanner/v1/spanner.proto

@ -350,19 +350,22 @@ message Instance {
// after the instance is created. Values are of the form
// `projects/<project>/instances/[a-z][-a-z0-9]*[a-z0-9]`. The final
// segment of the name must be between 2 and 64 characters in length.
string name = 1;
string name = 1 [(google.api.field_behavior) = REQUIRED];
// Required. The name of the instance's configuration. Values are of the form
// `projects/<project>/instanceConfigs/<configuration>`. See
// also [InstanceConfig][google.spanner.admin.instance.v1.InstanceConfig] and
// [ListInstanceConfigs][google.spanner.admin.instance.v1.InstanceAdmin.ListInstanceConfigs].
string config = 2 [(google.api.resource_reference) = {
type: "spanner.googleapis.com/InstanceConfig"
}];
string config = 2 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {
type: "spanner.googleapis.com/InstanceConfig"
}
];
// Required. The descriptive name for this instance as it appears in UIs.
// Must be unique per project and between 4 and 30 characters in length.
string display_name = 3;
string display_name = 3 [(google.api.field_behavior) = REQUIRED];
// Required. The number of nodes allocated to this instance. This may be zero
// in API responses for instances that are not yet in state `READY`.

@ -17,6 +17,7 @@ syntax = "proto3";
package google.spanner.v1;
import "google/api/annotations.proto";
import "google/api/field_behavior.proto";
import "google/protobuf/struct.proto";
import "google/spanner/v1/keys.proto";
@ -36,7 +37,7 @@ message Mutation {
// [replace][google.spanner.v1.Mutation.replace] operations.
message Write {
// Required. The table whose rows will be written.
string table = 1;
string table = 1 [(google.api.field_behavior) = REQUIRED];
// The names of the columns in [table][google.spanner.v1.Mutation.Write.table] to be written.
//
@ -59,7 +60,7 @@ message Mutation {
// Arguments to [delete][google.spanner.v1.Mutation.delete] operations.
message Delete {
// Required. The table whose rows will be deleted.
string table = 1;
string table = 1 [(google.api.field_behavior) = REQUIRED];
// Required. The primary keys of the rows within [table][google.spanner.v1.Mutation.Delete.table] to delete. The
// primary keys must be specified in the order in which they appear in the
@ -67,7 +68,7 @@ message Mutation {
// statement used to create the table).
// Delete is idempotent. The transaction will succeed even if some or all
// rows do not exist.
KeySet key_set = 2;
KeySet key_set = 2 [(google.api.field_behavior) = REQUIRED];
}
// Required. The operation to perform.

@ -300,8 +300,8 @@ message CreateSessionRequest {
}
];
// The session to create.
Session session = 2;
// Required. The session to create.
Session session = 2 [(google.api.field_behavior) = REQUIRED];
}
// The request for [BatchCreateSessions][google.spanner.v1.Spanner.BatchCreateSessions].
@ -647,7 +647,7 @@ message ExecuteBatchDmlRequest {
// A single DML statement.
message Statement {
// Required. The DML string.
string sql = 1;
string sql = 1 [(google.api.field_behavior) = REQUIRED];
// Parameter names and values that bind to placeholders in the DML string.
//

Loading…
Cancel
Save