Class SongClient
- Namespace
- Crews.PlanningCenter.Api.Services.V2018_11_01
- Assembly
- Crews.PlanningCenter.Api.dll
Client for interacting with the Song resource.
public class SongClient : SingletonResourceClient<Song, SongResource, SongResponse>
- Inheritance
-
SongClient
- Inherited Members
Constructors
SongClient(HttpClient, Uri)
Client for interacting with the Song resource.
public SongClient(HttpClient httpClient, Uri uri)
Parameters
httpClientHttpClienturiUri
Properties
Arrangements
Associated Arrangements.
public PaginatedArrangementClient Arrangements { get; }
Property Value
Attachments
Associated Attachments.
public PaginatedAttachmentClient Attachments { get; }
Property Value
LastScheduledItem
Associated LastScheduledItem.
public ItemClient LastScheduledItem { get; }
Property Value
SongSchedules
Associated SongSchedules.
public PaginatedSongScheduleClient SongSchedules { get; }
Property Value
Tags
Associated Tags.
public PaginatedTagClient Tags { get; }
Property Value
Methods
AssignTagsAsync(CancellationToken)
Used to assign tags to a song.
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
cancellationTokenCancellationToken
Returns
DeleteAsync(CancellationToken)
Deletes the Song 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 Song resource asynchronously.
public Task<SongResponse> GetAsync(CancellationToken cancellationToken = default)
Parameters
cancellationTokenCancellationTokenA token to monitor for cancellation requests.
Returns
- Task<SongResponse>
A task representing the asynchronous operation, containing the Song resource.
Exceptions
- JsonApiException
Thrown when the HTTP response indicates a failure status code.
PatchAsync(Song, CancellationToken)
Updates an existing Song resource asynchronously.
public Task<SongResponse> PatchAsync(Song resource, CancellationToken cancellationToken = default)
Parameters
resourceSongThe resource data to be sent in the patch request.
cancellationTokenCancellationTokenA token to monitor for cancellation requests.
Returns
- Task<SongResponse>
A task representing the asynchronous operation, containing the updated Song resource.
Exceptions
- JsonApiException
Thrown when the HTTP response indicates a failure status code.
PatchAsync(JsonApiDocument<SongResource>, CancellationToken)
Updates an existing Song resource asynchronously.
public Task<SongResponse> PatchAsync(JsonApiDocument<SongResource> document, CancellationToken cancellationToken = default)
Parameters
documentJsonApiDocument<SongResource>The JSON:API document to be sent in the patch request.
cancellationTokenCancellationTokenA token to monitor for cancellation requests.
Returns
- Task<SongResponse>
A task representing the asynchronous operation, containing the updated Song resource.
Exceptions
- JsonApiException
Thrown when the HTTP response indicates a failure status code.