Class PlanClient
- Namespace
- Crews.PlanningCenter.Api.Services.V2018_08_01
- Assembly
- Crews.PlanningCenter.Api.dll
Client for interacting with the Plan resource.
public class PlanClient : SingletonResourceClient<Plan, PlanResource, PlanResponse>
- Inheritance
-
PlanClient
- Inherited Members
Constructors
PlanClient(HttpClient, Uri)
Client for interacting with the Plan resource.
public PlanClient(HttpClient httpClient, Uri uri)
Parameters
httpClientHttpClienturiUri
Properties
AllAttachments
Associated AllAttachments.
public PaginatedAttachmentClient AllAttachments { get; }
Property Value
Attachments
Associated Attachments.
public PaginatedAttachmentClient Attachments { get; }
Property Value
Attendances
Associated Attendances.
public PaginatedAttendanceClient Attendances { get; }
Property Value
Contributors
Associated Contributors.
public PaginatedContributorClient Contributors { get; }
Property Value
Items
Associated Items.
public PaginatedItemClient Items { get; }
Property Value
Live
Associated Live.
public LiveClient Live { get; }
Property Value
MySchedules
Associated MySchedules.
public PaginatedScheduleClient MySchedules { get; }
Property Value
NeededPositions
Associated NeededPositions.
public PaginatedNeededPositionClient NeededPositions { get; }
Property Value
NextPlan
Associated NextPlan.
public PlanClient NextPlan { get; }
Property Value
Notes
Associated Notes.
public PaginatedPlanNoteClient Notes { get; }
Property Value
PlanTimes
Associated PlanTimes.
public PaginatedPlanTimeClient PlanTimes { get; }
Property Value
PreviousPlan
Associated PreviousPlan.
public PlanClient PreviousPlan { get; }
Property Value
Series
Associated Series.
public SeriesClient Series { get; }
Property Value
SignupTeams
Associated SignupTeams.
public PaginatedTeamClient SignupTeams { get; }
Property Value
TeamMembers
Associated TeamMembers.
public PaginatedPlanPersonClient TeamMembers { get; }
Property Value
Methods
AutoscheduleAsync(CancellationToken)
Auto-schedule for a team. Returns a collection of scheduled PlanPersonAutoscheduleVertex
Auto-schedule for a team. Returns a collection of scheduled PlanPersonAutoscheduleVertex.
It expects a POST body with a Team relationship.<code>json<br />{<br /> "data": {<br /> "type": "Autoschedule",<br /> "attributes": {},<br /> "relationship": {<br /> "team": {<br /> "data": {<br /> "id": 1,<br /> "type": 'Team'<br /> }<br /> }<br /> }<br /> }<br />}<br /></code>
public Task AutoscheduleAsync(CancellationToken cancellationToken = default)
Parameters
cancellationTokenCancellationToken
Returns
DeleteAsync(CancellationToken)
Deletes the Plan 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 Plan resource asynchronously.
public Task<PlanResponse> GetAsync(CancellationToken cancellationToken = default)
Parameters
cancellationTokenCancellationTokenA token to monitor for cancellation requests.
Returns
- Task<PlanResponse>
A task representing the asynchronous operation, containing the Plan resource.
Exceptions
- JsonApiException
Thrown when the HTTP response indicates a failure status code.
ImportTemplateAsync(CancellationToken)
Import template to plan
This action allows the importing of a template into a plan.
Accepted attributes:
- plan_id (Integer) ID of template to copying from
- copy_items (Boolean) Copy Items from another plan. (default false)
- copy_people (Boolean) Copy People from another plan. (default false)
- copy_notes (Boolean) Copy Notes from another plan. (default false)
public Task ImportTemplateAsync(CancellationToken cancellationToken = default)
Parameters
cancellationTokenCancellationToken
Returns
IncludeContributors()
Include related Contributors resources in the response.
public PlanClient IncludeContributors()
Returns
IncludeMySchedules()
Include related MySchedules resources in the response.
public PlanClient IncludeMySchedules()
Returns
IncludePlanTimes()
Include related PlanTimes resources in the response.
public PlanClient IncludePlanTimes()
Returns
IncludeSeries()
Include related Series resources in the response.
public PlanClient IncludeSeries()
Returns
ItemReorderAsync(CancellationToken)
Reorder plan items in one request.
This can be used to reorder all items in a plan in one request.
It expects a POST body with a sequence of Item ids in order. E.G.
``json
{
"data": {
"type": "PlanItemReorder",
"attributes": {
"sequence": [
"5",
"1",
"3"
]
}
}
}<code><br /><br />On success you will get back a </code>204 No Content.
public Task ItemReorderAsync(CancellationToken cancellationToken = default)
Parameters
cancellationTokenCancellationToken
Returns
PatchAsync(Plan, CancellationToken)
Updates an existing Plan resource asynchronously.
public Task<PlanResponse> PatchAsync(Plan resource, CancellationToken cancellationToken = default)
Parameters
resourcePlanThe resource data to be sent in the patch request.
cancellationTokenCancellationTokenA token to monitor for cancellation requests.
Returns
- Task<PlanResponse>
A task representing the asynchronous operation, containing the updated Plan resource.
Exceptions
- JsonApiException
Thrown when the HTTP response indicates a failure status code.
PatchAsync(JsonApiDocument<PlanResource>, CancellationToken)
Updates an existing Plan resource asynchronously.
public Task<PlanResponse> PatchAsync(JsonApiDocument<PlanResource> document, CancellationToken cancellationToken = default)
Parameters
documentJsonApiDocument<PlanResource>The JSON:API document to be sent in the patch request.
cancellationTokenCancellationTokenA token to monitor for cancellation requests.
Returns
- Task<PlanResponse>
A task representing the asynchronous operation, containing the updated Plan resource.
Exceptions
- JsonApiException
Thrown when the HTTP response indicates a failure status code.