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
TRequestThe type of the address validation request, which must derive from AbstractAddressValidationRequest.
TApiResponseThe 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
requestsIReadOnlyList<TRequest>The address validation requests to execute, listed in the order the response must preserve.
cancellationTokenCancellationTokenA 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.