Table of Contents

Class BatchClient

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

Client for interacting with the Batch resource.

public class BatchClient : SingletonResourceClient<Batch, BatchResource, BatchResponse>
Inheritance
BatchClient
Inherited Members

Constructors

BatchClient(HttpClient, Uri)

Client for interacting with the Batch resource.

public BatchClient(HttpClient httpClient, Uri uri)

Parameters

httpClient HttpClient
uri Uri

Properties

BatchGroup

Associated BatchGroup.

public BatchGroupClient BatchGroup { get; }

Property Value

BatchGroupClient

Donations

Associated Donations.

public PaginatedDonationClient Donations { get; }

Property Value

PaginatedDonationClient

Owner

Associated Owner.

public PersonClient Owner { get; }

Property Value

PersonClient

Methods

CommitAsync(CancellationToken)

Used to commit an in progress batch.
This action takes an uncommitted Batch and commits it.
It will respond with unprocessable_entity if the Batch cannot be committed.

It does not expect a body.

Committing a Batch happens asyncronously, so initially the Batch's status will be updating.
You can poll that Batch's endpoint to see whether it's changed from updating to committed.

public Task CommitAsync(CancellationToken cancellationToken = default)

Parameters

cancellationToken CancellationToken

Returns

Task

DeleteAsync(CancellationToken)

Deletes the Batch 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 Batch resource asynchronously.

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

Parameters

cancellationToken CancellationToken

A token to monitor for cancellation requests.

Returns

Task<BatchResponse>

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

Exceptions

JsonApiException

Thrown when the HTTP response indicates a failure status code.

IncludeBatchGroup()

Include related BatchGroup resources in the response.

public BatchClient IncludeBatchGroup()

Returns

BatchClient

IncludeOwner()

Include related Owner resources in the response.

public BatchClient IncludeOwner()

Returns

BatchClient

PatchAsync(Batch, CancellationToken)

Updates an existing Batch resource asynchronously.

public Task<BatchResponse> PatchAsync(Batch resource, CancellationToken cancellationToken = default)

Parameters

resource Batch

The resource data to be sent in the patch request.

cancellationToken CancellationToken

A token to monitor for cancellation requests.

Returns

Task<BatchResponse>

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

Exceptions

JsonApiException

Thrown when the HTTP response indicates a failure status code.

PatchAsync(JsonApiDocument<BatchResource>, CancellationToken)

Updates an existing Batch resource asynchronously.

public Task<BatchResponse> PatchAsync(JsonApiDocument<BatchResource> document, CancellationToken cancellationToken = default)

Parameters

document JsonApiDocument<BatchResource>

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

cancellationToken CancellationToken

A token to monitor for cancellation requests.

Returns

Task<BatchResponse>

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

Exceptions

JsonApiException

Thrown when the HTTP response indicates a failure status code.