Skip to content

Commit e0d00fe

Browse files
authored
Add protos as an artifact to library (#7205)
1 parent 9d59c0f commit e0d00fe

File tree

12 files changed

+2292
-5
lines changed

12 files changed

+2292
-5
lines changed
Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
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/timestamp.proto";
22+
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";
30+
31+
32+
// A set of field paths on a document.
33+
// Used to restrict a get or update operation on a document to a subset of its
34+
// fields.
35+
// This is different from standard field masks, as this is always scoped to a
36+
// [Document][google.firestore.v1beta1.Document], and takes in account the dynamic nature of [Value][google.firestore.v1beta1.Value].
37+
message DocumentMask {
38+
// The list of field paths in the mask. See [Document.fields][google.firestore.v1beta1.Document.fields] for a field
39+
// path syntax reference.
40+
repeated string field_paths = 1;
41+
}
42+
43+
// A precondition on a document, used for conditional operations.
44+
message Precondition {
45+
// The type of precondition.
46+
oneof condition_type {
47+
// When set to `true`, the target document must exist.
48+
// When set to `false`, the target document must not exist.
49+
bool exists = 1;
50+
51+
// When set, the target document must exist and have been last updated at
52+
// that time.
53+
google.protobuf.Timestamp update_time = 2;
54+
}
55+
}
56+
57+
// Options for creating a new transaction.
58+
message TransactionOptions {
59+
// Options for a transaction that can be used to read and write documents.
60+
message ReadWrite {
61+
// An optional transaction to retry.
62+
bytes retry_transaction = 1;
63+
}
64+
65+
// Options for a transaction that can only be used to read documents.
66+
message ReadOnly {
67+
// The consistency mode for this transaction. If not set, defaults to strong
68+
// consistency.
69+
oneof consistency_selector {
70+
// Reads documents at the given time.
71+
// This may not be older than 60 seconds.
72+
google.protobuf.Timestamp read_time = 2;
73+
}
74+
}
75+
76+
// The mode of the transaction.
77+
oneof mode {
78+
// The transaction can only be used for read operations.
79+
ReadOnly read_only = 2;
80+
81+
// The transaction can be used for both read and write operations.
82+
ReadWrite read_write = 3;
83+
}
84+
}
Lines changed: 151 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,151 @@
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+
}
Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
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.admin.v1beta2;
19+
20+
import "google/api/annotations.proto";
21+
import "google/firestore/admin/v1beta2/index.proto";
22+
23+
option csharp_namespace = "Google.Cloud.Firestore.Admin.V1Beta2";
24+
option go_package = "google.golang.org/genproto/googleapis/firestore/admin/v1beta2;admin";
25+
option java_multiple_files = true;
26+
option java_outer_classname = "FieldProto";
27+
option java_package = "com.google.firestore.admin.v1beta2";
28+
option objc_class_prefix = "GCFS";
29+
30+
31+
// Represents a single field in the database.
32+
//
33+
// Fields are grouped by their "Collection Group", which represent all
34+
// collections in the database with the same id.
35+
message Field {
36+
// The index configuration for this field.
37+
message IndexConfig {
38+
// The indexes supported for this field.
39+
repeated Index indexes = 1;
40+
41+
// Output only.
42+
// When true, the `Field`'s index configuration is set from the
43+
// configuration specified by the `ancestor_field`.
44+
// When false, the `Field`'s index configuration is defined explicitly.
45+
bool uses_ancestor_config = 2;
46+
47+
// Output only.
48+
// Specifies the resource name of the `Field` from which this field's
49+
// index configuration is set (when `uses_ancestor_config` is true),
50+
// or from which it *would* be set if this field had no index configuration
51+
// (when `uses_ancestor_config` is false).
52+
string ancestor_field = 3;
53+
54+
// Output only
55+
// When true, the `Field`'s index configuration is in the process of being
56+
// reverted. Once complete, the index config will transition to the same
57+
// state as the field specified by `ancestor_field`, at which point
58+
// `uses_ancestor_config` will be `true` and `reverting` will be `false`.
59+
bool reverting = 4;
60+
}
61+
62+
// A field name of the form
63+
// `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}/fields/{field_path}`
64+
//
65+
// A field path may be a simple field name, e.g. `address` or a path to fields
66+
// within map_value , e.g. `address.city`,
67+
// or a special field path. The only valid special field is `*`, which
68+
// represents any field.
69+
//
70+
// Field paths may be quoted using ` (backtick). The only character that needs
71+
// to be escaped within a quoted field path is the backtick character itself,
72+
// escaped using a backslash. Special characters in field paths that
73+
// must be quoted include: `*`, `.`,
74+
// ``` (backtick), `[`, `]`, as well as any ascii symbolic characters.
75+
//
76+
// Examples:
77+
// (Note: Comments here are written in markdown syntax, so there is an
78+
// additional layer of backticks to represent a code block)
79+
// `\`address.city\`` represents a field named `address.city`, not the map key
80+
// `city` in the field `address`.
81+
// `\`*\`` represents a field named `*`, not any field.
82+
//
83+
// A special `Field` contains the default indexing settings for all fields.
84+
// This field's resource name is:
85+
// `projects/{project_id}/databases/{database_id}/collectionGroups/__default__/fields/*`
86+
// Indexes defined on this `Field` will be applied to all fields which do not
87+
// have their own `Field` index configuration.
88+
string name = 1;
89+
90+
// The index configuration for this field. If unset, field indexing will
91+
// revert to the configuration defined by the `ancestor_field`. To
92+
// explicitly remove all indexes for this field, specify an index config
93+
// with an empty list of indexes.
94+
IndexConfig index_config = 2;
95+
}

0 commit comments

Comments
 (0)