Class SurveysLanguageTranslationsClient
public class SurveysLanguageTranslationsClient
- Inheritance
-
SurveysLanguageTranslationsClient
- Inherited Members
Constructors
SurveysLanguageTranslationsClient(string, HttpClient)
public SurveysLanguageTranslationsClient(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)
Delete a language.
public virtual Task DeleteAsync(string surveyId, int languageId, CancellationToken cancellationToken = default)
Parameters
surveyIdstringThe id of the survey to delete language
languageIdintThe id of the language to delete
cancellationTokenCancellationTokenA 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
surveyIdstringSurvey id to retrieve languages
cancellationTokenCancellationTokenA 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
surveyIdstringThe id of the survey to update language
languageIdintThe id of the language to update
languageTranslationsSurveyLanguageTranslationsRequestModelNew translations
cancellationTokenCancellationTokenA 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
surveyIdstringSurvey id to add a language
languageTranslationsSurveyLanguageTranslationsRequestModelNew translations to add
cancellationTokenCancellationTokenA 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
responseHttpResponseMessageheadersIReadOnlyDictionary<string, IEnumerable<string>>cancellationTokenCancellationToken
Returns
Type Parameters
T