package translate
import "github.com/aws/aws-sdk-go-v2/service/translate"
Package translate provides the API client, operations, and parameter types for Amazon Translate.
Provides translation between one source language and another of the same set of languages.
Index ¶
- Constants
- func NewDefaultEndpointResolver() *internalendpoints.Resolver
- type Client
- func New(options Options, optFns ...func(*Options)) *Client
- func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client
- func (c *Client) DeleteTerminology(ctx context.Context, params *DeleteTerminologyInput, optFns ...func(*Options)) (*DeleteTerminologyOutput, error)
- func (c *Client) DescribeTextTranslationJob(ctx context.Context, params *DescribeTextTranslationJobInput, optFns ...func(*Options)) (*DescribeTextTranslationJobOutput, error)
- func (c *Client) GetTerminology(ctx context.Context, params *GetTerminologyInput, optFns ...func(*Options)) (*GetTerminologyOutput, error)
- func (c *Client) ImportTerminology(ctx context.Context, params *ImportTerminologyInput, optFns ...func(*Options)) (*ImportTerminologyOutput, error)
- func (c *Client) ListTerminologies(ctx context.Context, params *ListTerminologiesInput, optFns ...func(*Options)) (*ListTerminologiesOutput, error)
- func (c *Client) ListTextTranslationJobs(ctx context.Context, params *ListTextTranslationJobsInput, optFns ...func(*Options)) (*ListTextTranslationJobsOutput, error)
- func (c *Client) StartTextTranslationJob(ctx context.Context, params *StartTextTranslationJobInput, optFns ...func(*Options)) (*StartTextTranslationJobOutput, error)
- func (c *Client) StopTextTranslationJob(ctx context.Context, params *StopTextTranslationJobInput, optFns ...func(*Options)) (*StopTextTranslationJobOutput, error)
- func (c *Client) TranslateText(ctx context.Context, params *TranslateTextInput, optFns ...func(*Options)) (*TranslateTextOutput, error)
- type DeleteTerminologyInput
- type DeleteTerminologyOutput
- type DescribeTextTranslationJobInput
- type DescribeTextTranslationJobOutput
- type EndpointResolver
- type EndpointResolverFunc
- type GetTerminologyInput
- type GetTerminologyOutput
- type HTTPClient
- type HTTPSignerV4
- type IdempotencyTokenProvider
- type ImportTerminologyInput
- type ImportTerminologyOutput
- type ListTerminologiesInput
- type ListTerminologiesOutput
- type ListTextTranslationJobsInput
- type ListTextTranslationJobsOutput
- type Options
- type ResolveEndpoint
- func (m *ResolveEndpoint) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, )
- func (*ResolveEndpoint) ID() string
- type ResolverOptions
- type StartTextTranslationJobInput
- type StartTextTranslationJobOutput
- type StopTextTranslationJobInput
- type StopTextTranslationJobOutput
- type TranslateTextInput
- type TranslateTextOutput
Constants ¶
const ServiceAPIVersion = "2017-07-01"
const ServiceID = "Translate"
Functions ¶
func NewDefaultEndpointResolver ¶
func NewDefaultEndpointResolver() *internalendpoints.Resolver
NewDefaultEndpointResolver constructs a new service endpoint resolver
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client provides the API client to make operations call for Amazon Translate.
func New ¶
New returns an initialized Client based on the functional options. Provide additional functional options to further configure the behavior of the client, such as changing the client's endpoint or adding custom middleware behavior.
func NewFromConfig ¶
NewFromConfig returns a new client from the provided config.
func (*Client) DeleteTerminology ¶
func (c *Client) DeleteTerminology(ctx context.Context, params *DeleteTerminologyInput, optFns ...func(*Options)) (*DeleteTerminologyOutput, error)
A synchronous action that deletes a custom terminology.
func (*Client) DescribeTextTranslationJob ¶
func (c *Client) DescribeTextTranslationJob(ctx context.Context, params *DescribeTextTranslationJobInput, optFns ...func(*Options)) (*DescribeTextTranslationJobOutput, error)
Gets the properties associated with an asycnhronous batch translation job including name, ID, status, source and target languages, input/output S3 buckets, and so on.
func (*Client) GetTerminology ¶
func (c *Client) GetTerminology(ctx context.Context, params *GetTerminologyInput, optFns ...func(*Options)) (*GetTerminologyOutput, error)
Retrieves a custom terminology.
func (*Client) ImportTerminology ¶
func (c *Client) ImportTerminology(ctx context.Context, params *ImportTerminologyInput, optFns ...func(*Options)) (*ImportTerminologyOutput, error)
Creates or updates a custom terminology, depending on whether or not 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. Currently, the only supported merge strategy is OVERWRITE, and so the imported terminology will overwrite an existing terminology of the same name. If you import a terminology that overwrites an existing one, the new terminology take up to 10 minutes to fully propagate and be available for use in a translation due to cache policies with the DataPlane service that performs the translations.
func (*Client) ListTerminologies ¶
func (c *Client) ListTerminologies(ctx context.Context, params *ListTerminologiesInput, optFns ...func(*Options)) (*ListTerminologiesOutput, error)
Provides a list of custom terminologies associated with your account.
func (*Client) ListTextTranslationJobs ¶
func (c *Client) ListTextTranslationJobs(ctx context.Context, params *ListTextTranslationJobsInput, optFns ...func(*Options)) (*ListTextTranslationJobsOutput, error)
Gets a list of the batch translation jobs that you have submitted.
func (*Client) StartTextTranslationJob ¶
func (c *Client) StartTextTranslationJob(ctx context.Context, params *StartTextTranslationJobInput, optFns ...func(*Options)) (*StartTextTranslationJobOutput, error)
Starts an asynchronous batch translation job. Batch translation jobs can be used to translate large volumes of text across multiple documents at once. For more information, see async. Batch translation jobs can be described with the DescribeTextTranslationJob operation, listed with the ListTextTranslationJobs operation, and stopped with the StopTextTranslationJob operation. Amazon Translate does not support batch translation of multiple source languages at once.
func (*Client) StopTextTranslationJob ¶
func (c *Client) StopTextTranslationJob(ctx context.Context, params *StopTextTranslationJobInput, optFns ...func(*Options)) (*StopTextTranslationJobOutput, error)
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.
func (*Client) TranslateText ¶
func (c *Client) TranslateText(ctx context.Context, params *TranslateTextInput, optFns ...func(*Options)) (*TranslateTextOutput, error)
Translates input text from the source language to the target language. For a list of available languages and language codes, see what-is-languages.
type DeleteTerminologyInput ¶
type DeleteTerminologyInput struct { // The name of the custom terminology being deleted. // // This member is required. Name *string }
type DeleteTerminologyOutput ¶
type DeleteTerminologyOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata }
type DescribeTextTranslationJobInput ¶
type DescribeTextTranslationJobInput struct { // The identifier that Amazon Translate generated for the job. The // StartTextTranslationJob operation returns this identifier in its response. // // This member is required. JobId *string }
type DescribeTextTranslationJobOutput ¶
type DescribeTextTranslationJobOutput struct { // An object that contains the properties associated with an asynchronous batch // translation job. TextTranslationJobProperties *types.TextTranslationJobProperties // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata }
type EndpointResolver ¶
type EndpointResolver interface { ResolveEndpoint(region string, options ResolverOptions) (aws.Endpoint, error) }
EndpointResolver interface for resolving service endpoints.
func WithEndpointResolver ¶
func WithEndpointResolver(awsResolver aws.EndpointResolver, fallbackResolver EndpointResolver) EndpointResolver
WithEndpointResolver returns an EndpointResolver that first delegates endpoint resolution to the awsResolver. If awsResolver returns aws.EndpointNotFoundError error, the resolver will use the the provided fallbackResolver for resolution. awsResolver and fallbackResolver must not be nil
type EndpointResolverFunc ¶
type EndpointResolverFunc func(region string, options ResolverOptions) (aws.Endpoint, error)
EndpointResolverFunc is a helper utility that wraps a function so it satisfies the EndpointResolver interface. This is useful when you want to add additional endpoint resolving logic, or stub out specific endpoints with custom values.
func (EndpointResolverFunc) ResolveEndpoint ¶
func (fn EndpointResolverFunc) ResolveEndpoint(region string, options ResolverOptions) (endpoint aws.Endpoint, err error)
type GetTerminologyInput ¶
type GetTerminologyInput struct { // The name of the custom terminology being retrieved. // // This member is required. Name *string // The data format of the custom terminology being retrieved, either CSV or TMX. // // This member is required. TerminologyDataFormat types.TerminologyDataFormat }
type GetTerminologyOutput ¶
type GetTerminologyOutput struct { // The data location of the custom terminology being retrieved. The custom // terminology file is returned in a presigned url that has a 30 minute expiration. TerminologyDataLocation *types.TerminologyDataLocation // The properties of the custom terminology being retrieved. TerminologyProperties *types.TerminologyProperties // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata }
type HTTPClient ¶
type HTTPSignerV4 ¶
type HTTPSignerV4 interface { SignHTTP(ctx context.Context, credentials aws.Credentials, r *http.Request, payloadHash string, service string, region string, signingTime time.Time) error }
type IdempotencyTokenProvider ¶
IdempotencyTokenProvider interface for providing idempotency token
type ImportTerminologyInput ¶
type ImportTerminologyInput struct { // The merge strategy of the custom terminology being imported. Currently, only the // OVERWRITE merge strategy is supported. In this case, the imported terminology // will overwrite an existing terminology of the same name. // // This member is required. MergeStrategy types.MergeStrategy // The name of the custom terminology being imported. // // This member is required. Name *string // The terminology data for the custom terminology being imported. // // This member is required. TerminologyData *types.TerminologyData // The description of the custom terminology being imported. Description *string // The encryption key for the custom terminology being imported. EncryptionKey *types.EncryptionKey }
type ImportTerminologyOutput ¶
type ImportTerminologyOutput struct { // The properties of the custom terminology being imported. TerminologyProperties *types.TerminologyProperties // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata }
type ListTerminologiesInput ¶
type ListTerminologiesInput struct { // The maximum number of custom terminologies returned per list request. MaxResults *int32 // If the result of the request to ListTerminologies was truncated, include the // NextToken to fetch the next group of custom terminologies. NextToken *string }
type ListTerminologiesOutput ¶
type ListTerminologiesOutput struct { // If the response to the ListTerminologies was truncated, the NextToken fetches // the next group of custom terminologies. NextToken *string // The properties list of the custom terminologies returned on the list request. TerminologyPropertiesList []*types.TerminologyProperties // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata }
type ListTextTranslationJobsInput ¶
type ListTextTranslationJobsInput struct { // The parameters that specify which batch translation jobs to retrieve. Filters // include job name, job status, and submission time. You can only set one filter // at a time. Filter *types.TextTranslationJobFilter // The maximum number of results to return in each page. The default value is 100. MaxResults *int32 // The token to request the next page of results. NextToken *string }
type ListTextTranslationJobsOutput ¶
type ListTextTranslationJobsOutput struct { // The token to use to retreive the next page of results. This value is null when // there are no more results to return. NextToken *string // A list containing the properties of each job that is returned. TextTranslationJobPropertiesList []*types.TextTranslationJobProperties // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata }
type Options ¶
type Options struct { // Set of options to modify how an operation is invoked. These apply to all // operations invoked for this client. Use functional options on operation call to // modify this list for per operation behavior. APIOptions []func(*middleware.Stack) error // The credentials object to use when signing requests. Credentials aws.CredentialsProvider // The endpoint options to be used when attempting to resolve an endpoint. EndpointOptions ResolverOptions // The service endpoint resolver. EndpointResolver EndpointResolver // Signature Version 4 (SigV4) Signer HTTPSignerV4 HTTPSignerV4 // Provides idempotency tokens values that will be automatically populated into // idempotent API operations. IdempotencyTokenProvider IdempotencyTokenProvider // The region to send requests to. (Required) Region string // Retryer guides how HTTP requests should be retried in case of recoverable // failures. When nil the API client will use a default retryer. Retryer retry.Retryer // The HTTP client to invoke API calls with. Defaults to client's default HTTP // implementation if nil. HTTPClient HTTPClient }
func (Options) Copy ¶
Copy creates a clone where the APIOptions list is deep copied.
type ResolveEndpoint ¶
type ResolveEndpoint struct { Resolver EndpointResolver Options ResolverOptions }
func (*ResolveEndpoint) HandleSerialize ¶
func (m *ResolveEndpoint) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, )
func (*ResolveEndpoint) ID ¶
func (*ResolveEndpoint) ID() string
type ResolverOptions ¶
type ResolverOptions = internalendpoints.Options
ResolverOptions is the service endpoint resolver options
type StartTextTranslationJobInput ¶
type StartTextTranslationJobInput struct { // The client token of the EC2 instance calling the request. This token is // auto-generated when using the Amazon Translate SDK. Otherwise, use the // DescribeInstances EC2 operation to retreive an instance's client token. For more // information, see Client Tokens in the EC2 User Guide. // // This member is required. ClientToken *string // The Amazon Resource Name (ARN) of an AWS Identity Access and Management (IAM) // role that grants Amazon Translate read access to your input data. For more // nformation, see identity-and-access-management. // // This member is required. DataAccessRoleArn *string // Specifies the format and S3 location of the input documents for the translation // job. // // This member is required. InputDataConfig *types.InputDataConfig // Specifies the S3 folder to which your job output will be saved. // // This member is required. OutputDataConfig *types.OutputDataConfig // The language code of the input language. For a list of language codes, see // what-is-languages. Amazon Translate does not automatically detect a source // language during batch translation jobs. // // This member is required. SourceLanguageCode *string // The language code of the output language. // // This member is required. TargetLanguageCodes []*string // The name of the batch translation job to be performed. JobName *string // The name of the terminology to use in the batch translation job. For a list of // available terminologies, use the ListTerminologies operation. TerminologyNames []*string }
type StartTextTranslationJobOutput ¶
type StartTextTranslationJobOutput struct { // The identifier generated for the job. To get the status of a job, use this ID // with the DescribeTextTranslationJob operation. JobId *string // The status of the job. Possible values include: // // * SUBMITTED - The job has // been received and is queued for processing. // // * IN_PROGRESS - Amazon // Translate is processing the job. // // * COMPLETED - The job was successfully // completed and the output is available. // // * COMPLETED_WITH_ERRORS - The job // was completed with errors. The errors can be analyzed in the job's output. // // // * FAILED - The job did not complete. To get details, use the // DescribeTextTranslationJob operation. // // * STOP_REQUESTED - The user who // started the job has requested that it be stopped. // // * STOPPED - The job has // been stopped. JobStatus types.JobStatus // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata }
type StopTextTranslationJobInput ¶
type StopTextTranslationJobInput struct { // The job ID of the job to be stopped. // // This member is required. JobId *string }
type StopTextTranslationJobOutput ¶
type StopTextTranslationJobOutput struct { // The job ID of the stopped batch translation job. JobId *string // The status of the designated job. Upon successful completion, the job's status // will be STOPPED. JobStatus types.JobStatus // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata }
type TranslateTextInput ¶
type TranslateTextInput struct { // The language code for the language of the source text. The language must be a // language supported by Amazon Translate. For a list of language codes, see // what-is-languages. To have Amazon Translate determine the source language of // your text, you can specify auto in the SourceLanguageCode field. If you specify // auto, Amazon Translate will call Amazon Comprehend // (https://docs.aws.amazon.com/comprehend/latest/dg/comprehend-general.html) to // determine the source language. // // This member is required. SourceLanguageCode *string // The language code requested for the language of the target text. The language // must be a language supported by Amazon Translate. // // This member is required. TargetLanguageCode *string // The text to translate. The text string can be a maximum of 5,000 bytes long. // Depending on your character set, this may be fewer than 5,000 characters. // // This member is required. Text *string // The name of the terminology list file to be used in the TranslateText request. // You can use 1 terminology list at most in a TranslateText request. Terminology // lists can contain a maximum of 256 terms. TerminologyNames []*string }
type TranslateTextOutput ¶
type TranslateTextOutput struct { // The language code for the language of the source text. // // This member is required. SourceLanguageCode *string // The language code for the language of the target text. // // This member is required. TargetLanguageCode *string // The translated text. // // This member is required. TranslatedText *string // The names of the custom terminologies applied to the input text by Amazon // Translate for the translated text response. AppliedTerminologies []*types.AppliedTerminology // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata }
Source Files ¶
api_client.go api_op_DeleteTerminology.go api_op_DescribeTextTranslationJob.go api_op_GetTerminology.go api_op_ImportTerminology.go api_op_ListTerminologies.go api_op_ListTextTranslationJobs.go api_op_StartTextTranslationJob.go api_op_StopTextTranslationJob.go api_op_TranslateText.go deserializers.go doc.go endpoints.go serializers.go validators.go
Directories ¶
Path | Synopsis |
---|---|
internal | |
types |
- Version
- v0.28.0
- Published
- Oct 26, 2020
- Platform
- js/wasm
- Imports
- 28 packages
- Last checked
- now –
Tools for package owners.