Class ScheduleClient
- Namespace
- Crews.PlanningCenter.Api.Services.V2018_11_01
- Assembly
- Crews.PlanningCenter.Api.dll
Client for interacting with the Schedule resource.
public class ScheduleClient : SingletonResourceClient<Schedule, ScheduleResource, ScheduleResponse>
- Inheritance
-
ScheduleClient
- Inherited Members
Constructors
ScheduleClient(HttpClient, Uri)
Client for interacting with the Schedule resource.
public ScheduleClient(HttpClient httpClient, Uri uri)
Parameters
httpClientHttpClienturiUri
Properties
DeclinedPlanTimes
Associated DeclinedPlanTimes.
public PaginatedPlanTimeClient DeclinedPlanTimes { get; }
Property Value
PlanTimes
Associated PlanTimes.
public PaginatedPlanTimeClient PlanTimes { get; }
Property Value
RespondTo
Associated RespondTo.
public PersonClient RespondTo { get; }
Property Value
Team
Associated Team.
public TeamClient Team { get; }
Property Value
Methods
AcceptAsync(CancellationToken)
Accept a Schedule
If this isn't a split time schedule, or you want to accept all times, an empty JSON body is accepted.
If the user wants to decline specific times you'll need to send the declined time IDs & a reason.
A POST body should be formated...<code>json<br />{<br /> "data": {<br /> "type": "ScheduleAccept",<br /> "attributes": {<br /> "reason": "Because reasons"<br /> },<br /> "relationships": {<br /> "declined_plan_times": {<br /> "data": [<br /> {<br /> "type": "PlanTime",<br /> "id": "1"<br /> }<br /> ]<br /> }<br /> }<br /> }<br />}<br /></code>
public Task AcceptAsync(CancellationToken cancellationToken = default)
Parameters
cancellationTokenCancellationToken
Returns
DeclineAsync(CancellationToken)
Decline a Schedule
If this is a split time request, all times will be declined.
If you want to decline specific times see ScheduleAcceptAction.
A POST body should be formated...<code>json<br />{<br /> "data": {<br /> "type": "ScheduleDecline",<br /> "attributes": {<br /> "reason": "A user supplied reason for declining the request or an empty string."<br /> },<br /> "relationships": null<br /> }<br />}<br /></code>
public Task DeclineAsync(CancellationToken cancellationToken = default)
Parameters
cancellationTokenCancellationToken
Returns
GetAsync(CancellationToken)
Fetches the Schedule resource asynchronously.
public Task<ScheduleResponse> GetAsync(CancellationToken cancellationToken = default)
Parameters
cancellationTokenCancellationTokenA token to monitor for cancellation requests.
Returns
- Task<ScheduleResponse>
A task representing the asynchronous operation, containing the Schedule resource.
Exceptions
- JsonApiException
Thrown when the HTTP response indicates a failure status code.
IncludePlanTimes()
Include related PlanTimes resources in the response.
public ScheduleClient IncludePlanTimes()