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