google-cloud-firestore-admin-v1 0.7.1 → 0.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/lib/google/cloud/firestore/admin/v1/firestore_admin/client.rb +28 -32
- data/lib/google/cloud/firestore/admin/v1/firestore_admin/operations.rb +12 -14
- data/lib/google/cloud/firestore/admin/v1/firestore_admin/rest/client.rb +1289 -0
- data/lib/google/cloud/firestore/admin/v1/firestore_admin/rest/operations.rb +795 -0
- data/lib/google/cloud/firestore/admin/v1/firestore_admin/rest/service_stub.rb +763 -0
- data/lib/google/cloud/firestore/admin/v1/firestore_admin/rest.rb +82 -0
- data/lib/google/cloud/firestore/admin/v1/firestore_admin.rb +6 -0
- data/lib/google/cloud/firestore/admin/v1/rest.rb +39 -0
- data/lib/google/cloud/firestore/admin/v1/version.rb +1 -1
- data/lib/google/cloud/firestore/admin/v1.rb +5 -0
- metadata +15 -9
@@ -0,0 +1,763 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Copyright 2023 Google LLC
|
4
|
+
#
|
5
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
6
|
+
# you may not use this file except in compliance with the License.
|
7
|
+
# You may obtain a copy of the License at
|
8
|
+
#
|
9
|
+
# https://www.apache.org/licenses/LICENSE-2.0
|
10
|
+
#
|
11
|
+
# Unless required by applicable law or agreed to in writing, software
|
12
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
13
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
14
|
+
# See the License for the specific language governing permissions and
|
15
|
+
# limitations under the License.
|
16
|
+
|
17
|
+
# Auto-generated by gapic-generator-ruby. DO NOT EDIT!
|
18
|
+
|
19
|
+
require "google/firestore/admin/v1/firestore_admin_pb"
|
20
|
+
|
21
|
+
module Google
|
22
|
+
module Cloud
|
23
|
+
module Firestore
|
24
|
+
module Admin
|
25
|
+
module V1
|
26
|
+
module FirestoreAdmin
|
27
|
+
module Rest
|
28
|
+
##
|
29
|
+
# REST service stub for the FirestoreAdmin service.
|
30
|
+
# Service stub contains baseline method implementations
|
31
|
+
# including transcoding, making the REST call, and deserialing the response.
|
32
|
+
#
|
33
|
+
class ServiceStub
|
34
|
+
def initialize endpoint:, credentials:
|
35
|
+
# These require statements are intentionally placed here to initialize
|
36
|
+
# the REST modules only when it's required.
|
37
|
+
require "gapic/rest"
|
38
|
+
|
39
|
+
@client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, credentials: credentials,
|
40
|
+
numeric_enums: true,
|
41
|
+
raise_faraday_errors: false
|
42
|
+
end
|
43
|
+
|
44
|
+
##
|
45
|
+
# Baseline implementation for the create_index REST call
|
46
|
+
#
|
47
|
+
# @param request_pb [::Google::Cloud::Firestore::Admin::V1::CreateIndexRequest]
|
48
|
+
# A request object representing the call parameters. Required.
|
49
|
+
# @param options [::Gapic::CallOptions]
|
50
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
51
|
+
#
|
52
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
53
|
+
# @yieldparam result [::Google::Longrunning::Operation]
|
54
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
55
|
+
#
|
56
|
+
# @return [::Google::Longrunning::Operation]
|
57
|
+
# A result object deserialized from the server's reply
|
58
|
+
def create_index request_pb, options = nil
|
59
|
+
raise ::ArgumentError, "request must be provided" if request_pb.nil?
|
60
|
+
|
61
|
+
verb, uri, query_string_params, body = ServiceStub.transcode_create_index_request request_pb
|
62
|
+
query_string_params = if query_string_params.any?
|
63
|
+
query_string_params.to_h { |p| p.split("=", 2) }
|
64
|
+
else
|
65
|
+
{}
|
66
|
+
end
|
67
|
+
|
68
|
+
response = @client_stub.make_http_request(
|
69
|
+
verb,
|
70
|
+
uri: uri,
|
71
|
+
body: body || "",
|
72
|
+
params: query_string_params,
|
73
|
+
options: options
|
74
|
+
)
|
75
|
+
operation = ::Gapic::Rest::TransportOperation.new response
|
76
|
+
result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true
|
77
|
+
|
78
|
+
yield result, operation if block_given?
|
79
|
+
result
|
80
|
+
end
|
81
|
+
|
82
|
+
##
|
83
|
+
# Baseline implementation for the list_indexes REST call
|
84
|
+
#
|
85
|
+
# @param request_pb [::Google::Cloud::Firestore::Admin::V1::ListIndexesRequest]
|
86
|
+
# A request object representing the call parameters. Required.
|
87
|
+
# @param options [::Gapic::CallOptions]
|
88
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
89
|
+
#
|
90
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
91
|
+
# @yieldparam result [::Google::Cloud::Firestore::Admin::V1::ListIndexesResponse]
|
92
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
93
|
+
#
|
94
|
+
# @return [::Google::Cloud::Firestore::Admin::V1::ListIndexesResponse]
|
95
|
+
# A result object deserialized from the server's reply
|
96
|
+
def list_indexes request_pb, options = nil
|
97
|
+
raise ::ArgumentError, "request must be provided" if request_pb.nil?
|
98
|
+
|
99
|
+
verb, uri, query_string_params, body = ServiceStub.transcode_list_indexes_request request_pb
|
100
|
+
query_string_params = if query_string_params.any?
|
101
|
+
query_string_params.to_h { |p| p.split("=", 2) }
|
102
|
+
else
|
103
|
+
{}
|
104
|
+
end
|
105
|
+
|
106
|
+
response = @client_stub.make_http_request(
|
107
|
+
verb,
|
108
|
+
uri: uri,
|
109
|
+
body: body || "",
|
110
|
+
params: query_string_params,
|
111
|
+
options: options
|
112
|
+
)
|
113
|
+
operation = ::Gapic::Rest::TransportOperation.new response
|
114
|
+
result = ::Google::Cloud::Firestore::Admin::V1::ListIndexesResponse.decode_json response.body, ignore_unknown_fields: true
|
115
|
+
|
116
|
+
yield result, operation if block_given?
|
117
|
+
result
|
118
|
+
end
|
119
|
+
|
120
|
+
##
|
121
|
+
# Baseline implementation for the get_index REST call
|
122
|
+
#
|
123
|
+
# @param request_pb [::Google::Cloud::Firestore::Admin::V1::GetIndexRequest]
|
124
|
+
# A request object representing the call parameters. Required.
|
125
|
+
# @param options [::Gapic::CallOptions]
|
126
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
127
|
+
#
|
128
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
129
|
+
# @yieldparam result [::Google::Cloud::Firestore::Admin::V1::Index]
|
130
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
131
|
+
#
|
132
|
+
# @return [::Google::Cloud::Firestore::Admin::V1::Index]
|
133
|
+
# A result object deserialized from the server's reply
|
134
|
+
def get_index request_pb, options = nil
|
135
|
+
raise ::ArgumentError, "request must be provided" if request_pb.nil?
|
136
|
+
|
137
|
+
verb, uri, query_string_params, body = ServiceStub.transcode_get_index_request request_pb
|
138
|
+
query_string_params = if query_string_params.any?
|
139
|
+
query_string_params.to_h { |p| p.split("=", 2) }
|
140
|
+
else
|
141
|
+
{}
|
142
|
+
end
|
143
|
+
|
144
|
+
response = @client_stub.make_http_request(
|
145
|
+
verb,
|
146
|
+
uri: uri,
|
147
|
+
body: body || "",
|
148
|
+
params: query_string_params,
|
149
|
+
options: options
|
150
|
+
)
|
151
|
+
operation = ::Gapic::Rest::TransportOperation.new response
|
152
|
+
result = ::Google::Cloud::Firestore::Admin::V1::Index.decode_json response.body, ignore_unknown_fields: true
|
153
|
+
|
154
|
+
yield result, operation if block_given?
|
155
|
+
result
|
156
|
+
end
|
157
|
+
|
158
|
+
##
|
159
|
+
# Baseline implementation for the delete_index REST call
|
160
|
+
#
|
161
|
+
# @param request_pb [::Google::Cloud::Firestore::Admin::V1::DeleteIndexRequest]
|
162
|
+
# A request object representing the call parameters. Required.
|
163
|
+
# @param options [::Gapic::CallOptions]
|
164
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
165
|
+
#
|
166
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
167
|
+
# @yieldparam result [::Google::Protobuf::Empty]
|
168
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
169
|
+
#
|
170
|
+
# @return [::Google::Protobuf::Empty]
|
171
|
+
# A result object deserialized from the server's reply
|
172
|
+
def delete_index request_pb, options = nil
|
173
|
+
raise ::ArgumentError, "request must be provided" if request_pb.nil?
|
174
|
+
|
175
|
+
verb, uri, query_string_params, body = ServiceStub.transcode_delete_index_request request_pb
|
176
|
+
query_string_params = if query_string_params.any?
|
177
|
+
query_string_params.to_h { |p| p.split("=", 2) }
|
178
|
+
else
|
179
|
+
{}
|
180
|
+
end
|
181
|
+
|
182
|
+
response = @client_stub.make_http_request(
|
183
|
+
verb,
|
184
|
+
uri: uri,
|
185
|
+
body: body || "",
|
186
|
+
params: query_string_params,
|
187
|
+
options: options
|
188
|
+
)
|
189
|
+
operation = ::Gapic::Rest::TransportOperation.new response
|
190
|
+
result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true
|
191
|
+
|
192
|
+
yield result, operation if block_given?
|
193
|
+
result
|
194
|
+
end
|
195
|
+
|
196
|
+
##
|
197
|
+
# Baseline implementation for the get_field REST call
|
198
|
+
#
|
199
|
+
# @param request_pb [::Google::Cloud::Firestore::Admin::V1::GetFieldRequest]
|
200
|
+
# A request object representing the call parameters. Required.
|
201
|
+
# @param options [::Gapic::CallOptions]
|
202
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
203
|
+
#
|
204
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
205
|
+
# @yieldparam result [::Google::Cloud::Firestore::Admin::V1::Field]
|
206
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
207
|
+
#
|
208
|
+
# @return [::Google::Cloud::Firestore::Admin::V1::Field]
|
209
|
+
# A result object deserialized from the server's reply
|
210
|
+
def get_field request_pb, options = nil
|
211
|
+
raise ::ArgumentError, "request must be provided" if request_pb.nil?
|
212
|
+
|
213
|
+
verb, uri, query_string_params, body = ServiceStub.transcode_get_field_request request_pb
|
214
|
+
query_string_params = if query_string_params.any?
|
215
|
+
query_string_params.to_h { |p| p.split("=", 2) }
|
216
|
+
else
|
217
|
+
{}
|
218
|
+
end
|
219
|
+
|
220
|
+
response = @client_stub.make_http_request(
|
221
|
+
verb,
|
222
|
+
uri: uri,
|
223
|
+
body: body || "",
|
224
|
+
params: query_string_params,
|
225
|
+
options: options
|
226
|
+
)
|
227
|
+
operation = ::Gapic::Rest::TransportOperation.new response
|
228
|
+
result = ::Google::Cloud::Firestore::Admin::V1::Field.decode_json response.body, ignore_unknown_fields: true
|
229
|
+
|
230
|
+
yield result, operation if block_given?
|
231
|
+
result
|
232
|
+
end
|
233
|
+
|
234
|
+
##
|
235
|
+
# Baseline implementation for the update_field REST call
|
236
|
+
#
|
237
|
+
# @param request_pb [::Google::Cloud::Firestore::Admin::V1::UpdateFieldRequest]
|
238
|
+
# A request object representing the call parameters. Required.
|
239
|
+
# @param options [::Gapic::CallOptions]
|
240
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
241
|
+
#
|
242
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
243
|
+
# @yieldparam result [::Google::Longrunning::Operation]
|
244
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
245
|
+
#
|
246
|
+
# @return [::Google::Longrunning::Operation]
|
247
|
+
# A result object deserialized from the server's reply
|
248
|
+
def update_field request_pb, options = nil
|
249
|
+
raise ::ArgumentError, "request must be provided" if request_pb.nil?
|
250
|
+
|
251
|
+
verb, uri, query_string_params, body = ServiceStub.transcode_update_field_request request_pb
|
252
|
+
query_string_params = if query_string_params.any?
|
253
|
+
query_string_params.to_h { |p| p.split("=", 2) }
|
254
|
+
else
|
255
|
+
{}
|
256
|
+
end
|
257
|
+
|
258
|
+
response = @client_stub.make_http_request(
|
259
|
+
verb,
|
260
|
+
uri: uri,
|
261
|
+
body: body || "",
|
262
|
+
params: query_string_params,
|
263
|
+
options: options
|
264
|
+
)
|
265
|
+
operation = ::Gapic::Rest::TransportOperation.new response
|
266
|
+
result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true
|
267
|
+
|
268
|
+
yield result, operation if block_given?
|
269
|
+
result
|
270
|
+
end
|
271
|
+
|
272
|
+
##
|
273
|
+
# Baseline implementation for the list_fields REST call
|
274
|
+
#
|
275
|
+
# @param request_pb [::Google::Cloud::Firestore::Admin::V1::ListFieldsRequest]
|
276
|
+
# A request object representing the call parameters. Required.
|
277
|
+
# @param options [::Gapic::CallOptions]
|
278
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
279
|
+
#
|
280
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
281
|
+
# @yieldparam result [::Google::Cloud::Firestore::Admin::V1::ListFieldsResponse]
|
282
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
283
|
+
#
|
284
|
+
# @return [::Google::Cloud::Firestore::Admin::V1::ListFieldsResponse]
|
285
|
+
# A result object deserialized from the server's reply
|
286
|
+
def list_fields request_pb, options = nil
|
287
|
+
raise ::ArgumentError, "request must be provided" if request_pb.nil?
|
288
|
+
|
289
|
+
verb, uri, query_string_params, body = ServiceStub.transcode_list_fields_request request_pb
|
290
|
+
query_string_params = if query_string_params.any?
|
291
|
+
query_string_params.to_h { |p| p.split("=", 2) }
|
292
|
+
else
|
293
|
+
{}
|
294
|
+
end
|
295
|
+
|
296
|
+
response = @client_stub.make_http_request(
|
297
|
+
verb,
|
298
|
+
uri: uri,
|
299
|
+
body: body || "",
|
300
|
+
params: query_string_params,
|
301
|
+
options: options
|
302
|
+
)
|
303
|
+
operation = ::Gapic::Rest::TransportOperation.new response
|
304
|
+
result = ::Google::Cloud::Firestore::Admin::V1::ListFieldsResponse.decode_json response.body, ignore_unknown_fields: true
|
305
|
+
|
306
|
+
yield result, operation if block_given?
|
307
|
+
result
|
308
|
+
end
|
309
|
+
|
310
|
+
##
|
311
|
+
# Baseline implementation for the export_documents REST call
|
312
|
+
#
|
313
|
+
# @param request_pb [::Google::Cloud::Firestore::Admin::V1::ExportDocumentsRequest]
|
314
|
+
# A request object representing the call parameters. Required.
|
315
|
+
# @param options [::Gapic::CallOptions]
|
316
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
317
|
+
#
|
318
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
319
|
+
# @yieldparam result [::Google::Longrunning::Operation]
|
320
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
321
|
+
#
|
322
|
+
# @return [::Google::Longrunning::Operation]
|
323
|
+
# A result object deserialized from the server's reply
|
324
|
+
def export_documents request_pb, options = nil
|
325
|
+
raise ::ArgumentError, "request must be provided" if request_pb.nil?
|
326
|
+
|
327
|
+
verb, uri, query_string_params, body = ServiceStub.transcode_export_documents_request request_pb
|
328
|
+
query_string_params = if query_string_params.any?
|
329
|
+
query_string_params.to_h { |p| p.split("=", 2) }
|
330
|
+
else
|
331
|
+
{}
|
332
|
+
end
|
333
|
+
|
334
|
+
response = @client_stub.make_http_request(
|
335
|
+
verb,
|
336
|
+
uri: uri,
|
337
|
+
body: body || "",
|
338
|
+
params: query_string_params,
|
339
|
+
options: options
|
340
|
+
)
|
341
|
+
operation = ::Gapic::Rest::TransportOperation.new response
|
342
|
+
result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true
|
343
|
+
|
344
|
+
yield result, operation if block_given?
|
345
|
+
result
|
346
|
+
end
|
347
|
+
|
348
|
+
##
|
349
|
+
# Baseline implementation for the import_documents REST call
|
350
|
+
#
|
351
|
+
# @param request_pb [::Google::Cloud::Firestore::Admin::V1::ImportDocumentsRequest]
|
352
|
+
# A request object representing the call parameters. Required.
|
353
|
+
# @param options [::Gapic::CallOptions]
|
354
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
355
|
+
#
|
356
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
357
|
+
# @yieldparam result [::Google::Longrunning::Operation]
|
358
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
359
|
+
#
|
360
|
+
# @return [::Google::Longrunning::Operation]
|
361
|
+
# A result object deserialized from the server's reply
|
362
|
+
def import_documents request_pb, options = nil
|
363
|
+
raise ::ArgumentError, "request must be provided" if request_pb.nil?
|
364
|
+
|
365
|
+
verb, uri, query_string_params, body = ServiceStub.transcode_import_documents_request request_pb
|
366
|
+
query_string_params = if query_string_params.any?
|
367
|
+
query_string_params.to_h { |p| p.split("=", 2) }
|
368
|
+
else
|
369
|
+
{}
|
370
|
+
end
|
371
|
+
|
372
|
+
response = @client_stub.make_http_request(
|
373
|
+
verb,
|
374
|
+
uri: uri,
|
375
|
+
body: body || "",
|
376
|
+
params: query_string_params,
|
377
|
+
options: options
|
378
|
+
)
|
379
|
+
operation = ::Gapic::Rest::TransportOperation.new response
|
380
|
+
result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true
|
381
|
+
|
382
|
+
yield result, operation if block_given?
|
383
|
+
result
|
384
|
+
end
|
385
|
+
|
386
|
+
##
|
387
|
+
# Baseline implementation for the get_database REST call
|
388
|
+
#
|
389
|
+
# @param request_pb [::Google::Cloud::Firestore::Admin::V1::GetDatabaseRequest]
|
390
|
+
# A request object representing the call parameters. Required.
|
391
|
+
# @param options [::Gapic::CallOptions]
|
392
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
393
|
+
#
|
394
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
395
|
+
# @yieldparam result [::Google::Cloud::Firestore::Admin::V1::Database]
|
396
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
397
|
+
#
|
398
|
+
# @return [::Google::Cloud::Firestore::Admin::V1::Database]
|
399
|
+
# A result object deserialized from the server's reply
|
400
|
+
def get_database request_pb, options = nil
|
401
|
+
raise ::ArgumentError, "request must be provided" if request_pb.nil?
|
402
|
+
|
403
|
+
verb, uri, query_string_params, body = ServiceStub.transcode_get_database_request request_pb
|
404
|
+
query_string_params = if query_string_params.any?
|
405
|
+
query_string_params.to_h { |p| p.split("=", 2) }
|
406
|
+
else
|
407
|
+
{}
|
408
|
+
end
|
409
|
+
|
410
|
+
response = @client_stub.make_http_request(
|
411
|
+
verb,
|
412
|
+
uri: uri,
|
413
|
+
body: body || "",
|
414
|
+
params: query_string_params,
|
415
|
+
options: options
|
416
|
+
)
|
417
|
+
operation = ::Gapic::Rest::TransportOperation.new response
|
418
|
+
result = ::Google::Cloud::Firestore::Admin::V1::Database.decode_json response.body, ignore_unknown_fields: true
|
419
|
+
|
420
|
+
yield result, operation if block_given?
|
421
|
+
result
|
422
|
+
end
|
423
|
+
|
424
|
+
##
|
425
|
+
# Baseline implementation for the list_databases REST call
|
426
|
+
#
|
427
|
+
# @param request_pb [::Google::Cloud::Firestore::Admin::V1::ListDatabasesRequest]
|
428
|
+
# A request object representing the call parameters. Required.
|
429
|
+
# @param options [::Gapic::CallOptions]
|
430
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
431
|
+
#
|
432
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
433
|
+
# @yieldparam result [::Google::Cloud::Firestore::Admin::V1::ListDatabasesResponse]
|
434
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
435
|
+
#
|
436
|
+
# @return [::Google::Cloud::Firestore::Admin::V1::ListDatabasesResponse]
|
437
|
+
# A result object deserialized from the server's reply
|
438
|
+
def list_databases request_pb, options = nil
|
439
|
+
raise ::ArgumentError, "request must be provided" if request_pb.nil?
|
440
|
+
|
441
|
+
verb, uri, query_string_params, body = ServiceStub.transcode_list_databases_request request_pb
|
442
|
+
query_string_params = if query_string_params.any?
|
443
|
+
query_string_params.to_h { |p| p.split("=", 2) }
|
444
|
+
else
|
445
|
+
{}
|
446
|
+
end
|
447
|
+
|
448
|
+
response = @client_stub.make_http_request(
|
449
|
+
verb,
|
450
|
+
uri: uri,
|
451
|
+
body: body || "",
|
452
|
+
params: query_string_params,
|
453
|
+
options: options
|
454
|
+
)
|
455
|
+
operation = ::Gapic::Rest::TransportOperation.new response
|
456
|
+
result = ::Google::Cloud::Firestore::Admin::V1::ListDatabasesResponse.decode_json response.body, ignore_unknown_fields: true
|
457
|
+
|
458
|
+
yield result, operation if block_given?
|
459
|
+
result
|
460
|
+
end
|
461
|
+
|
462
|
+
##
|
463
|
+
# Baseline implementation for the update_database REST call
|
464
|
+
#
|
465
|
+
# @param request_pb [::Google::Cloud::Firestore::Admin::V1::UpdateDatabaseRequest]
|
466
|
+
# A request object representing the call parameters. Required.
|
467
|
+
# @param options [::Gapic::CallOptions]
|
468
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
469
|
+
#
|
470
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
471
|
+
# @yieldparam result [::Google::Longrunning::Operation]
|
472
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
473
|
+
#
|
474
|
+
# @return [::Google::Longrunning::Operation]
|
475
|
+
# A result object deserialized from the server's reply
|
476
|
+
def update_database request_pb, options = nil
|
477
|
+
raise ::ArgumentError, "request must be provided" if request_pb.nil?
|
478
|
+
|
479
|
+
verb, uri, query_string_params, body = ServiceStub.transcode_update_database_request request_pb
|
480
|
+
query_string_params = if query_string_params.any?
|
481
|
+
query_string_params.to_h { |p| p.split("=", 2) }
|
482
|
+
else
|
483
|
+
{}
|
484
|
+
end
|
485
|
+
|
486
|
+
response = @client_stub.make_http_request(
|
487
|
+
verb,
|
488
|
+
uri: uri,
|
489
|
+
body: body || "",
|
490
|
+
params: query_string_params,
|
491
|
+
options: options
|
492
|
+
)
|
493
|
+
operation = ::Gapic::Rest::TransportOperation.new response
|
494
|
+
result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true
|
495
|
+
|
496
|
+
yield result, operation if block_given?
|
497
|
+
result
|
498
|
+
end
|
499
|
+
|
500
|
+
##
|
501
|
+
# @private
|
502
|
+
#
|
503
|
+
# GRPC transcoding helper method for the create_index REST call
|
504
|
+
#
|
505
|
+
# @param request_pb [::Google::Cloud::Firestore::Admin::V1::CreateIndexRequest]
|
506
|
+
# A request object representing the call parameters. Required.
|
507
|
+
# @return [Array(String, [String, nil], Hash{String => String})]
|
508
|
+
# Uri, Body, Query string parameters
|
509
|
+
def self.transcode_create_index_request request_pb
|
510
|
+
transcoder = Gapic::Rest::GrpcTranscoder.new
|
511
|
+
.with_bindings(
|
512
|
+
uri_method: :post,
|
513
|
+
uri_template: "/v1/{parent}/indexes",
|
514
|
+
body: "index",
|
515
|
+
matches: [
|
516
|
+
["parent", %r{^projects/[^/]+/databases/[^/]+/collectionGroups/[^/]+/?$}, false]
|
517
|
+
]
|
518
|
+
)
|
519
|
+
transcoder.transcode request_pb
|
520
|
+
end
|
521
|
+
|
522
|
+
##
|
523
|
+
# @private
|
524
|
+
#
|
525
|
+
# GRPC transcoding helper method for the list_indexes REST call
|
526
|
+
#
|
527
|
+
# @param request_pb [::Google::Cloud::Firestore::Admin::V1::ListIndexesRequest]
|
528
|
+
# A request object representing the call parameters. Required.
|
529
|
+
# @return [Array(String, [String, nil], Hash{String => String})]
|
530
|
+
# Uri, Body, Query string parameters
|
531
|
+
def self.transcode_list_indexes_request request_pb
|
532
|
+
transcoder = Gapic::Rest::GrpcTranscoder.new
|
533
|
+
.with_bindings(
|
534
|
+
uri_method: :get,
|
535
|
+
uri_template: "/v1/{parent}/indexes",
|
536
|
+
matches: [
|
537
|
+
["parent", %r{^projects/[^/]+/databases/[^/]+/collectionGroups/[^/]+/?$}, false]
|
538
|
+
]
|
539
|
+
)
|
540
|
+
transcoder.transcode request_pb
|
541
|
+
end
|
542
|
+
|
543
|
+
##
|
544
|
+
# @private
|
545
|
+
#
|
546
|
+
# GRPC transcoding helper method for the get_index REST call
|
547
|
+
#
|
548
|
+
# @param request_pb [::Google::Cloud::Firestore::Admin::V1::GetIndexRequest]
|
549
|
+
# A request object representing the call parameters. Required.
|
550
|
+
# @return [Array(String, [String, nil], Hash{String => String})]
|
551
|
+
# Uri, Body, Query string parameters
|
552
|
+
def self.transcode_get_index_request request_pb
|
553
|
+
transcoder = Gapic::Rest::GrpcTranscoder.new
|
554
|
+
.with_bindings(
|
555
|
+
uri_method: :get,
|
556
|
+
uri_template: "/v1/{name}",
|
557
|
+
matches: [
|
558
|
+
["name", %r{^projects/[^/]+/databases/[^/]+/collectionGroups/[^/]+/indexes/[^/]+/?$}, false]
|
559
|
+
]
|
560
|
+
)
|
561
|
+
transcoder.transcode request_pb
|
562
|
+
end
|
563
|
+
|
564
|
+
##
|
565
|
+
# @private
|
566
|
+
#
|
567
|
+
# GRPC transcoding helper method for the delete_index REST call
|
568
|
+
#
|
569
|
+
# @param request_pb [::Google::Cloud::Firestore::Admin::V1::DeleteIndexRequest]
|
570
|
+
# A request object representing the call parameters. Required.
|
571
|
+
# @return [Array(String, [String, nil], Hash{String => String})]
|
572
|
+
# Uri, Body, Query string parameters
|
573
|
+
def self.transcode_delete_index_request request_pb
|
574
|
+
transcoder = Gapic::Rest::GrpcTranscoder.new
|
575
|
+
.with_bindings(
|
576
|
+
uri_method: :delete,
|
577
|
+
uri_template: "/v1/{name}",
|
578
|
+
matches: [
|
579
|
+
["name", %r{^projects/[^/]+/databases/[^/]+/collectionGroups/[^/]+/indexes/[^/]+/?$}, false]
|
580
|
+
]
|
581
|
+
)
|
582
|
+
transcoder.transcode request_pb
|
583
|
+
end
|
584
|
+
|
585
|
+
##
|
586
|
+
# @private
|
587
|
+
#
|
588
|
+
# GRPC transcoding helper method for the get_field REST call
|
589
|
+
#
|
590
|
+
# @param request_pb [::Google::Cloud::Firestore::Admin::V1::GetFieldRequest]
|
591
|
+
# A request object representing the call parameters. Required.
|
592
|
+
# @return [Array(String, [String, nil], Hash{String => String})]
|
593
|
+
# Uri, Body, Query string parameters
|
594
|
+
def self.transcode_get_field_request request_pb
|
595
|
+
transcoder = Gapic::Rest::GrpcTranscoder.new
|
596
|
+
.with_bindings(
|
597
|
+
uri_method: :get,
|
598
|
+
uri_template: "/v1/{name}",
|
599
|
+
matches: [
|
600
|
+
["name", %r{^projects/[^/]+/databases/[^/]+/collectionGroups/[^/]+/fields/[^/]+/?$}, false]
|
601
|
+
]
|
602
|
+
)
|
603
|
+
transcoder.transcode request_pb
|
604
|
+
end
|
605
|
+
|
606
|
+
##
|
607
|
+
# @private
|
608
|
+
#
|
609
|
+
# GRPC transcoding helper method for the update_field REST call
|
610
|
+
#
|
611
|
+
# @param request_pb [::Google::Cloud::Firestore::Admin::V1::UpdateFieldRequest]
|
612
|
+
# A request object representing the call parameters. Required.
|
613
|
+
# @return [Array(String, [String, nil], Hash{String => String})]
|
614
|
+
# Uri, Body, Query string parameters
|
615
|
+
def self.transcode_update_field_request request_pb
|
616
|
+
transcoder = Gapic::Rest::GrpcTranscoder.new
|
617
|
+
.with_bindings(
|
618
|
+
uri_method: :patch,
|
619
|
+
uri_template: "/v1/{field.name}",
|
620
|
+
body: "field",
|
621
|
+
matches: [
|
622
|
+
["field.name", %r{^projects/[^/]+/databases/[^/]+/collectionGroups/[^/]+/fields/[^/]+/?$}, false]
|
623
|
+
]
|
624
|
+
)
|
625
|
+
transcoder.transcode request_pb
|
626
|
+
end
|
627
|
+
|
628
|
+
##
|
629
|
+
# @private
|
630
|
+
#
|
631
|
+
# GRPC transcoding helper method for the list_fields REST call
|
632
|
+
#
|
633
|
+
# @param request_pb [::Google::Cloud::Firestore::Admin::V1::ListFieldsRequest]
|
634
|
+
# A request object representing the call parameters. Required.
|
635
|
+
# @return [Array(String, [String, nil], Hash{String => String})]
|
636
|
+
# Uri, Body, Query string parameters
|
637
|
+
def self.transcode_list_fields_request request_pb
|
638
|
+
transcoder = Gapic::Rest::GrpcTranscoder.new
|
639
|
+
.with_bindings(
|
640
|
+
uri_method: :get,
|
641
|
+
uri_template: "/v1/{parent}/fields",
|
642
|
+
matches: [
|
643
|
+
["parent", %r{^projects/[^/]+/databases/[^/]+/collectionGroups/[^/]+/?$}, false]
|
644
|
+
]
|
645
|
+
)
|
646
|
+
transcoder.transcode request_pb
|
647
|
+
end
|
648
|
+
|
649
|
+
##
|
650
|
+
# @private
|
651
|
+
#
|
652
|
+
# GRPC transcoding helper method for the export_documents REST call
|
653
|
+
#
|
654
|
+
# @param request_pb [::Google::Cloud::Firestore::Admin::V1::ExportDocumentsRequest]
|
655
|
+
# A request object representing the call parameters. Required.
|
656
|
+
# @return [Array(String, [String, nil], Hash{String => String})]
|
657
|
+
# Uri, Body, Query string parameters
|
658
|
+
def self.transcode_export_documents_request request_pb
|
659
|
+
transcoder = Gapic::Rest::GrpcTranscoder.new
|
660
|
+
.with_bindings(
|
661
|
+
uri_method: :post,
|
662
|
+
uri_template: "/v1/{name}:exportDocuments",
|
663
|
+
body: "*",
|
664
|
+
matches: [
|
665
|
+
["name", %r{^projects/[^/]+/databases/[^/]+/?$}, false]
|
666
|
+
]
|
667
|
+
)
|
668
|
+
transcoder.transcode request_pb
|
669
|
+
end
|
670
|
+
|
671
|
+
##
|
672
|
+
# @private
|
673
|
+
#
|
674
|
+
# GRPC transcoding helper method for the import_documents REST call
|
675
|
+
#
|
676
|
+
# @param request_pb [::Google::Cloud::Firestore::Admin::V1::ImportDocumentsRequest]
|
677
|
+
# A request object representing the call parameters. Required.
|
678
|
+
# @return [Array(String, [String, nil], Hash{String => String})]
|
679
|
+
# Uri, Body, Query string parameters
|
680
|
+
def self.transcode_import_documents_request request_pb
|
681
|
+
transcoder = Gapic::Rest::GrpcTranscoder.new
|
682
|
+
.with_bindings(
|
683
|
+
uri_method: :post,
|
684
|
+
uri_template: "/v1/{name}:importDocuments",
|
685
|
+
body: "*",
|
686
|
+
matches: [
|
687
|
+
["name", %r{^projects/[^/]+/databases/[^/]+/?$}, false]
|
688
|
+
]
|
689
|
+
)
|
690
|
+
transcoder.transcode request_pb
|
691
|
+
end
|
692
|
+
|
693
|
+
##
|
694
|
+
# @private
|
695
|
+
#
|
696
|
+
# GRPC transcoding helper method for the get_database REST call
|
697
|
+
#
|
698
|
+
# @param request_pb [::Google::Cloud::Firestore::Admin::V1::GetDatabaseRequest]
|
699
|
+
# A request object representing the call parameters. Required.
|
700
|
+
# @return [Array(String, [String, nil], Hash{String => String})]
|
701
|
+
# Uri, Body, Query string parameters
|
702
|
+
def self.transcode_get_database_request request_pb
|
703
|
+
transcoder = Gapic::Rest::GrpcTranscoder.new
|
704
|
+
.with_bindings(
|
705
|
+
uri_method: :get,
|
706
|
+
uri_template: "/v1/{name}",
|
707
|
+
matches: [
|
708
|
+
["name", %r{^projects/[^/]+/databases/[^/]+/?$}, false]
|
709
|
+
]
|
710
|
+
)
|
711
|
+
transcoder.transcode request_pb
|
712
|
+
end
|
713
|
+
|
714
|
+
##
|
715
|
+
# @private
|
716
|
+
#
|
717
|
+
# GRPC transcoding helper method for the list_databases REST call
|
718
|
+
#
|
719
|
+
# @param request_pb [::Google::Cloud::Firestore::Admin::V1::ListDatabasesRequest]
|
720
|
+
# A request object representing the call parameters. Required.
|
721
|
+
# @return [Array(String, [String, nil], Hash{String => String})]
|
722
|
+
# Uri, Body, Query string parameters
|
723
|
+
def self.transcode_list_databases_request request_pb
|
724
|
+
transcoder = Gapic::Rest::GrpcTranscoder.new
|
725
|
+
.with_bindings(
|
726
|
+
uri_method: :get,
|
727
|
+
uri_template: "/v1/{parent}/databases",
|
728
|
+
matches: [
|
729
|
+
["parent", %r{^projects/[^/]+/?$}, false]
|
730
|
+
]
|
731
|
+
)
|
732
|
+
transcoder.transcode request_pb
|
733
|
+
end
|
734
|
+
|
735
|
+
##
|
736
|
+
# @private
|
737
|
+
#
|
738
|
+
# GRPC transcoding helper method for the update_database REST call
|
739
|
+
#
|
740
|
+
# @param request_pb [::Google::Cloud::Firestore::Admin::V1::UpdateDatabaseRequest]
|
741
|
+
# A request object representing the call parameters. Required.
|
742
|
+
# @return [Array(String, [String, nil], Hash{String => String})]
|
743
|
+
# Uri, Body, Query string parameters
|
744
|
+
def self.transcode_update_database_request request_pb
|
745
|
+
transcoder = Gapic::Rest::GrpcTranscoder.new
|
746
|
+
.with_bindings(
|
747
|
+
uri_method: :patch,
|
748
|
+
uri_template: "/v1/{database.name}",
|
749
|
+
body: "database",
|
750
|
+
matches: [
|
751
|
+
["database.name", %r{^projects/[^/]+/databases/[^/]+/?$}, false]
|
752
|
+
]
|
753
|
+
)
|
754
|
+
transcoder.transcode request_pb
|
755
|
+
end
|
756
|
+
end
|
757
|
+
end
|
758
|
+
end
|
759
|
+
end
|
760
|
+
end
|
761
|
+
end
|
762
|
+
end
|
763
|
+
end
|