1 // Copyright 2018 Google LLC.
3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at
7 // http://www.apache.org/licenses/LICENSE-2.0
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and
13 // limitations under the License.
18 package google.firestore.v1beta1;
20 import "google/api/annotations.proto";
21 import "google/protobuf/timestamp.proto";
23 option csharp_namespace = "Google.Cloud.Firestore.V1Beta1";
24 option go_package = "google.golang.org/genproto/googleapis/firestore/v1beta1;firestore";
25 option java_multiple_files = true;
26 option java_outer_classname = "CommonProto";
27 option java_package = "com.google.firestore.v1beta1";
28 option objc_class_prefix = "GCFS";
29 option php_namespace = "Google\\Cloud\\Firestore\\V1beta1";
31 // A set of field paths on a document.
32 // Used to restrict a get or update operation on a document to a subset of its
34 // This is different from standard field masks, as this is always scoped to a
35 // [Document][google.firestore.v1beta1.Document], and takes in account the
36 // dynamic nature of [Value][google.firestore.v1beta1.Value].
37 message DocumentMask {
38 // The list of field paths in the mask. See
39 // [Document.fields][google.firestore.v1beta1.Document.fields] for a field
40 // path syntax reference.
41 repeated string field_paths = 1;
44 // A precondition on a document, used for conditional operations.
45 message Precondition {
46 // The type of precondition.
47 oneof condition_type {
48 // When set to `true`, the target document must exist.
49 // When set to `false`, the target document must not exist.
52 // When set, the target document must exist and have been last updated at
54 google.protobuf.Timestamp update_time = 2;
58 // Options for creating a new transaction.
59 message TransactionOptions {
60 // Options for a transaction that can be used to read and write documents.
62 // An optional transaction to retry.
63 bytes retry_transaction = 1;
66 // Options for a transaction that can only be used to read documents.
68 // The consistency mode for this transaction. If not set, defaults to strong
70 oneof consistency_selector {
71 // Reads documents at the given time.
72 // This may not be older than 60 seconds.
73 google.protobuf.Timestamp read_time = 2;
77 // The mode of the transaction.
79 // The transaction can only be used for read operations.
80 ReadOnly read_only = 2;
82 // The transaction can be used for both read and write operations.
83 ReadWrite read_write = 3;