Class DomainResponseCodesClient
public class DomainResponseCodesClient
- Inheritance
-
DomainResponseCodesClient
- Inherited Members
Constructors
DomainResponseCodesClient(string, HttpClient)
public DomainResponseCodesClient(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(int, CancellationToken)
Delete the domain response code by id.
public virtual Task DeleteAsync(int responseCodeId, CancellationToken cancellationToken = default)
Parameters
responseCodeIdintThe id of the response code to delete
cancellationTokenCancellationTokenA cancellation token that can be used by other objects or threads to receive notice of cancellation.
Returns
- Task
Code deleted
Exceptions
- NfieldSdkException
A server side error occurred.
GetAsync(CancellationToken)
Gets all domain response codes for the domain.
public virtual Task<ICollection<DomainResponseCodeResponseModel>> GetAsync(CancellationToken cancellationToken = default)
Parameters
cancellationTokenCancellationTokenA cancellation token that can be used by other objects or threads to receive notice of cancellation.
Returns
- Task<ICollection<DomainResponseCodeResponseModel>>
Successful
Exceptions
- NfieldSdkException
A server side error occurred.
PatchAsync(int, DomainResponseCodeUpdateModel, CancellationToken)
Patch the domain response codes.
public virtual Task<DomainResponseCodeResponseModel> PatchAsync(int responseCodeId, DomainResponseCodeUpdateModel domainResponseCode, CancellationToken cancellationToken = default)
Parameters
responseCodeIdintThe id of the response code to update
domainResponseCodeDomainResponseCodeUpdateModelUrl and description
cancellationTokenCancellationTokenA cancellation token that can be used by other objects or threads to receive notice of cancellation.
Returns
- Task<DomainResponseCodeResponseModel>
Successful
Exceptions
- NfieldSdkException
A server side error occurred.
PostAsync(DomainResponseCodeCreateModel, CancellationToken)
Create a new domain response code
public virtual Task<DomainResponseCodeResponseModel> PostAsync(DomainResponseCodeCreateModel domainResponseCode, CancellationToken cancellationToken = default)
Parameters
domainResponseCodeDomainResponseCodeCreateModeldomain response code URL and description
cancellationTokenCancellationTokenA cancellation token that can be used by other objects or threads to receive notice of cancellation.
Returns
- Task<DomainResponseCodeResponseModel>
Code Created
Exceptions
- NfieldSdkException
A server side error occurred.
ReadObjectResponseAsync<T>(HttpResponseMessage, IReadOnlyDictionary<string, IEnumerable<string>>, CancellationToken)
protected virtual Task<DomainResponseCodesClient.ObjectResponseResult<T>> ReadObjectResponseAsync<T>(HttpResponseMessage response, IReadOnlyDictionary<string, IEnumerable<string>> headers, CancellationToken cancellationToken)
Parameters
responseHttpResponseMessageheadersIReadOnlyDictionary<string, IEnumerable<string>>cancellationTokenCancellationToken
Returns
Type Parameters
T