ynab-cli 0.3.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- ynab_cli/__init__.py +0 -0
- ynab_cli/adapters/__init__.py +0 -0
- ynab_cli/adapters/rich/__init__.py +0 -0
- ynab_cli/adapters/rich/io.py +38 -0
- ynab_cli/adapters/textual/__init__.py +0 -0
- ynab_cli/adapters/textual/io.py +62 -0
- ynab_cli/adapters/ynab/__init__.py +8 -0
- ynab_cli/adapters/ynab/api/__init__.py +1 -0
- ynab_cli/adapters/ynab/api/accounts/__init__.py +1 -0
- ynab_cli/adapters/ynab/api/accounts/create_account.py +186 -0
- ynab_cli/adapters/ynab/api/accounts/get_account_by_id.py +177 -0
- ynab_cli/adapters/ynab/api/accounts/get_accounts.py +184 -0
- ynab_cli/adapters/ynab/api/budgets/__init__.py +1 -0
- ynab_cli/adapters/ynab/api/budgets/get_budget_by_id.py +188 -0
- ynab_cli/adapters/ynab/api/budgets/get_budget_settings_by_id.py +163 -0
- ynab_cli/adapters/ynab/api/budgets/get_budgets.py +171 -0
- ynab_cli/adapters/ynab/api/categories/__init__.py +1 -0
- ynab_cli/adapters/ynab/api/categories/get_categories.py +188 -0
- ynab_cli/adapters/ynab/api/categories/get_category_by_id.py +180 -0
- ynab_cli/adapters/ynab/api/categories/get_month_category_by_id.py +194 -0
- ynab_cli/adapters/ynab/api/categories/update_category.py +199 -0
- ynab_cli/adapters/ynab/api/categories/update_month_category.py +213 -0
- ynab_cli/adapters/ynab/api/months/__init__.py +1 -0
- ynab_cli/adapters/ynab/api/months/get_budget_month.py +177 -0
- ynab_cli/adapters/ynab/api/months/get_budget_months.py +184 -0
- ynab_cli/adapters/ynab/api/payee_locations/__init__.py +1 -0
- ynab_cli/adapters/ynab/api/payee_locations/get_payee_location_by_id.py +176 -0
- ynab_cli/adapters/ynab/api/payee_locations/get_payee_locations.py +163 -0
- ynab_cli/adapters/ynab/api/payee_locations/get_payee_locations_by_payee.py +176 -0
- ynab_cli/adapters/ynab/api/payees/__init__.py +1 -0
- ynab_cli/adapters/ynab/api/payees/get_payee_by_id.py +176 -0
- ynab_cli/adapters/ynab/api/payees/get_payees.py +184 -0
- ynab_cli/adapters/ynab/api/payees/update_payee.py +199 -0
- ynab_cli/adapters/ynab/api/scheduled_transactions/__init__.py +1 -0
- ynab_cli/adapters/ynab/api/scheduled_transactions/create_scheduled_transaction.py +186 -0
- ynab_cli/adapters/ynab/api/scheduled_transactions/delete_scheduled_transaction.py +176 -0
- ynab_cli/adapters/ynab/api/scheduled_transactions/get_scheduled_transaction_by_id.py +176 -0
- ynab_cli/adapters/ynab/api/scheduled_transactions/get_scheduled_transactions.py +184 -0
- ynab_cli/adapters/ynab/api/scheduled_transactions/update_scheduled_transaction.py +199 -0
- ynab_cli/adapters/ynab/api/transactions/__init__.py +1 -0
- ynab_cli/adapters/ynab/api/transactions/create_transaction.py +202 -0
- ynab_cli/adapters/ynab/api/transactions/delete_transaction.py +176 -0
- ynab_cli/adapters/ynab/api/transactions/get_transaction_by_id.py +176 -0
- ynab_cli/adapters/ynab/api/transactions/get_transactions.py +227 -0
- ynab_cli/adapters/ynab/api/transactions/get_transactions_by_account.py +236 -0
- ynab_cli/adapters/ynab/api/transactions/get_transactions_by_category.py +236 -0
- ynab_cli/adapters/ynab/api/transactions/get_transactions_by_month.py +236 -0
- ynab_cli/adapters/ynab/api/transactions/get_transactions_by_payee.py +236 -0
- ynab_cli/adapters/ynab/api/transactions/import_transactions.py +183 -0
- ynab_cli/adapters/ynab/api/transactions/update_transaction.py +199 -0
- ynab_cli/adapters/ynab/api/transactions/update_transactions.py +177 -0
- ynab_cli/adapters/ynab/api/user/__init__.py +1 -0
- ynab_cli/adapters/ynab/api/user/get_user.py +130 -0
- ynab_cli/adapters/ynab/client.py +268 -0
- ynab_cli/adapters/ynab/errors.py +16 -0
- ynab_cli/adapters/ynab/models/__init__.py +229 -0
- ynab_cli/adapters/ynab/models/account.py +345 -0
- ynab_cli/adapters/ynab/models/account_response.py +65 -0
- ynab_cli/adapters/ynab/models/account_response_data.py +65 -0
- ynab_cli/adapters/ynab/models/account_type.py +23 -0
- ynab_cli/adapters/ynab/models/accounts_response.py +65 -0
- ynab_cli/adapters/ynab/models/accounts_response_data.py +81 -0
- ynab_cli/adapters/ynab/models/budget_detail.py +405 -0
- ynab_cli/adapters/ynab/models/budget_detail_response.py +65 -0
- ynab_cli/adapters/ynab/models/budget_detail_response_data.py +73 -0
- ynab_cli/adapters/ynab/models/budget_settings.py +115 -0
- ynab_cli/adapters/ynab/models/budget_settings_response.py +65 -0
- ynab_cli/adapters/ynab/models/budget_settings_response_data.py +65 -0
- ynab_cli/adapters/ynab/models/budget_summary.py +216 -0
- ynab_cli/adapters/ynab/models/budget_summary_response.py +65 -0
- ynab_cli/adapters/ynab/models/budget_summary_response_data.py +91 -0
- ynab_cli/adapters/ynab/models/bulk_response.py +65 -0
- ynab_cli/adapters/ynab/models/bulk_response_data.py +65 -0
- ynab_cli/adapters/ynab/models/bulk_response_data_bulk.py +68 -0
- ynab_cli/adapters/ynab/models/bulk_transactions.py +75 -0
- ynab_cli/adapters/ynab/models/categories_response.py +65 -0
- ynab_cli/adapters/ynab/models/categories_response_data.py +81 -0
- ynab_cli/adapters/ynab/models/category.py +519 -0
- ynab_cli/adapters/ynab/models/category_goal_type_type_1.py +15 -0
- ynab_cli/adapters/ynab/models/category_goal_type_type_2_type_1.py +15 -0
- ynab_cli/adapters/ynab/models/category_goal_type_type_3_type_1.py +15 -0
- ynab_cli/adapters/ynab/models/category_group.py +85 -0
- ynab_cli/adapters/ynab/models/category_group_with_categories.py +108 -0
- ynab_cli/adapters/ynab/models/category_response.py +65 -0
- ynab_cli/adapters/ynab/models/category_response_data.py +65 -0
- ynab_cli/adapters/ynab/models/currency_format_type_0.py +117 -0
- ynab_cli/adapters/ynab/models/date_format_type_0.py +61 -0
- ynab_cli/adapters/ynab/models/error_detail.py +75 -0
- ynab_cli/adapters/ynab/models/error_response.py +65 -0
- ynab_cli/adapters/ynab/models/existing_transaction.py +322 -0
- ynab_cli/adapters/ynab/models/get_transactions_by_account_type.py +12 -0
- ynab_cli/adapters/ynab/models/get_transactions_by_category_type.py +12 -0
- ynab_cli/adapters/ynab/models/get_transactions_by_month_type.py +12 -0
- ynab_cli/adapters/ynab/models/get_transactions_by_payee_type.py +12 -0
- ynab_cli/adapters/ynab/models/get_transactions_type.py +12 -0
- ynab_cli/adapters/ynab/models/hybrid_transaction.py +567 -0
- ynab_cli/adapters/ynab/models/hybrid_transaction_type.py +12 -0
- ynab_cli/adapters/ynab/models/hybrid_transactions_response.py +65 -0
- ynab_cli/adapters/ynab/models/hybrid_transactions_response_data.py +84 -0
- ynab_cli/adapters/ynab/models/loan_account_periodic_value_type_0.py +44 -0
- ynab_cli/adapters/ynab/models/month_detail.py +168 -0
- ynab_cli/adapters/ynab/models/month_detail_response.py +65 -0
- ynab_cli/adapters/ynab/models/month_detail_response_data.py +65 -0
- ynab_cli/adapters/ynab/models/month_summaries_response.py +65 -0
- ynab_cli/adapters/ynab/models/month_summaries_response_data.py +81 -0
- ynab_cli/adapters/ynab/models/month_summary.py +145 -0
- ynab_cli/adapters/ynab/models/new_transaction.py +352 -0
- ynab_cli/adapters/ynab/models/patch_category_wrapper.py +65 -0
- ynab_cli/adapters/ynab/models/patch_month_category_wrapper.py +65 -0
- ynab_cli/adapters/ynab/models/patch_payee_wrapper.py +65 -0
- ynab_cli/adapters/ynab/models/patch_transactions_wrapper.py +73 -0
- ynab_cli/adapters/ynab/models/payee.py +100 -0
- ynab_cli/adapters/ynab/models/payee_location.py +93 -0
- ynab_cli/adapters/ynab/models/payee_location_response.py +65 -0
- ynab_cli/adapters/ynab/models/payee_location_response_data.py +65 -0
- ynab_cli/adapters/ynab/models/payee_locations_response.py +65 -0
- ynab_cli/adapters/ynab/models/payee_locations_response_data.py +73 -0
- ynab_cli/adapters/ynab/models/payee_response.py +65 -0
- ynab_cli/adapters/ynab/models/payee_response_data.py +65 -0
- ynab_cli/adapters/ynab/models/payees_response.py +65 -0
- ynab_cli/adapters/ynab/models/payees_response_data.py +81 -0
- ynab_cli/adapters/ynab/models/post_account_wrapper.py +65 -0
- ynab_cli/adapters/ynab/models/post_scheduled_transaction_wrapper.py +65 -0
- ynab_cli/adapters/ynab/models/post_transactions_wrapper.py +91 -0
- ynab_cli/adapters/ynab/models/put_scheduled_transaction_wrapper.py +65 -0
- ynab_cli/adapters/ynab/models/put_transaction_wrapper.py +65 -0
- ynab_cli/adapters/ynab/models/save_account.py +77 -0
- ynab_cli/adapters/ynab/models/save_category.py +129 -0
- ynab_cli/adapters/ynab/models/save_category_response.py +65 -0
- ynab_cli/adapters/ynab/models/save_category_response_data.py +73 -0
- ynab_cli/adapters/ynab/models/save_month_category.py +59 -0
- ynab_cli/adapters/ynab/models/save_payee.py +59 -0
- ynab_cli/adapters/ynab/models/save_payee_response.py +65 -0
- ynab_cli/adapters/ynab/models/save_payee_response_data.py +73 -0
- ynab_cli/adapters/ynab/models/save_scheduled_transaction.py +269 -0
- ynab_cli/adapters/ynab/models/save_sub_transaction.py +166 -0
- ynab_cli/adapters/ynab/models/save_transaction_with_id_or_import_id.py +366 -0
- ynab_cli/adapters/ynab/models/save_transaction_with_optional_fields.py +322 -0
- ynab_cli/adapters/ynab/models/save_transactions_response.py +65 -0
- ynab_cli/adapters/ynab/models/save_transactions_response_data.py +123 -0
- ynab_cli/adapters/ynab/models/scheduled_sub_transaction.py +238 -0
- ynab_cli/adapters/ynab/models/scheduled_transaction_detail.py +381 -0
- ynab_cli/adapters/ynab/models/scheduled_transaction_frequency.py +23 -0
- ynab_cli/adapters/ynab/models/scheduled_transaction_response.py +65 -0
- ynab_cli/adapters/ynab/models/scheduled_transaction_response_data.py +65 -0
- ynab_cli/adapters/ynab/models/scheduled_transaction_summary.py +310 -0
- ynab_cli/adapters/ynab/models/scheduled_transaction_summary_frequency.py +23 -0
- ynab_cli/adapters/ynab/models/scheduled_transactions_response.py +65 -0
- ynab_cli/adapters/ynab/models/scheduled_transactions_response_data.py +81 -0
- ynab_cli/adapters/ynab/models/sub_transaction.py +259 -0
- ynab_cli/adapters/ynab/models/transaction_cleared_status.py +13 -0
- ynab_cli/adapters/ynab/models/transaction_detail.py +570 -0
- ynab_cli/adapters/ynab/models/transaction_flag_color_type_1.py +16 -0
- ynab_cli/adapters/ynab/models/transaction_flag_color_type_2_type_1.py +16 -0
- ynab_cli/adapters/ynab/models/transaction_flag_color_type_3_type_1.py +16 -0
- ynab_cli/adapters/ynab/models/transaction_response.py +65 -0
- ynab_cli/adapters/ynab/models/transaction_response_data.py +65 -0
- ynab_cli/adapters/ynab/models/transaction_summary.py +499 -0
- ynab_cli/adapters/ynab/models/transaction_summary_debt_transaction_type_type_1.py +18 -0
- ynab_cli/adapters/ynab/models/transaction_summary_debt_transaction_type_type_2_type_1.py +18 -0
- ynab_cli/adapters/ynab/models/transaction_summary_debt_transaction_type_type_3_type_1.py +18 -0
- ynab_cli/adapters/ynab/models/transactions_import_response.py +65 -0
- ynab_cli/adapters/ynab/models/transactions_import_response_data.py +59 -0
- ynab_cli/adapters/ynab/models/transactions_response.py +65 -0
- ynab_cli/adapters/ynab/models/transactions_response_data.py +81 -0
- ynab_cli/adapters/ynab/models/user.py +60 -0
- ynab_cli/adapters/ynab/models/user_response.py +65 -0
- ynab_cli/adapters/ynab/models/user_response_data.py +65 -0
- ynab_cli/adapters/ynab/types.py +46 -0
- ynab_cli/adapters/ynab/util.py +78 -0
- ynab_cli/domain/__init__.py +0 -0
- ynab_cli/domain/constants.py +3 -0
- ynab_cli/domain/models/__init__.py +0 -0
- ynab_cli/domain/models/rules.py +37 -0
- ynab_cli/domain/ports/__init__.py +5 -0
- ynab_cli/domain/ports/io.py +63 -0
- ynab_cli/domain/settings.py +16 -0
- ynab_cli/domain/use_cases/__init__.py +0 -0
- ynab_cli/domain/use_cases/categories.py +105 -0
- ynab_cli/domain/use_cases/payees.py +232 -0
- ynab_cli/domain/use_cases/transactions.py +93 -0
- ynab_cli/host/__init__.py +14 -0
- ynab_cli/host/cli.py +37 -0
- ynab_cli/host/click/__init__.py +0 -0
- ynab_cli/host/click/cli.py +44 -0
- ynab_cli/host/click/commands/__init__.py +0 -0
- ynab_cli/host/click/commands/categories.py +92 -0
- ynab_cli/host/click/commands/payees.py +157 -0
- ynab_cli/host/click/commands/rich/__init__.py +0 -0
- ynab_cli/host/click/commands/rich/progress_table.py +37 -0
- ynab_cli/host/click/commands/transactions.py +76 -0
- ynab_cli/host/constants.py +3 -0
- ynab_cli/host/textual/__init__.py +0 -0
- ynab_cli/host/textual/app.py +98 -0
- ynab_cli/host/textual/app.tcss +47 -0
- ynab_cli/host/textual/cli.py +42 -0
- ynab_cli/host/textual/widgets/__init__.py +58 -0
- ynab_cli/host/textual/widgets/categories.py +90 -0
- ynab_cli/host/textual/widgets/payees.py +154 -0
- ynab_cli/host/textual/widgets/transactions.py +89 -0
- ynab_cli/py.typed +0 -0
- ynab_cli-0.3.0.dist-info/METADATA +102 -0
- ynab_cli-0.3.0.dist-info/RECORD +206 -0
- ynab_cli-0.3.0.dist-info/WHEEL +4 -0
- ynab_cli-0.3.0.dist-info/entry_points.txt +2 -0
- ynab_cli-0.3.0.dist-info/licenses/LICENSE.md +21 -0
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
from http import HTTPStatus
|
|
2
|
+
from typing import Any
|
|
3
|
+
|
|
4
|
+
import httpx
|
|
5
|
+
|
|
6
|
+
from ynab_cli.adapters.ynab import errors
|
|
7
|
+
from ynab_cli.adapters.ynab.client import AuthenticatedClient, Client
|
|
8
|
+
from ynab_cli.adapters.ynab.models.error_response import ErrorResponse
|
|
9
|
+
from ynab_cli.adapters.ynab.models.transactions_import_response import TransactionsImportResponse
|
|
10
|
+
from ynab_cli.adapters.ynab.types import Response
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
def _get_kwargs(
|
|
14
|
+
budget_id: str,
|
|
15
|
+
) -> dict[str, Any]:
|
|
16
|
+
_kwargs: dict[str, Any] = {
|
|
17
|
+
"method": "post",
|
|
18
|
+
"url": f"/budgets/{budget_id}/transactions/import",
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
return _kwargs
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
def _parse_response(
|
|
25
|
+
*, client: AuthenticatedClient | Client, response: httpx.Response
|
|
26
|
+
) -> ErrorResponse | TransactionsImportResponse | None:
|
|
27
|
+
if response.status_code == 200:
|
|
28
|
+
response_200 = TransactionsImportResponse.from_dict(response.json())
|
|
29
|
+
|
|
30
|
+
return response_200
|
|
31
|
+
if response.status_code == 201:
|
|
32
|
+
response_201 = TransactionsImportResponse.from_dict(response.json())
|
|
33
|
+
|
|
34
|
+
return response_201
|
|
35
|
+
if response.status_code == 400:
|
|
36
|
+
response_400 = ErrorResponse.from_dict(response.json())
|
|
37
|
+
|
|
38
|
+
return response_400
|
|
39
|
+
if client.raise_on_unexpected_status:
|
|
40
|
+
raise errors.UnexpectedStatusError(response.status_code, response.content)
|
|
41
|
+
else:
|
|
42
|
+
return None
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
def _build_response(
|
|
46
|
+
*, client: AuthenticatedClient | Client, response: httpx.Response
|
|
47
|
+
) -> Response[ErrorResponse | TransactionsImportResponse]:
|
|
48
|
+
return Response(
|
|
49
|
+
status_code=HTTPStatus(response.status_code),
|
|
50
|
+
content=response.content,
|
|
51
|
+
headers=response.headers,
|
|
52
|
+
parsed=_parse_response(client=client, response=response),
|
|
53
|
+
)
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
def sync_detailed(
|
|
57
|
+
budget_id: str,
|
|
58
|
+
*,
|
|
59
|
+
client: AuthenticatedClient | Client,
|
|
60
|
+
) -> Response[ErrorResponse | TransactionsImportResponse]:
|
|
61
|
+
r"""Import transactions
|
|
62
|
+
|
|
63
|
+
Imports available transactions on all linked accounts for the given budget. Linked accounts allow
|
|
64
|
+
transactions to be imported directly from a specified financial institution and this endpoint
|
|
65
|
+
initiates that import. Sending a request to this endpoint is the equivalent of clicking \"Import\"
|
|
66
|
+
on each account in the web application or tapping the \"New Transactions\" banner in the mobile
|
|
67
|
+
applications. The response for this endpoint contains the transaction ids that have been imported.
|
|
68
|
+
|
|
69
|
+
Args:
|
|
70
|
+
budget_id (str):
|
|
71
|
+
|
|
72
|
+
Raises:
|
|
73
|
+
errors.UnexpectedStatusError: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
74
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
75
|
+
|
|
76
|
+
Returns:
|
|
77
|
+
Response[Union[ErrorResponse, TransactionsImportResponse]]
|
|
78
|
+
"""
|
|
79
|
+
|
|
80
|
+
kwargs = _get_kwargs(
|
|
81
|
+
budget_id=budget_id,
|
|
82
|
+
)
|
|
83
|
+
|
|
84
|
+
response = client.get_httpx_client().request(
|
|
85
|
+
**kwargs,
|
|
86
|
+
)
|
|
87
|
+
|
|
88
|
+
return _build_response(client=client, response=response)
|
|
89
|
+
|
|
90
|
+
|
|
91
|
+
def sync(
|
|
92
|
+
budget_id: str,
|
|
93
|
+
*,
|
|
94
|
+
client: AuthenticatedClient | Client,
|
|
95
|
+
) -> ErrorResponse | TransactionsImportResponse | None:
|
|
96
|
+
r"""Import transactions
|
|
97
|
+
|
|
98
|
+
Imports available transactions on all linked accounts for the given budget. Linked accounts allow
|
|
99
|
+
transactions to be imported directly from a specified financial institution and this endpoint
|
|
100
|
+
initiates that import. Sending a request to this endpoint is the equivalent of clicking \"Import\"
|
|
101
|
+
on each account in the web application or tapping the \"New Transactions\" banner in the mobile
|
|
102
|
+
applications. The response for this endpoint contains the transaction ids that have been imported.
|
|
103
|
+
|
|
104
|
+
Args:
|
|
105
|
+
budget_id (str):
|
|
106
|
+
|
|
107
|
+
Raises:
|
|
108
|
+
errors.UnexpectedStatusError: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
109
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
110
|
+
|
|
111
|
+
Returns:
|
|
112
|
+
Union[ErrorResponse, TransactionsImportResponse]
|
|
113
|
+
"""
|
|
114
|
+
|
|
115
|
+
return sync_detailed(
|
|
116
|
+
budget_id=budget_id,
|
|
117
|
+
client=client,
|
|
118
|
+
).parsed
|
|
119
|
+
|
|
120
|
+
|
|
121
|
+
async def asyncio_detailed(
|
|
122
|
+
budget_id: str,
|
|
123
|
+
*,
|
|
124
|
+
client: AuthenticatedClient | Client,
|
|
125
|
+
) -> Response[ErrorResponse | TransactionsImportResponse]:
|
|
126
|
+
r"""Import transactions
|
|
127
|
+
|
|
128
|
+
Imports available transactions on all linked accounts for the given budget. Linked accounts allow
|
|
129
|
+
transactions to be imported directly from a specified financial institution and this endpoint
|
|
130
|
+
initiates that import. Sending a request to this endpoint is the equivalent of clicking \"Import\"
|
|
131
|
+
on each account in the web application or tapping the \"New Transactions\" banner in the mobile
|
|
132
|
+
applications. The response for this endpoint contains the transaction ids that have been imported.
|
|
133
|
+
|
|
134
|
+
Args:
|
|
135
|
+
budget_id (str):
|
|
136
|
+
|
|
137
|
+
Raises:
|
|
138
|
+
errors.UnexpectedStatusError: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
139
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
140
|
+
|
|
141
|
+
Returns:
|
|
142
|
+
Response[Union[ErrorResponse, TransactionsImportResponse]]
|
|
143
|
+
"""
|
|
144
|
+
|
|
145
|
+
kwargs = _get_kwargs(
|
|
146
|
+
budget_id=budget_id,
|
|
147
|
+
)
|
|
148
|
+
|
|
149
|
+
response = await client.get_async_httpx_client().request(**kwargs)
|
|
150
|
+
|
|
151
|
+
return _build_response(client=client, response=response)
|
|
152
|
+
|
|
153
|
+
|
|
154
|
+
async def asyncio(
|
|
155
|
+
budget_id: str,
|
|
156
|
+
*,
|
|
157
|
+
client: AuthenticatedClient | Client,
|
|
158
|
+
) -> ErrorResponse | TransactionsImportResponse | None:
|
|
159
|
+
r"""Import transactions
|
|
160
|
+
|
|
161
|
+
Imports available transactions on all linked accounts for the given budget. Linked accounts allow
|
|
162
|
+
transactions to be imported directly from a specified financial institution and this endpoint
|
|
163
|
+
initiates that import. Sending a request to this endpoint is the equivalent of clicking \"Import\"
|
|
164
|
+
on each account in the web application or tapping the \"New Transactions\" banner in the mobile
|
|
165
|
+
applications. The response for this endpoint contains the transaction ids that have been imported.
|
|
166
|
+
|
|
167
|
+
Args:
|
|
168
|
+
budget_id (str):
|
|
169
|
+
|
|
170
|
+
Raises:
|
|
171
|
+
errors.UnexpectedStatusError: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
172
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
173
|
+
|
|
174
|
+
Returns:
|
|
175
|
+
Union[ErrorResponse, TransactionsImportResponse]
|
|
176
|
+
"""
|
|
177
|
+
|
|
178
|
+
return (
|
|
179
|
+
await asyncio_detailed(
|
|
180
|
+
budget_id=budget_id,
|
|
181
|
+
client=client,
|
|
182
|
+
)
|
|
183
|
+
).parsed
|
|
@@ -0,0 +1,199 @@
|
|
|
1
|
+
from http import HTTPStatus
|
|
2
|
+
from typing import Any
|
|
3
|
+
|
|
4
|
+
import httpx
|
|
5
|
+
|
|
6
|
+
from ynab_cli.adapters.ynab import errors
|
|
7
|
+
from ynab_cli.adapters.ynab.client import AuthenticatedClient, Client
|
|
8
|
+
from ynab_cli.adapters.ynab.models.error_response import ErrorResponse
|
|
9
|
+
from ynab_cli.adapters.ynab.models.put_transaction_wrapper import PutTransactionWrapper
|
|
10
|
+
from ynab_cli.adapters.ynab.models.transaction_response import TransactionResponse
|
|
11
|
+
from ynab_cli.adapters.ynab.types import Response
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
def _get_kwargs(
|
|
15
|
+
budget_id: str,
|
|
16
|
+
transaction_id: str,
|
|
17
|
+
*,
|
|
18
|
+
body: PutTransactionWrapper,
|
|
19
|
+
) -> dict[str, Any]:
|
|
20
|
+
headers: dict[str, Any] = {}
|
|
21
|
+
|
|
22
|
+
_kwargs: dict[str, Any] = {
|
|
23
|
+
"method": "put",
|
|
24
|
+
"url": f"/budgets/{budget_id}/transactions/{transaction_id}",
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
_body = body.to_dict()
|
|
28
|
+
|
|
29
|
+
_kwargs["json"] = _body
|
|
30
|
+
headers["Content-Type"] = "application/json"
|
|
31
|
+
|
|
32
|
+
_kwargs["headers"] = headers
|
|
33
|
+
return _kwargs
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
def _parse_response(
|
|
37
|
+
*, client: AuthenticatedClient | Client, response: httpx.Response
|
|
38
|
+
) -> ErrorResponse | TransactionResponse | None:
|
|
39
|
+
if response.status_code == 200:
|
|
40
|
+
response_200 = TransactionResponse.from_dict(response.json())
|
|
41
|
+
|
|
42
|
+
return response_200
|
|
43
|
+
if response.status_code == 400:
|
|
44
|
+
response_400 = ErrorResponse.from_dict(response.json())
|
|
45
|
+
|
|
46
|
+
return response_400
|
|
47
|
+
if client.raise_on_unexpected_status:
|
|
48
|
+
raise errors.UnexpectedStatusError(response.status_code, response.content)
|
|
49
|
+
else:
|
|
50
|
+
return None
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
def _build_response(
|
|
54
|
+
*, client: AuthenticatedClient | Client, response: httpx.Response
|
|
55
|
+
) -> Response[ErrorResponse | TransactionResponse]:
|
|
56
|
+
return Response(
|
|
57
|
+
status_code=HTTPStatus(response.status_code),
|
|
58
|
+
content=response.content,
|
|
59
|
+
headers=response.headers,
|
|
60
|
+
parsed=_parse_response(client=client, response=response),
|
|
61
|
+
)
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
def sync_detailed(
|
|
65
|
+
budget_id: str,
|
|
66
|
+
transaction_id: str,
|
|
67
|
+
*,
|
|
68
|
+
client: AuthenticatedClient | Client,
|
|
69
|
+
body: PutTransactionWrapper,
|
|
70
|
+
) -> Response[ErrorResponse | TransactionResponse]:
|
|
71
|
+
"""Updates an existing transaction
|
|
72
|
+
|
|
73
|
+
Updates a single transaction
|
|
74
|
+
|
|
75
|
+
Args:
|
|
76
|
+
budget_id (str):
|
|
77
|
+
transaction_id (str):
|
|
78
|
+
body (PutTransactionWrapper):
|
|
79
|
+
|
|
80
|
+
Raises:
|
|
81
|
+
errors.UnexpectedStatusError: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
82
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
83
|
+
|
|
84
|
+
Returns:
|
|
85
|
+
Response[Union[ErrorResponse, TransactionResponse]]
|
|
86
|
+
"""
|
|
87
|
+
|
|
88
|
+
kwargs = _get_kwargs(
|
|
89
|
+
budget_id=budget_id,
|
|
90
|
+
transaction_id=transaction_id,
|
|
91
|
+
body=body,
|
|
92
|
+
)
|
|
93
|
+
|
|
94
|
+
response = client.get_httpx_client().request(
|
|
95
|
+
**kwargs,
|
|
96
|
+
)
|
|
97
|
+
|
|
98
|
+
return _build_response(client=client, response=response)
|
|
99
|
+
|
|
100
|
+
|
|
101
|
+
def sync(
|
|
102
|
+
budget_id: str,
|
|
103
|
+
transaction_id: str,
|
|
104
|
+
*,
|
|
105
|
+
client: AuthenticatedClient | Client,
|
|
106
|
+
body: PutTransactionWrapper,
|
|
107
|
+
) -> ErrorResponse | TransactionResponse | None:
|
|
108
|
+
"""Updates an existing transaction
|
|
109
|
+
|
|
110
|
+
Updates a single transaction
|
|
111
|
+
|
|
112
|
+
Args:
|
|
113
|
+
budget_id (str):
|
|
114
|
+
transaction_id (str):
|
|
115
|
+
body (PutTransactionWrapper):
|
|
116
|
+
|
|
117
|
+
Raises:
|
|
118
|
+
errors.UnexpectedStatusError: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
119
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
120
|
+
|
|
121
|
+
Returns:
|
|
122
|
+
Union[ErrorResponse, TransactionResponse]
|
|
123
|
+
"""
|
|
124
|
+
|
|
125
|
+
return sync_detailed(
|
|
126
|
+
budget_id=budget_id,
|
|
127
|
+
transaction_id=transaction_id,
|
|
128
|
+
client=client,
|
|
129
|
+
body=body,
|
|
130
|
+
).parsed
|
|
131
|
+
|
|
132
|
+
|
|
133
|
+
async def asyncio_detailed(
|
|
134
|
+
budget_id: str,
|
|
135
|
+
transaction_id: str,
|
|
136
|
+
*,
|
|
137
|
+
client: AuthenticatedClient | Client,
|
|
138
|
+
body: PutTransactionWrapper,
|
|
139
|
+
) -> Response[ErrorResponse | TransactionResponse]:
|
|
140
|
+
"""Updates an existing transaction
|
|
141
|
+
|
|
142
|
+
Updates a single transaction
|
|
143
|
+
|
|
144
|
+
Args:
|
|
145
|
+
budget_id (str):
|
|
146
|
+
transaction_id (str):
|
|
147
|
+
body (PutTransactionWrapper):
|
|
148
|
+
|
|
149
|
+
Raises:
|
|
150
|
+
errors.UnexpectedStatusError: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
151
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
152
|
+
|
|
153
|
+
Returns:
|
|
154
|
+
Response[Union[ErrorResponse, TransactionResponse]]
|
|
155
|
+
"""
|
|
156
|
+
|
|
157
|
+
kwargs = _get_kwargs(
|
|
158
|
+
budget_id=budget_id,
|
|
159
|
+
transaction_id=transaction_id,
|
|
160
|
+
body=body,
|
|
161
|
+
)
|
|
162
|
+
|
|
163
|
+
response = await client.get_async_httpx_client().request(**kwargs)
|
|
164
|
+
|
|
165
|
+
return _build_response(client=client, response=response)
|
|
166
|
+
|
|
167
|
+
|
|
168
|
+
async def asyncio(
|
|
169
|
+
budget_id: str,
|
|
170
|
+
transaction_id: str,
|
|
171
|
+
*,
|
|
172
|
+
client: AuthenticatedClient | Client,
|
|
173
|
+
body: PutTransactionWrapper,
|
|
174
|
+
) -> ErrorResponse | TransactionResponse | None:
|
|
175
|
+
"""Updates an existing transaction
|
|
176
|
+
|
|
177
|
+
Updates a single transaction
|
|
178
|
+
|
|
179
|
+
Args:
|
|
180
|
+
budget_id (str):
|
|
181
|
+
transaction_id (str):
|
|
182
|
+
body (PutTransactionWrapper):
|
|
183
|
+
|
|
184
|
+
Raises:
|
|
185
|
+
errors.UnexpectedStatusError: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
186
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
187
|
+
|
|
188
|
+
Returns:
|
|
189
|
+
Union[ErrorResponse, TransactionResponse]
|
|
190
|
+
"""
|
|
191
|
+
|
|
192
|
+
return (
|
|
193
|
+
await asyncio_detailed(
|
|
194
|
+
budget_id=budget_id,
|
|
195
|
+
transaction_id=transaction_id,
|
|
196
|
+
client=client,
|
|
197
|
+
body=body,
|
|
198
|
+
)
|
|
199
|
+
).parsed
|
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
from http import HTTPStatus
|
|
2
|
+
from typing import Any
|
|
3
|
+
|
|
4
|
+
import httpx
|
|
5
|
+
|
|
6
|
+
from ynab_cli.adapters.ynab import errors
|
|
7
|
+
from ynab_cli.adapters.ynab.client import AuthenticatedClient, Client
|
|
8
|
+
from ynab_cli.adapters.ynab.models.error_response import ErrorResponse
|
|
9
|
+
from ynab_cli.adapters.ynab.models.patch_transactions_wrapper import PatchTransactionsWrapper
|
|
10
|
+
from ynab_cli.adapters.ynab.types import Response
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
def _get_kwargs(
|
|
14
|
+
budget_id: str,
|
|
15
|
+
*,
|
|
16
|
+
body: PatchTransactionsWrapper,
|
|
17
|
+
) -> dict[str, Any]:
|
|
18
|
+
headers: dict[str, Any] = {}
|
|
19
|
+
|
|
20
|
+
_kwargs: dict[str, Any] = {
|
|
21
|
+
"method": "patch",
|
|
22
|
+
"url": f"/budgets/{budget_id}/transactions",
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
_body = body.to_dict()
|
|
26
|
+
|
|
27
|
+
_kwargs["json"] = _body
|
|
28
|
+
headers["Content-Type"] = "application/json"
|
|
29
|
+
|
|
30
|
+
_kwargs["headers"] = headers
|
|
31
|
+
return _kwargs
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> ErrorResponse | None:
|
|
35
|
+
if response.status_code == 400:
|
|
36
|
+
response_400 = ErrorResponse.from_dict(response.json())
|
|
37
|
+
|
|
38
|
+
return response_400
|
|
39
|
+
if client.raise_on_unexpected_status:
|
|
40
|
+
raise errors.UnexpectedStatusError(response.status_code, response.content)
|
|
41
|
+
else:
|
|
42
|
+
return None
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[ErrorResponse]:
|
|
46
|
+
return Response(
|
|
47
|
+
status_code=HTTPStatus(response.status_code),
|
|
48
|
+
content=response.content,
|
|
49
|
+
headers=response.headers,
|
|
50
|
+
parsed=_parse_response(client=client, response=response),
|
|
51
|
+
)
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
def sync_detailed(
|
|
55
|
+
budget_id: str,
|
|
56
|
+
*,
|
|
57
|
+
client: AuthenticatedClient | Client,
|
|
58
|
+
body: PatchTransactionsWrapper,
|
|
59
|
+
) -> Response[ErrorResponse]:
|
|
60
|
+
"""Update multiple transactions
|
|
61
|
+
|
|
62
|
+
Updates multiple transactions, by `id` or `import_id`.
|
|
63
|
+
|
|
64
|
+
Args:
|
|
65
|
+
budget_id (str):
|
|
66
|
+
body (PatchTransactionsWrapper):
|
|
67
|
+
|
|
68
|
+
Raises:
|
|
69
|
+
errors.UnexpectedStatusError: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
70
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
71
|
+
|
|
72
|
+
Returns:
|
|
73
|
+
Response[ErrorResponse]
|
|
74
|
+
"""
|
|
75
|
+
|
|
76
|
+
kwargs = _get_kwargs(
|
|
77
|
+
budget_id=budget_id,
|
|
78
|
+
body=body,
|
|
79
|
+
)
|
|
80
|
+
|
|
81
|
+
response = client.get_httpx_client().request(
|
|
82
|
+
**kwargs,
|
|
83
|
+
)
|
|
84
|
+
|
|
85
|
+
return _build_response(client=client, response=response)
|
|
86
|
+
|
|
87
|
+
|
|
88
|
+
def sync(
|
|
89
|
+
budget_id: str,
|
|
90
|
+
*,
|
|
91
|
+
client: AuthenticatedClient | Client,
|
|
92
|
+
body: PatchTransactionsWrapper,
|
|
93
|
+
) -> ErrorResponse | None:
|
|
94
|
+
"""Update multiple transactions
|
|
95
|
+
|
|
96
|
+
Updates multiple transactions, by `id` or `import_id`.
|
|
97
|
+
|
|
98
|
+
Args:
|
|
99
|
+
budget_id (str):
|
|
100
|
+
body (PatchTransactionsWrapper):
|
|
101
|
+
|
|
102
|
+
Raises:
|
|
103
|
+
errors.UnexpectedStatusError: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
104
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
105
|
+
|
|
106
|
+
Returns:
|
|
107
|
+
ErrorResponse
|
|
108
|
+
"""
|
|
109
|
+
|
|
110
|
+
return sync_detailed(
|
|
111
|
+
budget_id=budget_id,
|
|
112
|
+
client=client,
|
|
113
|
+
body=body,
|
|
114
|
+
).parsed
|
|
115
|
+
|
|
116
|
+
|
|
117
|
+
async def asyncio_detailed(
|
|
118
|
+
budget_id: str,
|
|
119
|
+
*,
|
|
120
|
+
client: AuthenticatedClient | Client,
|
|
121
|
+
body: PatchTransactionsWrapper,
|
|
122
|
+
) -> Response[ErrorResponse]:
|
|
123
|
+
"""Update multiple transactions
|
|
124
|
+
|
|
125
|
+
Updates multiple transactions, by `id` or `import_id`.
|
|
126
|
+
|
|
127
|
+
Args:
|
|
128
|
+
budget_id (str):
|
|
129
|
+
body (PatchTransactionsWrapper):
|
|
130
|
+
|
|
131
|
+
Raises:
|
|
132
|
+
errors.UnexpectedStatusError: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
133
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
134
|
+
|
|
135
|
+
Returns:
|
|
136
|
+
Response[ErrorResponse]
|
|
137
|
+
"""
|
|
138
|
+
|
|
139
|
+
kwargs = _get_kwargs(
|
|
140
|
+
budget_id=budget_id,
|
|
141
|
+
body=body,
|
|
142
|
+
)
|
|
143
|
+
|
|
144
|
+
response = await client.get_async_httpx_client().request(**kwargs)
|
|
145
|
+
|
|
146
|
+
return _build_response(client=client, response=response)
|
|
147
|
+
|
|
148
|
+
|
|
149
|
+
async def asyncio(
|
|
150
|
+
budget_id: str,
|
|
151
|
+
*,
|
|
152
|
+
client: AuthenticatedClient | Client,
|
|
153
|
+
body: PatchTransactionsWrapper,
|
|
154
|
+
) -> ErrorResponse | None:
|
|
155
|
+
"""Update multiple transactions
|
|
156
|
+
|
|
157
|
+
Updates multiple transactions, by `id` or `import_id`.
|
|
158
|
+
|
|
159
|
+
Args:
|
|
160
|
+
budget_id (str):
|
|
161
|
+
body (PatchTransactionsWrapper):
|
|
162
|
+
|
|
163
|
+
Raises:
|
|
164
|
+
errors.UnexpectedStatusError: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
165
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
166
|
+
|
|
167
|
+
Returns:
|
|
168
|
+
ErrorResponse
|
|
169
|
+
"""
|
|
170
|
+
|
|
171
|
+
return (
|
|
172
|
+
await asyncio_detailed(
|
|
173
|
+
budget_id=budget_id,
|
|
174
|
+
client=client,
|
|
175
|
+
body=body,
|
|
176
|
+
)
|
|
177
|
+
).parsed
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"""Contains endpoint functions for accessing the API"""
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
from http import HTTPStatus
|
|
2
|
+
from typing import Any
|
|
3
|
+
|
|
4
|
+
import httpx
|
|
5
|
+
|
|
6
|
+
from ynab_cli.adapters.ynab import errors
|
|
7
|
+
from ynab_cli.adapters.ynab.client import AuthenticatedClient, Client
|
|
8
|
+
from ynab_cli.adapters.ynab.models.user_response import UserResponse
|
|
9
|
+
from ynab_cli.adapters.ynab.types import Response
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
def _get_kwargs() -> dict[str, Any]:
|
|
13
|
+
_kwargs: dict[str, Any] = {
|
|
14
|
+
"method": "get",
|
|
15
|
+
"url": "/user",
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
return _kwargs
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> UserResponse | None:
|
|
22
|
+
if response.status_code == 200:
|
|
23
|
+
response_200 = UserResponse.from_dict(response.json())
|
|
24
|
+
|
|
25
|
+
return response_200
|
|
26
|
+
if client.raise_on_unexpected_status:
|
|
27
|
+
raise errors.UnexpectedStatusError(response.status_code, response.content)
|
|
28
|
+
else:
|
|
29
|
+
return None
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[UserResponse]:
|
|
33
|
+
return Response(
|
|
34
|
+
status_code=HTTPStatus(response.status_code),
|
|
35
|
+
content=response.content,
|
|
36
|
+
headers=response.headers,
|
|
37
|
+
parsed=_parse_response(client=client, response=response),
|
|
38
|
+
)
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
def sync_detailed(
|
|
42
|
+
*,
|
|
43
|
+
client: AuthenticatedClient | Client,
|
|
44
|
+
) -> Response[UserResponse]:
|
|
45
|
+
"""User info
|
|
46
|
+
|
|
47
|
+
Returns authenticated user information
|
|
48
|
+
|
|
49
|
+
Raises:
|
|
50
|
+
errors.UnexpectedStatusError: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
51
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
52
|
+
|
|
53
|
+
Returns:
|
|
54
|
+
Response[UserResponse]
|
|
55
|
+
"""
|
|
56
|
+
|
|
57
|
+
kwargs = _get_kwargs()
|
|
58
|
+
|
|
59
|
+
response = client.get_httpx_client().request(
|
|
60
|
+
**kwargs,
|
|
61
|
+
)
|
|
62
|
+
|
|
63
|
+
return _build_response(client=client, response=response)
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
def sync(
|
|
67
|
+
*,
|
|
68
|
+
client: AuthenticatedClient | Client,
|
|
69
|
+
) -> UserResponse | None:
|
|
70
|
+
"""User info
|
|
71
|
+
|
|
72
|
+
Returns authenticated user information
|
|
73
|
+
|
|
74
|
+
Raises:
|
|
75
|
+
errors.UnexpectedStatusError: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
76
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
77
|
+
|
|
78
|
+
Returns:
|
|
79
|
+
UserResponse
|
|
80
|
+
"""
|
|
81
|
+
|
|
82
|
+
return sync_detailed(
|
|
83
|
+
client=client,
|
|
84
|
+
).parsed
|
|
85
|
+
|
|
86
|
+
|
|
87
|
+
async def asyncio_detailed(
|
|
88
|
+
*,
|
|
89
|
+
client: AuthenticatedClient | Client,
|
|
90
|
+
) -> Response[UserResponse]:
|
|
91
|
+
"""User info
|
|
92
|
+
|
|
93
|
+
Returns authenticated user information
|
|
94
|
+
|
|
95
|
+
Raises:
|
|
96
|
+
errors.UnexpectedStatusError: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
97
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
98
|
+
|
|
99
|
+
Returns:
|
|
100
|
+
Response[UserResponse]
|
|
101
|
+
"""
|
|
102
|
+
|
|
103
|
+
kwargs = _get_kwargs()
|
|
104
|
+
|
|
105
|
+
response = await client.get_async_httpx_client().request(**kwargs)
|
|
106
|
+
|
|
107
|
+
return _build_response(client=client, response=response)
|
|
108
|
+
|
|
109
|
+
|
|
110
|
+
async def asyncio(
|
|
111
|
+
*,
|
|
112
|
+
client: AuthenticatedClient | Client,
|
|
113
|
+
) -> UserResponse | None:
|
|
114
|
+
"""User info
|
|
115
|
+
|
|
116
|
+
Returns authenticated user information
|
|
117
|
+
|
|
118
|
+
Raises:
|
|
119
|
+
errors.UnexpectedStatusError: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
120
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
121
|
+
|
|
122
|
+
Returns:
|
|
123
|
+
UserResponse
|
|
124
|
+
"""
|
|
125
|
+
|
|
126
|
+
return (
|
|
127
|
+
await asyncio_detailed(
|
|
128
|
+
client=client,
|
|
129
|
+
)
|
|
130
|
+
).parsed
|