Table of Contents

Interface IBatchApiRequestAdapter<TRequest, TApiResponse>

Namespace
Visus.AddressValidation.Adapters
Assembly
Visus.AddressValidation.dll

Defines an adapter that translates a batch of address validation requests into a single API-specific request. It sends the request to the provider and returns the API response.

public interface IBatchApiRequestAdapter<in TRequest, TApiResponse> where TRequest : AbstractAddressValidationRequest where TApiResponse : class

Type Parameters

TRequest

The type of the address validation request, which must derive from AbstractAddressValidationRequest.

TApiResponse

The type of API response the provider returns.

Methods

ExecuteAsync(IReadOnlyList<TRequest>, CancellationToken)

Sends the specified requests to the provider as a single batch call and returns the API response.

Task<TApiResponse?> ExecuteAsync(IReadOnlyList<in TRequest> requests, CancellationToken cancellationToken)

Parameters

requests IReadOnlyList<TRequest>

The address validation requests to execute, listed in the order the response must preserve.

cancellationToken CancellationToken

A token that cancels the operation.

Returns

Task<TApiResponse>

A task that represents the asynchronous operation. The task result holds the API response, or null if the provider returns none.

Remarks

Implementations must submit requests to the provider in the given order. Callers correlate each item within the resulting TApiResponse back to its request, strictly by position.