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 and returns the corresponding 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 the API response returned by the underlying service.

Methods

ExecuteAsync(IReadOnlyList<TRequest>, CancellationToken)

Executes the specified requests against the underlying API as a single batch call and returns the raw API response.

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

Parameters

requests IReadOnlyList<TRequest>

The address validation requests to execute, in the order results should be returned in.

cancellationToken CancellationToken

A token that can be used to cancel the asynchronous operation.

Returns

Task<TApiResponse>

A task that represents the asynchronous operation. The task result contains the API response, or null if no response was returned.

Remarks

Implementations must submit requests to the underlying API preserving the given order — callers correlate the returned TApiResponse back to individual requests strictly by position.