Table of Contents

Class MediaClient

Namespace
Crews.PlanningCenter.Api.Services.V2018_08_01
Assembly
Crews.PlanningCenter.Api.dll

Client for interacting with the Media resource.

public class MediaClient : SingletonResourceClient<Media, MediaResource, MediaResponse>
Inheritance
MediaClient
Inherited Members

Constructors

MediaClient(HttpClient, Uri)

Client for interacting with the Media resource.

public MediaClient(HttpClient httpClient, Uri uri)

Parameters

httpClient HttpClient
uri Uri

Properties

Attachments

Associated Attachments.

public PaginatedAttachmentClient Attachments { get; }

Property Value

PaginatedAttachmentClient

MediaSchedules

Associated MediaSchedules.

public PaginatedMediaScheduleClient MediaSchedules { get; }

Property Value

PaginatedMediaScheduleClient

Tags

Associated Tags.

public PaginatedTagClient Tags { get; }

Property Value

PaginatedTagClient

Methods

ArchiveAsync(CancellationToken)

Archive a Media.
Accepts an optional time attribute (ISO 8601) for scheduling archival for a future time.

<code>json<br />{<br /> "data": {<br /> "type": "MediaArchive",<br /> "attributes": {<br /> "time": "2026-06-16T00:00:00Z"<br /> }<br /> }<br />}<br /></code>

public Task ArchiveAsync(CancellationToken cancellationToken = default)

Parameters

cancellationToken CancellationToken

Returns

Task

AssignTagsAsync(CancellationToken)

Used to assign tags to a media.
All tags will be replaced so the full data set must be sent.

It expects a body that looks like:

``json
{
"data": {
"type": "TagAssignment",
"attributes": {},
"relationships": {
"tags": {
"data": [
{
"type": "Tag",
"id": "5"
}
]
}
}
}
}
<code><br /><br />On success you will get back a </code>204 No Content.

public Task AssignTagsAsync(CancellationToken cancellationToken = default)

Parameters

cancellationToken CancellationToken

Returns

Task

DeleteAsync(CancellationToken)

Deletes the Media resource asynchronously.

public Task DeleteAsync(CancellationToken cancellationToken = default)

Parameters

cancellationToken CancellationToken

A token to monitor for cancellation requests.

Returns

Task

A task representing the asynchronous delete operation.

Exceptions

JsonApiException

Thrown when the HTTP response indicates a failure status code.

GetAsync(CancellationToken)

Fetches the Media resource asynchronously.

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

Parameters

cancellationToken CancellationToken

A token to monitor for cancellation requests.

Returns

Task<MediaResponse>

A task representing the asynchronous operation, containing the Media resource.

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

PatchAsync(Media, CancellationToken)

Updates an existing Media resource asynchronously.

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

Parameters

resource Media

The resource data to be sent in the patch request.

cancellationToken CancellationToken

A token to monitor for cancellation requests.

Returns

Task<MediaResponse>

A task representing the asynchronous operation, containing the updated Media resource.

Exceptions

JsonApiException

Thrown when the HTTP response indicates a failure status code.

PatchAsync(JsonApiDocument<MediaResource>, CancellationToken)

Updates an existing Media resource asynchronously.

public Task<MediaResponse> PatchAsync(JsonApiDocument<MediaResource> document, CancellationToken cancellationToken = default)

Parameters

document JsonApiDocument<MediaResource>

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

cancellationToken CancellationToken

A token to monitor for cancellation requests.

Returns

Task<MediaResponse>

A task representing the asynchronous operation, containing the updated Media resource.

Exceptions

JsonApiException

Thrown when the HTTP response indicates a failure status code.

UnarchiveAsync(CancellationToken)

Restore an archived Media.

public Task UnarchiveAsync(CancellationToken cancellationToken = default)

Parameters

cancellationToken CancellationToken

Returns

Task