Class DomainDeliveryRepositoriesSurveysClient
public class DomainDeliveryRepositoriesSurveysClient
- Inheritance
-
DomainDeliveryRepositoriesSurveysClient
- Inherited Members
Constructors
DomainDeliveryRepositoriesSurveysClient(string, HttpClient)
public DomainDeliveryRepositoriesSurveysClient(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(long, string, CancellationToken)
Removes a Survey from the repository's added surveys.
public virtual Task DeleteAsync(long repositoryId, string surveyId, CancellationToken cancellationToken = default)
Parameters
repositoryIdlongThe identifier for the repository.
surveyIdstringThe Id of the Survey that will be removed.
cancellationTokenCancellationTokenA cancellation token that can be used by other objects or threads to receive notice of cancellation.
Returns
- Task
Removes the selected survey from the repository's added surveys
Exceptions
- NfieldSdkException
A server side error occurred.
GetAsync(long, CancellationToken)
Returns the surveys of the given repository.
Returns first 100. The list can be filtered, sorted and supports paging using standard OData syntax.
public virtual Task<ICollection<RepositorySurveyModel>> GetAsync(long repositoryId, CancellationToken cancellationToken = default)
Parameters
repositoryIdlongThe repository id.
cancellationTokenCancellationTokenA cancellation token that can be used by other objects or threads to receive notice of cancellation.
Returns
- Task<ICollection<RepositorySurveyModel>>
Returns the repository surveys
Exceptions
- NfieldSdkException
A server side error occurred.
PostAsync(long, IEnumerable<string>, CancellationToken)
Adds the selected surveys to the repository.
public virtual Task PostAsync(long repositoryId, IEnumerable<string> nfieldSurveyIds, CancellationToken cancellationToken = default)
Parameters
repositoryIdlongThe repository id.
nfieldSurveyIdsIEnumerable<string>The nfieldSurveyIds of the surveys to add to the repository.
cancellationTokenCancellationTokenA cancellation token that can be used by other objects or threads to receive notice of cancellation.
Returns
- Task
The selected surveys have been added to the repository
Exceptions
- NfieldSdkException
A server side error occurred.
PutAsync(long, string, CancellationToken)
Re-initiates a paused Survey in the selected Repository.
public virtual Task PutAsync(long repositoryId, string surveyId, CancellationToken cancellationToken = default)
Parameters
repositoryIdlongThe identifier for the repository.
surveyIdstringThe Id of the Survey that will be reinitialized.
cancellationTokenCancellationTokenA cancellation token that can be used by other objects or threads to receive notice of cancellation.
Returns
- Task
Reinitiates a paused Survey in the selected Repository
Exceptions
- NfieldSdkException
A server side error occurred.
ReadObjectResponseAsync<T>(HttpResponseMessage, IReadOnlyDictionary<string, IEnumerable<string>>, CancellationToken)
protected virtual Task<DomainDeliveryRepositoriesSurveysClient.ObjectResponseResult<T>> ReadObjectResponseAsync<T>(HttpResponseMessage response, IReadOnlyDictionary<string, IEnumerable<string>> headers, CancellationToken cancellationToken)
Parameters
responseHttpResponseMessageheadersIReadOnlyDictionary<string, IEnumerable<string>>cancellationTokenCancellationToken
Returns
Type Parameters
T