Skip to content

LocationClient

Namespace: IntegrationTests.ApiClient

public class LocationClient

Inheritance ObjectLocationClient

Properties

BaseUrl

public string BaseUrl { get; set; }

Property Value

String

ReadResponseAsString

public bool ReadResponseAsString { get; set; }

Property Value

Boolean

Constructors

LocationClient(String, HttpClient)

public LocationClient(string baseUrl, HttpClient httpClient)

Parameters

baseUrl String

httpClient HttpClient

Methods

GetAllPostalcodesAsync()

Retrieves all saved locations.

public Task<FileResponse> GetAllPostalcodesAsync()

Returns

A list of all postalcodes; otherwise, NotFound.

Exceptions

ApiException

A server side error occurred.

GetAllPostalcodesAsync(CancellationToken)

Retrieves all saved locations.

public Task<FileResponse> GetAllPostalcodesAsync(CancellationToken cancellationToken)

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.

public Task<FileResponse> InsertLocationAsync(Nullable<Int32> postalcode)

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>)

public Task RemovePostalcodeAsync(Nullable<Int32> postalCode)

Parameters

postalCode Nullable<Int32>

Returns

Task

Exceptions

ApiException

A server side error occurred.

RemovePostalcodeAsync(Nullable<Int32>, CancellationToken)

public Task RemovePostalcodeAsync(Nullable<Int32> postalCode, CancellationToken cancellationToken)

Parameters

postalCode Nullable<Int32>

cancellationToken CancellationToken

A cancellation token that can be used by other objects or threads to receive notice of cancellation.

Returns

Task

Exceptions

ApiException

A server side error occurred.