Table of Contents

Class SurveysResponseCodesClient

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

Constructors

SurveysResponseCodesClient(string, HttpClient)

public SurveysResponseCodesClient(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, int, CancellationToken)

This method deletes a specified response code.

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

Parameters

surveyId string

The id of the survey

responseCode int

The response code that is to be deleted

cancellationToken CancellationToken

A 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

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

surveyId string

The id of the survey

responseCode int

The response code

cancellationToken CancellationToken

A 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

surveyId string

The id of the survey

responseCode int

The response code that is updated.

surveyResponseCodeChanges SurveyResponseCodeModelForPatch

Supply 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).

cancellationToken CancellationToken

A 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

surveyId string

The id of the survey

responseCode SurveyResponseCodeModel

An object describing the details for the new response code

cancellationToken CancellationToken

A 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

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

Returns

Task<SurveysResponseCodesClient.ObjectResponseResult<T>>

Type Parameters

T