Class PaginatedServiceTypeClient
- Namespace
- Crews.PlanningCenter.Api.Services.V2018_08_01
- Assembly
- Crews.PlanningCenter.Api.dll
Client for interacting with ServiceType collection resources.
public class PaginatedServiceTypeClient : PaginatedResourceClient<ServiceType, ServiceTypeResource, ServiceTypeCollectionResponse, ServiceTypeResponse>
- Inheritance
-
PaginatedResourceClient<ServiceType, ServiceTypeResource, ServiceTypeCollectionResponse, ServiceTypeResponse>PaginatedServiceTypeClient
- Inherited Members
Constructors
PaginatedServiceTypeClient(HttpClient, Uri)
Client for interacting with ServiceType collection resources.
public PaginatedServiceTypeClient(HttpClient httpClient, Uri uri)
Parameters
httpClientHttpClienturiUri
Methods
GetAsync(CancellationToken)
Fetches a paginated list of ServiceType resources asynchronously.
public Task<ServiceTypeCollectionResponse> GetAsync(CancellationToken cancellationToken = default)
Parameters
cancellationTokenCancellationTokenA token to monitor for cancellation requests.
Returns
- Task<ServiceTypeCollectionResponse>
A task representing the asynchronous operation, containing a paginated list of ServiceType resources.
Exceptions
- JsonApiException
Thrown when the HTTP response indicates a failure status code.
IncludeTimePreferenceOptions()
Include related TimePreferenceOptions resources in the response.
public ServiceTypeClient IncludeTimePreferenceOptions()
Returns
OrderByName()
Sort response items by the Name attribute.
public ServiceTypeClient OrderByName()
Returns
OrderByNameDescending()
Sort response items by the Name attribute. Use reverse order.
public ServiceTypeClient OrderByNameDescending()
Returns
OrderBySequence()
Sort response items by the Sequence attribute.
public ServiceTypeClient OrderBySequence()
Returns
OrderBySequenceDescending()
Sort response items by the Sequence attribute. Use reverse order.
public ServiceTypeClient OrderBySequenceDescending()
Returns
PostAsync(ServiceType, CancellationToken)
Creates a new ServiceType resource asynchronously.
public Task<ServiceTypeResponse> PostAsync(ServiceType resource, CancellationToken cancellationToken = default)
Parameters
resourceServiceTypeThe resource data to be sent in the POST request.
cancellationTokenCancellationTokenA token to monitor for cancellation requests.
Returns
- Task<ServiceTypeResponse>
A task representing the asynchronous operation, containing the created ServiceType resource.
Exceptions
- JsonApiException
Thrown when the HTTP response indicates a failure status code.
PostAsync(JsonApiDocument<ServiceTypeResource>, CancellationToken)
Creates a new ServiceType resource asynchronously.
public Task<ServiceTypeResponse> PostAsync(JsonApiDocument<ServiceTypeResource> document, CancellationToken cancellationToken = default)
Parameters
documentJsonApiDocument<ServiceTypeResource>The JSON:API document to be sent in the POST request.
cancellationTokenCancellationTokenA token to monitor for cancellation requests.
Returns
- Task<ServiceTypeResponse>
A task representing the asynchronous operation, containing the created ServiceType resource.
Exceptions
- JsonApiException
Thrown when the HTTP response indicates a failure status code.
WhereId(string)
Query response items by the Id attribute.
public ServiceTypeClient WhereId(string value)
Parameters
valuestring
Returns
WhereName(string)
Query response items by the Name attribute.
public ServiceTypeClient WhereName(string value)
Parameters
valuestring
Returns
WhereParentId(int)
Query response items by the ParentId attribute.
public ServiceTypeClient WhereParentId(int value)
Parameters
valueint
Returns
WithId(string)
Creates a new instance of a ServiceType client for a specific resource ID.
public ServiceTypeClient WithId(string id)
Parameters
idstringThe ID of the resource to create a client for.
Returns
- ServiceTypeClient
A new instance of the resource client for the specified resource ID.