Textract / Client / create_adapter_version

create_adapter_version#

Textract.Client.create_adapter_version(**kwargs)#

Creates a new version of an adapter. Operates on a provided AdapterId and a specified dataset provided via the DatasetConfig argument. Requires that you specify an Amazon S3 bucket with the OutputConfig argument. You can provide an optional KMSKeyId, an optional ClientRequestToken, and optional tags.

See also: AWS API Documentation

Request Syntax

response = client.create_adapter_version(
    AdapterId='string',
    ClientRequestToken='string',
    DatasetConfig={
        'ManifestS3Object': {
            'Bucket': 'string',
            'Name': 'string',
            'Version': 'string'
        }
    },
    KMSKeyId='string',
    OutputConfig={
        'S3Bucket': 'string',
        'S3Prefix': 'string'
    },
    Tags={
        'string': 'string'
    }
)
Parameters:
  • AdapterId (string) –

    [REQUIRED]

    A string containing a unique ID for the adapter that will receive a new version.

  • ClientRequestToken (string) –

    Idempotent token is used to recognize the request. If the same token is used with multiple CreateAdapterVersion requests, the same session is returned. This token is employed to avoid unintentionally creating the same session multiple times.

    This field is autopopulated if not provided.

  • DatasetConfig (dict) –

    [REQUIRED]

    Specifies a dataset used to train a new adapter version. Takes a ManifestS3Object as the value.

    • ManifestS3Object (dict) –

      The S3 bucket name and file name that identifies the document.

      The AWS Region for the S3 bucket that contains the document must match the Region that you use for Amazon Textract operations.

      For Amazon Textract to process a file in an S3 bucket, the user must have permission to access the S3 bucket and file.

      • Bucket (string) –

        The name of the S3 bucket. Note that the # character is not valid in the file name.

      • Name (string) –

        The file name of the input document. Synchronous operations can use image files that are in JPEG or PNG format. Asynchronous operations also support PDF and TIFF format files.

      • Version (string) –

        If the bucket has versioning enabled, you can specify the object version.

  • KMSKeyId (string) – The identifier for your AWS Key Management Service key (AWS KMS key). Used to encrypt your documents.

  • OutputConfig (dict) –

    [REQUIRED]

    Sets whether or not your output will go to a user created bucket. Used to set the name of the bucket, and the prefix on the output file.

    OutputConfig is an optional parameter which lets you adjust where your output will be placed. By default, Amazon Textract will store the results internally and can only be accessed by the Get API operations. With OutputConfig enabled, you can set the name of the bucket the output will be sent to the file prefix of the results where you can download your results. Additionally, you can set the KMSKeyID parameter to a customer master key (CMK) to encrypt your output. Without this parameter set Amazon Textract will encrypt server-side using the AWS managed CMK for Amazon S3.

    Decryption of Customer Content is necessary for processing of the documents by Amazon Textract. If your account is opted out under an AI services opt out policy then all unencrypted Customer Content is immediately and permanently deleted after the Customer Content has been processed by the service. No copy of of the output is retained by Amazon Textract. For information about how to opt out, see Managing AI services opt-out policy.

    For more information on data privacy, see the Data Privacy FAQ.

    • S3Bucket (string) – [REQUIRED]

      The name of the bucket your output will go to.

    • S3Prefix (string) –

      The prefix of the object key that the output will be saved to. When not enabled, the prefix will be “textract_output”.

  • Tags (dict) –

    A set of tags (key-value pairs) that you want to attach to the adapter version.

    • (string) –

      • (string) –

Return type:

dict

Returns:

Response Syntax

{
    'AdapterId': 'string',
    'AdapterVersion': 'string'
}

Response Structure

  • (dict) –

    • AdapterId (string) –

      A string containing the unique ID for the adapter that has received a new version.

    • AdapterVersion (string) –

      A string describing the new version of the adapter.

Exceptions

  • Textract.Client.exceptions.InvalidParameterException

  • Textract.Client.exceptions.InvalidS3ObjectException

  • Textract.Client.exceptions.InvalidKMSKeyException

  • Textract.Client.exceptions.AccessDeniedException

  • Textract.Client.exceptions.ProvisionedThroughputExceededException

  • Textract.Client.exceptions.InternalServerError

  • Textract.Client.exceptions.IdempotentParameterMismatchException

  • Textract.Client.exceptions.ThrottlingException

  • Textract.Client.exceptions.LimitExceededException

  • Textract.Client.exceptions.ValidationException

  • Textract.Client.exceptions.ServiceQuotaExceededException

  • Textract.Client.exceptions.ResourceNotFoundException

  • Textract.Client.exceptions.ConflictException