resources
Monzo API 'accounts' resource.
AccountsResource
dataclass
Bases: BaseResource
Monzo API 'accounts' resource.
Note
Monzo API docs: https://docs.monzo.com/#accounts
Source code in pymonzo/accounts/resources.py
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 | |
get_default_account()
If the user has only one active account, treat it as the default account.
Returns:
| Type | Description |
|---|---|
MonzoAccount
|
User's active account. |
Raises:
| Type | Description |
|---|---|
CannotDetermineDefaultAccount
|
If user has more than one active account. |
Source code in pymonzo/accounts/resources.py
21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 | |
list(*, refresh=False)
Return a list of user's Monzo accounts.
It's often used when deciding whether to require explicit account ID or use the only active one, so we cache the response by default.
Note
Monzo API docs: https://docs.monzo.com/#list-accounts
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
refresh |
bool
|
Whether to refresh the cached list of accounts. |
False
|
Returns:
| Type | Description |
|---|---|
List[MonzoAccount]
|
A list of user's Monzo accounts. |
Source code in pymonzo/accounts/resources.py
47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 | |