@@ -32,46 +32,47 @@ option java_package = "com.google.datastore.v1beta3";
3232// input keys sets the project ID (if not already set) to the project ID from
3333// the request.
3434//
35+ //
3536service Datastore {
36- // Look up entities by key.
37+ // Looks up entities by key.
3738 rpc Lookup (LookupRequest ) returns (LookupResponse ) {
3839 option (google.api.http ) = { post : "/v1beta3/projects/{project_id}:lookup" body: "*" };
3940 }
4041
41- // Query for entities.
42+ // Queries for entities.
4243 rpc RunQuery (RunQueryRequest ) returns (RunQueryResponse ) {
4344 option (google.api.http ) = { post : "/v1beta3/projects/{project_id}:runQuery" body: "*" };
4445 }
4546
46- // Begin a new transaction.
47+ // Begins a new transaction.
4748 rpc BeginTransaction (BeginTransactionRequest ) returns (BeginTransactionResponse ) {
4849 option (google.api.http ) = { post : "/v1beta3/projects/{project_id}:beginTransaction" body: "*" };
4950 }
5051
51- // Commit a transaction, optionally creating, deleting or modifying some
52+ // Commits a transaction, optionally creating, deleting or modifying some
5253 // entities.
5354 rpc Commit (CommitRequest ) returns (CommitResponse ) {
5455 option (google.api.http ) = { post : "/v1beta3/projects/{project_id}:commit" body: "*" };
5556 }
5657
57- // Roll back a transaction.
58+ // Rolls back a transaction.
5859 rpc Rollback (RollbackRequest ) returns (RollbackResponse ) {
5960 option (google.api.http ) = { post : "/v1beta3/projects/{project_id}:rollback" body: "*" };
6061 }
6162
62- // Allocate IDs for the given keys ( useful for referencing an entity before
63- // it is inserted) .
63+ // Allocates IDs for the given keys, which is useful for referencing an entity
64+ // before it is inserted.
6465 rpc AllocateIds (AllocateIdsRequest ) returns (AllocateIdsResponse ) {
6566 option (google.api.http ) = { post : "/v1beta3/projects/{project_id}:allocateIds" body: "*" };
6667 }
6768}
6869
6970// The request for [google.datastore.v1beta3.Datastore.Lookup][google.datastore.v1beta3.Datastore.Lookup].
7071message LookupRequest {
71- // Project ID against which to make the request.
72+ // The ID of the project against which to make the request.
7273 string project_id = 8 ;
7374
74- // Options for this lookup request.
75+ // The options for this lookup request.
7576 ReadOptions read_options = 1 ;
7677
7778 // Keys of entities to look up.
@@ -98,7 +99,7 @@ message LookupResponse {
9899
99100// The request for [google.datastore.v1beta3.Datastore.RunQuery][google.datastore.v1beta3.Datastore.RunQuery].
100101message RunQueryRequest {
101- // Project ID against which to make the request.
102+ // The ID of the project against which to make the request.
102103 string project_id = 8 ;
103104
104105 // Entities are partitioned into subsets, identified by a partition ID.
@@ -131,7 +132,7 @@ message RunQueryResponse {
131132
132133// The request for [google.datastore.v1beta3.Datastore.BeginTransaction][google.datastore.v1beta3.Datastore.BeginTransaction].
133134message BeginTransactionRequest {
134- // Project ID against which to make the request.
135+ // The ID of the project against which to make the request.
135136 string project_id = 8 ;
136137}
137138
@@ -143,7 +144,7 @@ message BeginTransactionResponse {
143144
144145// The request for [google.datastore.v1beta3.Datastore.Rollback][google.datastore.v1beta3.Datastore.Rollback].
145146message RollbackRequest {
146- // Project ID against which to make the request.
147+ // The ID of the project against which to make the request.
147148 string project_id = 8 ;
148149
149150 // The transaction identifier, returned by a call to
@@ -159,27 +160,30 @@ message RollbackResponse {
159160
160161// The request for [google.datastore.v1beta3.Datastore.Commit][google.datastore.v1beta3.Datastore.Commit].
161162message CommitRequest {
162- // Commit modes.
163+ // The modes available for commits .
163164 enum Mode {
164- // Unspecified.
165+ // Unspecified. This value must not be used.
165166 MODE_UNSPECIFIED = 0 ;
166167
167- // Transactional.
168+ // Transactional: The mutations are either all applied, or none are applied.
169+ // Learn about transactions [here](https://cloud.google.com/datastore/docs/concepts/transactions).
168170 TRANSACTIONAL = 1 ;
169171
170- // Non-transactional.
172+ // Non-transactional: The mutations may not apply as all or none .
171173 NON_TRANSACTIONAL = 2 ;
172174 }
173175
174- // Project ID against which to make the request.
176+ // The ID of the project against which to make the request.
175177 string project_id = 8 ;
176178
177179 // The type of commit to perform. Defaults to `TRANSACTIONAL`.
178180 Mode mode = 5 ;
179181
180182 // Must be set when mode is `TRANSACTIONAL`.
181183 oneof transaction_selector {
182- // The transaction in which to write.
184+ // The identifier of the transaction associated with the commit. A
185+ // transaction identifier is returned by a call to
186+ // [BeginTransaction][google.datastore.v1beta3.Datastore.BeginTransaction].
183187 bytes transaction = 1 ;
184188 }
185189
@@ -188,6 +192,7 @@ message CommitRequest {
188192 // When mode is `TRANSACTIONAL`, mutations affecting a single entity are
189193 // applied in order. The following sequences of mutations affecting a single
190194 // entity are not permitted in a single `Commit` request:
195+ //
191196 // - `insert` followed by `insert`
192197 // - `update` followed by `insert`
193198 // - `upsert` followed by `insert`
@@ -204,13 +209,14 @@ message CommitResponse {
204209 // The i-th mutation result corresponds to the i-th mutation in the request.
205210 repeated MutationResult mutation_results = 3 ;
206211
207- // The number of index entries updated during the commit.
212+ // The number of index entries updated during the commit, or zero if none were
213+ // updated.
208214 int32 index_updates = 4 ;
209215}
210216
211217// The request for [google.datastore.v1beta3.Datastore.AllocateIds][google.datastore.v1beta3.Datastore.AllocateIds].
212218message AllocateIdsRequest {
213- // Project ID against which to make the request.
219+ // The ID of the project against which to make the request.
214220 string project_id = 8 ;
215221
216222 // A list of keys with incomplete key paths for which to allocate IDs.
@@ -237,15 +243,15 @@ message Mutation {
237243 // not even a value in an entity in another value.
238244 oneof operation {
239245 // The entity to insert. The entity must not already exist.
240- // The entity's key's final path element may be incomplete.
246+ // The entity key's final path element may be incomplete.
241247 Entity insert = 4 ;
242248
243249 // The entity to update. The entity must already exist.
244250 // Must have a complete key path.
245251 Entity update = 5 ;
246252
247253 // The entity to upsert. The entity may or may not already exist.
248- // The entity's key's final path element may be incomplete.
254+ // The entity key's final path element may be incomplete.
249255 Entity upsert = 6 ;
250256
251257 // The key of the entity to delete. The entity may or may not already exist.
@@ -261,11 +267,11 @@ message MutationResult {
261267 Key key = 3 ;
262268}
263269
264- // Options shared by read requests.
270+ // The options shared by read requests.
265271message ReadOptions {
266- // Read consistencies.
272+ // The possible values for read consistencies.
267273 enum ReadConsistency {
268- // Unspecified.
274+ // Unspecified. This value must not be used.
269275 READ_CONSISTENCY_UNSPECIFIED = 0 ;
270276
271277 // Strong consistency.
0 commit comments