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
AddCustomParameter(string, string)
Adds a custom query parameter to the request URI.
public PaginatedServiceTypeClient AddCustomParameter(string parameter, string value)
Parameters
Returns
- PaginatedServiceTypeClient
The current PaginatedServiceTypeClient instance.
ClearParameters()
Removes the entire query string from the request URI.
public PaginatedServiceTypeClient ClearParameters()
Returns
- PaginatedServiceTypeClient
The current PaginatedServiceTypeClient instance.
Filter(string)
Adds a filter query parameter to the request.
public PaginatedServiceTypeClient Filter(string filter)
Parameters
filterstringThe filter criteria.
Returns
- PaginatedServiceTypeClient
The current PaginatedServiceTypeClient instance.
Remarks
See Planning Center API documentation for details on supported filter values for this resource.
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
Offset(int)
Sets the item offset in the paginated response.
public PaginatedServiceTypeClient Offset(int count)
Parameters
countintThe number of items to skip.
Returns
- PaginatedServiceTypeClient
The current PaginatedServiceTypeClient instance.
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
PerPage(int)
Sets the number of items to be returned per page in the paginated response.
public PaginatedServiceTypeClient PerPage(int count)
Parameters
countintThe number of items to be returned per page.
Returns
- PaginatedServiceTypeClient
The current PaginatedServiceTypeClient instance.
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.