Class BatchClient
- Namespace
- Crews.PlanningCenter.Api.Giving.V2019_10_18
- 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
httpClientHttpClienturiUri
Properties
BatchGroup
Associated BatchGroup.
public BatchGroupClient BatchGroup { get; }
Property Value
Donations
Associated Donations.
public PaginatedDonationClient Donations { get; }
Property Value
Owner
Associated Owner.
public PersonClient Owner { get; }
Property Value
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
cancellationTokenCancellationToken
Returns
DeleteAsync(CancellationToken)
Deletes the Batch 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 Batch resource asynchronously.
public Task<BatchResponse> GetAsync(CancellationToken cancellationToken = default)
Parameters
cancellationTokenCancellationTokenA 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
IncludeOwner()
Include related Owner resources in the response.
public BatchClient IncludeOwner()
Returns
PatchAsync(Batch, CancellationToken)
Updates an existing Batch resource asynchronously.
public Task<BatchResponse> PatchAsync(Batch resource, CancellationToken cancellationToken = default)
Parameters
resourceBatchThe resource data to be sent in the patch request.
cancellationTokenCancellationTokenA 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
documentJsonApiDocument<BatchResource>The JSON:API document to be sent in the patch request.
cancellationTokenCancellationTokenA 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.