pub struct Client { /* private fields */ }
Expand description

Client for Amazon Textract

Client for invoking operations on Amazon Textract. Each operation on Amazon Textract is a method on this this struct. .send() MUST be invoked on the generated operations to dispatch the request to the service.

Examples

Constructing a client and invoking an operation

    // create a shared configuration. This can be used & shared between multiple service clients.
    let shared_config = aws_config::load_from_env().await;
    let client = aws_sdk_textract::Client::new(&shared_config);
    // invoke an operation
    /* let rsp = client
        .<operation_name>().
        .<param>("some value")
        .send().await; */

Constructing a client with custom configuration

use aws_config::retry::RetryConfig;
let shared_config = aws_config::load_from_env().await;
let config = aws_sdk_textract::config::Builder::from(&shared_config)
  .retry_config(RetryConfig::disabled())
  .build();
let client = aws_sdk_textract::Client::from_conf(config);

Implementations§

Creates a client with the given service configuration.

Returns the client’s configuration.

Constructs a fluent builder for the AnalyzeDocument operation.

Constructs a fluent builder for the AnalyzeExpense operation.

  • The fluent builder is configurable:
    • document(Document) / set_document(Option<Document>):

      The input document, either as bytes or as an S3 object.

      You pass image bytes to an Amazon Textract API operation by using the Bytes property. For example, you would use the Bytes property to pass a document loaded from a local file system. Image bytes passed by using the Bytes property must be base64 encoded. Your code might not need to encode document file bytes if you’re using an AWS SDK to call Amazon Textract API operations.

      You pass images stored in an S3 bucket to an Amazon Textract API operation by using the S3Object property. Documents stored in an S3 bucket don’t need to be base64 encoded.

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

      If you use the AWS CLI to call Amazon Textract operations, passing image bytes using the Bytes property isn’t supported. You must first upload the document to an Amazon S3 bucket, and then call the operation using the S3Object property.

      For Amazon Textract to process an S3 object, the user must have permission to access the S3 object.

  • On success, responds with AnalyzeExpenseOutput with field(s):
  • On failure, responds with SdkError<AnalyzeExpenseError>

Constructs a fluent builder for the AnalyzeID operation.

Constructs a fluent builder for the DetectDocumentText operation.

Constructs a fluent builder for the GetDocumentAnalysis operation.

Constructs a fluent builder for the GetDocumentTextDetection operation.

Constructs a fluent builder for the GetExpenseAnalysis operation.

Constructs a fluent builder for the GetLendingAnalysis operation.

Constructs a fluent builder for the GetLendingAnalysisSummary operation.

Constructs a fluent builder for the StartDocumentAnalysis operation.

Constructs a fluent builder for the StartDocumentTextDetection operation.

Constructs a fluent builder for the StartExpenseAnalysis operation.

Constructs a fluent builder for the StartLendingAnalysis operation.

  • The fluent builder is configurable:
    • document_location(DocumentLocation) / set_document_location(Option<DocumentLocation>):

      The Amazon S3 bucket that contains the document to be processed. It’s used by asynchronous operations.

      The input document can be an image file in JPEG or PNG format. It can also be a file in PDF format.

    • client_request_token(impl Into<String>) / set_client_request_token(Option<String>):

      The idempotent token that you use to identify the start request. If you use the same token with multiple StartLendingAnalysis requests, the same JobId is returned. Use ClientRequestToken to prevent the same job from being accidentally started more than once. For more information, see Calling Amazon Textract Asynchronous Operations.

    • job_tag(impl Into<String>) / set_job_tag(Option<String>):

      An identifier that you specify to be included in the completion notification published to the Amazon SNS topic. For example, you can use JobTag to identify the type of document that the completion notification corresponds to (such as a tax form or a receipt).

    • notification_channel(NotificationChannel) / set_notification_channel(Option<NotificationChannel>):

      The Amazon Simple Notification Service (Amazon SNS) topic to which Amazon Textract publishes the completion status of an asynchronous document operation.

    • output_config(OutputConfig) / set_output_config(Option<OutputConfig>):

      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.

    • kms_key_id(impl Into<String>) / set_kms_key_id(Option<String>):

      The KMS key used to encrypt the inference results. This can be in either Key ID or Key Alias format. When a KMS key is provided, the KMS key will be used for server-side encryption of the objects in the customer bucket. When this parameter is not enabled, the result will be encrypted server side, using SSE-S3.

  • On success, responds with StartLendingAnalysisOutput with field(s):
    • job_id(Option<String>):

      A unique identifier for the lending or text-detection job. The JobId is returned from StartLendingAnalysis. A JobId value is only valid for 7 days.

  • On failure, responds with SdkError<StartLendingAnalysisError>

Creates a new client from an SDK Config.

Panics
  • This method will panic if the sdk_config is missing an async sleep implementation. If you experience this panic, set the sleep_impl on the Config passed into this function to fix it.
  • This method will panic if the sdk_config is missing an HTTP connector. If you experience this panic, set the http_connector on the Config passed into this function to fix it.

Creates a new client from the service Config.

Panics
  • This method will panic if the conf is missing an async sleep implementation. If you experience this panic, set the sleep_impl on the Config passed into this function to fix it.
  • This method will panic if the conf is missing an HTTP connector. If you experience this panic, set the http_connector on the Config passed into this function to fix it.

Trait Implementations§

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more
Converts to this type from the input type.

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Should always be Self
The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.
Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more