Table of Contents

Interface IEngineFacade<TRequest, TResponse>

Namespace
GoogleMapsApi
Assembly
GoogleMapsApi.dll

Contract for a Google Maps API engine that executes a strongly-typed request and returns its matching response.

public interface IEngineFacade<in TRequest, TResponse> where TRequest : MapsBaseRequest, new() where TResponse : IResponseFor<in TRequest>

Type Parameters

TRequest

The request type, deriving from MapsBaseRequest.

TResponse

The response type returned for TRequest.

Methods

QueryAsync(TRequest)

Asynchronously query the Google Maps API using the provided request.

Task<TResponse> QueryAsync(TRequest request)

Parameters

request TRequest

The request that will be sent.

Returns

Task<TResponse>

A Task with the future value of the response.

Exceptions

ArgumentNullException

Thrown when a null value is passed to the request parameter.

QueryAsync(TRequest, CancellationToken)

Asynchronously query the Google Maps API using the provided request.

Task<TResponse> QueryAsync(TRequest request, CancellationToken token)

Parameters

request TRequest

The request that will be sent.

token CancellationToken

A cancellation token that can be used to cancel the pending asynchronous task.

Returns

Task<TResponse>

A Task with the future value of the response.

Exceptions

ArgumentNullException

Thrown when a null value is passed to the request parameter.

QueryAsync(TRequest, TimeSpan)

Asynchronously query the Google Maps API using the provided request.

Task<TResponse> QueryAsync(TRequest request, TimeSpan timeout)

Parameters

request TRequest

The request that will be sent.

timeout TimeSpan

A TimeSpan specifying the amount of time to wait for a response before aborting the request. The specify an infinite timeout, pass a TimeSpan with a TotalMillisecond value of Timeout.Infinite. When a request is aborted due to a timeout the returned task will transition to the Faulted state with a TimeoutException.

Returns

Task<TResponse>

A Task with the future value of the response.

Exceptions

ArgumentNullException

Thrown when a null value is passed to the request parameter.

ArgumentOutOfRangeException

Thrown when the value of timeout is neither a positive value or infinite.

QueryAsync(TRequest, TimeSpan, CancellationToken)

Asynchronously query the Google Maps API using the provided request.

Task<TResponse> QueryAsync(TRequest request, TimeSpan timeout, CancellationToken token)

Parameters

request TRequest

The request that will be sent.

timeout TimeSpan

A TimeSpan specifying the amount of time to wait for a response before aborting the request. The specify an infinite timeout, pass a TimeSpan with a TotalMillisecond value of Timeout.Infinite. When a request is aborted due to a timeout the returned task will transition to the Faulted state with a TimeoutException.

token CancellationToken

A cancellation token that can be used to cancel the pending asynchronous task.

Returns

Task<TResponse>

A Task with the future value of the response.

Exceptions

ArgumentNullException

Thrown when a null value is passed to the request parameter.

ArgumentOutOfRangeException

Thrown when the value of timeout is neither a positive value or infinite.

Events

OnRawResponseReceived

Occurs when raw data from Google API received.

event RawResponseReceivedDelegate OnRawResponseReceived

Event Type

RawResponseReceivedDelegate

OnUriCreated

Occurs when the Url created. Can be used for override the Url.

event UriCreatedDelegate OnUriCreated

Event Type

UriCreatedDelegate