google-cloud-translate-v3 0.12.0 → 1.1.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/lib/google/cloud/translate/v3/adaptive_mt_pb.rb +5 -1
- data/lib/google/cloud/translate/v3/automl_translation_pb.rb +78 -0
- data/lib/google/cloud/translate/v3/bindings_override.rb +102 -0
- data/lib/google/cloud/translate/v3/common_pb.rb +7 -1
- data/lib/google/cloud/translate/v3/rest.rb +1 -0
- data/lib/google/cloud/translate/v3/translation_service/client.rb +2196 -312
- data/lib/google/cloud/translate/v3/translation_service/operations.rb +13 -5
- data/lib/google/cloud/translate/v3/translation_service/paths.rb +59 -0
- data/lib/google/cloud/translate/v3/translation_service/rest/client.rb +2063 -297
- data/lib/google/cloud/translate/v3/translation_service/rest/operations.rb +13 -5
- data/lib/google/cloud/translate/v3/translation_service/rest/service_stub.rb +1258 -180
- data/lib/google/cloud/translate/v3/translation_service/rest.rb +1 -0
- data/lib/google/cloud/translate/v3/translation_service_pb.rb +21 -3
- data/lib/google/cloud/translate/v3/translation_service_services_pb.rb +37 -0
- data/lib/google/cloud/translate/v3/version.rb +1 -1
- data/proto_docs/google/api/client.rb +18 -10
- data/proto_docs/google/api/resource.rb +7 -2
- data/proto_docs/google/cloud/translate/v3/adaptive_mt.rb +71 -1
- data/proto_docs/google/cloud/translate/v3/automl_translation.rb +487 -0
- data/proto_docs/google/cloud/translate/v3/common.rb +78 -0
- data/proto_docs/google/cloud/translate/v3/translation_service.rb +207 -14
- data/proto_docs/google/protobuf/field_mask.rb +229 -0
- metadata +46 -2
@@ -19,6 +19,8 @@
|
|
19
19
|
require "google/cloud/errors"
|
20
20
|
require "google/cloud/translate/v3/translation_service_pb"
|
21
21
|
require "google/cloud/translate/v3/translation_service/rest/service_stub"
|
22
|
+
require "google/cloud/location/rest"
|
23
|
+
require "google/iam/v1/rest"
|
22
24
|
|
23
25
|
module Google
|
24
26
|
module Cloud
|
@@ -32,6 +34,9 @@ module Google
|
|
32
34
|
# Provides natural language translation operations.
|
33
35
|
#
|
34
36
|
class Client
|
37
|
+
# @private
|
38
|
+
API_VERSION = ""
|
39
|
+
|
35
40
|
# @private
|
36
41
|
DEFAULT_ENDPOINT_TEMPLATE = "translate.$UNIVERSE_DOMAIN$"
|
37
42
|
|
@@ -188,6 +193,21 @@ module Google
|
|
188
193
|
universe_domain: @config.universe_domain,
|
189
194
|
credentials: credentials
|
190
195
|
)
|
196
|
+
|
197
|
+
@location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config|
|
198
|
+
config.credentials = credentials
|
199
|
+
config.quota_project = @quota_project_id
|
200
|
+
config.endpoint = @translation_service_stub.endpoint
|
201
|
+
config.universe_domain = @translation_service_stub.universe_domain
|
202
|
+
config.bindings_override = @config.bindings_override
|
203
|
+
end
|
204
|
+
|
205
|
+
@iam_policy_client = Google::Iam::V1::IAMPolicy::Rest::Client.new do |config|
|
206
|
+
config.credentials = credentials
|
207
|
+
config.quota_project = @quota_project_id
|
208
|
+
config.endpoint = @translation_service_stub.endpoint
|
209
|
+
config.universe_domain = @translation_service_stub.universe_domain
|
210
|
+
end
|
191
211
|
end
|
192
212
|
|
193
213
|
##
|
@@ -197,6 +217,20 @@ module Google
|
|
197
217
|
#
|
198
218
|
attr_reader :operations_client
|
199
219
|
|
220
|
+
##
|
221
|
+
# Get the associated client for mix-in of the Locations.
|
222
|
+
#
|
223
|
+
# @return [Google::Cloud::Location::Locations::Rest::Client]
|
224
|
+
#
|
225
|
+
attr_reader :location_client
|
226
|
+
|
227
|
+
##
|
228
|
+
# Get the associated client for mix-in of the IAMPolicy.
|
229
|
+
#
|
230
|
+
# @return [Google::Iam::V1::IAMPolicy::Rest::Client]
|
231
|
+
#
|
232
|
+
attr_reader :iam_policy_client
|
233
|
+
|
200
234
|
# Service calls
|
201
235
|
|
202
236
|
##
|
@@ -212,7 +246,7 @@ module Google
|
|
212
246
|
# @param options [::Gapic::CallOptions, ::Hash]
|
213
247
|
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
214
248
|
#
|
215
|
-
# @overload translate_text(contents: nil, mime_type: nil, source_language_code: nil, target_language_code: nil, parent: nil, model: nil, glossary_config: nil, labels: nil)
|
249
|
+
# @overload translate_text(contents: nil, mime_type: nil, source_language_code: nil, target_language_code: nil, parent: nil, model: nil, glossary_config: nil, transliteration_config: nil, labels: nil)
|
216
250
|
# Pass arguments to `translate_text` via keyword arguments. Note that at
|
217
251
|
# least one keyword argument is required. To specify no parameters, or to keep all
|
218
252
|
# the default parameter values, pass an empty Hash as a request object (see above).
|
@@ -259,6 +293,8 @@ module Google
|
|
259
293
|
# - General (built-in) models:
|
260
294
|
# `projects/{project-number-or-id}/locations/{location-id}/models/general/nmt`,
|
261
295
|
#
|
296
|
+
# - Translation LLM models:
|
297
|
+
# `projects/{project-number-or-id}/locations/{location-id}/models/general/translation-llm`,
|
262
298
|
#
|
263
299
|
# For global (non-regionalized) requests, use `location-id` `global`.
|
264
300
|
# For example,
|
@@ -269,6 +305,8 @@ module Google
|
|
269
305
|
# Optional. Glossary to be applied. The glossary must be
|
270
306
|
# within the same region (have the same location-id) as the model, otherwise
|
271
307
|
# an INVALID_ARGUMENT (400) error is returned.
|
308
|
+
# @param transliteration_config [::Google::Cloud::Translate::V3::TransliterationConfig, ::Hash]
|
309
|
+
# Optional. Transliteration to be applied.
|
272
310
|
# @param labels [::Hash{::String => ::String}]
|
273
311
|
# Optional. The labels with user-defined metadata for the request.
|
274
312
|
#
|
@@ -313,12 +351,13 @@ module Google
|
|
313
351
|
# Customize the options with defaults
|
314
352
|
call_metadata = @config.rpcs.translate_text.metadata.to_h
|
315
353
|
|
316
|
-
# Set x-goog-api-client
|
354
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
317
355
|
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
318
356
|
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
319
357
|
gapic_version: ::Google::Cloud::Translate::V3::VERSION,
|
320
358
|
transports_version_send: [:rest]
|
321
359
|
|
360
|
+
call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
322
361
|
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
323
362
|
|
324
363
|
options.apply_defaults timeout: @config.rpcs.translate_text.timeout,
|
@@ -337,6 +376,99 @@ module Google
|
|
337
376
|
raise ::Google::Cloud::Error.from_error(e)
|
338
377
|
end
|
339
378
|
|
379
|
+
##
|
380
|
+
# Romanize input text written in non-Latin scripts to Latin text.
|
381
|
+
#
|
382
|
+
# @overload romanize_text(request, options = nil)
|
383
|
+
# Pass arguments to `romanize_text` via a request object, either of type
|
384
|
+
# {::Google::Cloud::Translate::V3::RomanizeTextRequest} or an equivalent Hash.
|
385
|
+
#
|
386
|
+
# @param request [::Google::Cloud::Translate::V3::RomanizeTextRequest, ::Hash]
|
387
|
+
# A request object representing the call parameters. Required. To specify no
|
388
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
389
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
390
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
391
|
+
#
|
392
|
+
# @overload romanize_text(parent: nil, contents: nil, source_language_code: nil)
|
393
|
+
# Pass arguments to `romanize_text` via keyword arguments. Note that at
|
394
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
395
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
396
|
+
#
|
397
|
+
# @param parent [::String]
|
398
|
+
# Required. Project or location to make a call. Must refer to a caller's
|
399
|
+
# project.
|
400
|
+
#
|
401
|
+
# Format: `projects/{project-number-or-id}/locations/{location-id}` or
|
402
|
+
# `projects/{project-number-or-id}`.
|
403
|
+
#
|
404
|
+
# For global calls, use `projects/{project-number-or-id}/locations/global` or
|
405
|
+
# `projects/{project-number-or-id}`.
|
406
|
+
# @param contents [::Array<::String>]
|
407
|
+
# Required. The content of the input in string format.
|
408
|
+
# @param source_language_code [::String]
|
409
|
+
# Optional. The ISO-639 language code of the input text if
|
410
|
+
# known, for example, "hi" or "zh". If the source language isn't specified,
|
411
|
+
# the API attempts to identify the source language automatically and returns
|
412
|
+
# the source language for each content in the response.
|
413
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
414
|
+
# @yieldparam result [::Google::Cloud::Translate::V3::RomanizeTextResponse]
|
415
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
416
|
+
#
|
417
|
+
# @return [::Google::Cloud::Translate::V3::RomanizeTextResponse]
|
418
|
+
#
|
419
|
+
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
420
|
+
#
|
421
|
+
# @example Basic example
|
422
|
+
# require "google/cloud/translate/v3"
|
423
|
+
#
|
424
|
+
# # Create a client object. The client can be reused for multiple calls.
|
425
|
+
# client = Google::Cloud::Translate::V3::TranslationService::Rest::Client.new
|
426
|
+
#
|
427
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
428
|
+
# request = Google::Cloud::Translate::V3::RomanizeTextRequest.new
|
429
|
+
#
|
430
|
+
# # Call the romanize_text method.
|
431
|
+
# result = client.romanize_text request
|
432
|
+
#
|
433
|
+
# # The returned object is of type Google::Cloud::Translate::V3::RomanizeTextResponse.
|
434
|
+
# p result
|
435
|
+
#
|
436
|
+
def romanize_text request, options = nil
|
437
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
438
|
+
|
439
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Translate::V3::RomanizeTextRequest
|
440
|
+
|
441
|
+
# Converts hash and nil to an options object
|
442
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
443
|
+
|
444
|
+
# Customize the options with defaults
|
445
|
+
call_metadata = @config.rpcs.romanize_text.metadata.to_h
|
446
|
+
|
447
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
448
|
+
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
449
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
450
|
+
gapic_version: ::Google::Cloud::Translate::V3::VERSION,
|
451
|
+
transports_version_send: [:rest]
|
452
|
+
|
453
|
+
call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
454
|
+
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
455
|
+
|
456
|
+
options.apply_defaults timeout: @config.rpcs.romanize_text.timeout,
|
457
|
+
metadata: call_metadata,
|
458
|
+
retry_policy: @config.rpcs.romanize_text.retry_policy
|
459
|
+
|
460
|
+
options.apply_defaults timeout: @config.timeout,
|
461
|
+
metadata: @config.metadata,
|
462
|
+
retry_policy: @config.retry_policy
|
463
|
+
|
464
|
+
@translation_service_stub.romanize_text request, options do |result, operation|
|
465
|
+
yield result, operation if block_given?
|
466
|
+
return result
|
467
|
+
end
|
468
|
+
rescue ::Gapic::Rest::Error => e
|
469
|
+
raise ::Google::Cloud::Error.from_error(e)
|
470
|
+
end
|
471
|
+
|
340
472
|
##
|
341
473
|
# Detects the language of text within a request.
|
342
474
|
#
|
@@ -426,12 +558,13 @@ module Google
|
|
426
558
|
# Customize the options with defaults
|
427
559
|
call_metadata = @config.rpcs.detect_language.metadata.to_h
|
428
560
|
|
429
|
-
# Set x-goog-api-client
|
561
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
430
562
|
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
431
563
|
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
432
564
|
gapic_version: ::Google::Cloud::Translate::V3::VERSION,
|
433
565
|
transports_version_send: [:rest]
|
434
566
|
|
567
|
+
call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
435
568
|
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
436
569
|
|
437
570
|
options.apply_defaults timeout: @config.rpcs.detect_language.timeout,
|
@@ -534,12 +667,13 @@ module Google
|
|
534
667
|
# Customize the options with defaults
|
535
668
|
call_metadata = @config.rpcs.get_supported_languages.metadata.to_h
|
536
669
|
|
537
|
-
# Set x-goog-api-client
|
670
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
538
671
|
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
539
672
|
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
540
673
|
gapic_version: ::Google::Cloud::Translate::V3::VERSION,
|
541
674
|
transports_version_send: [:rest]
|
542
675
|
|
676
|
+
call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
543
677
|
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
544
678
|
|
545
679
|
options.apply_defaults timeout: @config.rpcs.get_supported_languages.timeout,
|
@@ -685,12 +819,13 @@ module Google
|
|
685
819
|
# Customize the options with defaults
|
686
820
|
call_metadata = @config.rpcs.translate_document.metadata.to_h
|
687
821
|
|
688
|
-
# Set x-goog-api-client
|
822
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
689
823
|
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
690
824
|
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
691
825
|
gapic_version: ::Google::Cloud::Translate::V3::VERSION,
|
692
826
|
transports_version_send: [:rest]
|
693
827
|
|
828
|
+
call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
694
829
|
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
695
830
|
|
696
831
|
options.apply_defaults timeout: @config.rpcs.translate_document.timeout,
|
@@ -826,12 +961,13 @@ module Google
|
|
826
961
|
# Customize the options with defaults
|
827
962
|
call_metadata = @config.rpcs.batch_translate_text.metadata.to_h
|
828
963
|
|
829
|
-
# Set x-goog-api-client
|
964
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
830
965
|
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
831
966
|
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
832
967
|
gapic_version: ::Google::Cloud::Translate::V3::VERSION,
|
833
968
|
transports_version_send: [:rest]
|
834
969
|
|
970
|
+
call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
835
971
|
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
836
972
|
|
837
973
|
options.apply_defaults timeout: @config.rpcs.batch_translate_text.timeout,
|
@@ -983,12 +1119,13 @@ module Google
|
|
983
1119
|
# Customize the options with defaults
|
984
1120
|
call_metadata = @config.rpcs.batch_translate_document.metadata.to_h
|
985
1121
|
|
986
|
-
# Set x-goog-api-client
|
1122
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
987
1123
|
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
988
1124
|
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
989
1125
|
gapic_version: ::Google::Cloud::Translate::V3::VERSION,
|
990
1126
|
transports_version_send: [:rest]
|
991
1127
|
|
1128
|
+
call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
992
1129
|
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
993
1130
|
|
994
1131
|
options.apply_defaults timeout: @config.rpcs.batch_translate_document.timeout,
|
@@ -1072,12 +1209,13 @@ module Google
|
|
1072
1209
|
# Customize the options with defaults
|
1073
1210
|
call_metadata = @config.rpcs.create_glossary.metadata.to_h
|
1074
1211
|
|
1075
|
-
# Set x-goog-api-client
|
1212
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
1076
1213
|
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
1077
1214
|
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
1078
1215
|
gapic_version: ::Google::Cloud::Translate::V3::VERSION,
|
1079
1216
|
transports_version_send: [:rest]
|
1080
1217
|
|
1218
|
+
call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
1081
1219
|
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
1082
1220
|
|
1083
1221
|
options.apply_defaults timeout: @config.rpcs.create_glossary.timeout,
|
@@ -1097,6 +1235,97 @@ module Google
|
|
1097
1235
|
raise ::Google::Cloud::Error.from_error(e)
|
1098
1236
|
end
|
1099
1237
|
|
1238
|
+
##
|
1239
|
+
# Updates a glossary. A LRO is used since the update can be async if the
|
1240
|
+
# glossary's entry file is updated.
|
1241
|
+
#
|
1242
|
+
# @overload update_glossary(request, options = nil)
|
1243
|
+
# Pass arguments to `update_glossary` via a request object, either of type
|
1244
|
+
# {::Google::Cloud::Translate::V3::UpdateGlossaryRequest} or an equivalent Hash.
|
1245
|
+
#
|
1246
|
+
# @param request [::Google::Cloud::Translate::V3::UpdateGlossaryRequest, ::Hash]
|
1247
|
+
# A request object representing the call parameters. Required. To specify no
|
1248
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
1249
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
1250
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
1251
|
+
#
|
1252
|
+
# @overload update_glossary(glossary: nil, update_mask: nil)
|
1253
|
+
# Pass arguments to `update_glossary` via keyword arguments. Note that at
|
1254
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
1255
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
1256
|
+
#
|
1257
|
+
# @param glossary [::Google::Cloud::Translate::V3::Glossary, ::Hash]
|
1258
|
+
# Required. The glossary entry to update.
|
1259
|
+
# @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
|
1260
|
+
# The list of fields to be updated. Currently only `display_name` and
|
1261
|
+
# 'input_config'
|
1262
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
1263
|
+
# @yieldparam result [::Gapic::Operation]
|
1264
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
1265
|
+
#
|
1266
|
+
# @return [::Gapic::Operation]
|
1267
|
+
#
|
1268
|
+
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
1269
|
+
#
|
1270
|
+
# @example Basic example
|
1271
|
+
# require "google/cloud/translate/v3"
|
1272
|
+
#
|
1273
|
+
# # Create a client object. The client can be reused for multiple calls.
|
1274
|
+
# client = Google::Cloud::Translate::V3::TranslationService::Rest::Client.new
|
1275
|
+
#
|
1276
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
1277
|
+
# request = Google::Cloud::Translate::V3::UpdateGlossaryRequest.new
|
1278
|
+
#
|
1279
|
+
# # Call the update_glossary method.
|
1280
|
+
# result = client.update_glossary request
|
1281
|
+
#
|
1282
|
+
# # The returned object is of type Gapic::Operation. You can use it to
|
1283
|
+
# # check the status of an operation, cancel it, or wait for results.
|
1284
|
+
# # Here is how to wait for a response.
|
1285
|
+
# result.wait_until_done! timeout: 60
|
1286
|
+
# if result.response?
|
1287
|
+
# p result.response
|
1288
|
+
# else
|
1289
|
+
# puts "No response received."
|
1290
|
+
# end
|
1291
|
+
#
|
1292
|
+
def update_glossary request, options = nil
|
1293
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
1294
|
+
|
1295
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Translate::V3::UpdateGlossaryRequest
|
1296
|
+
|
1297
|
+
# Converts hash and nil to an options object
|
1298
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
1299
|
+
|
1300
|
+
# Customize the options with defaults
|
1301
|
+
call_metadata = @config.rpcs.update_glossary.metadata.to_h
|
1302
|
+
|
1303
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
1304
|
+
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
1305
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
1306
|
+
gapic_version: ::Google::Cloud::Translate::V3::VERSION,
|
1307
|
+
transports_version_send: [:rest]
|
1308
|
+
|
1309
|
+
call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
1310
|
+
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
1311
|
+
|
1312
|
+
options.apply_defaults timeout: @config.rpcs.update_glossary.timeout,
|
1313
|
+
metadata: call_metadata,
|
1314
|
+
retry_policy: @config.rpcs.update_glossary.retry_policy
|
1315
|
+
|
1316
|
+
options.apply_defaults timeout: @config.timeout,
|
1317
|
+
metadata: @config.metadata,
|
1318
|
+
retry_policy: @config.retry_policy
|
1319
|
+
|
1320
|
+
@translation_service_stub.update_glossary request, options do |result, operation|
|
1321
|
+
result = ::Gapic::Operation.new result, @operations_client, options: options
|
1322
|
+
yield result, operation if block_given?
|
1323
|
+
return result
|
1324
|
+
end
|
1325
|
+
rescue ::Gapic::Rest::Error => e
|
1326
|
+
raise ::Google::Cloud::Error.from_error(e)
|
1327
|
+
end
|
1328
|
+
|
1100
1329
|
##
|
1101
1330
|
# Lists glossaries in a project. Returns NOT_FOUND, if the project doesn't
|
1102
1331
|
# exist.
|
@@ -1181,12 +1410,13 @@ module Google
|
|
1181
1410
|
# Customize the options with defaults
|
1182
1411
|
call_metadata = @config.rpcs.list_glossaries.metadata.to_h
|
1183
1412
|
|
1184
|
-
# Set x-goog-api-client
|
1413
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
1185
1414
|
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
1186
1415
|
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
1187
1416
|
gapic_version: ::Google::Cloud::Translate::V3::VERSION,
|
1188
1417
|
transports_version_send: [:rest]
|
1189
1418
|
|
1419
|
+
call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
1190
1420
|
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
1191
1421
|
|
1192
1422
|
options.apply_defaults timeout: @config.rpcs.list_glossaries.timeout,
|
@@ -1261,12 +1491,13 @@ module Google
|
|
1261
1491
|
# Customize the options with defaults
|
1262
1492
|
call_metadata = @config.rpcs.get_glossary.metadata.to_h
|
1263
1493
|
|
1264
|
-
# Set x-goog-api-client
|
1494
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
1265
1495
|
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
1266
1496
|
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
1267
1497
|
gapic_version: ::Google::Cloud::Translate::V3::VERSION,
|
1268
1498
|
transports_version_send: [:rest]
|
1269
1499
|
|
1500
|
+
call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
1270
1501
|
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
1271
1502
|
|
1272
1503
|
options.apply_defaults timeout: @config.rpcs.get_glossary.timeout,
|
@@ -1348,12 +1579,13 @@ module Google
|
|
1348
1579
|
# Customize the options with defaults
|
1349
1580
|
call_metadata = @config.rpcs.delete_glossary.metadata.to_h
|
1350
1581
|
|
1351
|
-
# Set x-goog-api-client
|
1582
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
1352
1583
|
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
1353
1584
|
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
1354
1585
|
gapic_version: ::Google::Cloud::Translate::V3::VERSION,
|
1355
1586
|
transports_version_send: [:rest]
|
1356
1587
|
|
1588
|
+
call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
1357
1589
|
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
1358
1590
|
|
1359
1591
|
options.apply_defaults timeout: @config.rpcs.delete_glossary.timeout,
|
@@ -1374,33 +1606,30 @@ module Google
|
|
1374
1606
|
end
|
1375
1607
|
|
1376
1608
|
##
|
1377
|
-
#
|
1609
|
+
# Gets a single glossary entry by the given id.
|
1378
1610
|
#
|
1379
|
-
# @overload
|
1380
|
-
# Pass arguments to `
|
1381
|
-
# {::Google::Cloud::Translate::V3::
|
1611
|
+
# @overload get_glossary_entry(request, options = nil)
|
1612
|
+
# Pass arguments to `get_glossary_entry` via a request object, either of type
|
1613
|
+
# {::Google::Cloud::Translate::V3::GetGlossaryEntryRequest} or an equivalent Hash.
|
1382
1614
|
#
|
1383
|
-
# @param request [::Google::Cloud::Translate::V3::
|
1615
|
+
# @param request [::Google::Cloud::Translate::V3::GetGlossaryEntryRequest, ::Hash]
|
1384
1616
|
# A request object representing the call parameters. Required. To specify no
|
1385
1617
|
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
1386
1618
|
# @param options [::Gapic::CallOptions, ::Hash]
|
1387
1619
|
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
1388
1620
|
#
|
1389
|
-
# @overload
|
1390
|
-
# Pass arguments to `
|
1621
|
+
# @overload get_glossary_entry(name: nil)
|
1622
|
+
# Pass arguments to `get_glossary_entry` via keyword arguments. Note that at
|
1391
1623
|
# least one keyword argument is required. To specify no parameters, or to keep all
|
1392
1624
|
# the default parameter values, pass an empty Hash as a request object (see above).
|
1393
1625
|
#
|
1394
|
-
# @param
|
1395
|
-
# Required.
|
1396
|
-
# `projects/{project-number-or-id}/locations/{location-id}`
|
1397
|
-
# @param adaptive_mt_dataset [::Google::Cloud::Translate::V3::AdaptiveMtDataset, ::Hash]
|
1398
|
-
# Required. The AdaptiveMtDataset to be created.
|
1626
|
+
# @param name [::String]
|
1627
|
+
# Required. The resource name of the glossary entry to get
|
1399
1628
|
# @yield [result, operation] Access the result along with the TransportOperation object
|
1400
|
-
# @yieldparam result [::Google::Cloud::Translate::V3::
|
1629
|
+
# @yieldparam result [::Google::Cloud::Translate::V3::GlossaryEntry]
|
1401
1630
|
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
1402
1631
|
#
|
1403
|
-
# @return [::Google::Cloud::Translate::V3::
|
1632
|
+
# @return [::Google::Cloud::Translate::V3::GlossaryEntry]
|
1404
1633
|
#
|
1405
1634
|
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
1406
1635
|
#
|
@@ -1411,42 +1640,43 @@ module Google
|
|
1411
1640
|
# client = Google::Cloud::Translate::V3::TranslationService::Rest::Client.new
|
1412
1641
|
#
|
1413
1642
|
# # Create a request. To set request fields, pass in keyword arguments.
|
1414
|
-
# request = Google::Cloud::Translate::V3::
|
1643
|
+
# request = Google::Cloud::Translate::V3::GetGlossaryEntryRequest.new
|
1415
1644
|
#
|
1416
|
-
# # Call the
|
1417
|
-
# result = client.
|
1645
|
+
# # Call the get_glossary_entry method.
|
1646
|
+
# result = client.get_glossary_entry request
|
1418
1647
|
#
|
1419
|
-
# # The returned object is of type Google::Cloud::Translate::V3::
|
1648
|
+
# # The returned object is of type Google::Cloud::Translate::V3::GlossaryEntry.
|
1420
1649
|
# p result
|
1421
1650
|
#
|
1422
|
-
def
|
1651
|
+
def get_glossary_entry request, options = nil
|
1423
1652
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
1424
1653
|
|
1425
|
-
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Translate::V3::
|
1654
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Translate::V3::GetGlossaryEntryRequest
|
1426
1655
|
|
1427
1656
|
# Converts hash and nil to an options object
|
1428
1657
|
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
1429
1658
|
|
1430
1659
|
# Customize the options with defaults
|
1431
|
-
call_metadata = @config.rpcs.
|
1660
|
+
call_metadata = @config.rpcs.get_glossary_entry.metadata.to_h
|
1432
1661
|
|
1433
|
-
# Set x-goog-api-client
|
1662
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
1434
1663
|
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
1435
1664
|
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
1436
1665
|
gapic_version: ::Google::Cloud::Translate::V3::VERSION,
|
1437
1666
|
transports_version_send: [:rest]
|
1438
1667
|
|
1668
|
+
call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
1439
1669
|
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
1440
1670
|
|
1441
|
-
options.apply_defaults timeout: @config.rpcs.
|
1671
|
+
options.apply_defaults timeout: @config.rpcs.get_glossary_entry.timeout,
|
1442
1672
|
metadata: call_metadata,
|
1443
|
-
retry_policy: @config.rpcs.
|
1673
|
+
retry_policy: @config.rpcs.get_glossary_entry.retry_policy
|
1444
1674
|
|
1445
1675
|
options.apply_defaults timeout: @config.timeout,
|
1446
1676
|
metadata: @config.metadata,
|
1447
1677
|
retry_policy: @config.retry_policy
|
1448
1678
|
|
1449
|
-
@translation_service_stub.
|
1679
|
+
@translation_service_stub.get_glossary_entry request, options do |result, operation|
|
1450
1680
|
yield result, operation if block_given?
|
1451
1681
|
return result
|
1452
1682
|
end
|
@@ -1455,32 +1685,39 @@ module Google
|
|
1455
1685
|
end
|
1456
1686
|
|
1457
1687
|
##
|
1458
|
-
#
|
1459
|
-
# metadata.
|
1688
|
+
# List the entries for the glossary.
|
1460
1689
|
#
|
1461
|
-
# @overload
|
1462
|
-
# Pass arguments to `
|
1463
|
-
# {::Google::Cloud::Translate::V3::
|
1690
|
+
# @overload list_glossary_entries(request, options = nil)
|
1691
|
+
# Pass arguments to `list_glossary_entries` via a request object, either of type
|
1692
|
+
# {::Google::Cloud::Translate::V3::ListGlossaryEntriesRequest} or an equivalent Hash.
|
1464
1693
|
#
|
1465
|
-
# @param request [::Google::Cloud::Translate::V3::
|
1694
|
+
# @param request [::Google::Cloud::Translate::V3::ListGlossaryEntriesRequest, ::Hash]
|
1466
1695
|
# A request object representing the call parameters. Required. To specify no
|
1467
1696
|
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
1468
1697
|
# @param options [::Gapic::CallOptions, ::Hash]
|
1469
1698
|
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
1470
1699
|
#
|
1471
|
-
# @overload
|
1472
|
-
# Pass arguments to `
|
1700
|
+
# @overload list_glossary_entries(parent: nil, page_size: nil, page_token: nil)
|
1701
|
+
# Pass arguments to `list_glossary_entries` via keyword arguments. Note that at
|
1473
1702
|
# least one keyword argument is required. To specify no parameters, or to keep all
|
1474
1703
|
# the default parameter values, pass an empty Hash as a request object (see above).
|
1475
1704
|
#
|
1476
|
-
# @param
|
1477
|
-
# Required.
|
1478
|
-
#
|
1705
|
+
# @param parent [::String]
|
1706
|
+
# Required. The parent glossary resource name for listing the glossary's
|
1707
|
+
# entries.
|
1708
|
+
# @param page_size [::Integer]
|
1709
|
+
# Optional. Requested page size. The server may return fewer glossary entries
|
1710
|
+
# than requested. If unspecified, the server picks an appropriate default.
|
1711
|
+
# @param page_token [::String]
|
1712
|
+
# Optional. A token identifying a page of results the server should return.
|
1713
|
+
# Typically, this is the value of
|
1714
|
+
# [ListGlossaryEntriesResponse.next_page_token] returned from the previous
|
1715
|
+
# call. The first page is returned if `page_token`is empty or missing.
|
1479
1716
|
# @yield [result, operation] Access the result along with the TransportOperation object
|
1480
|
-
# @yieldparam result [::Google::
|
1717
|
+
# @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Translate::V3::GlossaryEntry>]
|
1481
1718
|
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
1482
1719
|
#
|
1483
|
-
# @return [::Google::
|
1720
|
+
# @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Translate::V3::GlossaryEntry>]
|
1484
1721
|
#
|
1485
1722
|
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
1486
1723
|
#
|
@@ -1491,42 +1728,48 @@ module Google
|
|
1491
1728
|
# client = Google::Cloud::Translate::V3::TranslationService::Rest::Client.new
|
1492
1729
|
#
|
1493
1730
|
# # Create a request. To set request fields, pass in keyword arguments.
|
1494
|
-
# request = Google::Cloud::Translate::V3::
|
1731
|
+
# request = Google::Cloud::Translate::V3::ListGlossaryEntriesRequest.new
|
1495
1732
|
#
|
1496
|
-
# # Call the
|
1497
|
-
# result = client.
|
1733
|
+
# # Call the list_glossary_entries method.
|
1734
|
+
# result = client.list_glossary_entries request
|
1498
1735
|
#
|
1499
|
-
# # The returned object is of type
|
1500
|
-
#
|
1736
|
+
# # The returned object is of type Gapic::PagedEnumerable. You can iterate
|
1737
|
+
# # over elements, and API calls will be issued to fetch pages as needed.
|
1738
|
+
# result.each do |item|
|
1739
|
+
# # Each element is of type ::Google::Cloud::Translate::V3::GlossaryEntry.
|
1740
|
+
# p item
|
1741
|
+
# end
|
1501
1742
|
#
|
1502
|
-
def
|
1743
|
+
def list_glossary_entries request, options = nil
|
1503
1744
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
1504
1745
|
|
1505
|
-
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Translate::V3::
|
1746
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Translate::V3::ListGlossaryEntriesRequest
|
1506
1747
|
|
1507
1748
|
# Converts hash and nil to an options object
|
1508
1749
|
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
1509
1750
|
|
1510
1751
|
# Customize the options with defaults
|
1511
|
-
call_metadata = @config.rpcs.
|
1752
|
+
call_metadata = @config.rpcs.list_glossary_entries.metadata.to_h
|
1512
1753
|
|
1513
|
-
# Set x-goog-api-client
|
1754
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
1514
1755
|
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
1515
1756
|
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
1516
1757
|
gapic_version: ::Google::Cloud::Translate::V3::VERSION,
|
1517
1758
|
transports_version_send: [:rest]
|
1518
1759
|
|
1760
|
+
call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
1519
1761
|
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
1520
1762
|
|
1521
|
-
options.apply_defaults timeout: @config.rpcs.
|
1763
|
+
options.apply_defaults timeout: @config.rpcs.list_glossary_entries.timeout,
|
1522
1764
|
metadata: call_metadata,
|
1523
|
-
retry_policy: @config.rpcs.
|
1765
|
+
retry_policy: @config.rpcs.list_glossary_entries.retry_policy
|
1524
1766
|
|
1525
1767
|
options.apply_defaults timeout: @config.timeout,
|
1526
1768
|
metadata: @config.metadata,
|
1527
1769
|
retry_policy: @config.retry_policy
|
1528
1770
|
|
1529
|
-
@translation_service_stub.
|
1771
|
+
@translation_service_stub.list_glossary_entries request, options do |result, operation|
|
1772
|
+
result = ::Gapic::Rest::PagedEnumerable.new @translation_service_stub, :list_glossary_entries, "glossary_entries", request, result, options
|
1530
1773
|
yield result, operation if block_given?
|
1531
1774
|
return result
|
1532
1775
|
end
|
@@ -1535,31 +1778,32 @@ module Google
|
|
1535
1778
|
end
|
1536
1779
|
|
1537
1780
|
##
|
1538
|
-
#
|
1781
|
+
# Creates a glossary entry.
|
1539
1782
|
#
|
1540
|
-
# @overload
|
1541
|
-
# Pass arguments to `
|
1542
|
-
# {::Google::Cloud::Translate::V3::
|
1783
|
+
# @overload create_glossary_entry(request, options = nil)
|
1784
|
+
# Pass arguments to `create_glossary_entry` via a request object, either of type
|
1785
|
+
# {::Google::Cloud::Translate::V3::CreateGlossaryEntryRequest} or an equivalent Hash.
|
1543
1786
|
#
|
1544
|
-
# @param request [::Google::Cloud::Translate::V3::
|
1787
|
+
# @param request [::Google::Cloud::Translate::V3::CreateGlossaryEntryRequest, ::Hash]
|
1545
1788
|
# A request object representing the call parameters. Required. To specify no
|
1546
1789
|
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
1547
1790
|
# @param options [::Gapic::CallOptions, ::Hash]
|
1548
1791
|
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
1549
1792
|
#
|
1550
|
-
# @overload
|
1551
|
-
# Pass arguments to `
|
1793
|
+
# @overload create_glossary_entry(parent: nil, glossary_entry: nil)
|
1794
|
+
# Pass arguments to `create_glossary_entry` via keyword arguments. Note that at
|
1552
1795
|
# least one keyword argument is required. To specify no parameters, or to keep all
|
1553
1796
|
# the default parameter values, pass an empty Hash as a request object (see above).
|
1554
1797
|
#
|
1555
|
-
# @param
|
1556
|
-
# Required.
|
1557
|
-
#
|
1798
|
+
# @param parent [::String]
|
1799
|
+
# Required. The resource name of the glossary to create the entry under.
|
1800
|
+
# @param glossary_entry [::Google::Cloud::Translate::V3::GlossaryEntry, ::Hash]
|
1801
|
+
# Required. The glossary entry to create
|
1558
1802
|
# @yield [result, operation] Access the result along with the TransportOperation object
|
1559
|
-
# @yieldparam result [::Google::Cloud::Translate::V3::
|
1803
|
+
# @yieldparam result [::Google::Cloud::Translate::V3::GlossaryEntry]
|
1560
1804
|
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
1561
1805
|
#
|
1562
|
-
# @return [::Google::Cloud::Translate::V3::
|
1806
|
+
# @return [::Google::Cloud::Translate::V3::GlossaryEntry]
|
1563
1807
|
#
|
1564
1808
|
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
1565
1809
|
#
|
@@ -1570,42 +1814,43 @@ module Google
|
|
1570
1814
|
# client = Google::Cloud::Translate::V3::TranslationService::Rest::Client.new
|
1571
1815
|
#
|
1572
1816
|
# # Create a request. To set request fields, pass in keyword arguments.
|
1573
|
-
# request = Google::Cloud::Translate::V3::
|
1817
|
+
# request = Google::Cloud::Translate::V3::CreateGlossaryEntryRequest.new
|
1574
1818
|
#
|
1575
|
-
# # Call the
|
1576
|
-
# result = client.
|
1819
|
+
# # Call the create_glossary_entry method.
|
1820
|
+
# result = client.create_glossary_entry request
|
1577
1821
|
#
|
1578
|
-
# # The returned object is of type Google::Cloud::Translate::V3::
|
1822
|
+
# # The returned object is of type Google::Cloud::Translate::V3::GlossaryEntry.
|
1579
1823
|
# p result
|
1580
1824
|
#
|
1581
|
-
def
|
1825
|
+
def create_glossary_entry request, options = nil
|
1582
1826
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
1583
1827
|
|
1584
|
-
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Translate::V3::
|
1828
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Translate::V3::CreateGlossaryEntryRequest
|
1585
1829
|
|
1586
1830
|
# Converts hash and nil to an options object
|
1587
1831
|
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
1588
1832
|
|
1589
1833
|
# Customize the options with defaults
|
1590
|
-
call_metadata = @config.rpcs.
|
1834
|
+
call_metadata = @config.rpcs.create_glossary_entry.metadata.to_h
|
1591
1835
|
|
1592
|
-
# Set x-goog-api-client
|
1836
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
1593
1837
|
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
1594
1838
|
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
1595
1839
|
gapic_version: ::Google::Cloud::Translate::V3::VERSION,
|
1596
1840
|
transports_version_send: [:rest]
|
1597
1841
|
|
1842
|
+
call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
1598
1843
|
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
1599
1844
|
|
1600
|
-
options.apply_defaults timeout: @config.rpcs.
|
1845
|
+
options.apply_defaults timeout: @config.rpcs.create_glossary_entry.timeout,
|
1601
1846
|
metadata: call_metadata,
|
1602
|
-
retry_policy: @config.rpcs.
|
1847
|
+
retry_policy: @config.rpcs.create_glossary_entry.retry_policy
|
1603
1848
|
|
1604
1849
|
options.apply_defaults timeout: @config.timeout,
|
1605
1850
|
metadata: @config.metadata,
|
1606
1851
|
retry_policy: @config.retry_policy
|
1607
1852
|
|
1608
|
-
@translation_service_stub.
|
1853
|
+
@translation_service_stub.create_glossary_entry request, options do |result, operation|
|
1609
1854
|
yield result, operation if block_given?
|
1610
1855
|
return result
|
1611
1856
|
end
|
@@ -1614,43 +1859,1222 @@ module Google
|
|
1614
1859
|
end
|
1615
1860
|
|
1616
1861
|
##
|
1617
|
-
#
|
1862
|
+
# Updates a glossary entry.
|
1618
1863
|
#
|
1619
|
-
# @overload
|
1620
|
-
# Pass arguments to `
|
1621
|
-
# {::Google::Cloud::Translate::V3::
|
1864
|
+
# @overload update_glossary_entry(request, options = nil)
|
1865
|
+
# Pass arguments to `update_glossary_entry` via a request object, either of type
|
1866
|
+
# {::Google::Cloud::Translate::V3::UpdateGlossaryEntryRequest} or an equivalent Hash.
|
1622
1867
|
#
|
1623
|
-
# @param request [::Google::Cloud::Translate::V3::
|
1868
|
+
# @param request [::Google::Cloud::Translate::V3::UpdateGlossaryEntryRequest, ::Hash]
|
1624
1869
|
# A request object representing the call parameters. Required. To specify no
|
1625
1870
|
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
1626
1871
|
# @param options [::Gapic::CallOptions, ::Hash]
|
1627
1872
|
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
1628
1873
|
#
|
1629
|
-
# @overload
|
1630
|
-
# Pass arguments to `
|
1874
|
+
# @overload update_glossary_entry(glossary_entry: nil)
|
1875
|
+
# Pass arguments to `update_glossary_entry` via keyword arguments. Note that at
|
1631
1876
|
# least one keyword argument is required. To specify no parameters, or to keep all
|
1632
1877
|
# the default parameter values, pass an empty Hash as a request object (see above).
|
1633
1878
|
#
|
1634
|
-
# @param
|
1635
|
-
# Required. The
|
1636
|
-
#
|
1637
|
-
#
|
1638
|
-
#
|
1639
|
-
#
|
1640
|
-
#
|
1641
|
-
#
|
1642
|
-
#
|
1643
|
-
#
|
1644
|
-
#
|
1645
|
-
#
|
1879
|
+
# @param glossary_entry [::Google::Cloud::Translate::V3::GlossaryEntry, ::Hash]
|
1880
|
+
# Required. The glossary entry to update.
|
1881
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
1882
|
+
# @yieldparam result [::Google::Cloud::Translate::V3::GlossaryEntry]
|
1883
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
1884
|
+
#
|
1885
|
+
# @return [::Google::Cloud::Translate::V3::GlossaryEntry]
|
1886
|
+
#
|
1887
|
+
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
1888
|
+
#
|
1889
|
+
# @example Basic example
|
1890
|
+
# require "google/cloud/translate/v3"
|
1891
|
+
#
|
1892
|
+
# # Create a client object. The client can be reused for multiple calls.
|
1893
|
+
# client = Google::Cloud::Translate::V3::TranslationService::Rest::Client.new
|
1894
|
+
#
|
1895
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
1896
|
+
# request = Google::Cloud::Translate::V3::UpdateGlossaryEntryRequest.new
|
1897
|
+
#
|
1898
|
+
# # Call the update_glossary_entry method.
|
1899
|
+
# result = client.update_glossary_entry request
|
1900
|
+
#
|
1901
|
+
# # The returned object is of type Google::Cloud::Translate::V3::GlossaryEntry.
|
1902
|
+
# p result
|
1903
|
+
#
|
1904
|
+
def update_glossary_entry request, options = nil
|
1905
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
1906
|
+
|
1907
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Translate::V3::UpdateGlossaryEntryRequest
|
1908
|
+
|
1909
|
+
# Converts hash and nil to an options object
|
1910
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
1911
|
+
|
1912
|
+
# Customize the options with defaults
|
1913
|
+
call_metadata = @config.rpcs.update_glossary_entry.metadata.to_h
|
1914
|
+
|
1915
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
1916
|
+
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
1917
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
1918
|
+
gapic_version: ::Google::Cloud::Translate::V3::VERSION,
|
1919
|
+
transports_version_send: [:rest]
|
1920
|
+
|
1921
|
+
call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
1922
|
+
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
1923
|
+
|
1924
|
+
options.apply_defaults timeout: @config.rpcs.update_glossary_entry.timeout,
|
1925
|
+
metadata: call_metadata,
|
1926
|
+
retry_policy: @config.rpcs.update_glossary_entry.retry_policy
|
1927
|
+
|
1928
|
+
options.apply_defaults timeout: @config.timeout,
|
1929
|
+
metadata: @config.metadata,
|
1930
|
+
retry_policy: @config.retry_policy
|
1931
|
+
|
1932
|
+
@translation_service_stub.update_glossary_entry request, options do |result, operation|
|
1933
|
+
yield result, operation if block_given?
|
1934
|
+
return result
|
1935
|
+
end
|
1936
|
+
rescue ::Gapic::Rest::Error => e
|
1937
|
+
raise ::Google::Cloud::Error.from_error(e)
|
1938
|
+
end
|
1939
|
+
|
1940
|
+
##
|
1941
|
+
# Deletes a single entry from the glossary
|
1942
|
+
#
|
1943
|
+
# @overload delete_glossary_entry(request, options = nil)
|
1944
|
+
# Pass arguments to `delete_glossary_entry` via a request object, either of type
|
1945
|
+
# {::Google::Cloud::Translate::V3::DeleteGlossaryEntryRequest} or an equivalent Hash.
|
1946
|
+
#
|
1947
|
+
# @param request [::Google::Cloud::Translate::V3::DeleteGlossaryEntryRequest, ::Hash]
|
1948
|
+
# A request object representing the call parameters. Required. To specify no
|
1949
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
1950
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
1951
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
1952
|
+
#
|
1953
|
+
# @overload delete_glossary_entry(name: nil)
|
1954
|
+
# Pass arguments to `delete_glossary_entry` via keyword arguments. Note that at
|
1955
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
1956
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
1957
|
+
#
|
1958
|
+
# @param name [::String]
|
1959
|
+
# Required. The resource name of the glossary entry to delete
|
1960
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
1961
|
+
# @yieldparam result [::Google::Protobuf::Empty]
|
1962
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
1963
|
+
#
|
1964
|
+
# @return [::Google::Protobuf::Empty]
|
1965
|
+
#
|
1966
|
+
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
1967
|
+
#
|
1968
|
+
# @example Basic example
|
1969
|
+
# require "google/cloud/translate/v3"
|
1970
|
+
#
|
1971
|
+
# # Create a client object. The client can be reused for multiple calls.
|
1972
|
+
# client = Google::Cloud::Translate::V3::TranslationService::Rest::Client.new
|
1973
|
+
#
|
1974
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
1975
|
+
# request = Google::Cloud::Translate::V3::DeleteGlossaryEntryRequest.new
|
1976
|
+
#
|
1977
|
+
# # Call the delete_glossary_entry method.
|
1978
|
+
# result = client.delete_glossary_entry request
|
1979
|
+
#
|
1980
|
+
# # The returned object is of type Google::Protobuf::Empty.
|
1981
|
+
# p result
|
1982
|
+
#
|
1983
|
+
def delete_glossary_entry request, options = nil
|
1984
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
1985
|
+
|
1986
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Translate::V3::DeleteGlossaryEntryRequest
|
1987
|
+
|
1988
|
+
# Converts hash and nil to an options object
|
1989
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
1990
|
+
|
1991
|
+
# Customize the options with defaults
|
1992
|
+
call_metadata = @config.rpcs.delete_glossary_entry.metadata.to_h
|
1993
|
+
|
1994
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
1995
|
+
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
1996
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
1997
|
+
gapic_version: ::Google::Cloud::Translate::V3::VERSION,
|
1998
|
+
transports_version_send: [:rest]
|
1999
|
+
|
2000
|
+
call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
2001
|
+
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
2002
|
+
|
2003
|
+
options.apply_defaults timeout: @config.rpcs.delete_glossary_entry.timeout,
|
2004
|
+
metadata: call_metadata,
|
2005
|
+
retry_policy: @config.rpcs.delete_glossary_entry.retry_policy
|
2006
|
+
|
2007
|
+
options.apply_defaults timeout: @config.timeout,
|
2008
|
+
metadata: @config.metadata,
|
2009
|
+
retry_policy: @config.retry_policy
|
2010
|
+
|
2011
|
+
@translation_service_stub.delete_glossary_entry request, options do |result, operation|
|
2012
|
+
yield result, operation if block_given?
|
2013
|
+
return result
|
2014
|
+
end
|
2015
|
+
rescue ::Gapic::Rest::Error => e
|
2016
|
+
raise ::Google::Cloud::Error.from_error(e)
|
2017
|
+
end
|
2018
|
+
|
2019
|
+
##
|
2020
|
+
# Creates a Dataset.
|
2021
|
+
#
|
2022
|
+
# @overload create_dataset(request, options = nil)
|
2023
|
+
# Pass arguments to `create_dataset` via a request object, either of type
|
2024
|
+
# {::Google::Cloud::Translate::V3::CreateDatasetRequest} or an equivalent Hash.
|
2025
|
+
#
|
2026
|
+
# @param request [::Google::Cloud::Translate::V3::CreateDatasetRequest, ::Hash]
|
2027
|
+
# A request object representing the call parameters. Required. To specify no
|
2028
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
2029
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
2030
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
2031
|
+
#
|
2032
|
+
# @overload create_dataset(parent: nil, dataset: nil)
|
2033
|
+
# Pass arguments to `create_dataset` via keyword arguments. Note that at
|
2034
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
2035
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
2036
|
+
#
|
2037
|
+
# @param parent [::String]
|
2038
|
+
# Required. The project name.
|
2039
|
+
# @param dataset [::Google::Cloud::Translate::V3::Dataset, ::Hash]
|
2040
|
+
# Required. The Dataset to create.
|
2041
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
2042
|
+
# @yieldparam result [::Gapic::Operation]
|
2043
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
2044
|
+
#
|
2045
|
+
# @return [::Gapic::Operation]
|
2046
|
+
#
|
2047
|
+
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
2048
|
+
#
|
2049
|
+
# @example Basic example
|
2050
|
+
# require "google/cloud/translate/v3"
|
2051
|
+
#
|
2052
|
+
# # Create a client object. The client can be reused for multiple calls.
|
2053
|
+
# client = Google::Cloud::Translate::V3::TranslationService::Rest::Client.new
|
2054
|
+
#
|
2055
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
2056
|
+
# request = Google::Cloud::Translate::V3::CreateDatasetRequest.new
|
2057
|
+
#
|
2058
|
+
# # Call the create_dataset method.
|
2059
|
+
# result = client.create_dataset request
|
2060
|
+
#
|
2061
|
+
# # The returned object is of type Gapic::Operation. You can use it to
|
2062
|
+
# # check the status of an operation, cancel it, or wait for results.
|
2063
|
+
# # Here is how to wait for a response.
|
2064
|
+
# result.wait_until_done! timeout: 60
|
2065
|
+
# if result.response?
|
2066
|
+
# p result.response
|
2067
|
+
# else
|
2068
|
+
# puts "No response received."
|
2069
|
+
# end
|
2070
|
+
#
|
2071
|
+
def create_dataset request, options = nil
|
2072
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
2073
|
+
|
2074
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Translate::V3::CreateDatasetRequest
|
2075
|
+
|
2076
|
+
# Converts hash and nil to an options object
|
2077
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
2078
|
+
|
2079
|
+
# Customize the options with defaults
|
2080
|
+
call_metadata = @config.rpcs.create_dataset.metadata.to_h
|
2081
|
+
|
2082
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
2083
|
+
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
2084
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
2085
|
+
gapic_version: ::Google::Cloud::Translate::V3::VERSION,
|
2086
|
+
transports_version_send: [:rest]
|
2087
|
+
|
2088
|
+
call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
2089
|
+
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
2090
|
+
|
2091
|
+
options.apply_defaults timeout: @config.rpcs.create_dataset.timeout,
|
2092
|
+
metadata: call_metadata,
|
2093
|
+
retry_policy: @config.rpcs.create_dataset.retry_policy
|
2094
|
+
|
2095
|
+
options.apply_defaults timeout: @config.timeout,
|
2096
|
+
metadata: @config.metadata,
|
2097
|
+
retry_policy: @config.retry_policy
|
2098
|
+
|
2099
|
+
@translation_service_stub.create_dataset request, options do |result, operation|
|
2100
|
+
result = ::Gapic::Operation.new result, @operations_client, options: options
|
2101
|
+
yield result, operation if block_given?
|
2102
|
+
return result
|
2103
|
+
end
|
2104
|
+
rescue ::Gapic::Rest::Error => e
|
2105
|
+
raise ::Google::Cloud::Error.from_error(e)
|
2106
|
+
end
|
2107
|
+
|
2108
|
+
##
|
2109
|
+
# Gets a Dataset.
|
2110
|
+
#
|
2111
|
+
# @overload get_dataset(request, options = nil)
|
2112
|
+
# Pass arguments to `get_dataset` via a request object, either of type
|
2113
|
+
# {::Google::Cloud::Translate::V3::GetDatasetRequest} or an equivalent Hash.
|
2114
|
+
#
|
2115
|
+
# @param request [::Google::Cloud::Translate::V3::GetDatasetRequest, ::Hash]
|
2116
|
+
# A request object representing the call parameters. Required. To specify no
|
2117
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
2118
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
2119
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
2120
|
+
#
|
2121
|
+
# @overload get_dataset(name: nil)
|
2122
|
+
# Pass arguments to `get_dataset` via keyword arguments. Note that at
|
2123
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
2124
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
2125
|
+
#
|
2126
|
+
# @param name [::String]
|
2127
|
+
# Required. The resource name of the dataset to retrieve.
|
2128
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
2129
|
+
# @yieldparam result [::Google::Cloud::Translate::V3::Dataset]
|
2130
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
2131
|
+
#
|
2132
|
+
# @return [::Google::Cloud::Translate::V3::Dataset]
|
2133
|
+
#
|
2134
|
+
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
2135
|
+
#
|
2136
|
+
# @example Basic example
|
2137
|
+
# require "google/cloud/translate/v3"
|
2138
|
+
#
|
2139
|
+
# # Create a client object. The client can be reused for multiple calls.
|
2140
|
+
# client = Google::Cloud::Translate::V3::TranslationService::Rest::Client.new
|
2141
|
+
#
|
2142
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
2143
|
+
# request = Google::Cloud::Translate::V3::GetDatasetRequest.new
|
2144
|
+
#
|
2145
|
+
# # Call the get_dataset method.
|
2146
|
+
# result = client.get_dataset request
|
2147
|
+
#
|
2148
|
+
# # The returned object is of type Google::Cloud::Translate::V3::Dataset.
|
2149
|
+
# p result
|
2150
|
+
#
|
2151
|
+
def get_dataset request, options = nil
|
2152
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
2153
|
+
|
2154
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Translate::V3::GetDatasetRequest
|
2155
|
+
|
2156
|
+
# Converts hash and nil to an options object
|
2157
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
2158
|
+
|
2159
|
+
# Customize the options with defaults
|
2160
|
+
call_metadata = @config.rpcs.get_dataset.metadata.to_h
|
2161
|
+
|
2162
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
2163
|
+
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
2164
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
2165
|
+
gapic_version: ::Google::Cloud::Translate::V3::VERSION,
|
2166
|
+
transports_version_send: [:rest]
|
2167
|
+
|
2168
|
+
call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
2169
|
+
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
2170
|
+
|
2171
|
+
options.apply_defaults timeout: @config.rpcs.get_dataset.timeout,
|
2172
|
+
metadata: call_metadata,
|
2173
|
+
retry_policy: @config.rpcs.get_dataset.retry_policy
|
2174
|
+
|
2175
|
+
options.apply_defaults timeout: @config.timeout,
|
2176
|
+
metadata: @config.metadata,
|
2177
|
+
retry_policy: @config.retry_policy
|
2178
|
+
|
2179
|
+
@translation_service_stub.get_dataset request, options do |result, operation|
|
2180
|
+
yield result, operation if block_given?
|
2181
|
+
return result
|
2182
|
+
end
|
2183
|
+
rescue ::Gapic::Rest::Error => e
|
2184
|
+
raise ::Google::Cloud::Error.from_error(e)
|
2185
|
+
end
|
2186
|
+
|
2187
|
+
##
|
2188
|
+
# Lists datasets.
|
2189
|
+
#
|
2190
|
+
# @overload list_datasets(request, options = nil)
|
2191
|
+
# Pass arguments to `list_datasets` via a request object, either of type
|
2192
|
+
# {::Google::Cloud::Translate::V3::ListDatasetsRequest} or an equivalent Hash.
|
2193
|
+
#
|
2194
|
+
# @param request [::Google::Cloud::Translate::V3::ListDatasetsRequest, ::Hash]
|
2195
|
+
# A request object representing the call parameters. Required. To specify no
|
2196
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
2197
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
2198
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
2199
|
+
#
|
2200
|
+
# @overload list_datasets(parent: nil, page_size: nil, page_token: nil)
|
2201
|
+
# Pass arguments to `list_datasets` via keyword arguments. Note that at
|
2202
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
2203
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
2204
|
+
#
|
2205
|
+
# @param parent [::String]
|
2206
|
+
# Required. Name of the parent project. In form of
|
2207
|
+
# `projects/{project-number-or-id}/locations/{location-id}`
|
2208
|
+
# @param page_size [::Integer]
|
2209
|
+
# Optional. Requested page size. The server can return fewer results than
|
2210
|
+
# requested.
|
2211
|
+
# @param page_token [::String]
|
2212
|
+
# Optional. A token identifying a page of results for the server to return.
|
2213
|
+
# Typically obtained from next_page_token field in the response of a
|
2214
|
+
# ListDatasets call.
|
2215
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
2216
|
+
# @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Translate::V3::Dataset>]
|
2217
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
2218
|
+
#
|
2219
|
+
# @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Translate::V3::Dataset>]
|
2220
|
+
#
|
2221
|
+
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
2222
|
+
#
|
2223
|
+
# @example Basic example
|
2224
|
+
# require "google/cloud/translate/v3"
|
2225
|
+
#
|
2226
|
+
# # Create a client object. The client can be reused for multiple calls.
|
2227
|
+
# client = Google::Cloud::Translate::V3::TranslationService::Rest::Client.new
|
2228
|
+
#
|
2229
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
2230
|
+
# request = Google::Cloud::Translate::V3::ListDatasetsRequest.new
|
2231
|
+
#
|
2232
|
+
# # Call the list_datasets method.
|
2233
|
+
# result = client.list_datasets request
|
2234
|
+
#
|
2235
|
+
# # The returned object is of type Gapic::PagedEnumerable. You can iterate
|
2236
|
+
# # over elements, and API calls will be issued to fetch pages as needed.
|
2237
|
+
# result.each do |item|
|
2238
|
+
# # Each element is of type ::Google::Cloud::Translate::V3::Dataset.
|
2239
|
+
# p item
|
2240
|
+
# end
|
2241
|
+
#
|
2242
|
+
def list_datasets request, options = nil
|
2243
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
2244
|
+
|
2245
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Translate::V3::ListDatasetsRequest
|
2246
|
+
|
2247
|
+
# Converts hash and nil to an options object
|
2248
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
2249
|
+
|
2250
|
+
# Customize the options with defaults
|
2251
|
+
call_metadata = @config.rpcs.list_datasets.metadata.to_h
|
2252
|
+
|
2253
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
2254
|
+
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
2255
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
2256
|
+
gapic_version: ::Google::Cloud::Translate::V3::VERSION,
|
2257
|
+
transports_version_send: [:rest]
|
2258
|
+
|
2259
|
+
call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
2260
|
+
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
2261
|
+
|
2262
|
+
options.apply_defaults timeout: @config.rpcs.list_datasets.timeout,
|
2263
|
+
metadata: call_metadata,
|
2264
|
+
retry_policy: @config.rpcs.list_datasets.retry_policy
|
2265
|
+
|
2266
|
+
options.apply_defaults timeout: @config.timeout,
|
2267
|
+
metadata: @config.metadata,
|
2268
|
+
retry_policy: @config.retry_policy
|
2269
|
+
|
2270
|
+
@translation_service_stub.list_datasets request, options do |result, operation|
|
2271
|
+
result = ::Gapic::Rest::PagedEnumerable.new @translation_service_stub, :list_datasets, "datasets", request, result, options
|
2272
|
+
yield result, operation if block_given?
|
2273
|
+
return result
|
2274
|
+
end
|
2275
|
+
rescue ::Gapic::Rest::Error => e
|
2276
|
+
raise ::Google::Cloud::Error.from_error(e)
|
2277
|
+
end
|
2278
|
+
|
2279
|
+
##
|
2280
|
+
# Deletes a dataset and all of its contents.
|
2281
|
+
#
|
2282
|
+
# @overload delete_dataset(request, options = nil)
|
2283
|
+
# Pass arguments to `delete_dataset` via a request object, either of type
|
2284
|
+
# {::Google::Cloud::Translate::V3::DeleteDatasetRequest} or an equivalent Hash.
|
2285
|
+
#
|
2286
|
+
# @param request [::Google::Cloud::Translate::V3::DeleteDatasetRequest, ::Hash]
|
2287
|
+
# A request object representing the call parameters. Required. To specify no
|
2288
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
2289
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
2290
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
2291
|
+
#
|
2292
|
+
# @overload delete_dataset(name: nil)
|
2293
|
+
# Pass arguments to `delete_dataset` via keyword arguments. Note that at
|
2294
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
2295
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
2296
|
+
#
|
2297
|
+
# @param name [::String]
|
2298
|
+
# Required. The name of the dataset to delete.
|
2299
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
2300
|
+
# @yieldparam result [::Gapic::Operation]
|
2301
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
2302
|
+
#
|
2303
|
+
# @return [::Gapic::Operation]
|
2304
|
+
#
|
2305
|
+
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
2306
|
+
#
|
2307
|
+
# @example Basic example
|
2308
|
+
# require "google/cloud/translate/v3"
|
2309
|
+
#
|
2310
|
+
# # Create a client object. The client can be reused for multiple calls.
|
2311
|
+
# client = Google::Cloud::Translate::V3::TranslationService::Rest::Client.new
|
2312
|
+
#
|
2313
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
2314
|
+
# request = Google::Cloud::Translate::V3::DeleteDatasetRequest.new
|
2315
|
+
#
|
2316
|
+
# # Call the delete_dataset method.
|
2317
|
+
# result = client.delete_dataset request
|
2318
|
+
#
|
2319
|
+
# # The returned object is of type Gapic::Operation. You can use it to
|
2320
|
+
# # check the status of an operation, cancel it, or wait for results.
|
2321
|
+
# # Here is how to wait for a response.
|
2322
|
+
# result.wait_until_done! timeout: 60
|
2323
|
+
# if result.response?
|
2324
|
+
# p result.response
|
2325
|
+
# else
|
2326
|
+
# puts "No response received."
|
2327
|
+
# end
|
2328
|
+
#
|
2329
|
+
def delete_dataset request, options = nil
|
2330
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
2331
|
+
|
2332
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Translate::V3::DeleteDatasetRequest
|
2333
|
+
|
2334
|
+
# Converts hash and nil to an options object
|
2335
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
2336
|
+
|
2337
|
+
# Customize the options with defaults
|
2338
|
+
call_metadata = @config.rpcs.delete_dataset.metadata.to_h
|
2339
|
+
|
2340
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
2341
|
+
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
2342
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
2343
|
+
gapic_version: ::Google::Cloud::Translate::V3::VERSION,
|
2344
|
+
transports_version_send: [:rest]
|
2345
|
+
|
2346
|
+
call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
2347
|
+
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
2348
|
+
|
2349
|
+
options.apply_defaults timeout: @config.rpcs.delete_dataset.timeout,
|
2350
|
+
metadata: call_metadata,
|
2351
|
+
retry_policy: @config.rpcs.delete_dataset.retry_policy
|
2352
|
+
|
2353
|
+
options.apply_defaults timeout: @config.timeout,
|
2354
|
+
metadata: @config.metadata,
|
2355
|
+
retry_policy: @config.retry_policy
|
2356
|
+
|
2357
|
+
@translation_service_stub.delete_dataset request, options do |result, operation|
|
2358
|
+
result = ::Gapic::Operation.new result, @operations_client, options: options
|
2359
|
+
yield result, operation if block_given?
|
2360
|
+
return result
|
2361
|
+
end
|
2362
|
+
rescue ::Gapic::Rest::Error => e
|
2363
|
+
raise ::Google::Cloud::Error.from_error(e)
|
2364
|
+
end
|
2365
|
+
|
2366
|
+
##
|
2367
|
+
# Creates an Adaptive MT dataset.
|
2368
|
+
#
|
2369
|
+
# @overload create_adaptive_mt_dataset(request, options = nil)
|
2370
|
+
# Pass arguments to `create_adaptive_mt_dataset` via a request object, either of type
|
2371
|
+
# {::Google::Cloud::Translate::V3::CreateAdaptiveMtDatasetRequest} or an equivalent Hash.
|
2372
|
+
#
|
2373
|
+
# @param request [::Google::Cloud::Translate::V3::CreateAdaptiveMtDatasetRequest, ::Hash]
|
2374
|
+
# A request object representing the call parameters. Required. To specify no
|
2375
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
2376
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
2377
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
2378
|
+
#
|
2379
|
+
# @overload create_adaptive_mt_dataset(parent: nil, adaptive_mt_dataset: nil)
|
2380
|
+
# Pass arguments to `create_adaptive_mt_dataset` via keyword arguments. Note that at
|
2381
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
2382
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
2383
|
+
#
|
2384
|
+
# @param parent [::String]
|
2385
|
+
# Required. Name of the parent project. In form of
|
2386
|
+
# `projects/{project-number-or-id}/locations/{location-id}`
|
2387
|
+
# @param adaptive_mt_dataset [::Google::Cloud::Translate::V3::AdaptiveMtDataset, ::Hash]
|
2388
|
+
# Required. The AdaptiveMtDataset to be created.
|
2389
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
2390
|
+
# @yieldparam result [::Google::Cloud::Translate::V3::AdaptiveMtDataset]
|
2391
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
2392
|
+
#
|
2393
|
+
# @return [::Google::Cloud::Translate::V3::AdaptiveMtDataset]
|
2394
|
+
#
|
2395
|
+
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
2396
|
+
#
|
2397
|
+
# @example Basic example
|
2398
|
+
# require "google/cloud/translate/v3"
|
2399
|
+
#
|
2400
|
+
# # Create a client object. The client can be reused for multiple calls.
|
2401
|
+
# client = Google::Cloud::Translate::V3::TranslationService::Rest::Client.new
|
2402
|
+
#
|
2403
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
2404
|
+
# request = Google::Cloud::Translate::V3::CreateAdaptiveMtDatasetRequest.new
|
2405
|
+
#
|
2406
|
+
# # Call the create_adaptive_mt_dataset method.
|
2407
|
+
# result = client.create_adaptive_mt_dataset request
|
2408
|
+
#
|
2409
|
+
# # The returned object is of type Google::Cloud::Translate::V3::AdaptiveMtDataset.
|
2410
|
+
# p result
|
2411
|
+
#
|
2412
|
+
def create_adaptive_mt_dataset request, options = nil
|
2413
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
2414
|
+
|
2415
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Translate::V3::CreateAdaptiveMtDatasetRequest
|
2416
|
+
|
2417
|
+
# Converts hash and nil to an options object
|
2418
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
2419
|
+
|
2420
|
+
# Customize the options with defaults
|
2421
|
+
call_metadata = @config.rpcs.create_adaptive_mt_dataset.metadata.to_h
|
2422
|
+
|
2423
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
2424
|
+
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
2425
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
2426
|
+
gapic_version: ::Google::Cloud::Translate::V3::VERSION,
|
2427
|
+
transports_version_send: [:rest]
|
2428
|
+
|
2429
|
+
call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
2430
|
+
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
2431
|
+
|
2432
|
+
options.apply_defaults timeout: @config.rpcs.create_adaptive_mt_dataset.timeout,
|
2433
|
+
metadata: call_metadata,
|
2434
|
+
retry_policy: @config.rpcs.create_adaptive_mt_dataset.retry_policy
|
2435
|
+
|
2436
|
+
options.apply_defaults timeout: @config.timeout,
|
2437
|
+
metadata: @config.metadata,
|
2438
|
+
retry_policy: @config.retry_policy
|
2439
|
+
|
2440
|
+
@translation_service_stub.create_adaptive_mt_dataset request, options do |result, operation|
|
2441
|
+
yield result, operation if block_given?
|
2442
|
+
return result
|
2443
|
+
end
|
2444
|
+
rescue ::Gapic::Rest::Error => e
|
2445
|
+
raise ::Google::Cloud::Error.from_error(e)
|
2446
|
+
end
|
2447
|
+
|
2448
|
+
##
|
2449
|
+
# Deletes an Adaptive MT dataset, including all its entries and associated
|
2450
|
+
# metadata.
|
2451
|
+
#
|
2452
|
+
# @overload delete_adaptive_mt_dataset(request, options = nil)
|
2453
|
+
# Pass arguments to `delete_adaptive_mt_dataset` via a request object, either of type
|
2454
|
+
# {::Google::Cloud::Translate::V3::DeleteAdaptiveMtDatasetRequest} or an equivalent Hash.
|
2455
|
+
#
|
2456
|
+
# @param request [::Google::Cloud::Translate::V3::DeleteAdaptiveMtDatasetRequest, ::Hash]
|
2457
|
+
# A request object representing the call parameters. Required. To specify no
|
2458
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
2459
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
2460
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
2461
|
+
#
|
2462
|
+
# @overload delete_adaptive_mt_dataset(name: nil)
|
2463
|
+
# Pass arguments to `delete_adaptive_mt_dataset` via keyword arguments. Note that at
|
2464
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
2465
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
2466
|
+
#
|
2467
|
+
# @param name [::String]
|
2468
|
+
# Required. Name of the dataset. In the form of
|
2469
|
+
# `projects/{project-number-or-id}/locations/{location-id}/adaptiveMtDatasets/{adaptive-mt-dataset-id}`
|
2470
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
2471
|
+
# @yieldparam result [::Google::Protobuf::Empty]
|
2472
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
2473
|
+
#
|
2474
|
+
# @return [::Google::Protobuf::Empty]
|
2475
|
+
#
|
2476
|
+
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
2477
|
+
#
|
2478
|
+
# @example Basic example
|
2479
|
+
# require "google/cloud/translate/v3"
|
2480
|
+
#
|
2481
|
+
# # Create a client object. The client can be reused for multiple calls.
|
2482
|
+
# client = Google::Cloud::Translate::V3::TranslationService::Rest::Client.new
|
2483
|
+
#
|
2484
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
2485
|
+
# request = Google::Cloud::Translate::V3::DeleteAdaptiveMtDatasetRequest.new
|
2486
|
+
#
|
2487
|
+
# # Call the delete_adaptive_mt_dataset method.
|
2488
|
+
# result = client.delete_adaptive_mt_dataset request
|
2489
|
+
#
|
2490
|
+
# # The returned object is of type Google::Protobuf::Empty.
|
2491
|
+
# p result
|
2492
|
+
#
|
2493
|
+
def delete_adaptive_mt_dataset request, options = nil
|
2494
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
2495
|
+
|
2496
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Translate::V3::DeleteAdaptiveMtDatasetRequest
|
2497
|
+
|
2498
|
+
# Converts hash and nil to an options object
|
2499
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
2500
|
+
|
2501
|
+
# Customize the options with defaults
|
2502
|
+
call_metadata = @config.rpcs.delete_adaptive_mt_dataset.metadata.to_h
|
2503
|
+
|
2504
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
2505
|
+
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
2506
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
2507
|
+
gapic_version: ::Google::Cloud::Translate::V3::VERSION,
|
2508
|
+
transports_version_send: [:rest]
|
2509
|
+
|
2510
|
+
call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
2511
|
+
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
2512
|
+
|
2513
|
+
options.apply_defaults timeout: @config.rpcs.delete_adaptive_mt_dataset.timeout,
|
2514
|
+
metadata: call_metadata,
|
2515
|
+
retry_policy: @config.rpcs.delete_adaptive_mt_dataset.retry_policy
|
2516
|
+
|
2517
|
+
options.apply_defaults timeout: @config.timeout,
|
2518
|
+
metadata: @config.metadata,
|
2519
|
+
retry_policy: @config.retry_policy
|
2520
|
+
|
2521
|
+
@translation_service_stub.delete_adaptive_mt_dataset request, options do |result, operation|
|
2522
|
+
yield result, operation if block_given?
|
2523
|
+
return result
|
2524
|
+
end
|
2525
|
+
rescue ::Gapic::Rest::Error => e
|
2526
|
+
raise ::Google::Cloud::Error.from_error(e)
|
2527
|
+
end
|
2528
|
+
|
2529
|
+
##
|
2530
|
+
# Gets the Adaptive MT dataset.
|
2531
|
+
#
|
2532
|
+
# @overload get_adaptive_mt_dataset(request, options = nil)
|
2533
|
+
# Pass arguments to `get_adaptive_mt_dataset` via a request object, either of type
|
2534
|
+
# {::Google::Cloud::Translate::V3::GetAdaptiveMtDatasetRequest} or an equivalent Hash.
|
2535
|
+
#
|
2536
|
+
# @param request [::Google::Cloud::Translate::V3::GetAdaptiveMtDatasetRequest, ::Hash]
|
2537
|
+
# A request object representing the call parameters. Required. To specify no
|
2538
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
2539
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
2540
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
2541
|
+
#
|
2542
|
+
# @overload get_adaptive_mt_dataset(name: nil)
|
2543
|
+
# Pass arguments to `get_adaptive_mt_dataset` via keyword arguments. Note that at
|
2544
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
2545
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
2546
|
+
#
|
2547
|
+
# @param name [::String]
|
2548
|
+
# Required. Name of the dataset. In the form of
|
2549
|
+
# `projects/{project-number-or-id}/locations/{location-id}/adaptiveMtDatasets/{adaptive-mt-dataset-id}`
|
2550
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
2551
|
+
# @yieldparam result [::Google::Cloud::Translate::V3::AdaptiveMtDataset]
|
2552
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
2553
|
+
#
|
2554
|
+
# @return [::Google::Cloud::Translate::V3::AdaptiveMtDataset]
|
2555
|
+
#
|
2556
|
+
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
2557
|
+
#
|
2558
|
+
# @example Basic example
|
2559
|
+
# require "google/cloud/translate/v3"
|
2560
|
+
#
|
2561
|
+
# # Create a client object. The client can be reused for multiple calls.
|
2562
|
+
# client = Google::Cloud::Translate::V3::TranslationService::Rest::Client.new
|
2563
|
+
#
|
2564
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
2565
|
+
# request = Google::Cloud::Translate::V3::GetAdaptiveMtDatasetRequest.new
|
2566
|
+
#
|
2567
|
+
# # Call the get_adaptive_mt_dataset method.
|
2568
|
+
# result = client.get_adaptive_mt_dataset request
|
2569
|
+
#
|
2570
|
+
# # The returned object is of type Google::Cloud::Translate::V3::AdaptiveMtDataset.
|
2571
|
+
# p result
|
2572
|
+
#
|
2573
|
+
def get_adaptive_mt_dataset request, options = nil
|
2574
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
2575
|
+
|
2576
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Translate::V3::GetAdaptiveMtDatasetRequest
|
2577
|
+
|
2578
|
+
# Converts hash and nil to an options object
|
2579
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
2580
|
+
|
2581
|
+
# Customize the options with defaults
|
2582
|
+
call_metadata = @config.rpcs.get_adaptive_mt_dataset.metadata.to_h
|
2583
|
+
|
2584
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
2585
|
+
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
2586
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
2587
|
+
gapic_version: ::Google::Cloud::Translate::V3::VERSION,
|
2588
|
+
transports_version_send: [:rest]
|
2589
|
+
|
2590
|
+
call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
2591
|
+
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
2592
|
+
|
2593
|
+
options.apply_defaults timeout: @config.rpcs.get_adaptive_mt_dataset.timeout,
|
2594
|
+
metadata: call_metadata,
|
2595
|
+
retry_policy: @config.rpcs.get_adaptive_mt_dataset.retry_policy
|
2596
|
+
|
2597
|
+
options.apply_defaults timeout: @config.timeout,
|
2598
|
+
metadata: @config.metadata,
|
2599
|
+
retry_policy: @config.retry_policy
|
2600
|
+
|
2601
|
+
@translation_service_stub.get_adaptive_mt_dataset request, options do |result, operation|
|
2602
|
+
yield result, operation if block_given?
|
2603
|
+
return result
|
2604
|
+
end
|
2605
|
+
rescue ::Gapic::Rest::Error => e
|
2606
|
+
raise ::Google::Cloud::Error.from_error(e)
|
2607
|
+
end
|
2608
|
+
|
2609
|
+
##
|
2610
|
+
# Lists all Adaptive MT datasets for which the caller has read permission.
|
2611
|
+
#
|
2612
|
+
# @overload list_adaptive_mt_datasets(request, options = nil)
|
2613
|
+
# Pass arguments to `list_adaptive_mt_datasets` via a request object, either of type
|
2614
|
+
# {::Google::Cloud::Translate::V3::ListAdaptiveMtDatasetsRequest} or an equivalent Hash.
|
2615
|
+
#
|
2616
|
+
# @param request [::Google::Cloud::Translate::V3::ListAdaptiveMtDatasetsRequest, ::Hash]
|
2617
|
+
# A request object representing the call parameters. Required. To specify no
|
2618
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
2619
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
2620
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
2621
|
+
#
|
2622
|
+
# @overload list_adaptive_mt_datasets(parent: nil, page_size: nil, page_token: nil, filter: nil)
|
2623
|
+
# Pass arguments to `list_adaptive_mt_datasets` via keyword arguments. Note that at
|
2624
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
2625
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
2626
|
+
#
|
2627
|
+
# @param parent [::String]
|
2628
|
+
# Required. The resource name of the project from which to list the Adaptive
|
2629
|
+
# MT datasets. `projects/{project-number-or-id}/locations/{location-id}`
|
2630
|
+
# @param page_size [::Integer]
|
2631
|
+
# Optional. Requested page size. The server may return fewer results than
|
2632
|
+
# requested. If unspecified, the server picks an appropriate default.
|
2633
|
+
# @param page_token [::String]
|
2634
|
+
# Optional. A token identifying a page of results the server should return.
|
2635
|
+
# Typically, this is the value of
|
2636
|
+
# ListAdaptiveMtDatasetsResponse.next_page_token returned from the
|
2637
|
+
# previous call to `ListAdaptiveMtDatasets` method. The first page is
|
2638
|
+
# returned if `page_token`is empty or missing.
|
1646
2639
|
# @param filter [::String]
|
1647
2640
|
# Optional. An expression for filtering the results of the request.
|
1648
2641
|
# Filter is not supported yet.
|
1649
2642
|
# @yield [result, operation] Access the result along with the TransportOperation object
|
1650
|
-
# @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Translate::V3::AdaptiveMtDataset>]
|
2643
|
+
# @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Translate::V3::AdaptiveMtDataset>]
|
2644
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
2645
|
+
#
|
2646
|
+
# @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Translate::V3::AdaptiveMtDataset>]
|
2647
|
+
#
|
2648
|
+
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
2649
|
+
#
|
2650
|
+
# @example Basic example
|
2651
|
+
# require "google/cloud/translate/v3"
|
2652
|
+
#
|
2653
|
+
# # Create a client object. The client can be reused for multiple calls.
|
2654
|
+
# client = Google::Cloud::Translate::V3::TranslationService::Rest::Client.new
|
2655
|
+
#
|
2656
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
2657
|
+
# request = Google::Cloud::Translate::V3::ListAdaptiveMtDatasetsRequest.new
|
2658
|
+
#
|
2659
|
+
# # Call the list_adaptive_mt_datasets method.
|
2660
|
+
# result = client.list_adaptive_mt_datasets request
|
2661
|
+
#
|
2662
|
+
# # The returned object is of type Gapic::PagedEnumerable. You can iterate
|
2663
|
+
# # over elements, and API calls will be issued to fetch pages as needed.
|
2664
|
+
# result.each do |item|
|
2665
|
+
# # Each element is of type ::Google::Cloud::Translate::V3::AdaptiveMtDataset.
|
2666
|
+
# p item
|
2667
|
+
# end
|
2668
|
+
#
|
2669
|
+
def list_adaptive_mt_datasets request, options = nil
|
2670
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
2671
|
+
|
2672
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Translate::V3::ListAdaptiveMtDatasetsRequest
|
2673
|
+
|
2674
|
+
# Converts hash and nil to an options object
|
2675
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
2676
|
+
|
2677
|
+
# Customize the options with defaults
|
2678
|
+
call_metadata = @config.rpcs.list_adaptive_mt_datasets.metadata.to_h
|
2679
|
+
|
2680
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
2681
|
+
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
2682
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
2683
|
+
gapic_version: ::Google::Cloud::Translate::V3::VERSION,
|
2684
|
+
transports_version_send: [:rest]
|
2685
|
+
|
2686
|
+
call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
2687
|
+
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
2688
|
+
|
2689
|
+
options.apply_defaults timeout: @config.rpcs.list_adaptive_mt_datasets.timeout,
|
2690
|
+
metadata: call_metadata,
|
2691
|
+
retry_policy: @config.rpcs.list_adaptive_mt_datasets.retry_policy
|
2692
|
+
|
2693
|
+
options.apply_defaults timeout: @config.timeout,
|
2694
|
+
metadata: @config.metadata,
|
2695
|
+
retry_policy: @config.retry_policy
|
2696
|
+
|
2697
|
+
@translation_service_stub.list_adaptive_mt_datasets request, options do |result, operation|
|
2698
|
+
result = ::Gapic::Rest::PagedEnumerable.new @translation_service_stub, :list_adaptive_mt_datasets, "adaptive_mt_datasets", request, result, options
|
2699
|
+
yield result, operation if block_given?
|
2700
|
+
return result
|
2701
|
+
end
|
2702
|
+
rescue ::Gapic::Rest::Error => e
|
2703
|
+
raise ::Google::Cloud::Error.from_error(e)
|
2704
|
+
end
|
2705
|
+
|
2706
|
+
##
|
2707
|
+
# Translate text using Adaptive MT.
|
2708
|
+
#
|
2709
|
+
# @overload adaptive_mt_translate(request, options = nil)
|
2710
|
+
# Pass arguments to `adaptive_mt_translate` via a request object, either of type
|
2711
|
+
# {::Google::Cloud::Translate::V3::AdaptiveMtTranslateRequest} or an equivalent Hash.
|
2712
|
+
#
|
2713
|
+
# @param request [::Google::Cloud::Translate::V3::AdaptiveMtTranslateRequest, ::Hash]
|
2714
|
+
# A request object representing the call parameters. Required. To specify no
|
2715
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
2716
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
2717
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
2718
|
+
#
|
2719
|
+
# @overload adaptive_mt_translate(parent: nil, dataset: nil, content: nil, reference_sentence_config: nil, glossary_config: nil)
|
2720
|
+
# Pass arguments to `adaptive_mt_translate` via keyword arguments. Note that at
|
2721
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
2722
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
2723
|
+
#
|
2724
|
+
# @param parent [::String]
|
2725
|
+
# Required. Location to make a regional call.
|
2726
|
+
#
|
2727
|
+
# Format: `projects/{project-number-or-id}/locations/{location-id}`.
|
2728
|
+
# @param dataset [::String]
|
2729
|
+
# Required. The resource name for the dataset to use for adaptive MT.
|
2730
|
+
# `projects/{project}/locations/{location-id}/adaptiveMtDatasets/{dataset}`
|
2731
|
+
# @param content [::Array<::String>]
|
2732
|
+
# Required. The content of the input in string format.
|
2733
|
+
# @param reference_sentence_config [::Google::Cloud::Translate::V3::AdaptiveMtTranslateRequest::ReferenceSentenceConfig, ::Hash]
|
2734
|
+
# Configuration for caller provided reference sentences.
|
2735
|
+
# @param glossary_config [::Google::Cloud::Translate::V3::AdaptiveMtTranslateRequest::GlossaryConfig, ::Hash]
|
2736
|
+
# Optional. Glossary to be applied. The glossary must be
|
2737
|
+
# within the same region (have the same location-id) as the model, otherwise
|
2738
|
+
# an INVALID_ARGUMENT (400) error is returned.
|
2739
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
2740
|
+
# @yieldparam result [::Google::Cloud::Translate::V3::AdaptiveMtTranslateResponse]
|
2741
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
2742
|
+
#
|
2743
|
+
# @return [::Google::Cloud::Translate::V3::AdaptiveMtTranslateResponse]
|
2744
|
+
#
|
2745
|
+
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
2746
|
+
#
|
2747
|
+
# @example Basic example
|
2748
|
+
# require "google/cloud/translate/v3"
|
2749
|
+
#
|
2750
|
+
# # Create a client object. The client can be reused for multiple calls.
|
2751
|
+
# client = Google::Cloud::Translate::V3::TranslationService::Rest::Client.new
|
2752
|
+
#
|
2753
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
2754
|
+
# request = Google::Cloud::Translate::V3::AdaptiveMtTranslateRequest.new
|
2755
|
+
#
|
2756
|
+
# # Call the adaptive_mt_translate method.
|
2757
|
+
# result = client.adaptive_mt_translate request
|
2758
|
+
#
|
2759
|
+
# # The returned object is of type Google::Cloud::Translate::V3::AdaptiveMtTranslateResponse.
|
2760
|
+
# p result
|
2761
|
+
#
|
2762
|
+
def adaptive_mt_translate request, options = nil
|
2763
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
2764
|
+
|
2765
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Translate::V3::AdaptiveMtTranslateRequest
|
2766
|
+
|
2767
|
+
# Converts hash and nil to an options object
|
2768
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
2769
|
+
|
2770
|
+
# Customize the options with defaults
|
2771
|
+
call_metadata = @config.rpcs.adaptive_mt_translate.metadata.to_h
|
2772
|
+
|
2773
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
2774
|
+
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
2775
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
2776
|
+
gapic_version: ::Google::Cloud::Translate::V3::VERSION,
|
2777
|
+
transports_version_send: [:rest]
|
2778
|
+
|
2779
|
+
call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
2780
|
+
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
2781
|
+
|
2782
|
+
options.apply_defaults timeout: @config.rpcs.adaptive_mt_translate.timeout,
|
2783
|
+
metadata: call_metadata,
|
2784
|
+
retry_policy: @config.rpcs.adaptive_mt_translate.retry_policy
|
2785
|
+
|
2786
|
+
options.apply_defaults timeout: @config.timeout,
|
2787
|
+
metadata: @config.metadata,
|
2788
|
+
retry_policy: @config.retry_policy
|
2789
|
+
|
2790
|
+
@translation_service_stub.adaptive_mt_translate request, options do |result, operation|
|
2791
|
+
yield result, operation if block_given?
|
2792
|
+
return result
|
2793
|
+
end
|
2794
|
+
rescue ::Gapic::Rest::Error => e
|
2795
|
+
raise ::Google::Cloud::Error.from_error(e)
|
2796
|
+
end
|
2797
|
+
|
2798
|
+
##
|
2799
|
+
# Gets and AdaptiveMtFile
|
2800
|
+
#
|
2801
|
+
# @overload get_adaptive_mt_file(request, options = nil)
|
2802
|
+
# Pass arguments to `get_adaptive_mt_file` via a request object, either of type
|
2803
|
+
# {::Google::Cloud::Translate::V3::GetAdaptiveMtFileRequest} or an equivalent Hash.
|
2804
|
+
#
|
2805
|
+
# @param request [::Google::Cloud::Translate::V3::GetAdaptiveMtFileRequest, ::Hash]
|
2806
|
+
# A request object representing the call parameters. Required. To specify no
|
2807
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
2808
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
2809
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
2810
|
+
#
|
2811
|
+
# @overload get_adaptive_mt_file(name: nil)
|
2812
|
+
# Pass arguments to `get_adaptive_mt_file` via keyword arguments. Note that at
|
2813
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
2814
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
2815
|
+
#
|
2816
|
+
# @param name [::String]
|
2817
|
+
# Required. The resource name of the file, in form of
|
2818
|
+
# `projects/{project-number-or-id}/locations/{location_id}/adaptiveMtDatasets/{dataset}/adaptiveMtFiles/{file}`
|
2819
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
2820
|
+
# @yieldparam result [::Google::Cloud::Translate::V3::AdaptiveMtFile]
|
2821
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
2822
|
+
#
|
2823
|
+
# @return [::Google::Cloud::Translate::V3::AdaptiveMtFile]
|
2824
|
+
#
|
2825
|
+
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
2826
|
+
#
|
2827
|
+
# @example Basic example
|
2828
|
+
# require "google/cloud/translate/v3"
|
2829
|
+
#
|
2830
|
+
# # Create a client object. The client can be reused for multiple calls.
|
2831
|
+
# client = Google::Cloud::Translate::V3::TranslationService::Rest::Client.new
|
2832
|
+
#
|
2833
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
2834
|
+
# request = Google::Cloud::Translate::V3::GetAdaptiveMtFileRequest.new
|
2835
|
+
#
|
2836
|
+
# # Call the get_adaptive_mt_file method.
|
2837
|
+
# result = client.get_adaptive_mt_file request
|
2838
|
+
#
|
2839
|
+
# # The returned object is of type Google::Cloud::Translate::V3::AdaptiveMtFile.
|
2840
|
+
# p result
|
2841
|
+
#
|
2842
|
+
def get_adaptive_mt_file request, options = nil
|
2843
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
2844
|
+
|
2845
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Translate::V3::GetAdaptiveMtFileRequest
|
2846
|
+
|
2847
|
+
# Converts hash and nil to an options object
|
2848
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
2849
|
+
|
2850
|
+
# Customize the options with defaults
|
2851
|
+
call_metadata = @config.rpcs.get_adaptive_mt_file.metadata.to_h
|
2852
|
+
|
2853
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
2854
|
+
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
2855
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
2856
|
+
gapic_version: ::Google::Cloud::Translate::V3::VERSION,
|
2857
|
+
transports_version_send: [:rest]
|
2858
|
+
|
2859
|
+
call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
2860
|
+
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
2861
|
+
|
2862
|
+
options.apply_defaults timeout: @config.rpcs.get_adaptive_mt_file.timeout,
|
2863
|
+
metadata: call_metadata,
|
2864
|
+
retry_policy: @config.rpcs.get_adaptive_mt_file.retry_policy
|
2865
|
+
|
2866
|
+
options.apply_defaults timeout: @config.timeout,
|
2867
|
+
metadata: @config.metadata,
|
2868
|
+
retry_policy: @config.retry_policy
|
2869
|
+
|
2870
|
+
@translation_service_stub.get_adaptive_mt_file request, options do |result, operation|
|
2871
|
+
yield result, operation if block_given?
|
2872
|
+
return result
|
2873
|
+
end
|
2874
|
+
rescue ::Gapic::Rest::Error => e
|
2875
|
+
raise ::Google::Cloud::Error.from_error(e)
|
2876
|
+
end
|
2877
|
+
|
2878
|
+
##
|
2879
|
+
# Deletes an AdaptiveMtFile along with its sentences.
|
2880
|
+
#
|
2881
|
+
# @overload delete_adaptive_mt_file(request, options = nil)
|
2882
|
+
# Pass arguments to `delete_adaptive_mt_file` via a request object, either of type
|
2883
|
+
# {::Google::Cloud::Translate::V3::DeleteAdaptiveMtFileRequest} or an equivalent Hash.
|
2884
|
+
#
|
2885
|
+
# @param request [::Google::Cloud::Translate::V3::DeleteAdaptiveMtFileRequest, ::Hash]
|
2886
|
+
# A request object representing the call parameters. Required. To specify no
|
2887
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
2888
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
2889
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
2890
|
+
#
|
2891
|
+
# @overload delete_adaptive_mt_file(name: nil)
|
2892
|
+
# Pass arguments to `delete_adaptive_mt_file` via keyword arguments. Note that at
|
2893
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
2894
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
2895
|
+
#
|
2896
|
+
# @param name [::String]
|
2897
|
+
# Required. The resource name of the file to delete, in form of
|
2898
|
+
# `projects/{project-number-or-id}/locations/{location_id}/adaptiveMtDatasets/{dataset}/adaptiveMtFiles/{file}`
|
2899
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
2900
|
+
# @yieldparam result [::Google::Protobuf::Empty]
|
2901
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
2902
|
+
#
|
2903
|
+
# @return [::Google::Protobuf::Empty]
|
2904
|
+
#
|
2905
|
+
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
2906
|
+
#
|
2907
|
+
# @example Basic example
|
2908
|
+
# require "google/cloud/translate/v3"
|
2909
|
+
#
|
2910
|
+
# # Create a client object. The client can be reused for multiple calls.
|
2911
|
+
# client = Google::Cloud::Translate::V3::TranslationService::Rest::Client.new
|
2912
|
+
#
|
2913
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
2914
|
+
# request = Google::Cloud::Translate::V3::DeleteAdaptiveMtFileRequest.new
|
2915
|
+
#
|
2916
|
+
# # Call the delete_adaptive_mt_file method.
|
2917
|
+
# result = client.delete_adaptive_mt_file request
|
2918
|
+
#
|
2919
|
+
# # The returned object is of type Google::Protobuf::Empty.
|
2920
|
+
# p result
|
2921
|
+
#
|
2922
|
+
def delete_adaptive_mt_file request, options = nil
|
2923
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
2924
|
+
|
2925
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Translate::V3::DeleteAdaptiveMtFileRequest
|
2926
|
+
|
2927
|
+
# Converts hash and nil to an options object
|
2928
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
2929
|
+
|
2930
|
+
# Customize the options with defaults
|
2931
|
+
call_metadata = @config.rpcs.delete_adaptive_mt_file.metadata.to_h
|
2932
|
+
|
2933
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
2934
|
+
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
2935
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
2936
|
+
gapic_version: ::Google::Cloud::Translate::V3::VERSION,
|
2937
|
+
transports_version_send: [:rest]
|
2938
|
+
|
2939
|
+
call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
2940
|
+
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
2941
|
+
|
2942
|
+
options.apply_defaults timeout: @config.rpcs.delete_adaptive_mt_file.timeout,
|
2943
|
+
metadata: call_metadata,
|
2944
|
+
retry_policy: @config.rpcs.delete_adaptive_mt_file.retry_policy
|
2945
|
+
|
2946
|
+
options.apply_defaults timeout: @config.timeout,
|
2947
|
+
metadata: @config.metadata,
|
2948
|
+
retry_policy: @config.retry_policy
|
2949
|
+
|
2950
|
+
@translation_service_stub.delete_adaptive_mt_file request, options do |result, operation|
|
2951
|
+
yield result, operation if block_given?
|
2952
|
+
return result
|
2953
|
+
end
|
2954
|
+
rescue ::Gapic::Rest::Error => e
|
2955
|
+
raise ::Google::Cloud::Error.from_error(e)
|
2956
|
+
end
|
2957
|
+
|
2958
|
+
##
|
2959
|
+
# Imports an AdaptiveMtFile and adds all of its sentences into the
|
2960
|
+
# AdaptiveMtDataset.
|
2961
|
+
#
|
2962
|
+
# @overload import_adaptive_mt_file(request, options = nil)
|
2963
|
+
# Pass arguments to `import_adaptive_mt_file` via a request object, either of type
|
2964
|
+
# {::Google::Cloud::Translate::V3::ImportAdaptiveMtFileRequest} or an equivalent Hash.
|
2965
|
+
#
|
2966
|
+
# @param request [::Google::Cloud::Translate::V3::ImportAdaptiveMtFileRequest, ::Hash]
|
2967
|
+
# A request object representing the call parameters. Required. To specify no
|
2968
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
2969
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
2970
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
2971
|
+
#
|
2972
|
+
# @overload import_adaptive_mt_file(parent: nil, file_input_source: nil, gcs_input_source: nil)
|
2973
|
+
# Pass arguments to `import_adaptive_mt_file` via keyword arguments. Note that at
|
2974
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
2975
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
2976
|
+
#
|
2977
|
+
# @param parent [::String]
|
2978
|
+
# Required. The resource name of the file, in form of
|
2979
|
+
# `projects/{project-number-or-id}/locations/{location_id}/adaptiveMtDatasets/{dataset}`
|
2980
|
+
# @param file_input_source [::Google::Cloud::Translate::V3::FileInputSource, ::Hash]
|
2981
|
+
# Inline file source.
|
2982
|
+
# @param gcs_input_source [::Google::Cloud::Translate::V3::GcsInputSource, ::Hash]
|
2983
|
+
# Google Cloud Storage file source.
|
2984
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
2985
|
+
# @yieldparam result [::Google::Cloud::Translate::V3::ImportAdaptiveMtFileResponse]
|
2986
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
2987
|
+
#
|
2988
|
+
# @return [::Google::Cloud::Translate::V3::ImportAdaptiveMtFileResponse]
|
2989
|
+
#
|
2990
|
+
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
2991
|
+
#
|
2992
|
+
# @example Basic example
|
2993
|
+
# require "google/cloud/translate/v3"
|
2994
|
+
#
|
2995
|
+
# # Create a client object. The client can be reused for multiple calls.
|
2996
|
+
# client = Google::Cloud::Translate::V3::TranslationService::Rest::Client.new
|
2997
|
+
#
|
2998
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
2999
|
+
# request = Google::Cloud::Translate::V3::ImportAdaptiveMtFileRequest.new
|
3000
|
+
#
|
3001
|
+
# # Call the import_adaptive_mt_file method.
|
3002
|
+
# result = client.import_adaptive_mt_file request
|
3003
|
+
#
|
3004
|
+
# # The returned object is of type Google::Cloud::Translate::V3::ImportAdaptiveMtFileResponse.
|
3005
|
+
# p result
|
3006
|
+
#
|
3007
|
+
def import_adaptive_mt_file request, options = nil
|
3008
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
3009
|
+
|
3010
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Translate::V3::ImportAdaptiveMtFileRequest
|
3011
|
+
|
3012
|
+
# Converts hash and nil to an options object
|
3013
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
3014
|
+
|
3015
|
+
# Customize the options with defaults
|
3016
|
+
call_metadata = @config.rpcs.import_adaptive_mt_file.metadata.to_h
|
3017
|
+
|
3018
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
3019
|
+
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
3020
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
3021
|
+
gapic_version: ::Google::Cloud::Translate::V3::VERSION,
|
3022
|
+
transports_version_send: [:rest]
|
3023
|
+
|
3024
|
+
call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
3025
|
+
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
3026
|
+
|
3027
|
+
options.apply_defaults timeout: @config.rpcs.import_adaptive_mt_file.timeout,
|
3028
|
+
metadata: call_metadata,
|
3029
|
+
retry_policy: @config.rpcs.import_adaptive_mt_file.retry_policy
|
3030
|
+
|
3031
|
+
options.apply_defaults timeout: @config.timeout,
|
3032
|
+
metadata: @config.metadata,
|
3033
|
+
retry_policy: @config.retry_policy
|
3034
|
+
|
3035
|
+
@translation_service_stub.import_adaptive_mt_file request, options do |result, operation|
|
3036
|
+
yield result, operation if block_given?
|
3037
|
+
return result
|
3038
|
+
end
|
3039
|
+
rescue ::Gapic::Rest::Error => e
|
3040
|
+
raise ::Google::Cloud::Error.from_error(e)
|
3041
|
+
end
|
3042
|
+
|
3043
|
+
##
|
3044
|
+
# Lists all AdaptiveMtFiles associated to an AdaptiveMtDataset.
|
3045
|
+
#
|
3046
|
+
# @overload list_adaptive_mt_files(request, options = nil)
|
3047
|
+
# Pass arguments to `list_adaptive_mt_files` via a request object, either of type
|
3048
|
+
# {::Google::Cloud::Translate::V3::ListAdaptiveMtFilesRequest} or an equivalent Hash.
|
3049
|
+
#
|
3050
|
+
# @param request [::Google::Cloud::Translate::V3::ListAdaptiveMtFilesRequest, ::Hash]
|
3051
|
+
# A request object representing the call parameters. Required. To specify no
|
3052
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
3053
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
3054
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
3055
|
+
#
|
3056
|
+
# @overload list_adaptive_mt_files(parent: nil, page_size: nil, page_token: nil)
|
3057
|
+
# Pass arguments to `list_adaptive_mt_files` via keyword arguments. Note that at
|
3058
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
3059
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
3060
|
+
#
|
3061
|
+
# @param parent [::String]
|
3062
|
+
# Required. The resource name of the project from which to list the Adaptive
|
3063
|
+
# MT files.
|
3064
|
+
# `projects/{project}/locations/{location}/adaptiveMtDatasets/{dataset}`
|
3065
|
+
# @param page_size [::Integer]
|
3066
|
+
# Optional.
|
3067
|
+
# @param page_token [::String]
|
3068
|
+
# Optional. A token identifying a page of results the server should return.
|
3069
|
+
# Typically, this is the value of
|
3070
|
+
# ListAdaptiveMtFilesResponse.next_page_token returned from the
|
3071
|
+
# previous call to `ListAdaptiveMtFiles` method. The first page is
|
3072
|
+
# returned if `page_token`is empty or missing.
|
3073
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
3074
|
+
# @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Translate::V3::AdaptiveMtFile>]
|
1651
3075
|
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
1652
3076
|
#
|
1653
|
-
# @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Translate::V3::
|
3077
|
+
# @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Translate::V3::AdaptiveMtFile>]
|
1654
3078
|
#
|
1655
3079
|
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
1656
3080
|
#
|
@@ -1661,47 +3085,48 @@ module Google
|
|
1661
3085
|
# client = Google::Cloud::Translate::V3::TranslationService::Rest::Client.new
|
1662
3086
|
#
|
1663
3087
|
# # Create a request. To set request fields, pass in keyword arguments.
|
1664
|
-
# request = Google::Cloud::Translate::V3::
|
3088
|
+
# request = Google::Cloud::Translate::V3::ListAdaptiveMtFilesRequest.new
|
1665
3089
|
#
|
1666
|
-
# # Call the
|
1667
|
-
# result = client.
|
3090
|
+
# # Call the list_adaptive_mt_files method.
|
3091
|
+
# result = client.list_adaptive_mt_files request
|
1668
3092
|
#
|
1669
3093
|
# # The returned object is of type Gapic::PagedEnumerable. You can iterate
|
1670
3094
|
# # over elements, and API calls will be issued to fetch pages as needed.
|
1671
3095
|
# result.each do |item|
|
1672
|
-
# # Each element is of type ::Google::Cloud::Translate::V3::
|
3096
|
+
# # Each element is of type ::Google::Cloud::Translate::V3::AdaptiveMtFile.
|
1673
3097
|
# p item
|
1674
3098
|
# end
|
1675
3099
|
#
|
1676
|
-
def
|
3100
|
+
def list_adaptive_mt_files request, options = nil
|
1677
3101
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
1678
3102
|
|
1679
|
-
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Translate::V3::
|
3103
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Translate::V3::ListAdaptiveMtFilesRequest
|
1680
3104
|
|
1681
3105
|
# Converts hash and nil to an options object
|
1682
3106
|
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
1683
3107
|
|
1684
3108
|
# Customize the options with defaults
|
1685
|
-
call_metadata = @config.rpcs.
|
3109
|
+
call_metadata = @config.rpcs.list_adaptive_mt_files.metadata.to_h
|
1686
3110
|
|
1687
|
-
# Set x-goog-api-client
|
3111
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
1688
3112
|
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
1689
3113
|
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
1690
3114
|
gapic_version: ::Google::Cloud::Translate::V3::VERSION,
|
1691
3115
|
transports_version_send: [:rest]
|
1692
3116
|
|
3117
|
+
call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
1693
3118
|
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
1694
3119
|
|
1695
|
-
options.apply_defaults timeout: @config.rpcs.
|
3120
|
+
options.apply_defaults timeout: @config.rpcs.list_adaptive_mt_files.timeout,
|
1696
3121
|
metadata: call_metadata,
|
1697
|
-
retry_policy: @config.rpcs.
|
3122
|
+
retry_policy: @config.rpcs.list_adaptive_mt_files.retry_policy
|
1698
3123
|
|
1699
3124
|
options.apply_defaults timeout: @config.timeout,
|
1700
3125
|
metadata: @config.metadata,
|
1701
3126
|
retry_policy: @config.retry_policy
|
1702
3127
|
|
1703
|
-
@translation_service_stub.
|
1704
|
-
result = ::Gapic::Rest::PagedEnumerable.new @translation_service_stub, :
|
3128
|
+
@translation_service_stub.list_adaptive_mt_files request, options do |result, operation|
|
3129
|
+
result = ::Gapic::Rest::PagedEnumerable.new @translation_service_stub, :list_adaptive_mt_files, "adaptive_mt_files", request, result, options
|
1705
3130
|
yield result, operation if block_given?
|
1706
3131
|
return result
|
1707
3132
|
end
|
@@ -1710,38 +3135,128 @@ module Google
|
|
1710
3135
|
end
|
1711
3136
|
|
1712
3137
|
##
|
1713
|
-
#
|
3138
|
+
# Lists all AdaptiveMtSentences under a given file/dataset.
|
1714
3139
|
#
|
1715
|
-
# @overload
|
1716
|
-
# Pass arguments to `
|
1717
|
-
# {::Google::Cloud::Translate::V3::
|
3140
|
+
# @overload list_adaptive_mt_sentences(request, options = nil)
|
3141
|
+
# Pass arguments to `list_adaptive_mt_sentences` via a request object, either of type
|
3142
|
+
# {::Google::Cloud::Translate::V3::ListAdaptiveMtSentencesRequest} or an equivalent Hash.
|
1718
3143
|
#
|
1719
|
-
# @param request [::Google::Cloud::Translate::V3::
|
3144
|
+
# @param request [::Google::Cloud::Translate::V3::ListAdaptiveMtSentencesRequest, ::Hash]
|
1720
3145
|
# A request object representing the call parameters. Required. To specify no
|
1721
3146
|
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
1722
3147
|
# @param options [::Gapic::CallOptions, ::Hash]
|
1723
3148
|
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
1724
3149
|
#
|
1725
|
-
# @overload
|
1726
|
-
# Pass arguments to `
|
3150
|
+
# @overload list_adaptive_mt_sentences(parent: nil, page_size: nil, page_token: nil)
|
3151
|
+
# Pass arguments to `list_adaptive_mt_sentences` via keyword arguments. Note that at
|
1727
3152
|
# least one keyword argument is required. To specify no parameters, or to keep all
|
1728
3153
|
# the default parameter values, pass an empty Hash as a request object (see above).
|
1729
3154
|
#
|
1730
3155
|
# @param parent [::String]
|
1731
|
-
# Required.
|
3156
|
+
# Required. The resource name of the project from which to list the Adaptive
|
3157
|
+
# MT files. The following format lists all sentences under a file.
|
3158
|
+
# `projects/{project}/locations/{location}/adaptiveMtDatasets/{dataset}/adaptiveMtFiles/{file}`
|
3159
|
+
# The following format lists all sentences within a dataset.
|
3160
|
+
# `projects/{project}/locations/{location}/adaptiveMtDatasets/{dataset}`
|
3161
|
+
# @param page_size [::Integer]
|
3162
|
+
# @param page_token [::String]
|
3163
|
+
# A token identifying a page of results the server should return.
|
3164
|
+
# Typically, this is the value of
|
3165
|
+
# ListAdaptiveMtSentencesRequest.next_page_token returned from the
|
3166
|
+
# previous call to `ListTranslationMemories` method. The first page is
|
3167
|
+
# returned if `page_token` is empty or missing.
|
3168
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
3169
|
+
# @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Translate::V3::AdaptiveMtSentence>]
|
3170
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
3171
|
+
#
|
3172
|
+
# @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Translate::V3::AdaptiveMtSentence>]
|
3173
|
+
#
|
3174
|
+
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
3175
|
+
#
|
3176
|
+
# @example Basic example
|
3177
|
+
# require "google/cloud/translate/v3"
|
3178
|
+
#
|
3179
|
+
# # Create a client object. The client can be reused for multiple calls.
|
3180
|
+
# client = Google::Cloud::Translate::V3::TranslationService::Rest::Client.new
|
3181
|
+
#
|
3182
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
3183
|
+
# request = Google::Cloud::Translate::V3::ListAdaptiveMtSentencesRequest.new
|
3184
|
+
#
|
3185
|
+
# # Call the list_adaptive_mt_sentences method.
|
3186
|
+
# result = client.list_adaptive_mt_sentences request
|
3187
|
+
#
|
3188
|
+
# # The returned object is of type Gapic::PagedEnumerable. You can iterate
|
3189
|
+
# # over elements, and API calls will be issued to fetch pages as needed.
|
3190
|
+
# result.each do |item|
|
3191
|
+
# # Each element is of type ::Google::Cloud::Translate::V3::AdaptiveMtSentence.
|
3192
|
+
# p item
|
3193
|
+
# end
|
3194
|
+
#
|
3195
|
+
def list_adaptive_mt_sentences request, options = nil
|
3196
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
3197
|
+
|
3198
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Translate::V3::ListAdaptiveMtSentencesRequest
|
3199
|
+
|
3200
|
+
# Converts hash and nil to an options object
|
3201
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
3202
|
+
|
3203
|
+
# Customize the options with defaults
|
3204
|
+
call_metadata = @config.rpcs.list_adaptive_mt_sentences.metadata.to_h
|
3205
|
+
|
3206
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
3207
|
+
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
3208
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
3209
|
+
gapic_version: ::Google::Cloud::Translate::V3::VERSION,
|
3210
|
+
transports_version_send: [:rest]
|
3211
|
+
|
3212
|
+
call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
3213
|
+
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
3214
|
+
|
3215
|
+
options.apply_defaults timeout: @config.rpcs.list_adaptive_mt_sentences.timeout,
|
3216
|
+
metadata: call_metadata,
|
3217
|
+
retry_policy: @config.rpcs.list_adaptive_mt_sentences.retry_policy
|
3218
|
+
|
3219
|
+
options.apply_defaults timeout: @config.timeout,
|
3220
|
+
metadata: @config.metadata,
|
3221
|
+
retry_policy: @config.retry_policy
|
3222
|
+
|
3223
|
+
@translation_service_stub.list_adaptive_mt_sentences request, options do |result, operation|
|
3224
|
+
result = ::Gapic::Rest::PagedEnumerable.new @translation_service_stub, :list_adaptive_mt_sentences, "adaptive_mt_sentences", request, result, options
|
3225
|
+
yield result, operation if block_given?
|
3226
|
+
return result
|
3227
|
+
end
|
3228
|
+
rescue ::Gapic::Rest::Error => e
|
3229
|
+
raise ::Google::Cloud::Error.from_error(e)
|
3230
|
+
end
|
3231
|
+
|
3232
|
+
##
|
3233
|
+
# Import sentence pairs into translation Dataset.
|
3234
|
+
#
|
3235
|
+
# @overload import_data(request, options = nil)
|
3236
|
+
# Pass arguments to `import_data` via a request object, either of type
|
3237
|
+
# {::Google::Cloud::Translate::V3::ImportDataRequest} or an equivalent Hash.
|
3238
|
+
#
|
3239
|
+
# @param request [::Google::Cloud::Translate::V3::ImportDataRequest, ::Hash]
|
3240
|
+
# A request object representing the call parameters. Required. To specify no
|
3241
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
3242
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
3243
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
3244
|
+
#
|
3245
|
+
# @overload import_data(dataset: nil, input_config: nil)
|
3246
|
+
# Pass arguments to `import_data` via keyword arguments. Note that at
|
3247
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
3248
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
1732
3249
|
#
|
1733
|
-
# Format: `projects/{project-number-or-id}/locations/{location-id}`.
|
1734
3250
|
# @param dataset [::String]
|
1735
|
-
# Required.
|
1736
|
-
# `projects/{project}/locations/{location-id}/
|
1737
|
-
# @param
|
1738
|
-
# Required. The
|
1739
|
-
# For now only one sentence per request is supported.
|
3251
|
+
# Required. Name of the dataset. In form of
|
3252
|
+
# `projects/{project-number-or-id}/locations/{location-id}/datasets/{dataset-id}`
|
3253
|
+
# @param input_config [::Google::Cloud::Translate::V3::DatasetInputConfig, ::Hash]
|
3254
|
+
# Required. The config for the input content.
|
1740
3255
|
# @yield [result, operation] Access the result along with the TransportOperation object
|
1741
|
-
# @yieldparam result [::
|
3256
|
+
# @yieldparam result [::Gapic::Operation]
|
1742
3257
|
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
1743
3258
|
#
|
1744
|
-
# @return [::
|
3259
|
+
# @return [::Gapic::Operation]
|
1745
3260
|
#
|
1746
3261
|
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
1747
3262
|
#
|
@@ -1752,42 +3267,141 @@ module Google
|
|
1752
3267
|
# client = Google::Cloud::Translate::V3::TranslationService::Rest::Client.new
|
1753
3268
|
#
|
1754
3269
|
# # Create a request. To set request fields, pass in keyword arguments.
|
1755
|
-
# request = Google::Cloud::Translate::V3::
|
3270
|
+
# request = Google::Cloud::Translate::V3::ImportDataRequest.new
|
1756
3271
|
#
|
1757
|
-
# # Call the
|
1758
|
-
# result = client.
|
3272
|
+
# # Call the import_data method.
|
3273
|
+
# result = client.import_data request
|
1759
3274
|
#
|
1760
|
-
# # The returned object is of type
|
1761
|
-
#
|
3275
|
+
# # The returned object is of type Gapic::Operation. You can use it to
|
3276
|
+
# # check the status of an operation, cancel it, or wait for results.
|
3277
|
+
# # Here is how to wait for a response.
|
3278
|
+
# result.wait_until_done! timeout: 60
|
3279
|
+
# if result.response?
|
3280
|
+
# p result.response
|
3281
|
+
# else
|
3282
|
+
# puts "No response received."
|
3283
|
+
# end
|
3284
|
+
#
|
3285
|
+
def import_data request, options = nil
|
3286
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
3287
|
+
|
3288
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Translate::V3::ImportDataRequest
|
3289
|
+
|
3290
|
+
# Converts hash and nil to an options object
|
3291
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
3292
|
+
|
3293
|
+
# Customize the options with defaults
|
3294
|
+
call_metadata = @config.rpcs.import_data.metadata.to_h
|
3295
|
+
|
3296
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
3297
|
+
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
3298
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
3299
|
+
gapic_version: ::Google::Cloud::Translate::V3::VERSION,
|
3300
|
+
transports_version_send: [:rest]
|
3301
|
+
|
3302
|
+
call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
3303
|
+
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
3304
|
+
|
3305
|
+
options.apply_defaults timeout: @config.rpcs.import_data.timeout,
|
3306
|
+
metadata: call_metadata,
|
3307
|
+
retry_policy: @config.rpcs.import_data.retry_policy
|
3308
|
+
|
3309
|
+
options.apply_defaults timeout: @config.timeout,
|
3310
|
+
metadata: @config.metadata,
|
3311
|
+
retry_policy: @config.retry_policy
|
3312
|
+
|
3313
|
+
@translation_service_stub.import_data request, options do |result, operation|
|
3314
|
+
result = ::Gapic::Operation.new result, @operations_client, options: options
|
3315
|
+
yield result, operation if block_given?
|
3316
|
+
return result
|
3317
|
+
end
|
3318
|
+
rescue ::Gapic::Rest::Error => e
|
3319
|
+
raise ::Google::Cloud::Error.from_error(e)
|
3320
|
+
end
|
3321
|
+
|
3322
|
+
##
|
3323
|
+
# Exports dataset's data to the provided output location.
|
3324
|
+
#
|
3325
|
+
# @overload export_data(request, options = nil)
|
3326
|
+
# Pass arguments to `export_data` via a request object, either of type
|
3327
|
+
# {::Google::Cloud::Translate::V3::ExportDataRequest} or an equivalent Hash.
|
3328
|
+
#
|
3329
|
+
# @param request [::Google::Cloud::Translate::V3::ExportDataRequest, ::Hash]
|
3330
|
+
# A request object representing the call parameters. Required. To specify no
|
3331
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
3332
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
3333
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
3334
|
+
#
|
3335
|
+
# @overload export_data(dataset: nil, output_config: nil)
|
3336
|
+
# Pass arguments to `export_data` via keyword arguments. Note that at
|
3337
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
3338
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
3339
|
+
#
|
3340
|
+
# @param dataset [::String]
|
3341
|
+
# Required. Name of the dataset. In form of
|
3342
|
+
# `projects/{project-number-or-id}/locations/{location-id}/datasets/{dataset-id}`
|
3343
|
+
# @param output_config [::Google::Cloud::Translate::V3::DatasetOutputConfig, ::Hash]
|
3344
|
+
# Required. The config for the output content.
|
3345
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
3346
|
+
# @yieldparam result [::Gapic::Operation]
|
3347
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
3348
|
+
#
|
3349
|
+
# @return [::Gapic::Operation]
|
3350
|
+
#
|
3351
|
+
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
3352
|
+
#
|
3353
|
+
# @example Basic example
|
3354
|
+
# require "google/cloud/translate/v3"
|
3355
|
+
#
|
3356
|
+
# # Create a client object. The client can be reused for multiple calls.
|
3357
|
+
# client = Google::Cloud::Translate::V3::TranslationService::Rest::Client.new
|
3358
|
+
#
|
3359
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
3360
|
+
# request = Google::Cloud::Translate::V3::ExportDataRequest.new
|
3361
|
+
#
|
3362
|
+
# # Call the export_data method.
|
3363
|
+
# result = client.export_data request
|
3364
|
+
#
|
3365
|
+
# # The returned object is of type Gapic::Operation. You can use it to
|
3366
|
+
# # check the status of an operation, cancel it, or wait for results.
|
3367
|
+
# # Here is how to wait for a response.
|
3368
|
+
# result.wait_until_done! timeout: 60
|
3369
|
+
# if result.response?
|
3370
|
+
# p result.response
|
3371
|
+
# else
|
3372
|
+
# puts "No response received."
|
3373
|
+
# end
|
1762
3374
|
#
|
1763
|
-
def
|
3375
|
+
def export_data request, options = nil
|
1764
3376
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
1765
3377
|
|
1766
|
-
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Translate::V3::
|
3378
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Translate::V3::ExportDataRequest
|
1767
3379
|
|
1768
3380
|
# Converts hash and nil to an options object
|
1769
3381
|
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
1770
3382
|
|
1771
3383
|
# Customize the options with defaults
|
1772
|
-
call_metadata = @config.rpcs.
|
3384
|
+
call_metadata = @config.rpcs.export_data.metadata.to_h
|
1773
3385
|
|
1774
|
-
# Set x-goog-api-client
|
3386
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
1775
3387
|
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
1776
3388
|
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
1777
3389
|
gapic_version: ::Google::Cloud::Translate::V3::VERSION,
|
1778
3390
|
transports_version_send: [:rest]
|
1779
3391
|
|
3392
|
+
call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
1780
3393
|
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
1781
3394
|
|
1782
|
-
options.apply_defaults timeout: @config.rpcs.
|
3395
|
+
options.apply_defaults timeout: @config.rpcs.export_data.timeout,
|
1783
3396
|
metadata: call_metadata,
|
1784
|
-
retry_policy: @config.rpcs.
|
3397
|
+
retry_policy: @config.rpcs.export_data.retry_policy
|
1785
3398
|
|
1786
3399
|
options.apply_defaults timeout: @config.timeout,
|
1787
3400
|
metadata: @config.metadata,
|
1788
3401
|
retry_policy: @config.retry_policy
|
1789
3402
|
|
1790
|
-
@translation_service_stub.
|
3403
|
+
@translation_service_stub.export_data request, options do |result, operation|
|
3404
|
+
result = ::Gapic::Operation.new result, @operations_client, options: options
|
1791
3405
|
yield result, operation if block_given?
|
1792
3406
|
return result
|
1793
3407
|
end
|
@@ -1796,31 +3410,42 @@ module Google
|
|
1796
3410
|
end
|
1797
3411
|
|
1798
3412
|
##
|
1799
|
-
#
|
3413
|
+
# Lists sentence pairs in the dataset.
|
1800
3414
|
#
|
1801
|
-
# @overload
|
1802
|
-
# Pass arguments to `
|
1803
|
-
# {::Google::Cloud::Translate::V3::
|
3415
|
+
# @overload list_examples(request, options = nil)
|
3416
|
+
# Pass arguments to `list_examples` via a request object, either of type
|
3417
|
+
# {::Google::Cloud::Translate::V3::ListExamplesRequest} or an equivalent Hash.
|
1804
3418
|
#
|
1805
|
-
# @param request [::Google::Cloud::Translate::V3::
|
3419
|
+
# @param request [::Google::Cloud::Translate::V3::ListExamplesRequest, ::Hash]
|
1806
3420
|
# A request object representing the call parameters. Required. To specify no
|
1807
3421
|
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
1808
3422
|
# @param options [::Gapic::CallOptions, ::Hash]
|
1809
3423
|
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
1810
3424
|
#
|
1811
|
-
# @overload
|
1812
|
-
# Pass arguments to `
|
3425
|
+
# @overload list_examples(parent: nil, filter: nil, page_size: nil, page_token: nil)
|
3426
|
+
# Pass arguments to `list_examples` via keyword arguments. Note that at
|
1813
3427
|
# least one keyword argument is required. To specify no parameters, or to keep all
|
1814
3428
|
# the default parameter values, pass an empty Hash as a request object (see above).
|
1815
3429
|
#
|
1816
|
-
# @param
|
1817
|
-
# Required.
|
1818
|
-
# `projects/{project-number-or-id}/locations/{
|
3430
|
+
# @param parent [::String]
|
3431
|
+
# Required. Name of the parent dataset. In form of
|
3432
|
+
# `projects/{project-number-or-id}/locations/{location-id}/datasets/{dataset-id}`
|
3433
|
+
# @param filter [::String]
|
3434
|
+
# Optional. An expression for filtering the examples that will be returned.
|
3435
|
+
# Example filter:
|
3436
|
+
# * `usage=TRAIN`
|
3437
|
+
# @param page_size [::Integer]
|
3438
|
+
# Optional. Requested page size. The server can return fewer results than
|
3439
|
+
# requested.
|
3440
|
+
# @param page_token [::String]
|
3441
|
+
# Optional. A token identifying a page of results for the server to return.
|
3442
|
+
# Typically obtained from next_page_token field in the response of a
|
3443
|
+
# ListExamples call.
|
1819
3444
|
# @yield [result, operation] Access the result along with the TransportOperation object
|
1820
|
-
# @yieldparam result [::Google::Cloud::Translate::V3::
|
3445
|
+
# @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Translate::V3::Example>]
|
1821
3446
|
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
1822
3447
|
#
|
1823
|
-
# @return [::Google::Cloud::Translate::V3::
|
3448
|
+
# @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Translate::V3::Example>]
|
1824
3449
|
#
|
1825
3450
|
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
1826
3451
|
#
|
@@ -1831,42 +3456,48 @@ module Google
|
|
1831
3456
|
# client = Google::Cloud::Translate::V3::TranslationService::Rest::Client.new
|
1832
3457
|
#
|
1833
3458
|
# # Create a request. To set request fields, pass in keyword arguments.
|
1834
|
-
# request = Google::Cloud::Translate::V3::
|
3459
|
+
# request = Google::Cloud::Translate::V3::ListExamplesRequest.new
|
1835
3460
|
#
|
1836
|
-
# # Call the
|
1837
|
-
# result = client.
|
3461
|
+
# # Call the list_examples method.
|
3462
|
+
# result = client.list_examples request
|
1838
3463
|
#
|
1839
|
-
# # The returned object is of type
|
1840
|
-
#
|
3464
|
+
# # The returned object is of type Gapic::PagedEnumerable. You can iterate
|
3465
|
+
# # over elements, and API calls will be issued to fetch pages as needed.
|
3466
|
+
# result.each do |item|
|
3467
|
+
# # Each element is of type ::Google::Cloud::Translate::V3::Example.
|
3468
|
+
# p item
|
3469
|
+
# end
|
1841
3470
|
#
|
1842
|
-
def
|
3471
|
+
def list_examples request, options = nil
|
1843
3472
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
1844
3473
|
|
1845
|
-
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Translate::V3::
|
3474
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Translate::V3::ListExamplesRequest
|
1846
3475
|
|
1847
3476
|
# Converts hash and nil to an options object
|
1848
3477
|
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
1849
3478
|
|
1850
3479
|
# Customize the options with defaults
|
1851
|
-
call_metadata = @config.rpcs.
|
3480
|
+
call_metadata = @config.rpcs.list_examples.metadata.to_h
|
1852
3481
|
|
1853
|
-
# Set x-goog-api-client
|
3482
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
1854
3483
|
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
1855
3484
|
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
1856
3485
|
gapic_version: ::Google::Cloud::Translate::V3::VERSION,
|
1857
3486
|
transports_version_send: [:rest]
|
1858
3487
|
|
3488
|
+
call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
1859
3489
|
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
1860
3490
|
|
1861
|
-
options.apply_defaults timeout: @config.rpcs.
|
3491
|
+
options.apply_defaults timeout: @config.rpcs.list_examples.timeout,
|
1862
3492
|
metadata: call_metadata,
|
1863
|
-
retry_policy: @config.rpcs.
|
3493
|
+
retry_policy: @config.rpcs.list_examples.retry_policy
|
1864
3494
|
|
1865
3495
|
options.apply_defaults timeout: @config.timeout,
|
1866
3496
|
metadata: @config.metadata,
|
1867
3497
|
retry_policy: @config.retry_policy
|
1868
3498
|
|
1869
|
-
@translation_service_stub.
|
3499
|
+
@translation_service_stub.list_examples request, options do |result, operation|
|
3500
|
+
result = ::Gapic::Rest::PagedEnumerable.new @translation_service_stub, :list_examples, "examples", request, result, options
|
1870
3501
|
yield result, operation if block_given?
|
1871
3502
|
return result
|
1872
3503
|
end
|
@@ -1875,31 +3506,33 @@ module Google
|
|
1875
3506
|
end
|
1876
3507
|
|
1877
3508
|
##
|
1878
|
-
#
|
3509
|
+
# Creates a Model.
|
1879
3510
|
#
|
1880
|
-
# @overload
|
1881
|
-
# Pass arguments to `
|
1882
|
-
# {::Google::Cloud::Translate::V3::
|
3511
|
+
# @overload create_model(request, options = nil)
|
3512
|
+
# Pass arguments to `create_model` via a request object, either of type
|
3513
|
+
# {::Google::Cloud::Translate::V3::CreateModelRequest} or an equivalent Hash.
|
1883
3514
|
#
|
1884
|
-
# @param request [::Google::Cloud::Translate::V3::
|
3515
|
+
# @param request [::Google::Cloud::Translate::V3::CreateModelRequest, ::Hash]
|
1885
3516
|
# A request object representing the call parameters. Required. To specify no
|
1886
3517
|
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
1887
3518
|
# @param options [::Gapic::CallOptions, ::Hash]
|
1888
3519
|
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
1889
3520
|
#
|
1890
|
-
# @overload
|
1891
|
-
# Pass arguments to `
|
3521
|
+
# @overload create_model(parent: nil, model: nil)
|
3522
|
+
# Pass arguments to `create_model` via keyword arguments. Note that at
|
1892
3523
|
# least one keyword argument is required. To specify no parameters, or to keep all
|
1893
3524
|
# the default parameter values, pass an empty Hash as a request object (see above).
|
1894
3525
|
#
|
1895
|
-
# @param
|
1896
|
-
# Required. The
|
1897
|
-
# `projects/{project
|
3526
|
+
# @param parent [::String]
|
3527
|
+
# Required. The project name, in form of
|
3528
|
+
# `projects/{project}/locations/{location}`
|
3529
|
+
# @param model [::Google::Cloud::Translate::V3::Model, ::Hash]
|
3530
|
+
# Required. The Model to create.
|
1898
3531
|
# @yield [result, operation] Access the result along with the TransportOperation object
|
1899
|
-
# @yieldparam result [::
|
3532
|
+
# @yieldparam result [::Gapic::Operation]
|
1900
3533
|
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
1901
3534
|
#
|
1902
|
-
# @return [::
|
3535
|
+
# @return [::Gapic::Operation]
|
1903
3536
|
#
|
1904
3537
|
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
1905
3538
|
#
|
@@ -1910,42 +3543,51 @@ module Google
|
|
1910
3543
|
# client = Google::Cloud::Translate::V3::TranslationService::Rest::Client.new
|
1911
3544
|
#
|
1912
3545
|
# # Create a request. To set request fields, pass in keyword arguments.
|
1913
|
-
# request = Google::Cloud::Translate::V3::
|
3546
|
+
# request = Google::Cloud::Translate::V3::CreateModelRequest.new
|
1914
3547
|
#
|
1915
|
-
# # Call the
|
1916
|
-
# result = client.
|
3548
|
+
# # Call the create_model method.
|
3549
|
+
# result = client.create_model request
|
1917
3550
|
#
|
1918
|
-
# # The returned object is of type
|
1919
|
-
#
|
3551
|
+
# # The returned object is of type Gapic::Operation. You can use it to
|
3552
|
+
# # check the status of an operation, cancel it, or wait for results.
|
3553
|
+
# # Here is how to wait for a response.
|
3554
|
+
# result.wait_until_done! timeout: 60
|
3555
|
+
# if result.response?
|
3556
|
+
# p result.response
|
3557
|
+
# else
|
3558
|
+
# puts "No response received."
|
3559
|
+
# end
|
1920
3560
|
#
|
1921
|
-
def
|
3561
|
+
def create_model request, options = nil
|
1922
3562
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
1923
3563
|
|
1924
|
-
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Translate::V3::
|
3564
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Translate::V3::CreateModelRequest
|
1925
3565
|
|
1926
3566
|
# Converts hash and nil to an options object
|
1927
3567
|
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
1928
3568
|
|
1929
3569
|
# Customize the options with defaults
|
1930
|
-
call_metadata = @config.rpcs.
|
3570
|
+
call_metadata = @config.rpcs.create_model.metadata.to_h
|
1931
3571
|
|
1932
|
-
# Set x-goog-api-client
|
3572
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
1933
3573
|
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
1934
3574
|
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
1935
3575
|
gapic_version: ::Google::Cloud::Translate::V3::VERSION,
|
1936
3576
|
transports_version_send: [:rest]
|
1937
3577
|
|
3578
|
+
call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
1938
3579
|
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
1939
3580
|
|
1940
|
-
options.apply_defaults timeout: @config.rpcs.
|
3581
|
+
options.apply_defaults timeout: @config.rpcs.create_model.timeout,
|
1941
3582
|
metadata: call_metadata,
|
1942
|
-
retry_policy: @config.rpcs.
|
3583
|
+
retry_policy: @config.rpcs.create_model.retry_policy
|
1943
3584
|
|
1944
3585
|
options.apply_defaults timeout: @config.timeout,
|
1945
3586
|
metadata: @config.metadata,
|
1946
3587
|
retry_policy: @config.retry_policy
|
1947
3588
|
|
1948
|
-
@translation_service_stub.
|
3589
|
+
@translation_service_stub.create_model request, options do |result, operation|
|
3590
|
+
result = ::Gapic::Operation.new result, @operations_client, options: options
|
1949
3591
|
yield result, operation if block_given?
|
1950
3592
|
return result
|
1951
3593
|
end
|
@@ -1954,36 +3596,42 @@ module Google
|
|
1954
3596
|
end
|
1955
3597
|
|
1956
3598
|
##
|
1957
|
-
#
|
1958
|
-
# AdaptiveMtDataset.
|
3599
|
+
# Lists models.
|
1959
3600
|
#
|
1960
|
-
# @overload
|
1961
|
-
# Pass arguments to `
|
1962
|
-
# {::Google::Cloud::Translate::V3::
|
3601
|
+
# @overload list_models(request, options = nil)
|
3602
|
+
# Pass arguments to `list_models` via a request object, either of type
|
3603
|
+
# {::Google::Cloud::Translate::V3::ListModelsRequest} or an equivalent Hash.
|
1963
3604
|
#
|
1964
|
-
# @param request [::Google::Cloud::Translate::V3::
|
3605
|
+
# @param request [::Google::Cloud::Translate::V3::ListModelsRequest, ::Hash]
|
1965
3606
|
# A request object representing the call parameters. Required. To specify no
|
1966
3607
|
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
1967
3608
|
# @param options [::Gapic::CallOptions, ::Hash]
|
1968
3609
|
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
1969
3610
|
#
|
1970
|
-
# @overload
|
1971
|
-
# Pass arguments to `
|
3611
|
+
# @overload list_models(parent: nil, filter: nil, page_size: nil, page_token: nil)
|
3612
|
+
# Pass arguments to `list_models` via keyword arguments. Note that at
|
1972
3613
|
# least one keyword argument is required. To specify no parameters, or to keep all
|
1973
3614
|
# the default parameter values, pass an empty Hash as a request object (see above).
|
1974
3615
|
#
|
1975
3616
|
# @param parent [::String]
|
1976
|
-
# Required.
|
1977
|
-
# `projects/{project-number-or-id}/locations/{
|
1978
|
-
# @param
|
1979
|
-
#
|
1980
|
-
#
|
1981
|
-
#
|
3617
|
+
# Required. Name of the parent project. In form of
|
3618
|
+
# `projects/{project-number-or-id}/locations/{location-id}`
|
3619
|
+
# @param filter [::String]
|
3620
|
+
# Optional. An expression for filtering the models that will be returned.
|
3621
|
+
# Supported filter:
|
3622
|
+
# `dataset_id=${dataset_id}`
|
3623
|
+
# @param page_size [::Integer]
|
3624
|
+
# Optional. Requested page size. The server can return fewer results than
|
3625
|
+
# requested.
|
3626
|
+
# @param page_token [::String]
|
3627
|
+
# Optional. A token identifying a page of results for the server to return.
|
3628
|
+
# Typically obtained from next_page_token field in the response of a
|
3629
|
+
# ListModels call.
|
1982
3630
|
# @yield [result, operation] Access the result along with the TransportOperation object
|
1983
|
-
# @yieldparam result [::Google::Cloud::Translate::V3::
|
3631
|
+
# @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Translate::V3::Model>]
|
1984
3632
|
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
1985
3633
|
#
|
1986
|
-
# @return [::Google::Cloud::Translate::V3::
|
3634
|
+
# @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Translate::V3::Model>]
|
1987
3635
|
#
|
1988
3636
|
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
1989
3637
|
#
|
@@ -1994,42 +3642,48 @@ module Google
|
|
1994
3642
|
# client = Google::Cloud::Translate::V3::TranslationService::Rest::Client.new
|
1995
3643
|
#
|
1996
3644
|
# # Create a request. To set request fields, pass in keyword arguments.
|
1997
|
-
# request = Google::Cloud::Translate::V3::
|
3645
|
+
# request = Google::Cloud::Translate::V3::ListModelsRequest.new
|
1998
3646
|
#
|
1999
|
-
# # Call the
|
2000
|
-
# result = client.
|
3647
|
+
# # Call the list_models method.
|
3648
|
+
# result = client.list_models request
|
2001
3649
|
#
|
2002
|
-
# # The returned object is of type
|
2003
|
-
#
|
3650
|
+
# # The returned object is of type Gapic::PagedEnumerable. You can iterate
|
3651
|
+
# # over elements, and API calls will be issued to fetch pages as needed.
|
3652
|
+
# result.each do |item|
|
3653
|
+
# # Each element is of type ::Google::Cloud::Translate::V3::Model.
|
3654
|
+
# p item
|
3655
|
+
# end
|
2004
3656
|
#
|
2005
|
-
def
|
3657
|
+
def list_models request, options = nil
|
2006
3658
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
2007
3659
|
|
2008
|
-
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Translate::V3::
|
3660
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Translate::V3::ListModelsRequest
|
2009
3661
|
|
2010
3662
|
# Converts hash and nil to an options object
|
2011
3663
|
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
2012
3664
|
|
2013
3665
|
# Customize the options with defaults
|
2014
|
-
call_metadata = @config.rpcs.
|
3666
|
+
call_metadata = @config.rpcs.list_models.metadata.to_h
|
2015
3667
|
|
2016
|
-
# Set x-goog-api-client
|
3668
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
2017
3669
|
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
2018
3670
|
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
2019
3671
|
gapic_version: ::Google::Cloud::Translate::V3::VERSION,
|
2020
3672
|
transports_version_send: [:rest]
|
2021
3673
|
|
3674
|
+
call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
2022
3675
|
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
2023
3676
|
|
2024
|
-
options.apply_defaults timeout: @config.rpcs.
|
3677
|
+
options.apply_defaults timeout: @config.rpcs.list_models.timeout,
|
2025
3678
|
metadata: call_metadata,
|
2026
|
-
retry_policy: @config.rpcs.
|
3679
|
+
retry_policy: @config.rpcs.list_models.retry_policy
|
2027
3680
|
|
2028
3681
|
options.apply_defaults timeout: @config.timeout,
|
2029
3682
|
metadata: @config.metadata,
|
2030
3683
|
retry_policy: @config.retry_policy
|
2031
3684
|
|
2032
|
-
@translation_service_stub.
|
3685
|
+
@translation_service_stub.list_models request, options do |result, operation|
|
3686
|
+
result = ::Gapic::Rest::PagedEnumerable.new @translation_service_stub, :list_models, "models", request, result, options
|
2033
3687
|
yield result, operation if block_given?
|
2034
3688
|
return result
|
2035
3689
|
end
|
@@ -2038,40 +3692,30 @@ module Google
|
|
2038
3692
|
end
|
2039
3693
|
|
2040
3694
|
##
|
2041
|
-
#
|
3695
|
+
# Gets a model.
|
2042
3696
|
#
|
2043
|
-
# @overload
|
2044
|
-
# Pass arguments to `
|
2045
|
-
# {::Google::Cloud::Translate::V3::
|
3697
|
+
# @overload get_model(request, options = nil)
|
3698
|
+
# Pass arguments to `get_model` via a request object, either of type
|
3699
|
+
# {::Google::Cloud::Translate::V3::GetModelRequest} or an equivalent Hash.
|
2046
3700
|
#
|
2047
|
-
# @param request [::Google::Cloud::Translate::V3::
|
3701
|
+
# @param request [::Google::Cloud::Translate::V3::GetModelRequest, ::Hash]
|
2048
3702
|
# A request object representing the call parameters. Required. To specify no
|
2049
3703
|
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
2050
3704
|
# @param options [::Gapic::CallOptions, ::Hash]
|
2051
3705
|
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
2052
3706
|
#
|
2053
|
-
# @overload
|
2054
|
-
# Pass arguments to `
|
3707
|
+
# @overload get_model(name: nil)
|
3708
|
+
# Pass arguments to `get_model` via keyword arguments. Note that at
|
2055
3709
|
# least one keyword argument is required. To specify no parameters, or to keep all
|
2056
3710
|
# the default parameter values, pass an empty Hash as a request object (see above).
|
2057
3711
|
#
|
2058
|
-
# @param
|
2059
|
-
# Required. The resource name of the
|
2060
|
-
# MT files.
|
2061
|
-
# `projects/{project}/locations/{location}/adaptiveMtDatasets/{dataset}`
|
2062
|
-
# @param page_size [::Integer]
|
2063
|
-
# Optional.
|
2064
|
-
# @param page_token [::String]
|
2065
|
-
# Optional. A token identifying a page of results the server should return.
|
2066
|
-
# Typically, this is the value of
|
2067
|
-
# ListAdaptiveMtFilesResponse.next_page_token returned from the
|
2068
|
-
# previous call to `ListAdaptiveMtFiles` method. The first page is
|
2069
|
-
# returned if `page_token`is empty or missing.
|
3712
|
+
# @param name [::String]
|
3713
|
+
# Required. The resource name of the model to retrieve.
|
2070
3714
|
# @yield [result, operation] Access the result along with the TransportOperation object
|
2071
|
-
# @yieldparam result [::
|
3715
|
+
# @yieldparam result [::Google::Cloud::Translate::V3::Model]
|
2072
3716
|
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
2073
3717
|
#
|
2074
|
-
# @return [::
|
3718
|
+
# @return [::Google::Cloud::Translate::V3::Model]
|
2075
3719
|
#
|
2076
3720
|
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
2077
3721
|
#
|
@@ -2082,47 +3726,43 @@ module Google
|
|
2082
3726
|
# client = Google::Cloud::Translate::V3::TranslationService::Rest::Client.new
|
2083
3727
|
#
|
2084
3728
|
# # Create a request. To set request fields, pass in keyword arguments.
|
2085
|
-
# request = Google::Cloud::Translate::V3::
|
3729
|
+
# request = Google::Cloud::Translate::V3::GetModelRequest.new
|
2086
3730
|
#
|
2087
|
-
# # Call the
|
2088
|
-
# result = client.
|
3731
|
+
# # Call the get_model method.
|
3732
|
+
# result = client.get_model request
|
2089
3733
|
#
|
2090
|
-
# # The returned object is of type
|
2091
|
-
#
|
2092
|
-
# result.each do |item|
|
2093
|
-
# # Each element is of type ::Google::Cloud::Translate::V3::AdaptiveMtFile.
|
2094
|
-
# p item
|
2095
|
-
# end
|
3734
|
+
# # The returned object is of type Google::Cloud::Translate::V3::Model.
|
3735
|
+
# p result
|
2096
3736
|
#
|
2097
|
-
def
|
3737
|
+
def get_model request, options = nil
|
2098
3738
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
2099
3739
|
|
2100
|
-
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Translate::V3::
|
3740
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Translate::V3::GetModelRequest
|
2101
3741
|
|
2102
3742
|
# Converts hash and nil to an options object
|
2103
3743
|
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
2104
3744
|
|
2105
3745
|
# Customize the options with defaults
|
2106
|
-
call_metadata = @config.rpcs.
|
3746
|
+
call_metadata = @config.rpcs.get_model.metadata.to_h
|
2107
3747
|
|
2108
|
-
# Set x-goog-api-client
|
3748
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
2109
3749
|
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
2110
3750
|
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
2111
3751
|
gapic_version: ::Google::Cloud::Translate::V3::VERSION,
|
2112
3752
|
transports_version_send: [:rest]
|
2113
3753
|
|
3754
|
+
call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
2114
3755
|
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
2115
3756
|
|
2116
|
-
options.apply_defaults timeout: @config.rpcs.
|
3757
|
+
options.apply_defaults timeout: @config.rpcs.get_model.timeout,
|
2117
3758
|
metadata: call_metadata,
|
2118
|
-
retry_policy: @config.rpcs.
|
3759
|
+
retry_policy: @config.rpcs.get_model.retry_policy
|
2119
3760
|
|
2120
3761
|
options.apply_defaults timeout: @config.timeout,
|
2121
3762
|
metadata: @config.metadata,
|
2122
3763
|
retry_policy: @config.retry_policy
|
2123
3764
|
|
2124
|
-
@translation_service_stub.
|
2125
|
-
result = ::Gapic::Rest::PagedEnumerable.new @translation_service_stub, :list_adaptive_mt_files, "adaptive_mt_files", request, result, options
|
3765
|
+
@translation_service_stub.get_model request, options do |result, operation|
|
2126
3766
|
yield result, operation if block_given?
|
2127
3767
|
return result
|
2128
3768
|
end
|
@@ -2131,41 +3771,30 @@ module Google
|
|
2131
3771
|
end
|
2132
3772
|
|
2133
3773
|
##
|
2134
|
-
#
|
3774
|
+
# Deletes a model.
|
2135
3775
|
#
|
2136
|
-
# @overload
|
2137
|
-
# Pass arguments to `
|
2138
|
-
# {::Google::Cloud::Translate::V3::
|
3776
|
+
# @overload delete_model(request, options = nil)
|
3777
|
+
# Pass arguments to `delete_model` via a request object, either of type
|
3778
|
+
# {::Google::Cloud::Translate::V3::DeleteModelRequest} or an equivalent Hash.
|
2139
3779
|
#
|
2140
|
-
# @param request [::Google::Cloud::Translate::V3::
|
3780
|
+
# @param request [::Google::Cloud::Translate::V3::DeleteModelRequest, ::Hash]
|
2141
3781
|
# A request object representing the call parameters. Required. To specify no
|
2142
3782
|
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
2143
3783
|
# @param options [::Gapic::CallOptions, ::Hash]
|
2144
3784
|
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
2145
3785
|
#
|
2146
|
-
# @overload
|
2147
|
-
# Pass arguments to `
|
3786
|
+
# @overload delete_model(name: nil)
|
3787
|
+
# Pass arguments to `delete_model` via keyword arguments. Note that at
|
2148
3788
|
# least one keyword argument is required. To specify no parameters, or to keep all
|
2149
3789
|
# the default parameter values, pass an empty Hash as a request object (see above).
|
2150
3790
|
#
|
2151
|
-
# @param
|
2152
|
-
# Required. The
|
2153
|
-
# MT files. The following format lists all sentences under a file.
|
2154
|
-
# `projects/{project}/locations/{location}/adaptiveMtDatasets/{dataset}/adaptiveMtFiles/{file}`
|
2155
|
-
# The following format lists all sentences within a dataset.
|
2156
|
-
# `projects/{project}/locations/{location}/adaptiveMtDatasets/{dataset}`
|
2157
|
-
# @param page_size [::Integer]
|
2158
|
-
# @param page_token [::String]
|
2159
|
-
# A token identifying a page of results the server should return.
|
2160
|
-
# Typically, this is the value of
|
2161
|
-
# ListAdaptiveMtSentencesRequest.next_page_token returned from the
|
2162
|
-
# previous call to `ListTranslationMemories` method. The first page is
|
2163
|
-
# returned if `page_token` is empty or missing.
|
3791
|
+
# @param name [::String]
|
3792
|
+
# Required. The name of the model to delete.
|
2164
3793
|
# @yield [result, operation] Access the result along with the TransportOperation object
|
2165
|
-
# @yieldparam result [::Gapic::
|
3794
|
+
# @yieldparam result [::Gapic::Operation]
|
2166
3795
|
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
2167
3796
|
#
|
2168
|
-
# @return [::Gapic::
|
3797
|
+
# @return [::Gapic::Operation]
|
2169
3798
|
#
|
2170
3799
|
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
2171
3800
|
#
|
@@ -2176,47 +3805,51 @@ module Google
|
|
2176
3805
|
# client = Google::Cloud::Translate::V3::TranslationService::Rest::Client.new
|
2177
3806
|
#
|
2178
3807
|
# # Create a request. To set request fields, pass in keyword arguments.
|
2179
|
-
# request = Google::Cloud::Translate::V3::
|
3808
|
+
# request = Google::Cloud::Translate::V3::DeleteModelRequest.new
|
2180
3809
|
#
|
2181
|
-
# # Call the
|
2182
|
-
# result = client.
|
3810
|
+
# # Call the delete_model method.
|
3811
|
+
# result = client.delete_model request
|
2183
3812
|
#
|
2184
|
-
# # The returned object is of type Gapic::
|
2185
|
-
# #
|
2186
|
-
#
|
2187
|
-
#
|
2188
|
-
#
|
3813
|
+
# # The returned object is of type Gapic::Operation. You can use it to
|
3814
|
+
# # check the status of an operation, cancel it, or wait for results.
|
3815
|
+
# # Here is how to wait for a response.
|
3816
|
+
# result.wait_until_done! timeout: 60
|
3817
|
+
# if result.response?
|
3818
|
+
# p result.response
|
3819
|
+
# else
|
3820
|
+
# puts "No response received."
|
2189
3821
|
# end
|
2190
3822
|
#
|
2191
|
-
def
|
3823
|
+
def delete_model request, options = nil
|
2192
3824
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
2193
3825
|
|
2194
|
-
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Translate::V3::
|
3826
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Translate::V3::DeleteModelRequest
|
2195
3827
|
|
2196
3828
|
# Converts hash and nil to an options object
|
2197
3829
|
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
2198
3830
|
|
2199
3831
|
# Customize the options with defaults
|
2200
|
-
call_metadata = @config.rpcs.
|
3832
|
+
call_metadata = @config.rpcs.delete_model.metadata.to_h
|
2201
3833
|
|
2202
|
-
# Set x-goog-api-client
|
3834
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
2203
3835
|
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
2204
3836
|
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
2205
3837
|
gapic_version: ::Google::Cloud::Translate::V3::VERSION,
|
2206
3838
|
transports_version_send: [:rest]
|
2207
3839
|
|
3840
|
+
call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
2208
3841
|
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
2209
3842
|
|
2210
|
-
options.apply_defaults timeout: @config.rpcs.
|
3843
|
+
options.apply_defaults timeout: @config.rpcs.delete_model.timeout,
|
2211
3844
|
metadata: call_metadata,
|
2212
|
-
retry_policy: @config.rpcs.
|
3845
|
+
retry_policy: @config.rpcs.delete_model.retry_policy
|
2213
3846
|
|
2214
3847
|
options.apply_defaults timeout: @config.timeout,
|
2215
3848
|
metadata: @config.metadata,
|
2216
3849
|
retry_policy: @config.retry_policy
|
2217
3850
|
|
2218
|
-
@translation_service_stub.
|
2219
|
-
result = ::Gapic::
|
3851
|
+
@translation_service_stub.delete_model request, options do |result, operation|
|
3852
|
+
result = ::Gapic::Operation.new result, @operations_client, options: options
|
2220
3853
|
yield result, operation if block_given?
|
2221
3854
|
return result
|
2222
3855
|
end
|
@@ -2320,6 +3953,13 @@ module Google
|
|
2320
3953
|
config_attr :quota_project, nil, ::String, nil
|
2321
3954
|
config_attr :universe_domain, nil, ::String, nil
|
2322
3955
|
|
3956
|
+
# @private
|
3957
|
+
# Overrides for http bindings for the RPCs of this service
|
3958
|
+
# are only used when this service is used as mixin, and only
|
3959
|
+
# by the host service.
|
3960
|
+
# @return [::Hash{::Symbol=>::Array<::Gapic::Rest::GrpcTranscoder::HttpBinding>}]
|
3961
|
+
config_attr :bindings_override, {}, ::Hash, nil
|
3962
|
+
|
2323
3963
|
# @private
|
2324
3964
|
def initialize parent_config = nil
|
2325
3965
|
@parent_config = parent_config unless parent_config.nil?
|
@@ -2363,6 +4003,11 @@ module Google
|
|
2363
4003
|
#
|
2364
4004
|
attr_reader :translate_text
|
2365
4005
|
##
|
4006
|
+
# RPC-specific configuration for `romanize_text`
|
4007
|
+
# @return [::Gapic::Config::Method]
|
4008
|
+
#
|
4009
|
+
attr_reader :romanize_text
|
4010
|
+
##
|
2366
4011
|
# RPC-specific configuration for `detect_language`
|
2367
4012
|
# @return [::Gapic::Config::Method]
|
2368
4013
|
#
|
@@ -2393,6 +4038,11 @@ module Google
|
|
2393
4038
|
#
|
2394
4039
|
attr_reader :create_glossary
|
2395
4040
|
##
|
4041
|
+
# RPC-specific configuration for `update_glossary`
|
4042
|
+
# @return [::Gapic::Config::Method]
|
4043
|
+
#
|
4044
|
+
attr_reader :update_glossary
|
4045
|
+
##
|
2396
4046
|
# RPC-specific configuration for `list_glossaries`
|
2397
4047
|
# @return [::Gapic::Config::Method]
|
2398
4048
|
#
|
@@ -2408,6 +4058,51 @@ module Google
|
|
2408
4058
|
#
|
2409
4059
|
attr_reader :delete_glossary
|
2410
4060
|
##
|
4061
|
+
# RPC-specific configuration for `get_glossary_entry`
|
4062
|
+
# @return [::Gapic::Config::Method]
|
4063
|
+
#
|
4064
|
+
attr_reader :get_glossary_entry
|
4065
|
+
##
|
4066
|
+
# RPC-specific configuration for `list_glossary_entries`
|
4067
|
+
# @return [::Gapic::Config::Method]
|
4068
|
+
#
|
4069
|
+
attr_reader :list_glossary_entries
|
4070
|
+
##
|
4071
|
+
# RPC-specific configuration for `create_glossary_entry`
|
4072
|
+
# @return [::Gapic::Config::Method]
|
4073
|
+
#
|
4074
|
+
attr_reader :create_glossary_entry
|
4075
|
+
##
|
4076
|
+
# RPC-specific configuration for `update_glossary_entry`
|
4077
|
+
# @return [::Gapic::Config::Method]
|
4078
|
+
#
|
4079
|
+
attr_reader :update_glossary_entry
|
4080
|
+
##
|
4081
|
+
# RPC-specific configuration for `delete_glossary_entry`
|
4082
|
+
# @return [::Gapic::Config::Method]
|
4083
|
+
#
|
4084
|
+
attr_reader :delete_glossary_entry
|
4085
|
+
##
|
4086
|
+
# RPC-specific configuration for `create_dataset`
|
4087
|
+
# @return [::Gapic::Config::Method]
|
4088
|
+
#
|
4089
|
+
attr_reader :create_dataset
|
4090
|
+
##
|
4091
|
+
# RPC-specific configuration for `get_dataset`
|
4092
|
+
# @return [::Gapic::Config::Method]
|
4093
|
+
#
|
4094
|
+
attr_reader :get_dataset
|
4095
|
+
##
|
4096
|
+
# RPC-specific configuration for `list_datasets`
|
4097
|
+
# @return [::Gapic::Config::Method]
|
4098
|
+
#
|
4099
|
+
attr_reader :list_datasets
|
4100
|
+
##
|
4101
|
+
# RPC-specific configuration for `delete_dataset`
|
4102
|
+
# @return [::Gapic::Config::Method]
|
4103
|
+
#
|
4104
|
+
attr_reader :delete_dataset
|
4105
|
+
##
|
2411
4106
|
# RPC-specific configuration for `create_adaptive_mt_dataset`
|
2412
4107
|
# @return [::Gapic::Config::Method]
|
2413
4108
|
#
|
@@ -2457,11 +4152,48 @@ module Google
|
|
2457
4152
|
# @return [::Gapic::Config::Method]
|
2458
4153
|
#
|
2459
4154
|
attr_reader :list_adaptive_mt_sentences
|
4155
|
+
##
|
4156
|
+
# RPC-specific configuration for `import_data`
|
4157
|
+
# @return [::Gapic::Config::Method]
|
4158
|
+
#
|
4159
|
+
attr_reader :import_data
|
4160
|
+
##
|
4161
|
+
# RPC-specific configuration for `export_data`
|
4162
|
+
# @return [::Gapic::Config::Method]
|
4163
|
+
#
|
4164
|
+
attr_reader :export_data
|
4165
|
+
##
|
4166
|
+
# RPC-specific configuration for `list_examples`
|
4167
|
+
# @return [::Gapic::Config::Method]
|
4168
|
+
#
|
4169
|
+
attr_reader :list_examples
|
4170
|
+
##
|
4171
|
+
# RPC-specific configuration for `create_model`
|
4172
|
+
# @return [::Gapic::Config::Method]
|
4173
|
+
#
|
4174
|
+
attr_reader :create_model
|
4175
|
+
##
|
4176
|
+
# RPC-specific configuration for `list_models`
|
4177
|
+
# @return [::Gapic::Config::Method]
|
4178
|
+
#
|
4179
|
+
attr_reader :list_models
|
4180
|
+
##
|
4181
|
+
# RPC-specific configuration for `get_model`
|
4182
|
+
# @return [::Gapic::Config::Method]
|
4183
|
+
#
|
4184
|
+
attr_reader :get_model
|
4185
|
+
##
|
4186
|
+
# RPC-specific configuration for `delete_model`
|
4187
|
+
# @return [::Gapic::Config::Method]
|
4188
|
+
#
|
4189
|
+
attr_reader :delete_model
|
2460
4190
|
|
2461
4191
|
# @private
|
2462
4192
|
def initialize parent_rpcs = nil
|
2463
4193
|
translate_text_config = parent_rpcs.translate_text if parent_rpcs.respond_to? :translate_text
|
2464
4194
|
@translate_text = ::Gapic::Config::Method.new translate_text_config
|
4195
|
+
romanize_text_config = parent_rpcs.romanize_text if parent_rpcs.respond_to? :romanize_text
|
4196
|
+
@romanize_text = ::Gapic::Config::Method.new romanize_text_config
|
2465
4197
|
detect_language_config = parent_rpcs.detect_language if parent_rpcs.respond_to? :detect_language
|
2466
4198
|
@detect_language = ::Gapic::Config::Method.new detect_language_config
|
2467
4199
|
get_supported_languages_config = parent_rpcs.get_supported_languages if parent_rpcs.respond_to? :get_supported_languages
|
@@ -2474,12 +4206,32 @@ module Google
|
|
2474
4206
|
@batch_translate_document = ::Gapic::Config::Method.new batch_translate_document_config
|
2475
4207
|
create_glossary_config = parent_rpcs.create_glossary if parent_rpcs.respond_to? :create_glossary
|
2476
4208
|
@create_glossary = ::Gapic::Config::Method.new create_glossary_config
|
4209
|
+
update_glossary_config = parent_rpcs.update_glossary if parent_rpcs.respond_to? :update_glossary
|
4210
|
+
@update_glossary = ::Gapic::Config::Method.new update_glossary_config
|
2477
4211
|
list_glossaries_config = parent_rpcs.list_glossaries if parent_rpcs.respond_to? :list_glossaries
|
2478
4212
|
@list_glossaries = ::Gapic::Config::Method.new list_glossaries_config
|
2479
4213
|
get_glossary_config = parent_rpcs.get_glossary if parent_rpcs.respond_to? :get_glossary
|
2480
4214
|
@get_glossary = ::Gapic::Config::Method.new get_glossary_config
|
2481
4215
|
delete_glossary_config = parent_rpcs.delete_glossary if parent_rpcs.respond_to? :delete_glossary
|
2482
4216
|
@delete_glossary = ::Gapic::Config::Method.new delete_glossary_config
|
4217
|
+
get_glossary_entry_config = parent_rpcs.get_glossary_entry if parent_rpcs.respond_to? :get_glossary_entry
|
4218
|
+
@get_glossary_entry = ::Gapic::Config::Method.new get_glossary_entry_config
|
4219
|
+
list_glossary_entries_config = parent_rpcs.list_glossary_entries if parent_rpcs.respond_to? :list_glossary_entries
|
4220
|
+
@list_glossary_entries = ::Gapic::Config::Method.new list_glossary_entries_config
|
4221
|
+
create_glossary_entry_config = parent_rpcs.create_glossary_entry if parent_rpcs.respond_to? :create_glossary_entry
|
4222
|
+
@create_glossary_entry = ::Gapic::Config::Method.new create_glossary_entry_config
|
4223
|
+
update_glossary_entry_config = parent_rpcs.update_glossary_entry if parent_rpcs.respond_to? :update_glossary_entry
|
4224
|
+
@update_glossary_entry = ::Gapic::Config::Method.new update_glossary_entry_config
|
4225
|
+
delete_glossary_entry_config = parent_rpcs.delete_glossary_entry if parent_rpcs.respond_to? :delete_glossary_entry
|
4226
|
+
@delete_glossary_entry = ::Gapic::Config::Method.new delete_glossary_entry_config
|
4227
|
+
create_dataset_config = parent_rpcs.create_dataset if parent_rpcs.respond_to? :create_dataset
|
4228
|
+
@create_dataset = ::Gapic::Config::Method.new create_dataset_config
|
4229
|
+
get_dataset_config = parent_rpcs.get_dataset if parent_rpcs.respond_to? :get_dataset
|
4230
|
+
@get_dataset = ::Gapic::Config::Method.new get_dataset_config
|
4231
|
+
list_datasets_config = parent_rpcs.list_datasets if parent_rpcs.respond_to? :list_datasets
|
4232
|
+
@list_datasets = ::Gapic::Config::Method.new list_datasets_config
|
4233
|
+
delete_dataset_config = parent_rpcs.delete_dataset if parent_rpcs.respond_to? :delete_dataset
|
4234
|
+
@delete_dataset = ::Gapic::Config::Method.new delete_dataset_config
|
2483
4235
|
create_adaptive_mt_dataset_config = parent_rpcs.create_adaptive_mt_dataset if parent_rpcs.respond_to? :create_adaptive_mt_dataset
|
2484
4236
|
@create_adaptive_mt_dataset = ::Gapic::Config::Method.new create_adaptive_mt_dataset_config
|
2485
4237
|
delete_adaptive_mt_dataset_config = parent_rpcs.delete_adaptive_mt_dataset if parent_rpcs.respond_to? :delete_adaptive_mt_dataset
|
@@ -2500,6 +4252,20 @@ module Google
|
|
2500
4252
|
@list_adaptive_mt_files = ::Gapic::Config::Method.new list_adaptive_mt_files_config
|
2501
4253
|
list_adaptive_mt_sentences_config = parent_rpcs.list_adaptive_mt_sentences if parent_rpcs.respond_to? :list_adaptive_mt_sentences
|
2502
4254
|
@list_adaptive_mt_sentences = ::Gapic::Config::Method.new list_adaptive_mt_sentences_config
|
4255
|
+
import_data_config = parent_rpcs.import_data if parent_rpcs.respond_to? :import_data
|
4256
|
+
@import_data = ::Gapic::Config::Method.new import_data_config
|
4257
|
+
export_data_config = parent_rpcs.export_data if parent_rpcs.respond_to? :export_data
|
4258
|
+
@export_data = ::Gapic::Config::Method.new export_data_config
|
4259
|
+
list_examples_config = parent_rpcs.list_examples if parent_rpcs.respond_to? :list_examples
|
4260
|
+
@list_examples = ::Gapic::Config::Method.new list_examples_config
|
4261
|
+
create_model_config = parent_rpcs.create_model if parent_rpcs.respond_to? :create_model
|
4262
|
+
@create_model = ::Gapic::Config::Method.new create_model_config
|
4263
|
+
list_models_config = parent_rpcs.list_models if parent_rpcs.respond_to? :list_models
|
4264
|
+
@list_models = ::Gapic::Config::Method.new list_models_config
|
4265
|
+
get_model_config = parent_rpcs.get_model if parent_rpcs.respond_to? :get_model
|
4266
|
+
@get_model = ::Gapic::Config::Method.new get_model_config
|
4267
|
+
delete_model_config = parent_rpcs.delete_model if parent_rpcs.respond_to? :delete_model
|
4268
|
+
@delete_model = ::Gapic::Config::Method.new delete_model_config
|
2503
4269
|
|
2504
4270
|
yield self if block_given?
|
2505
4271
|
end
|