The configuration interface of TranslateClient class constructor that set the region, credentials and other options.

interface TranslateClientConfig {
    authSchemePreference?: string[] | Provider<string[]>;
    cacheMiddleware?: boolean;
    credentials?: AwsCredentialIdentity | AwsCredentialIdentityProvider;
    customUserAgent?: string | UserAgent;
    defaultsMode?: DefaultsMode | Provider<DefaultsMode>;
    disableHostPrefix?: boolean;
    endpoint?: (string | Endpoint | Provider<Endpoint> | EndpointV2 | Provider<EndpointV2>) & (string | Provider<string> | Endpoint | Provider<...> | EndpointV2 | Provider<...>);
    endpointProvider?: ((params, context?) => EndpointV2);
    extensions?: RuntimeExtension[];
    logger?: Logger;
    maxAttempts?: number | Provider<number>;
    profile?: string;
    protocol?: ClientProtocol<any, any> | $ClientProtocol<any, any> | ClientProtocolCtor<any, any> | $ClientProtocolCtor<any, any>;
    region?: (string | Provider<string>) & (string | Provider<string | undefined>);
    requestHandler?: (NodeHttpHandlerOptions | FetchHttpHandlerOptions | Record<string, unknown> | RequestHandler<any, any, HttpHandlerOptions>) & HttpHandlerUserInput;
    retryMode?: string | Provider<string>;
    retryStrategy?: RetryStrategy | RetryStrategyV2;
    signer?: RequestSigner | ((authScheme?) => Promise<RequestSigner>);
    signingEscapePath?: boolean;
    signingRegion?: string;
    systemClockOffset?: number;
    tls?: boolean;
    useDualstackEndpoint?: (boolean | Provider<boolean>) & (boolean | Provider<boolean | undefined>);
    useFipsEndpoint?: (boolean | Provider<boolean>) & (boolean | Provider<boolean | undefined>);
    userAgentAppId?: string | Provider<undefined | string>;
}

Hierarchy (view full)

Properties

authSchemePreference?: string[] | Provider<string[]>

A comma-separated list of case-sensitive auth scheme names. An auth scheme name is a fully qualified auth scheme ID with the namespace prefix trimmed. For example, the auth scheme with ID aws.auth#sigv4 is named sigv4.

cacheMiddleware?: boolean

Default false.

When true, the client will only resolve the middleware stack once per Command class. This means modifying the middlewareStack of the command or client after requests have been made will not be recognized.

Calling client.destroy() also clears this cache.

Enable this only if needing the additional time saved (0-1ms per request) and not needing middleware modifications between requests.

The credentials used to sign requests.

customUserAgent?: string | UserAgent

The custom user agent header that would be appended to default one

The @smithy/smithy-client#DefaultsMode that will be used to determine how certain default configuration options are resolved in the SDK.

disableHostPrefix?: boolean

Disable dynamically changing the endpoint of the client based on the hostPrefix trait of an operation.

endpoint?: (string | Endpoint | Provider<Endpoint> | EndpointV2 | Provider<EndpointV2>) & (string | Provider<string> | Endpoint | Provider<...> | EndpointV2 | Provider<...>)

The fully qualified endpoint of the webservice. This is only for using a custom endpoint (for example, when using a local version of S3).

Endpoint transformations such as S3 applying a bucket to the hostname are still applicable to this custom endpoint.

endpointProvider?: ((params, context?) => EndpointV2)

Providing a custom endpointProvider will override built-in transformations of the endpoint such as S3 adding the bucket name to the hostname, since they are part of the default endpointProvider.

Type declaration

    • (params, context?): EndpointV2
    • Providing a custom endpointProvider will override built-in transformations of the endpoint such as S3 adding the bucket name to the hostname, since they are part of the default endpointProvider.

      Parameters

      • params: EndpointParameters
      • Optional context: {
            logger?: Logger;
        }

      Returns EndpointV2

extensions?: RuntimeExtension[]

Optional extensions

logger?: Logger

Optional logger for logging debug/info/warn/error.

maxAttempts?: number | Provider<number>

Value for how many times a request will be made at most in case of retry.

profile?: string

Setting a client profile is similar to setting a value for the AWS_PROFILE environment variable. Setting a profile on a client in code only affects the single client instance, unlike AWS_PROFILE.

When set, and only for environments where an AWS configuration file exists, fields configurable by this file will be retrieved from the specified profile within that file. Conflicting code configuration and environment variables will still have higher priority.

For client credential resolution that involves checking the AWS configuration file, the client's profile (this value) will be used unless a different profile is set in the credential provider options.

protocol?: ClientProtocol<any, any> | $ClientProtocol<any, any> | ClientProtocolCtor<any, any> | $ClientProtocolCtor<any, any>

A client request/response protocol or constructor of one. A protocol in this context is not e.g. https. It is the combined implementation of how to (de)serialize and create the messages (e.g. http requests/responses) that are being exchanged.

region?: (string | Provider<string>) & (string | Provider<string | undefined>)

The AWS region to which this client will send requests

requestHandler?: (NodeHttpHandlerOptions | FetchHttpHandlerOptions | Record<string, unknown> | RequestHandler<any, any, HttpHandlerOptions>) & HttpHandlerUserInput
retryMode?: string | Provider<string>

Specifies which retry algorithm to use.

retryStrategy?: RetryStrategy | RetryStrategyV2

The strategy to retry the request. Using built-in exponential backoff strategy by default.

signer?: RequestSigner | ((authScheme?) => Promise<RequestSigner>)

The signer to use when signing requests.

Type declaration

signingEscapePath?: boolean

Whether to escape request path when signing the request.

signingRegion?: string

The region where you want to sign your request against. This can be different to the region in the endpoint.

systemClockOffset?: number

An offset value in milliseconds to apply to all signing times.

tls?: boolean

Whether TLS is enabled for requests.

Deprecated

useDualstackEndpoint?: (boolean | Provider<boolean>) & (boolean | Provider<boolean | undefined>)

Enables IPv6/IPv4 dualstack endpoint.

useFipsEndpoint?: (boolean | Provider<boolean>) & (boolean | Provider<boolean | undefined>)

Enables FIPS compatible endpoints.

userAgentAppId?: string | Provider<undefined | string>

The application ID used to identify the application.