Class SurveysResponseCodesClient
public class SurveysResponseCodesClient
- Inheritance
-
SurveysResponseCodesClient
- Inherited Members
Constructors
SurveysResponseCodesClient(string, HttpClient)
public SurveysResponseCodesClient(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, int, CancellationToken)
This method deletes a specified response code.
public virtual Task DeleteAsync(string surveyId, int responseCode, CancellationToken cancellationToken = default)
Parameters
surveyIdstringThe id of the survey
responseCodeintThe response code that is to be deleted
cancellationTokenCancellationTokenA cancellation token that can be used by other objects or threads to receive notice of cancellation.
Returns
- Task
Successful
Exceptions
- NfieldSdkException
A server side error occurred.
GetAsync(string, CancellationToken)
This method retrieves a list of response codes based on a survey.
This list can be filtered and sorted using standard OData syntax.
public virtual Task<ICollection<SurveyResponseCodeModel>> GetAsync(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<ICollection<SurveyResponseCodeModel>>
Successful
Exceptions
- NfieldSdkException
A server side error occurred.
GetResponseAsync(string, int, CancellationToken)
This method retrieve details of a specific response code for a specific survey.
public virtual Task<SurveyResponseCodeModel> GetResponseAsync(string surveyId, int responseCode, CancellationToken cancellationToken = default)
Parameters
surveyIdstringThe id of the survey
responseCodeintThe response code
cancellationTokenCancellationTokenA cancellation token that can be used by other objects or threads to receive notice of cancellation.
Returns
- Task<SurveyResponseCodeModel>
Successful
Exceptions
- NfieldSdkException
A server side error occurred.
PatchAsync(string, int, SurveyResponseCodeModelForPatch, CancellationToken)
Update a response code with the specified fields.
public virtual Task<SurveyResponseCodeModel> PatchAsync(string surveyId, int responseCode, SurveyResponseCodeModelForPatch surveyResponseCodeChanges, CancellationToken cancellationToken = default)
Parameters
surveyIdstringThe id of the survey
responseCodeintThe response code that is updated.
surveyResponseCodeChangesSurveyResponseCodeModelForPatchSupply SurveyResponseCode object with only the properties and values you would like to update. Only the Description and RelocationUrl properties can be supplied for system response codes (codes below 200).
cancellationTokenCancellationTokenA cancellation token that can be used by other objects or threads to receive notice of cancellation.
Returns
- Task<SurveyResponseCodeModel>
Successful
Exceptions
- NfieldSdkException
A server side error occurred.
PostAsync(string, SurveyResponseCodeModel, CancellationToken)
This method creates a new response code.
public virtual Task<SurveyResponseCodeModel> PostAsync(string surveyId, SurveyResponseCodeModel responseCode, CancellationToken cancellationToken = default)
Parameters
surveyIdstringThe id of the survey
responseCodeSurveyResponseCodeModelAn object describing the details for the new response code
cancellationTokenCancellationTokenA cancellation token that can be used by other objects or threads to receive notice of cancellation.
Returns
- Task<SurveyResponseCodeModel>
Successful
Exceptions
- NfieldSdkException
A server side error occurred.
ReadObjectResponseAsync<T>(HttpResponseMessage, IReadOnlyDictionary<string, IEnumerable<string>>, CancellationToken)
protected virtual Task<SurveysResponseCodesClient.ObjectResponseResult<T>> ReadObjectResponseAsync<T>(HttpResponseMessage response, IReadOnlyDictionary<string, IEnumerable<string>> headers, CancellationToken cancellationToken)
Parameters
responseHttpResponseMessageheadersIReadOnlyDictionary<string, IEnumerable<string>>cancellationTokenCancellationToken
Returns
Type Parameters
T