Update protos for datastore/v1beta3 API.

This commit is contained in:
Ethan Bao 2016-08-10 13:32:53 -07:00
parent f2df330940
commit a777f1c33a
3 changed files with 50 additions and 7 deletions

View File

@ -1,4 +1,4 @@
// Copyright (c) 2015, Google Inc.
// Copyright 2016 Google Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@ -32,7 +32,6 @@ option java_package = "com.google.datastore.v1beta3";
// input keys sets the project ID (if not already set) to the project ID from
// the request.
//
//
service Datastore {
// Looks up entities by key.
rpc Lookup(LookupRequest) returns (LookupResponse) {
@ -258,6 +257,15 @@ message Mutation {
// Must have a complete key path and must not be reserved/read-only.
Key delete = 7;
}
// When set, the server will detect whether or not this mutation conflicts
// with the current version of the entity on the server. Conflicting mutations
// are not applied, and are marked as such in MutationResult.
oneof conflict_detection_strategy {
// The version of the entity that this mutation is being applied to. If this
// does not match the current version on the server, the mutation conflicts.
int64 base_version = 8;
}
}
// The result of applying a mutation.
@ -265,6 +273,17 @@ message MutationResult {
// The automatically allocated key.
// Set only when the mutation allocated a key.
Key key = 3;
// The version of the entity on the server after processing the mutation. If
// the mutation doesn't change anything on the server, then the version will
// be the version of the current entity or, if no entity is present, a version
// that is strictly greater than the version of any previous entity and less
// than the version of any possible future entity.
int64 version = 4;
// Whether a conflict was detected for this mutation. Always false when a
// conflict detection strategy field is not set in the mutation.
bool conflict_detected = 5;
}
// The options shared by read requests.
@ -289,7 +308,9 @@ message ReadOptions {
// Cannot be set to `STRONG` for global queries.
ReadConsistency read_consistency = 1;
// The transaction in which to read.
// The identifier of the transaction in which to read. A
// transaction identifier is returned by a call to
// [BeginTransaction][google.datastore.v1beta3.Datastore.BeginTransaction].
bytes transaction = 2;
}
}

View File

@ -1,4 +1,4 @@
// Copyright (c) 2015, Google Inc.
// Copyright 2016 Google Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.

View File

@ -1,4 +1,4 @@
// Copyright (c) 2015, Google Inc.
// Copyright 2016 Google Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@ -50,6 +50,16 @@ message EntityResult {
// The resulting entity.
Entity entity = 1;
// The version of the entity, a strictly positive number that monotonically
// increases with changes to the entity.
//
// This field is set for [`FULL`]
// [google.datastore.v1beta3.EntityResult.ResultType.FULL] entity results.
// For [missing][google.datastore.v1beta3.LookupResponse.missing] entities in
// `LookupResponse`, this is the version of the snapshot that was used to look
// up the entity, and it is always set except for eventually consistent reads.
int64 version = 4;
// A cursor that points to the position after the result entity.
// Set only when the `EntityResult` is part of a `QueryResultBatch` message.
bytes cursor = 3;
@ -76,11 +86,13 @@ message Query {
repeated PropertyReference distinct_on = 6;
// A starting point for the query results. Query cursors are
// returned in query result batches.
// returned in query result batches and
// [can only be used to continue the same query](https://cloud.google.com/datastore/docs/concepts/queries#cursors_limits_and_offsets).
bytes start_cursor = 7;
// An ending point for the query results. Query cursors are
// returned in query result batches.
// returned in query result batches and
// [can only be used to limit the same query](https://cloud.google.com/datastore/docs/concepts/queries#cursors_limits_and_offsets).
bytes end_cursor = 8;
// The number of results to skip. Applies before limit, but after all other
@ -279,4 +291,14 @@ message QueryResultBatch {
// The state of the query after the current batch.
MoreResultsType more_results = 5;
// The version number of the snapshot this batch was returned from.
// This applies to the range of results from the query's `start_cursor` (or
// the beginning of the query if no cursor was given) to this batch's
// `end_cursor` (not the query's `end_cursor`).
//
// In a single transaction, subsequent query result batches for the same query
// can have a greater snapshot version number. Each batch's snapshot version
// is valid for all preceding batches.
int64 snapshot_version = 7;
}