Class SurveysScriptsFragmentsClient
public class SurveysScriptsFragmentsClient
- Inheritance
-
SurveysScriptsFragmentsClient
- Inherited Members
Constructors
SurveysScriptsFragmentsClient(string, HttpClient)
public SurveysScriptsFragmentsClient(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, string, CancellationToken)
Delete the specified survey script fragment.
public virtual Task<ICollection<DeleteScriptFragmentResult>> DeleteAsync(string surveyId, string fragmentName, CancellationToken cancellationToken = default)
Parameters
surveyIdstringfragmentNamestringcancellationTokenCancellationTokenA cancellation token that can be used by other objects or threads to receive notice of cancellation.
Returns
- Task<ICollection<DeleteScriptFragmentResult>>
Successful
Exceptions
- NfieldSdkException
A server side error occurred.
GetAllAsync(string, CancellationToken)
Gets a list of all script fragment names for a survey.
public virtual Task<ICollection<string>> GetAllAsync(string surveyId, CancellationToken cancellationToken = default)
Parameters
surveyIdstringcancellationTokenCancellationTokenA cancellation token that can be used by other objects or threads to receive notice of cancellation.
Returns
- Task<ICollection<string>>
Successful
Exceptions
- NfieldSdkException
A server side error occurred.
GetAsync(string, string, CancellationToken)
Gets the specified script fragment for the survey
public virtual Task<SurveyGetScriptFragmentModel> GetAsync(string surveyId, string fragmentName, CancellationToken cancellationToken = default)
Parameters
surveyIdstringfragmentNamestringcancellationTokenCancellationTokenA cancellation token that can be used by other objects or threads to receive notice of cancellation.
Returns
- Task<SurveyGetScriptFragmentModel>
Successful
Exceptions
- NfieldSdkException
A server side error occurred.
PostAsync(string, string, FileParameter, CancellationToken)
Add or update the wanted survey script fragment with the content specified as body of the request
public virtual Task<SurveyCreateScriptFragmentResponseModel> PostAsync(string surveyId, string fragmentName, FileParameter file = null, CancellationToken cancellationToken = default)
Parameters
surveyIdstringfragmentNamestringfileFileParametercancellationTokenCancellationTokenA cancellation token that can be used by other objects or threads to receive notice of cancellation.
Returns
- Task<SurveyCreateScriptFragmentResponseModel>
Successful
Exceptions
- NfieldSdkException
A server side error occurred.
ReadObjectResponseAsync<T>(HttpResponseMessage, IReadOnlyDictionary<string, IEnumerable<string>>, CancellationToken)
protected virtual Task<SurveysScriptsFragmentsClient.ObjectResponseResult<T>> ReadObjectResponseAsync<T>(HttpResponseMessage response, IReadOnlyDictionary<string, IEnumerable<string>> headers, CancellationToken cancellationToken)
Parameters
responseHttpResponseMessageheadersIReadOnlyDictionary<string, IEnumerable<string>>cancellationTokenCancellationToken
Returns
Type Parameters
T