Table of Contents

Class PersonClient

Namespace
Crews.PlanningCenter.Api.Services.V2018_11_01
Assembly
Crews.PlanningCenter.Api.dll

Client for interacting with the Person resource.

public class PersonClient : SingletonResourceClient<Person, PersonResource, PersonResponse>
Inheritance
PersonClient
Inherited Members

Constructors

PersonClient(HttpClient, Uri)

Client for interacting with the Person resource.

public PersonClient(HttpClient httpClient, Uri uri)

Parameters

httpClient HttpClient
uri Uri

Properties

AvailableSignups

Associated AvailableSignups.

public PaginatedAvailableSignupClient AvailableSignups { get; }

Property Value

PaginatedAvailableSignupClient

Blockouts

Associated Blockouts.

public PaginatedBlockoutClient Blockouts { get; }

Property Value

PaginatedBlockoutClient

Emails

Associated Emails.

public PaginatedEmailClient Emails { get; }

Property Value

PaginatedEmailClient

PersonTeamPositionAssignments

Associated PersonTeamPositionAssignments.

public PaginatedPersonTeamPositionAssignmentClient PersonTeamPositionAssignments { get; }

Property Value

PaginatedPersonTeamPositionAssignmentClient

PlanPeople

Associated PlanPeople.

public PaginatedPlanPersonClient PlanPeople { get; }

Property Value

PaginatedPlanPersonClient

Schedules

Associated Schedules.

public PaginatedScheduleClient Schedules { get; }

Property Value

PaginatedScheduleClient

SchedulingPreferences

Associated SchedulingPreferences.

public PaginatedSchedulingPreferenceClient SchedulingPreferences { get; }

Property Value

PaginatedSchedulingPreferenceClient

Tags

Associated Tags.

public PaginatedTagClient Tags { get; }

Property Value

PaginatedTagClient

TeamLeaders

Associated TeamLeaders.

public PaginatedTeamLeaderClient TeamLeaders { get; }

Property Value

PaginatedTeamLeaderClient

TextSettings

Associated TextSettings.

public PaginatedTextSettingClient TextSettings { get; }

Property Value

PaginatedTextSettingClient

Methods

AssignTagsAsync(CancellationToken)

Used to assign tags to a person.
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

cancellationToken CancellationToken

Returns

Task

CollapseServiceTypesAsync(CancellationToken)

Used to set Service Types as collapsed for the Person
It expects a body that looks like:

``json
{
"data": {
"type": "CollapseServiceTypes",
"attributes": {},
"relationships": {
"service_type": {
"data": [
{
"type": "ServiceType",
"id": "1"
},
{
"type": "ServiceType",
"id": "2"
}
]
}
}
}
}
<code><br /><br />On success you will get back a </code>204 No Content.

public Task CollapseServiceTypesAsync(CancellationToken cancellationToken = default)

Parameters

cancellationToken CancellationToken

Returns

Task

ExpandServiceTypesAsync(CancellationToken)

Used to set Service Types as expanded for the Person
It expects a body that looks like:

``json
{
"data": {
"type": "ExpandServiceTypes",
"attributes": {},
"relationships": {
"service_type": {
"data": [
{
"type": "ServiceType",
"id": "1"
},
{
"type": "ServiceType",
"id": "2"
}
]
}
}
}
}
<code><br /><br />On success you will get back a </code>204 No Content.

public Task ExpandServiceTypesAsync(CancellationToken cancellationToken = default)

Parameters

cancellationToken CancellationToken

Returns

Task

GetAsync(CancellationToken)

Fetches the Person resource asynchronously.

public Task<PersonResponse> GetAsync(CancellationToken cancellationToken = default)

Parameters

cancellationToken CancellationToken

A token to monitor for cancellation requests.

Returns

Task<PersonResponse>

A task representing the asynchronous operation, containing the Person resource.

Exceptions

JsonApiException

Thrown when the HTTP response indicates a failure status code.

IncludeEmails()

Include related Emails resources in the response.

public PersonClient IncludeEmails()

Returns

PersonClient

IncludeTags()

Include related Tags resources in the response.

public PersonClient IncludeTags()

Returns

PersonClient

IncludeTeamLeaders()

Include related TeamLeaders resources in the response.

public PersonClient IncludeTeamLeaders()

Returns

PersonClient

PatchAsync(Person, CancellationToken)

Updates an existing Person resource asynchronously.

public Task<PersonResponse> PatchAsync(Person resource, CancellationToken cancellationToken = default)

Parameters

resource Person

The resource data to be sent in the patch request.

cancellationToken CancellationToken

A token to monitor for cancellation requests.

Returns

Task<PersonResponse>

A task representing the asynchronous operation, containing the updated Person resource.

Exceptions

JsonApiException

Thrown when the HTTP response indicates a failure status code.

PatchAsync(JsonApiDocument<PersonResource>, CancellationToken)

Updates an existing Person resource asynchronously.

public Task<PersonResponse> PatchAsync(JsonApiDocument<PersonResource> document, CancellationToken cancellationToken = default)

Parameters

document JsonApiDocument<PersonResource>

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

cancellationToken CancellationToken

A token to monitor for cancellation requests.

Returns

Task<PersonResponse>

A task representing the asynchronous operation, containing the updated Person resource.

Exceptions

JsonApiException

Thrown when the HTTP response indicates a failure status code.