google-cloud-translate-v3 0.4.0 → 0.4.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/google/cloud/translate/v3/translation_service/client.rb +234 -30
- data/lib/google/cloud/translate/v3/translation_service/operations.rb +115 -12
- data/lib/google/cloud/translate/v3/translation_service_pb.rb +2 -2
- data/lib/google/cloud/translate/v3/translation_service_services_pb.rb +1 -1
- data/lib/google/cloud/translate/v3/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 51835934ad0cc7de98c1f047cecb93f2a99d953a66e4dc570543e7cd10ae6860
|
4
|
+
data.tar.gz: bdb8e9989bb1c7a1d85be2404a0e4860cf52db78e40a8a4fae64c74dc644471d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 939eec2c00e62e7a3342f291c0c33f437a48cc08e94ad6416a4206a4d48168fa664060dbefa8b8ad59facb7fc0770c89647a456acf1897cc1e1886efd21d1d31
|
7
|
+
data.tar.gz: e79c2b3c69fcfa26e8ef2bf0b0c0b8f3600c1978daf8507da880dbb8e925fa43a09872886964b61e3c56e9ba7edf1af3b30e11935560c191bbe8d1bdc2e58a7b
|
@@ -278,6 +278,21 @@ module Google
|
|
278
278
|
#
|
279
279
|
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
280
280
|
#
|
281
|
+
# @example Basic example
|
282
|
+
# require "google/cloud/translate/v3"
|
283
|
+
#
|
284
|
+
# # Create a client object. The client can be reused for multiple calls.
|
285
|
+
# client = Google::Cloud::Translate::V3::TranslationService::Client.new
|
286
|
+
#
|
287
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
288
|
+
# request = Google::Cloud::Translate::V3::TranslateTextRequest.new
|
289
|
+
#
|
290
|
+
# # Call the translate_text method.
|
291
|
+
# result = client.translate_text request
|
292
|
+
#
|
293
|
+
# # The returned object is of type Google::Cloud::Translate::V3::TranslateTextResponse.
|
294
|
+
# p result
|
295
|
+
#
|
281
296
|
def translate_text request, options = nil
|
282
297
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
283
298
|
|
@@ -295,9 +310,11 @@ module Google
|
|
295
310
|
gapic_version: ::Google::Cloud::Translate::V3::VERSION
|
296
311
|
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
297
312
|
|
298
|
-
header_params = {
|
299
|
-
|
300
|
-
|
313
|
+
header_params = {}
|
314
|
+
if request.parent
|
315
|
+
header_params["parent"] = request.parent
|
316
|
+
end
|
317
|
+
|
301
318
|
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
302
319
|
metadata[:"x-goog-request-params"] ||= request_params_header
|
303
320
|
|
@@ -381,6 +398,21 @@ module Google
|
|
381
398
|
#
|
382
399
|
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
383
400
|
#
|
401
|
+
# @example Basic example
|
402
|
+
# require "google/cloud/translate/v3"
|
403
|
+
#
|
404
|
+
# # Create a client object. The client can be reused for multiple calls.
|
405
|
+
# client = Google::Cloud::Translate::V3::TranslationService::Client.new
|
406
|
+
#
|
407
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
408
|
+
# request = Google::Cloud::Translate::V3::DetectLanguageRequest.new
|
409
|
+
#
|
410
|
+
# # Call the detect_language method.
|
411
|
+
# result = client.detect_language request
|
412
|
+
#
|
413
|
+
# # The returned object is of type Google::Cloud::Translate::V3::DetectLanguageResponse.
|
414
|
+
# p result
|
415
|
+
#
|
384
416
|
def detect_language request, options = nil
|
385
417
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
386
418
|
|
@@ -398,9 +430,11 @@ module Google
|
|
398
430
|
gapic_version: ::Google::Cloud::Translate::V3::VERSION
|
399
431
|
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
400
432
|
|
401
|
-
header_params = {
|
402
|
-
|
403
|
-
|
433
|
+
header_params = {}
|
434
|
+
if request.parent
|
435
|
+
header_params["parent"] = request.parent
|
436
|
+
end
|
437
|
+
|
404
438
|
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
405
439
|
metadata[:"x-goog-request-params"] ||= request_params_header
|
406
440
|
|
@@ -479,6 +513,21 @@ module Google
|
|
479
513
|
#
|
480
514
|
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
481
515
|
#
|
516
|
+
# @example Basic example
|
517
|
+
# require "google/cloud/translate/v3"
|
518
|
+
#
|
519
|
+
# # Create a client object. The client can be reused for multiple calls.
|
520
|
+
# client = Google::Cloud::Translate::V3::TranslationService::Client.new
|
521
|
+
#
|
522
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
523
|
+
# request = Google::Cloud::Translate::V3::GetSupportedLanguagesRequest.new
|
524
|
+
#
|
525
|
+
# # Call the get_supported_languages method.
|
526
|
+
# result = client.get_supported_languages request
|
527
|
+
#
|
528
|
+
# # The returned object is of type Google::Cloud::Translate::V3::SupportedLanguages.
|
529
|
+
# p result
|
530
|
+
#
|
482
531
|
def get_supported_languages request, options = nil
|
483
532
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
484
533
|
|
@@ -496,9 +545,11 @@ module Google
|
|
496
545
|
gapic_version: ::Google::Cloud::Translate::V3::VERSION
|
497
546
|
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
498
547
|
|
499
|
-
header_params = {
|
500
|
-
|
501
|
-
|
548
|
+
header_params = {}
|
549
|
+
if request.parent
|
550
|
+
header_params["parent"] = request.parent
|
551
|
+
end
|
552
|
+
|
502
553
|
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
503
554
|
metadata[:"x-goog-request-params"] ||= request_params_header
|
504
555
|
|
@@ -604,6 +655,21 @@ module Google
|
|
604
655
|
#
|
605
656
|
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
606
657
|
#
|
658
|
+
# @example Basic example
|
659
|
+
# require "google/cloud/translate/v3"
|
660
|
+
#
|
661
|
+
# # Create a client object. The client can be reused for multiple calls.
|
662
|
+
# client = Google::Cloud::Translate::V3::TranslationService::Client.new
|
663
|
+
#
|
664
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
665
|
+
# request = Google::Cloud::Translate::V3::TranslateDocumentRequest.new
|
666
|
+
#
|
667
|
+
# # Call the translate_document method.
|
668
|
+
# result = client.translate_document request
|
669
|
+
#
|
670
|
+
# # The returned object is of type Google::Cloud::Translate::V3::TranslateDocumentResponse.
|
671
|
+
# p result
|
672
|
+
#
|
607
673
|
def translate_document request, options = nil
|
608
674
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
609
675
|
|
@@ -621,9 +687,11 @@ module Google
|
|
621
687
|
gapic_version: ::Google::Cloud::Translate::V3::VERSION
|
622
688
|
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
623
689
|
|
624
|
-
header_params = {
|
625
|
-
|
626
|
-
|
690
|
+
header_params = {}
|
691
|
+
if request.parent
|
692
|
+
header_params["parent"] = request.parent
|
693
|
+
end
|
694
|
+
|
627
695
|
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
628
696
|
metadata[:"x-goog-request-params"] ||= request_params_header
|
629
697
|
|
@@ -728,6 +796,28 @@ module Google
|
|
728
796
|
#
|
729
797
|
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
730
798
|
#
|
799
|
+
# @example Basic example
|
800
|
+
# require "google/cloud/translate/v3"
|
801
|
+
#
|
802
|
+
# # Create a client object. The client can be reused for multiple calls.
|
803
|
+
# client = Google::Cloud::Translate::V3::TranslationService::Client.new
|
804
|
+
#
|
805
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
806
|
+
# request = Google::Cloud::Translate::V3::BatchTranslateTextRequest.new
|
807
|
+
#
|
808
|
+
# # Call the batch_translate_text method.
|
809
|
+
# result = client.batch_translate_text request
|
810
|
+
#
|
811
|
+
# # The returned object is of type Gapic::Operation. You can use this
|
812
|
+
# # object to check the status of an operation, cancel it, or wait
|
813
|
+
# # for results. Here is how to block until completion:
|
814
|
+
# result.wait_until_done! timeout: 60
|
815
|
+
# if result.response?
|
816
|
+
# p result.response
|
817
|
+
# else
|
818
|
+
# puts "Error!"
|
819
|
+
# end
|
820
|
+
#
|
731
821
|
def batch_translate_text request, options = nil
|
732
822
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
733
823
|
|
@@ -745,9 +835,11 @@ module Google
|
|
745
835
|
gapic_version: ::Google::Cloud::Translate::V3::VERSION
|
746
836
|
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
747
837
|
|
748
|
-
header_params = {
|
749
|
-
|
750
|
-
|
838
|
+
header_params = {}
|
839
|
+
if request.parent
|
840
|
+
header_params["parent"] = request.parent
|
841
|
+
end
|
842
|
+
|
751
843
|
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
752
844
|
metadata[:"x-goog-request-params"] ||= request_params_header
|
753
845
|
|
@@ -856,6 +948,28 @@ module Google
|
|
856
948
|
#
|
857
949
|
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
858
950
|
#
|
951
|
+
# @example Basic example
|
952
|
+
# require "google/cloud/translate/v3"
|
953
|
+
#
|
954
|
+
# # Create a client object. The client can be reused for multiple calls.
|
955
|
+
# client = Google::Cloud::Translate::V3::TranslationService::Client.new
|
956
|
+
#
|
957
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
958
|
+
# request = Google::Cloud::Translate::V3::BatchTranslateDocumentRequest.new
|
959
|
+
#
|
960
|
+
# # Call the batch_translate_document method.
|
961
|
+
# result = client.batch_translate_document request
|
962
|
+
#
|
963
|
+
# # The returned object is of type Gapic::Operation. You can use this
|
964
|
+
# # object to check the status of an operation, cancel it, or wait
|
965
|
+
# # for results. Here is how to block until completion:
|
966
|
+
# result.wait_until_done! timeout: 60
|
967
|
+
# if result.response?
|
968
|
+
# p result.response
|
969
|
+
# else
|
970
|
+
# puts "Error!"
|
971
|
+
# end
|
972
|
+
#
|
859
973
|
def batch_translate_document request, options = nil
|
860
974
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
861
975
|
|
@@ -873,9 +987,11 @@ module Google
|
|
873
987
|
gapic_version: ::Google::Cloud::Translate::V3::VERSION
|
874
988
|
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
875
989
|
|
876
|
-
header_params = {
|
877
|
-
|
878
|
-
|
990
|
+
header_params = {}
|
991
|
+
if request.parent
|
992
|
+
header_params["parent"] = request.parent
|
993
|
+
end
|
994
|
+
|
879
995
|
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
880
996
|
metadata[:"x-goog-request-params"] ||= request_params_header
|
881
997
|
|
@@ -928,6 +1044,28 @@ module Google
|
|
928
1044
|
#
|
929
1045
|
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
930
1046
|
#
|
1047
|
+
# @example Basic example
|
1048
|
+
# require "google/cloud/translate/v3"
|
1049
|
+
#
|
1050
|
+
# # Create a client object. The client can be reused for multiple calls.
|
1051
|
+
# client = Google::Cloud::Translate::V3::TranslationService::Client.new
|
1052
|
+
#
|
1053
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
1054
|
+
# request = Google::Cloud::Translate::V3::CreateGlossaryRequest.new
|
1055
|
+
#
|
1056
|
+
# # Call the create_glossary method.
|
1057
|
+
# result = client.create_glossary request
|
1058
|
+
#
|
1059
|
+
# # The returned object is of type Gapic::Operation. You can use this
|
1060
|
+
# # object to check the status of an operation, cancel it, or wait
|
1061
|
+
# # for results. Here is how to block until completion:
|
1062
|
+
# result.wait_until_done! timeout: 60
|
1063
|
+
# if result.response?
|
1064
|
+
# p result.response
|
1065
|
+
# else
|
1066
|
+
# puts "Error!"
|
1067
|
+
# end
|
1068
|
+
#
|
931
1069
|
def create_glossary request, options = nil
|
932
1070
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
933
1071
|
|
@@ -945,9 +1083,11 @@ module Google
|
|
945
1083
|
gapic_version: ::Google::Cloud::Translate::V3::VERSION
|
946
1084
|
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
947
1085
|
|
948
|
-
header_params = {
|
949
|
-
|
950
|
-
|
1086
|
+
header_params = {}
|
1087
|
+
if request.parent
|
1088
|
+
header_params["parent"] = request.parent
|
1089
|
+
end
|
1090
|
+
|
951
1091
|
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
952
1092
|
metadata[:"x-goog-request-params"] ||= request_params_header
|
953
1093
|
|
@@ -1023,6 +1163,27 @@ module Google
|
|
1023
1163
|
#
|
1024
1164
|
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
1025
1165
|
#
|
1166
|
+
# @example Basic example
|
1167
|
+
# require "google/cloud/translate/v3"
|
1168
|
+
#
|
1169
|
+
# # Create a client object. The client can be reused for multiple calls.
|
1170
|
+
# client = Google::Cloud::Translate::V3::TranslationService::Client.new
|
1171
|
+
#
|
1172
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
1173
|
+
# request = Google::Cloud::Translate::V3::ListGlossariesRequest.new
|
1174
|
+
#
|
1175
|
+
# # Call the list_glossaries method.
|
1176
|
+
# result = client.list_glossaries request
|
1177
|
+
#
|
1178
|
+
# # The returned object is of type Gapic::PagedEnumerable. You can
|
1179
|
+
# # iterate over all elements by calling #each, and the enumerable
|
1180
|
+
# # will lazily make API calls to fetch subsequent pages. Other
|
1181
|
+
# # methods are also available for managing paging directly.
|
1182
|
+
# result.each do |response|
|
1183
|
+
# # Each element is of type ::Google::Cloud::Translate::V3::Glossary.
|
1184
|
+
# p response
|
1185
|
+
# end
|
1186
|
+
#
|
1026
1187
|
def list_glossaries request, options = nil
|
1027
1188
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
1028
1189
|
|
@@ -1040,9 +1201,11 @@ module Google
|
|
1040
1201
|
gapic_version: ::Google::Cloud::Translate::V3::VERSION
|
1041
1202
|
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
1042
1203
|
|
1043
|
-
header_params = {
|
1044
|
-
|
1045
|
-
|
1204
|
+
header_params = {}
|
1205
|
+
if request.parent
|
1206
|
+
header_params["parent"] = request.parent
|
1207
|
+
end
|
1208
|
+
|
1046
1209
|
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
1047
1210
|
metadata[:"x-goog-request-params"] ||= request_params_header
|
1048
1211
|
|
@@ -1093,6 +1256,21 @@ module Google
|
|
1093
1256
|
#
|
1094
1257
|
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
1095
1258
|
#
|
1259
|
+
# @example Basic example
|
1260
|
+
# require "google/cloud/translate/v3"
|
1261
|
+
#
|
1262
|
+
# # Create a client object. The client can be reused for multiple calls.
|
1263
|
+
# client = Google::Cloud::Translate::V3::TranslationService::Client.new
|
1264
|
+
#
|
1265
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
1266
|
+
# request = Google::Cloud::Translate::V3::GetGlossaryRequest.new
|
1267
|
+
#
|
1268
|
+
# # Call the get_glossary method.
|
1269
|
+
# result = client.get_glossary request
|
1270
|
+
#
|
1271
|
+
# # The returned object is of type Google::Cloud::Translate::V3::Glossary.
|
1272
|
+
# p result
|
1273
|
+
#
|
1096
1274
|
def get_glossary request, options = nil
|
1097
1275
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
1098
1276
|
|
@@ -1110,9 +1288,11 @@ module Google
|
|
1110
1288
|
gapic_version: ::Google::Cloud::Translate::V3::VERSION
|
1111
1289
|
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
1112
1290
|
|
1113
|
-
header_params = {
|
1114
|
-
|
1115
|
-
|
1291
|
+
header_params = {}
|
1292
|
+
if request.name
|
1293
|
+
header_params["name"] = request.name
|
1294
|
+
end
|
1295
|
+
|
1116
1296
|
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
1117
1297
|
metadata[:"x-goog-request-params"] ||= request_params_header
|
1118
1298
|
|
@@ -1163,6 +1343,28 @@ module Google
|
|
1163
1343
|
#
|
1164
1344
|
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
1165
1345
|
#
|
1346
|
+
# @example Basic example
|
1347
|
+
# require "google/cloud/translate/v3"
|
1348
|
+
#
|
1349
|
+
# # Create a client object. The client can be reused for multiple calls.
|
1350
|
+
# client = Google::Cloud::Translate::V3::TranslationService::Client.new
|
1351
|
+
#
|
1352
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
1353
|
+
# request = Google::Cloud::Translate::V3::DeleteGlossaryRequest.new
|
1354
|
+
#
|
1355
|
+
# # Call the delete_glossary method.
|
1356
|
+
# result = client.delete_glossary request
|
1357
|
+
#
|
1358
|
+
# # The returned object is of type Gapic::Operation. You can use this
|
1359
|
+
# # object to check the status of an operation, cancel it, or wait
|
1360
|
+
# # for results. Here is how to block until completion:
|
1361
|
+
# result.wait_until_done! timeout: 60
|
1362
|
+
# if result.response?
|
1363
|
+
# p result.response
|
1364
|
+
# else
|
1365
|
+
# puts "Error!"
|
1366
|
+
# end
|
1367
|
+
#
|
1166
1368
|
def delete_glossary request, options = nil
|
1167
1369
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
1168
1370
|
|
@@ -1180,9 +1382,11 @@ module Google
|
|
1180
1382
|
gapic_version: ::Google::Cloud::Translate::V3::VERSION
|
1181
1383
|
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
1182
1384
|
|
1183
|
-
header_params = {
|
1184
|
-
|
1185
|
-
|
1385
|
+
header_params = {}
|
1386
|
+
if request.name
|
1387
|
+
header_params["name"] = request.name
|
1388
|
+
end
|
1389
|
+
|
1186
1390
|
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
1187
1391
|
metadata[:"x-goog-request-params"] ||= request_params_header
|
1188
1392
|
|
@@ -143,6 +143,27 @@ module Google
|
|
143
143
|
#
|
144
144
|
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
145
145
|
#
|
146
|
+
# @example Basic example
|
147
|
+
# require "google/longrunning"
|
148
|
+
#
|
149
|
+
# # Create a client object. The client can be reused for multiple calls.
|
150
|
+
# client = Google::Longrunning::Operations::Client.new
|
151
|
+
#
|
152
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
153
|
+
# request = Google::Longrunning::ListOperationsRequest.new
|
154
|
+
#
|
155
|
+
# # Call the list_operations method.
|
156
|
+
# result = client.list_operations request
|
157
|
+
#
|
158
|
+
# # The returned object is of type Gapic::PagedEnumerable. You can
|
159
|
+
# # iterate over all elements by calling #each, and the enumerable
|
160
|
+
# # will lazily make API calls to fetch subsequent pages. Other
|
161
|
+
# # methods are also available for managing paging directly.
|
162
|
+
# result.each do |response|
|
163
|
+
# # Each element is of type ::Google::Longrunning::Operation.
|
164
|
+
# p response
|
165
|
+
# end
|
166
|
+
#
|
146
167
|
def list_operations request, options = nil
|
147
168
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
148
169
|
|
@@ -160,9 +181,11 @@ module Google
|
|
160
181
|
gapic_version: ::Google::Cloud::Translate::V3::VERSION
|
161
182
|
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
162
183
|
|
163
|
-
header_params = {
|
164
|
-
|
165
|
-
|
184
|
+
header_params = {}
|
185
|
+
if request.name
|
186
|
+
header_params["name"] = request.name
|
187
|
+
end
|
188
|
+
|
166
189
|
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
167
190
|
metadata[:"x-goog-request-params"] ||= request_params_header
|
168
191
|
|
@@ -215,6 +238,28 @@ module Google
|
|
215
238
|
#
|
216
239
|
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
217
240
|
#
|
241
|
+
# @example Basic example
|
242
|
+
# require "google/longrunning"
|
243
|
+
#
|
244
|
+
# # Create a client object. The client can be reused for multiple calls.
|
245
|
+
# client = Google::Longrunning::Operations::Client.new
|
246
|
+
#
|
247
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
248
|
+
# request = Google::Longrunning::GetOperationRequest.new
|
249
|
+
#
|
250
|
+
# # Call the get_operation method.
|
251
|
+
# result = client.get_operation request
|
252
|
+
#
|
253
|
+
# # The returned object is of type Gapic::Operation. You can use this
|
254
|
+
# # object to check the status of an operation, cancel it, or wait
|
255
|
+
# # for results. Here is how to block until completion:
|
256
|
+
# result.wait_until_done! timeout: 60
|
257
|
+
# if result.response?
|
258
|
+
# p result.response
|
259
|
+
# else
|
260
|
+
# puts "Error!"
|
261
|
+
# end
|
262
|
+
#
|
218
263
|
def get_operation request, options = nil
|
219
264
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
220
265
|
|
@@ -232,9 +277,11 @@ module Google
|
|
232
277
|
gapic_version: ::Google::Cloud::Translate::V3::VERSION
|
233
278
|
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
234
279
|
|
235
|
-
header_params = {
|
236
|
-
|
237
|
-
|
280
|
+
header_params = {}
|
281
|
+
if request.name
|
282
|
+
header_params["name"] = request.name
|
283
|
+
end
|
284
|
+
|
238
285
|
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
239
286
|
metadata[:"x-goog-request-params"] ||= request_params_header
|
240
287
|
|
@@ -287,6 +334,21 @@ module Google
|
|
287
334
|
#
|
288
335
|
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
289
336
|
#
|
337
|
+
# @example Basic example
|
338
|
+
# require "google/longrunning"
|
339
|
+
#
|
340
|
+
# # Create a client object. The client can be reused for multiple calls.
|
341
|
+
# client = Google::Longrunning::Operations::Client.new
|
342
|
+
#
|
343
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
344
|
+
# request = Google::Longrunning::DeleteOperationRequest.new
|
345
|
+
#
|
346
|
+
# # Call the delete_operation method.
|
347
|
+
# result = client.delete_operation request
|
348
|
+
#
|
349
|
+
# # The returned object is of type Google::Protobuf::Empty.
|
350
|
+
# p result
|
351
|
+
#
|
290
352
|
def delete_operation request, options = nil
|
291
353
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
292
354
|
|
@@ -304,9 +366,11 @@ module Google
|
|
304
366
|
gapic_version: ::Google::Cloud::Translate::V3::VERSION
|
305
367
|
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
306
368
|
|
307
|
-
header_params = {
|
308
|
-
|
309
|
-
|
369
|
+
header_params = {}
|
370
|
+
if request.name
|
371
|
+
header_params["name"] = request.name
|
372
|
+
end
|
373
|
+
|
310
374
|
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
311
375
|
metadata[:"x-goog-request-params"] ||= request_params_header
|
312
376
|
|
@@ -364,6 +428,21 @@ module Google
|
|
364
428
|
#
|
365
429
|
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
366
430
|
#
|
431
|
+
# @example Basic example
|
432
|
+
# require "google/longrunning"
|
433
|
+
#
|
434
|
+
# # Create a client object. The client can be reused for multiple calls.
|
435
|
+
# client = Google::Longrunning::Operations::Client.new
|
436
|
+
#
|
437
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
438
|
+
# request = Google::Longrunning::CancelOperationRequest.new
|
439
|
+
#
|
440
|
+
# # Call the cancel_operation method.
|
441
|
+
# result = client.cancel_operation request
|
442
|
+
#
|
443
|
+
# # The returned object is of type Google::Protobuf::Empty.
|
444
|
+
# p result
|
445
|
+
#
|
367
446
|
def cancel_operation request, options = nil
|
368
447
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
369
448
|
|
@@ -381,9 +460,11 @@ module Google
|
|
381
460
|
gapic_version: ::Google::Cloud::Translate::V3::VERSION
|
382
461
|
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
383
462
|
|
384
|
-
header_params = {
|
385
|
-
|
386
|
-
|
463
|
+
header_params = {}
|
464
|
+
if request.name
|
465
|
+
header_params["name"] = request.name
|
466
|
+
end
|
467
|
+
|
387
468
|
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
388
469
|
metadata[:"x-goog-request-params"] ||= request_params_header
|
389
470
|
|
@@ -444,6 +525,28 @@ module Google
|
|
444
525
|
#
|
445
526
|
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
446
527
|
#
|
528
|
+
# @example Basic example
|
529
|
+
# require "google/longrunning"
|
530
|
+
#
|
531
|
+
# # Create a client object. The client can be reused for multiple calls.
|
532
|
+
# client = Google::Longrunning::Operations::Client.new
|
533
|
+
#
|
534
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
535
|
+
# request = Google::Longrunning::WaitOperationRequest.new
|
536
|
+
#
|
537
|
+
# # Call the wait_operation method.
|
538
|
+
# result = client.wait_operation request
|
539
|
+
#
|
540
|
+
# # The returned object is of type Gapic::Operation. You can use this
|
541
|
+
# # object to check the status of an operation, cancel it, or wait
|
542
|
+
# # for results. Here is how to block until completion:
|
543
|
+
# result.wait_until_done! timeout: 60
|
544
|
+
# if result.response?
|
545
|
+
# p result.response
|
546
|
+
# else
|
547
|
+
# puts "Error!"
|
548
|
+
# end
|
549
|
+
#
|
447
550
|
def wait_operation request, options = nil
|
448
551
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
449
552
|
|
@@ -1,8 +1,6 @@
|
|
1
1
|
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
2
2
|
# source: google/cloud/translate/v3/translation_service.proto
|
3
3
|
|
4
|
-
require 'google/protobuf'
|
5
|
-
|
6
4
|
require 'google/api/annotations_pb'
|
7
5
|
require 'google/api/client_pb'
|
8
6
|
require 'google/api/field_behavior_pb'
|
@@ -11,6 +9,8 @@ require 'google/longrunning/operations_pb'
|
|
11
9
|
require 'google/protobuf/empty_pb'
|
12
10
|
require 'google/protobuf/timestamp_pb'
|
13
11
|
require 'google/rpc/status_pb'
|
12
|
+
require 'google/protobuf'
|
13
|
+
|
14
14
|
Google::Protobuf::DescriptorPool.generated_pool.build do
|
15
15
|
add_file("google/cloud/translate/v3/translation_service.proto", :syntax => :proto3) do
|
16
16
|
add_message "google.cloud.translation.v3.TranslateTextGlossaryConfig" do
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: google-cloud-translate-v3
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Google LLC
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-08
|
11
|
+
date: 2021-11-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: gapic-common
|