Class DonationClient
- Namespace
- Crews.PlanningCenter.Api.Giving.V2019_10_18
- Assembly
- Crews.PlanningCenter.Api.dll
Client for interacting with the Donation resource.
public class DonationClient : SingletonResourceClient<Donation, DonationResource, DonationResponse>
- Inheritance
-
DonationClient
- Inherited Members
Constructors
DonationClient(HttpClient, Uri)
Client for interacting with the Donation resource.
public DonationClient(HttpClient httpClient, Uri uri)
Parameters
httpClientHttpClienturiUri
Properties
Campus
Associated Campus.
public PaginatedCampusClient Campus { get; }
Property Value
Designations
Associated Designations.
public PaginatedDesignationClient Designations { get; }
Property Value
Labels
Associated Labels.
public PaginatedLabelClient Labels { get; }
Property Value
Note
Associated Note.
public NoteClient Note { get; }
Property Value
Refund
Associated Refund.
public RefundClient Refund { get; }
Property Value
Methods
DeleteAsync(CancellationToken)
Deletes the Donation 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 Donation resource asynchronously.
public Task<DonationResponse> GetAsync(CancellationToken cancellationToken = default)
Parameters
cancellationTokenCancellationTokenA token to monitor for cancellation requests.
Returns
- Task<DonationResponse>
A task representing the asynchronous operation, containing the Donation resource.
Exceptions
- JsonApiException
Thrown when the HTTP response indicates a failure status code.
IncludeDesignations()
Include related Designations resources in the response.
public DonationClient IncludeDesignations()
Returns
IncludeLabels()
Include related Labels resources in the response.
public DonationClient IncludeLabels()
Returns
IncludeNote()
Include related Note resources in the response.
public DonationClient IncludeNote()
Returns
IncludeRefund()
Include related Refund resources in the response.
public DonationClient IncludeRefund()
Returns
IssueRefundAsync(CancellationToken)
Used to refund a batch donation
This action refunds a batch donation.
It will respond with unprocessable_entity if the donation cannot be refunded, or if the donation is not part of a batch.refunded_at is optional, but recommended for data accuracy.<code>json<br />{<br /> "data": {<br /> "attributes": {<br /> "refunded_at": "1959-02-03"<br /> }<br /> }<br />}<br /></code>
public Task IssueRefundAsync(CancellationToken cancellationToken = default)
Parameters
cancellationTokenCancellationToken
Returns
PatchAsync(Donation, CancellationToken)
Updates an existing Donation resource asynchronously.
public Task<DonationResponse> PatchAsync(Donation resource, CancellationToken cancellationToken = default)
Parameters
resourceDonationThe resource data to be sent in the patch request.
cancellationTokenCancellationTokenA token to monitor for cancellation requests.
Returns
- Task<DonationResponse>
A task representing the asynchronous operation, containing the updated Donation resource.
Exceptions
- JsonApiException
Thrown when the HTTP response indicates a failure status code.
PatchAsync(JsonApiDocument<DonationResource>, CancellationToken)
Updates an existing Donation resource asynchronously.
public Task<DonationResponse> PatchAsync(JsonApiDocument<DonationResource> document, CancellationToken cancellationToken = default)
Parameters
documentJsonApiDocument<DonationResource>The JSON:API document to be sent in the patch request.
cancellationTokenCancellationTokenA token to monitor for cancellation requests.
Returns
- Task<DonationResponse>
A task representing the asynchronous operation, containing the updated Donation resource.
Exceptions
- JsonApiException
Thrown when the HTTP response indicates a failure status code.