Table of Contents

Class PaginatedServiceTypeClient

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

Client for interacting with ServiceType collection resources.

public class PaginatedServiceTypeClient : PaginatedResourceClient<ServiceType, ServiceTypeResource, ServiceTypeCollectionResponse, ServiceTypeResponse>
Inheritance
PaginatedServiceTypeClient
Inherited Members

Constructors

PaginatedServiceTypeClient(HttpClient, Uri)

Client for interacting with ServiceType collection resources.

public PaginatedServiceTypeClient(HttpClient httpClient, Uri uri)

Parameters

httpClient HttpClient
uri Uri

Methods

AddCustomParameter(string, string)

Adds a custom query parameter to the request URI.

public PaginatedServiceTypeClient AddCustomParameter(string parameter, string value)

Parameters

parameter string

The name of the query parameter.

value string

The value of the query parameter.

Returns

PaginatedServiceTypeClient

The current PaginatedServiceTypeClient instance.

ClearParameters()

Removes the entire query string from the request URI.

public PaginatedServiceTypeClient ClearParameters()

Returns

PaginatedServiceTypeClient

The current PaginatedServiceTypeClient instance.

Filter(string)

Adds a filter query parameter to the request.

public PaginatedServiceTypeClient Filter(string filter)

Parameters

filter string

The filter criteria.

Returns

PaginatedServiceTypeClient

The current PaginatedServiceTypeClient instance.

Remarks

See Planning Center API documentation for details on supported filter values for this resource.

GetAsync(CancellationToken)

Fetches a paginated list of ServiceType resources asynchronously.

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

Parameters

cancellationToken CancellationToken

A token to monitor for cancellation requests.

Returns

Task<ServiceTypeCollectionResponse>

A task representing the asynchronous operation, containing a paginated list of ServiceType resources.

Exceptions

JsonApiException

Thrown when the HTTP response indicates a failure status code.

IncludeTimePreferenceOptions()

Include related TimePreferenceOptions resources in the response.

public ServiceTypeClient IncludeTimePreferenceOptions()

Returns

ServiceTypeClient

Offset(int)

Sets the item offset in the paginated response.

public PaginatedServiceTypeClient Offset(int count)

Parameters

count int

The number of items to skip.

Returns

PaginatedServiceTypeClient

The current PaginatedServiceTypeClient instance.

OrderByName()

Sort response items by the Name attribute.

public ServiceTypeClient OrderByName()

Returns

ServiceTypeClient

OrderByNameDescending()

Sort response items by the Name attribute. Use reverse order.

public ServiceTypeClient OrderByNameDescending()

Returns

ServiceTypeClient

OrderBySequence()

Sort response items by the Sequence attribute.

public ServiceTypeClient OrderBySequence()

Returns

ServiceTypeClient

OrderBySequenceDescending()

Sort response items by the Sequence attribute. Use reverse order.

public ServiceTypeClient OrderBySequenceDescending()

Returns

ServiceTypeClient

PerPage(int)

Sets the number of items to be returned per page in the paginated response.

public PaginatedServiceTypeClient PerPage(int count)

Parameters

count int

The number of items to be returned per page.

Returns

PaginatedServiceTypeClient

The current PaginatedServiceTypeClient instance.

PostAsync(ServiceType, CancellationToken)

Creates a new ServiceType resource asynchronously.

public Task<ServiceTypeResponse> PostAsync(ServiceType resource, CancellationToken cancellationToken = default)

Parameters

resource ServiceType

The resource data to be sent in the POST request.

cancellationToken CancellationToken

A token to monitor for cancellation requests.

Returns

Task<ServiceTypeResponse>

A task representing the asynchronous operation, containing the created ServiceType resource.

Exceptions

JsonApiException

Thrown when the HTTP response indicates a failure status code.

PostAsync(JsonApiDocument<ServiceTypeResource>, CancellationToken)

Creates a new ServiceType resource asynchronously.

public Task<ServiceTypeResponse> PostAsync(JsonApiDocument<ServiceTypeResource> document, CancellationToken cancellationToken = default)

Parameters

document JsonApiDocument<ServiceTypeResource>

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

cancellationToken CancellationToken

A token to monitor for cancellation requests.

Returns

Task<ServiceTypeResponse>

A task representing the asynchronous operation, containing the created ServiceType resource.

Exceptions

JsonApiException

Thrown when the HTTP response indicates a failure status code.

WhereId(string)

Query response items by the Id attribute.

public ServiceTypeClient WhereId(string value)

Parameters

value string

Returns

ServiceTypeClient

WhereName(string)

Query response items by the Name attribute.

public ServiceTypeClient WhereName(string value)

Parameters

value string

Returns

ServiceTypeClient

WhereParentId(int)

Query response items by the ParentId attribute.

public ServiceTypeClient WhereParentId(int value)

Parameters

value int

Returns

ServiceTypeClient

WithId(string)

Creates a new instance of a ServiceType client for a specific resource ID.

public ServiceTypeClient WithId(string id)

Parameters

id string

The ID of the resource to create a client for.

Returns

ServiceTypeClient

A new instance of the resource client for the specified resource ID.