-
Notifications
You must be signed in to change notification settings - Fork 2
Resource ElectionResource
CrucifiedPain edited this page Jun 26, 2026
·
10 revisions
Endpoints: • election.getElections (cursor-paginated)
Fetch all items across all pages concurrently using parallel time-slicing.
await client.election.collect_all(**kwargs: 'typing.Any') -> 'list[Election]'| Name | Type | Default |
|---|---|---|
kwargs |
Any |
*Required* |
An election event in a country.
| Field | Type | Required | Description |
|---|---|---|---|
_id |
string |
Optional | |
__v |
integer |
Optional | |
country |
string |
Optional | The UUID of the country this user holds citizenship in. |
electedCandidates |
array[string] |
Optional | |
isActive |
boolean |
Optional | |
type |
string |
Optional | The type. |
candidates |
array[ElectionCandidate] |
Optional | The candidates. |
votesStartAt |
string |
Optional | |
votesEndAt |
string |
Optional | |
votesCount |
integer |
Optional | |
electedCount |
integer |
Optional | |
createdAt |
string |
Optional | The timestamp when this record was created. |
status |
string |
Optional | The status. |
votes |
object |
Optional | The votes. |
A candidate in an election.
| Field | Type | Required | Description |
|---|---|---|---|
user |
string |
Optional | |
voteCount |
integer |
Optional | |
article |
string |
Optional | |
party |
string |
Optional | |
isElected |
boolean |
Optional |
Convenience: fetch all elections in a given country.
await client.election.get_by_country(country_id: 'str') -> 'list[Election]'| Name | Type | Default |
|---|---|---|
country_id |
str |
*Required* |
An election event in a country.
| Field | Type | Required | Description |
|---|---|---|---|
_id |
string |
Optional | |
__v |
integer |
Optional | |
country |
string |
Optional | The UUID of the country this user holds citizenship in. |
electedCandidates |
array[string] |
Optional | |
isActive |
boolean |
Optional | |
type |
string |
Optional | The type. |
candidates |
array[ElectionCandidate] |
Optional | The candidates. |
votesStartAt |
string |
Optional | |
votesEndAt |
string |
Optional | |
votesCount |
integer |
Optional | |
electedCount |
integer |
Optional | |
createdAt |
string |
Optional | The timestamp when this record was created. |
status |
string |
Optional | The status. |
votes |
object |
Optional | The votes. |
A candidate in an election.
| Field | Type | Required | Description |
|---|---|---|---|
user |
string |
Optional | |
voteCount |
integer |
Optional | |
article |
string |
Optional | |
party |
string |
Optional | |
isElected |
boolean |
Optional |
Get elections (cursor-paginated), optionally filtered by country.
Args:
country_id: Filter to elections in this country.
direction: "forward" (default) or "backward" pagination.
await client.election.get_paginated(*, country_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[Election] | AsyncIterator[Election]'| Name | Type | Default |
|---|---|---|
country_id |
str |
None |
limit |
int |
20 |
cursor |
str |
None |
direction |
str |
None |
auto_items |
bool |
False |
max_pages |
int | float |
inf |
cursor_end |
str |
None |
| Field | Type | Required | Description |
|---|---|---|---|
_id |
string |
Optional | |
__v |
integer |
Optional | |
items |
array[Election] |
Required | |
nextCursor |
string |
Optional | |
hasMore |
boolean |
Optional |
An election event in a country.
| Field | Type | Required | Description |
|---|---|---|---|
_id |
string |
Optional | |
__v |
integer |
Optional | |
country |
string |
Optional | The UUID of the country this user holds citizenship in. |
electedCandidates |
array[string] |
Optional | |
isActive |
boolean |
Optional | |
type |
string |
Optional | The type. |
candidates |
array[ElectionCandidate] |
Optional | The candidates. |
votesStartAt |
string |
Optional | |
votesEndAt |
string |
Optional | |
votesCount |
integer |
Optional | |
electedCount |
integer |
Optional | |
createdAt |
string |
Optional | The timestamp when this record was created. |
status |
string |
Optional | The status. |
votes |
object |
Optional | The votes. |
A candidate in an election.
| Field | Type | Required | Description |
|---|---|---|---|
user |
string |
Optional | |
voteCount |
integer |
Optional | |
article |
string |
Optional | |
party |
string |
Optional | |
isElected |
boolean |
Optional |
Clear the SWR cache for all resources.
await client.election.invalidate_cache() -> 'None'- action_log
- alliance
- article
- battle
- battle_loot_summary
- battle_order
- battle_ranking
- company
- country
- donation
- election
- event
- game_config
- game_stat
- government
- inventory
- item_trading
- mercenary_contract_auction
- mu
- mu_member
- party
- ranking
- region
- round
- search
- tournament
- transaction
- upgrade
- user
- work
- work_offer
- worker