Class PaginatedMembershipClient
- Namespace
- Crews.PlanningCenter.Api.Groups.V2018_08_01
- Assembly
- Crews.PlanningCenter.Api.dll
Client for interacting with Membership collection resources.
public class PaginatedMembershipClient : PaginatedResourceClient<Membership, MembershipResource, MembershipCollectionResponse, MembershipResponse>
- Inheritance
-
PaginatedResourceClient<Membership, MembershipResource, MembershipCollectionResponse, MembershipResponse>PaginatedMembershipClient
- Inherited Members
Constructors
PaginatedMembershipClient(HttpClient, Uri)
Client for interacting with Membership collection resources.
public PaginatedMembershipClient(HttpClient httpClient, Uri uri)
Parameters
httpClientHttpClienturiUri
Methods
AddCustomParameter(string, string)
Adds a custom query parameter to the request URI.
public PaginatedMembershipClient AddCustomParameter(string parameter, string value)
Parameters
Returns
- PaginatedMembershipClient
The current PaginatedMembershipClient instance.
ClearParameters()
Removes the entire query string from the request URI.
public PaginatedMembershipClient ClearParameters()
Returns
- PaginatedMembershipClient
The current PaginatedMembershipClient instance.
Filter(string)
Adds a filter query parameter to the request.
public PaginatedMembershipClient Filter(string filter)
Parameters
filterstringThe filter criteria.
Returns
- PaginatedMembershipClient
The current PaginatedMembershipClient instance.
Remarks
See Planning Center API documentation for details on supported filter values for this resource.
GetAsync(CancellationToken)
Fetches a paginated list of Membership resources asynchronously.
public Task<MembershipCollectionResponse> GetAsync(CancellationToken cancellationToken = default)
Parameters
cancellationTokenCancellationTokenA token to monitor for cancellation requests.
Returns
- Task<MembershipCollectionResponse>
A task representing the asynchronous operation, containing a paginated list of Membership resources.
Exceptions
- JsonApiException
Thrown when the HTTP response indicates a failure status code.
IncludePerson()
Include related Person resources in the response.
public MembershipClient IncludePerson()
Returns
Offset(int)
Sets the item offset in the paginated response.
public PaginatedMembershipClient Offset(int count)
Parameters
countintThe number of items to skip.
Returns
- PaginatedMembershipClient
The current PaginatedMembershipClient instance.
OrderByFirstName()
Sort response items by the FirstName attribute.
public MembershipClient OrderByFirstName()
Returns
OrderByFirstNameDescending()
Sort response items by the FirstName attribute. Use reverse order.
public MembershipClient OrderByFirstNameDescending()
Returns
OrderByJoinedAt()
Sort response items by the JoinedAt attribute.
public MembershipClient OrderByJoinedAt()
Returns
OrderByJoinedAtDescending()
Sort response items by the JoinedAt attribute. Use reverse order.
public MembershipClient OrderByJoinedAtDescending()
Returns
OrderByLastName()
Sort response items by the LastName attribute.
public MembershipClient OrderByLastName()
Returns
OrderByLastNameDescending()
Sort response items by the LastName attribute. Use reverse order.
public MembershipClient OrderByLastNameDescending()
Returns
OrderByRole()
Sort response items by the Role attribute.
public MembershipClient OrderByRole()
Returns
OrderByRoleDescending()
Sort response items by the Role attribute. Use reverse order.
public MembershipClient OrderByRoleDescending()
Returns
PerPage(int)
Sets the number of items to be returned per page in the paginated response.
public PaginatedMembershipClient PerPage(int count)
Parameters
countintThe number of items to be returned per page.
Returns
- PaginatedMembershipClient
The current PaginatedMembershipClient instance.
PostAsync(Membership, CancellationToken)
Creates a new Membership resource asynchronously.
public Task<MembershipResponse> PostAsync(Membership resource, CancellationToken cancellationToken = default)
Parameters
resourceMembershipThe resource data to be sent in the POST request.
cancellationTokenCancellationTokenA token to monitor for cancellation requests.
Returns
- Task<MembershipResponse>
A task representing the asynchronous operation, containing the created Membership resource.
Exceptions
- JsonApiException
Thrown when the HTTP response indicates a failure status code.
PostAsync(JsonApiDocument<MembershipResource>, CancellationToken)
Creates a new Membership resource asynchronously.
public Task<MembershipResponse> PostAsync(JsonApiDocument<MembershipResource> document, CancellationToken cancellationToken = default)
Parameters
documentJsonApiDocument<MembershipResource>The JSON:API document to be sent in the POST request.
cancellationTokenCancellationTokenA token to monitor for cancellation requests.
Returns
- Task<MembershipResponse>
A task representing the asynchronous operation, containing the created Membership resource.
Exceptions
- JsonApiException
Thrown when the HTTP response indicates a failure status code.
WhereRole(string)
Query response items by the Role attribute.
public MembershipClient WhereRole(string value)
Parameters
valuestring
Returns
WithId(string)
Creates a new instance of a Membership client for a specific resource ID.
public MembershipClient WithId(string id)
Parameters
idstringThe ID of the resource to create a client for.
Returns
- MembershipClient
A new instance of the resource client for the specified resource ID.