Table of Contents

Class PaginatedMediaClient

Namespace
Crews.PlanningCenter.Api.Services.V2018_08_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

httpClient HttpClient
uri Uri

Methods

AddCustomParameter(string, string)

Adds a custom query parameter to the request URI.

public PaginatedMediaClient AddCustomParameter(string parameter, string value)

Parameters

parameter string

The name of the query parameter.

value string

The value of the query parameter.

Returns

PaginatedMediaClient

The current PaginatedMediaClient instance.

ClearParameters()

Removes the entire query string from the request URI.

public PaginatedMediaClient ClearParameters()

Returns

PaginatedMediaClient

The current PaginatedMediaClient instance.

Filter(string)

Adds a filter query parameter to the request.

public PaginatedMediaClient Filter(string filter)

Parameters

filter string

The filter criteria.

Returns

PaginatedMediaClient

The current PaginatedMediaClient instance.

Remarks

See Planning Center API documentation for details on supported filter values for this resource.

GetAsync(CancellationToken)

Fetches a paginated list of Media resources asynchronously.

public Task<MediaCollectionResponse> GetAsync(CancellationToken cancellationToken = default)

Parameters

cancellationToken CancellationToken

A 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

MediaClient

Offset(int)

Sets the item offset in the paginated response.

public PaginatedMediaClient Offset(int count)

Parameters

count int

The number of items to skip.

Returns

PaginatedMediaClient

The current PaginatedMediaClient instance.

OrderByCreatedAt()

Sort response items by the CreatedAt attribute.

public MediaClient OrderByCreatedAt()

Returns

MediaClient

OrderByCreatedAtDescending()

Sort response items by the CreatedAt attribute. Use reverse order.

public MediaClient OrderByCreatedAtDescending()

Returns

MediaClient

OrderByTitle()

Sort response items by the Title attribute.

public MediaClient OrderByTitle()

Returns

MediaClient

OrderByTitleDescending()

Sort response items by the Title attribute. Use reverse order.

public MediaClient OrderByTitleDescending()

Returns

MediaClient

OrderByUpdatedAt()

Sort response items by the UpdatedAt attribute.

public MediaClient OrderByUpdatedAt()

Returns

MediaClient

OrderByUpdatedAtDescending()

Sort response items by the UpdatedAt attribute. Use reverse order.

public MediaClient OrderByUpdatedAtDescending()

Returns

MediaClient

PerPage(int)

Sets the number of items to be returned per page in the paginated response.

public PaginatedMediaClient PerPage(int count)

Parameters

count int

The number of items to be returned per page.

Returns

PaginatedMediaClient

The current PaginatedMediaClient instance.

PostAsync(Media, CancellationToken)

Creates a new Media resource asynchronously.

public Task<MediaResponse> PostAsync(Media resource, CancellationToken cancellationToken = default)

Parameters

resource Media

The resource data to be sent in the POST request.

cancellationToken CancellationToken

A 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

document JsonApiDocument<MediaResource>

The JSON:API document to be sent in the POST request.

cancellationToken CancellationToken

A 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

value string

Returns

MediaClient

WhereId(string)

Query response items by the Id attribute.

public MediaClient WhereId(string value)

Parameters

value string

Returns

MediaClient

WhereThemes(string)

Query response items by the Themes attribute.

public MediaClient WhereThemes(string value)

Parameters

value string

Returns

MediaClient

WhereTitle(string)

Query response items by the Title attribute.

public MediaClient WhereTitle(string value)

Parameters

value string

Returns

MediaClient

WithId(string)

Creates a new instance of a Media client for a specific resource ID.

public MediaClient WithId(string id)

Parameters

id string

The ID of the resource to create a client for.

Returns

MediaClient

A new instance of the resource client for the specified resource ID.