|
6 | 6 | ) |
7 | 7 |
|
8 | 8 | import requests |
9 | | -from typing import List, Optional, Union |
| 9 | +from typing import Any, Dict, List, Union |
10 | 10 | from seamapi.utils.convert_to_id import to_connected_account_id |
11 | 11 |
|
12 | 12 |
|
@@ -61,13 +61,14 @@ def list(self) -> List[ConnectedAccount]: |
61 | 61 | ) |
62 | 62 | if not res.ok: |
63 | 63 | raise Exception(res.text) |
64 | | - json_accounts = res.json()["connected_accounts"] |
| 64 | + json_accounts: List[Dict[str, Any]] = res.json()["connected_accounts"] |
65 | 65 | return [ |
66 | 66 | ConnectedAccount( |
67 | 67 | connected_account_id=json_account["connected_account_id"], |
68 | 68 | created_at=json_account["created_at"], |
69 | 69 | user_identifier=json_account["user_identifier"], |
70 | 70 | account_type=json_account["account_type"], |
| 71 | + errors=json_account.get("errors", []), |
71 | 72 | ) |
72 | 73 | for json_account in json_accounts |
73 | 74 | ] |
@@ -101,10 +102,11 @@ def get( |
101 | 102 | ) |
102 | 103 | if not res.ok: |
103 | 104 | raise Exception(res.text) |
104 | | - json_account = res.json()["connected_account"] |
| 105 | + json_account: Dict[str, Any] = res.json()["connected_account"] |
105 | 106 | return ConnectedAccount( |
106 | 107 | connected_account_id=json_account["connected_account_id"], |
107 | 108 | created_at=json_account["created_at"], |
108 | 109 | user_identifier=json_account["user_identifier"], |
109 | 110 | account_type=json_account["account_type"], |
| 111 | + errors=json_account.get("errors", []), |
110 | 112 | ) |
0 commit comments