Class ServiceTypeClient
- Namespace
- Crews.PlanningCenter.Api.Services.V2018_08_01
- Assembly
- Crews.PlanningCenter.Api.dll
Client for interacting with the ServiceType resource.
public class ServiceTypeClient : SingletonResourceClient<ServiceType, ServiceTypeResource, ServiceTypeResponse>
- Inheritance
-
ServiceTypeClient
- Inherited Members
Constructors
ServiceTypeClient(HttpClient, Uri)
Client for interacting with the ServiceType resource.
public ServiceTypeClient(HttpClient httpClient, Uri uri)
Parameters
httpClientHttpClienturiUri
Properties
Attachments
Associated Attachments.
public PaginatedAttachmentClient Attachments { get; }
Property Value
ItemNoteCategories
Associated ItemNoteCategories.
public PaginatedItemNoteCategoryClient ItemNoteCategories { get; }
Property Value
LiveControllers
Associated LiveControllers.
public PaginatedLiveControllerClient LiveControllers { get; }
Property Value
PlanNoteCategories
Associated PlanNoteCategories.
public PaginatedPlanNoteCategoryClient PlanNoteCategories { get; }
Property Value
PlanTemplates
Associated PlanTemplates.
public PaginatedPlanTemplateClient PlanTemplates { get; }
Property Value
PlanTimes
Associated PlanTimes.
public PaginatedPlanTimeClient PlanTimes { get; }
Property Value
Plans
Associated Plans.
public PaginatedPlanClient Plans { get; }
Property Value
PublicView
Associated PublicView.
public PublicViewClient PublicView { get; }
Property Value
TeamPositions
Associated TeamPositions.
public PaginatedTeamPositionClient TeamPositions { get; }
Property Value
Teams
Associated Teams.
public PaginatedTeamClient Teams { get; }
Property Value
TimePreferenceOptions
Associated TimePreferenceOptions.
public PaginatedTimePreferenceOptionClient TimePreferenceOptions { get; }
Property Value
UnscopedPlans
Associated UnscopedPlans.
public PaginatedPlanClient UnscopedPlans { get; }
Property Value
Methods
CreatePlansAsync(CancellationToken)
Create multiple plans
This action provides the abillity to create multiple plans with a single API request.
Accepted attributes:
- count (Integer) The number of plans to create. (max 12, default 1)
- copy_items (Boolean) Copy Items from another plan. (default false)
- copy_people (Boolean) Copy People from another plan. (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)
- copy_notes (Boolean) Copy Notes from another plan. (default false)
- as_template (Boolean) Create the new plans as templates (default false)
- base_date (ISO 8601 Date) The date from which to start building the plans. (default false)
Accepted Relationships
- plan (optional) The plan from which to copy times, items, people, and notes
- template (optional) Collection of templates from which to copy items, people, and notes (not times) for each new plan.
Order dependant. Takes precedence over plan.
public Task CreatePlansAsync(CancellationToken cancellationToken = default)
Parameters
cancellationTokenCancellationToken
Returns
DeleteAsync(CancellationToken)
Deletes the ServiceType 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 ServiceType resource asynchronously.
public Task<ServiceTypeResponse> GetAsync(CancellationToken cancellationToken = default)
Parameters
cancellationTokenCancellationTokenA token to monitor for cancellation requests.
Returns
- Task<ServiceTypeResponse>
A task representing the asynchronous operation, containing the ServiceType resource.
Exceptions
- JsonApiException
Thrown when the HTTP response indicates a failure status code.
IncludeTimePreferenceOptions()
Include related TimePreferenceOptions resources in the response.
public ServiceTypeClient IncludeTimePreferenceOptions()
Returns
PatchAsync(ServiceType, CancellationToken)
Updates an existing ServiceType resource asynchronously.
public Task<ServiceTypeResponse> PatchAsync(ServiceType resource, CancellationToken cancellationToken = default)
Parameters
resourceServiceTypeThe resource data to be sent in the patch request.
cancellationTokenCancellationTokenA token to monitor for cancellation requests.
Returns
- Task<ServiceTypeResponse>
A task representing the asynchronous operation, containing the updated ServiceType resource.
Exceptions
- JsonApiException
Thrown when the HTTP response indicates a failure status code.
PatchAsync(JsonApiDocument<ServiceTypeResource>, CancellationToken)
Updates an existing ServiceType resource asynchronously.
public Task<ServiceTypeResponse> PatchAsync(JsonApiDocument<ServiceTypeResource> document, CancellationToken cancellationToken = default)
Parameters
documentJsonApiDocument<ServiceTypeResource>The JSON:API document to be sent in the patch request.
cancellationTokenCancellationTokenA token to monitor for cancellation requests.
Returns
- Task<ServiceTypeResponse>
A task representing the asynchronous operation, containing the updated ServiceType resource.
Exceptions
- JsonApiException
Thrown when the HTTP response indicates a failure status code.