Class: Aws::Translate::Client
- Inherits:
-
Seahorse::Client::Base
- Object
- Seahorse::Client::Base
- Aws::Translate::Client
- Includes:
- ClientStubs
- Defined in:
- lib/aws-sdk-translate/client.rb
Overview
An API client for Translate. To construct a client, you need to configure a ‘:region` and `:credentials`.
client = Aws::Translate::Client.new(
region: region_name,
credentials: credentials,
# ...
)
For details on configuring region and credentials see the [developer guide](/sdk-for-ruby/v3/developer-guide/setup-config.html).
See #initialize for a full list of supported configuration options.
Class Attribute Summary collapse
- .identifier ⇒ Object readonly private
API Operations collapse
-
#create_parallel_data(params = {}) ⇒ Types::CreateParallelDataResponse
Creates a parallel data resource in Amazon Translate by importing an input file from Amazon S3.
-
#delete_parallel_data(params = {}) ⇒ Types::DeleteParallelDataResponse
Deletes a parallel data resource in Amazon Translate.
-
#delete_terminology(params = {}) ⇒ Struct
A synchronous action that deletes a custom terminology.
-
#describe_text_translation_job(params = {}) ⇒ Types::DescribeTextTranslationJobResponse
Gets the properties associated with an asynchronous batch translation job including name, ID, status, source and target languages, input/output S3 buckets, and so on.
-
#get_parallel_data(params = {}) ⇒ Types::GetParallelDataResponse
Provides information about a parallel data resource.
-
#get_terminology(params = {}) ⇒ Types::GetTerminologyResponse
Retrieves a custom terminology.
-
#import_terminology(params = {}) ⇒ Types::ImportTerminologyResponse
Creates or updates a custom terminology, depending on whether one already exists for the given terminology name.
-
#list_languages(params = {}) ⇒ Types::ListLanguagesResponse
Provides a list of languages (RFC-5646 codes and names) that Amazon Translate supports.
-
#list_parallel_data(params = {}) ⇒ Types::ListParallelDataResponse
Provides a list of your parallel data resources in Amazon Translate.
-
#list_tags_for_resource(params = {}) ⇒ Types::ListTagsForResourceResponse
Lists all tags associated with a given Amazon Translate resource.
-
#list_terminologies(params = {}) ⇒ Types::ListTerminologiesResponse
Provides a list of custom terminologies associated with your account.
-
#list_text_translation_jobs(params = {}) ⇒ Types::ListTextTranslationJobsResponse
Gets a list of the batch translation jobs that you have submitted.
-
#start_text_translation_job(params = {}) ⇒ Types::StartTextTranslationJobResponse
Starts an asynchronous batch translation job.
-
#stop_text_translation_job(params = {}) ⇒ Types::StopTextTranslationJobResponse
Stops an asynchronous batch translation job that is in progress.
-
#tag_resource(params = {}) ⇒ Struct
Associates a specific tag with a resource.
-
#translate_document(params = {}) ⇒ Types::TranslateDocumentResponse
Translates the input document from the source language to the target language.
-
#translate_text(params = {}) ⇒ Types::TranslateTextResponse
Translates input text from the source language to the target language.
-
#untag_resource(params = {}) ⇒ Struct
Removes a specific tag associated with an Amazon Translate resource.
-
#update_parallel_data(params = {}) ⇒ Types::UpdateParallelDataResponse
Updates a previously created parallel data resource by importing a new input file from Amazon S3.
Class Method Summary collapse
- .errors_module ⇒ Object private
Instance Method Summary collapse
- #build_request(operation_name, params = {}) ⇒ Object private
-
#initialize(options) ⇒ Client
constructor
A new instance of Client.
- #waiter_names ⇒ Object deprecated private Deprecated.
Constructor Details
#initialize(options) ⇒ Client
Returns a new instance of Client.
453 454 455 |
# File 'lib/aws-sdk-translate/client.rb', line 453 def initialize(*args) super end |
Class Attribute Details
.identifier ⇒ Object (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
1735 1736 1737 |
# File 'lib/aws-sdk-translate/client.rb', line 1735 def identifier @identifier end |
Class Method Details
.errors_module ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
1738 1739 1740 |
# File 'lib/aws-sdk-translate/client.rb', line 1738 def errors_module Errors end |
Instance Method Details
#build_request(operation_name, params = {}) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
1708 1709 1710 1711 1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 |
# File 'lib/aws-sdk-translate/client.rb', line 1708 def build_request(operation_name, params = {}) handlers = @handlers.for(operation_name) tracer = config.telemetry_provider.tracer_provider.tracer( Aws::Telemetry.module_to_tracer_name('Aws::Translate') ) context = Seahorse::Client::RequestContext.new( operation_name: operation_name, operation: config.api.operation(operation_name), client: self, params: params, config: config, tracer: tracer ) context[:gem_name] = 'aws-sdk-translate' context[:gem_version] = '1.77.0' Seahorse::Client::Request.new(handlers, context) end |
#create_parallel_data(params = {}) ⇒ Types::CreateParallelDataResponse
Creates a parallel data resource in Amazon Translate by importing an input file from Amazon S3. Parallel data files contain examples that show how you want segments of text to be translated. By adding parallel data, you can influence the style, tone, and word choice in your translation output.
531 532 533 534 |
# File 'lib/aws-sdk-translate/client.rb', line 531 def create_parallel_data(params = {}, = {}) req = build_request(:create_parallel_data, params) req.send_request() end |
#delete_parallel_data(params = {}) ⇒ Types::DeleteParallelDataResponse
Deletes a parallel data resource in Amazon Translate.
561 562 563 564 |
# File 'lib/aws-sdk-translate/client.rb', line 561 def delete_parallel_data(params = {}, = {}) req = build_request(:delete_parallel_data, params) req.send_request() end |
#delete_terminology(params = {}) ⇒ Struct
A synchronous action that deletes a custom terminology.
583 584 585 586 |
# File 'lib/aws-sdk-translate/client.rb', line 583 def delete_terminology(params = {}, = {}) req = build_request(:delete_terminology, params) req.send_request() end |
#describe_text_translation_job(params = {}) ⇒ Types::DescribeTextTranslationJobResponse
Gets the properties associated with an asynchronous batch translation job including name, ID, status, source and target languages, input/output S3 buckets, and so on.
639 640 641 642 |
# File 'lib/aws-sdk-translate/client.rb', line 639 def describe_text_translation_job(params = {}, = {}) req = build_request(:describe_text_translation_job, params) req.send_request() end |
#get_parallel_data(params = {}) ⇒ Types::GetParallelDataResponse
Provides information about a parallel data resource.
695 696 697 698 |
# File 'lib/aws-sdk-translate/client.rb', line 695 def get_parallel_data(params = {}, = {}) req = build_request(:get_parallel_data, params) req.send_request() end |
#get_terminology(params = {}) ⇒ Types::GetTerminologyResponse
Retrieves a custom terminology.
757 758 759 760 |
# File 'lib/aws-sdk-translate/client.rb', line 757 def get_terminology(params = {}, = {}) req = build_request(:get_terminology, params) req.send_request() end |
#import_terminology(params = {}) ⇒ Types::ImportTerminologyResponse
Creates or updates a custom terminology, depending on whether one already exists for the given terminology name. Importing a terminology with the same name as an existing one will merge the terminologies based on the chosen merge strategy. The only supported merge strategy is OVERWRITE, where the imported terminology overwrites the existing terminology of the same name.
If you import a terminology that overwrites an existing one, the new terminology takes up to 10 minutes to fully propagate. After that, translations have access to the new terminology.
853 854 855 856 |
# File 'lib/aws-sdk-translate/client.rb', line 853 def import_terminology(params = {}, = {}) req = build_request(:import_terminology, params) req.send_request() end |
#list_languages(params = {}) ⇒ Types::ListLanguagesResponse
Provides a list of languages (RFC-5646 codes and names) that Amazon Translate supports.
The returned response is a pageable response and is Enumerable. For details on usage see PageableResponse.
900 901 902 903 |
# File 'lib/aws-sdk-translate/client.rb', line 900 def list_languages(params = {}, = {}) req = build_request(:list_languages, params) req.send_request() end |
#list_parallel_data(params = {}) ⇒ Types::ListParallelDataResponse
Provides a list of your parallel data resources in Amazon Translate.
The returned response is a pageable response and is Enumerable. For details on usage see PageableResponse.
958 959 960 961 |
# File 'lib/aws-sdk-translate/client.rb', line 958 def list_parallel_data(params = {}, = {}) req = build_request(:list_parallel_data, params) req.send_request() end |
#list_tags_for_resource(params = {}) ⇒ Types::ListTagsForResourceResponse
Lists all tags associated with a given Amazon Translate resource. For more information, see [ Tagging your resources].
994 995 996 997 |
# File 'lib/aws-sdk-translate/client.rb', line 994 def (params = {}, = {}) req = build_request(:list_tags_for_resource, params) req.send_request() end |
#list_terminologies(params = {}) ⇒ Types::ListTerminologiesResponse
Provides a list of custom terminologies associated with your account.
The returned response is a pageable response and is Enumerable. For details on usage see PageableResponse.
1047 1048 1049 1050 |
# File 'lib/aws-sdk-translate/client.rb', line 1047 def list_terminologies(params = {}, = {}) req = build_request(:list_terminologies, params) req.send_request() end |
#list_text_translation_jobs(params = {}) ⇒ Types::ListTextTranslationJobsResponse
Gets a list of the batch translation jobs that you have submitted.
The returned response is a pageable response and is Enumerable. For details on usage see PageableResponse.
1120 1121 1122 1123 |
# File 'lib/aws-sdk-translate/client.rb', line 1120 def list_text_translation_jobs(params = {}, = {}) req = build_request(:list_text_translation_jobs, params) req.send_request() end |
#start_text_translation_job(params = {}) ⇒ Types::StartTextTranslationJobResponse
Starts an asynchronous batch translation job. Use batch translation jobs to translate large volumes of text across multiple documents at once. For batch translation, you can input documents with different source languages (specify ‘auto` as the source language). You can specify one or more target languages. Batch translation translates each input document into each of the target languages. For more information, see [Asynchronous batch processing].
Batch translation jobs can be described with the DescribeTextTranslationJob operation, listed with the ListTextTranslationJobs operation, and stopped with the StopTextTranslationJob operation.
1294 1295 1296 1297 |
# File 'lib/aws-sdk-translate/client.rb', line 1294 def start_text_translation_job(params = {}, = {}) req = build_request(:start_text_translation_job, params) req.send_request() end |
#stop_text_translation_job(params = {}) ⇒ Types::StopTextTranslationJobResponse
Stops an asynchronous batch translation job that is in progress.
If the job’s state is ‘IN_PROGRESS`, the job will be marked for termination and put into the `STOP_REQUESTED` state. If the job completes before it can be stopped, it is put into the `COMPLETED` state. Otherwise, the job is put into the `STOPPED` state.
Asynchronous batch translation jobs are started with the StartTextTranslationJob operation. You can use the DescribeTextTranslationJob or ListTextTranslationJobs operations to get a batch translation job’s ‘JobId`.
1334 1335 1336 1337 |
# File 'lib/aws-sdk-translate/client.rb', line 1334 def stop_text_translation_job(params = {}, = {}) req = build_request(:stop_text_translation_job, params) req.send_request() end |
#tag_resource(params = {}) ⇒ Struct
Associates a specific tag with a resource. A tag is a key-value pair that adds as a metadata to a resource. For more information, see [ Tagging your resources].
1374 1375 1376 1377 |
# File 'lib/aws-sdk-translate/client.rb', line 1374 def tag_resource(params = {}, = {}) req = build_request(:tag_resource, params) req.send_request() end |
#translate_document(params = {}) ⇒ Types::TranslateDocumentResponse
Translates the input document from the source language to the target language. This synchronous operation supports text, HTML, or Word documents as the input document. ‘TranslateDocument` supports translations from English to any supported language, and from any supported language to English. Therefore, specify either the source language code or the target language code as “en” (English).
If you set the ‘Formality` parameter, the request will fail if the target language does not support formality. For a list of target languages that support formality, see [Setting formality].
[1]: docs.aws.amazon.com/translate/latest/dg/customizing-translations-formality.html
1496 1497 1498 1499 |
# File 'lib/aws-sdk-translate/client.rb', line 1496 def translate_document(params = {}, = {}) req = build_request(:translate_document, params) req.send_request() end |
#translate_text(params = {}) ⇒ Types::TranslateTextResponse
Translates input text from the source language to the target language. For a list of available languages and language codes, see [Supported languages].
[1]: docs.aws.amazon.com/translate/latest/dg/what-is-languages.html
1610 1611 1612 1613 |
# File 'lib/aws-sdk-translate/client.rb', line 1610 def translate_text(params = {}, = {}) req = build_request(:translate_text, params) req.send_request() end |
#untag_resource(params = {}) ⇒ Struct
Removes a specific tag associated with an Amazon Translate resource. For more information, see [ Tagging your resources].
1644 1645 1646 1647 |
# File 'lib/aws-sdk-translate/client.rb', line 1644 def untag_resource(params = {}, = {}) req = build_request(:untag_resource, params) req.send_request() end |
#update_parallel_data(params = {}) ⇒ Types::UpdateParallelDataResponse
Updates a previously created parallel data resource by importing a new input file from Amazon S3.
1699 1700 1701 1702 |
# File 'lib/aws-sdk-translate/client.rb', line 1699 def update_parallel_data(params = {}, = {}) req = build_request(:update_parallel_data, params) req.send_request() end |
#waiter_names ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
1728 1729 1730 |
# File 'lib/aws-sdk-translate/client.rb', line 1728 def waiter_names [] end |