Built motion from commit 6a09e18b.|2.6.11
[motion2.git] / legacy-libs / google-proto-files / google / firestore / v1 / document.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/struct.proto";
22 import "google/protobuf/timestamp.proto";
23 import "google/type/latlng.proto";
24
25 option csharp_namespace = "Google.Cloud.Firestore.V1";
26 option go_package = "google.golang.org/genproto/googleapis/firestore/v1;firestore";
27 option java_multiple_files = true;
28 option java_outer_classname = "DocumentProto";
29 option java_package = "com.google.firestore.v1";
30 option objc_class_prefix = "GCFS";
31 option php_namespace = "Google\\Cloud\\Firestore\\V1";
32
33 // A Firestore document.
34 //
35 // Must not exceed 1 MiB - 4 bytes.
36 message Document {
37   // The resource name of the document, for example
38   // `projects/{project_id}/databases/{database_id}/documents/{document_path}`.
39   string name = 1;
40
41   // The document's fields.
42   //
43   // The map keys represent field names.
44   //
45   // A simple field name contains only characters `a` to `z`, `A` to `Z`,
46   // `0` to `9`, or `_`, and must not start with `0` to `9`. For example,
47   // `foo_bar_17`.
48   //
49   // Field names matching the regular expression `__.*__` are reserved. Reserved
50   // field names are forbidden except in certain documented contexts. The map
51   // keys, represented as UTF-8, must not exceed 1,500 bytes and cannot be
52   // empty.
53   //
54   // Field paths may be used in other contexts to refer to structured fields
55   // defined here. For `map_value`, the field path is represented by the simple
56   // or quoted field names of the containing fields, delimited by `.`. For
57   // example, the structured field
58   // `"foo" : { map_value: { "x&y" : { string_value: "hello" }}}` would be
59   // represented by the field path `foo.x&y`.
60   //
61   // Within a field path, a quoted field name starts and ends with `` ` `` and
62   // may contain any character. Some characters, including `` ` ``, must be
63   // escaped using a `\`. For example, `` `x&y` `` represents `x&y` and
64   // `` `bak\`tik` `` represents `` bak`tik ``.
65   map<string, Value> fields = 2;
66
67   // Output only. The time at which the document was created.
68   //
69   // This value increases monotonically when a document is deleted then
70   // recreated. It can also be compared to values from other documents and
71   // the `read_time` of a query.
72   google.protobuf.Timestamp create_time = 3;
73
74   // Output only. The time at which the document was last changed.
75   //
76   // This value is initially set to the `create_time` then increases
77   // monotonically with each change to the document. It can also be
78   // compared to values from other documents and the `read_time` of a query.
79   google.protobuf.Timestamp update_time = 4;
80 }
81
82 // A message that can hold any of the supported value types.
83 message Value {
84   // Must have a value set.
85   oneof value_type {
86     // A null value.
87     google.protobuf.NullValue null_value = 11;
88
89     // A boolean value.
90     bool boolean_value = 1;
91
92     // An integer value.
93     int64 integer_value = 2;
94
95     // A double value.
96     double double_value = 3;
97
98     // A timestamp value.
99     //
100     // Precise only to microseconds. When stored, any additional precision is
101     // rounded down.
102     google.protobuf.Timestamp timestamp_value = 10;
103
104     // A string value.
105     //
106     // The string, represented as UTF-8, must not exceed 1 MiB - 89 bytes.
107     // Only the first 1,500 bytes of the UTF-8 representation are considered by
108     // queries.
109     string string_value = 17;
110
111     // A bytes value.
112     //
113     // Must not exceed 1 MiB - 89 bytes.
114     // Only the first 1,500 bytes are considered by queries.
115     bytes bytes_value = 18;
116
117     // A reference to a document. For example:
118     // `projects/{project_id}/databases/{database_id}/documents/{document_path}`.
119     string reference_value = 5;
120
121     // A geo point value representing a point on the surface of Earth.
122     google.type.LatLng geo_point_value = 8;
123
124     // An array value.
125     //
126     // Cannot directly contain another array value, though can contain an
127     // map which contains another array.
128     ArrayValue array_value = 9;
129
130     // A map value.
131     MapValue map_value = 6;
132   }
133 }
134
135 // An array value.
136 message ArrayValue {
137   // Values in the array.
138   repeated Value values = 1;
139 }
140
141 // A map value.
142 message MapValue {
143   // The map's fields.
144   //
145   // The map keys represent field names. Field names matching the regular
146   // expression `__.*__` are reserved. Reserved field names are forbidden except
147   // in certain documented contexts. The map keys, represented as UTF-8, must
148   // not exceed 1,500 bytes and cannot be empty.
149   map<string, Value> fields = 1;
150 }