Built motion from commit 6a09e18b.|2.6.11
[motion2.git] / legacy-libs / google-proto-files / google / firestore / v1 / common.proto
1 // Copyright 2018 Google LLC.
2 //
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
6 //
7 //     http://www.apache.org/licenses/LICENSE-2.0
8 //
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.
14 //
15
16 syntax = "proto3";
17
18 package google.firestore.v1;
19
20 import "google/api/annotations.proto";
21 import "google/protobuf/timestamp.proto";
22
23 option csharp_namespace = "Google.Cloud.Firestore.V1";
24 option go_package = "google.golang.org/genproto/googleapis/firestore/v1;firestore";
25 option java_multiple_files = true;
26 option java_outer_classname = "CommonProto";
27 option java_package = "com.google.firestore.v1";
28 option objc_class_prefix = "GCFS";
29 option php_namespace = "Google\\Cloud\\Firestore\\V1";
30
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
33 // fields.
34 // This is different from standard field masks, as this is always scoped to a
35 // [Document][google.firestore.v1.Document], and takes in account the dynamic
36 // nature of [Value][google.firestore.v1.Value].
37 message DocumentMask {
38   // The list of field paths in the mask. See
39   // [Document.fields][google.firestore.v1.Document.fields] for a field path
40   // syntax reference.
41   repeated string field_paths = 1;
42 }
43
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.
50     bool exists = 1;
51
52     // When set, the target document must exist and have been last updated at
53     // that time.
54     google.protobuf.Timestamp update_time = 2;
55   }
56 }
57
58 // Options for creating a new transaction.
59 message TransactionOptions {
60   // Options for a transaction that can be used to read and write documents.
61   message ReadWrite {
62     // An optional transaction to retry.
63     bytes retry_transaction = 1;
64   }
65
66   // Options for a transaction that can only be used to read documents.
67   message ReadOnly {
68     // The consistency mode for this transaction. If not set, defaults to strong
69     // consistency.
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;
74     }
75   }
76
77   // The mode of the transaction.
78   oneof mode {
79     // The transaction can only be used for read operations.
80     ReadOnly read_only = 2;
81
82     // The transaction can be used for both read and write operations.
83     ReadWrite read_write = 3;
84   }
85 }