Table of Contents

Class SurveysLanguageTranslationsClient

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

Constructors

SurveysLanguageTranslationsClient(string, HttpClient)

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

Delete a language.

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

Parameters

surveyId string

The id of the survey to delete language

languageId int

The id of the language to delete

cancellationToken CancellationToken

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

Returns

Task

Language deleted

Exceptions

NfieldSdkException

A server side error occurred.

GetAsync(string, CancellationToken)

Retrieve a list of Languages for a survey.

public virtual Task<ICollection<SurveyLanguageTranslationsResponseModel>> GetAsync(string surveyId, CancellationToken cancellationToken = default)

Parameters

surveyId string

Survey id to retrieve languages

cancellationToken CancellationToken

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

Returns

Task<ICollection<SurveyLanguageTranslationsResponseModel>>

Successful

Exceptions

NfieldSdkException

A server side error occurred.

PatchAsync(string, int, SurveyLanguageTranslationsRequestModel, CancellationToken)

Update a language.

public virtual Task<SurveyLanguageTranslationsResponseModel> PatchAsync(string surveyId, int languageId, SurveyLanguageTranslationsRequestModel languageTranslations, CancellationToken cancellationToken = default)

Parameters

surveyId string

The id of the survey to update language

languageId int

The id of the language to update

languageTranslations SurveyLanguageTranslationsRequestModel

New translations

cancellationToken CancellationToken

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

Returns

Task<SurveyLanguageTranslationsResponseModel>

Successful

Exceptions

NfieldSdkException

A server side error occurred.

PostAsync(string, SurveyLanguageTranslationsRequestModel, CancellationToken)

Create a new language for the given survey.

public virtual Task<SurveyLanguageTranslationsResponseModel> PostAsync(string surveyId, SurveyLanguageTranslationsRequestModel languageTranslations, CancellationToken cancellationToken = default)

Parameters

surveyId string

Survey id to add a language

languageTranslations SurveyLanguageTranslationsRequestModel

New translations to add

cancellationToken CancellationToken

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

Returns

Task<SurveyLanguageTranslationsResponseModel>

Successful

Exceptions

NfieldSdkException

A server side error occurred.

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

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

Type Parameters

T