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
awsAccessKeyIdstringAWS Access Key ID.
awsSecretAccessKeystringAWS Secret Access Key.
regionAWSRegionAWS region hosting the Textract service.
timeoutTimeSpan?Maximum time to wait for the HTTP response. Defaults to 30 seconds when
null.cancellationTokenCancellationTokenOptional cancellation token.
Returns
- Task<TextractOcr.ConnectionTestResult>
A TextractOcr.ConnectionTestResult describing the outcome. When authentication succeeds, Success is
trueeven if Textract rejected the probe document — that still proves the credentials and region are reachable.
Exceptions
- ArgumentException
Thrown if
regionis Unknown.