google-cloud-translate-v3 1.1.1 → 1.3.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 +30 -20
- data/lib/google/cloud/translate/v3/adaptive_mt_pb.rb +1 -1
- data/lib/google/cloud/translate/v3/translation_service/client.rb +48 -39
- data/lib/google/cloud/translate/v3/translation_service/operations.rb +12 -15
- data/lib/google/cloud/translate/v3/translation_service/rest/client.rb +48 -39
- data/lib/google/cloud/translate/v3/translation_service/rest/operations.rb +52 -45
- data/lib/google/cloud/translate/v3/translation_service/rest/service_stub.rb +318 -230
- data/lib/google/cloud/translate/v3/translation_service_pb.rb +1 -1
- data/lib/google/cloud/translate/v3/version.rb +1 -1
- data/proto_docs/google/api/client.rb +39 -0
- data/proto_docs/google/cloud/translate/v3/adaptive_mt.rb +4 -0
- data/proto_docs/google/cloud/translate/v3/translation_service.rb +4 -0
- data/proto_docs/google/longrunning/operations.rb +19 -14
- metadata +5 -5
@@ -191,15 +191,27 @@ module Google
|
|
191
191
|
endpoint: @config.endpoint,
|
192
192
|
endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
|
193
193
|
universe_domain: @config.universe_domain,
|
194
|
-
credentials: credentials
|
194
|
+
credentials: credentials,
|
195
|
+
logger: @config.logger
|
195
196
|
)
|
196
197
|
|
198
|
+
@translation_service_stub.logger(stub: true)&.info do |entry|
|
199
|
+
entry.set_system_name
|
200
|
+
entry.set_service
|
201
|
+
entry.message = "Created client for #{entry.service}"
|
202
|
+
entry.set_credentials_fields credentials
|
203
|
+
entry.set "customEndpoint", @config.endpoint if @config.endpoint
|
204
|
+
entry.set "defaultTimeout", @config.timeout if @config.timeout
|
205
|
+
entry.set "quotaProject", @quota_project_id if @quota_project_id
|
206
|
+
end
|
207
|
+
|
197
208
|
@location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config|
|
198
209
|
config.credentials = credentials
|
199
210
|
config.quota_project = @quota_project_id
|
200
211
|
config.endpoint = @translation_service_stub.endpoint
|
201
212
|
config.universe_domain = @translation_service_stub.universe_domain
|
202
213
|
config.bindings_override = @config.bindings_override
|
214
|
+
config.logger = @translation_service_stub.logger if config.respond_to? :logger=
|
203
215
|
end
|
204
216
|
|
205
217
|
@iam_policy_client = Google::Iam::V1::IAMPolicy::Rest::Client.new do |config|
|
@@ -207,6 +219,7 @@ module Google
|
|
207
219
|
config.quota_project = @quota_project_id
|
208
220
|
config.endpoint = @translation_service_stub.endpoint
|
209
221
|
config.universe_domain = @translation_service_stub.universe_domain
|
222
|
+
config.logger = @translation_service_stub.logger if config.respond_to? :logger=
|
210
223
|
end
|
211
224
|
end
|
212
225
|
|
@@ -231,6 +244,15 @@ module Google
|
|
231
244
|
#
|
232
245
|
attr_reader :iam_policy_client
|
233
246
|
|
247
|
+
##
|
248
|
+
# The logger used for request/response debug logging.
|
249
|
+
#
|
250
|
+
# @return [Logger]
|
251
|
+
#
|
252
|
+
def logger
|
253
|
+
@translation_service_stub.logger
|
254
|
+
end
|
255
|
+
|
234
256
|
# Service calls
|
235
257
|
|
236
258
|
##
|
@@ -370,7 +392,6 @@ module Google
|
|
370
392
|
|
371
393
|
@translation_service_stub.translate_text request, options do |result, operation|
|
372
394
|
yield result, operation if block_given?
|
373
|
-
return result
|
374
395
|
end
|
375
396
|
rescue ::Gapic::Rest::Error => e
|
376
397
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -463,7 +484,6 @@ module Google
|
|
463
484
|
|
464
485
|
@translation_service_stub.romanize_text request, options do |result, operation|
|
465
486
|
yield result, operation if block_given?
|
466
|
-
return result
|
467
487
|
end
|
468
488
|
rescue ::Gapic::Rest::Error => e
|
469
489
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -577,7 +597,6 @@ module Google
|
|
577
597
|
|
578
598
|
@translation_service_stub.detect_language request, options do |result, operation|
|
579
599
|
yield result, operation if block_given?
|
580
|
-
return result
|
581
600
|
end
|
582
601
|
rescue ::Gapic::Rest::Error => e
|
583
602
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -686,7 +705,6 @@ module Google
|
|
686
705
|
|
687
706
|
@translation_service_stub.get_supported_languages request, options do |result, operation|
|
688
707
|
yield result, operation if block_given?
|
689
|
-
return result
|
690
708
|
end
|
691
709
|
rescue ::Gapic::Rest::Error => e
|
692
710
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -838,7 +856,6 @@ module Google
|
|
838
856
|
|
839
857
|
@translation_service_stub.translate_document request, options do |result, operation|
|
840
858
|
yield result, operation if block_given?
|
841
|
-
return result
|
842
859
|
end
|
843
860
|
rescue ::Gapic::Rest::Error => e
|
844
861
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -981,7 +998,7 @@ module Google
|
|
981
998
|
@translation_service_stub.batch_translate_text request, options do |result, operation|
|
982
999
|
result = ::Gapic::Operation.new result, @operations_client, options: options
|
983
1000
|
yield result, operation if block_given?
|
984
|
-
|
1001
|
+
throw :response, result
|
985
1002
|
end
|
986
1003
|
rescue ::Gapic::Rest::Error => e
|
987
1004
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -1139,7 +1156,7 @@ module Google
|
|
1139
1156
|
@translation_service_stub.batch_translate_document request, options do |result, operation|
|
1140
1157
|
result = ::Gapic::Operation.new result, @operations_client, options: options
|
1141
1158
|
yield result, operation if block_given?
|
1142
|
-
|
1159
|
+
throw :response, result
|
1143
1160
|
end
|
1144
1161
|
rescue ::Gapic::Rest::Error => e
|
1145
1162
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -1229,7 +1246,7 @@ module Google
|
|
1229
1246
|
@translation_service_stub.create_glossary request, options do |result, operation|
|
1230
1247
|
result = ::Gapic::Operation.new result, @operations_client, options: options
|
1231
1248
|
yield result, operation if block_given?
|
1232
|
-
|
1249
|
+
throw :response, result
|
1233
1250
|
end
|
1234
1251
|
rescue ::Gapic::Rest::Error => e
|
1235
1252
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -1320,7 +1337,7 @@ module Google
|
|
1320
1337
|
@translation_service_stub.update_glossary request, options do |result, operation|
|
1321
1338
|
result = ::Gapic::Operation.new result, @operations_client, options: options
|
1322
1339
|
yield result, operation if block_given?
|
1323
|
-
|
1340
|
+
throw :response, result
|
1324
1341
|
end
|
1325
1342
|
rescue ::Gapic::Rest::Error => e
|
1326
1343
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -1430,7 +1447,7 @@ module Google
|
|
1430
1447
|
@translation_service_stub.list_glossaries request, options do |result, operation|
|
1431
1448
|
result = ::Gapic::Rest::PagedEnumerable.new @translation_service_stub, :list_glossaries, "glossaries", request, result, options
|
1432
1449
|
yield result, operation if block_given?
|
1433
|
-
|
1450
|
+
throw :response, result
|
1434
1451
|
end
|
1435
1452
|
rescue ::Gapic::Rest::Error => e
|
1436
1453
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -1510,7 +1527,6 @@ module Google
|
|
1510
1527
|
|
1511
1528
|
@translation_service_stub.get_glossary request, options do |result, operation|
|
1512
1529
|
yield result, operation if block_given?
|
1513
|
-
return result
|
1514
1530
|
end
|
1515
1531
|
rescue ::Gapic::Rest::Error => e
|
1516
1532
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -1599,7 +1615,7 @@ module Google
|
|
1599
1615
|
@translation_service_stub.delete_glossary request, options do |result, operation|
|
1600
1616
|
result = ::Gapic::Operation.new result, @operations_client, options: options
|
1601
1617
|
yield result, operation if block_given?
|
1602
|
-
|
1618
|
+
throw :response, result
|
1603
1619
|
end
|
1604
1620
|
rescue ::Gapic::Rest::Error => e
|
1605
1621
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -1678,7 +1694,6 @@ module Google
|
|
1678
1694
|
|
1679
1695
|
@translation_service_stub.get_glossary_entry request, options do |result, operation|
|
1680
1696
|
yield result, operation if block_given?
|
1681
|
-
return result
|
1682
1697
|
end
|
1683
1698
|
rescue ::Gapic::Rest::Error => e
|
1684
1699
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -1771,7 +1786,7 @@ module Google
|
|
1771
1786
|
@translation_service_stub.list_glossary_entries request, options do |result, operation|
|
1772
1787
|
result = ::Gapic::Rest::PagedEnumerable.new @translation_service_stub, :list_glossary_entries, "glossary_entries", request, result, options
|
1773
1788
|
yield result, operation if block_given?
|
1774
|
-
|
1789
|
+
throw :response, result
|
1775
1790
|
end
|
1776
1791
|
rescue ::Gapic::Rest::Error => e
|
1777
1792
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -1852,7 +1867,6 @@ module Google
|
|
1852
1867
|
|
1853
1868
|
@translation_service_stub.create_glossary_entry request, options do |result, operation|
|
1854
1869
|
yield result, operation if block_given?
|
1855
|
-
return result
|
1856
1870
|
end
|
1857
1871
|
rescue ::Gapic::Rest::Error => e
|
1858
1872
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -1931,7 +1945,6 @@ module Google
|
|
1931
1945
|
|
1932
1946
|
@translation_service_stub.update_glossary_entry request, options do |result, operation|
|
1933
1947
|
yield result, operation if block_given?
|
1934
|
-
return result
|
1935
1948
|
end
|
1936
1949
|
rescue ::Gapic::Rest::Error => e
|
1937
1950
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -2010,7 +2023,6 @@ module Google
|
|
2010
2023
|
|
2011
2024
|
@translation_service_stub.delete_glossary_entry request, options do |result, operation|
|
2012
2025
|
yield result, operation if block_given?
|
2013
|
-
return result
|
2014
2026
|
end
|
2015
2027
|
rescue ::Gapic::Rest::Error => e
|
2016
2028
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -2099,7 +2111,7 @@ module Google
|
|
2099
2111
|
@translation_service_stub.create_dataset request, options do |result, operation|
|
2100
2112
|
result = ::Gapic::Operation.new result, @operations_client, options: options
|
2101
2113
|
yield result, operation if block_given?
|
2102
|
-
|
2114
|
+
throw :response, result
|
2103
2115
|
end
|
2104
2116
|
rescue ::Gapic::Rest::Error => e
|
2105
2117
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -2178,7 +2190,6 @@ module Google
|
|
2178
2190
|
|
2179
2191
|
@translation_service_stub.get_dataset request, options do |result, operation|
|
2180
2192
|
yield result, operation if block_given?
|
2181
|
-
return result
|
2182
2193
|
end
|
2183
2194
|
rescue ::Gapic::Rest::Error => e
|
2184
2195
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -2270,7 +2281,7 @@ module Google
|
|
2270
2281
|
@translation_service_stub.list_datasets request, options do |result, operation|
|
2271
2282
|
result = ::Gapic::Rest::PagedEnumerable.new @translation_service_stub, :list_datasets, "datasets", request, result, options
|
2272
2283
|
yield result, operation if block_given?
|
2273
|
-
|
2284
|
+
throw :response, result
|
2274
2285
|
end
|
2275
2286
|
rescue ::Gapic::Rest::Error => e
|
2276
2287
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -2357,7 +2368,7 @@ module Google
|
|
2357
2368
|
@translation_service_stub.delete_dataset request, options do |result, operation|
|
2358
2369
|
result = ::Gapic::Operation.new result, @operations_client, options: options
|
2359
2370
|
yield result, operation if block_given?
|
2360
|
-
|
2371
|
+
throw :response, result
|
2361
2372
|
end
|
2362
2373
|
rescue ::Gapic::Rest::Error => e
|
2363
2374
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -2439,7 +2450,6 @@ module Google
|
|
2439
2450
|
|
2440
2451
|
@translation_service_stub.create_adaptive_mt_dataset request, options do |result, operation|
|
2441
2452
|
yield result, operation if block_given?
|
2442
|
-
return result
|
2443
2453
|
end
|
2444
2454
|
rescue ::Gapic::Rest::Error => e
|
2445
2455
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -2520,7 +2530,6 @@ module Google
|
|
2520
2530
|
|
2521
2531
|
@translation_service_stub.delete_adaptive_mt_dataset request, options do |result, operation|
|
2522
2532
|
yield result, operation if block_given?
|
2523
|
-
return result
|
2524
2533
|
end
|
2525
2534
|
rescue ::Gapic::Rest::Error => e
|
2526
2535
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -2600,7 +2609,6 @@ module Google
|
|
2600
2609
|
|
2601
2610
|
@translation_service_stub.get_adaptive_mt_dataset request, options do |result, operation|
|
2602
2611
|
yield result, operation if block_given?
|
2603
|
-
return result
|
2604
2612
|
end
|
2605
2613
|
rescue ::Gapic::Rest::Error => e
|
2606
2614
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -2697,7 +2705,7 @@ module Google
|
|
2697
2705
|
@translation_service_stub.list_adaptive_mt_datasets request, options do |result, operation|
|
2698
2706
|
result = ::Gapic::Rest::PagedEnumerable.new @translation_service_stub, :list_adaptive_mt_datasets, "adaptive_mt_datasets", request, result, options
|
2699
2707
|
yield result, operation if block_given?
|
2700
|
-
|
2708
|
+
throw :response, result
|
2701
2709
|
end
|
2702
2710
|
rescue ::Gapic::Rest::Error => e
|
2703
2711
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -2789,7 +2797,6 @@ module Google
|
|
2789
2797
|
|
2790
2798
|
@translation_service_stub.adaptive_mt_translate request, options do |result, operation|
|
2791
2799
|
yield result, operation if block_given?
|
2792
|
-
return result
|
2793
2800
|
end
|
2794
2801
|
rescue ::Gapic::Rest::Error => e
|
2795
2802
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -2869,7 +2876,6 @@ module Google
|
|
2869
2876
|
|
2870
2877
|
@translation_service_stub.get_adaptive_mt_file request, options do |result, operation|
|
2871
2878
|
yield result, operation if block_given?
|
2872
|
-
return result
|
2873
2879
|
end
|
2874
2880
|
rescue ::Gapic::Rest::Error => e
|
2875
2881
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -2949,7 +2955,6 @@ module Google
|
|
2949
2955
|
|
2950
2956
|
@translation_service_stub.delete_adaptive_mt_file request, options do |result, operation|
|
2951
2957
|
yield result, operation if block_given?
|
2952
|
-
return result
|
2953
2958
|
end
|
2954
2959
|
rescue ::Gapic::Rest::Error => e
|
2955
2960
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -3034,7 +3039,6 @@ module Google
|
|
3034
3039
|
|
3035
3040
|
@translation_service_stub.import_adaptive_mt_file request, options do |result, operation|
|
3036
3041
|
yield result, operation if block_given?
|
3037
|
-
return result
|
3038
3042
|
end
|
3039
3043
|
rescue ::Gapic::Rest::Error => e
|
3040
3044
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -3128,7 +3132,7 @@ module Google
|
|
3128
3132
|
@translation_service_stub.list_adaptive_mt_files request, options do |result, operation|
|
3129
3133
|
result = ::Gapic::Rest::PagedEnumerable.new @translation_service_stub, :list_adaptive_mt_files, "adaptive_mt_files", request, result, options
|
3130
3134
|
yield result, operation if block_given?
|
3131
|
-
|
3135
|
+
throw :response, result
|
3132
3136
|
end
|
3133
3137
|
rescue ::Gapic::Rest::Error => e
|
3134
3138
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -3223,7 +3227,7 @@ module Google
|
|
3223
3227
|
@translation_service_stub.list_adaptive_mt_sentences request, options do |result, operation|
|
3224
3228
|
result = ::Gapic::Rest::PagedEnumerable.new @translation_service_stub, :list_adaptive_mt_sentences, "adaptive_mt_sentences", request, result, options
|
3225
3229
|
yield result, operation if block_given?
|
3226
|
-
|
3230
|
+
throw :response, result
|
3227
3231
|
end
|
3228
3232
|
rescue ::Gapic::Rest::Error => e
|
3229
3233
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -3313,7 +3317,7 @@ module Google
|
|
3313
3317
|
@translation_service_stub.import_data request, options do |result, operation|
|
3314
3318
|
result = ::Gapic::Operation.new result, @operations_client, options: options
|
3315
3319
|
yield result, operation if block_given?
|
3316
|
-
|
3320
|
+
throw :response, result
|
3317
3321
|
end
|
3318
3322
|
rescue ::Gapic::Rest::Error => e
|
3319
3323
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -3403,7 +3407,7 @@ module Google
|
|
3403
3407
|
@translation_service_stub.export_data request, options do |result, operation|
|
3404
3408
|
result = ::Gapic::Operation.new result, @operations_client, options: options
|
3405
3409
|
yield result, operation if block_given?
|
3406
|
-
|
3410
|
+
throw :response, result
|
3407
3411
|
end
|
3408
3412
|
rescue ::Gapic::Rest::Error => e
|
3409
3413
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -3499,7 +3503,7 @@ module Google
|
|
3499
3503
|
@translation_service_stub.list_examples request, options do |result, operation|
|
3500
3504
|
result = ::Gapic::Rest::PagedEnumerable.new @translation_service_stub, :list_examples, "examples", request, result, options
|
3501
3505
|
yield result, operation if block_given?
|
3502
|
-
|
3506
|
+
throw :response, result
|
3503
3507
|
end
|
3504
3508
|
rescue ::Gapic::Rest::Error => e
|
3505
3509
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -3589,7 +3593,7 @@ module Google
|
|
3589
3593
|
@translation_service_stub.create_model request, options do |result, operation|
|
3590
3594
|
result = ::Gapic::Operation.new result, @operations_client, options: options
|
3591
3595
|
yield result, operation if block_given?
|
3592
|
-
|
3596
|
+
throw :response, result
|
3593
3597
|
end
|
3594
3598
|
rescue ::Gapic::Rest::Error => e
|
3595
3599
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -3685,7 +3689,7 @@ module Google
|
|
3685
3689
|
@translation_service_stub.list_models request, options do |result, operation|
|
3686
3690
|
result = ::Gapic::Rest::PagedEnumerable.new @translation_service_stub, :list_models, "models", request, result, options
|
3687
3691
|
yield result, operation if block_given?
|
3688
|
-
|
3692
|
+
throw :response, result
|
3689
3693
|
end
|
3690
3694
|
rescue ::Gapic::Rest::Error => e
|
3691
3695
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -3764,7 +3768,6 @@ module Google
|
|
3764
3768
|
|
3765
3769
|
@translation_service_stub.get_model request, options do |result, operation|
|
3766
3770
|
yield result, operation if block_given?
|
3767
|
-
return result
|
3768
3771
|
end
|
3769
3772
|
rescue ::Gapic::Rest::Error => e
|
3770
3773
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -3851,7 +3854,7 @@ module Google
|
|
3851
3854
|
@translation_service_stub.delete_model request, options do |result, operation|
|
3852
3855
|
result = ::Gapic::Operation.new result, @operations_client, options: options
|
3853
3856
|
yield result, operation if block_given?
|
3854
|
-
|
3857
|
+
throw :response, result
|
3855
3858
|
end
|
3856
3859
|
rescue ::Gapic::Rest::Error => e
|
3857
3860
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -3931,6 +3934,11 @@ module Google
|
|
3931
3934
|
# default endpoint URL. The default value of nil uses the environment
|
3932
3935
|
# universe (usually the default "googleapis.com" universe).
|
3933
3936
|
# @return [::String,nil]
|
3937
|
+
# @!attribute [rw] logger
|
3938
|
+
# A custom logger to use for request/response debug logging, or the value
|
3939
|
+
# `:default` (the default) to construct a default logger, or `nil` to
|
3940
|
+
# explicitly disable logging.
|
3941
|
+
# @return [::Logger,:default,nil]
|
3934
3942
|
#
|
3935
3943
|
class Configuration
|
3936
3944
|
extend ::Gapic::Config
|
@@ -3959,6 +3967,7 @@ module Google
|
|
3959
3967
|
# by the host service.
|
3960
3968
|
# @return [::Hash{::Symbol=>::Array<::Gapic::Rest::GrpcTranscoder::HttpBinding>}]
|
3961
3969
|
config_attr :bindings_override, {}, ::Hash, nil
|
3970
|
+
config_attr :logger, :default, ::Logger, nil, :default
|
3962
3971
|
|
3963
3972
|
# @private
|
3964
3973
|
def initialize parent_config = nil
|
@@ -115,14 +115,6 @@ module Google
|
|
115
115
|
# Lists operations that match the specified filter in the request. If the
|
116
116
|
# server doesn't support this method, it returns `UNIMPLEMENTED`.
|
117
117
|
#
|
118
|
-
# NOTE: the `name` binding allows API services to override the binding
|
119
|
-
# to use different resource name schemes, such as `users/*/operations`. To
|
120
|
-
# override the binding, API services can add a binding such as
|
121
|
-
# `"/v1/{name=users/*}/operations"` to their service configuration.
|
122
|
-
# For backwards compatibility, the default name includes the operations
|
123
|
-
# collection id, however overriding users must ensure the name binding
|
124
|
-
# is the parent resource, without the operations collection id.
|
125
|
-
#
|
126
118
|
# @overload list_operations(request, options = nil)
|
127
119
|
# Pass arguments to `list_operations` via a request object, either of type
|
128
120
|
# {::Google::Longrunning::ListOperationsRequest} or an equivalent Hash.
|
@@ -204,7 +196,7 @@ module Google
|
|
204
196
|
@operations_stub.list_operations request, options do |result, operation|
|
205
197
|
result = ::Gapic::Rest::PagedEnumerable.new @operations_stub, :list_operations, "operations", request, result, options
|
206
198
|
yield result, operation if block_given?
|
207
|
-
|
199
|
+
throw :response, result
|
208
200
|
end
|
209
201
|
rescue ::Gapic::Rest::Error => e
|
210
202
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -293,7 +285,7 @@ module Google
|
|
293
285
|
@operations_stub.get_operation request, options do |result, operation|
|
294
286
|
result = ::Gapic::Operation.new result, @operations_client, options: options
|
295
287
|
yield result, operation if block_given?
|
296
|
-
|
288
|
+
throw :response, result
|
297
289
|
end
|
298
290
|
rescue ::Gapic::Rest::Error => e
|
299
291
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -375,7 +367,6 @@ module Google
|
|
375
367
|
|
376
368
|
@operations_stub.delete_operation request, options do |result, operation|
|
377
369
|
yield result, operation if block_given?
|
378
|
-
return result
|
379
370
|
end
|
380
371
|
rescue ::Gapic::Rest::Error => e
|
381
372
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -390,8 +381,9 @@ module Google
|
|
390
381
|
# other methods to check whether the cancellation succeeded or whether the
|
391
382
|
# operation completed despite cancellation. On successful cancellation,
|
392
383
|
# the operation is not deleted; instead, it becomes an operation with
|
393
|
-
# an {::Google::Longrunning::Operation#error Operation.error} value with a
|
394
|
-
# corresponding to
|
384
|
+
# an {::Google::Longrunning::Operation#error Operation.error} value with a
|
385
|
+
# {::Google::Rpc::Status#code google.rpc.Status.code} of `1`, corresponding to
|
386
|
+
# `Code.CANCELLED`.
|
395
387
|
#
|
396
388
|
# @overload cancel_operation(request, options = nil)
|
397
389
|
# Pass arguments to `cancel_operation` via a request object, either of type
|
@@ -463,7 +455,6 @@ module Google
|
|
463
455
|
|
464
456
|
@operations_stub.cancel_operation request, options do |result, operation|
|
465
457
|
yield result, operation if block_given?
|
466
|
-
return result
|
467
458
|
end
|
468
459
|
rescue ::Gapic::Rest::Error => e
|
469
460
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -562,7 +553,7 @@ module Google
|
|
562
553
|
@operations_stub.wait_operation request, options do |result, operation|
|
563
554
|
result = ::Gapic::Operation.new result, @operations_client, options: options
|
564
555
|
yield result, operation if block_given?
|
565
|
-
|
556
|
+
throw :response, result
|
566
557
|
end
|
567
558
|
rescue ::Gapic::Rest::Error => e
|
568
559
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -642,6 +633,11 @@ module Google
|
|
642
633
|
# default endpoint URL. The default value of nil uses the environment
|
643
634
|
# universe (usually the default "googleapis.com" universe).
|
644
635
|
# @return [::String,nil]
|
636
|
+
# @!attribute [rw] logger
|
637
|
+
# A custom logger to use for request/response debug logging, or the value
|
638
|
+
# `:default` (the default) to construct a default logger, or `nil` to
|
639
|
+
# explicitly disable logging.
|
640
|
+
# @return [::Logger,:default,nil]
|
645
641
|
#
|
646
642
|
class Configuration
|
647
643
|
extend ::Gapic::Config
|
@@ -663,6 +659,7 @@ module Google
|
|
663
659
|
config_attr :retry_policy, nil, ::Hash, ::Proc, nil
|
664
660
|
config_attr :quota_project, nil, ::String, nil
|
665
661
|
config_attr :universe_domain, nil, ::String, nil
|
662
|
+
config_attr :logger, :default, ::Logger, nil, :default
|
666
663
|
|
667
664
|
# @private
|
668
665
|
def initialize parent_config = nil
|
@@ -789,16 +786,18 @@ module Google
|
|
789
786
|
|
790
787
|
response = @client_stub.make_http_request(
|
791
788
|
verb,
|
792
|
-
uri:
|
793
|
-
body:
|
794
|
-
params:
|
789
|
+
uri: uri,
|
790
|
+
body: body || "",
|
791
|
+
params: query_string_params,
|
792
|
+
method_name: "list_operations",
|
795
793
|
options: options
|
796
794
|
)
|
797
795
|
operation = ::Gapic::Rest::TransportOperation.new response
|
798
796
|
result = ::Google::Longrunning::ListOperationsResponse.decode_json response.body, ignore_unknown_fields: true
|
799
|
-
|
800
|
-
|
801
|
-
|
797
|
+
catch :response do
|
798
|
+
yield result, operation if block_given?
|
799
|
+
result
|
800
|
+
end
|
802
801
|
end
|
803
802
|
|
804
803
|
##
|
@@ -827,16 +826,18 @@ module Google
|
|
827
826
|
|
828
827
|
response = @client_stub.make_http_request(
|
829
828
|
verb,
|
830
|
-
uri:
|
831
|
-
body:
|
832
|
-
params:
|
829
|
+
uri: uri,
|
830
|
+
body: body || "",
|
831
|
+
params: query_string_params,
|
832
|
+
method_name: "get_operation",
|
833
833
|
options: options
|
834
834
|
)
|
835
835
|
operation = ::Gapic::Rest::TransportOperation.new response
|
836
836
|
result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true
|
837
|
-
|
838
|
-
|
839
|
-
|
837
|
+
catch :response do
|
838
|
+
yield result, operation if block_given?
|
839
|
+
result
|
840
|
+
end
|
840
841
|
end
|
841
842
|
|
842
843
|
##
|
@@ -865,16 +866,18 @@ module Google
|
|
865
866
|
|
866
867
|
response = @client_stub.make_http_request(
|
867
868
|
verb,
|
868
|
-
uri:
|
869
|
-
body:
|
870
|
-
params:
|
869
|
+
uri: uri,
|
870
|
+
body: body || "",
|
871
|
+
params: query_string_params,
|
872
|
+
method_name: "delete_operation",
|
871
873
|
options: options
|
872
874
|
)
|
873
875
|
operation = ::Gapic::Rest::TransportOperation.new response
|
874
876
|
result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true
|
875
|
-
|
876
|
-
|
877
|
-
|
877
|
+
catch :response do
|
878
|
+
yield result, operation if block_given?
|
879
|
+
result
|
880
|
+
end
|
878
881
|
end
|
879
882
|
|
880
883
|
##
|
@@ -903,16 +906,18 @@ module Google
|
|
903
906
|
|
904
907
|
response = @client_stub.make_http_request(
|
905
908
|
verb,
|
906
|
-
uri:
|
907
|
-
body:
|
908
|
-
params:
|
909
|
+
uri: uri,
|
910
|
+
body: body || "",
|
911
|
+
params: query_string_params,
|
912
|
+
method_name: "cancel_operation",
|
909
913
|
options: options
|
910
914
|
)
|
911
915
|
operation = ::Gapic::Rest::TransportOperation.new response
|
912
916
|
result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true
|
913
|
-
|
914
|
-
|
915
|
-
|
917
|
+
catch :response do
|
918
|
+
yield result, operation if block_given?
|
919
|
+
result
|
920
|
+
end
|
916
921
|
end
|
917
922
|
|
918
923
|
##
|
@@ -941,16 +946,18 @@ module Google
|
|
941
946
|
|
942
947
|
response = @client_stub.make_http_request(
|
943
948
|
verb,
|
944
|
-
uri:
|
945
|
-
body:
|
946
|
-
params:
|
949
|
+
uri: uri,
|
950
|
+
body: body || "",
|
951
|
+
params: query_string_params,
|
952
|
+
method_name: "wait_operation",
|
947
953
|
options: options
|
948
954
|
)
|
949
955
|
operation = ::Gapic::Rest::TransportOperation.new response
|
950
956
|
result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true
|
951
|
-
|
952
|
-
|
953
|
-
|
957
|
+
catch :response do
|
958
|
+
yield result, operation if block_given?
|
959
|
+
result
|
960
|
+
end
|
954
961
|
end
|
955
962
|
|
956
963
|
##
|