Class SurveysSamplingPointImageClient
public class SurveysSamplingPointImageClient
- Inheritance
-
SurveysSamplingPointImageClient
- Inherited Members
Constructors
SurveysSamplingPointImageClient(string, HttpClient)
public SurveysSamplingPointImageClient(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)
Method used to delete the sampling point image.
public virtual Task DeleteAsync(string surveyId, string samplingPointId, CancellationToken cancellationToken = default)
Parameters
surveyIdstringThe id of the survey the sampling point belongs to
samplingPointIdstringThe id of the sampling point associated with the image
cancellationTokenCancellationTokenA 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
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<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
surveyIdstringThe surveyId of the survey
samplingPointIdstringThe surveyId of the sampling point
fileNamestringfileFileParametercancellationTokenCancellationTokenA 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
responseHttpResponseMessageheadersIReadOnlyDictionary<string, IEnumerable<string>>cancellationTokenCancellationToken
Returns
Type Parameters
T