google-cloud-firestore 1.4.0 → 2.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/AUTHENTICATION.md +1 -1
- data/CHANGELOG.md +47 -0
- data/TROUBLESHOOTING.md +2 -8
- data/lib/google-cloud-firestore.rb +14 -21
- data/lib/google/cloud/firestore.rb +12 -23
- data/lib/google/cloud/firestore/client.rb +12 -14
- data/lib/google/cloud/firestore/collection_reference.rb +1 -0
- data/lib/google/cloud/firestore/collection_reference_list.rb +137 -0
- data/lib/google/cloud/firestore/convert.rb +39 -39
- data/lib/google/cloud/firestore/credentials.rb +2 -2
- data/lib/google/cloud/firestore/document_reference.rb +8 -8
- data/lib/google/cloud/firestore/document_reference/list.rb +2 -2
- data/lib/google/cloud/firestore/document_snapshot.rb +4 -4
- data/lib/google/cloud/firestore/query.rb +4 -4
- data/lib/google/cloud/firestore/service.rb +71 -106
- data/lib/google/cloud/firestore/transaction.rb +2 -2
- data/lib/google/cloud/firestore/version.rb +1 -1
- data/lib/google/cloud/firestore/watch/listener.rb +9 -9
- data/lib/google/cloud/firestore/watch/order.rb +1 -1
- metadata +11 -109
- data/lib/google/cloud/firestore/admin.rb +0 -144
- data/lib/google/cloud/firestore/admin/v1.rb +0 -151
- data/lib/google/cloud/firestore/admin/v1/credentials.rb +0 -44
- data/lib/google/cloud/firestore/admin/v1/doc/google/firestore/admin/v1/field.rb +0 -86
- data/lib/google/cloud/firestore/admin/v1/doc/google/firestore/admin/v1/firestore_admin.rb +0 -161
- data/lib/google/cloud/firestore/admin/v1/doc/google/firestore/admin/v1/index.rb +0 -142
- data/lib/google/cloud/firestore/admin/v1/doc/google/longrunning/operations.rb +0 -51
- data/lib/google/cloud/firestore/admin/v1/doc/google/protobuf/any.rb +0 -131
- data/lib/google/cloud/firestore/admin/v1/doc/google/protobuf/empty.rb +0 -29
- data/lib/google/cloud/firestore/admin/v1/doc/google/protobuf/field_mask.rb +0 -222
- data/lib/google/cloud/firestore/admin/v1/doc/google/rpc/status.rb +0 -39
- data/lib/google/cloud/firestore/admin/v1/firestore_admin_client.rb +0 -764
- data/lib/google/cloud/firestore/admin/v1/firestore_admin_client_config.json +0 -72
- data/lib/google/cloud/firestore/v1.rb +0 -152
- data/lib/google/cloud/firestore/v1/credentials.rb +0 -42
- data/lib/google/cloud/firestore/v1/doc/google/firestore/v1/common.rb +0 -64
- data/lib/google/cloud/firestore/v1/doc/google/firestore/v1/document.rb +0 -136
- data/lib/google/cloud/firestore/v1/doc/google/firestore/v1/firestore.rb +0 -566
- data/lib/google/cloud/firestore/v1/doc/google/firestore/v1/query.rb +0 -227
- data/lib/google/cloud/firestore/v1/doc/google/firestore/v1/write.rb +0 -241
- data/lib/google/cloud/firestore/v1/doc/google/protobuf/any.rb +0 -131
- data/lib/google/cloud/firestore/v1/doc/google/protobuf/empty.rb +0 -29
- data/lib/google/cloud/firestore/v1/doc/google/protobuf/timestamp.rb +0 -113
- data/lib/google/cloud/firestore/v1/doc/google/protobuf/wrappers.rb +0 -26
- data/lib/google/cloud/firestore/v1/doc/google/rpc/status.rb +0 -39
- data/lib/google/cloud/firestore/v1/firestore_client.rb +0 -1073
- data/lib/google/cloud/firestore/v1/firestore_client_config.json +0 -101
- data/lib/google/cloud/firestore/v1beta1.rb +0 -160
- data/lib/google/cloud/firestore/v1beta1/credentials.rb +0 -42
- data/lib/google/cloud/firestore/v1beta1/doc/google/firestore/v1beta1/common.rb +0 -64
- data/lib/google/cloud/firestore/v1beta1/doc/google/firestore/v1beta1/document.rb +0 -136
- data/lib/google/cloud/firestore/v1beta1/doc/google/firestore/v1beta1/firestore.rb +0 -564
- data/lib/google/cloud/firestore/v1beta1/doc/google/firestore/v1beta1/query.rb +0 -227
- data/lib/google/cloud/firestore/v1beta1/doc/google/firestore/v1beta1/write.rb +0 -237
- data/lib/google/cloud/firestore/v1beta1/doc/google/protobuf/any.rb +0 -131
- data/lib/google/cloud/firestore/v1beta1/doc/google/protobuf/empty.rb +0 -29
- data/lib/google/cloud/firestore/v1beta1/doc/google/protobuf/timestamp.rb +0 -113
- data/lib/google/cloud/firestore/v1beta1/doc/google/protobuf/wrappers.rb +0 -26
- data/lib/google/cloud/firestore/v1beta1/doc/google/rpc/status.rb +0 -39
- data/lib/google/cloud/firestore/v1beta1/firestore_client.rb +0 -1081
- data/lib/google/cloud/firestore/v1beta1/firestore_client_config.json +0 -100
- data/lib/google/firestore/admin/v1/field_pb.rb +0 -32
- data/lib/google/firestore/admin/v1/firestore_admin_pb.rb +0 -84
- data/lib/google/firestore/admin/v1/firestore_admin_services_pb.rb +0 -94
- data/lib/google/firestore/admin/v1/index_pb.rb +0 -58
- data/lib/google/firestore/admin/v1/location_pb.rb +0 -22
- data/lib/google/firestore/admin/v1/operation_pb.rb +0 -90
- data/lib/google/firestore/v1/common_pb.rb +0 -45
- data/lib/google/firestore/v1/document_pb.rb +0 -50
- data/lib/google/firestore/v1/firestore_pb.rb +0 -222
- data/lib/google/firestore/v1/firestore_services_pb.rb +0 -80
- data/lib/google/firestore/v1/query_pb.rb +0 -107
- data/lib/google/firestore/v1/write_pb.rb +0 -80
- data/lib/google/firestore/v1beta1/common_pb.rb +0 -45
- data/lib/google/firestore/v1beta1/document_pb.rb +0 -50
- data/lib/google/firestore/v1beta1/firestore_pb.rb +0 -222
- data/lib/google/firestore/v1beta1/firestore_services_pb.rb +0 -89
- data/lib/google/firestore/v1beta1/query_pb.rb +0 -107
- data/lib/google/firestore/v1beta1/write_pb.rb +0 -79
@@ -1,44 +0,0 @@
|
|
1
|
-
# Copyright 2020 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
|
-
# https://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
|
-
require "googleauth"
|
17
|
-
|
18
|
-
module Google
|
19
|
-
module Cloud
|
20
|
-
module Firestore
|
21
|
-
module Admin
|
22
|
-
module V1
|
23
|
-
class Credentials < Google::Auth::Credentials
|
24
|
-
SCOPE = [
|
25
|
-
"https://www.googleapis.com/auth/cloud-platform",
|
26
|
-
"https://www.googleapis.com/auth/datastore"
|
27
|
-
].freeze
|
28
|
-
PATH_ENV_VARS = %w(FIRESTORE_ADMIN_CREDENTIALS
|
29
|
-
FIRESTORE_ADMIN_KEYFILE
|
30
|
-
GOOGLE_CLOUD_CREDENTIALS
|
31
|
-
GOOGLE_CLOUD_KEYFILE
|
32
|
-
GCLOUD_KEYFILE)
|
33
|
-
JSON_ENV_VARS = %w(FIRESTORE_ADMIN_CREDENTIALS_JSON
|
34
|
-
FIRESTORE_ADMIN_KEYFILE_JSON
|
35
|
-
GOOGLE_CLOUD_CREDENTIALS_JSON
|
36
|
-
GOOGLE_CLOUD_KEYFILE_JSON
|
37
|
-
GCLOUD_KEYFILE_JSON)
|
38
|
-
DEFAULT_PATHS = ["~/.config/gcloud/application_default_credentials.json"]
|
39
|
-
end
|
40
|
-
end
|
41
|
-
end
|
42
|
-
end
|
43
|
-
end
|
44
|
-
end
|
@@ -1,86 +0,0 @@
|
|
1
|
-
# Copyright 2020 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
|
-
# https://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
|
-
module Google
|
17
|
-
module Firestore
|
18
|
-
module Admin
|
19
|
-
module V1
|
20
|
-
# Represents a single field in the database.
|
21
|
-
#
|
22
|
-
# Fields are grouped by their "Collection Group", which represent all
|
23
|
-
# collections in the database with the same id.
|
24
|
-
# @!attribute [rw] name
|
25
|
-
# @return [String]
|
26
|
-
# A field name of the form
|
27
|
-
# `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}/fields/{field_path}`
|
28
|
-
#
|
29
|
-
# A field path may be a simple field name, e.g. `address` or a path to fields
|
30
|
-
# within map_value , e.g. `address.city`,
|
31
|
-
# or a special field path. The only valid special field is `*`, which
|
32
|
-
# represents any field.
|
33
|
-
#
|
34
|
-
# Field paths may be quoted using ` (backtick). The only character that needs
|
35
|
-
# to be escaped within a quoted field path is the backtick character itself,
|
36
|
-
# escaped using a backslash. Special characters in field paths that
|
37
|
-
# must be quoted include: `*`, `.`,
|
38
|
-
# ``` (backtick), `[`, `]`, as well as any ascii symbolic characters.
|
39
|
-
#
|
40
|
-
# Examples:
|
41
|
-
# (Note: Comments here are written in markdown syntax, so there is an
|
42
|
-
# additional layer of backticks to represent a code block)
|
43
|
-
# `\`address.city\`` represents a field named `address.city`, not the map key
|
44
|
-
# `city` in the field `address`.
|
45
|
-
# `\`*\`` represents a field named `*`, not any field.
|
46
|
-
#
|
47
|
-
# A special `Field` contains the default indexing settings for all fields.
|
48
|
-
# This field's resource name is:
|
49
|
-
# `projects/{project_id}/databases/{database_id}/collectionGroups/__default__/fields/*`
|
50
|
-
# Indexes defined on this `Field` will be applied to all fields which do not
|
51
|
-
# have their own `Field` index configuration.
|
52
|
-
# @!attribute [rw] index_config
|
53
|
-
# @return [Google::Firestore::Admin::V1::Field::IndexConfig]
|
54
|
-
# The index configuration for this field. If unset, field indexing will
|
55
|
-
# revert to the configuration defined by the `ancestor_field`. To
|
56
|
-
# explicitly remove all indexes for this field, specify an index config
|
57
|
-
# with an empty list of indexes.
|
58
|
-
class Field
|
59
|
-
# The index configuration for this field.
|
60
|
-
# @!attribute [rw] indexes
|
61
|
-
# @return [Array<Google::Firestore::Admin::V1::Index>]
|
62
|
-
# The indexes supported for this field.
|
63
|
-
# @!attribute [rw] uses_ancestor_config
|
64
|
-
# @return [true, false]
|
65
|
-
# Output only. When true, the `Field`'s index configuration is set from the
|
66
|
-
# configuration specified by the `ancestor_field`.
|
67
|
-
# When false, the `Field`'s index configuration is defined explicitly.
|
68
|
-
# @!attribute [rw] ancestor_field
|
69
|
-
# @return [String]
|
70
|
-
# Output only. Specifies the resource name of the `Field` from which this field's
|
71
|
-
# index configuration is set (when `uses_ancestor_config` is true),
|
72
|
-
# or from which it *would* be set if this field had no index configuration
|
73
|
-
# (when `uses_ancestor_config` is false).
|
74
|
-
# @!attribute [rw] reverting
|
75
|
-
# @return [true, false]
|
76
|
-
# Output only
|
77
|
-
# When true, the `Field`'s index configuration is in the process of being
|
78
|
-
# reverted. Once complete, the index config will transition to the same
|
79
|
-
# state as the field specified by `ancestor_field`, at which point
|
80
|
-
# `uses_ancestor_config` will be `true` and `reverting` will be `false`.
|
81
|
-
class IndexConfig; end
|
82
|
-
end
|
83
|
-
end
|
84
|
-
end
|
85
|
-
end
|
86
|
-
end
|
@@ -1,161 +0,0 @@
|
|
1
|
-
# Copyright 2020 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
|
-
# https://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
|
-
module Google
|
17
|
-
module Firestore
|
18
|
-
module Admin
|
19
|
-
module V1
|
20
|
-
# The request for {Google::Firestore::Admin::V1::FirestoreAdmin::CreateIndex FirestoreAdmin::CreateIndex}.
|
21
|
-
# @!attribute [rw] parent
|
22
|
-
# @return [String]
|
23
|
-
# Required. A parent name of the form
|
24
|
-
# `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}`
|
25
|
-
# @!attribute [rw] index
|
26
|
-
# @return [Google::Firestore::Admin::V1::Index]
|
27
|
-
# Required. The composite index to create.
|
28
|
-
class CreateIndexRequest; end
|
29
|
-
|
30
|
-
# The request for {Google::Firestore::Admin::V1::FirestoreAdmin::ListIndexes FirestoreAdmin::ListIndexes}.
|
31
|
-
# @!attribute [rw] parent
|
32
|
-
# @return [String]
|
33
|
-
# Required. A parent name of the form
|
34
|
-
# `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}`
|
35
|
-
# @!attribute [rw] filter
|
36
|
-
# @return [String]
|
37
|
-
# The filter to apply to list results.
|
38
|
-
# @!attribute [rw] page_size
|
39
|
-
# @return [Integer]
|
40
|
-
# The number of results to return.
|
41
|
-
# @!attribute [rw] page_token
|
42
|
-
# @return [String]
|
43
|
-
# A page token, returned from a previous call to
|
44
|
-
# {Google::Firestore::Admin::V1::FirestoreAdmin::ListIndexes FirestoreAdmin::ListIndexes}, that may be used to get the next
|
45
|
-
# page of results.
|
46
|
-
class ListIndexesRequest; end
|
47
|
-
|
48
|
-
# The response for {Google::Firestore::Admin::V1::FirestoreAdmin::ListIndexes FirestoreAdmin::ListIndexes}.
|
49
|
-
# @!attribute [rw] indexes
|
50
|
-
# @return [Array<Google::Firestore::Admin::V1::Index>]
|
51
|
-
# The requested indexes.
|
52
|
-
# @!attribute [rw] next_page_token
|
53
|
-
# @return [String]
|
54
|
-
# A page token that may be used to request another page of results. If blank,
|
55
|
-
# this is the last page.
|
56
|
-
class ListIndexesResponse; end
|
57
|
-
|
58
|
-
# The request for {Google::Firestore::Admin::V1::FirestoreAdmin::GetIndex FirestoreAdmin::GetIndex}.
|
59
|
-
# @!attribute [rw] name
|
60
|
-
# @return [String]
|
61
|
-
# Required. A name of the form
|
62
|
-
# `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}/indexes/{index_id}`
|
63
|
-
class GetIndexRequest; end
|
64
|
-
|
65
|
-
# The request for {Google::Firestore::Admin::V1::FirestoreAdmin::DeleteIndex FirestoreAdmin::DeleteIndex}.
|
66
|
-
# @!attribute [rw] name
|
67
|
-
# @return [String]
|
68
|
-
# Required. A name of the form
|
69
|
-
# `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}/indexes/{index_id}`
|
70
|
-
class DeleteIndexRequest; end
|
71
|
-
|
72
|
-
# The request for {Google::Firestore::Admin::V1::FirestoreAdmin::UpdateField FirestoreAdmin::UpdateField}.
|
73
|
-
# @!attribute [rw] field
|
74
|
-
# @return [Google::Firestore::Admin::V1::Field]
|
75
|
-
# Required. The field to be updated.
|
76
|
-
# @!attribute [rw] update_mask
|
77
|
-
# @return [Google::Protobuf::FieldMask]
|
78
|
-
# A mask, relative to the field. If specified, only configuration specified
|
79
|
-
# by this field_mask will be updated in the field.
|
80
|
-
class UpdateFieldRequest; end
|
81
|
-
|
82
|
-
# The request for {Google::Firestore::Admin::V1::FirestoreAdmin::GetField FirestoreAdmin::GetField}.
|
83
|
-
# @!attribute [rw] name
|
84
|
-
# @return [String]
|
85
|
-
# Required. A name of the form
|
86
|
-
# `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}/fields/{field_id}`
|
87
|
-
class GetFieldRequest; end
|
88
|
-
|
89
|
-
# The request for {Google::Firestore::Admin::V1::FirestoreAdmin::ListFields FirestoreAdmin::ListFields}.
|
90
|
-
# @!attribute [rw] parent
|
91
|
-
# @return [String]
|
92
|
-
# Required. A parent name of the form
|
93
|
-
# `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}`
|
94
|
-
# @!attribute [rw] filter
|
95
|
-
# @return [String]
|
96
|
-
# The filter to apply to list results. Currently,
|
97
|
-
# {Google::Firestore::Admin::V1::FirestoreAdmin::ListFields FirestoreAdmin::ListFields} only supports listing fields
|
98
|
-
# that have been explicitly overridden. To issue this query, call
|
99
|
-
# {Google::Firestore::Admin::V1::FirestoreAdmin::ListFields FirestoreAdmin::ListFields} with the filter set to
|
100
|
-
# `indexConfig.usesAncestorConfig:false`.
|
101
|
-
# @!attribute [rw] page_size
|
102
|
-
# @return [Integer]
|
103
|
-
# The number of results to return.
|
104
|
-
# @!attribute [rw] page_token
|
105
|
-
# @return [String]
|
106
|
-
# A page token, returned from a previous call to
|
107
|
-
# {Google::Firestore::Admin::V1::FirestoreAdmin::ListFields FirestoreAdmin::ListFields}, that may be used to get the next
|
108
|
-
# page of results.
|
109
|
-
class ListFieldsRequest; end
|
110
|
-
|
111
|
-
# The response for {Google::Firestore::Admin::V1::FirestoreAdmin::ListFields FirestoreAdmin::ListFields}.
|
112
|
-
# @!attribute [rw] fields
|
113
|
-
# @return [Array<Google::Firestore::Admin::V1::Field>]
|
114
|
-
# The requested fields.
|
115
|
-
# @!attribute [rw] next_page_token
|
116
|
-
# @return [String]
|
117
|
-
# A page token that may be used to request another page of results. If blank,
|
118
|
-
# this is the last page.
|
119
|
-
class ListFieldsResponse; end
|
120
|
-
|
121
|
-
# The request for {Google::Firestore::Admin::V1::FirestoreAdmin::ExportDocuments FirestoreAdmin::ExportDocuments}.
|
122
|
-
# @!attribute [rw] name
|
123
|
-
# @return [String]
|
124
|
-
# Required. Database to export. Should be of the form:
|
125
|
-
# `projects/{project_id}/databases/{database_id}`.
|
126
|
-
# @!attribute [rw] collection_ids
|
127
|
-
# @return [Array<String>]
|
128
|
-
# Which collection ids to export. Unspecified means all collections.
|
129
|
-
# @!attribute [rw] output_uri_prefix
|
130
|
-
# @return [String]
|
131
|
-
# The output URI. Currently only supports Google Cloud Storage URIs of the
|
132
|
-
# form: `gs://BUCKET_NAME[/NAMESPACE_PATH]`, where `BUCKET_NAME` is the name
|
133
|
-
# of the Google Cloud Storage bucket and `NAMESPACE_PATH` is an optional
|
134
|
-
# Google Cloud Storage namespace path. When
|
135
|
-
# choosing a name, be sure to consider Google Cloud Storage naming
|
136
|
-
# guidelines: https://cloud.google.com/storage/docs/naming.
|
137
|
-
# If the URI is a bucket (without a namespace path), a prefix will be
|
138
|
-
# generated based on the start time.
|
139
|
-
class ExportDocumentsRequest; end
|
140
|
-
|
141
|
-
# The request for {Google::Firestore::Admin::V1::FirestoreAdmin::ImportDocuments FirestoreAdmin::ImportDocuments}.
|
142
|
-
# @!attribute [rw] name
|
143
|
-
# @return [String]
|
144
|
-
# Required. Database to import into. Should be of the form:
|
145
|
-
# `projects/{project_id}/databases/{database_id}`.
|
146
|
-
# @!attribute [rw] collection_ids
|
147
|
-
# @return [Array<String>]
|
148
|
-
# Which collection ids to import. Unspecified means all collections included
|
149
|
-
# in the import.
|
150
|
-
# @!attribute [rw] input_uri_prefix
|
151
|
-
# @return [String]
|
152
|
-
# Location of the exported files.
|
153
|
-
# This must match the output_uri_prefix of an ExportDocumentsResponse from
|
154
|
-
# an export that has completed successfully.
|
155
|
-
# See:
|
156
|
-
# {Google::Firestore::Admin::V1::ExportDocumentsResponse#output_uri_prefix}.
|
157
|
-
class ImportDocumentsRequest; end
|
158
|
-
end
|
159
|
-
end
|
160
|
-
end
|
161
|
-
end
|
@@ -1,142 +0,0 @@
|
|
1
|
-
# Copyright 2020 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
|
-
# https://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
|
-
module Google
|
17
|
-
module Firestore
|
18
|
-
module Admin
|
19
|
-
module V1
|
20
|
-
# Cloud Firestore indexes enable simple and complex queries against
|
21
|
-
# documents in a database.
|
22
|
-
# @!attribute [rw] name
|
23
|
-
# @return [String]
|
24
|
-
# Output only. A server defined name for this index.
|
25
|
-
# The form of this name for composite indexes will be:
|
26
|
-
# `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}/indexes/{composite_index_id}`
|
27
|
-
# For single field indexes, this field will be empty.
|
28
|
-
# @!attribute [rw] query_scope
|
29
|
-
# @return [Google::Firestore::Admin::V1::Index::QueryScope]
|
30
|
-
# Indexes with a collection query scope specified allow queries
|
31
|
-
# against a collection that is the child of a specific document, specified at
|
32
|
-
# query time, and that has the same collection id.
|
33
|
-
#
|
34
|
-
# Indexes with a collection group query scope specified allow queries against
|
35
|
-
# all collections descended from a specific document, specified at query
|
36
|
-
# time, and that have the same collection id as this index.
|
37
|
-
# @!attribute [rw] fields
|
38
|
-
# @return [Array<Google::Firestore::Admin::V1::Index::IndexField>]
|
39
|
-
# The fields supported by this index.
|
40
|
-
#
|
41
|
-
# For composite indexes, this is always 2 or more fields.
|
42
|
-
# The last field entry is always for the field path `__name__`. If, on
|
43
|
-
# creation, `__name__` was not specified as the last field, it will be added
|
44
|
-
# automatically with the same direction as that of the last field defined. If
|
45
|
-
# the final field in a composite index is not directional, the `__name__`
|
46
|
-
# will be ordered ASCENDING (unless explicitly specified).
|
47
|
-
#
|
48
|
-
# For single field indexes, this will always be exactly one entry with a
|
49
|
-
# field path equal to the field path of the associated field.
|
50
|
-
# @!attribute [rw] state
|
51
|
-
# @return [Google::Firestore::Admin::V1::Index::State]
|
52
|
-
# Output only. The serving state of the index.
|
53
|
-
class Index
|
54
|
-
# A field in an index.
|
55
|
-
# The field_path describes which field is indexed, the value_mode describes
|
56
|
-
# how the field value is indexed.
|
57
|
-
# @!attribute [rw] field_path
|
58
|
-
# @return [String]
|
59
|
-
# Can be __name__.
|
60
|
-
# For single field indexes, this must match the name of the field or may
|
61
|
-
# be omitted.
|
62
|
-
# @!attribute [rw] order
|
63
|
-
# @return [Google::Firestore::Admin::V1::Index::IndexField::Order]
|
64
|
-
# Indicates that this field supports ordering by the specified order or
|
65
|
-
# comparing using =, <, <=, >, >=.
|
66
|
-
# @!attribute [rw] array_config
|
67
|
-
# @return [Google::Firestore::Admin::V1::Index::IndexField::ArrayConfig]
|
68
|
-
# Indicates that this field supports operations on `array_value`s.
|
69
|
-
class IndexField
|
70
|
-
# The supported array value configurations.
|
71
|
-
module ArrayConfig
|
72
|
-
# The index does not support additional array queries.
|
73
|
-
ARRAY_CONFIG_UNSPECIFIED = 0
|
74
|
-
|
75
|
-
# The index supports array containment queries.
|
76
|
-
CONTAINS = 1
|
77
|
-
end
|
78
|
-
|
79
|
-
# The supported orderings.
|
80
|
-
module Order
|
81
|
-
# The ordering is unspecified. Not a valid option.
|
82
|
-
ORDER_UNSPECIFIED = 0
|
83
|
-
|
84
|
-
# The field is ordered by ascending field value.
|
85
|
-
ASCENDING = 1
|
86
|
-
|
87
|
-
# The field is ordered by descending field value.
|
88
|
-
DESCENDING = 2
|
89
|
-
end
|
90
|
-
end
|
91
|
-
|
92
|
-
# Query Scope defines the scope at which a query is run. This is specified on
|
93
|
-
# a StructuredQuery's `from` field.
|
94
|
-
module QueryScope
|
95
|
-
# The query scope is unspecified. Not a valid option.
|
96
|
-
QUERY_SCOPE_UNSPECIFIED = 0
|
97
|
-
|
98
|
-
# Indexes with a collection query scope specified allow queries
|
99
|
-
# against a collection that is the child of a specific document, specified
|
100
|
-
# at query time, and that has the collection id specified by the index.
|
101
|
-
COLLECTION = 1
|
102
|
-
|
103
|
-
# Indexes with a collection group query scope specified allow queries
|
104
|
-
# against all collections that has the collection id specified by the
|
105
|
-
# index.
|
106
|
-
COLLECTION_GROUP = 2
|
107
|
-
end
|
108
|
-
|
109
|
-
# The state of an index. During index creation, an index will be in the
|
110
|
-
# `CREATING` state. If the index is created successfully, it will transition
|
111
|
-
# to the `READY` state. If the index creation encounters a problem, the index
|
112
|
-
# will transition to the `NEEDS_REPAIR` state.
|
113
|
-
module State
|
114
|
-
# The state is unspecified.
|
115
|
-
STATE_UNSPECIFIED = 0
|
116
|
-
|
117
|
-
# The index is being created.
|
118
|
-
# There is an active long-running operation for the index.
|
119
|
-
# The index is updated when writing a document.
|
120
|
-
# Some index data may exist.
|
121
|
-
CREATING = 1
|
122
|
-
|
123
|
-
# The index is ready to be used.
|
124
|
-
# The index is updated when writing a document.
|
125
|
-
# The index is fully populated from all stored documents it applies to.
|
126
|
-
READY = 2
|
127
|
-
|
128
|
-
# The index was being created, but something went wrong.
|
129
|
-
# There is no active long-running operation for the index,
|
130
|
-
# and the most recently finished long-running operation failed.
|
131
|
-
# The index is not updated when writing a document.
|
132
|
-
# Some index data may exist.
|
133
|
-
# Use the google.longrunning.Operations API to determine why the operation
|
134
|
-
# that last attempted to create this index failed, then re-create the
|
135
|
-
# index.
|
136
|
-
NEEDS_REPAIR = 3
|
137
|
-
end
|
138
|
-
end
|
139
|
-
end
|
140
|
-
end
|
141
|
-
end
|
142
|
-
end
|
@@ -1,51 +0,0 @@
|
|
1
|
-
# Copyright 2020 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
|
-
# https://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
|
-
module Google
|
17
|
-
module Longrunning
|
18
|
-
# This resource represents a long-running operation that is the result of a
|
19
|
-
# network API call.
|
20
|
-
# @!attribute [rw] name
|
21
|
-
# @return [String]
|
22
|
-
# The server-assigned name, which is only unique within the same service that
|
23
|
-
# originally returns it. If you use the default HTTP mapping, the
|
24
|
-
# `name` should be a resource name ending with `operations/{unique_id}`.
|
25
|
-
# @!attribute [rw] metadata
|
26
|
-
# @return [Google::Protobuf::Any]
|
27
|
-
# Service-specific metadata associated with the operation. It typically
|
28
|
-
# contains progress information and common metadata such as create time.
|
29
|
-
# Some services might not provide such metadata. Any method that returns a
|
30
|
-
# long-running operation should document the metadata type, if any.
|
31
|
-
# @!attribute [rw] done
|
32
|
-
# @return [true, false]
|
33
|
-
# If the value is `false`, it means the operation is still in progress.
|
34
|
-
# If `true`, the operation is completed, and either `error` or `response` is
|
35
|
-
# available.
|
36
|
-
# @!attribute [rw] error
|
37
|
-
# @return [Google::Rpc::Status]
|
38
|
-
# The error result of the operation in case of failure or cancellation.
|
39
|
-
# @!attribute [rw] response
|
40
|
-
# @return [Google::Protobuf::Any]
|
41
|
-
# The normal response of the operation in case of success. If the original
|
42
|
-
# method returns no data on success, such as `Delete`, the response is
|
43
|
-
# `google.protobuf.Empty`. If the original method is standard
|
44
|
-
# `Get`/`Create`/`Update`, the response should be the resource. For other
|
45
|
-
# methods, the response should have the type `XxxResponse`, where `Xxx`
|
46
|
-
# is the original method name. For example, if the original method name
|
47
|
-
# is `TakeSnapshot()`, the inferred response type is
|
48
|
-
# `TakeSnapshotResponse`.
|
49
|
-
class Operation; end
|
50
|
-
end
|
51
|
-
end
|