Table of Contents

Class SurveysSamplingPointsClient

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

Constructors

SurveysSamplingPointsClient(string, HttpClient)

public SurveysSamplingPointsClient(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, string, CancellationToken)

Delete a specified sampling point.

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

Parameters

surveyId string

The id of the survey

samplingPointId string

The id of the sampling point that is to be deleted

cancellationToken CancellationToken

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

Returns

Task

Sampling point deleted

Exceptions

NfieldSdkException

A server side error occurred.

GetAllAsync(string, CancellationToken)

Get a list of all sampling points for a survey.
This list can be filtered and sorted using standard OData syntax.

public virtual Task<ICollection<SamplingPointResponseModel>> GetAllAsync(string surveyId, CancellationToken cancellationToken = default)

Parameters

surveyId string

The id of the survey

cancellationToken CancellationToken

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

Returns

Task<ICollection<SamplingPointResponseModel>>

Successful

Exceptions

NfieldSdkException

A server side error occurred.

GetAsync(string, string, CancellationToken)

Get the details of a specific sampling point.

public virtual Task<SamplingPointResponseModel> GetAsync(string surveyId, string samplingPointId, CancellationToken cancellationToken = default)

Parameters

surveyId string

The id of the survey

samplingPointId string

The id of the sampling point

cancellationToken CancellationToken

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

Returns

Task<SamplingPointResponseModel>

Successful

Exceptions

NfieldSdkException

A server side error occurred.

PatchActivateAsync(string, string, ActivateSpareSamplingPointRequestModel, CancellationToken)

Activate a spare sampling point so it can be assigned.
If a target is provided, it will also apply it.

public virtual Task<ActivateSpareSamplingPointsResponseModel> PatchActivateAsync(string surveyId, string samplingPointId, ActivateSpareSamplingPointRequestModel spareSamplingPoint, CancellationToken cancellationToken = default)

Parameters

surveyId string

The id of the survey

samplingPointId string

The id of the spare sampling point that we want to activate

spareSamplingPoint ActivateSpareSamplingPointRequestModel

An optional target that we want to set to the sampling point

cancellationToken CancellationToken

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

Returns

Task<ActivateSpareSamplingPointsResponseModel>

Successful

Exceptions

NfieldSdkException

A server side error occurred.

PatchAsync(string, string, SamplingPointUpdateRequestModel, CancellationToken)

Update a sampling point with the specified fields

public virtual Task<SamplingPointResponseModel> PatchAsync(string surveyId, string samplingPointId, SamplingPointUpdateRequestModel samplingPoint, CancellationToken cancellationToken = default)

Parameters

surveyId string

The id of the survey

samplingPointId string

The id of the sampling point that is updated.

samplingPoint SamplingPointUpdateRequestModel

Supply SamplingPoint object with only the properties and values you would like to update. Some properties might not be allowed. At least allowed: Name, Description, FieldworkOfficeId, GroupId, Stratum

cancellationToken CancellationToken

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

Returns

Task<SamplingPointResponseModel>

Successful

Exceptions

NfieldSdkException

A server side error occurred.

PatchReplaceAsync(string, string, ReplaceSamplingPointWithSpareRequestModel, CancellationToken)

Replaces an active sampling point with a spare one.
If a target is provided, it will also apply it.

public virtual Task<ReplaceSamplingPointWithSpareResponseModel> PatchReplaceAsync(string surveyId, string samplingPointId, ReplaceSamplingPointWithSpareRequestModel spareSamplingPoint, CancellationToken cancellationToken = default)

Parameters

surveyId string

The id of the survey

samplingPointId string

The id of the sampling point that we want to replace

spareSamplingPoint ReplaceSamplingPointWithSpareRequestModel

The sampling point id and target of the spare that we want to use as replacement

cancellationToken CancellationToken

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

Returns

Task<ReplaceSamplingPointWithSpareResponseModel>

Successful

Exceptions

NfieldSdkException

A server side error occurred.

PostActivateBatchAsync(string, ActivateSpareSamplingPointsRequestModel, CancellationToken)

Send a list of spare sampling points to be activated so they can be assigned.

public virtual Task<ActivateSpareSamplingPointsResponseModel> PostActivateBatchAsync(string surveyId, ActivateSpareSamplingPointsRequestModel spareSamplingPoints, CancellationToken cancellationToken = default)

Parameters

surveyId string

The id of the survey

spareSamplingPoints ActivateSpareSamplingPointsRequestModel

A list of spare sampling points that we request to activate

cancellationToken CancellationToken

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

Returns

Task<ActivateSpareSamplingPointsResponseModel>

Successful

Exceptions

NfieldSdkException

A server side error occurred.

PostAsync(string, SamplingPointCreateRequestModel, CancellationToken)

Create a new sampling point.

public virtual Task<SamplingPointResponseModel> PostAsync(string surveyId, SamplingPointCreateRequestModel samplingPoint, CancellationToken cancellationToken = default)

Parameters

surveyId string

The id of the survey

samplingPoint SamplingPointCreateRequestModel

An object describing the details for the new sampling point

cancellationToken CancellationToken

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

Returns

Task<SamplingPointResponseModel>

Successful

Exceptions

NfieldSdkException

A server side error occurred.

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

protected virtual Task<SurveysSamplingPointsClient.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<SurveysSamplingPointsClient.ObjectResponseResult<T>>

Type Parameters

T