Table of Contents

Method TestConnectionAsync

Namespace
LMKit.Integrations.AWS.Ocr.Textract
Assembly
LM-Kit.NET.dll

TestConnectionAsync(string, string, AWSRegion, TimeSpan?, CancellationToken)

Tests whether the supplied AWS credentials can reach the Textract service in the given region. Signs a minimal DetectDocumentText request with SigV4 and reports the outcome.

public static Task<TextractOcr.ConnectionTestResult> TestConnectionAsync(string awsAccessKeyId, string awsSecretAccessKey, AWSRegion region, TimeSpan? timeout = null, CancellationToken cancellationToken = default)

Parameters

awsAccessKeyId string

AWS Access Key ID.

awsSecretAccessKey string

AWS Secret Access Key.

region AWSRegion

AWS region hosting the Textract service.

timeout TimeSpan?

Maximum time to wait for the HTTP response. Defaults to 30 seconds when null.

cancellationToken CancellationToken

Optional cancellation token.

Returns

Task<TextractOcr.ConnectionTestResult>

A TextractOcr.ConnectionTestResult describing the outcome. When authentication succeeds, Success is true even if Textract rejected the probe document — that still proves the credentials and region are reachable.

Exceptions

ArgumentException

Thrown if region is Unknown.

Share