Class PaginatedMediaClient
- Namespace
- Crews.PlanningCenter.Api.Services.V2018_11_01
- Assembly
- Crews.PlanningCenter.Api.dll
Client for interacting with Media collection resources.
public class PaginatedMediaClient : PaginatedResourceClient<Media, MediaResource, MediaCollectionResponse, MediaResponse>
- Inheritance
-
PaginatedMediaClient
- Inherited Members
Constructors
PaginatedMediaClient(HttpClient, Uri)
Client for interacting with Media collection resources.
public PaginatedMediaClient(HttpClient httpClient, Uri uri)
Parameters
httpClientHttpClienturiUri
Methods
GetAsync(CancellationToken)
Fetches a paginated list of Media resources asynchronously.
public Task<MediaCollectionResponse> GetAsync(CancellationToken cancellationToken = default)
Parameters
cancellationTokenCancellationTokenA token to monitor for cancellation requests.
Returns
- Task<MediaCollectionResponse>
A task representing the asynchronous operation, containing a paginated list of Media resources.
Exceptions
- JsonApiException
Thrown when the HTTP response indicates a failure status code.
IncludeAttachments()
Include related Attachments resources in the response.
public MediaClient IncludeAttachments()
Returns
OrderByCreatedAt()
Sort response items by the CreatedAt attribute.
public MediaClient OrderByCreatedAt()
Returns
OrderByCreatedAtDescending()
Sort response items by the CreatedAt attribute. Use reverse order.
public MediaClient OrderByCreatedAtDescending()
Returns
OrderByTitle()
Sort response items by the Title attribute.
public MediaClient OrderByTitle()
Returns
OrderByTitleDescending()
Sort response items by the Title attribute. Use reverse order.
public MediaClient OrderByTitleDescending()
Returns
OrderByUpdatedAt()
Sort response items by the UpdatedAt attribute.
public MediaClient OrderByUpdatedAt()
Returns
OrderByUpdatedAtDescending()
Sort response items by the UpdatedAt attribute. Use reverse order.
public MediaClient OrderByUpdatedAtDescending()
Returns
PostAsync(Media, CancellationToken)
Creates a new Media resource asynchronously.
public Task<MediaResponse> PostAsync(Media resource, CancellationToken cancellationToken = default)
Parameters
resourceMediaThe resource data to be sent in the POST request.
cancellationTokenCancellationTokenA token to monitor for cancellation requests.
Returns
- Task<MediaResponse>
A task representing the asynchronous operation, containing the created Media resource.
Exceptions
- JsonApiException
Thrown when the HTTP response indicates a failure status code.
PostAsync(JsonApiDocument<MediaResource>, CancellationToken)
Creates a new Media resource asynchronously.
public Task<MediaResponse> PostAsync(JsonApiDocument<MediaResource> document, CancellationToken cancellationToken = default)
Parameters
documentJsonApiDocument<MediaResource>The JSON:API document to be sent in the POST request.
cancellationTokenCancellationTokenA token to monitor for cancellation requests.
Returns
- Task<MediaResponse>
A task representing the asynchronous operation, containing the created Media resource.
Exceptions
- JsonApiException
Thrown when the HTTP response indicates a failure status code.
WhereCreatorName(string)
Query response items by the CreatorName attribute.
public MediaClient WhereCreatorName(string value)
Parameters
valuestring
Returns
WhereId(string)
Query response items by the Id attribute.
public MediaClient WhereId(string value)
Parameters
valuestring
Returns
WhereThemes(string)
Query response items by the Themes attribute.
public MediaClient WhereThemes(string value)
Parameters
valuestring
Returns
WhereTitle(string)
Query response items by the Title attribute.
public MediaClient WhereTitle(string value)
Parameters
valuestring
Returns
WithId(string)
Creates a new instance of a Media client for a specific resource ID.
public MediaClient WithId(string id)
Parameters
idstringThe ID of the resource to create a client for.
Returns
- MediaClient
A new instance of the resource client for the specified resource ID.