Table of Contents

Class AttachmentClient

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

Client for interacting with the Attachment resource.

public class AttachmentClient : SingletonResourceClient<Attachment, AttachmentResource, AttachmentResponse>
Inheritance
AttachmentClient
Inherited Members

Constructors

AttachmentClient(HttpClient, Uri)

Client for interacting with the Attachment resource.

public AttachmentClient(HttpClient httpClient, Uri uri)

Parameters

httpClient HttpClient
uri Uri

Properties

Zooms

Associated Zooms.

public PaginatedZoomClient Zooms { get; }

Property Value

PaginatedZoomClient

Methods

DeleteAsync(CancellationToken)

Deletes the Attachment 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 Attachment resource asynchronously.

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

Parameters

cancellationToken CancellationToken

A token to monitor for cancellation requests.

Returns

Task<AttachmentResponse>

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

Exceptions

JsonApiException

Thrown when the HTTP response indicates a failure status code.

IncludeZooms()

Include related Zooms resources in the response.

public AttachmentClient IncludeZooms()

Returns

AttachmentClient

OpenAsync(CancellationToken)

This action is used to get the attachment file URL. It is accessed by POSTing to .../attachments/1/open

This will generate the URL and return it in the attachment_url attribute of the AttachmentActivity.

public Task OpenAsync(CancellationToken cancellationToken = default)

Parameters

cancellationToken CancellationToken

Returns

Task

PatchAsync(Attachment, CancellationToken)

Updates an existing Attachment resource asynchronously.

public Task<AttachmentResponse> PatchAsync(Attachment resource, CancellationToken cancellationToken = default)

Parameters

resource Attachment

The resource data to be sent in the patch request.

cancellationToken CancellationToken

A token to monitor for cancellation requests.

Returns

Task<AttachmentResponse>

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

Exceptions

JsonApiException

Thrown when the HTTP response indicates a failure status code.

PatchAsync(JsonApiDocument<AttachmentResource>, CancellationToken)

Updates an existing Attachment resource asynchronously.

public Task<AttachmentResponse> PatchAsync(JsonApiDocument<AttachmentResource> document, CancellationToken cancellationToken = default)

Parameters

document JsonApiDocument<AttachmentResource>

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

cancellationToken CancellationToken

A token to monitor for cancellation requests.

Returns

Task<AttachmentResponse>

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

Exceptions

JsonApiException

Thrown when the HTTP response indicates a failure status code.

PreviewAsync(CancellationToken)

This action is used to get a reduced resolution (preview) version of the attachment. It is accessed by POSTing to .../attachments/1/preview

This will generate the URL and return it in the attachment_url attribute of the AttachmentActivity.

The has_preview attribute of an Attachment indicates if a preview is available. When a preview is not available this action will return a Not Found error with a status code of 404.

public Task PreviewAsync(CancellationToken cancellationToken = default)

Parameters

cancellationToken CancellationToken

Returns

Task