Class TemplateClient
Inherited Members
Namespace: System.Dynamic.ExpandoObject
Syntax
[GeneratedCode("NSwag", "13.20.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.0.0))")]
public class TemplateClient : ClientBase, ITemplateClient
Constructors
TemplateClient(IPictureparkServiceSettings, HttpClient)
Declaration
public TemplateClient(IPictureparkServiceSettings configuration, HttpClient httpClient)
Parameters
IPictureparkServiceSettings configuration |
HttpClient httpClient |
Properties
JsonSerializerSettings
Declaration
protected JsonSerializerSettings JsonSerializerSettings { get; }
Property Value
JsonSerializerSettings |
ReadResponseAsString
Methods
CreateAsync(TemplateCreateRequest, CancellationToken)
Create template
Declaration
public virtual Task<Template> CreateAsync(TemplateCreateRequest request, CancellationToken cancellationToken = default)
Parameters
TemplateCreateRequest
request
TemplateCreateRequest |
CancellationToken
cancellationToken
A cancellation token that can be used by other objects or threads to receive notice of cancellation. |
Returns
Task<Template>
Template |
Implements
Exceptions
ApiException
A server side error occurred. |
PictureparkValidationException
Validation exception |
PictureparkForbiddenException
Forbidden |
PictureparkNotFoundException
Entity not found |
PictureparkConflictException
Version conflict |
PictureparkTooManyRequestsException
Too many requests |
PictureparkException
Internal server error |
DeleteAsync(string, CancellationToken)
Delete template
Declaration
public virtual Task DeleteAsync(string id, CancellationToken cancellationToken = default)
Parameters
string
id
ID of template |
CancellationToken
cancellationToken
A cancellation token that can be used by other objects or threads to receive notice of cancellation. |
Returns
Task |
Implements
Exceptions
ApiException
A server side error occurred. |
PictureparkValidationException
Validation exception |
PictureparkForbiddenException
Forbidden |
PictureparkNotFoundException
Entity not found |
PictureparkConflictException
Version conflict |
PictureparkTooManyRequestsException
Too many requests |
PictureparkException
Internal server error |
GetAllAsync(CancellationToken)
Get all templates
Declaration
public virtual Task<ICollection<Template>> GetAllAsync(CancellationToken cancellationToken = default)
Parameters
CancellationToken
cancellationToken
A cancellation token that can be used by other objects or threads to receive notice of cancellation. |
Returns
Task<ICollection<Template>>
All templates |
Implements
Exceptions
ApiException
A server side error occurred. |
PictureparkValidationException
Validation exception |
PictureparkForbiddenException
Forbidden |
PictureparkNotFoundException
Entity not found |
PictureparkConflictException
Version conflict |
PictureparkTooManyRequestsException
Too many requests |
PictureparkException
Internal server error |
GetAsync(string, CancellationToken)
Get template
Declaration
public virtual Task<Template> GetAsync(string id, CancellationToken cancellationToken = default)
Parameters
string
id
ID of template. |
CancellationToken
cancellationToken
A cancellation token that can be used by other objects or threads to receive notice of cancellation. |
Returns
Task<Template>
Template |
Implements
Exceptions
ApiException
A server side error occurred. |
PictureparkValidationException
Validation exception |
PictureparkForbiddenException
Forbidden |
PictureparkNotFoundException
Entity not found |
PictureparkConflictException
Version conflict |
PictureparkTooManyRequestsException
Too many requests |
PictureparkException
Internal server error |
ReadObjectResponseAsync<T>(HttpResponseMessage, IReadOnlyDictionary<string, IEnumerable<string>>, CancellationToken)
Declaration
protected virtual Task<TemplateClient.ObjectResponseResult<T>> ReadObjectResponseAsync<T>(HttpResponseMessage response, IReadOnlyDictionary<string, IEnumerable<string>> headers, CancellationToken cancellationToken)
Parameters
HttpResponseMessage response |
IReadOnlyDictionary<string, IEnumerable<string>> headers |
CancellationToken cancellationToken |
Returns
Task<TemplateClient.ObjectResponseResult<T>> |
Type Parameters
T |
SearchAsync(TemplateSearchRequest, CancellationToken)
Search templates
Declaration
public virtual Task<TemplateSearchResult> SearchAsync(TemplateSearchRequest searchRequest, CancellationToken cancellationToken = default)
Parameters
TemplateSearchRequest
searchRequest
The template search request. |
CancellationToken
cancellationToken
A cancellation token that can be used by other objects or threads to receive notice of cancellation. |
Returns
Task<TemplateSearchResult>
Template search result |
Implements
Remarks
All matching templates are returned. No pagination is implemented.
Exceptions
ApiException
A server side error occurred. |
PictureparkValidationException
Validation exception |
PictureparkForbiddenException
Forbidden |
PictureparkNotFoundException
Entity not found |
PictureparkConflictException
Version conflict |
PictureparkTooManyRequestsException
Too many requests |
PictureparkException
Internal server error |
UpdateAsync(string, TemplateUpdateRequest, CancellationToken)
Update template
Declaration
public virtual Task<Template> UpdateAsync(string id, TemplateUpdateRequest request, CancellationToken cancellationToken = default)
Parameters
string
id
ID of template. |
TemplateUpdateRequest
request
Template |
CancellationToken
cancellationToken
A cancellation token that can be used by other objects or threads to receive notice of cancellation. |
Returns
Task<Template>
Template |
Implements
Exceptions
ApiException
A server side error occurred. |
PictureparkValidationException
Validation exception |
PictureparkForbiddenException
Forbidden |
PictureparkNotFoundException
Entity not found |
PictureparkConflictException
Version conflict |
PictureparkTooManyRequestsException
Too many requests |
PictureparkException
Internal server error |