Class PaginatedServiceTimeClient
- Namespace
- Crews.PlanningCenter.Api.People.V2020_04_06
- Assembly
- Crews.PlanningCenter.Api.dll
Client for interacting with ServiceTime collection resources.
public class PaginatedServiceTimeClient : PaginatedResourceClient<ServiceTime, ServiceTimeResource, ServiceTimeCollectionResponse, ServiceTimeResponse>
- Inheritance
-
PaginatedResourceClient<ServiceTime, ServiceTimeResource, ServiceTimeCollectionResponse, ServiceTimeResponse>PaginatedServiceTimeClient
- Inherited Members
Constructors
PaginatedServiceTimeClient(HttpClient, Uri)
Client for interacting with ServiceTime collection resources.
public PaginatedServiceTimeClient(HttpClient httpClient, Uri uri)
Parameters
httpClientHttpClienturiUri
Methods
AddCustomParameter(string, string)
Adds a custom query parameter to the request URI.
public PaginatedServiceTimeClient AddCustomParameter(string parameter, string value)
Parameters
Returns
- PaginatedServiceTimeClient
The current PaginatedServiceTimeClient instance.
ClearParameters()
Removes the entire query string from the request URI.
public PaginatedServiceTimeClient ClearParameters()
Returns
- PaginatedServiceTimeClient
The current PaginatedServiceTimeClient instance.
Filter(string)
Adds a filter query parameter to the request.
public PaginatedServiceTimeClient Filter(string filter)
Parameters
filterstringThe filter criteria.
Returns
- PaginatedServiceTimeClient
The current PaginatedServiceTimeClient instance.
Remarks
See Planning Center API documentation for details on supported filter values for this resource.
GetAsync(CancellationToken)
Fetches a paginated list of ServiceTime resources asynchronously.
public Task<ServiceTimeCollectionResponse> GetAsync(CancellationToken cancellationToken = default)
Parameters
cancellationTokenCancellationTokenA token to monitor for cancellation requests.
Returns
- Task<ServiceTimeCollectionResponse>
A task representing the asynchronous operation, containing a paginated list of ServiceTime resources.
Exceptions
- JsonApiException
Thrown when the HTTP response indicates a failure status code.
Offset(int)
Sets the item offset in the paginated response.
public PaginatedServiceTimeClient Offset(int count)
Parameters
countintThe number of items to skip.
Returns
- PaginatedServiceTimeClient
The current PaginatedServiceTimeClient instance.
OrderByTime()
Sort response items by the Time attribute.
public ServiceTimeClient OrderByTime()
Returns
OrderByTimeDescending()
Sort response items by the Time attribute. Use reverse order.
public ServiceTimeClient OrderByTimeDescending()
Returns
PerPage(int)
Sets the number of items to be returned per page in the paginated response.
public PaginatedServiceTimeClient PerPage(int count)
Parameters
countintThe number of items to be returned per page.
Returns
- PaginatedServiceTimeClient
The current PaginatedServiceTimeClient instance.
PostAsync(ServiceTime, CancellationToken)
Creates a new ServiceTime resource asynchronously.
public Task<ServiceTimeResponse> PostAsync(ServiceTime resource, CancellationToken cancellationToken = default)
Parameters
resourceServiceTimeThe resource data to be sent in the POST request.
cancellationTokenCancellationTokenA token to monitor for cancellation requests.
Returns
- Task<ServiceTimeResponse>
A task representing the asynchronous operation, containing the created ServiceTime resource.
Exceptions
- JsonApiException
Thrown when the HTTP response indicates a failure status code.
PostAsync(JsonApiDocument<ServiceTimeResource>, CancellationToken)
Creates a new ServiceTime resource asynchronously.
public Task<ServiceTimeResponse> PostAsync(JsonApiDocument<ServiceTimeResource> document, CancellationToken cancellationToken = default)
Parameters
documentJsonApiDocument<ServiceTimeResource>The JSON:API document to be sent in the POST request.
cancellationTokenCancellationTokenA token to monitor for cancellation requests.
Returns
- Task<ServiceTimeResponse>
A task representing the asynchronous operation, containing the created ServiceTime resource.
Exceptions
- JsonApiException
Thrown when the HTTP response indicates a failure status code.
WithId(string)
Creates a new instance of a ServiceTime client for a specific resource ID.
public ServiceTimeClient WithId(string id)
Parameters
idstringThe ID of the resource to create a client for.
Returns
- ServiceTimeClient
A new instance of the resource client for the specified resource ID.