Class DomainDeliverySurveysPropertiesClient
public class DomainDeliverySurveysPropertiesClient
- Inheritance
-
DomainDeliverySurveysPropertiesClient
- Inherited Members
Constructors
DomainDeliverySurveysPropertiesClient(string, HttpClient)
public DomainDeliverySurveysPropertiesClient(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, long, CancellationToken)
Deletes the survey property by the given id.
public virtual Task DeleteAsync(string surveyId, long propertyId, CancellationToken cancellationToken = default)
Parameters
surveyIdstringThe Nfield Survey Id.
propertyIdlongThe identifier for the survey property.
cancellationTokenCancellationTokenA cancellation token that can be used by other objects or threads to receive notice of cancellation.
Returns
- Task
The survey property was deleted.
Exceptions
- NfieldSdkException
A server side error occurred.
GetAllAsync(string, CancellationToken)
Gets a list of the custom properties associated with the requested survey.
Returns the first 100. This list can be filtered, sorted and supports paging using standard OData syntax.
public virtual Task<ICollection<DomainSurveyPropertyModel>> GetAllAsync(string surveyId, CancellationToken cancellationToken = default)
Parameters
surveyIdstringThe Nfield Survey Id.
cancellationTokenCancellationTokenA cancellation token that can be used by other objects or threads to receive notice of cancellation.
Returns
- Task<ICollection<DomainSurveyPropertyModel>>
Returns a list of custom properties for the requested survey.
Exceptions
- NfieldSdkException
A server side error occurred.
GetAsync(string, long, CancellationToken)
Gets the survey property for the given id.
public virtual Task<DomainSurveyPropertyModel> GetAsync(string surveyId, long propertyId, CancellationToken cancellationToken = default)
Parameters
surveyIdstringThe Nfield Survey Id.
propertyIdlongThe identifier for the survey property.
cancellationTokenCancellationTokenA cancellation token that can be used by other objects or threads to receive notice of cancellation.
Returns
- Task<DomainSurveyPropertyModel>
Returns the survey property for the requested identifier.
Exceptions
- NfieldSdkException
A server side error occurred.
PostAsync(string, CreateDomainSurveyPropertyModel, CancellationToken)
Creates a new domain survey property based on the given data.
public virtual Task PostAsync(string surveyId, CreateDomainSurveyPropertyModel model, CancellationToken cancellationToken = default)
Parameters
surveyIdstringThe survey that will include the custom property.
modelCreateDomainSurveyPropertyModelThe survey property info which will be used in the creation process.
cancellationTokenCancellationTokenA cancellation token that can be used by other objects or threads to receive notice of cancellation.
Returns
- Task
Returns the survey property identifier.
Exceptions
- NfieldSdkException
A server side error occurred.
PutAsync(string, long, UpdateDomainSurveyPropertyModel, CancellationToken)
Updates a domain survey property based on the given data.
public virtual Task PutAsync(string surveyId, long propertyId, UpdateDomainSurveyPropertyModel model, CancellationToken cancellationToken = default)
Parameters
surveyIdstringThe survey that includes the custom property.
propertyIdlongThe identifier for the survey property.
modelUpdateDomainSurveyPropertyModelThe survey property info which will be used in the update process.
cancellationTokenCancellationTokenA cancellation token that can be used by other objects or threads to receive notice of cancellation.
Returns
- Task
The survey property was updated.
Exceptions
- NfieldSdkException
A server side error occurred.
ReadObjectResponseAsync<T>(HttpResponseMessage, IReadOnlyDictionary<string, IEnumerable<string>>, CancellationToken)
protected virtual Task<DomainDeliverySurveysPropertiesClient.ObjectResponseResult<T>> ReadObjectResponseAsync<T>(HttpResponseMessage response, IReadOnlyDictionary<string, IEnumerable<string>> headers, CancellationToken cancellationToken)
Parameters
responseHttpResponseMessageheadersIReadOnlyDictionary<string, IEnumerable<string>>cancellationTokenCancellationToken
Returns
Type Parameters
T