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

Client for Amazon Comprehend

Client for invoking operations on Amazon Comprehend. Each operation on Amazon Comprehend 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_comprehend::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_comprehend::config::Builder::from(&shared_config)
  .retry_config(RetryConfig::disabled())
  .build();
let client = aws_sdk_comprehend::Client::from_conf(config);

Implementations§

Creates a client with the given service configuration.

Returns the client’s configuration.

Constructs a fluent builder for the BatchDetectDominantLanguage operation.

Constructs a fluent builder for the BatchDetectEntities operation.

Constructs a fluent builder for the BatchDetectKeyPhrases operation.

Constructs a fluent builder for the BatchDetectSentiment operation.

Constructs a fluent builder for the BatchDetectSyntax operation.

Constructs a fluent builder for the BatchDetectTargetedSentiment operation.

Constructs a fluent builder for the ClassifyDocument operation.

Constructs a fluent builder for the ContainsPiiEntities operation.

Constructs a fluent builder for the CreateDocumentClassifier operation.

Constructs a fluent builder for the CreateEndpoint operation.

Constructs a fluent builder for the CreateEntityRecognizer operation.

Constructs a fluent builder for the DeleteDocumentClassifier operation.

Constructs a fluent builder for the DeleteEndpoint operation.

Constructs a fluent builder for the DeleteEntityRecognizer operation.

Constructs a fluent builder for the DeleteResourcePolicy operation.

Constructs a fluent builder for the DescribeDocumentClassificationJob operation.

Constructs a fluent builder for the DescribeDocumentClassifier operation.

Constructs a fluent builder for the DescribeDominantLanguageDetectionJob operation.

Constructs a fluent builder for the DescribeEndpoint operation.

Constructs a fluent builder for the DescribeEntitiesDetectionJob operation.

Constructs a fluent builder for the DescribeEntityRecognizer operation.

Constructs a fluent builder for the DescribeEventsDetectionJob operation.

Constructs a fluent builder for the DescribeKeyPhrasesDetectionJob operation.

Constructs a fluent builder for the DescribePiiEntitiesDetectionJob operation.

Constructs a fluent builder for the DescribeResourcePolicy operation.

Constructs a fluent builder for the DescribeSentimentDetectionJob operation.

Constructs a fluent builder for the DescribeTargetedSentimentDetectionJob operation.

Constructs a fluent builder for the DescribeTopicsDetectionJob operation.

Constructs a fluent builder for the DetectDominantLanguage operation.

Constructs a fluent builder for the DetectEntities operation.

  • The fluent builder is configurable:
    • text(impl Into<String>) / set_text(Option<String>):

      A UTF-8 text string. The maximum string size is 100 KB. If you enter text using this parameter, do not use the Bytes parameter.

    • language_code(LanguageCode) / set_language_code(Option<LanguageCode>):

      The language of the input documents. You can specify any of the primary languages supported by Amazon Comprehend. If your request includes the endpoint for a custom entity recognition model, Amazon Comprehend uses the language of your custom model, and it ignores any language code that you specify here.

      All input documents must be in the same language.

    • endpoint_arn(impl Into<String>) / set_endpoint_arn(Option<String>):

      The Amazon Resource Name of an endpoint that is associated with a custom entity recognition model. Provide an endpoint if you want to detect entities by using your own custom model instead of the default model that is used by Amazon Comprehend.

      If you specify an endpoint, Amazon Comprehend uses the language of your custom model, and it ignores any language code that you provide in your request.

      For information about endpoints, see Managing endpoints.

    • bytes(Blob) / set_bytes(Option<Blob>):

      This field applies only when you use a custom entity recognition model that was trained with PDF annotations. For other cases, enter your text input in the Text field.

      Use the Bytes parameter to input a text, PDF, Word or image file. Using a plain-text file in the Bytes parameter is equivelent to using the Text parameter (the Entities field in the response is identical).

      You can also use the Bytes parameter to input an Amazon Textract DetectDocumentText or AnalyzeDocument output file.

      Provide the input document as a sequence of base64-encoded bytes. If your code uses an Amazon Web Services SDK to detect entities, the SDK may encode the document file bytes for you.

      The maximum length of this field depends on the input document type. For details, see Inputs for real-time custom analysis in the Comprehend Developer Guide.

      If you use the Bytes parameter, do not use the Text parameter.

    • document_reader_config(DocumentReaderConfig) / set_document_reader_config(Option<DocumentReaderConfig>):

      Provides configuration parameters to override the default actions for extracting text from PDF documents and image files.

  • On success, responds with DetectEntitiesOutput with field(s):
    • entities(Option<Vec<Entity>>):

      A collection of entities identified in the input text. For each entity, the response provides the entity text, entity type, where the entity text begins and ends, and the level of confidence that Amazon Comprehend has in the detection.

      If your request uses a custom entity recognition model, Amazon Comprehend detects the entities that the model is trained to recognize. Otherwise, it detects the default entity types. For a list of default entity types, see Entities in the Comprehend Developer Guide.

    • document_metadata(Option<DocumentMetadata>):

      Information about the document, discovered during text extraction. This field is present in the response only if your request used the Byte parameter.

    • document_type(Option<Vec<DocumentTypeListItem>>):

      The document type for each page in the input document. This field is present in the response only if your request used the Byte parameter.

    • blocks(Option<Vec<Block>>):

      Information about each block of text in the input document. Blocks are nested. A page block contains a block for each line of text, which contains a block for each word.

      The Block content for a Word input document does not include a Geometry field.

      The Block field is not present in the response for plain-text inputs.

    • errors(Option<Vec<ErrorsListItem>>):

      Page-level errors that the system detected while processing the input document. The field is empty if the system encountered no errors.

  • On failure, responds with SdkError<DetectEntitiesError>

Constructs a fluent builder for the DetectKeyPhrases operation.

Constructs a fluent builder for the DetectPiiEntities operation.

Constructs a fluent builder for the DetectSentiment operation.

Constructs a fluent builder for the DetectSyntax operation.

Constructs a fluent builder for the DetectTargetedSentiment operation.

Constructs a fluent builder for the ImportModel operation.

Constructs a fluent builder for the ListDocumentClassificationJobs operation. This operation supports pagination; See into_paginator().

Constructs a fluent builder for the ListDocumentClassifiers operation. This operation supports pagination; See into_paginator().

Constructs a fluent builder for the ListDocumentClassifierSummaries operation. This operation supports pagination; See into_paginator().

Constructs a fluent builder for the ListDominantLanguageDetectionJobs operation. This operation supports pagination; See into_paginator().

Constructs a fluent builder for the ListEndpoints operation. This operation supports pagination; See into_paginator().

Constructs a fluent builder for the ListEntitiesDetectionJobs operation. This operation supports pagination; See into_paginator().

Constructs a fluent builder for the ListEntityRecognizers operation. This operation supports pagination; See into_paginator().

Constructs a fluent builder for the ListEntityRecognizerSummaries operation. This operation supports pagination; See into_paginator().

Constructs a fluent builder for the ListEventsDetectionJobs operation. This operation supports pagination; See into_paginator().

Constructs a fluent builder for the ListKeyPhrasesDetectionJobs operation. This operation supports pagination; See into_paginator().

Constructs a fluent builder for the ListPiiEntitiesDetectionJobs operation. This operation supports pagination; See into_paginator().

Constructs a fluent builder for the ListSentimentDetectionJobs operation. This operation supports pagination; See into_paginator().

Constructs a fluent builder for the ListTagsForResource operation.

Constructs a fluent builder for the ListTargetedSentimentDetectionJobs operation. This operation supports pagination; See into_paginator().

Constructs a fluent builder for the ListTopicsDetectionJobs operation. This operation supports pagination; See into_paginator().

Constructs a fluent builder for the PutResourcePolicy operation.

Constructs a fluent builder for the StartDocumentClassificationJob operation.

Constructs a fluent builder for the StartDominantLanguageDetectionJob operation.

Constructs a fluent builder for the StartEntitiesDetectionJob operation.

Constructs a fluent builder for the StartEventsDetectionJob operation.

Constructs a fluent builder for the StartKeyPhrasesDetectionJob operation.

Constructs a fluent builder for the StartPiiEntitiesDetectionJob operation.

Constructs a fluent builder for the StartSentimentDetectionJob operation.

Constructs a fluent builder for the StartTargetedSentimentDetectionJob operation.

Constructs a fluent builder for the StartTopicsDetectionJob operation.

Constructs a fluent builder for the StopDominantLanguageDetectionJob operation.

Constructs a fluent builder for the StopEntitiesDetectionJob operation.

Constructs a fluent builder for the StopEventsDetectionJob operation.

Constructs a fluent builder for the StopKeyPhrasesDetectionJob operation.

Constructs a fluent builder for the StopPiiEntitiesDetectionJob operation.

Constructs a fluent builder for the StopSentimentDetectionJob operation.

Constructs a fluent builder for the StopTargetedSentimentDetectionJob operation.

Constructs a fluent builder for the StopTrainingDocumentClassifier operation.

Constructs a fluent builder for the StopTrainingEntityRecognizer operation.

Constructs a fluent builder for the TagResource operation.

Constructs a fluent builder for the UntagResource operation.

Constructs a fluent builder for the UpdateEndpoint operation.

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