Class SurveysFieldworkClient
public class SurveysFieldworkClient
- Inheritance
-
SurveysFieldworkClient
- Inherited Members
Constructors
SurveysFieldworkClient(string, HttpClient)
public SurveysFieldworkClient(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
GetCountsAsync(string, CancellationToken)
Returns survey fieldwork counts.
public virtual Task<SurveyFieldworkCountsResponseModel> GetCountsAsync(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<SurveyFieldworkCountsResponseModel>
Fieldwork counts
Exceptions
- NfieldSdkException
A server side error occurred.
GetStatusAsync(string, CancellationToken)
This method returns fieldwork status.
public virtual Task<int> GetStatusAsync(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
Exceptions
- NfieldSdkException
A server side error occurred.
PutStartAsync(string, CancellationToken)
This method starts the fieldwork of the survey.
public virtual Task PutStartAsync(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
Fieldwork started
Exceptions
- NfieldSdkException
A server side error occurred.
PutStopAsync(string, SurveysFieldworkStopRequestModel, CancellationToken)
This method stops the fieldwork of the survey.
public virtual Task PutStopAsync(string surveyId, SurveysFieldworkStopRequestModel model, CancellationToken cancellationToken = default)
Parameters
surveyIdstringThe id of the survey
modelSurveysFieldworkStopRequestModelThe settings for the stopping of the fieldwork
cancellationTokenCancellationTokenA cancellation token that can be used by other objects or threads to receive notice of cancellation.
Returns
- Task
Fieldwork stoped
Exceptions
- NfieldSdkException
A server side error occurred.
ReadObjectResponseAsync<T>(HttpResponseMessage, IReadOnlyDictionary<string, IEnumerable<string>>, CancellationToken)
protected virtual Task<SurveysFieldworkClient.ObjectResponseResult<T>> ReadObjectResponseAsync<T>(HttpResponseMessage response, IReadOnlyDictionary<string, IEnumerable<string>> headers, CancellationToken cancellationToken)
Parameters
responseHttpResponseMessageheadersIReadOnlyDictionary<string, IEnumerable<string>>cancellationTokenCancellationToken
Returns
Type Parameters
T