Struct aws_sdk_textract::Client
source · 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.
§Constructing a Client
A Config is required to construct a client. For most use cases, the aws-config
crate should be used to automatically resolve this config using
aws_config::load_from_env(), since this will resolve an SdkConfig which can be shared
across multiple different AWS SDK clients. This config resolution process can be customized
by calling aws_config::from_env() instead, which returns a ConfigLoader that uses
the builder pattern to customize the default config.
In the simplest case, creating a client looks as follows:
let config = aws_config::load_from_env().await;
let client = aws_sdk_textract::Client::new(&config);Occasionally, SDKs may have additional service-specific values that can be set on the Config that
is absent from SdkConfig, or slightly different settings for a specific client may be desired.
The Config struct implements From<&SdkConfig>, so setting these specific settings can be
done as follows:
let sdk_config = ::aws_config::load_from_env().await;
let config = aws_sdk_textract::config::Builder::from(&sdk_config)
.some_service_specific_setting("value")
.build();See the aws-config docs and Config for more information on customizing configuration.
Note: Client construction is expensive due to connection thread pool initialization, and should be done once at application start-up.
§Using the Client
A client has a function for every operation that can be performed by the service.
For example, the CreateAdapter operation has
a Client::create_adapter, function which returns a builder for that operation.
The fluent builder ultimately has a send() function that returns an async future that
returns a result, as illustrated below:
let result = client.create_adapter()
.adapter_name("example")
.send()
.await;The underlying HTTP requests that get made by this can be modified with the customize_operation
function on the fluent builder. See the customize module for more
information.
Implementations§
source§impl Client
impl Client
sourcepub fn analyze_document(&self) -> AnalyzeDocumentFluentBuilder
pub fn analyze_document(&self) -> AnalyzeDocumentFluentBuilder
Constructs a fluent builder for the AnalyzeDocument operation.
- The fluent builder is configurable:
document(Document)/set_document(Option<Document>):
required: trueThe input document as base64-encoded bytes or an Amazon S3 object. If you use the AWS CLI to call Amazon Textract operations, you can’t pass image bytes. The document must be an image in JPEG, PNG, PDF, or TIFF format.
If you’re using an AWS SDK to call Amazon Textract, you might not need to base64-encode image bytes that are passed using the
Bytesfield.feature_types(FeatureType)/set_feature_types(Option<Vec::<FeatureType>>):
required: trueA list of the types of analysis to perform. Add TABLES to the list to return information about the tables that are detected in the input document. Add FORMS to return detected form data. Add SIGNATURES to return the locations of detected signatures. Add LAYOUT to the list to return information about the layout of the document. All lines and words detected in the document are included in the response (including text that isn’t related to the value of
FeatureTypes).human_loop_config(HumanLoopConfig)/set_human_loop_config(Option<HumanLoopConfig>):
required: falseSets the configuration for the human in the loop workflow for analyzing documents.
queries_config(QueriesConfig)/set_queries_config(Option<QueriesConfig>):
required: falseContains Queries and the alias for those Queries, as determined by the input.
adapters_config(AdaptersConfig)/set_adapters_config(Option<AdaptersConfig>):
required: falseSpecifies the adapter to be used when analyzing a document.
- On success, responds with
AnalyzeDocumentOutputwith field(s):document_metadata(Option<DocumentMetadata>):Metadata about the analyzed document. An example is the number of pages.
blocks(Option<Vec::<Block>>):The items that are detected and analyzed by
AnalyzeDocument.human_loop_activation_output(Option<HumanLoopActivationOutput>):Shows the results of the human in the loop evaluation.
analyze_document_model_version(Option<String>):The version of the model used to analyze the document.
- On failure, responds with
SdkError<AnalyzeDocumentError>
source§impl Client
impl Client
sourcepub fn analyze_expense(&self) -> AnalyzeExpenseFluentBuilder
pub fn analyze_expense(&self) -> AnalyzeExpenseFluentBuilder
Constructs a fluent builder for the AnalyzeExpense operation.
- The fluent builder is configurable:
document(Document)/set_document(Option<Document>):
required: trueThe input document, either as bytes or as an S3 object.
You pass image bytes to an Amazon Textract API operation by using the
Bytesproperty. For example, you would use theBytesproperty to pass a document loaded from a local file system. Image bytes passed by using theBytesproperty 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
S3Objectproperty. 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
AnalyzeExpenseOutputwith field(s):document_metadata(Option<DocumentMetadata>):Information about the input document.
expense_documents(Option<Vec::<ExpenseDocument>>):The expenses detected by Amazon Textract.
- On failure, responds with
SdkError<AnalyzeExpenseError>
source§impl Client
impl Client
sourcepub fn analyze_id(&self) -> AnalyzeIDFluentBuilder
pub fn analyze_id(&self) -> AnalyzeIDFluentBuilder
Constructs a fluent builder for the AnalyzeID operation.
- The fluent builder is configurable:
document_pages(Document)/set_document_pages(Option<Vec::<Document>>):
required: trueThe document being passed to AnalyzeID.
- On success, responds with
AnalyzeIdOutputwith field(s):identity_documents(Option<Vec::<IdentityDocument>>):The list of documents processed by AnalyzeID. Includes a number denoting their place in the list and the response structure for the document.
document_metadata(Option<DocumentMetadata>):Information about the input document.
analyze_id_model_version(Option<String>):The version of the AnalyzeIdentity API being used to process documents.
- On failure, responds with
SdkError<AnalyzeIDError>
source§impl Client
impl Client
sourcepub fn create_adapter(&self) -> CreateAdapterFluentBuilder
pub fn create_adapter(&self) -> CreateAdapterFluentBuilder
Constructs a fluent builder for the CreateAdapter operation.
- The fluent builder is configurable:
adapter_name(impl Into<String>)/set_adapter_name(Option<String>):
required: trueThe name to be assigned to the adapter being created.
client_request_token(impl Into<String>)/set_client_request_token(Option<String>):
required: falseIdempotent token is used to recognize the request. If the same token is used with multiple CreateAdapter requests, the same session is returned. This token is employed to avoid unintentionally creating the same session multiple times.
description(impl Into<String>)/set_description(Option<String>):
required: falseThe description to be assigned to the adapter being created.
feature_types(FeatureType)/set_feature_types(Option<Vec::<FeatureType>>):
required: trueThe type of feature that the adapter is being trained on. Currrenly, supported feature types are:
QUERIESauto_update(AutoUpdate)/set_auto_update(Option<AutoUpdate>):
required: falseControls whether or not the adapter should automatically update.
tags(impl Into<String>, impl Into<String>)/set_tags(Option<HashMap::<String, String>>):
required: falseA list of tags to be added to the adapter.
- On success, responds with
CreateAdapterOutputwith field(s):adapter_id(Option<String>):A string containing the unique ID for the adapter that has been created.
- On failure, responds with
SdkError<CreateAdapterError>
source§impl Client
impl Client
sourcepub fn create_adapter_version(&self) -> CreateAdapterVersionFluentBuilder
pub fn create_adapter_version(&self) -> CreateAdapterVersionFluentBuilder
Constructs a fluent builder for the CreateAdapterVersion operation.
- The fluent builder is configurable:
adapter_id(impl Into<String>)/set_adapter_id(Option<String>):
required: trueA string containing a unique ID for the adapter that will receive a new version.
client_request_token(impl Into<String>)/set_client_request_token(Option<String>):
required: falseIdempotent 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.
dataset_config(AdapterVersionDatasetConfig)/set_dataset_config(Option<AdapterVersionDatasetConfig>):
required: trueSpecifies a dataset used to train a new adapter version. Takes a ManifestS3Object as the value.
kms_key_id(impl Into<String>)/set_kms_key_id(Option<String>):
required: falseThe identifier for your AWS Key Management Service key (AWS KMS key). Used to encrypt your documents.
output_config(OutputConfig)/set_output_config(Option<OutputConfig>):
required: trueSets 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.
OutputConfigis 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. WithOutputConfigenabled, 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 theKMSKeyIDparameter 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.
tags(impl Into<String>, impl Into<String>)/set_tags(Option<HashMap::<String, String>>):
required: falseA set of tags (key-value pairs) that you want to attach to the adapter version.
- On success, responds with
CreateAdapterVersionOutputwith field(s):adapter_id(Option<String>):A string containing the unique ID for the adapter that has received a new version.
adapter_version(Option<String>):A string describing the new version of the adapter.
- On failure, responds with
SdkError<CreateAdapterVersionError>
source§impl Client
impl Client
sourcepub fn delete_adapter(&self) -> DeleteAdapterFluentBuilder
pub fn delete_adapter(&self) -> DeleteAdapterFluentBuilder
Constructs a fluent builder for the DeleteAdapter operation.
- The fluent builder is configurable:
adapter_id(impl Into<String>)/set_adapter_id(Option<String>):
required: trueA string containing a unique ID for the adapter to be deleted.
- On success, responds with
DeleteAdapterOutput - On failure, responds with
SdkError<DeleteAdapterError>
source§impl Client
impl Client
sourcepub fn delete_adapter_version(&self) -> DeleteAdapterVersionFluentBuilder
pub fn delete_adapter_version(&self) -> DeleteAdapterVersionFluentBuilder
Constructs a fluent builder for the DeleteAdapterVersion operation.
- The fluent builder is configurable:
adapter_id(impl Into<String>)/set_adapter_id(Option<String>):
required: trueA string containing a unique ID for the adapter version that will be deleted.
adapter_version(impl Into<String>)/set_adapter_version(Option<String>):
required: trueSpecifies the adapter version to be deleted.
- On success, responds with
DeleteAdapterVersionOutput - On failure, responds with
SdkError<DeleteAdapterVersionError>
source§impl Client
impl Client
sourcepub fn detect_document_text(&self) -> DetectDocumentTextFluentBuilder
pub fn detect_document_text(&self) -> DetectDocumentTextFluentBuilder
Constructs a fluent builder for the DetectDocumentText operation.
- The fluent builder is configurable:
document(Document)/set_document(Option<Document>):
required: trueThe input document as base64-encoded bytes or an Amazon S3 object. If you use the AWS CLI to call Amazon Textract operations, you can’t pass image bytes. The document must be an image in JPEG or PNG format.
If you’re using an AWS SDK to call Amazon Textract, you might not need to base64-encode image bytes that are passed using the
Bytesfield.
- On success, responds with
DetectDocumentTextOutputwith field(s):document_metadata(Option<DocumentMetadata>):Metadata about the document. It contains the number of pages that are detected in the document.
blocks(Option<Vec::<Block>>):An array of
Blockobjects that contain the text that’s detected in the document.detect_document_text_model_version(Option<String>):
- On failure, responds with
SdkError<DetectDocumentTextError>
source§impl Client
impl Client
sourcepub fn get_adapter(&self) -> GetAdapterFluentBuilder
pub fn get_adapter(&self) -> GetAdapterFluentBuilder
Constructs a fluent builder for the GetAdapter operation.
- The fluent builder is configurable:
adapter_id(impl Into<String>)/set_adapter_id(Option<String>):
required: trueA string containing a unique ID for the adapter.
- On success, responds with
GetAdapterOutputwith field(s):adapter_id(Option<String>):A string identifying the adapter that information has been retrieved for.
adapter_name(Option<String>):The name of the requested adapter.
creation_time(Option<DateTime>):The date and time the requested adapter was created at.
description(Option<String>):The description for the requested adapter.
feature_types(Option<Vec::<FeatureType>>):List of the targeted feature types for the requested adapter.
auto_update(Option<AutoUpdate>):Binary value indicating if the adapter is being automatically updated or not.
tags(Option<HashMap::<String, String>>):A set of tags (key-value pairs) associated with the adapter that has been retrieved.
- On failure, responds with
SdkError<GetAdapterError>
source§impl Client
impl Client
sourcepub fn get_adapter_version(&self) -> GetAdapterVersionFluentBuilder
pub fn get_adapter_version(&self) -> GetAdapterVersionFluentBuilder
Constructs a fluent builder for the GetAdapterVersion operation.
- The fluent builder is configurable:
adapter_id(impl Into<String>)/set_adapter_id(Option<String>):
required: trueA string specifying a unique ID for the adapter version you want to retrieve information for.
adapter_version(impl Into<String>)/set_adapter_version(Option<String>):
required: trueA string specifying the adapter version you want to retrieve information for.
- On success, responds with
GetAdapterVersionOutputwith field(s):adapter_id(Option<String>):A string containing a unique ID for the adapter version being retrieved.
adapter_version(Option<String>):A string containing the adapter version that has been retrieved.
creation_time(Option<DateTime>):The time that the adapter version was created.
feature_types(Option<Vec::<FeatureType>>):List of the targeted feature types for the requested adapter version.
status(Option<AdapterVersionStatus>):The status of the adapter version that has been requested.
status_message(Option<String>):A message that describes the status of the requested adapter version.
dataset_config(Option<AdapterVersionDatasetConfig>):Specifies a dataset used to train a new adapter version. Takes a ManifestS3Objec as the value.
kms_key_id(Option<String>):The identifier for your AWS Key Management Service key (AWS KMS key). Used to encrypt your documents.
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.
OutputConfigis 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. WithOutputConfigenabled, 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 theKMSKeyIDparameter 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.
evaluation_metrics(Option<Vec::<AdapterVersionEvaluationMetric>>):The evaluation metrics (F1 score, Precision, and Recall) for the requested version, grouped by baseline metrics and adapter version.
tags(Option<HashMap::<String, String>>):A set of tags (key-value pairs) that are associated with the adapter version.
- On failure, responds with
SdkError<GetAdapterVersionError>
source§impl Client
impl Client
sourcepub fn get_document_analysis(&self) -> GetDocumentAnalysisFluentBuilder
pub fn get_document_analysis(&self) -> GetDocumentAnalysisFluentBuilder
Constructs a fluent builder for the GetDocumentAnalysis operation.
- The fluent builder is configurable:
job_id(impl Into<String>)/set_job_id(Option<String>):
required: trueA unique identifier for the text-detection job. The
JobIdis returned fromStartDocumentAnalysis. AJobIdvalue is only valid for 7 days.max_results(i32)/set_max_results(Option<i32>):
required: falseThe maximum number of results to return per paginated call. The largest value that you can specify is 1,000. If you specify a value greater than 1,000, a maximum of 1,000 results is returned. The default value is 1,000.
next_token(impl Into<String>)/set_next_token(Option<String>):
required: falseIf the previous response was incomplete (because there are more blocks to retrieve), Amazon Textract returns a pagination token in the response. You can use this pagination token to retrieve the next set of blocks.
- On success, responds with
GetDocumentAnalysisOutputwith field(s):document_metadata(Option<DocumentMetadata>):Information about a document that Amazon Textract processed.
DocumentMetadatais returned in every page of paginated responses from an Amazon Textract video operation.job_status(Option<JobStatus>):The current status of the text detection job.
next_token(Option<String>):If the response is truncated, Amazon Textract returns this token. You can use this token in the subsequent request to retrieve the next set of text detection results.
blocks(Option<Vec::<Block>>):The results of the text-analysis operation.
warnings(Option<Vec::<Warning>>):A list of warnings that occurred during the document-analysis operation.
status_message(Option<String>):Returns if the detection job could not be completed. Contains explanation for what error occured.
analyze_document_model_version(Option<String>):
- On failure, responds with
SdkError<GetDocumentAnalysisError>
source§impl Client
impl Client
sourcepub fn get_document_text_detection(
&self,
) -> GetDocumentTextDetectionFluentBuilder
pub fn get_document_text_detection( &self, ) -> GetDocumentTextDetectionFluentBuilder
Constructs a fluent builder for the GetDocumentTextDetection operation.
- The fluent builder is configurable:
job_id(impl Into<String>)/set_job_id(Option<String>):
required: trueA unique identifier for the text detection job. The
JobIdis returned fromStartDocumentTextDetection. AJobIdvalue is only valid for 7 days.max_results(i32)/set_max_results(Option<i32>):
required: falseThe maximum number of results to return per paginated call. The largest value you can specify is 1,000. If you specify a value greater than 1,000, a maximum of 1,000 results is returned. The default value is 1,000.
next_token(impl Into<String>)/set_next_token(Option<String>):
required: falseIf the previous response was incomplete (because there are more blocks to retrieve), Amazon Textract returns a pagination token in the response. You can use this pagination token to retrieve the next set of blocks.
- On success, responds with
GetDocumentTextDetectionOutputwith field(s):document_metadata(Option<DocumentMetadata>):Information about a document that Amazon Textract processed.
DocumentMetadatais returned in every page of paginated responses from an Amazon Textract video operation.job_status(Option<JobStatus>):The current status of the text detection job.
next_token(Option<String>):If the response is truncated, Amazon Textract returns this token. You can use this token in the subsequent request to retrieve the next set of text-detection results.
blocks(Option<Vec::<Block>>):The results of the text-detection operation.
warnings(Option<Vec::<Warning>>):A list of warnings that occurred during the text-detection operation for the document.
status_message(Option<String>):Returns if the detection job could not be completed. Contains explanation for what error occured.
detect_document_text_model_version(Option<String>):
- On failure, responds with
SdkError<GetDocumentTextDetectionError>
source§impl Client
impl Client
sourcepub fn get_expense_analysis(&self) -> GetExpenseAnalysisFluentBuilder
pub fn get_expense_analysis(&self) -> GetExpenseAnalysisFluentBuilder
Constructs a fluent builder for the GetExpenseAnalysis operation.
- The fluent builder is configurable:
job_id(impl Into<String>)/set_job_id(Option<String>):
required: trueA unique identifier for the text detection job. The
JobIdis returned fromStartExpenseAnalysis. AJobIdvalue is only valid for 7 days.max_results(i32)/set_max_results(Option<i32>):
required: falseThe maximum number of results to return per paginated call. The largest value you can specify is 20. If you specify a value greater than 20, a maximum of 20 results is returned. The default value is 20.
next_token(impl Into<String>)/set_next_token(Option<String>):
required: falseIf the previous response was incomplete (because there are more blocks to retrieve), Amazon Textract returns a pagination token in the response. You can use this pagination token to retrieve the next set of blocks.
- On success, responds with
GetExpenseAnalysisOutputwith field(s):document_metadata(Option<DocumentMetadata>):Information about a document that Amazon Textract processed.
DocumentMetadatais returned in every page of paginated responses from an Amazon Textract operation.job_status(Option<JobStatus>):The current status of the text detection job.
next_token(Option<String>):If the response is truncated, Amazon Textract returns this token. You can use this token in the subsequent request to retrieve the next set of text-detection results.
expense_documents(Option<Vec::<ExpenseDocument>>):The expenses detected by Amazon Textract.
warnings(Option<Vec::<Warning>>):A list of warnings that occurred during the text-detection operation for the document.
status_message(Option<String>):Returns if the detection job could not be completed. Contains explanation for what error occured.
analyze_expense_model_version(Option<String>):The current model version of AnalyzeExpense.
- On failure, responds with
SdkError<GetExpenseAnalysisError>
source§impl Client
impl Client
sourcepub fn get_lending_analysis(&self) -> GetLendingAnalysisFluentBuilder
pub fn get_lending_analysis(&self) -> GetLendingAnalysisFluentBuilder
Constructs a fluent builder for the GetLendingAnalysis operation.
- The fluent builder is configurable:
job_id(impl Into<String>)/set_job_id(Option<String>):
required: trueA unique identifier for the lending or text-detection job. The
JobIdis returned fromStartLendingAnalysis. AJobIdvalue is only valid for 7 days.max_results(i32)/set_max_results(Option<i32>):
required: falseThe maximum number of results to return per paginated call. The largest value that you can specify is 30. If you specify a value greater than 30, a maximum of 30 results is returned. The default value is 30.
next_token(impl Into<String>)/set_next_token(Option<String>):
required: falseIf the previous response was incomplete, Amazon Textract returns a pagination token in the response. You can use this pagination token to retrieve the next set of lending results.
- On success, responds with
GetLendingAnalysisOutputwith field(s):document_metadata(Option<DocumentMetadata>):Information about the input document.
job_status(Option<JobStatus>):The current status of the lending analysis job.
next_token(Option<String>):If the response is truncated, Amazon Textract returns this token. You can use this token in the subsequent request to retrieve the next set of lending results.
results(Option<Vec::<LendingResult>>):Holds the information returned by one of AmazonTextract’s document analysis operations for the pinstripe.
warnings(Option<Vec::<Warning>>):A list of warnings that occurred during the lending analysis operation.
status_message(Option<String>):Returns if the lending analysis job could not be completed. Contains explanation for what error occurred.
analyze_lending_model_version(Option<String>):The current model version of the Analyze Lending API.
- On failure, responds with
SdkError<GetLendingAnalysisError>
source§impl Client
impl Client
sourcepub fn get_lending_analysis_summary(
&self,
) -> GetLendingAnalysisSummaryFluentBuilder
pub fn get_lending_analysis_summary( &self, ) -> GetLendingAnalysisSummaryFluentBuilder
Constructs a fluent builder for the GetLendingAnalysisSummary operation.
- The fluent builder is configurable:
job_id(impl Into<String>)/set_job_id(Option<String>):
required: trueA unique identifier for the lending or text-detection job. The
JobIdis returned from StartLendingAnalysis. AJobIdvalue is only valid for 7 days.
- On success, responds with
GetLendingAnalysisSummaryOutputwith field(s):document_metadata(Option<DocumentMetadata>):Information about the input document.
job_status(Option<JobStatus>):The current status of the lending analysis job.
summary(Option<LendingSummary>):Contains summary information for documents grouped by type.
warnings(Option<Vec::<Warning>>):A list of warnings that occurred during the lending analysis operation.
status_message(Option<String>):Returns if the lending analysis could not be completed. Contains explanation for what error occurred.
analyze_lending_model_version(Option<String>):The current model version of the Analyze Lending API.
- On failure, responds with
SdkError<GetLendingAnalysisSummaryError>
source§impl Client
impl Client
sourcepub fn list_adapter_versions(&self) -> ListAdapterVersionsFluentBuilder
pub fn list_adapter_versions(&self) -> ListAdapterVersionsFluentBuilder
Constructs a fluent builder for the ListAdapterVersions operation.
This operation supports pagination; See into_paginator().
- The fluent builder is configurable:
adapter_id(impl Into<String>)/set_adapter_id(Option<String>):
required: falseA string containing a unique ID for the adapter to match for when listing adapter versions.
after_creation_time(DateTime)/set_after_creation_time(Option<DateTime>):
required: falseSpecifies the lower bound for the ListAdapterVersions operation. Ensures ListAdapterVersions returns only adapter versions created after the specified creation time.
before_creation_time(DateTime)/set_before_creation_time(Option<DateTime>):
required: falseSpecifies the upper bound for the ListAdapterVersions operation. Ensures ListAdapterVersions returns only adapter versions created after the specified creation time.
max_results(i32)/set_max_results(Option<i32>):
required: falseThe maximum number of results to return when listing adapter versions.
next_token(impl Into<String>)/set_next_token(Option<String>):
required: falseIdentifies the next page of results to return when listing adapter versions.
- On success, responds with
ListAdapterVersionsOutputwith field(s):adapter_versions(Option<Vec::<AdapterVersionOverview>>):Adapter versions that match the filtering criteria specified when calling ListAdapters.
next_token(Option<String>):Identifies the next page of results to return when listing adapter versions.
- On failure, responds with
SdkError<ListAdapterVersionsError>
source§impl Client
impl Client
sourcepub fn list_adapters(&self) -> ListAdaptersFluentBuilder
pub fn list_adapters(&self) -> ListAdaptersFluentBuilder
Constructs a fluent builder for the ListAdapters operation.
This operation supports pagination; See into_paginator().
- The fluent builder is configurable:
after_creation_time(DateTime)/set_after_creation_time(Option<DateTime>):
required: falseSpecifies the lower bound for the ListAdapters operation. Ensures ListAdapters returns only adapters created after the specified creation time.
before_creation_time(DateTime)/set_before_creation_time(Option<DateTime>):
required: falseSpecifies the upper bound for the ListAdapters operation. Ensures ListAdapters returns only adapters created before the specified creation time.
max_results(i32)/set_max_results(Option<i32>):
required: falseThe maximum number of results to return when listing adapters.
next_token(impl Into<String>)/set_next_token(Option<String>):
required: falseIdentifies the next page of results to return when listing adapters.
- On success, responds with
ListAdaptersOutputwith field(s):adapters(Option<Vec::<AdapterOverview>>):A list of adapters that matches the filtering criteria specified when calling ListAdapters.
next_token(Option<String>):Identifies the next page of results to return when listing adapters.
- On failure, responds with
SdkError<ListAdaptersError>
source§impl Client
impl Client
Constructs a fluent builder for the ListTagsForResource operation.
- The fluent builder is configurable:
resource_arn(impl Into<String>)/set_resource_arn(Option<String>):
required: trueThe Amazon Resource Name (ARN) that specifies the resource to list tags for.
- On success, responds with
ListTagsForResourceOutputwith field(s):tags(Option<HashMap::<String, String>>):A set of tags (key-value pairs) that are part of the requested resource.
- On failure, responds with
SdkError<ListTagsForResourceError>
source§impl Client
impl Client
sourcepub fn start_document_analysis(&self) -> StartDocumentAnalysisFluentBuilder
pub fn start_document_analysis(&self) -> StartDocumentAnalysisFluentBuilder
Constructs a fluent builder for the StartDocumentAnalysis operation.
- The fluent builder is configurable:
document_location(DocumentLocation)/set_document_location(Option<DocumentLocation>):
required: trueThe location of the document to be processed.
feature_types(FeatureType)/set_feature_types(Option<Vec::<FeatureType>>):
required: trueA list of the types of analysis to perform. Add TABLES to the list to return information about the tables that are detected in the input document. Add FORMS to return detected form data. To perform both types of analysis, add TABLES and FORMS to
FeatureTypes. All lines and words detected in the document are included in the response (including text that isn’t related to the value ofFeatureTypes).client_request_token(impl Into<String>)/set_client_request_token(Option<String>):
required: falseThe idempotent token that you use to identify the start request. If you use the same token with multiple
StartDocumentAnalysisrequests, the sameJobIdis returned. UseClientRequestTokento 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>):
required: falseAn identifier that you specify that’s included in the completion notification published to the Amazon SNS topic. For example, you can use
JobTagto 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>):
required: falseThe Amazon SNS topic ARN that you want Amazon Textract to publish the completion status of the operation to.
output_config(OutputConfig)/set_output_config(Option<OutputConfig>):
required: falseSets if the output will go to a customer defined bucket. By default, Amazon Textract will save the results internally to be accessed by the GetDocumentAnalysis operation.
kms_key_id(impl Into<String>)/set_kms_key_id(Option<String>):
required: falseThe 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.
queries_config(QueriesConfig)/set_queries_config(Option<QueriesConfig>):
required: falseadapters_config(AdaptersConfig)/set_adapters_config(Option<AdaptersConfig>):
required: falseSpecifies the adapter to be used when analyzing a document.
- On success, responds with
StartDocumentAnalysisOutputwith field(s):job_id(Option<String>):The identifier for the document text detection job. Use
JobIdto identify the job in a subsequent call toGetDocumentAnalysis. AJobIdvalue is only valid for 7 days.
- On failure, responds with
SdkError<StartDocumentAnalysisError>
source§impl Client
impl Client
sourcepub fn start_document_text_detection(
&self,
) -> StartDocumentTextDetectionFluentBuilder
pub fn start_document_text_detection( &self, ) -> StartDocumentTextDetectionFluentBuilder
Constructs a fluent builder for the StartDocumentTextDetection operation.
- The fluent builder is configurable:
document_location(DocumentLocation)/set_document_location(Option<DocumentLocation>):
required: trueThe location of the document to be processed.
client_request_token(impl Into<String>)/set_client_request_token(Option<String>):
required: falseThe idempotent token that’s used to identify the start request. If you use the same token with multiple
StartDocumentTextDetectionrequests, the sameJobIdis returned. UseClientRequestTokento 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>):
required: falseAn identifier that you specify that’s included in the completion notification published to the Amazon SNS topic. For example, you can use
JobTagto 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>):
required: falseThe Amazon SNS topic ARN that you want Amazon Textract to publish the completion status of the operation to.
output_config(OutputConfig)/set_output_config(Option<OutputConfig>):
required: falseSets if the output will go to a customer defined bucket. By default Amazon Textract will save the results internally to be accessed with the GetDocumentTextDetection operation.
kms_key_id(impl Into<String>)/set_kms_key_id(Option<String>):
required: falseThe 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
StartDocumentTextDetectionOutputwith field(s):job_id(Option<String>):The identifier of the text detection job for the document. Use
JobIdto identify the job in a subsequent call toGetDocumentTextDetection. AJobIdvalue is only valid for 7 days.
- On failure, responds with
SdkError<StartDocumentTextDetectionError>
source§impl Client
impl Client
sourcepub fn start_expense_analysis(&self) -> StartExpenseAnalysisFluentBuilder
pub fn start_expense_analysis(&self) -> StartExpenseAnalysisFluentBuilder
Constructs a fluent builder for the StartExpenseAnalysis operation.
- The fluent builder is configurable:
document_location(DocumentLocation)/set_document_location(Option<DocumentLocation>):
required: trueThe location of the document to be processed.
client_request_token(impl Into<String>)/set_client_request_token(Option<String>):
required: falseThe idempotent token that’s used to identify the start request. If you use the same token with multiple
StartDocumentTextDetectionrequests, the sameJobIdis returned. UseClientRequestTokento prevent the same job from being accidentally started more than once. For more information, see Calling Amazon Textract Asynchronous Operationsjob_tag(impl Into<String>)/set_job_tag(Option<String>):
required: falseAn identifier you specify that’s included in the completion notification published to the Amazon SNS topic. For example, you can use
JobTagto 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>):
required: falseThe Amazon SNS topic ARN that you want Amazon Textract to publish the completion status of the operation to.
output_config(OutputConfig)/set_output_config(Option<OutputConfig>):
required: falseSets if the output will go to a customer defined bucket. By default, Amazon Textract will save the results internally to be accessed by the
GetExpenseAnalysisoperation.kms_key_id(impl Into<String>)/set_kms_key_id(Option<String>):
required: falseThe 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
StartExpenseAnalysisOutputwith field(s):job_id(Option<String>):A unique identifier for the text detection job. The
JobIdis returned fromStartExpenseAnalysis. AJobIdvalue is only valid for 7 days.
- On failure, responds with
SdkError<StartExpenseAnalysisError>
source§impl Client
impl Client
sourcepub fn start_lending_analysis(&self) -> StartLendingAnalysisFluentBuilder
pub fn start_lending_analysis(&self) -> StartLendingAnalysisFluentBuilder
Constructs a fluent builder for the StartLendingAnalysis operation.
- The fluent builder is configurable:
document_location(DocumentLocation)/set_document_location(Option<DocumentLocation>):
required: trueThe 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>):
required: falseThe idempotent token that you use to identify the start request. If you use the same token with multiple
StartLendingAnalysisrequests, the sameJobIdis returned. UseClientRequestTokento 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>):
required: falseAn identifier that you specify to be included in the completion notification published to the Amazon SNS topic. For example, you can use
JobTagto 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>):
required: falseThe 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>):
required: falseSets 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.
OutputConfigis 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. WithOutputConfigenabled, 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 theKMSKeyIDparameter 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>):
required: falseThe 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
StartLendingAnalysisOutputwith field(s):job_id(Option<String>):A unique identifier for the lending or text-detection job. The
JobIdis returned fromStartLendingAnalysis. AJobIdvalue is only valid for 7 days.
- On failure, responds with
SdkError<StartLendingAnalysisError>
source§impl Client
impl Client
sourcepub fn tag_resource(&self) -> TagResourceFluentBuilder
pub fn tag_resource(&self) -> TagResourceFluentBuilder
Constructs a fluent builder for the TagResource operation.
- The fluent builder is configurable:
resource_arn(impl Into<String>)/set_resource_arn(Option<String>):
required: trueThe Amazon Resource Name (ARN) that specifies the resource to be tagged.
tags(impl Into<String>, impl Into<String>)/set_tags(Option<HashMap::<String, String>>):
required: trueA set of tags (key-value pairs) that you want to assign to the resource.
- On success, responds with
TagResourceOutput - On failure, responds with
SdkError<TagResourceError>
source§impl Client
impl Client
sourcepub fn untag_resource(&self) -> UntagResourceFluentBuilder
pub fn untag_resource(&self) -> UntagResourceFluentBuilder
Constructs a fluent builder for the UntagResource operation.
- The fluent builder is configurable:
resource_arn(impl Into<String>)/set_resource_arn(Option<String>):
required: trueThe Amazon Resource Name (ARN) that specifies the resource to be untagged.
tag_keys(impl Into<String>)/set_tag_keys(Option<Vec::<String>>):
required: trueSpecifies the tags to be removed from the resource specified by the ResourceARN.
- On success, responds with
UntagResourceOutput - On failure, responds with
SdkError<UntagResourceError>
source§impl Client
impl Client
sourcepub fn update_adapter(&self) -> UpdateAdapterFluentBuilder
pub fn update_adapter(&self) -> UpdateAdapterFluentBuilder
Constructs a fluent builder for the UpdateAdapter operation.
- The fluent builder is configurable:
adapter_id(impl Into<String>)/set_adapter_id(Option<String>):
required: trueA string containing a unique ID for the adapter that will be updated.
description(impl Into<String>)/set_description(Option<String>):
required: falseThe new description to be applied to the adapter.
adapter_name(impl Into<String>)/set_adapter_name(Option<String>):
required: falseThe new name to be applied to the adapter.
auto_update(AutoUpdate)/set_auto_update(Option<AutoUpdate>):
required: falseThe new auto-update status to be applied to the adapter.
- On success, responds with
UpdateAdapterOutputwith field(s):adapter_id(Option<String>):A string containing a unique ID for the adapter that has been updated.
adapter_name(Option<String>):A string containing the name of the adapter that has been updated.
creation_time(Option<DateTime>):An object specifying the creation time of the the adapter that has been updated.
description(Option<String>):A string containing the description of the adapter that has been updated.
feature_types(Option<Vec::<FeatureType>>):List of the targeted feature types for the updated adapter.
auto_update(Option<AutoUpdate>):The auto-update status of the adapter that has been updated.
- On failure, responds with
SdkError<UpdateAdapterError>
source§impl Client
impl Client
sourcepub fn from_conf(conf: Config) -> Self
pub fn from_conf(conf: Config) -> Self
Creates a new client from the service Config.
§Panics
This method will panic in the following cases:
- Retries or timeouts are enabled without a
sleep_implconfigured. - Identity caching is enabled without a
sleep_implandtime_sourceconfigured. - No
behavior_versionis provided.
The panic message for each of these will have instructions on how to resolve them.
source§impl Client
impl Client
sourcepub fn new(sdk_config: &SdkConfig) -> Self
pub fn new(sdk_config: &SdkConfig) -> Self
Creates a new client from an SDK Config.
§Panics
- This method will panic if the
sdk_configis missing an async sleep implementation. If you experience this panic, set thesleep_implon the Config passed into this function to fix it. - This method will panic if the
sdk_configis missing an HTTP connector. If you experience this panic, set thehttp_connectoron the Config passed into this function to fix it. - This method will panic if no
BehaviorVersionis provided. If you experience this panic, setbehavior_versionon the Config or enable thebehavior-version-latestCargo feature.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Client
impl !RefUnwindSafe for Client
impl Send for Client
impl Sync for Client
impl Unpin for Client
impl !UnwindSafe for Client
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more