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