LocationClient¶
Namespace: IntegrationTests.ApiClient
Inheritance Object → LocationClient
Properties¶
BaseUrl¶
Property Value¶
ReadResponseAsString¶
Property Value¶
Constructors¶
LocationClient(String, HttpClient)¶
Parameters¶
baseUrl String
httpClient HttpClient
Methods¶
GetAllPostalcodesAsync()¶
Retrieves all saved locations.
Returns¶
A list of all postalcodes; otherwise, NotFound.
Exceptions¶
ApiException
A server side error occurred.
GetAllPostalcodesAsync(CancellationToken)¶
Retrieves all saved locations.
Parameters¶
cancellationToken CancellationToken
A cancellation token that can be used by other objects or threads to receive notice of cancellation.
Returns¶
A list of all postalcodes; otherwise, NotFound.
Exceptions¶
ApiException
A server side error occurred.
InsertLocationAsync(Nullable<Int32>)¶
Checks for existence of location and if necessary inserts new location.
Parameters¶
postalcode Nullable<Int32>
Defines the location.
Returns¶
Ok if successful; otherwise, an error response.
Exceptions¶
ApiException
A server side error occurred.
InsertLocationAsync(Nullable<Int32>, CancellationToken)¶
Checks for existence of location and if necessary inserts new location.
public Task<FileResponse> InsertLocationAsync(Nullable<Int32> postalcode, CancellationToken cancellationToken)
Parameters¶
postalcode Nullable<Int32>
Defines the location.
cancellationToken CancellationToken
A cancellation token that can be used by other objects or threads to receive notice of cancellation.
Returns¶
Ok if successful; otherwise, an error response.
Exceptions¶
ApiException
A server side error occurred.
ReadObjectResponseAsync<T>(HttpResponseMessage, IReadOnlyDictionary<String, IEnumerable<String>>, CancellationToken)¶
protected Task<ObjectResponseResult<T>> ReadObjectResponseAsync<T>(HttpResponseMessage response, IReadOnlyDictionary<String, IEnumerable<String>> headers, CancellationToken cancellationToken)
Type Parameters¶
T
Parameters¶
response HttpResponseMessage
headers IReadOnlyDictionary<String, IEnumerable<String>>
cancellationToken CancellationToken
Returns¶
Task<ObjectResponseResult<T>>
RemovePostalcodeAsync(Nullable<Int32>)¶
Deletes location from the database.
Parameters¶
postalCode Nullable<Int32>
Postalcode
Returns¶
Ok if successful; otherwise, an error response.
Exceptions¶
ApiException
A server side error occurred.
RemovePostalcodeAsync(Nullable<Int32>, CancellationToken)¶
Deletes location from the database.
Parameters¶
postalCode Nullable<Int32>
Postalcode
cancellationToken CancellationToken
A cancellation token that can be used by other objects or threads to receive notice of cancellation.
Returns¶
Ok if successful; otherwise, an error response.
Exceptions¶
ApiException
A server side error occurred.