Class PlanClient
- Namespace
- Crews.PlanningCenter.Api.Services.V2018_11_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
AddCustomParameter(string, string)
Adds a custom query parameter to the request URI.
public PlanClient AddCustomParameter(string parameter, string value)
Parameters
Returns
- PlanClient
The current PlanClient instance.
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
ClearParameters()
Removes the entire query string from the request URI.
public PlanClient ClearParameters()
Returns
- PlanClient
The current PlanClient instance.
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.
ImportAsync(CancellationToken)
Apply a Plan or PlanTemplate to this Plan
This action copies the team members, needed positions, items, and notes from a
source Plan or PlanTemplate into this (already existing) Plan.
Accepted attributes:
- source_id (Integer) ID of the PlanTemplate or Plan to copy from.
- additional_target_ids (Array[Integer]) IDs of other Plans to apply the source to. These are imported asynchronously. (default nil)
- copy_items (Boolean) Copy Items from the source. Requires editor permissions. (default false)
- copy_people (Boolean) Copy team members and needed positions from the source. (default false)
- copy_notes (Boolean) Copy Notes from the source. Requires editor permissions. (default false)
- team_ids (Array[Integer]) IDs of teams to copy people from when copy_people is set to true. If nil, copy_people copies from all teams. (default nil)
Permissions: requires scheduler on the target plan's service type (and on everyadditional_target_ids plan's service type). Using a Plan as the source requires
viewer on its service type; using a PlanTemplate as the source requires scheduler
on its service type. Schedulers may only copy people for teams they lead;copy_items and copy_notes require editor permissions.
Returns a PlanImportMetadata resource describing the outcome (e.g. whether any
copied people were missing required background checks).
public Task ImportAsync(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.