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