Class PaginatedPledgeClient
- Namespace
- Crews.PlanningCenter.Api.Giving.V2019_10_18
- Assembly
- Crews.PlanningCenter.Api.dll
Client for interacting with Pledge collection resources.
public class PaginatedPledgeClient : PaginatedResourceClient<Pledge, PledgeResource, PledgeCollectionResponse, PledgeResponse>
- Inheritance
-
PaginatedPledgeClient
- Inherited Members
Constructors
PaginatedPledgeClient(HttpClient, Uri)
Client for interacting with Pledge collection resources.
public PaginatedPledgeClient(HttpClient httpClient, Uri uri)
Parameters
httpClientHttpClienturiUri
Methods
AddCustomParameter(string, string)
Adds a custom query parameter to the request URI.
public PaginatedPledgeClient AddCustomParameter(string parameter, string value)
Parameters
Returns
- PaginatedPledgeClient
The current PaginatedPledgeClient instance.
ClearParameters()
Removes the entire query string from the request URI.
public PaginatedPledgeClient ClearParameters()
Returns
- PaginatedPledgeClient
The current PaginatedPledgeClient instance.
Filter(string)
Adds a filter query parameter to the request.
public PaginatedPledgeClient Filter(string filter)
Parameters
filterstringThe filter criteria.
Returns
- PaginatedPledgeClient
The current PaginatedPledgeClient instance.
Remarks
See Planning Center API documentation for details on supported filter values for this resource.
GetAsync(CancellationToken)
Fetches a paginated list of Pledge resources asynchronously.
public Task<PledgeCollectionResponse> GetAsync(CancellationToken cancellationToken = default)
Parameters
cancellationTokenCancellationTokenA token to monitor for cancellation requests.
Returns
- Task<PledgeCollectionResponse>
A task representing the asynchronous operation, containing a paginated list of Pledge resources.
Exceptions
- JsonApiException
Thrown when the HTTP response indicates a failure status code.
IncludeJointGiver()
Include related JointGiver resources in the response.
public PledgeClient IncludeJointGiver()
Returns
IncludePledgeCampaign()
Include related PledgeCampaign resources in the response.
public PledgeClient IncludePledgeCampaign()
Returns
Offset(int)
Sets the item offset in the paginated response.
public PaginatedPledgeClient Offset(int count)
Parameters
countintThe number of items to skip.
Returns
- PaginatedPledgeClient
The current PaginatedPledgeClient instance.
OrderByCreatedAt()
Sort response items by the CreatedAt attribute.
public PledgeClient OrderByCreatedAt()
Returns
OrderByCreatedAtDescending()
Sort response items by the CreatedAt attribute. Use reverse order.
public PledgeClient OrderByCreatedAtDescending()
Returns
OrderByUpdatedAt()
Sort response items by the UpdatedAt attribute.
public PledgeClient OrderByUpdatedAt()
Returns
OrderByUpdatedAtDescending()
Sort response items by the UpdatedAt attribute. Use reverse order.
public PledgeClient OrderByUpdatedAtDescending()
Returns
PerPage(int)
Sets the number of items to be returned per page in the paginated response.
public PaginatedPledgeClient PerPage(int count)
Parameters
countintThe number of items to be returned per page.
Returns
- PaginatedPledgeClient
The current PaginatedPledgeClient instance.
PostAsync(Pledge, CancellationToken)
Creates a new Pledge resource asynchronously.
public Task<PledgeResponse> PostAsync(Pledge resource, CancellationToken cancellationToken = default)
Parameters
resourcePledgeThe resource data to be sent in the POST request.
cancellationTokenCancellationTokenA token to monitor for cancellation requests.
Returns
- Task<PledgeResponse>
A task representing the asynchronous operation, containing the created Pledge resource.
Exceptions
- JsonApiException
Thrown when the HTTP response indicates a failure status code.
PostAsync(JsonApiDocument<PledgeResource>, CancellationToken)
Creates a new Pledge resource asynchronously.
public Task<PledgeResponse> PostAsync(JsonApiDocument<PledgeResource> document, CancellationToken cancellationToken = default)
Parameters
documentJsonApiDocument<PledgeResource>The JSON:API document to be sent in the POST request.
cancellationTokenCancellationTokenA token to monitor for cancellation requests.
Returns
- Task<PledgeResponse>
A task representing the asynchronous operation, containing the created Pledge resource.
Exceptions
- JsonApiException
Thrown when the HTTP response indicates a failure status code.
WhereCreatedAt(DateTime)
Query response items by the CreatedAt attribute.
public PledgeClient WhereCreatedAt(DateTime value)
Parameters
valueDateTime
Returns
WhereUpdatedAt(DateTime)
Query response items by the UpdatedAt attribute.
public PledgeClient WhereUpdatedAt(DateTime value)
Parameters
valueDateTime
Returns
WithId(string)
Creates a new instance of a Pledge client for a specific resource ID.
public PledgeClient WithId(string id)
Parameters
idstringThe ID of the resource to create a client for.
Returns
- PledgeClient
A new instance of the resource client for the specified resource ID.