Class PaginatedCampusClient
- Namespace
- Crews.PlanningCenter.Api.People.V2020_04_06
- Assembly
- Crews.PlanningCenter.Api.dll
Client for interacting with Campus collection resources.
public class PaginatedCampusClient : PaginatedResourceClient<Campus, CampusResource, CampusCollectionResponse, CampusResponse>
- Inheritance
-
PaginatedCampusClient
- Inherited Members
Constructors
PaginatedCampusClient(HttpClient, Uri)
Client for interacting with Campus collection resources.
public PaginatedCampusClient(HttpClient httpClient, Uri uri)
Parameters
httpClientHttpClienturiUri
Methods
AddCustomParameter(string, string)
Adds a custom query parameter to the request URI.
public PaginatedCampusClient AddCustomParameter(string parameter, string value)
Parameters
Returns
- PaginatedCampusClient
The current PaginatedCampusClient instance.
ClearParameters()
Removes the entire query string from the request URI.
public PaginatedCampusClient ClearParameters()
Returns
- PaginatedCampusClient
The current PaginatedCampusClient instance.
Filter(string)
Adds a filter query parameter to the request.
public PaginatedCampusClient Filter(string filter)
Parameters
filterstringThe filter criteria.
Returns
- PaginatedCampusClient
The current PaginatedCampusClient instance.
Remarks
See Planning Center API documentation for details on supported filter values for this resource.
GetAsync(CancellationToken)
Fetches a paginated list of Campus resources asynchronously.
public Task<CampusCollectionResponse> GetAsync(CancellationToken cancellationToken = default)
Parameters
cancellationTokenCancellationTokenA token to monitor for cancellation requests.
Returns
- Task<CampusCollectionResponse>
A task representing the asynchronous operation, containing a paginated list of Campus resources.
Exceptions
- JsonApiException
Thrown when the HTTP response indicates a failure status code.
IncludeLists()
Include related Lists resources in the response.
public CampusClient IncludeLists()
Returns
IncludeServiceTimes()
Include related ServiceTimes resources in the response.
public CampusClient IncludeServiceTimes()
Returns
Offset(int)
Sets the item offset in the paginated response.
public PaginatedCampusClient Offset(int count)
Parameters
countintThe number of items to skip.
Returns
- PaginatedCampusClient
The current PaginatedCampusClient instance.
OrderByCreatedAt()
Sort response items by the CreatedAt attribute.
public CampusClient OrderByCreatedAt()
Returns
OrderByCreatedAtDescending()
Sort response items by the CreatedAt attribute. Use reverse order.
public CampusClient OrderByCreatedAtDescending()
Returns
OrderByName()
Sort response items by the Name attribute.
public CampusClient OrderByName()
Returns
OrderByNameDescending()
Sort response items by the Name attribute. Use reverse order.
public CampusClient OrderByNameDescending()
Returns
OrderByUpdatedAt()
Sort response items by the UpdatedAt attribute.
public CampusClient OrderByUpdatedAt()
Returns
OrderByUpdatedAtDescending()
Sort response items by the UpdatedAt attribute. Use reverse order.
public CampusClient OrderByUpdatedAtDescending()
Returns
PerPage(int)
Sets the number of items to be returned per page in the paginated response.
public PaginatedCampusClient PerPage(int count)
Parameters
countintThe number of items to be returned per page.
Returns
- PaginatedCampusClient
The current PaginatedCampusClient instance.
PostAsync(Campus, CancellationToken)
Creates a new Campus resource asynchronously.
public Task<CampusResponse> PostAsync(Campus resource, CancellationToken cancellationToken = default)
Parameters
resourceCampusThe resource data to be sent in the POST request.
cancellationTokenCancellationTokenA token to monitor for cancellation requests.
Returns
- Task<CampusResponse>
A task representing the asynchronous operation, containing the created Campus resource.
Exceptions
- JsonApiException
Thrown when the HTTP response indicates a failure status code.
PostAsync(JsonApiDocument<CampusResource>, CancellationToken)
Creates a new Campus resource asynchronously.
public Task<CampusResponse> PostAsync(JsonApiDocument<CampusResource> document, CancellationToken cancellationToken = default)
Parameters
documentJsonApiDocument<CampusResource>The JSON:API document to be sent in the POST request.
cancellationTokenCancellationTokenA token to monitor for cancellation requests.
Returns
- Task<CampusResponse>
A task representing the asynchronous operation, containing the created Campus resource.
Exceptions
- JsonApiException
Thrown when the HTTP response indicates a failure status code.
WhereCreatedAt(DateTime)
Query response items by the CreatedAt attribute.
public CampusClient WhereCreatedAt(DateTime value)
Parameters
valueDateTime
Returns
WhereId(string)
Query response items by the Id attribute.
public CampusClient WhereId(string value)
Parameters
valuestring
Returns
WhereUpdatedAt(DateTime)
Query response items by the UpdatedAt attribute.
public CampusClient WhereUpdatedAt(DateTime value)
Parameters
valueDateTime
Returns
WithId(string)
Creates a new instance of a Campus client for a specific resource ID.
public CampusClient WithId(string id)
Parameters
idstringThe ID of the resource to create a client for.
Returns
- CampusClient
A new instance of the resource client for the specified resource ID.