Class DomainOfficesClient
public class DomainOfficesClient
- Inheritance
-
DomainOfficesClient
- Inherited Members
Constructors
DomainOfficesClient(string, HttpClient)
public DomainOfficesClient(string baseUrl, HttpClient httpClient)
Parameters
baseUrlstringhttpClientHttpClient
Properties
BaseUrl
public string BaseUrl { get; set; }
Property Value
JsonSerializerSettings
protected JsonSerializerSettings JsonSerializerSettings { get; }
Property Value
- JsonSerializerSettings
ReadResponseAsString
public bool ReadResponseAsString { get; set; }
Property Value
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
officeIdstringThe id of the fieldwork office to delete
cancellationTokenCancellationTokenA 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
cancellationTokenCancellationTokenA 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
officeIdstringThe id of the fieldwork office
cancellationTokenCancellationTokenA 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
officeIdstringThe id of the fieldwork office to update
officeDetailsOfficesRequestModelOffice name and description
cancellationTokenCancellationTokenA 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
officeDetailsOfficesRequestModelOffice name and description
cancellationTokenCancellationTokenA 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
responseHttpResponseMessageheadersIReadOnlyDictionary<string, IEnumerable<string>>cancellationTokenCancellationToken
Returns
Type Parameters
T