Class AttachmentClient
- Namespace
- Crews.PlanningCenter.Api.Services.V2018_11_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
httpClientHttpClienturiUri
Properties
Zooms
Associated Zooms.
public PaginatedZoomClient Zooms { get; }
Property Value
Methods
DeleteAsync(CancellationToken)
Deletes the Attachment resource asynchronously.
public Task DeleteAsync(CancellationToken cancellationToken = default)
Parameters
cancellationTokenCancellationTokenA 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
cancellationTokenCancellationTokenA 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
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
cancellationTokenCancellationToken
Returns
PatchAsync(Attachment, CancellationToken)
Updates an existing Attachment resource asynchronously.
public Task<AttachmentResponse> PatchAsync(Attachment resource, CancellationToken cancellationToken = default)
Parameters
resourceAttachmentThe resource data to be sent in the patch request.
cancellationTokenCancellationTokenA 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
documentJsonApiDocument<AttachmentResource>The JSON:API document to be sent in the patch request.
cancellationTokenCancellationTokenA 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
cancellationTokenCancellationToken