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
httpClientHttpClienturiUri
Properties
AvailableSignups
Associated AvailableSignups.
public PaginatedAvailableSignupClient AvailableSignups { get; }
Property Value
Blockouts
Associated Blockouts.
public PaginatedBlockoutClient Blockouts { get; }
Property Value
Emails
Associated Emails.
public PaginatedEmailClient Emails { get; }
Property Value
PersonTeamPositionAssignments
Associated PersonTeamPositionAssignments.
public PaginatedPersonTeamPositionAssignmentClient PersonTeamPositionAssignments { get; }
Property Value
PlanPeople
Associated PlanPeople.
public PaginatedPlanPersonClient PlanPeople { get; }
Property Value
Schedules
Associated Schedules.
public PaginatedScheduleClient Schedules { get; }
Property Value
SchedulingPreferences
Associated SchedulingPreferences.
public PaginatedSchedulingPreferenceClient SchedulingPreferences { get; }
Property Value
Tags
Associated Tags.
public PaginatedTagClient Tags { get; }
Property Value
TeamLeaders
Associated TeamLeaders.
public PaginatedTeamLeaderClient TeamLeaders { get; }
Property Value
TextSettings
Associated TextSettings.
public PaginatedTextSettingClient TextSettings { get; }
Property Value
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
cancellationTokenCancellationToken
Returns
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
cancellationTokenCancellationToken
Returns
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
cancellationTokenCancellationToken
Returns
GetAsync(CancellationToken)
Fetches the Person resource asynchronously.
public Task<PersonResponse> GetAsync(CancellationToken cancellationToken = default)
Parameters
cancellationTokenCancellationTokenA 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
IncludeTags()
Include related Tags resources in the response.
public PersonClient IncludeTags()
Returns
IncludeTeamLeaders()
Include related TeamLeaders resources in the response.
public PersonClient IncludeTeamLeaders()
Returns
PatchAsync(Person, CancellationToken)
Updates an existing Person resource asynchronously.
public Task<PersonResponse> PatchAsync(Person resource, CancellationToken cancellationToken = default)
Parameters
resourcePersonThe resource data to be sent in the patch request.
cancellationTokenCancellationTokenA 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
documentJsonApiDocument<PersonResource>The JSON:API document to be sent in the patch request.
cancellationTokenCancellationTokenA 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.