Table of Contents

Class SurveysScriptsFragmentsClient

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

Constructors

SurveysScriptsFragmentsClient(string, HttpClient)

public SurveysScriptsFragmentsClient(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, string, CancellationToken)

Delete the specified survey script fragment.

public virtual Task<ICollection<DeleteScriptFragmentResult>> DeleteAsync(string surveyId, string fragmentName, CancellationToken cancellationToken = default)

Parameters

surveyId string
fragmentName string
cancellationToken CancellationToken

A 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

surveyId string
cancellationToken CancellationToken

A 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

surveyId string
fragmentName string
cancellationToken CancellationToken

A 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

surveyId string
fragmentName string
file FileParameter
cancellationToken CancellationToken

A 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

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

Returns

Task<SurveysScriptsFragmentsClient.ObjectResponseResult<T>>

Type Parameters

T