aws-sdk-translate 1.50.0 → 1.51.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/CHANGELOG.md +5 -0
- data/VERSION +1 -1
- data/lib/aws-sdk-translate/client.rb +128 -8
- data/lib/aws-sdk-translate/client_api.rb +42 -0
- data/lib/aws-sdk-translate/endpoint_parameters.rb +0 -3
- data/lib/aws-sdk-translate/endpoint_provider.rb +27 -24
- data/lib/aws-sdk-translate/endpoints.rb +14 -0
- data/lib/aws-sdk-translate/plugins/endpoints.rb +2 -0
- data/lib/aws-sdk-translate/types.rb +173 -20
- data/lib/aws-sdk-translate.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 58b2f09fd6d7932e95f8beb86a52dc0e8c6ee5b3cfe67cc40b12a9d60187502e
|
4
|
+
data.tar.gz: d5415777d6625dc807b4178aa046e68e1fe5b7d7afb4e058f987b2973c25dd08
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b2aea410b774f8846d72a120752dd364de9852d4f973d8d11d82901f1b5f5b6994664b1b53fcaf6f41471591cd9833f38f85d31f21dc91fd314cffb54285c051
|
7
|
+
data.tar.gz: 14cc7ba496daa9fbea3750db44e05a189e8f5a8d9d4dbb769e100febbc1c861abafa4f98205d9d6507284209a62191beaa47eab111bdcf967b4d98ceb52c95ae
|
data/CHANGELOG.md
CHANGED
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.
|
1
|
+
1.51.0
|
@@ -1289,6 +1289,112 @@ module Aws::Translate
|
|
1289
1289
|
req.send_request(options)
|
1290
1290
|
end
|
1291
1291
|
|
1292
|
+
# Translates the input document from the source language to the target
|
1293
|
+
# language. This synchronous operation supports plain text or HTML for
|
1294
|
+
# the input document. `TranslateDocument` supports translations from
|
1295
|
+
# English to any supported language, and from any supported language to
|
1296
|
+
# English. Therefore, specify either the source language code or the
|
1297
|
+
# target language code as “en” (English).
|
1298
|
+
#
|
1299
|
+
# `TranslateDocument` does not support language auto-detection.
|
1300
|
+
#
|
1301
|
+
# If you set the `Formality` parameter, the request will fail if the
|
1302
|
+
# target language does not support formality. For a list of target
|
1303
|
+
# languages that support formality, see [Setting formality][1].
|
1304
|
+
#
|
1305
|
+
#
|
1306
|
+
#
|
1307
|
+
# [1]: https://docs.aws.amazon.com/translate/latest/dg/customizing-translations-formality.html
|
1308
|
+
#
|
1309
|
+
# @option params [required, Types::Document] :document
|
1310
|
+
# The content and content type for the document to be translated. The
|
1311
|
+
# document size must not exceed 100 KB.
|
1312
|
+
#
|
1313
|
+
# @option params [Array<String>] :terminology_names
|
1314
|
+
# The name of a terminology list file to add to the translation job.
|
1315
|
+
# This file provides source terms and the desired translation for each
|
1316
|
+
# term. A terminology list can contain a maximum of 256 terms. You can
|
1317
|
+
# use one custom terminology resource in your translation request.
|
1318
|
+
#
|
1319
|
+
# Use the ListTerminologies operation to get the available terminology
|
1320
|
+
# lists.
|
1321
|
+
#
|
1322
|
+
# For more information about custom terminology lists, see [Custom
|
1323
|
+
# terminology][1].
|
1324
|
+
#
|
1325
|
+
#
|
1326
|
+
#
|
1327
|
+
# [1]: https://docs.aws.amazon.com/translate/latest/dg/how-custom-terminology.html
|
1328
|
+
#
|
1329
|
+
# @option params [required, String] :source_language_code
|
1330
|
+
# The language code for the language of the source text. Do not use
|
1331
|
+
# `auto`, because `TranslateDocument` does not support language
|
1332
|
+
# auto-detection. For a list of supported language codes, see [Supported
|
1333
|
+
# languages][1].
|
1334
|
+
#
|
1335
|
+
#
|
1336
|
+
#
|
1337
|
+
# [1]: https://docs.aws.amazon.com/translate/latest/dg/what-is-languages.html
|
1338
|
+
#
|
1339
|
+
# @option params [required, String] :target_language_code
|
1340
|
+
# The language code requested for the translated document. For a list of
|
1341
|
+
# supported language codes, see [Supported languages][1].
|
1342
|
+
#
|
1343
|
+
#
|
1344
|
+
#
|
1345
|
+
# [1]: https://docs.aws.amazon.com/translate/latest/dg/what-is-languages.html
|
1346
|
+
#
|
1347
|
+
# @option params [Types::TranslationSettings] :settings
|
1348
|
+
# Settings to configure your translation output, including the option to
|
1349
|
+
# set the formality level of the output text and the option to mask
|
1350
|
+
# profane words and phrases.
|
1351
|
+
#
|
1352
|
+
# @return [Types::TranslateDocumentResponse] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
|
1353
|
+
#
|
1354
|
+
# * {Types::TranslateDocumentResponse#translated_document #translated_document} => Types::TranslatedDocument
|
1355
|
+
# * {Types::TranslateDocumentResponse#source_language_code #source_language_code} => String
|
1356
|
+
# * {Types::TranslateDocumentResponse#target_language_code #target_language_code} => String
|
1357
|
+
# * {Types::TranslateDocumentResponse#applied_terminologies #applied_terminologies} => Array<Types::AppliedTerminology>
|
1358
|
+
# * {Types::TranslateDocumentResponse#applied_settings #applied_settings} => Types::TranslationSettings
|
1359
|
+
#
|
1360
|
+
# @example Request syntax with placeholder values
|
1361
|
+
#
|
1362
|
+
# resp = client.translate_document({
|
1363
|
+
# document: { # required
|
1364
|
+
# content: "data", # required
|
1365
|
+
# content_type: "ContentType", # required
|
1366
|
+
# },
|
1367
|
+
# terminology_names: ["ResourceName"],
|
1368
|
+
# source_language_code: "LanguageCodeString", # required
|
1369
|
+
# target_language_code: "LanguageCodeString", # required
|
1370
|
+
# settings: {
|
1371
|
+
# formality: "FORMAL", # accepts FORMAL, INFORMAL
|
1372
|
+
# profanity: "MASK", # accepts MASK
|
1373
|
+
# },
|
1374
|
+
# })
|
1375
|
+
#
|
1376
|
+
# @example Response structure
|
1377
|
+
#
|
1378
|
+
# resp.translated_document.content #=> String
|
1379
|
+
# resp.source_language_code #=> String
|
1380
|
+
# resp.target_language_code #=> String
|
1381
|
+
# resp.applied_terminologies #=> Array
|
1382
|
+
# resp.applied_terminologies[0].name #=> String
|
1383
|
+
# resp.applied_terminologies[0].terms #=> Array
|
1384
|
+
# resp.applied_terminologies[0].terms[0].source_text #=> String
|
1385
|
+
# resp.applied_terminologies[0].terms[0].target_text #=> String
|
1386
|
+
# resp.applied_settings.formality #=> String, one of "FORMAL", "INFORMAL"
|
1387
|
+
# resp.applied_settings.profanity #=> String, one of "MASK"
|
1388
|
+
#
|
1389
|
+
# @see http://docs.aws.amazon.com/goto/WebAPI/translate-2017-07-01/TranslateDocument AWS API Documentation
|
1390
|
+
#
|
1391
|
+
# @overload translate_document(params = {})
|
1392
|
+
# @param [Hash] params ({})
|
1393
|
+
def translate_document(params = {}, options = {})
|
1394
|
+
req = build_request(:translate_document, params)
|
1395
|
+
req.send_request(options)
|
1396
|
+
end
|
1397
|
+
|
1292
1398
|
# Translates input text from the source language to the target language.
|
1293
1399
|
# For a list of available languages and language codes, see [Supported
|
1294
1400
|
# languages][1].
|
@@ -1303,13 +1409,23 @@ module Aws::Translate
|
|
1303
1409
|
# 10,000 characters.
|
1304
1410
|
#
|
1305
1411
|
# @option params [Array<String>] :terminology_names
|
1306
|
-
# The name of
|
1307
|
-
#
|
1308
|
-
#
|
1412
|
+
# The name of a terminology list file to add to the translation job.
|
1413
|
+
# This file provides source terms and the desired translation for each
|
1414
|
+
# term. A terminology list can contain a maximum of 256 terms. You can
|
1415
|
+
# use one custom terminology resource in your translation request.
|
1416
|
+
#
|
1417
|
+
# Use the ListTerminologies operation to get the available terminology
|
1418
|
+
# lists.
|
1419
|
+
#
|
1420
|
+
# For more information about custom terminology lists, see [Custom
|
1421
|
+
# terminology][1].
|
1422
|
+
#
|
1423
|
+
#
|
1424
|
+
#
|
1425
|
+
# [1]: https://docs.aws.amazon.com/translate/latest/dg/how-custom-terminology.html
|
1309
1426
|
#
|
1310
1427
|
# @option params [required, String] :source_language_code
|
1311
|
-
# The language code for the language of the source text.
|
1312
|
-
# must be a language supported by Amazon Translate. For a list of
|
1428
|
+
# The language code for the language of the source text. For a list of
|
1313
1429
|
# language codes, see [Supported languages][1].
|
1314
1430
|
#
|
1315
1431
|
# To have Amazon Translate determine the source language of your text,
|
@@ -1329,8 +1445,12 @@ module Aws::Translate
|
|
1329
1445
|
# [2]: https://docs.aws.amazon.com/comprehend/latest/dg/comprehend-general.html
|
1330
1446
|
#
|
1331
1447
|
# @option params [required, String] :target_language_code
|
1332
|
-
# The language code requested for the language of the target text.
|
1333
|
-
#
|
1448
|
+
# The language code requested for the language of the target text. For a
|
1449
|
+
# list of language codes, see [Supported languages][1].
|
1450
|
+
#
|
1451
|
+
#
|
1452
|
+
#
|
1453
|
+
# [1]: https://docs.aws.amazon.com/translate/latest/dg/what-is-languages.html
|
1334
1454
|
#
|
1335
1455
|
# @option params [Types::TranslationSettings] :settings
|
1336
1456
|
# Settings to configure your translation output, including the option to
|
@@ -1482,7 +1602,7 @@ module Aws::Translate
|
|
1482
1602
|
params: params,
|
1483
1603
|
config: config)
|
1484
1604
|
context[:gem_name] = 'aws-sdk-translate'
|
1485
|
-
context[:gem_version] = '1.
|
1605
|
+
context[:gem_version] = '1.51.0'
|
1486
1606
|
Seahorse::Client::Request.new(handlers, context)
|
1487
1607
|
end
|
1488
1608
|
|
@@ -31,6 +31,8 @@ module Aws::Translate
|
|
31
31
|
DetectedLanguageLowConfidenceException = Shapes::StructureShape.new(name: 'DetectedLanguageLowConfidenceException')
|
32
32
|
Directionality = Shapes::StringShape.new(name: 'Directionality')
|
33
33
|
DisplayLanguageCode = Shapes::StringShape.new(name: 'DisplayLanguageCode')
|
34
|
+
Document = Shapes::StructureShape.new(name: 'Document')
|
35
|
+
DocumentContent = Shapes::BlobShape.new(name: 'DocumentContent')
|
34
36
|
EncryptionKey = Shapes::StructureShape.new(name: 'EncryptionKey')
|
35
37
|
EncryptionKeyID = Shapes::StringShape.new(name: 'EncryptionKeyID')
|
36
38
|
EncryptionKeyType = Shapes::StringShape.new(name: 'EncryptionKeyType')
|
@@ -116,8 +118,12 @@ module Aws::Translate
|
|
116
118
|
Timestamp = Shapes::TimestampShape.new(name: 'Timestamp')
|
117
119
|
TooManyRequestsException = Shapes::StructureShape.new(name: 'TooManyRequestsException')
|
118
120
|
TooManyTagsException = Shapes::StructureShape.new(name: 'TooManyTagsException')
|
121
|
+
TranslateDocumentRequest = Shapes::StructureShape.new(name: 'TranslateDocumentRequest')
|
122
|
+
TranslateDocumentResponse = Shapes::StructureShape.new(name: 'TranslateDocumentResponse')
|
119
123
|
TranslateTextRequest = Shapes::StructureShape.new(name: 'TranslateTextRequest')
|
120
124
|
TranslateTextResponse = Shapes::StructureShape.new(name: 'TranslateTextResponse')
|
125
|
+
TranslatedDocument = Shapes::StructureShape.new(name: 'TranslatedDocument')
|
126
|
+
TranslatedDocumentContent = Shapes::BlobShape.new(name: 'TranslatedDocumentContent')
|
121
127
|
TranslatedTextString = Shapes::StringShape.new(name: 'TranslatedTextString')
|
122
128
|
TranslationSettings = Shapes::StructureShape.new(name: 'TranslationSettings')
|
123
129
|
UnboundedLengthString = Shapes::StringShape.new(name: 'UnboundedLengthString')
|
@@ -172,6 +178,10 @@ module Aws::Translate
|
|
172
178
|
DetectedLanguageLowConfidenceException.add_member(:detected_language_code, Shapes::ShapeRef.new(shape: LanguageCodeString, location_name: "DetectedLanguageCode"))
|
173
179
|
DetectedLanguageLowConfidenceException.struct_class = Types::DetectedLanguageLowConfidenceException
|
174
180
|
|
181
|
+
Document.add_member(:content, Shapes::ShapeRef.new(shape: DocumentContent, required: true, location_name: "Content"))
|
182
|
+
Document.add_member(:content_type, Shapes::ShapeRef.new(shape: ContentType, required: true, location_name: "ContentType"))
|
183
|
+
Document.struct_class = Types::Document
|
184
|
+
|
175
185
|
EncryptionKey.add_member(:type, Shapes::ShapeRef.new(shape: EncryptionKeyType, required: true, location_name: "Type"))
|
176
186
|
EncryptionKey.add_member(:id, Shapes::ShapeRef.new(shape: EncryptionKeyID, required: true, location_name: "Id"))
|
177
187
|
EncryptionKey.struct_class = Types::EncryptionKey
|
@@ -427,6 +437,20 @@ module Aws::Translate
|
|
427
437
|
TooManyTagsException.add_member(:resource_arn, Shapes::ShapeRef.new(shape: ResourceArn, location_name: "ResourceArn"))
|
428
438
|
TooManyTagsException.struct_class = Types::TooManyTagsException
|
429
439
|
|
440
|
+
TranslateDocumentRequest.add_member(:document, Shapes::ShapeRef.new(shape: Document, required: true, location_name: "Document"))
|
441
|
+
TranslateDocumentRequest.add_member(:terminology_names, Shapes::ShapeRef.new(shape: ResourceNameList, location_name: "TerminologyNames"))
|
442
|
+
TranslateDocumentRequest.add_member(:source_language_code, Shapes::ShapeRef.new(shape: LanguageCodeString, required: true, location_name: "SourceLanguageCode"))
|
443
|
+
TranslateDocumentRequest.add_member(:target_language_code, Shapes::ShapeRef.new(shape: LanguageCodeString, required: true, location_name: "TargetLanguageCode"))
|
444
|
+
TranslateDocumentRequest.add_member(:settings, Shapes::ShapeRef.new(shape: TranslationSettings, location_name: "Settings"))
|
445
|
+
TranslateDocumentRequest.struct_class = Types::TranslateDocumentRequest
|
446
|
+
|
447
|
+
TranslateDocumentResponse.add_member(:translated_document, Shapes::ShapeRef.new(shape: TranslatedDocument, required: true, location_name: "TranslatedDocument"))
|
448
|
+
TranslateDocumentResponse.add_member(:source_language_code, Shapes::ShapeRef.new(shape: LanguageCodeString, required: true, location_name: "SourceLanguageCode"))
|
449
|
+
TranslateDocumentResponse.add_member(:target_language_code, Shapes::ShapeRef.new(shape: LanguageCodeString, required: true, location_name: "TargetLanguageCode"))
|
450
|
+
TranslateDocumentResponse.add_member(:applied_terminologies, Shapes::ShapeRef.new(shape: AppliedTerminologyList, location_name: "AppliedTerminologies"))
|
451
|
+
TranslateDocumentResponse.add_member(:applied_settings, Shapes::ShapeRef.new(shape: TranslationSettings, location_name: "AppliedSettings"))
|
452
|
+
TranslateDocumentResponse.struct_class = Types::TranslateDocumentResponse
|
453
|
+
|
430
454
|
TranslateTextRequest.add_member(:text, Shapes::ShapeRef.new(shape: BoundedLengthString, required: true, location_name: "Text"))
|
431
455
|
TranslateTextRequest.add_member(:terminology_names, Shapes::ShapeRef.new(shape: ResourceNameList, location_name: "TerminologyNames"))
|
432
456
|
TranslateTextRequest.add_member(:source_language_code, Shapes::ShapeRef.new(shape: LanguageCodeString, required: true, location_name: "SourceLanguageCode"))
|
@@ -441,6 +465,9 @@ module Aws::Translate
|
|
441
465
|
TranslateTextResponse.add_member(:applied_settings, Shapes::ShapeRef.new(shape: TranslationSettings, location_name: "AppliedSettings"))
|
442
466
|
TranslateTextResponse.struct_class = Types::TranslateTextResponse
|
443
467
|
|
468
|
+
TranslatedDocument.add_member(:content, Shapes::ShapeRef.new(shape: TranslatedDocumentContent, required: true, location_name: "Content"))
|
469
|
+
TranslatedDocument.struct_class = Types::TranslatedDocument
|
470
|
+
|
444
471
|
TranslationSettings.add_member(:formality, Shapes::ShapeRef.new(shape: Formality, location_name: "Formality"))
|
445
472
|
TranslationSettings.add_member(:profanity, Shapes::ShapeRef.new(shape: Profanity, location_name: "Profanity"))
|
446
473
|
TranslationSettings.struct_class = Types::TranslationSettings
|
@@ -699,6 +726,21 @@ module Aws::Translate
|
|
699
726
|
o.errors << Shapes::ShapeRef.new(shape: InternalServerException)
|
700
727
|
end)
|
701
728
|
|
729
|
+
api.add_operation(:translate_document, Seahorse::Model::Operation.new.tap do |o|
|
730
|
+
o.name = "TranslateDocument"
|
731
|
+
o.http_method = "POST"
|
732
|
+
o.http_request_uri = "/"
|
733
|
+
o.input = Shapes::ShapeRef.new(shape: TranslateDocumentRequest)
|
734
|
+
o.output = Shapes::ShapeRef.new(shape: TranslateDocumentResponse)
|
735
|
+
o.errors << Shapes::ShapeRef.new(shape: InvalidRequestException)
|
736
|
+
o.errors << Shapes::ShapeRef.new(shape: LimitExceededException)
|
737
|
+
o.errors << Shapes::ShapeRef.new(shape: TooManyRequestsException)
|
738
|
+
o.errors << Shapes::ShapeRef.new(shape: ResourceNotFoundException)
|
739
|
+
o.errors << Shapes::ShapeRef.new(shape: UnsupportedLanguagePairException)
|
740
|
+
o.errors << Shapes::ShapeRef.new(shape: InternalServerException)
|
741
|
+
o.errors << Shapes::ShapeRef.new(shape: ServiceUnavailableException)
|
742
|
+
end)
|
743
|
+
|
702
744
|
api.add_operation(:translate_text, Seahorse::Model::Operation.new.tap do |o|
|
703
745
|
o.name = "TranslateText"
|
704
746
|
o.http_method = "POST"
|
@@ -50,9 +50,6 @@ module Aws::Translate
|
|
50
50
|
|
51
51
|
def initialize(options = {})
|
52
52
|
self[:region] = options[:region]
|
53
|
-
if self[:region].nil?
|
54
|
-
raise ArgumentError, "Missing required EndpointParameter: :region"
|
55
|
-
end
|
56
53
|
self[:use_dual_stack] = options[:use_dual_stack]
|
57
54
|
self[:use_dual_stack] = false if self[:use_dual_stack].nil?
|
58
55
|
if self[:use_dual_stack].nil?
|
@@ -14,36 +14,39 @@ module Aws::Translate
|
|
14
14
|
use_dual_stack = parameters.use_dual_stack
|
15
15
|
use_fips = parameters.use_fips
|
16
16
|
endpoint = parameters.endpoint
|
17
|
-
if
|
18
|
-
if Aws::Endpoints::Matchers.set?(endpoint)
|
19
|
-
if Aws::Endpoints::Matchers.boolean_equals?(use_fips, true)
|
20
|
-
raise ArgumentError, "Invalid Configuration: FIPS and custom endpoint are not supported"
|
21
|
-
end
|
22
|
-
if Aws::Endpoints::Matchers.boolean_equals?(use_dual_stack, true)
|
23
|
-
raise ArgumentError, "Invalid Configuration: Dualstack and custom endpoint are not supported"
|
24
|
-
end
|
25
|
-
return Aws::Endpoints::Endpoint.new(url: endpoint, headers: {}, properties: {})
|
26
|
-
end
|
27
|
-
if Aws::Endpoints::Matchers.boolean_equals?(use_fips, true) && Aws::Endpoints::Matchers.boolean_equals?(use_dual_stack, true)
|
28
|
-
if Aws::Endpoints::Matchers.boolean_equals?(true, Aws::Endpoints::Matchers.attr(partition_result, "supportsFIPS")) && Aws::Endpoints::Matchers.boolean_equals?(true, Aws::Endpoints::Matchers.attr(partition_result, "supportsDualStack"))
|
29
|
-
return Aws::Endpoints::Endpoint.new(url: "https://translate-fips.#{region}.#{partition_result['dualStackDnsSuffix']}", headers: {}, properties: {})
|
30
|
-
end
|
31
|
-
raise ArgumentError, "FIPS and DualStack are enabled, but this partition does not support one or both"
|
32
|
-
end
|
17
|
+
if Aws::Endpoints::Matchers.set?(endpoint)
|
33
18
|
if Aws::Endpoints::Matchers.boolean_equals?(use_fips, true)
|
34
|
-
|
35
|
-
return Aws::Endpoints::Endpoint.new(url: "https://translate-fips.#{region}.#{partition_result['dnsSuffix']}", headers: {}, properties: {})
|
36
|
-
end
|
37
|
-
raise ArgumentError, "FIPS is enabled but this partition does not support FIPS"
|
19
|
+
raise ArgumentError, "Invalid Configuration: FIPS and custom endpoint are not supported"
|
38
20
|
end
|
39
21
|
if Aws::Endpoints::Matchers.boolean_equals?(use_dual_stack, true)
|
40
|
-
|
41
|
-
|
22
|
+
raise ArgumentError, "Invalid Configuration: Dualstack and custom endpoint are not supported"
|
23
|
+
end
|
24
|
+
return Aws::Endpoints::Endpoint.new(url: endpoint, headers: {}, properties: {})
|
25
|
+
end
|
26
|
+
if Aws::Endpoints::Matchers.set?(region)
|
27
|
+
if (partition_result = Aws::Endpoints::Matchers.aws_partition(region))
|
28
|
+
if Aws::Endpoints::Matchers.boolean_equals?(use_fips, true) && Aws::Endpoints::Matchers.boolean_equals?(use_dual_stack, true)
|
29
|
+
if Aws::Endpoints::Matchers.boolean_equals?(true, Aws::Endpoints::Matchers.attr(partition_result, "supportsFIPS")) && Aws::Endpoints::Matchers.boolean_equals?(true, Aws::Endpoints::Matchers.attr(partition_result, "supportsDualStack"))
|
30
|
+
return Aws::Endpoints::Endpoint.new(url: "https://translate-fips.#{region}.#{partition_result['dualStackDnsSuffix']}", headers: {}, properties: {})
|
31
|
+
end
|
32
|
+
raise ArgumentError, "FIPS and DualStack are enabled, but this partition does not support one or both"
|
33
|
+
end
|
34
|
+
if Aws::Endpoints::Matchers.boolean_equals?(use_fips, true)
|
35
|
+
if Aws::Endpoints::Matchers.boolean_equals?(true, Aws::Endpoints::Matchers.attr(partition_result, "supportsFIPS"))
|
36
|
+
return Aws::Endpoints::Endpoint.new(url: "https://translate-fips.#{region}.#{partition_result['dnsSuffix']}", headers: {}, properties: {})
|
37
|
+
end
|
38
|
+
raise ArgumentError, "FIPS is enabled but this partition does not support FIPS"
|
39
|
+
end
|
40
|
+
if Aws::Endpoints::Matchers.boolean_equals?(use_dual_stack, true)
|
41
|
+
if Aws::Endpoints::Matchers.boolean_equals?(true, Aws::Endpoints::Matchers.attr(partition_result, "supportsDualStack"))
|
42
|
+
return Aws::Endpoints::Endpoint.new(url: "https://translate.#{region}.#{partition_result['dualStackDnsSuffix']}", headers: {}, properties: {})
|
43
|
+
end
|
44
|
+
raise ArgumentError, "DualStack is enabled but this partition does not support DualStack"
|
42
45
|
end
|
43
|
-
|
46
|
+
return Aws::Endpoints::Endpoint.new(url: "https://translate.#{region}.#{partition_result['dnsSuffix']}", headers: {}, properties: {})
|
44
47
|
end
|
45
|
-
return Aws::Endpoints::Endpoint.new(url: "https://translate.#{region}.#{partition_result['dnsSuffix']}", headers: {}, properties: {})
|
46
48
|
end
|
49
|
+
raise ArgumentError, "Invalid Configuration: Missing Region"
|
47
50
|
raise ArgumentError, 'No endpoint could be resolved'
|
48
51
|
|
49
52
|
end
|
@@ -221,6 +221,20 @@ module Aws::Translate
|
|
221
221
|
end
|
222
222
|
end
|
223
223
|
|
224
|
+
class TranslateDocument
|
225
|
+
def self.build(context)
|
226
|
+
unless context.config.regional_endpoint
|
227
|
+
endpoint = context.config.endpoint.to_s
|
228
|
+
end
|
229
|
+
Aws::Translate::EndpointParameters.new(
|
230
|
+
region: context.config.region,
|
231
|
+
use_dual_stack: context.config.use_dualstack_endpoint,
|
232
|
+
use_fips: context.config.use_fips_endpoint,
|
233
|
+
endpoint: endpoint,
|
234
|
+
)
|
235
|
+
end
|
236
|
+
end
|
237
|
+
|
224
238
|
class TranslateText
|
225
239
|
def self.build(context)
|
226
240
|
unless context.config.regional_endpoint
|
@@ -86,6 +86,8 @@ module Aws::Translate
|
|
86
86
|
Aws::Translate::Endpoints::StopTextTranslationJob.build(context)
|
87
87
|
when :tag_resource
|
88
88
|
Aws::Translate::Endpoints::TagResource.build(context)
|
89
|
+
when :translate_document
|
90
|
+
Aws::Translate::Endpoints::TranslateDocument.build(context)
|
89
91
|
when :translate_text
|
90
92
|
Aws::Translate::Endpoints::TranslateText.build(context)
|
91
93
|
when :untag_resource
|
@@ -228,6 +228,35 @@ module Aws::Translate
|
|
228
228
|
include Aws::Structure
|
229
229
|
end
|
230
230
|
|
231
|
+
# The content and content type of a document.
|
232
|
+
#
|
233
|
+
# @!attribute [rw] content
|
234
|
+
# The `Content`field type is Binary large object (blob). This object
|
235
|
+
# contains the document content converted into base64-encoded binary
|
236
|
+
# data. If you use one of the AWS SDKs, the SDK performs the
|
237
|
+
# Base64-encoding on this field before sending the request.
|
238
|
+
# @return [String]
|
239
|
+
#
|
240
|
+
# @!attribute [rw] content_type
|
241
|
+
# Describes the format of the document. You can specify one of the
|
242
|
+
# following:
|
243
|
+
#
|
244
|
+
# * text/html - The input data consists of HTML content. Amazon
|
245
|
+
# Translate translates only the text in the HTML element.
|
246
|
+
#
|
247
|
+
# * text/plain - The input data consists of unformatted text. Amazon
|
248
|
+
# Translate translates every character in the content.
|
249
|
+
# @return [String]
|
250
|
+
#
|
251
|
+
# @see http://docs.aws.amazon.com/goto/WebAPI/translate-2017-07-01/Document AWS API Documentation
|
252
|
+
#
|
253
|
+
class Document < Struct.new(
|
254
|
+
:content,
|
255
|
+
:content_type)
|
256
|
+
SENSITIVE = [:content]
|
257
|
+
include Aws::Structure
|
258
|
+
end
|
259
|
+
|
231
260
|
# The encryption key used to encrypt this object.
|
232
261
|
#
|
233
262
|
# @!attribute [rw] type
|
@@ -460,26 +489,26 @@ module Aws::Translate
|
|
460
489
|
# as input. You can specify one of the following multipurpose internet
|
461
490
|
# mail extension (MIME) types:
|
462
491
|
#
|
463
|
-
# * `text/html
|
492
|
+
# * `text/html`: The input data consists of one or more HTML files.
|
464
493
|
# Amazon Translate translates only the text that resides in the
|
465
494
|
# `html` element in each file.
|
466
495
|
#
|
467
|
-
# * `text/plain
|
496
|
+
# * `text/plain`: The input data consists of one or more unformatted
|
468
497
|
# text files. Amazon Translate translates every character in this
|
469
498
|
# type of input.
|
470
499
|
#
|
471
|
-
# * `application/vnd.openxmlformats-officedocument.wordprocessingml.document
|
500
|
+
# * `application/vnd.openxmlformats-officedocument.wordprocessingml.document`:
|
472
501
|
# The input data consists of one or more Word documents (.docx).
|
473
502
|
#
|
474
|
-
# * `application/vnd.openxmlformats-officedocument.presentationml.presentation
|
503
|
+
# * `application/vnd.openxmlformats-officedocument.presentationml.presentation`:
|
475
504
|
# The input data consists of one or more PowerPoint Presentation
|
476
505
|
# files (.pptx).
|
477
506
|
#
|
478
|
-
# * `application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
|
507
|
+
# * `application/vnd.openxmlformats-officedocument.spreadsheetml.sheet`:
|
479
508
|
# The input data consists of one or more Excel Workbook files
|
480
509
|
# (.xlsx).
|
481
510
|
#
|
482
|
-
# * `application/x-xliff+xml
|
511
|
+
# * `application/x-xliff+xml`: The input data consists of one or more
|
483
512
|
# XML Localization Interchange File Format (XLIFF) files (.xlf).
|
484
513
|
# Amazon Translate supports only XLIFF version 1.2.
|
485
514
|
#
|
@@ -1598,7 +1627,7 @@ module Aws::Translate
|
|
1598
1627
|
# @return [String]
|
1599
1628
|
#
|
1600
1629
|
# @!attribute [rw] settings
|
1601
|
-
# Settings that
|
1630
|
+
# Settings that modify the translation output.
|
1602
1631
|
# @return [Types::TranslationSettings]
|
1603
1632
|
#
|
1604
1633
|
# @see http://docs.aws.amazon.com/goto/WebAPI/translate-2017-07-01/TextTranslationJobProperties AWS API Documentation
|
@@ -1654,6 +1683,102 @@ module Aws::Translate
|
|
1654
1683
|
include Aws::Structure
|
1655
1684
|
end
|
1656
1685
|
|
1686
|
+
# @!attribute [rw] document
|
1687
|
+
# The content and content type for the document to be translated. The
|
1688
|
+
# document size must not exceed 100 KB.
|
1689
|
+
# @return [Types::Document]
|
1690
|
+
#
|
1691
|
+
# @!attribute [rw] terminology_names
|
1692
|
+
# The name of a terminology list file to add to the translation job.
|
1693
|
+
# This file provides source terms and the desired translation for each
|
1694
|
+
# term. A terminology list can contain a maximum of 256 terms. You can
|
1695
|
+
# use one custom terminology resource in your translation request.
|
1696
|
+
#
|
1697
|
+
# Use the ListTerminologies operation to get the available terminology
|
1698
|
+
# lists.
|
1699
|
+
#
|
1700
|
+
# For more information about custom terminology lists, see [Custom
|
1701
|
+
# terminology][1].
|
1702
|
+
#
|
1703
|
+
#
|
1704
|
+
#
|
1705
|
+
# [1]: https://docs.aws.amazon.com/translate/latest/dg/how-custom-terminology.html
|
1706
|
+
# @return [Array<String>]
|
1707
|
+
#
|
1708
|
+
# @!attribute [rw] source_language_code
|
1709
|
+
# The language code for the language of the source text. Do not use
|
1710
|
+
# `auto`, because `TranslateDocument` does not support language
|
1711
|
+
# auto-detection. For a list of supported language codes, see
|
1712
|
+
# [Supported languages][1].
|
1713
|
+
#
|
1714
|
+
#
|
1715
|
+
#
|
1716
|
+
# [1]: https://docs.aws.amazon.com/translate/latest/dg/what-is-languages.html
|
1717
|
+
# @return [String]
|
1718
|
+
#
|
1719
|
+
# @!attribute [rw] target_language_code
|
1720
|
+
# The language code requested for the translated document. For a list
|
1721
|
+
# of supported language codes, see [Supported languages][1].
|
1722
|
+
#
|
1723
|
+
#
|
1724
|
+
#
|
1725
|
+
# [1]: https://docs.aws.amazon.com/translate/latest/dg/what-is-languages.html
|
1726
|
+
# @return [String]
|
1727
|
+
#
|
1728
|
+
# @!attribute [rw] settings
|
1729
|
+
# Settings to configure your translation output, including the option
|
1730
|
+
# to set the formality level of the output text and the option to mask
|
1731
|
+
# profane words and phrases.
|
1732
|
+
# @return [Types::TranslationSettings]
|
1733
|
+
#
|
1734
|
+
# @see http://docs.aws.amazon.com/goto/WebAPI/translate-2017-07-01/TranslateDocumentRequest AWS API Documentation
|
1735
|
+
#
|
1736
|
+
class TranslateDocumentRequest < Struct.new(
|
1737
|
+
:document,
|
1738
|
+
:terminology_names,
|
1739
|
+
:source_language_code,
|
1740
|
+
:target_language_code,
|
1741
|
+
:settings)
|
1742
|
+
SENSITIVE = []
|
1743
|
+
include Aws::Structure
|
1744
|
+
end
|
1745
|
+
|
1746
|
+
# @!attribute [rw] translated_document
|
1747
|
+
# The document containing the translated content. The document format
|
1748
|
+
# matches the source document format.
|
1749
|
+
# @return [Types::TranslatedDocument]
|
1750
|
+
#
|
1751
|
+
# @!attribute [rw] source_language_code
|
1752
|
+
# The language code of the source document.
|
1753
|
+
# @return [String]
|
1754
|
+
#
|
1755
|
+
# @!attribute [rw] target_language_code
|
1756
|
+
# The language code of the translated document.
|
1757
|
+
# @return [String]
|
1758
|
+
#
|
1759
|
+
# @!attribute [rw] applied_terminologies
|
1760
|
+
# The names of the custom terminologies applied to the input text by
|
1761
|
+
# Amazon Translate to produce the translated text document.
|
1762
|
+
# @return [Array<Types::AppliedTerminology>]
|
1763
|
+
#
|
1764
|
+
# @!attribute [rw] applied_settings
|
1765
|
+
# Settings to configure your translation output, including the option
|
1766
|
+
# to set the formality level of the output text and the option to mask
|
1767
|
+
# profane words and phrases.
|
1768
|
+
# @return [Types::TranslationSettings]
|
1769
|
+
#
|
1770
|
+
# @see http://docs.aws.amazon.com/goto/WebAPI/translate-2017-07-01/TranslateDocumentResponse AWS API Documentation
|
1771
|
+
#
|
1772
|
+
class TranslateDocumentResponse < Struct.new(
|
1773
|
+
:translated_document,
|
1774
|
+
:source_language_code,
|
1775
|
+
:target_language_code,
|
1776
|
+
:applied_terminologies,
|
1777
|
+
:applied_settings)
|
1778
|
+
SENSITIVE = []
|
1779
|
+
include Aws::Structure
|
1780
|
+
end
|
1781
|
+
|
1657
1782
|
# @!attribute [rw] text
|
1658
1783
|
# The text to translate. The text string can be a maximum of 10,000
|
1659
1784
|
# bytes long. Depending on your character set, this may be fewer than
|
@@ -1661,15 +1786,24 @@ module Aws::Translate
|
|
1661
1786
|
# @return [String]
|
1662
1787
|
#
|
1663
1788
|
# @!attribute [rw] terminology_names
|
1664
|
-
# The name of
|
1665
|
-
#
|
1666
|
-
#
|
1667
|
-
#
|
1789
|
+
# The name of a terminology list file to add to the translation job.
|
1790
|
+
# This file provides source terms and the desired translation for each
|
1791
|
+
# term. A terminology list can contain a maximum of 256 terms. You can
|
1792
|
+
# use one custom terminology resource in your translation request.
|
1793
|
+
#
|
1794
|
+
# Use the ListTerminologies operation to get the available terminology
|
1795
|
+
# lists.
|
1796
|
+
#
|
1797
|
+
# For more information about custom terminology lists, see [Custom
|
1798
|
+
# terminology][1].
|
1799
|
+
#
|
1800
|
+
#
|
1801
|
+
#
|
1802
|
+
# [1]: https://docs.aws.amazon.com/translate/latest/dg/how-custom-terminology.html
|
1668
1803
|
# @return [Array<String>]
|
1669
1804
|
#
|
1670
1805
|
# @!attribute [rw] source_language_code
|
1671
|
-
# The language code for the language of the source text.
|
1672
|
-
# must be a language supported by Amazon Translate. For a list of
|
1806
|
+
# The language code for the language of the source text. For a list of
|
1673
1807
|
# language codes, see [Supported languages][1].
|
1674
1808
|
#
|
1675
1809
|
# To have Amazon Translate determine the source language of your text,
|
@@ -1690,8 +1824,12 @@ module Aws::Translate
|
|
1690
1824
|
# @return [String]
|
1691
1825
|
#
|
1692
1826
|
# @!attribute [rw] target_language_code
|
1693
|
-
# The language code requested for the language of the target text.
|
1694
|
-
#
|
1827
|
+
# The language code requested for the language of the target text. For
|
1828
|
+
# a list of language codes, see [Supported languages][1].
|
1829
|
+
#
|
1830
|
+
#
|
1831
|
+
#
|
1832
|
+
# [1]: https://docs.aws.amazon.com/translate/latest/dg/what-is-languages.html
|
1695
1833
|
# @return [String]
|
1696
1834
|
#
|
1697
1835
|
# @!attribute [rw] settings
|
@@ -1730,7 +1868,7 @@ module Aws::Translate
|
|
1730
1868
|
# @return [Array<Types::AppliedTerminology>]
|
1731
1869
|
#
|
1732
1870
|
# @!attribute [rw] applied_settings
|
1733
|
-
#
|
1871
|
+
# Optional settings that modify the translation output.
|
1734
1872
|
# @return [Types::TranslationSettings]
|
1735
1873
|
#
|
1736
1874
|
# @see http://docs.aws.amazon.com/goto/WebAPI/translate-2017-07-01/TranslateTextResponse AWS API Documentation
|
@@ -1745,8 +1883,23 @@ module Aws::Translate
|
|
1745
1883
|
include Aws::Structure
|
1746
1884
|
end
|
1747
1885
|
|
1748
|
-
#
|
1749
|
-
#
|
1886
|
+
# The translated content.
|
1887
|
+
#
|
1888
|
+
# @!attribute [rw] content
|
1889
|
+
# The document containing the translated content.
|
1890
|
+
# @return [String]
|
1891
|
+
#
|
1892
|
+
# @see http://docs.aws.amazon.com/goto/WebAPI/translate-2017-07-01/TranslatedDocument AWS API Documentation
|
1893
|
+
#
|
1894
|
+
class TranslatedDocument < Struct.new(
|
1895
|
+
:content)
|
1896
|
+
SENSITIVE = [:content]
|
1897
|
+
include Aws::Structure
|
1898
|
+
end
|
1899
|
+
|
1900
|
+
# Settings to configure your translation output, including the option to
|
1901
|
+
# set the formality level of the output text and the option to mask
|
1902
|
+
# profane words and phrases.
|
1750
1903
|
#
|
1751
1904
|
# @!attribute [rw] formality
|
1752
1905
|
# You can optionally specify the desired level of formality for
|
@@ -1822,11 +1975,11 @@ module Aws::Translate
|
|
1822
1975
|
|
1823
1976
|
# Amazon Translate does not support translation from the language of the
|
1824
1977
|
# source text into the requested target language. For more information,
|
1825
|
-
# see [
|
1978
|
+
# see [Supported languages][1].
|
1826
1979
|
#
|
1827
1980
|
#
|
1828
1981
|
#
|
1829
|
-
# [1]: https://docs.aws.amazon.com/translate/latest/dg/
|
1982
|
+
# [1]: https://docs.aws.amazon.com/translate/latest/dg/what-is-languages.html
|
1830
1983
|
#
|
1831
1984
|
# @!attribute [rw] message
|
1832
1985
|
# @return [String]
|
data/lib/aws-sdk-translate.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: aws-sdk-translate
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.51.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Amazon Web Services
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-05-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: aws-sdk-core
|