PartyResource (client.party)¶
Endpoints: • party.getById • party.getManyPaginated (cursor-paginated)
.collect_all()¶
Fetch all items across all pages concurrently using parallel time-slicing.
Signature¶
await client.party.collect_all(**kwargs: 'typing.Any') -> 'list[Party]'
Parameters¶
| Name | Type | Default |
|---|---|---|
kwargs |
Any |
Required |
Return Models¶
Party¶
A political party in WarEra.
| Field | Type | Required |
|---|---|---|
_id |
string |
Optional |
__v |
integer |
Optional |
name |
string |
Optional |
description |
string |
Optional |
country |
string |
Optional |
region |
string |
Optional |
leader |
string |
Optional |
councilMembers |
array[string] |
Optional |
members |
array[string] |
Optional |
ethics |
PartyEthics |
Optional |
avatarUrl |
string |
Optional |
treasurer |
string |
Optional |
primaryWinner |
string |
Optional |
createdAt |
string |
Optional |
updatedAt |
string |
Optional |
PartyEthics¶
Ethics alignment values for a political party.
| Field | Type | Required |
|---|---|---|
_id |
string |
Optional |
__v |
integer |
Optional |
unethical |
boolean |
Optional |
militarism |
number |
Optional |
isolationism |
number |
Optional |
imperialism |
number |
Optional |
industrialism |
number |
Optional |
.get()¶
Get a single political party by ID.
Signature¶
await client.party.get(party_id: 'str') -> 'Party'
Parameters¶
| Name | Type | Default |
|---|---|---|
party_id |
str |
Required |
Return Models¶
Party¶
A political party in WarEra.
| Field | Type | Required |
|---|---|---|
_id |
string |
Optional |
__v |
integer |
Optional |
name |
string |
Optional |
description |
string |
Optional |
country |
string |
Optional |
region |
string |
Optional |
leader |
string |
Optional |
councilMembers |
array[string] |
Optional |
members |
array[string] |
Optional |
ethics |
PartyEthics |
Optional |
avatarUrl |
string |
Optional |
treasurer |
string |
Optional |
primaryWinner |
string |
Optional |
createdAt |
string |
Optional |
updatedAt |
string |
Optional |
PartyEthics¶
Ethics alignment values for a political party.
| Field | Type | Required |
|---|---|---|
_id |
string |
Optional |
__v |
integer |
Optional |
unethical |
boolean |
Optional |
militarism |
number |
Optional |
isolationism |
number |
Optional |
imperialism |
number |
Optional |
industrialism |
number |
Optional |
.get_by_country()¶
Convenience: fetch all parties in a given country.
Signature¶
await client.party.get_by_country(country_id: 'str') -> 'list[Party]'
Parameters¶
| Name | Type | Default |
|---|---|---|
country_id |
str |
Required |
Return Models¶
Party¶
A political party in WarEra.
| Field | Type | Required |
|---|---|---|
_id |
string |
Optional |
__v |
integer |
Optional |
name |
string |
Optional |
description |
string |
Optional |
country |
string |
Optional |
region |
string |
Optional |
leader |
string |
Optional |
councilMembers |
array[string] |
Optional |
members |
array[string] |
Optional |
ethics |
PartyEthics |
Optional |
avatarUrl |
string |
Optional |
treasurer |
string |
Optional |
primaryWinner |
string |
Optional |
createdAt |
string |
Optional |
updatedAt |
string |
Optional |
PartyEthics¶
Ethics alignment values for a political party.
| Field | Type | Required |
|---|---|---|
_id |
string |
Optional |
__v |
integer |
Optional |
unethical |
boolean |
Optional |
militarism |
number |
Optional |
isolationism |
number |
Optional |
imperialism |
number |
Optional |
industrialism |
number |
Optional |
.get_paginated()¶
Get political parties (cursor-paginated), optionally filtered by country.
Args:
country_id: Filter to parties in this country.
direction: "forward" (default) or "backward" pagination.
Signature¶
await client.party.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[Party] | AsyncIterator[Party]'
Parameters¶
| 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 |
Return Models¶
CursorPage[Party]¶
| Field | Type | Required |
|---|---|---|
_id |
string |
Optional |
__v |
integer |
Optional |
items |
array[Party] |
Required |
nextCursor |
string |
Optional |
hasMore |
boolean |
Optional |
Party¶
A political party in WarEra.
| Field | Type | Required |
|---|---|---|
_id |
string |
Optional |
__v |
integer |
Optional |
name |
string |
Optional |
description |
string |
Optional |
country |
string |
Optional |
region |
string |
Optional |
leader |
string |
Optional |
councilMembers |
array[string] |
Optional |
members |
array[string] |
Optional |
ethics |
PartyEthics |
Optional |
avatarUrl |
string |
Optional |
treasurer |
string |
Optional |
primaryWinner |
string |
Optional |
createdAt |
string |
Optional |
updatedAt |
string |
Optional |
PartyEthics¶
Ethics alignment values for a political party.
| Field | Type | Required |
|---|---|---|
_id |
string |
Optional |
__v |
integer |
Optional |
unethical |
boolean |
Optional |
militarism |
number |
Optional |
isolationism |
number |
Optional |
imperialism |
number |
Optional |
industrialism |
number |
Optional |
.invalidate_cache()¶
Clear the SWR cache for all resources.
Signature¶
await client.party.invalidate_cache() -> 'None'