Table of Contents

Interface IApiRequestAdapter<TRequest, TApiResponse>

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

Defines an adapter that translates an address validation request into an API-specific request and returns the corresponding API response.

public interface IApiRequestAdapter<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(TRequest, CancellationToken)

Executes the address validation request against the underlying API and returns the raw API response.

Task<TApiResponse?> ExecuteAsync(TRequest request, CancellationToken cancellationToken)

Parameters

request TRequest

The address validation request to execute.

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.