Table of Contents

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

httpClient HttpClient
uri Uri

Properties

AllAttachments

Associated AllAttachments.

public PaginatedAttachmentClient AllAttachments { get; }

Property Value

PaginatedAttachmentClient

Attachments

Associated Attachments.

public PaginatedAttachmentClient Attachments { get; }

Property Value

PaginatedAttachmentClient

Attendances

Associated Attendances.

public PaginatedAttendanceClient Attendances { get; }

Property Value

PaginatedAttendanceClient

Contributors

Associated Contributors.

public PaginatedContributorClient Contributors { get; }

Property Value

PaginatedContributorClient

Items

Associated Items.

public PaginatedItemClient Items { get; }

Property Value

PaginatedItemClient

Live

Associated Live.

public LiveClient Live { get; }

Property Value

LiveClient

MySchedules

Associated MySchedules.

public PaginatedScheduleClient MySchedules { get; }

Property Value

PaginatedScheduleClient

NeededPositions

Associated NeededPositions.

public PaginatedNeededPositionClient NeededPositions { get; }

Property Value

PaginatedNeededPositionClient

NextPlan

Associated NextPlan.

public PlanClient NextPlan { get; }

Property Value

PlanClient

Notes

Associated Notes.

public PaginatedPlanNoteClient Notes { get; }

Property Value

PaginatedPlanNoteClient

PlanTimes

Associated PlanTimes.

public PaginatedPlanTimeClient PlanTimes { get; }

Property Value

PaginatedPlanTimeClient

PreviousPlan

Associated PreviousPlan.

public PlanClient PreviousPlan { get; }

Property Value

PlanClient

Series

Associated Series.

public SeriesClient Series { get; }

Property Value

SeriesClient

SignupTeams

Associated SignupTeams.

public PaginatedTeamClient SignupTeams { get; }

Property Value

PaginatedTeamClient

TeamMembers

Associated TeamMembers.

public PaginatedPlanPersonClient TeamMembers { get; }

Property Value

PaginatedPlanPersonClient

Methods

AddCustomParameter(string, string)

Adds a custom query parameter to the request URI.

public PlanClient AddCustomParameter(string parameter, string value)

Parameters

parameter string

The name of the query parameter.

value string

The value of the query parameter.

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

cancellationToken CancellationToken

Returns

Task

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

cancellationToken CancellationToken

A 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

cancellationToken CancellationToken

A 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 every
additional_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

cancellationToken CancellationToken

Returns

Task

IncludeContributors()

Include related Contributors resources in the response.

public PlanClient IncludeContributors()

Returns

PlanClient

IncludeMySchedules()

Include related MySchedules resources in the response.

public PlanClient IncludeMySchedules()

Returns

PlanClient

IncludePlanTimes()

Include related PlanTimes resources in the response.

public PlanClient IncludePlanTimes()

Returns

PlanClient

IncludeSeries()

Include related Series resources in the response.

public PlanClient IncludeSeries()

Returns

PlanClient

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

cancellationToken CancellationToken

Returns

Task

PatchAsync(Plan, CancellationToken)

Updates an existing Plan resource asynchronously.

public Task<PlanResponse> PatchAsync(Plan resource, CancellationToken cancellationToken = default)

Parameters

resource Plan

The resource data to be sent in the patch request.

cancellationToken CancellationToken

A 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

document JsonApiDocument<PlanResource>

The JSON:API document to be sent in the patch request.

cancellationToken CancellationToken

A 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.