google-apis-firestore_v1beta2 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,28 @@
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
+ # 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
+ module Google
16
+ module Apis
17
+ module FirestoreV1beta2
18
+ # Version of the google-apis-firestore_v1beta2 gem
19
+ GEM_VERSION = "0.1.0"
20
+
21
+ # Version of the code generator used to generate this client
22
+ GENERATOR_VERSION = "0.1.1"
23
+
24
+ # Revision of the discovery document this client was generated from
25
+ REVISION = "20200801"
26
+ end
27
+ end
28
+ end
@@ -0,0 +1,319 @@
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
+ # 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
+ require 'date'
16
+ require 'google/apis/core/base_service'
17
+ require 'google/apis/core/json_representation'
18
+ require 'google/apis/core/hashable'
19
+ require 'google/apis/errors'
20
+
21
+ module Google
22
+ module Apis
23
+ module FirestoreV1beta2
24
+
25
+ class Empty
26
+ class Representation < Google::Apis::Core::JsonRepresentation; end
27
+
28
+ include Google::Apis::Core::JsonObjectSupport
29
+ end
30
+
31
+ class GoogleFirestoreAdminV1beta2ExportDocumentsMetadata
32
+ class Representation < Google::Apis::Core::JsonRepresentation; end
33
+
34
+ include Google::Apis::Core::JsonObjectSupport
35
+ end
36
+
37
+ class GoogleFirestoreAdminV1beta2ExportDocumentsRequest
38
+ class Representation < Google::Apis::Core::JsonRepresentation; end
39
+
40
+ include Google::Apis::Core::JsonObjectSupport
41
+ end
42
+
43
+ class GoogleFirestoreAdminV1beta2ExportDocumentsResponse
44
+ class Representation < Google::Apis::Core::JsonRepresentation; end
45
+
46
+ include Google::Apis::Core::JsonObjectSupport
47
+ end
48
+
49
+ class GoogleFirestoreAdminV1beta2Field
50
+ class Representation < Google::Apis::Core::JsonRepresentation; end
51
+
52
+ include Google::Apis::Core::JsonObjectSupport
53
+ end
54
+
55
+ class GoogleFirestoreAdminV1beta2FieldOperationMetadata
56
+ class Representation < Google::Apis::Core::JsonRepresentation; end
57
+
58
+ include Google::Apis::Core::JsonObjectSupport
59
+ end
60
+
61
+ class GoogleFirestoreAdminV1beta2ImportDocumentsMetadata
62
+ class Representation < Google::Apis::Core::JsonRepresentation; end
63
+
64
+ include Google::Apis::Core::JsonObjectSupport
65
+ end
66
+
67
+ class GoogleFirestoreAdminV1beta2ImportDocumentsRequest
68
+ class Representation < Google::Apis::Core::JsonRepresentation; end
69
+
70
+ include Google::Apis::Core::JsonObjectSupport
71
+ end
72
+
73
+ class GoogleFirestoreAdminV1beta2Index
74
+ class Representation < Google::Apis::Core::JsonRepresentation; end
75
+
76
+ include Google::Apis::Core::JsonObjectSupport
77
+ end
78
+
79
+ class GoogleFirestoreAdminV1beta2IndexConfig
80
+ class Representation < Google::Apis::Core::JsonRepresentation; end
81
+
82
+ include Google::Apis::Core::JsonObjectSupport
83
+ end
84
+
85
+ class GoogleFirestoreAdminV1beta2IndexConfigDelta
86
+ class Representation < Google::Apis::Core::JsonRepresentation; end
87
+
88
+ include Google::Apis::Core::JsonObjectSupport
89
+ end
90
+
91
+ class GoogleFirestoreAdminV1beta2IndexField
92
+ class Representation < Google::Apis::Core::JsonRepresentation; end
93
+
94
+ include Google::Apis::Core::JsonObjectSupport
95
+ end
96
+
97
+ class GoogleFirestoreAdminV1beta2IndexOperationMetadata
98
+ class Representation < Google::Apis::Core::JsonRepresentation; end
99
+
100
+ include Google::Apis::Core::JsonObjectSupport
101
+ end
102
+
103
+ class GoogleFirestoreAdminV1beta2ListFieldsResponse
104
+ class Representation < Google::Apis::Core::JsonRepresentation; end
105
+
106
+ include Google::Apis::Core::JsonObjectSupport
107
+ end
108
+
109
+ class GoogleFirestoreAdminV1beta2ListIndexesResponse
110
+ class Representation < Google::Apis::Core::JsonRepresentation; end
111
+
112
+ include Google::Apis::Core::JsonObjectSupport
113
+ end
114
+
115
+ class GoogleFirestoreAdminV1beta2Progress
116
+ class Representation < Google::Apis::Core::JsonRepresentation; end
117
+
118
+ include Google::Apis::Core::JsonObjectSupport
119
+ end
120
+
121
+ class GoogleLongrunningOperation
122
+ class Representation < Google::Apis::Core::JsonRepresentation; end
123
+
124
+ include Google::Apis::Core::JsonObjectSupport
125
+ end
126
+
127
+ class Status
128
+ class Representation < Google::Apis::Core::JsonRepresentation; end
129
+
130
+ include Google::Apis::Core::JsonObjectSupport
131
+ end
132
+
133
+ class Empty
134
+ # @private
135
+ class Representation < Google::Apis::Core::JsonRepresentation
136
+ end
137
+ end
138
+
139
+ class GoogleFirestoreAdminV1beta2ExportDocumentsMetadata
140
+ # @private
141
+ class Representation < Google::Apis::Core::JsonRepresentation
142
+ collection :collection_ids, as: 'collectionIds'
143
+ property :end_time, as: 'endTime'
144
+ property :operation_state, as: 'operationState'
145
+ property :output_uri_prefix, as: 'outputUriPrefix'
146
+ property :progress_bytes, as: 'progressBytes', class: Google::Apis::FirestoreV1beta2::GoogleFirestoreAdminV1beta2Progress, decorator: Google::Apis::FirestoreV1beta2::GoogleFirestoreAdminV1beta2Progress::Representation
147
+
148
+ property :progress_documents, as: 'progressDocuments', class: Google::Apis::FirestoreV1beta2::GoogleFirestoreAdminV1beta2Progress, decorator: Google::Apis::FirestoreV1beta2::GoogleFirestoreAdminV1beta2Progress::Representation
149
+
150
+ property :start_time, as: 'startTime'
151
+ end
152
+ end
153
+
154
+ class GoogleFirestoreAdminV1beta2ExportDocumentsRequest
155
+ # @private
156
+ class Representation < Google::Apis::Core::JsonRepresentation
157
+ collection :collection_ids, as: 'collectionIds'
158
+ property :output_uri_prefix, as: 'outputUriPrefix'
159
+ end
160
+ end
161
+
162
+ class GoogleFirestoreAdminV1beta2ExportDocumentsResponse
163
+ # @private
164
+ class Representation < Google::Apis::Core::JsonRepresentation
165
+ property :output_uri_prefix, as: 'outputUriPrefix'
166
+ end
167
+ end
168
+
169
+ class GoogleFirestoreAdminV1beta2Field
170
+ # @private
171
+ class Representation < Google::Apis::Core::JsonRepresentation
172
+ property :index_config, as: 'indexConfig', class: Google::Apis::FirestoreV1beta2::GoogleFirestoreAdminV1beta2IndexConfig, decorator: Google::Apis::FirestoreV1beta2::GoogleFirestoreAdminV1beta2IndexConfig::Representation
173
+
174
+ property :name, as: 'name'
175
+ end
176
+ end
177
+
178
+ class GoogleFirestoreAdminV1beta2FieldOperationMetadata
179
+ # @private
180
+ class Representation < Google::Apis::Core::JsonRepresentation
181
+ property :bytes_progress, as: 'bytesProgress', class: Google::Apis::FirestoreV1beta2::GoogleFirestoreAdminV1beta2Progress, decorator: Google::Apis::FirestoreV1beta2::GoogleFirestoreAdminV1beta2Progress::Representation
182
+
183
+ property :document_progress, as: 'documentProgress', class: Google::Apis::FirestoreV1beta2::GoogleFirestoreAdminV1beta2Progress, decorator: Google::Apis::FirestoreV1beta2::GoogleFirestoreAdminV1beta2Progress::Representation
184
+
185
+ property :end_time, as: 'endTime'
186
+ property :field, as: 'field'
187
+ collection :index_config_deltas, as: 'indexConfigDeltas', class: Google::Apis::FirestoreV1beta2::GoogleFirestoreAdminV1beta2IndexConfigDelta, decorator: Google::Apis::FirestoreV1beta2::GoogleFirestoreAdminV1beta2IndexConfigDelta::Representation
188
+
189
+ property :start_time, as: 'startTime'
190
+ property :state, as: 'state'
191
+ end
192
+ end
193
+
194
+ class GoogleFirestoreAdminV1beta2ImportDocumentsMetadata
195
+ # @private
196
+ class Representation < Google::Apis::Core::JsonRepresentation
197
+ collection :collection_ids, as: 'collectionIds'
198
+ property :end_time, as: 'endTime'
199
+ property :input_uri_prefix, as: 'inputUriPrefix'
200
+ property :operation_state, as: 'operationState'
201
+ property :progress_bytes, as: 'progressBytes', class: Google::Apis::FirestoreV1beta2::GoogleFirestoreAdminV1beta2Progress, decorator: Google::Apis::FirestoreV1beta2::GoogleFirestoreAdminV1beta2Progress::Representation
202
+
203
+ property :progress_documents, as: 'progressDocuments', class: Google::Apis::FirestoreV1beta2::GoogleFirestoreAdminV1beta2Progress, decorator: Google::Apis::FirestoreV1beta2::GoogleFirestoreAdminV1beta2Progress::Representation
204
+
205
+ property :start_time, as: 'startTime'
206
+ end
207
+ end
208
+
209
+ class GoogleFirestoreAdminV1beta2ImportDocumentsRequest
210
+ # @private
211
+ class Representation < Google::Apis::Core::JsonRepresentation
212
+ collection :collection_ids, as: 'collectionIds'
213
+ property :input_uri_prefix, as: 'inputUriPrefix'
214
+ end
215
+ end
216
+
217
+ class GoogleFirestoreAdminV1beta2Index
218
+ # @private
219
+ class Representation < Google::Apis::Core::JsonRepresentation
220
+ collection :fields, as: 'fields', class: Google::Apis::FirestoreV1beta2::GoogleFirestoreAdminV1beta2IndexField, decorator: Google::Apis::FirestoreV1beta2::GoogleFirestoreAdminV1beta2IndexField::Representation
221
+
222
+ property :name, as: 'name'
223
+ property :query_scope, as: 'queryScope'
224
+ property :state, as: 'state'
225
+ end
226
+ end
227
+
228
+ class GoogleFirestoreAdminV1beta2IndexConfig
229
+ # @private
230
+ class Representation < Google::Apis::Core::JsonRepresentation
231
+ property :ancestor_field, as: 'ancestorField'
232
+ collection :indexes, as: 'indexes', class: Google::Apis::FirestoreV1beta2::GoogleFirestoreAdminV1beta2Index, decorator: Google::Apis::FirestoreV1beta2::GoogleFirestoreAdminV1beta2Index::Representation
233
+
234
+ property :reverting, as: 'reverting'
235
+ property :uses_ancestor_config, as: 'usesAncestorConfig'
236
+ end
237
+ end
238
+
239
+ class GoogleFirestoreAdminV1beta2IndexConfigDelta
240
+ # @private
241
+ class Representation < Google::Apis::Core::JsonRepresentation
242
+ property :change_type, as: 'changeType'
243
+ property :index, as: 'index', class: Google::Apis::FirestoreV1beta2::GoogleFirestoreAdminV1beta2Index, decorator: Google::Apis::FirestoreV1beta2::GoogleFirestoreAdminV1beta2Index::Representation
244
+
245
+ end
246
+ end
247
+
248
+ class GoogleFirestoreAdminV1beta2IndexField
249
+ # @private
250
+ class Representation < Google::Apis::Core::JsonRepresentation
251
+ property :array_config, as: 'arrayConfig'
252
+ property :field_path, as: 'fieldPath'
253
+ property :order, as: 'order'
254
+ end
255
+ end
256
+
257
+ class GoogleFirestoreAdminV1beta2IndexOperationMetadata
258
+ # @private
259
+ class Representation < Google::Apis::Core::JsonRepresentation
260
+ property :end_time, as: 'endTime'
261
+ property :index, as: 'index'
262
+ property :progress_bytes, as: 'progressBytes', class: Google::Apis::FirestoreV1beta2::GoogleFirestoreAdminV1beta2Progress, decorator: Google::Apis::FirestoreV1beta2::GoogleFirestoreAdminV1beta2Progress::Representation
263
+
264
+ property :progress_documents, as: 'progressDocuments', class: Google::Apis::FirestoreV1beta2::GoogleFirestoreAdminV1beta2Progress, decorator: Google::Apis::FirestoreV1beta2::GoogleFirestoreAdminV1beta2Progress::Representation
265
+
266
+ property :start_time, as: 'startTime'
267
+ property :state, as: 'state'
268
+ end
269
+ end
270
+
271
+ class GoogleFirestoreAdminV1beta2ListFieldsResponse
272
+ # @private
273
+ class Representation < Google::Apis::Core::JsonRepresentation
274
+ collection :fields, as: 'fields', class: Google::Apis::FirestoreV1beta2::GoogleFirestoreAdminV1beta2Field, decorator: Google::Apis::FirestoreV1beta2::GoogleFirestoreAdminV1beta2Field::Representation
275
+
276
+ property :next_page_token, as: 'nextPageToken'
277
+ end
278
+ end
279
+
280
+ class GoogleFirestoreAdminV1beta2ListIndexesResponse
281
+ # @private
282
+ class Representation < Google::Apis::Core::JsonRepresentation
283
+ collection :indexes, as: 'indexes', class: Google::Apis::FirestoreV1beta2::GoogleFirestoreAdminV1beta2Index, decorator: Google::Apis::FirestoreV1beta2::GoogleFirestoreAdminV1beta2Index::Representation
284
+
285
+ property :next_page_token, as: 'nextPageToken'
286
+ end
287
+ end
288
+
289
+ class GoogleFirestoreAdminV1beta2Progress
290
+ # @private
291
+ class Representation < Google::Apis::Core::JsonRepresentation
292
+ property :completed_work, :numeric_string => true, as: 'completedWork'
293
+ property :estimated_work, :numeric_string => true, as: 'estimatedWork'
294
+ end
295
+ end
296
+
297
+ class GoogleLongrunningOperation
298
+ # @private
299
+ class Representation < Google::Apis::Core::JsonRepresentation
300
+ property :done, as: 'done'
301
+ property :error, as: 'error', class: Google::Apis::FirestoreV1beta2::Status, decorator: Google::Apis::FirestoreV1beta2::Status::Representation
302
+
303
+ hash :metadata, as: 'metadata'
304
+ property :name, as: 'name'
305
+ hash :response, as: 'response'
306
+ end
307
+ end
308
+
309
+ class Status
310
+ # @private
311
+ class Representation < Google::Apis::Core::JsonRepresentation
312
+ property :code, as: 'code'
313
+ collection :details, as: 'details'
314
+ property :message, as: 'message'
315
+ end
316
+ end
317
+ end
318
+ end
319
+ end
@@ -0,0 +1,418 @@
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
+ # 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
+ require 'google/apis/core/base_service'
16
+ require 'google/apis/core/json_representation'
17
+ require 'google/apis/core/hashable'
18
+ require 'google/apis/errors'
19
+
20
+ module Google
21
+ module Apis
22
+ module FirestoreV1beta2
23
+ # Cloud Firestore API
24
+ #
25
+ # Accesses the NoSQL document database built for automatic scaling, high
26
+ # performance, and ease of application development.
27
+ #
28
+ # @example
29
+ # require 'google/apis/firestore_v1beta2'
30
+ #
31
+ # Firestore = Google::Apis::FirestoreV1beta2 # Alias the module
32
+ # service = Firestore::FirestoreService.new
33
+ #
34
+ # @see https://cloud.google.com/firestore
35
+ class FirestoreService < Google::Apis::Core::BaseService
36
+ # @return [String]
37
+ # API key. Your API key identifies your project and provides you with API access,
38
+ # quota, and reports. Required unless you provide an OAuth 2.0 token.
39
+ attr_accessor :key
40
+
41
+ # @return [String]
42
+ # Available to use for quota purposes for server-side applications. Can be any
43
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
44
+ attr_accessor :quota_user
45
+
46
+ def initialize
47
+ super('https://firestore.googleapis.com/', '',
48
+ client_name: 'google-apis-firestore_v1beta2',
49
+ client_version: Google::Apis::FirestoreV1beta2::GEM_VERSION)
50
+ @batch_path = 'batch'
51
+ end
52
+
53
+ # Exports a copy of all or a subset of documents from Google Cloud Firestore to
54
+ # another storage system, such as Google Cloud Storage. Recent updates to
55
+ # documents may not be reflected in the export. The export occurs in the
56
+ # background and its progress can be monitored and managed via the Operation
57
+ # resource that is created. The output of an export may only be used once the
58
+ # associated operation is done. If an export operation is cancelled before
59
+ # completion it may leave partial data behind in Google Cloud Storage.
60
+ # @param [String] name
61
+ # Database to export. Should be of the form: `projects/`project_id`/databases/`
62
+ # database_id``.
63
+ # @param [Google::Apis::FirestoreV1beta2::GoogleFirestoreAdminV1beta2ExportDocumentsRequest] google_firestore_admin_v1beta2_export_documents_request_object
64
+ # @param [String] fields
65
+ # Selector specifying which fields to include in a partial response.
66
+ # @param [String] quota_user
67
+ # Available to use for quota purposes for server-side applications. Can be any
68
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
69
+ # @param [Google::Apis::RequestOptions] options
70
+ # Request-specific options
71
+ #
72
+ # @yield [result, err] Result & error if block supplied
73
+ # @yieldparam result [Google::Apis::FirestoreV1beta2::GoogleLongrunningOperation] parsed result object
74
+ # @yieldparam err [StandardError] error object if request failed
75
+ #
76
+ # @return [Google::Apis::FirestoreV1beta2::GoogleLongrunningOperation]
77
+ #
78
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
79
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
80
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
81
+ def export_project_database_documents(name, google_firestore_admin_v1beta2_export_documents_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
82
+ command = make_simple_command(:post, 'v1beta2/{+name}:exportDocuments', options)
83
+ command.request_representation = Google::Apis::FirestoreV1beta2::GoogleFirestoreAdminV1beta2ExportDocumentsRequest::Representation
84
+ command.request_object = google_firestore_admin_v1beta2_export_documents_request_object
85
+ command.response_representation = Google::Apis::FirestoreV1beta2::GoogleLongrunningOperation::Representation
86
+ command.response_class = Google::Apis::FirestoreV1beta2::GoogleLongrunningOperation
87
+ command.params['name'] = name unless name.nil?
88
+ command.query['fields'] = fields unless fields.nil?
89
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
90
+ execute_or_queue_command(command, &block)
91
+ end
92
+
93
+ # Imports documents into Google Cloud Firestore. Existing documents with the
94
+ # same name are overwritten. The import occurs in the background and its
95
+ # progress can be monitored and managed via the Operation resource that is
96
+ # created. If an ImportDocuments operation is cancelled, it is possible that a
97
+ # subset of the data has already been imported to Cloud Firestore.
98
+ # @param [String] name
99
+ # Database to import into. Should be of the form: `projects/`project_id`/
100
+ # databases/`database_id``.
101
+ # @param [Google::Apis::FirestoreV1beta2::GoogleFirestoreAdminV1beta2ImportDocumentsRequest] google_firestore_admin_v1beta2_import_documents_request_object
102
+ # @param [String] fields
103
+ # Selector specifying which fields to include in a partial response.
104
+ # @param [String] quota_user
105
+ # Available to use for quota purposes for server-side applications. Can be any
106
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
107
+ # @param [Google::Apis::RequestOptions] options
108
+ # Request-specific options
109
+ #
110
+ # @yield [result, err] Result & error if block supplied
111
+ # @yieldparam result [Google::Apis::FirestoreV1beta2::GoogleLongrunningOperation] parsed result object
112
+ # @yieldparam err [StandardError] error object if request failed
113
+ #
114
+ # @return [Google::Apis::FirestoreV1beta2::GoogleLongrunningOperation]
115
+ #
116
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
117
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
118
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
119
+ def import_project_database_documents(name, google_firestore_admin_v1beta2_import_documents_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
120
+ command = make_simple_command(:post, 'v1beta2/{+name}:importDocuments', options)
121
+ command.request_representation = Google::Apis::FirestoreV1beta2::GoogleFirestoreAdminV1beta2ImportDocumentsRequest::Representation
122
+ command.request_object = google_firestore_admin_v1beta2_import_documents_request_object
123
+ command.response_representation = Google::Apis::FirestoreV1beta2::GoogleLongrunningOperation::Representation
124
+ command.response_class = Google::Apis::FirestoreV1beta2::GoogleLongrunningOperation
125
+ command.params['name'] = name unless name.nil?
126
+ command.query['fields'] = fields unless fields.nil?
127
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
128
+ execute_or_queue_command(command, &block)
129
+ end
130
+
131
+ # Gets the metadata and configuration for a Field.
132
+ # @param [String] name
133
+ # A name of the form `projects/`project_id`/databases/`database_id`/
134
+ # collectionGroups/`collection_id`/fields/`field_id``
135
+ # @param [String] fields
136
+ # Selector specifying which fields to include in a partial response.
137
+ # @param [String] quota_user
138
+ # Available to use for quota purposes for server-side applications. Can be any
139
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
140
+ # @param [Google::Apis::RequestOptions] options
141
+ # Request-specific options
142
+ #
143
+ # @yield [result, err] Result & error if block supplied
144
+ # @yieldparam result [Google::Apis::FirestoreV1beta2::GoogleFirestoreAdminV1beta2Field] parsed result object
145
+ # @yieldparam err [StandardError] error object if request failed
146
+ #
147
+ # @return [Google::Apis::FirestoreV1beta2::GoogleFirestoreAdminV1beta2Field]
148
+ #
149
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
150
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
151
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
152
+ def get_project_database_collection_group_field(name, fields: nil, quota_user: nil, options: nil, &block)
153
+ command = make_simple_command(:get, 'v1beta2/{+name}', options)
154
+ command.response_representation = Google::Apis::FirestoreV1beta2::GoogleFirestoreAdminV1beta2Field::Representation
155
+ command.response_class = Google::Apis::FirestoreV1beta2::GoogleFirestoreAdminV1beta2Field
156
+ command.params['name'] = name unless name.nil?
157
+ command.query['fields'] = fields unless fields.nil?
158
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
159
+ execute_or_queue_command(command, &block)
160
+ end
161
+
162
+ # Lists the field configuration and metadata for this database. Currently,
163
+ # FirestoreAdmin.ListFields only supports listing fields that have been
164
+ # explicitly overridden. To issue this query, call FirestoreAdmin.ListFields
165
+ # with the filter set to `indexConfig.usesAncestorConfig:false`.
166
+ # @param [String] parent
167
+ # A parent name of the form `projects/`project_id`/databases/`database_id`/
168
+ # collectionGroups/`collection_id``
169
+ # @param [String] filter
170
+ # The filter to apply to list results. Currently, FirestoreAdmin.ListFields only
171
+ # supports listing fields that have been explicitly overridden. To issue this
172
+ # query, call FirestoreAdmin.ListFields with the filter set to `indexConfig.
173
+ # usesAncestorConfig:false`.
174
+ # @param [Fixnum] page_size
175
+ # The number of results to return.
176
+ # @param [String] page_token
177
+ # A page token, returned from a previous call to FirestoreAdmin.ListFields, that
178
+ # may be used to get the next page of results.
179
+ # @param [String] fields
180
+ # Selector specifying which fields to include in a partial response.
181
+ # @param [String] quota_user
182
+ # Available to use for quota purposes for server-side applications. Can be any
183
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
184
+ # @param [Google::Apis::RequestOptions] options
185
+ # Request-specific options
186
+ #
187
+ # @yield [result, err] Result & error if block supplied
188
+ # @yieldparam result [Google::Apis::FirestoreV1beta2::GoogleFirestoreAdminV1beta2ListFieldsResponse] parsed result object
189
+ # @yieldparam err [StandardError] error object if request failed
190
+ #
191
+ # @return [Google::Apis::FirestoreV1beta2::GoogleFirestoreAdminV1beta2ListFieldsResponse]
192
+ #
193
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
194
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
195
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
196
+ def list_project_database_collection_group_fields(parent, filter: nil, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block)
197
+ command = make_simple_command(:get, 'v1beta2/{+parent}/fields', options)
198
+ command.response_representation = Google::Apis::FirestoreV1beta2::GoogleFirestoreAdminV1beta2ListFieldsResponse::Representation
199
+ command.response_class = Google::Apis::FirestoreV1beta2::GoogleFirestoreAdminV1beta2ListFieldsResponse
200
+ command.params['parent'] = parent unless parent.nil?
201
+ command.query['filter'] = filter unless filter.nil?
202
+ command.query['pageSize'] = page_size unless page_size.nil?
203
+ command.query['pageToken'] = page_token unless page_token.nil?
204
+ command.query['fields'] = fields unless fields.nil?
205
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
206
+ execute_or_queue_command(command, &block)
207
+ end
208
+
209
+ # Updates a field configuration. Currently, field updates apply only to single
210
+ # field index configuration. However, calls to FirestoreAdmin.UpdateField should
211
+ # provide a field mask to avoid changing any configuration that the caller isn't
212
+ # aware of. The field mask should be specified as: `` paths: "index_config" ``.
213
+ # This call returns a google.longrunning.Operation which may be used to track
214
+ # the status of the field update. The metadata for the operation will be the
215
+ # type FieldOperationMetadata. To configure the default field settings for the
216
+ # database, use the special `Field` with resource name: `projects/`project_id`/
217
+ # databases/`database_id`/collectionGroups/__default__/fields/*`.
218
+ # @param [String] name
219
+ # A field name of the form `projects/`project_id`/databases/`database_id`/
220
+ # collectionGroups/`collection_id`/fields/`field_path`` A field path may be a
221
+ # simple field name, e.g. `address` or a path to fields within map_value , e.g. `
222
+ # address.city`, or a special field path. The only valid special field is `*`,
223
+ # which represents any field. Field paths may be quoted using ` (backtick). The
224
+ # only character that needs to be escaped within a quoted field path is the
225
+ # backtick character itself, escaped using a backslash. Special characters in
226
+ # field paths that must be quoted include: `*`, `.`, ``` (backtick), `[`, `]`,
227
+ # as well as any ascii symbolic characters. Examples: (Note: Comments here are
228
+ # written in markdown syntax, so there is an additional layer of backticks to
229
+ # represent a code block) `\`address.city\`` represents a field named `address.
230
+ # city`, not the map key `city` in the field `address`. `\`*\`` represents a
231
+ # field named `*`, not any field. A special `Field` contains the default
232
+ # indexing settings for all fields. This field's resource name is: `projects/`
233
+ # project_id`/databases/`database_id`/collectionGroups/__default__/fields/*`
234
+ # Indexes defined on this `Field` will be applied to all fields which do not
235
+ # have their own `Field` index configuration.
236
+ # @param [Google::Apis::FirestoreV1beta2::GoogleFirestoreAdminV1beta2Field] google_firestore_admin_v1beta2_field_object
237
+ # @param [String] update_mask
238
+ # A mask, relative to the field. If specified, only configuration specified by
239
+ # this field_mask will be updated in the field.
240
+ # @param [String] fields
241
+ # Selector specifying which fields to include in a partial response.
242
+ # @param [String] quota_user
243
+ # Available to use for quota purposes for server-side applications. Can be any
244
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
245
+ # @param [Google::Apis::RequestOptions] options
246
+ # Request-specific options
247
+ #
248
+ # @yield [result, err] Result & error if block supplied
249
+ # @yieldparam result [Google::Apis::FirestoreV1beta2::GoogleLongrunningOperation] parsed result object
250
+ # @yieldparam err [StandardError] error object if request failed
251
+ #
252
+ # @return [Google::Apis::FirestoreV1beta2::GoogleLongrunningOperation]
253
+ #
254
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
255
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
256
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
257
+ def patch_project_database_collection_group_field(name, google_firestore_admin_v1beta2_field_object = nil, update_mask: nil, fields: nil, quota_user: nil, options: nil, &block)
258
+ command = make_simple_command(:patch, 'v1beta2/{+name}', options)
259
+ command.request_representation = Google::Apis::FirestoreV1beta2::GoogleFirestoreAdminV1beta2Field::Representation
260
+ command.request_object = google_firestore_admin_v1beta2_field_object
261
+ command.response_representation = Google::Apis::FirestoreV1beta2::GoogleLongrunningOperation::Representation
262
+ command.response_class = Google::Apis::FirestoreV1beta2::GoogleLongrunningOperation
263
+ command.params['name'] = name unless name.nil?
264
+ command.query['updateMask'] = update_mask unless update_mask.nil?
265
+ command.query['fields'] = fields unless fields.nil?
266
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
267
+ execute_or_queue_command(command, &block)
268
+ end
269
+
270
+ # Creates a composite index. This returns a google.longrunning.Operation which
271
+ # may be used to track the status of the creation. The metadata for the
272
+ # operation will be the type IndexOperationMetadata.
273
+ # @param [String] parent
274
+ # A parent name of the form `projects/`project_id`/databases/`database_id`/
275
+ # collectionGroups/`collection_id``
276
+ # @param [Google::Apis::FirestoreV1beta2::GoogleFirestoreAdminV1beta2Index] google_firestore_admin_v1beta2_index_object
277
+ # @param [String] fields
278
+ # Selector specifying which fields to include in a partial response.
279
+ # @param [String] quota_user
280
+ # Available to use for quota purposes for server-side applications. Can be any
281
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
282
+ # @param [Google::Apis::RequestOptions] options
283
+ # Request-specific options
284
+ #
285
+ # @yield [result, err] Result & error if block supplied
286
+ # @yieldparam result [Google::Apis::FirestoreV1beta2::GoogleLongrunningOperation] parsed result object
287
+ # @yieldparam err [StandardError] error object if request failed
288
+ #
289
+ # @return [Google::Apis::FirestoreV1beta2::GoogleLongrunningOperation]
290
+ #
291
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
292
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
293
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
294
+ def create_project_database_collection_group_index(parent, google_firestore_admin_v1beta2_index_object = nil, fields: nil, quota_user: nil, options: nil, &block)
295
+ command = make_simple_command(:post, 'v1beta2/{+parent}/indexes', options)
296
+ command.request_representation = Google::Apis::FirestoreV1beta2::GoogleFirestoreAdminV1beta2Index::Representation
297
+ command.request_object = google_firestore_admin_v1beta2_index_object
298
+ command.response_representation = Google::Apis::FirestoreV1beta2::GoogleLongrunningOperation::Representation
299
+ command.response_class = Google::Apis::FirestoreV1beta2::GoogleLongrunningOperation
300
+ command.params['parent'] = parent unless parent.nil?
301
+ command.query['fields'] = fields unless fields.nil?
302
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
303
+ execute_or_queue_command(command, &block)
304
+ end
305
+
306
+ # Deletes a composite index.
307
+ # @param [String] name
308
+ # A name of the form `projects/`project_id`/databases/`database_id`/
309
+ # collectionGroups/`collection_id`/indexes/`index_id``
310
+ # @param [String] fields
311
+ # Selector specifying which fields to include in a partial response.
312
+ # @param [String] quota_user
313
+ # Available to use for quota purposes for server-side applications. Can be any
314
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
315
+ # @param [Google::Apis::RequestOptions] options
316
+ # Request-specific options
317
+ #
318
+ # @yield [result, err] Result & error if block supplied
319
+ # @yieldparam result [Google::Apis::FirestoreV1beta2::Empty] parsed result object
320
+ # @yieldparam err [StandardError] error object if request failed
321
+ #
322
+ # @return [Google::Apis::FirestoreV1beta2::Empty]
323
+ #
324
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
325
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
326
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
327
+ def delete_project_database_collection_group_index(name, fields: nil, quota_user: nil, options: nil, &block)
328
+ command = make_simple_command(:delete, 'v1beta2/{+name}', options)
329
+ command.response_representation = Google::Apis::FirestoreV1beta2::Empty::Representation
330
+ command.response_class = Google::Apis::FirestoreV1beta2::Empty
331
+ command.params['name'] = name unless name.nil?
332
+ command.query['fields'] = fields unless fields.nil?
333
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
334
+ execute_or_queue_command(command, &block)
335
+ end
336
+
337
+ # Gets a composite index.
338
+ # @param [String] name
339
+ # A name of the form `projects/`project_id`/databases/`database_id`/
340
+ # collectionGroups/`collection_id`/indexes/`index_id``
341
+ # @param [String] fields
342
+ # Selector specifying which fields to include in a partial response.
343
+ # @param [String] quota_user
344
+ # Available to use for quota purposes for server-side applications. Can be any
345
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
346
+ # @param [Google::Apis::RequestOptions] options
347
+ # Request-specific options
348
+ #
349
+ # @yield [result, err] Result & error if block supplied
350
+ # @yieldparam result [Google::Apis::FirestoreV1beta2::GoogleFirestoreAdminV1beta2Index] parsed result object
351
+ # @yieldparam err [StandardError] error object if request failed
352
+ #
353
+ # @return [Google::Apis::FirestoreV1beta2::GoogleFirestoreAdminV1beta2Index]
354
+ #
355
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
356
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
357
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
358
+ def get_project_database_collection_group_index(name, fields: nil, quota_user: nil, options: nil, &block)
359
+ command = make_simple_command(:get, 'v1beta2/{+name}', options)
360
+ command.response_representation = Google::Apis::FirestoreV1beta2::GoogleFirestoreAdminV1beta2Index::Representation
361
+ command.response_class = Google::Apis::FirestoreV1beta2::GoogleFirestoreAdminV1beta2Index
362
+ command.params['name'] = name unless name.nil?
363
+ command.query['fields'] = fields unless fields.nil?
364
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
365
+ execute_or_queue_command(command, &block)
366
+ end
367
+
368
+ # Lists composite indexes.
369
+ # @param [String] parent
370
+ # A parent name of the form `projects/`project_id`/databases/`database_id`/
371
+ # collectionGroups/`collection_id``
372
+ # @param [String] filter
373
+ # The filter to apply to list results.
374
+ # @param [Fixnum] page_size
375
+ # The number of results to return.
376
+ # @param [String] page_token
377
+ # A page token, returned from a previous call to FirestoreAdmin.ListIndexes,
378
+ # that may be used to get the next page of results.
379
+ # @param [String] fields
380
+ # Selector specifying which fields to include in a partial response.
381
+ # @param [String] quota_user
382
+ # Available to use for quota purposes for server-side applications. Can be any
383
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
384
+ # @param [Google::Apis::RequestOptions] options
385
+ # Request-specific options
386
+ #
387
+ # @yield [result, err] Result & error if block supplied
388
+ # @yieldparam result [Google::Apis::FirestoreV1beta2::GoogleFirestoreAdminV1beta2ListIndexesResponse] parsed result object
389
+ # @yieldparam err [StandardError] error object if request failed
390
+ #
391
+ # @return [Google::Apis::FirestoreV1beta2::GoogleFirestoreAdminV1beta2ListIndexesResponse]
392
+ #
393
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
394
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
395
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
396
+ def list_project_database_collection_group_indexes(parent, filter: nil, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block)
397
+ command = make_simple_command(:get, 'v1beta2/{+parent}/indexes', options)
398
+ command.response_representation = Google::Apis::FirestoreV1beta2::GoogleFirestoreAdminV1beta2ListIndexesResponse::Representation
399
+ command.response_class = Google::Apis::FirestoreV1beta2::GoogleFirestoreAdminV1beta2ListIndexesResponse
400
+ command.params['parent'] = parent unless parent.nil?
401
+ command.query['filter'] = filter unless filter.nil?
402
+ command.query['pageSize'] = page_size unless page_size.nil?
403
+ command.query['pageToken'] = page_token unless page_token.nil?
404
+ command.query['fields'] = fields unless fields.nil?
405
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
406
+ execute_or_queue_command(command, &block)
407
+ end
408
+
409
+ protected
410
+
411
+ def apply_command_defaults(command)
412
+ command.query['key'] = key unless key.nil?
413
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
414
+ end
415
+ end
416
+ end
417
+ end
418
+ end