Table of Contents

Class DomainOfficesClient

Namespace
Nfield.SDK
Assembly
Nfield.Public.SDK.dll
public class DomainOfficesClient
Inheritance
DomainOfficesClient
Inherited Members

Constructors

DomainOfficesClient(string, HttpClient)

public DomainOfficesClient(string baseUrl, HttpClient httpClient)

Parameters

baseUrl string
httpClient HttpClient

Properties

BaseUrl

public string BaseUrl { get; set; }

Property Value

string

JsonSerializerSettings

protected JsonSerializerSettings JsonSerializerSettings { get; }

Property Value

JsonSerializerSettings

ReadResponseAsString

public bool ReadResponseAsString { get; set; }

Property Value

bool

Methods

DeleteAsync(string, CancellationToken)

Delete a fieldwork office
NOTE: the headquarters office cannot be deleted.

public virtual Task DeleteAsync(string officeId, CancellationToken cancellationToken = default)

Parameters

officeId string

The id of the fieldwork office to delete

cancellationToken CancellationToken

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

Returns

Task

Office Deleted

Exceptions

NfieldSdkException

A server side error occurred.

GetAllAsync(CancellationToken)

Retrieve a list of Fieldwork Offices. This list can be filtered and sorted
using standard OData syntax.

public virtual Task<ICollection<OfficesResponseModel>> GetAllAsync(CancellationToken cancellationToken = default)

Parameters

cancellationToken CancellationToken

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

Returns

Task<ICollection<OfficesResponseModel>>

Successful

Exceptions

NfieldSdkException

A server side error occurred.

GetAsync(string, CancellationToken)

Retrieve details of a specific fieldwork office.

public virtual Task<OfficesResponseModel> GetAsync(string officeId, CancellationToken cancellationToken = default)

Parameters

officeId string

The id of the fieldwork office

cancellationToken CancellationToken

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

Returns

Task<OfficesResponseModel>

Successful

Exceptions

NfieldSdkException

A server side error occurred.

PatchAsync(string, OfficesRequestModel, CancellationToken)

Update a fieldwork office.

public virtual Task<OfficesResponseModel> PatchAsync(string officeId, OfficesRequestModel officeDetails, CancellationToken cancellationToken = default)

Parameters

officeId string

The id of the fieldwork office to update

officeDetails OfficesRequestModel

Office name and description

cancellationToken CancellationToken

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

Returns

Task<OfficesResponseModel>

Office Updated

Exceptions

NfieldSdkException

A server side error occurred.

PostAsync(OfficesRequestModel, CancellationToken)

Create a new fieldwork office.

public virtual Task<OfficesResponseModel> PostAsync(OfficesRequestModel officeDetails, CancellationToken cancellationToken = default)

Parameters

officeDetails OfficesRequestModel

Office name and description

cancellationToken CancellationToken

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

Returns

Task<OfficesResponseModel>

Created

Exceptions

NfieldSdkException

A server side error occurred.

ReadObjectResponseAsync<T>(HttpResponseMessage, IReadOnlyDictionary<string, IEnumerable<string>>, CancellationToken)

protected virtual Task<DomainOfficesClient.ObjectResponseResult<T>> ReadObjectResponseAsync<T>(HttpResponseMessage response, IReadOnlyDictionary<string, IEnumerable<string>> headers, CancellationToken cancellationToken)

Parameters

response HttpResponseMessage
headers IReadOnlyDictionary<string, IEnumerable<string>>
cancellationToken CancellationToken

Returns

Task<DomainOfficesClient.ObjectResponseResult<T>>

Type Parameters

T