Table of Contents

Class SurveysFieldworkClient

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

Constructors

SurveysFieldworkClient(string, HttpClient)

public SurveysFieldworkClient(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

GetCountsAsync(string, CancellationToken)

Returns survey fieldwork counts.

public virtual Task<SurveyFieldworkCountsResponseModel> GetCountsAsync(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<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

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<int>

Fieldwork status

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

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

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

surveyId string

The id of the survey

model SurveysFieldworkStopRequestModel

The settings for the stopping of the fieldwork

cancellationToken CancellationToken

A 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

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

Returns

Task<SurveysFieldworkClient.ObjectResponseResult<T>>

Type Parameters

T