Table of Contents

Class SurveysSamplingPointImageClient

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

Constructors

SurveysSamplingPointImageClient(string, HttpClient)

public SurveysSamplingPointImageClient(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)

Method used to delete the sampling point image.

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

Parameters

surveyId string

The id of the survey the sampling point belongs to

samplingPointId string

The id of the sampling point associated with the image

cancellationToken CancellationToken

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

Returns

Task

Image deleted

Exceptions

NfieldSdkException

A server side error occurred.

GetAsync(string, string, CancellationToken)

Method used to download sampling point image.

public virtual Task<FileResponse> 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<FileResponse>

Successful

Exceptions

NfieldSdkException

A server side error occurred.

PostAsync(string, string, string, FileParameter, CancellationToken)

Method used to upload an image file associated
with a sampling point (e.g. a map).

The upload of a new image file for an existing
sampling point will update the old image.

public virtual Task<SamplingPointImageUploadResponseModel> PostAsync(string surveyId, string samplingPointId, string fileName, FileParameter file = null, CancellationToken cancellationToken = default)

Parameters

surveyId string

The surveyId of the survey

samplingPointId string

The surveyId of the sampling point

fileName string
file FileParameter
cancellationToken CancellationToken

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

Returns

Task<SamplingPointImageUploadResponseModel>

Successful

Exceptions

NfieldSdkException

A server side error occurred.

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

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

Type Parameters

T