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
TRequestThe request type, deriving from MapsBaseRequest.
TResponseThe response type returned for
TRequest.
Methods
QueryAsync(TRequest)
Asynchronously query the Google Maps API using the provided request.
Task<TResponse> QueryAsync(TRequest request)
Parameters
requestTRequestThe 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
requestTRequestThe request that will be sent.
tokenCancellationTokenA 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
requestTRequestThe request that will be sent.
timeoutTimeSpanA 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
requestTRequestThe request that will be sent.
timeoutTimeSpanA 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.
tokenCancellationTokenA 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
OnUriCreated
Occurs when the Url created. Can be used for override the Url.
event UriCreatedDelegate OnUriCreated