google-cloud-firestore-admin-v1 1.1.0 → 1.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +30 -20
- data/lib/google/cloud/firestore/admin/v1/firestore_admin/client.rb +39 -25
- data/lib/google/cloud/firestore/admin/v1/firestore_admin/operations.rb +12 -15
- data/lib/google/cloud/firestore/admin/v1/firestore_admin/rest/client.rb +39 -25
- data/lib/google/cloud/firestore/admin/v1/firestore_admin/rest/operations.rb +43 -38
- data/lib/google/cloud/firestore/admin/v1/firestore_admin/rest/service_stub.rb +206 -146
- data/lib/google/cloud/firestore/admin/v1/version.rb +1 -1
- data/proto_docs/google/api/client.rb +39 -0
- data/proto_docs/google/longrunning/operations.rb +19 -14
- metadata +5 -5
@@ -221,14 +221,26 @@ module Google
|
|
221
221
|
endpoint: @config.endpoint,
|
222
222
|
endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
|
223
223
|
universe_domain: @config.universe_domain,
|
224
|
-
credentials: credentials
|
224
|
+
credentials: credentials,
|
225
|
+
logger: @config.logger
|
225
226
|
)
|
226
227
|
|
228
|
+
@firestore_admin_stub.logger(stub: true)&.info do |entry|
|
229
|
+
entry.set_system_name
|
230
|
+
entry.set_service
|
231
|
+
entry.message = "Created client for #{entry.service}"
|
232
|
+
entry.set_credentials_fields credentials
|
233
|
+
entry.set "customEndpoint", @config.endpoint if @config.endpoint
|
234
|
+
entry.set "defaultTimeout", @config.timeout if @config.timeout
|
235
|
+
entry.set "quotaProject", @quota_project_id if @quota_project_id
|
236
|
+
end
|
237
|
+
|
227
238
|
@location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config|
|
228
239
|
config.credentials = credentials
|
229
240
|
config.quota_project = @quota_project_id
|
230
241
|
config.endpoint = @firestore_admin_stub.endpoint
|
231
242
|
config.universe_domain = @firestore_admin_stub.universe_domain
|
243
|
+
config.logger = @firestore_admin_stub.logger if config.respond_to? :logger=
|
232
244
|
end
|
233
245
|
end
|
234
246
|
|
@@ -246,6 +258,15 @@ module Google
|
|
246
258
|
#
|
247
259
|
attr_reader :location_client
|
248
260
|
|
261
|
+
##
|
262
|
+
# The logger used for request/response debug logging.
|
263
|
+
#
|
264
|
+
# @return [Logger]
|
265
|
+
#
|
266
|
+
def logger
|
267
|
+
@firestore_admin_stub.logger
|
268
|
+
end
|
269
|
+
|
249
270
|
# Service calls
|
250
271
|
|
251
272
|
##
|
@@ -336,7 +357,7 @@ module Google
|
|
336
357
|
@firestore_admin_stub.create_index request, options do |result, operation|
|
337
358
|
result = ::Gapic::Operation.new result, @operations_client, options: options
|
338
359
|
yield result, operation if block_given?
|
339
|
-
|
360
|
+
throw :response, result
|
340
361
|
end
|
341
362
|
rescue ::Gapic::Rest::Error => e
|
342
363
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -429,7 +450,7 @@ module Google
|
|
429
450
|
@firestore_admin_stub.list_indexes request, options do |result, operation|
|
430
451
|
result = ::Gapic::Rest::PagedEnumerable.new @firestore_admin_stub, :list_indexes, "indexes", request, result, options
|
431
452
|
yield result, operation if block_given?
|
432
|
-
|
453
|
+
throw :response, result
|
433
454
|
end
|
434
455
|
rescue ::Gapic::Rest::Error => e
|
435
456
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -509,7 +530,6 @@ module Google
|
|
509
530
|
|
510
531
|
@firestore_admin_stub.get_index request, options do |result, operation|
|
511
532
|
yield result, operation if block_given?
|
512
|
-
return result
|
513
533
|
end
|
514
534
|
rescue ::Gapic::Rest::Error => e
|
515
535
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -589,7 +609,6 @@ module Google
|
|
589
609
|
|
590
610
|
@firestore_admin_stub.delete_index request, options do |result, operation|
|
591
611
|
yield result, operation if block_given?
|
592
|
-
return result
|
593
612
|
end
|
594
613
|
rescue ::Gapic::Rest::Error => e
|
595
614
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -669,7 +688,6 @@ module Google
|
|
669
688
|
|
670
689
|
@firestore_admin_stub.get_field request, options do |result, operation|
|
671
690
|
yield result, operation if block_given?
|
672
|
-
return result
|
673
691
|
end
|
674
692
|
rescue ::Gapic::Rest::Error => e
|
675
693
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -774,7 +792,7 @@ module Google
|
|
774
792
|
@firestore_admin_stub.update_field request, options do |result, operation|
|
775
793
|
result = ::Gapic::Operation.new result, @operations_client, options: options
|
776
794
|
yield result, operation if block_given?
|
777
|
-
|
795
|
+
throw :response, result
|
778
796
|
end
|
779
797
|
rescue ::Gapic::Rest::Error => e
|
780
798
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -881,7 +899,7 @@ module Google
|
|
881
899
|
@firestore_admin_stub.list_fields request, options do |result, operation|
|
882
900
|
result = ::Gapic::Rest::PagedEnumerable.new @firestore_admin_stub, :list_fields, "fields", request, result, options
|
883
901
|
yield result, operation if block_given?
|
884
|
-
|
902
|
+
throw :response, result
|
885
903
|
end
|
886
904
|
rescue ::Gapic::Rest::Error => e
|
887
905
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -1006,7 +1024,7 @@ module Google
|
|
1006
1024
|
@firestore_admin_stub.export_documents request, options do |result, operation|
|
1007
1025
|
result = ::Gapic::Operation.new result, @operations_client, options: options
|
1008
1026
|
yield result, operation if block_given?
|
1009
|
-
|
1027
|
+
throw :response, result
|
1010
1028
|
end
|
1011
1029
|
rescue ::Gapic::Rest::Error => e
|
1012
1030
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -1114,7 +1132,7 @@ module Google
|
|
1114
1132
|
@firestore_admin_stub.import_documents request, options do |result, operation|
|
1115
1133
|
result = ::Gapic::Operation.new result, @operations_client, options: options
|
1116
1134
|
yield result, operation if block_given?
|
1117
|
-
|
1135
|
+
throw :response, result
|
1118
1136
|
end
|
1119
1137
|
rescue ::Gapic::Rest::Error => e
|
1120
1138
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -1225,7 +1243,7 @@ module Google
|
|
1225
1243
|
@firestore_admin_stub.bulk_delete_documents request, options do |result, operation|
|
1226
1244
|
result = ::Gapic::Operation.new result, @operations_client, options: options
|
1227
1245
|
yield result, operation if block_given?
|
1228
|
-
|
1246
|
+
throw :response, result
|
1229
1247
|
end
|
1230
1248
|
rescue ::Gapic::Rest::Error => e
|
1231
1249
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -1324,7 +1342,7 @@ module Google
|
|
1324
1342
|
@firestore_admin_stub.create_database request, options do |result, operation|
|
1325
1343
|
result = ::Gapic::Operation.new result, @operations_client, options: options
|
1326
1344
|
yield result, operation if block_given?
|
1327
|
-
|
1345
|
+
throw :response, result
|
1328
1346
|
end
|
1329
1347
|
rescue ::Gapic::Rest::Error => e
|
1330
1348
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -1404,7 +1422,6 @@ module Google
|
|
1404
1422
|
|
1405
1423
|
@firestore_admin_stub.get_database request, options do |result, operation|
|
1406
1424
|
yield result, operation if block_given?
|
1407
|
-
return result
|
1408
1425
|
end
|
1409
1426
|
rescue ::Gapic::Rest::Error => e
|
1410
1427
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -1486,7 +1503,6 @@ module Google
|
|
1486
1503
|
|
1487
1504
|
@firestore_admin_stub.list_databases request, options do |result, operation|
|
1488
1505
|
yield result, operation if block_given?
|
1489
|
-
return result
|
1490
1506
|
end
|
1491
1507
|
rescue ::Gapic::Rest::Error => e
|
1492
1508
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -1575,7 +1591,7 @@ module Google
|
|
1575
1591
|
@firestore_admin_stub.update_database request, options do |result, operation|
|
1576
1592
|
result = ::Gapic::Operation.new result, @operations_client, options: options
|
1577
1593
|
yield result, operation if block_given?
|
1578
|
-
|
1594
|
+
throw :response, result
|
1579
1595
|
end
|
1580
1596
|
rescue ::Gapic::Rest::Error => e
|
1581
1597
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -1667,7 +1683,7 @@ module Google
|
|
1667
1683
|
@firestore_admin_stub.delete_database request, options do |result, operation|
|
1668
1684
|
result = ::Gapic::Operation.new result, @operations_client, options: options
|
1669
1685
|
yield result, operation if block_given?
|
1670
|
-
|
1686
|
+
throw :response, result
|
1671
1687
|
end
|
1672
1688
|
rescue ::Gapic::Rest::Error => e
|
1673
1689
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -1748,7 +1764,6 @@ module Google
|
|
1748
1764
|
|
1749
1765
|
@firestore_admin_stub.get_backup request, options do |result, operation|
|
1750
1766
|
yield result, operation if block_given?
|
1751
|
-
return result
|
1752
1767
|
end
|
1753
1768
|
rescue ::Gapic::Rest::Error => e
|
1754
1769
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -1832,7 +1847,6 @@ module Google
|
|
1832
1847
|
|
1833
1848
|
@firestore_admin_stub.list_backups request, options do |result, operation|
|
1834
1849
|
yield result, operation if block_given?
|
1835
|
-
return result
|
1836
1850
|
end
|
1837
1851
|
rescue ::Gapic::Rest::Error => e
|
1838
1852
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -1913,7 +1927,6 @@ module Google
|
|
1913
1927
|
|
1914
1928
|
@firestore_admin_stub.delete_backup request, options do |result, operation|
|
1915
1929
|
yield result, operation if block_given?
|
1916
|
-
return result
|
1917
1930
|
end
|
1918
1931
|
rescue ::Gapic::Rest::Error => e
|
1919
1932
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -2041,7 +2054,7 @@ module Google
|
|
2041
2054
|
@firestore_admin_stub.restore_database request, options do |result, operation|
|
2042
2055
|
result = ::Gapic::Operation.new result, @operations_client, options: options
|
2043
2056
|
yield result, operation if block_given?
|
2044
|
-
|
2057
|
+
throw :response, result
|
2045
2058
|
end
|
2046
2059
|
rescue ::Gapic::Rest::Error => e
|
2047
2060
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -2126,7 +2139,6 @@ module Google
|
|
2126
2139
|
|
2127
2140
|
@firestore_admin_stub.create_backup_schedule request, options do |result, operation|
|
2128
2141
|
yield result, operation if block_given?
|
2129
|
-
return result
|
2130
2142
|
end
|
2131
2143
|
rescue ::Gapic::Rest::Error => e
|
2132
2144
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -2208,7 +2220,6 @@ module Google
|
|
2208
2220
|
|
2209
2221
|
@firestore_admin_stub.get_backup_schedule request, options do |result, operation|
|
2210
2222
|
yield result, operation if block_given?
|
2211
|
-
return result
|
2212
2223
|
end
|
2213
2224
|
rescue ::Gapic::Rest::Error => e
|
2214
2225
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -2289,7 +2300,6 @@ module Google
|
|
2289
2300
|
|
2290
2301
|
@firestore_admin_stub.list_backup_schedules request, options do |result, operation|
|
2291
2302
|
yield result, operation if block_given?
|
2292
|
-
return result
|
2293
2303
|
end
|
2294
2304
|
rescue ::Gapic::Rest::Error => e
|
2295
2305
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -2370,7 +2380,6 @@ module Google
|
|
2370
2380
|
|
2371
2381
|
@firestore_admin_stub.update_backup_schedule request, options do |result, operation|
|
2372
2382
|
yield result, operation if block_given?
|
2373
|
-
return result
|
2374
2383
|
end
|
2375
2384
|
rescue ::Gapic::Rest::Error => e
|
2376
2385
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -2452,7 +2461,6 @@ module Google
|
|
2452
2461
|
|
2453
2462
|
@firestore_admin_stub.delete_backup_schedule request, options do |result, operation|
|
2454
2463
|
yield result, operation if block_given?
|
2455
|
-
return result
|
2456
2464
|
end
|
2457
2465
|
rescue ::Gapic::Rest::Error => e
|
2458
2466
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -2532,6 +2540,11 @@ module Google
|
|
2532
2540
|
# default endpoint URL. The default value of nil uses the environment
|
2533
2541
|
# universe (usually the default "googleapis.com" universe).
|
2534
2542
|
# @return [::String,nil]
|
2543
|
+
# @!attribute [rw] logger
|
2544
|
+
# A custom logger to use for request/response debug logging, or the value
|
2545
|
+
# `:default` (the default) to construct a default logger, or `nil` to
|
2546
|
+
# explicitly disable logging.
|
2547
|
+
# @return [::Logger,:default,nil]
|
2535
2548
|
#
|
2536
2549
|
class Configuration
|
2537
2550
|
extend ::Gapic::Config
|
@@ -2553,6 +2566,7 @@ module Google
|
|
2553
2566
|
config_attr :retry_policy, nil, ::Hash, ::Proc, nil
|
2554
2567
|
config_attr :quota_project, nil, ::String, nil
|
2555
2568
|
config_attr :universe_domain, nil, ::String, nil
|
2569
|
+
config_attr :logger, :default, ::Logger, nil, :default
|
2556
2570
|
|
2557
2571
|
# @private
|
2558
2572
|
def initialize parent_config = nil
|
@@ -116,14 +116,6 @@ module Google
|
|
116
116
|
# Lists operations that match the specified filter in the request. If the
|
117
117
|
# server doesn't support this method, it returns `UNIMPLEMENTED`.
|
118
118
|
#
|
119
|
-
# NOTE: the `name` binding allows API services to override the binding
|
120
|
-
# to use different resource name schemes, such as `users/*/operations`. To
|
121
|
-
# override the binding, API services can add a binding such as
|
122
|
-
# `"/v1/{name=users/*}/operations"` to their service configuration.
|
123
|
-
# For backwards compatibility, the default name includes the operations
|
124
|
-
# collection id, however overriding users must ensure the name binding
|
125
|
-
# is the parent resource, without the operations collection id.
|
126
|
-
#
|
127
119
|
# @overload list_operations(request, options = nil)
|
128
120
|
# Pass arguments to `list_operations` via a request object, either of type
|
129
121
|
# {::Google::Longrunning::ListOperationsRequest} or an equivalent Hash.
|
@@ -205,7 +197,7 @@ module Google
|
|
205
197
|
@operations_stub.list_operations request, options do |result, operation|
|
206
198
|
result = ::Gapic::Rest::PagedEnumerable.new @operations_stub, :list_operations, "operations", request, result, options
|
207
199
|
yield result, operation if block_given?
|
208
|
-
|
200
|
+
throw :response, result
|
209
201
|
end
|
210
202
|
rescue ::Gapic::Rest::Error => e
|
211
203
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -294,7 +286,7 @@ module Google
|
|
294
286
|
@operations_stub.get_operation request, options do |result, operation|
|
295
287
|
result = ::Gapic::Operation.new result, @operations_client, options: options
|
296
288
|
yield result, operation if block_given?
|
297
|
-
|
289
|
+
throw :response, result
|
298
290
|
end
|
299
291
|
rescue ::Gapic::Rest::Error => e
|
300
292
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -376,7 +368,6 @@ module Google
|
|
376
368
|
|
377
369
|
@operations_stub.delete_operation request, options do |result, operation|
|
378
370
|
yield result, operation if block_given?
|
379
|
-
return result
|
380
371
|
end
|
381
372
|
rescue ::Gapic::Rest::Error => e
|
382
373
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -391,8 +382,9 @@ module Google
|
|
391
382
|
# other methods to check whether the cancellation succeeded or whether the
|
392
383
|
# operation completed despite cancellation. On successful cancellation,
|
393
384
|
# the operation is not deleted; instead, it becomes an operation with
|
394
|
-
# an {::Google::Longrunning::Operation#error Operation.error} value with a
|
395
|
-
# corresponding to
|
385
|
+
# an {::Google::Longrunning::Operation#error Operation.error} value with a
|
386
|
+
# {::Google::Rpc::Status#code google.rpc.Status.code} of `1`, corresponding to
|
387
|
+
# `Code.CANCELLED`.
|
396
388
|
#
|
397
389
|
# @overload cancel_operation(request, options = nil)
|
398
390
|
# Pass arguments to `cancel_operation` via a request object, either of type
|
@@ -464,7 +456,6 @@ module Google
|
|
464
456
|
|
465
457
|
@operations_stub.cancel_operation request, options do |result, operation|
|
466
458
|
yield result, operation if block_given?
|
467
|
-
return result
|
468
459
|
end
|
469
460
|
rescue ::Gapic::Rest::Error => e
|
470
461
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -544,6 +535,11 @@ module Google
|
|
544
535
|
# default endpoint URL. The default value of nil uses the environment
|
545
536
|
# universe (usually the default "googleapis.com" universe).
|
546
537
|
# @return [::String,nil]
|
538
|
+
# @!attribute [rw] logger
|
539
|
+
# A custom logger to use for request/response debug logging, or the value
|
540
|
+
# `:default` (the default) to construct a default logger, or `nil` to
|
541
|
+
# explicitly disable logging.
|
542
|
+
# @return [::Logger,:default,nil]
|
547
543
|
#
|
548
544
|
class Configuration
|
549
545
|
extend ::Gapic::Config
|
@@ -565,6 +561,7 @@ module Google
|
|
565
561
|
config_attr :retry_policy, nil, ::Hash, ::Proc, nil
|
566
562
|
config_attr :quota_project, nil, ::String, nil
|
567
563
|
config_attr :universe_domain, nil, ::String, nil
|
564
|
+
config_attr :logger, :default, ::Logger, nil, :default
|
568
565
|
|
569
566
|
# @private
|
570
567
|
def initialize parent_config = nil
|
@@ -684,16 +681,18 @@ module Google
|
|
684
681
|
|
685
682
|
response = @client_stub.make_http_request(
|
686
683
|
verb,
|
687
|
-
uri:
|
688
|
-
body:
|
689
|
-
params:
|
684
|
+
uri: uri,
|
685
|
+
body: body || "",
|
686
|
+
params: query_string_params,
|
687
|
+
method_name: "list_operations",
|
690
688
|
options: options
|
691
689
|
)
|
692
690
|
operation = ::Gapic::Rest::TransportOperation.new response
|
693
691
|
result = ::Google::Longrunning::ListOperationsResponse.decode_json response.body, ignore_unknown_fields: true
|
694
|
-
|
695
|
-
|
696
|
-
|
692
|
+
catch :response do
|
693
|
+
yield result, operation if block_given?
|
694
|
+
result
|
695
|
+
end
|
697
696
|
end
|
698
697
|
|
699
698
|
##
|
@@ -722,16 +721,18 @@ module Google
|
|
722
721
|
|
723
722
|
response = @client_stub.make_http_request(
|
724
723
|
verb,
|
725
|
-
uri:
|
726
|
-
body:
|
727
|
-
params:
|
724
|
+
uri: uri,
|
725
|
+
body: body || "",
|
726
|
+
params: query_string_params,
|
727
|
+
method_name: "get_operation",
|
728
728
|
options: options
|
729
729
|
)
|
730
730
|
operation = ::Gapic::Rest::TransportOperation.new response
|
731
731
|
result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true
|
732
|
-
|
733
|
-
|
734
|
-
|
732
|
+
catch :response do
|
733
|
+
yield result, operation if block_given?
|
734
|
+
result
|
735
|
+
end
|
735
736
|
end
|
736
737
|
|
737
738
|
##
|
@@ -760,16 +761,18 @@ module Google
|
|
760
761
|
|
761
762
|
response = @client_stub.make_http_request(
|
762
763
|
verb,
|
763
|
-
uri:
|
764
|
-
body:
|
765
|
-
params:
|
764
|
+
uri: uri,
|
765
|
+
body: body || "",
|
766
|
+
params: query_string_params,
|
767
|
+
method_name: "delete_operation",
|
766
768
|
options: options
|
767
769
|
)
|
768
770
|
operation = ::Gapic::Rest::TransportOperation.new response
|
769
771
|
result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true
|
770
|
-
|
771
|
-
|
772
|
-
|
772
|
+
catch :response do
|
773
|
+
yield result, operation if block_given?
|
774
|
+
result
|
775
|
+
end
|
773
776
|
end
|
774
777
|
|
775
778
|
##
|
@@ -798,16 +801,18 @@ module Google
|
|
798
801
|
|
799
802
|
response = @client_stub.make_http_request(
|
800
803
|
verb,
|
801
|
-
uri:
|
802
|
-
body:
|
803
|
-
params:
|
804
|
+
uri: uri,
|
805
|
+
body: body || "",
|
806
|
+
params: query_string_params,
|
807
|
+
method_name: "cancel_operation",
|
804
808
|
options: options
|
805
809
|
)
|
806
810
|
operation = ::Gapic::Rest::TransportOperation.new response
|
807
811
|
result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true
|
808
|
-
|
809
|
-
|
810
|
-
|
812
|
+
catch :response do
|
813
|
+
yield result, operation if block_given?
|
814
|
+
result
|
815
|
+
end
|
811
816
|
end
|
812
817
|
|
813
818
|
##
|