Class SurveysSamplingPointsClient
public class SurveysSamplingPointsClient
- Inheritance
-
SurveysSamplingPointsClient
- Inherited Members
Constructors
SurveysSamplingPointsClient(string, HttpClient)
public SurveysSamplingPointsClient(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, string, CancellationToken)
Delete a specified sampling point.
public virtual Task DeleteAsync(string surveyId, string samplingPointId, CancellationToken cancellationToken = default)
Parameters
surveyIdstringThe id of the survey
samplingPointIdstringThe id of the sampling point that is to be deleted
cancellationTokenCancellationTokenA 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
surveyIdstringThe id of the survey
cancellationTokenCancellationTokenA 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
surveyIdstringThe id of the survey
samplingPointIdstringThe id of the sampling point
cancellationTokenCancellationTokenA 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
surveyIdstringThe id of the survey
samplingPointIdstringThe id of the spare sampling point that we want to activate
spareSamplingPointActivateSpareSamplingPointRequestModelAn optional target that we want to set to the sampling point
cancellationTokenCancellationTokenA 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
surveyIdstringThe id of the survey
samplingPointIdstringThe id of the sampling point that is updated.
samplingPointSamplingPointUpdateRequestModelSupply 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
cancellationTokenCancellationTokenA 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
surveyIdstringThe id of the survey
samplingPointIdstringThe id of the sampling point that we want to replace
spareSamplingPointReplaceSamplingPointWithSpareRequestModelThe sampling point id and target of the spare that we want to use as replacement
cancellationTokenCancellationTokenA 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
surveyIdstringThe id of the survey
spareSamplingPointsActivateSpareSamplingPointsRequestModelA list of spare sampling points that we request to activate
cancellationTokenCancellationTokenA 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
surveyIdstringThe id of the survey
samplingPointSamplingPointCreateRequestModelAn object describing the details for the new sampling point
cancellationTokenCancellationTokenA 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
responseHttpResponseMessageheadersIReadOnlyDictionary<string, IEnumerable<string>>cancellationTokenCancellationToken
Returns
Type Parameters
T