Skip to content

Resource DonationResource

CrucifiedPain edited this page Jun 26, 2026 · 10 revisions

DonationResource (client.donation)

Endpoints: • donation.getManyPaginated (cursor-paginated) • donation.getTotalDonations

.collect_all()

Fetch all items across all pages concurrently using parallel time-slicing.

Signature

await client.donation.collect_all(**kwargs: 'typing.Any') -> 'list[Donation]'

Parameters

Name Type Default
kwargs Any *Required*

Return Models

Donation

A donation made to a military unit, country, or party.

Field Type Required Description
_id string \| null
__v integer \| null
userId string \| null
muId string \| null
countryId string \| null
partyId string \| null
amount number \| null
createdAt string \| null
updatedAt string \| null

.get_paginated()

Get donations (cursor-paginated), filtered by target entity.

At least one of mu_id, country_id, or party_id is recommended.

Args: direction: "forward" (default) or "backward" pagination.

Signature

await client.donation.get_paginated(*, mu_id: 'str | None' = None, country_id: 'str | None' = None, party_id: 'str | None' = None, limit: 'int' = 20, cursor: 'str | None' = None, direction: 'str | None' = None, auto_items: 'bool' = False, max_pages: 'int | float' = inf, cursor_end: 'str | None' = None) -> 'CursorPage[Donation] | AsyncIterator[Donation]'

Parameters

Name Type Default
mu_id str | None None
country_id str | None None
party_id str | None None
limit int 20
cursor str | None None
direction str | None None
auto_items bool False
max_pages int | float inf
cursor_end str | None None

Return Models

CursorPage[Donation]

Field Type Required Description
_id string \| null
__v integer \| null
items array[Donation]
nextCursor string \| null
hasMore boolean

Donation

A donation made to a military unit, country, or party.

Field Type Required Description
_id string \| null
__v integer \| null
userId string \| null
muId string \| null
countryId string \| null
partyId string \| null
amount number \| null
createdAt string \| null
updatedAt string \| null

.get_totals()

Get aggregate donation totals (total amount and donor count) for a target.

Args: mu_id: Military unit to aggregate for. country_id: Country to aggregate for. party_id: Party to aggregate for.

Signature

await client.donation.get_totals(*, mu_id: 'str | None' = None, country_id: 'str | None' = None, party_id: 'str | None' = None) -> 'DonationTotals'

Parameters

Name Type Default
mu_id str | None None
country_id str | None None
party_id str | None None

Return Models

DonationTotals

Aggregate donation totals for a target.

Field Type Required Description
_id string \| null
__v integer \| null
totalAmount number \| null
donorCount integer \| null

.invalidate_cache()

Clear the SWR cache for all resources.

Signature

await client.donation.invalidate_cache() -> 'None'

Clone this wiki locally