Class PaginatedResourceClient
- Namespace
- Crews.PlanningCenter.Api.Calendar.V2020_04_08
- Assembly
- Crews.PlanningCenter.Api.dll
Client for interacting with Resource collection resources.
public class PaginatedResourceClient : PaginatedResourceClient<Resource, ResourceResource, ResourceCollectionResponse, ResourceResponse>
- Inheritance
-
PaginatedResourceClient
- Inherited Members
Constructors
PaginatedResourceClient(HttpClient, Uri)
Client for interacting with Resource collection resources.
public PaginatedResourceClient(HttpClient httpClient, Uri uri)
Parameters
httpClientHttpClienturiUri
Methods
GetAsync(CancellationToken)
Fetches a paginated list of Resource resources asynchronously.
public Task<ResourceCollectionResponse> GetAsync(CancellationToken cancellationToken = default)
Parameters
cancellationTokenCancellationTokenA token to monitor for cancellation requests.
Returns
- Task<ResourceCollectionResponse>
A task representing the asynchronous operation, containing a paginated list of Resource resources.
Exceptions
- JsonApiException
Thrown when the HTTP response indicates a failure status code.
IncludeResourceApprovalGroups()
Include related ResourceApprovalGroups resources in the response.
public ResourceClient IncludeResourceApprovalGroups()
Returns
IncludeResourceFolder()
Include related ResourceFolder resources in the response.
public ResourceClient IncludeResourceFolder()
Returns
IncludeResourceQuestions()
Include related ResourceQuestions resources in the response.
public ResourceClient IncludeResourceQuestions()
Returns
IncludeRoomSetups()
Include related RoomSetups resources in the response.
public ResourceClient IncludeRoomSetups()
Returns
OrderByCreatedAt()
Sort response items by the CreatedAt attribute.
public ResourceClient OrderByCreatedAt()
Returns
OrderByCreatedAtDescending()
Sort response items by the CreatedAt attribute. Use reverse order.
public ResourceClient OrderByCreatedAtDescending()
Returns
OrderByExpiresAt()
Sort response items by the ExpiresAt attribute.
public ResourceClient OrderByExpiresAt()
Returns
OrderByExpiresAtDescending()
Sort response items by the ExpiresAt attribute. Use reverse order.
public ResourceClient OrderByExpiresAtDescending()
Returns
OrderByName()
Sort response items by the Name attribute.
public ResourceClient OrderByName()
Returns
OrderByNameDescending()
Sort response items by the Name attribute. Use reverse order.
public ResourceClient OrderByNameDescending()
Returns
OrderByUpdatedAt()
Sort response items by the UpdatedAt attribute.
public ResourceClient OrderByUpdatedAt()
Returns
OrderByUpdatedAtDescending()
Sort response items by the UpdatedAt attribute. Use reverse order.
public ResourceClient OrderByUpdatedAtDescending()
Returns
PostAsync(Resource, CancellationToken)
Creates a new Resource resource asynchronously.
public Task<ResourceResponse> PostAsync(Resource resource, CancellationToken cancellationToken = default)
Parameters
resourceResourceThe resource data to be sent in the POST request.
cancellationTokenCancellationTokenA token to monitor for cancellation requests.
Returns
- Task<ResourceResponse>
A task representing the asynchronous operation, containing the created Resource resource.
Exceptions
- JsonApiException
Thrown when the HTTP response indicates a failure status code.
PostAsync(JsonApiDocument<ResourceResource>, CancellationToken)
Creates a new Resource resource asynchronously.
public Task<ResourceResponse> PostAsync(JsonApiDocument<ResourceResource> document, CancellationToken cancellationToken = default)
Parameters
documentJsonApiDocument<ResourceResource>The JSON:API document to be sent in the POST request.
cancellationTokenCancellationTokenA token to monitor for cancellation requests.
Returns
- Task<ResourceResponse>
A task representing the asynchronous operation, containing the created Resource resource.
Exceptions
- JsonApiException
Thrown when the HTTP response indicates a failure status code.
WhereCreatedAt(DateTime)
Query response items by the CreatedAt attribute.
public ResourceClient WhereCreatedAt(DateTime value)
Parameters
valueDateTime
Returns
WhereKind(string)
Query response items by the Kind attribute.
public ResourceClient WhereKind(string value)
Parameters
valuestring
Returns
WhereName(string)
Query response items by the Name attribute.
public ResourceClient WhereName(string value)
Parameters
valuestring
Returns
WherePathName(string)
Query response items by the PathName attribute.
public ResourceClient WherePathName(string value)
Parameters
valuestring
Returns
WhereSerialNumber(string)
Query response items by the SerialNumber attribute.
public ResourceClient WhereSerialNumber(string value)
Parameters
valuestring
Returns
WhereUpdatedAt(DateTime)
Query response items by the UpdatedAt attribute.
public ResourceClient WhereUpdatedAt(DateTime value)
Parameters
valueDateTime
Returns
WithId(string)
Creates a new instance of a Resource client for a specific resource ID.
public ResourceClient WithId(string id)
Parameters
idstringThe ID of the resource to create a client for.
Returns
- ResourceClient
A new instance of the resource client for the specified resource ID.