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,236 @@
|
|
|
1
|
+
import datetime
|
|
2
|
+
from http import HTTPStatus
|
|
3
|
+
from typing import Any
|
|
4
|
+
|
|
5
|
+
import httpx
|
|
6
|
+
|
|
7
|
+
from ynab_cli.adapters.ynab import errors
|
|
8
|
+
from ynab_cli.adapters.ynab.client import AuthenticatedClient, Client
|
|
9
|
+
from ynab_cli.adapters.ynab.models.error_response import ErrorResponse
|
|
10
|
+
from ynab_cli.adapters.ynab.models.get_transactions_by_category_type import GetTransactionsByCategoryType
|
|
11
|
+
from ynab_cli.adapters.ynab.models.hybrid_transactions_response import HybridTransactionsResponse
|
|
12
|
+
from ynab_cli.adapters.ynab.types import UNSET, Response, Unset
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
def _get_kwargs(
|
|
16
|
+
budget_id: str,
|
|
17
|
+
category_id: str,
|
|
18
|
+
*,
|
|
19
|
+
since_date: Unset | datetime.date = UNSET,
|
|
20
|
+
type_: Unset | GetTransactionsByCategoryType = UNSET,
|
|
21
|
+
last_knowledge_of_server: Unset | int = UNSET,
|
|
22
|
+
) -> dict[str, Any]:
|
|
23
|
+
params: dict[str, Any] = {}
|
|
24
|
+
|
|
25
|
+
json_since_date: Unset | str = UNSET
|
|
26
|
+
if not isinstance(since_date, Unset):
|
|
27
|
+
json_since_date = since_date.isoformat()
|
|
28
|
+
params["since_date"] = json_since_date
|
|
29
|
+
|
|
30
|
+
json_type_: Unset | str = UNSET
|
|
31
|
+
if not isinstance(type_, Unset):
|
|
32
|
+
json_type_ = type_.value
|
|
33
|
+
|
|
34
|
+
params["type"] = json_type_
|
|
35
|
+
|
|
36
|
+
params["last_knowledge_of_server"] = last_knowledge_of_server
|
|
37
|
+
|
|
38
|
+
params = {k: v for k, v in params.items() if v is not UNSET and v is not None}
|
|
39
|
+
|
|
40
|
+
_kwargs: dict[str, Any] = {
|
|
41
|
+
"method": "get",
|
|
42
|
+
"url": f"/budgets/{budget_id}/categories/{category_id}/transactions",
|
|
43
|
+
"params": params,
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
return _kwargs
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
def _parse_response(
|
|
50
|
+
*, client: AuthenticatedClient | Client, response: httpx.Response
|
|
51
|
+
) -> ErrorResponse | HybridTransactionsResponse | None:
|
|
52
|
+
if response.status_code == 200:
|
|
53
|
+
response_200 = HybridTransactionsResponse.from_dict(response.json())
|
|
54
|
+
|
|
55
|
+
return response_200
|
|
56
|
+
if response.status_code == 404:
|
|
57
|
+
response_404 = ErrorResponse.from_dict(response.json())
|
|
58
|
+
|
|
59
|
+
return response_404
|
|
60
|
+
if client.raise_on_unexpected_status:
|
|
61
|
+
raise errors.UnexpectedStatusError(response.status_code, response.content)
|
|
62
|
+
else:
|
|
63
|
+
return None
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
def _build_response(
|
|
67
|
+
*, client: AuthenticatedClient | Client, response: httpx.Response
|
|
68
|
+
) -> Response[ErrorResponse | HybridTransactionsResponse]:
|
|
69
|
+
return Response(
|
|
70
|
+
status_code=HTTPStatus(response.status_code),
|
|
71
|
+
content=response.content,
|
|
72
|
+
headers=response.headers,
|
|
73
|
+
parsed=_parse_response(client=client, response=response),
|
|
74
|
+
)
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
def sync_detailed(
|
|
78
|
+
budget_id: str,
|
|
79
|
+
category_id: str,
|
|
80
|
+
*,
|
|
81
|
+
client: AuthenticatedClient | Client,
|
|
82
|
+
since_date: Unset | datetime.date = UNSET,
|
|
83
|
+
type_: Unset | GetTransactionsByCategoryType = UNSET,
|
|
84
|
+
last_knowledge_of_server: Unset | int = UNSET,
|
|
85
|
+
) -> Response[ErrorResponse | HybridTransactionsResponse]:
|
|
86
|
+
"""List category transactions, excluding any pending transactions
|
|
87
|
+
|
|
88
|
+
Returns all transactions for a specified category
|
|
89
|
+
|
|
90
|
+
Args:
|
|
91
|
+
budget_id (str):
|
|
92
|
+
category_id (str):
|
|
93
|
+
since_date (Union[Unset, datetime.date]):
|
|
94
|
+
type_ (Union[Unset, GetTransactionsByCategoryType]):
|
|
95
|
+
last_knowledge_of_server (Union[Unset, int]):
|
|
96
|
+
|
|
97
|
+
Raises:
|
|
98
|
+
errors.UnexpectedStatusError: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
99
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
100
|
+
|
|
101
|
+
Returns:
|
|
102
|
+
Response[Union[ErrorResponse, HybridTransactionsResponse]]
|
|
103
|
+
"""
|
|
104
|
+
|
|
105
|
+
kwargs = _get_kwargs(
|
|
106
|
+
budget_id=budget_id,
|
|
107
|
+
category_id=category_id,
|
|
108
|
+
since_date=since_date,
|
|
109
|
+
type_=type_,
|
|
110
|
+
last_knowledge_of_server=last_knowledge_of_server,
|
|
111
|
+
)
|
|
112
|
+
|
|
113
|
+
response = client.get_httpx_client().request(
|
|
114
|
+
**kwargs,
|
|
115
|
+
)
|
|
116
|
+
|
|
117
|
+
return _build_response(client=client, response=response)
|
|
118
|
+
|
|
119
|
+
|
|
120
|
+
def sync(
|
|
121
|
+
budget_id: str,
|
|
122
|
+
category_id: str,
|
|
123
|
+
*,
|
|
124
|
+
client: AuthenticatedClient | Client,
|
|
125
|
+
since_date: Unset | datetime.date = UNSET,
|
|
126
|
+
type_: Unset | GetTransactionsByCategoryType = UNSET,
|
|
127
|
+
last_knowledge_of_server: Unset | int = UNSET,
|
|
128
|
+
) -> ErrorResponse | HybridTransactionsResponse | None:
|
|
129
|
+
"""List category transactions, excluding any pending transactions
|
|
130
|
+
|
|
131
|
+
Returns all transactions for a specified category
|
|
132
|
+
|
|
133
|
+
Args:
|
|
134
|
+
budget_id (str):
|
|
135
|
+
category_id (str):
|
|
136
|
+
since_date (Union[Unset, datetime.date]):
|
|
137
|
+
type_ (Union[Unset, GetTransactionsByCategoryType]):
|
|
138
|
+
last_knowledge_of_server (Union[Unset, int]):
|
|
139
|
+
|
|
140
|
+
Raises:
|
|
141
|
+
errors.UnexpectedStatusError: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
142
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
143
|
+
|
|
144
|
+
Returns:
|
|
145
|
+
Union[ErrorResponse, HybridTransactionsResponse]
|
|
146
|
+
"""
|
|
147
|
+
|
|
148
|
+
return sync_detailed(
|
|
149
|
+
budget_id=budget_id,
|
|
150
|
+
category_id=category_id,
|
|
151
|
+
client=client,
|
|
152
|
+
since_date=since_date,
|
|
153
|
+
type_=type_,
|
|
154
|
+
last_knowledge_of_server=last_knowledge_of_server,
|
|
155
|
+
).parsed
|
|
156
|
+
|
|
157
|
+
|
|
158
|
+
async def asyncio_detailed(
|
|
159
|
+
budget_id: str,
|
|
160
|
+
category_id: str,
|
|
161
|
+
*,
|
|
162
|
+
client: AuthenticatedClient | Client,
|
|
163
|
+
since_date: Unset | datetime.date = UNSET,
|
|
164
|
+
type_: Unset | GetTransactionsByCategoryType = UNSET,
|
|
165
|
+
last_knowledge_of_server: Unset | int = UNSET,
|
|
166
|
+
) -> Response[ErrorResponse | HybridTransactionsResponse]:
|
|
167
|
+
"""List category transactions, excluding any pending transactions
|
|
168
|
+
|
|
169
|
+
Returns all transactions for a specified category
|
|
170
|
+
|
|
171
|
+
Args:
|
|
172
|
+
budget_id (str):
|
|
173
|
+
category_id (str):
|
|
174
|
+
since_date (Union[Unset, datetime.date]):
|
|
175
|
+
type_ (Union[Unset, GetTransactionsByCategoryType]):
|
|
176
|
+
last_knowledge_of_server (Union[Unset, int]):
|
|
177
|
+
|
|
178
|
+
Raises:
|
|
179
|
+
errors.UnexpectedStatusError: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
180
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
181
|
+
|
|
182
|
+
Returns:
|
|
183
|
+
Response[Union[ErrorResponse, HybridTransactionsResponse]]
|
|
184
|
+
"""
|
|
185
|
+
|
|
186
|
+
kwargs = _get_kwargs(
|
|
187
|
+
budget_id=budget_id,
|
|
188
|
+
category_id=category_id,
|
|
189
|
+
since_date=since_date,
|
|
190
|
+
type_=type_,
|
|
191
|
+
last_knowledge_of_server=last_knowledge_of_server,
|
|
192
|
+
)
|
|
193
|
+
|
|
194
|
+
response = await client.get_async_httpx_client().request(**kwargs)
|
|
195
|
+
|
|
196
|
+
return _build_response(client=client, response=response)
|
|
197
|
+
|
|
198
|
+
|
|
199
|
+
async def asyncio(
|
|
200
|
+
budget_id: str,
|
|
201
|
+
category_id: str,
|
|
202
|
+
*,
|
|
203
|
+
client: AuthenticatedClient | Client,
|
|
204
|
+
since_date: Unset | datetime.date = UNSET,
|
|
205
|
+
type_: Unset | GetTransactionsByCategoryType = UNSET,
|
|
206
|
+
last_knowledge_of_server: Unset | int = UNSET,
|
|
207
|
+
) -> ErrorResponse | HybridTransactionsResponse | None:
|
|
208
|
+
"""List category transactions, excluding any pending transactions
|
|
209
|
+
|
|
210
|
+
Returns all transactions for a specified category
|
|
211
|
+
|
|
212
|
+
Args:
|
|
213
|
+
budget_id (str):
|
|
214
|
+
category_id (str):
|
|
215
|
+
since_date (Union[Unset, datetime.date]):
|
|
216
|
+
type_ (Union[Unset, GetTransactionsByCategoryType]):
|
|
217
|
+
last_knowledge_of_server (Union[Unset, int]):
|
|
218
|
+
|
|
219
|
+
Raises:
|
|
220
|
+
errors.UnexpectedStatusError: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
221
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
222
|
+
|
|
223
|
+
Returns:
|
|
224
|
+
Union[ErrorResponse, HybridTransactionsResponse]
|
|
225
|
+
"""
|
|
226
|
+
|
|
227
|
+
return (
|
|
228
|
+
await asyncio_detailed(
|
|
229
|
+
budget_id=budget_id,
|
|
230
|
+
category_id=category_id,
|
|
231
|
+
client=client,
|
|
232
|
+
since_date=since_date,
|
|
233
|
+
type_=type_,
|
|
234
|
+
last_knowledge_of_server=last_knowledge_of_server,
|
|
235
|
+
)
|
|
236
|
+
).parsed
|
|
@@ -0,0 +1,236 @@
|
|
|
1
|
+
import datetime
|
|
2
|
+
from http import HTTPStatus
|
|
3
|
+
from typing import Any
|
|
4
|
+
|
|
5
|
+
import httpx
|
|
6
|
+
|
|
7
|
+
from ynab_cli.adapters.ynab import errors
|
|
8
|
+
from ynab_cli.adapters.ynab.client import AuthenticatedClient, Client
|
|
9
|
+
from ynab_cli.adapters.ynab.models.error_response import ErrorResponse
|
|
10
|
+
from ynab_cli.adapters.ynab.models.get_transactions_by_month_type import GetTransactionsByMonthType
|
|
11
|
+
from ynab_cli.adapters.ynab.models.hybrid_transactions_response import HybridTransactionsResponse
|
|
12
|
+
from ynab_cli.adapters.ynab.types import UNSET, Response, Unset
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
def _get_kwargs(
|
|
16
|
+
budget_id: str,
|
|
17
|
+
month: str,
|
|
18
|
+
*,
|
|
19
|
+
since_date: Unset | datetime.date = UNSET,
|
|
20
|
+
type_: Unset | GetTransactionsByMonthType = UNSET,
|
|
21
|
+
last_knowledge_of_server: Unset | int = UNSET,
|
|
22
|
+
) -> dict[str, Any]:
|
|
23
|
+
params: dict[str, Any] = {}
|
|
24
|
+
|
|
25
|
+
json_since_date: Unset | str = UNSET
|
|
26
|
+
if not isinstance(since_date, Unset):
|
|
27
|
+
json_since_date = since_date.isoformat()
|
|
28
|
+
params["since_date"] = json_since_date
|
|
29
|
+
|
|
30
|
+
json_type_: Unset | str = UNSET
|
|
31
|
+
if not isinstance(type_, Unset):
|
|
32
|
+
json_type_ = type_.value
|
|
33
|
+
|
|
34
|
+
params["type"] = json_type_
|
|
35
|
+
|
|
36
|
+
params["last_knowledge_of_server"] = last_knowledge_of_server
|
|
37
|
+
|
|
38
|
+
params = {k: v for k, v in params.items() if v is not UNSET and v is not None}
|
|
39
|
+
|
|
40
|
+
_kwargs: dict[str, Any] = {
|
|
41
|
+
"method": "get",
|
|
42
|
+
"url": f"/budgets/{budget_id}/months/{month}/transactions",
|
|
43
|
+
"params": params,
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
return _kwargs
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
def _parse_response(
|
|
50
|
+
*, client: AuthenticatedClient | Client, response: httpx.Response
|
|
51
|
+
) -> ErrorResponse | HybridTransactionsResponse | None:
|
|
52
|
+
if response.status_code == 200:
|
|
53
|
+
response_200 = HybridTransactionsResponse.from_dict(response.json())
|
|
54
|
+
|
|
55
|
+
return response_200
|
|
56
|
+
if response.status_code == 404:
|
|
57
|
+
response_404 = ErrorResponse.from_dict(response.json())
|
|
58
|
+
|
|
59
|
+
return response_404
|
|
60
|
+
if client.raise_on_unexpected_status:
|
|
61
|
+
raise errors.UnexpectedStatusError(response.status_code, response.content)
|
|
62
|
+
else:
|
|
63
|
+
return None
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
def _build_response(
|
|
67
|
+
*, client: AuthenticatedClient | Client, response: httpx.Response
|
|
68
|
+
) -> Response[ErrorResponse | HybridTransactionsResponse]:
|
|
69
|
+
return Response(
|
|
70
|
+
status_code=HTTPStatus(response.status_code),
|
|
71
|
+
content=response.content,
|
|
72
|
+
headers=response.headers,
|
|
73
|
+
parsed=_parse_response(client=client, response=response),
|
|
74
|
+
)
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
def sync_detailed(
|
|
78
|
+
budget_id: str,
|
|
79
|
+
month: str,
|
|
80
|
+
*,
|
|
81
|
+
client: AuthenticatedClient | Client,
|
|
82
|
+
since_date: Unset | datetime.date = UNSET,
|
|
83
|
+
type_: Unset | GetTransactionsByMonthType = UNSET,
|
|
84
|
+
last_knowledge_of_server: Unset | int = UNSET,
|
|
85
|
+
) -> Response[ErrorResponse | HybridTransactionsResponse]:
|
|
86
|
+
"""List transactions in month, excluding any pending transactions
|
|
87
|
+
|
|
88
|
+
Returns all transactions for a specified month
|
|
89
|
+
|
|
90
|
+
Args:
|
|
91
|
+
budget_id (str):
|
|
92
|
+
month (str):
|
|
93
|
+
since_date (Union[Unset, datetime.date]):
|
|
94
|
+
type_ (Union[Unset, GetTransactionsByMonthType]):
|
|
95
|
+
last_knowledge_of_server (Union[Unset, int]):
|
|
96
|
+
|
|
97
|
+
Raises:
|
|
98
|
+
errors.UnexpectedStatusError: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
99
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
100
|
+
|
|
101
|
+
Returns:
|
|
102
|
+
Response[Union[ErrorResponse, HybridTransactionsResponse]]
|
|
103
|
+
"""
|
|
104
|
+
|
|
105
|
+
kwargs = _get_kwargs(
|
|
106
|
+
budget_id=budget_id,
|
|
107
|
+
month=month,
|
|
108
|
+
since_date=since_date,
|
|
109
|
+
type_=type_,
|
|
110
|
+
last_knowledge_of_server=last_knowledge_of_server,
|
|
111
|
+
)
|
|
112
|
+
|
|
113
|
+
response = client.get_httpx_client().request(
|
|
114
|
+
**kwargs,
|
|
115
|
+
)
|
|
116
|
+
|
|
117
|
+
return _build_response(client=client, response=response)
|
|
118
|
+
|
|
119
|
+
|
|
120
|
+
def sync(
|
|
121
|
+
budget_id: str,
|
|
122
|
+
month: str,
|
|
123
|
+
*,
|
|
124
|
+
client: AuthenticatedClient | Client,
|
|
125
|
+
since_date: Unset | datetime.date = UNSET,
|
|
126
|
+
type_: Unset | GetTransactionsByMonthType = UNSET,
|
|
127
|
+
last_knowledge_of_server: Unset | int = UNSET,
|
|
128
|
+
) -> ErrorResponse | HybridTransactionsResponse | None:
|
|
129
|
+
"""List transactions in month, excluding any pending transactions
|
|
130
|
+
|
|
131
|
+
Returns all transactions for a specified month
|
|
132
|
+
|
|
133
|
+
Args:
|
|
134
|
+
budget_id (str):
|
|
135
|
+
month (str):
|
|
136
|
+
since_date (Union[Unset, datetime.date]):
|
|
137
|
+
type_ (Union[Unset, GetTransactionsByMonthType]):
|
|
138
|
+
last_knowledge_of_server (Union[Unset, int]):
|
|
139
|
+
|
|
140
|
+
Raises:
|
|
141
|
+
errors.UnexpectedStatusError: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
142
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
143
|
+
|
|
144
|
+
Returns:
|
|
145
|
+
Union[ErrorResponse, HybridTransactionsResponse]
|
|
146
|
+
"""
|
|
147
|
+
|
|
148
|
+
return sync_detailed(
|
|
149
|
+
budget_id=budget_id,
|
|
150
|
+
month=month,
|
|
151
|
+
client=client,
|
|
152
|
+
since_date=since_date,
|
|
153
|
+
type_=type_,
|
|
154
|
+
last_knowledge_of_server=last_knowledge_of_server,
|
|
155
|
+
).parsed
|
|
156
|
+
|
|
157
|
+
|
|
158
|
+
async def asyncio_detailed(
|
|
159
|
+
budget_id: str,
|
|
160
|
+
month: str,
|
|
161
|
+
*,
|
|
162
|
+
client: AuthenticatedClient | Client,
|
|
163
|
+
since_date: Unset | datetime.date = UNSET,
|
|
164
|
+
type_: Unset | GetTransactionsByMonthType = UNSET,
|
|
165
|
+
last_knowledge_of_server: Unset | int = UNSET,
|
|
166
|
+
) -> Response[ErrorResponse | HybridTransactionsResponse]:
|
|
167
|
+
"""List transactions in month, excluding any pending transactions
|
|
168
|
+
|
|
169
|
+
Returns all transactions for a specified month
|
|
170
|
+
|
|
171
|
+
Args:
|
|
172
|
+
budget_id (str):
|
|
173
|
+
month (str):
|
|
174
|
+
since_date (Union[Unset, datetime.date]):
|
|
175
|
+
type_ (Union[Unset, GetTransactionsByMonthType]):
|
|
176
|
+
last_knowledge_of_server (Union[Unset, int]):
|
|
177
|
+
|
|
178
|
+
Raises:
|
|
179
|
+
errors.UnexpectedStatusError: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
180
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
181
|
+
|
|
182
|
+
Returns:
|
|
183
|
+
Response[Union[ErrorResponse, HybridTransactionsResponse]]
|
|
184
|
+
"""
|
|
185
|
+
|
|
186
|
+
kwargs = _get_kwargs(
|
|
187
|
+
budget_id=budget_id,
|
|
188
|
+
month=month,
|
|
189
|
+
since_date=since_date,
|
|
190
|
+
type_=type_,
|
|
191
|
+
last_knowledge_of_server=last_knowledge_of_server,
|
|
192
|
+
)
|
|
193
|
+
|
|
194
|
+
response = await client.get_async_httpx_client().request(**kwargs)
|
|
195
|
+
|
|
196
|
+
return _build_response(client=client, response=response)
|
|
197
|
+
|
|
198
|
+
|
|
199
|
+
async def asyncio(
|
|
200
|
+
budget_id: str,
|
|
201
|
+
month: str,
|
|
202
|
+
*,
|
|
203
|
+
client: AuthenticatedClient | Client,
|
|
204
|
+
since_date: Unset | datetime.date = UNSET,
|
|
205
|
+
type_: Unset | GetTransactionsByMonthType = UNSET,
|
|
206
|
+
last_knowledge_of_server: Unset | int = UNSET,
|
|
207
|
+
) -> ErrorResponse | HybridTransactionsResponse | None:
|
|
208
|
+
"""List transactions in month, excluding any pending transactions
|
|
209
|
+
|
|
210
|
+
Returns all transactions for a specified month
|
|
211
|
+
|
|
212
|
+
Args:
|
|
213
|
+
budget_id (str):
|
|
214
|
+
month (str):
|
|
215
|
+
since_date (Union[Unset, datetime.date]):
|
|
216
|
+
type_ (Union[Unset, GetTransactionsByMonthType]):
|
|
217
|
+
last_knowledge_of_server (Union[Unset, int]):
|
|
218
|
+
|
|
219
|
+
Raises:
|
|
220
|
+
errors.UnexpectedStatusError: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
221
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
222
|
+
|
|
223
|
+
Returns:
|
|
224
|
+
Union[ErrorResponse, HybridTransactionsResponse]
|
|
225
|
+
"""
|
|
226
|
+
|
|
227
|
+
return (
|
|
228
|
+
await asyncio_detailed(
|
|
229
|
+
budget_id=budget_id,
|
|
230
|
+
month=month,
|
|
231
|
+
client=client,
|
|
232
|
+
since_date=since_date,
|
|
233
|
+
type_=type_,
|
|
234
|
+
last_knowledge_of_server=last_knowledge_of_server,
|
|
235
|
+
)
|
|
236
|
+
).parsed
|
|
@@ -0,0 +1,236 @@
|
|
|
1
|
+
import datetime
|
|
2
|
+
from http import HTTPStatus
|
|
3
|
+
from typing import Any
|
|
4
|
+
|
|
5
|
+
import httpx
|
|
6
|
+
|
|
7
|
+
from ynab_cli.adapters.ynab import errors
|
|
8
|
+
from ynab_cli.adapters.ynab.client import AuthenticatedClient, Client
|
|
9
|
+
from ynab_cli.adapters.ynab.models.error_response import ErrorResponse
|
|
10
|
+
from ynab_cli.adapters.ynab.models.get_transactions_by_payee_type import GetTransactionsByPayeeType
|
|
11
|
+
from ynab_cli.adapters.ynab.models.hybrid_transactions_response import HybridTransactionsResponse
|
|
12
|
+
from ynab_cli.adapters.ynab.types import UNSET, Response, Unset
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
def _get_kwargs(
|
|
16
|
+
budget_id: str,
|
|
17
|
+
payee_id: str,
|
|
18
|
+
*,
|
|
19
|
+
since_date: Unset | datetime.date = UNSET,
|
|
20
|
+
type_: Unset | GetTransactionsByPayeeType = UNSET,
|
|
21
|
+
last_knowledge_of_server: Unset | int = UNSET,
|
|
22
|
+
) -> dict[str, Any]:
|
|
23
|
+
params: dict[str, Any] = {}
|
|
24
|
+
|
|
25
|
+
json_since_date: Unset | str = UNSET
|
|
26
|
+
if not isinstance(since_date, Unset):
|
|
27
|
+
json_since_date = since_date.isoformat()
|
|
28
|
+
params["since_date"] = json_since_date
|
|
29
|
+
|
|
30
|
+
json_type_: Unset | str = UNSET
|
|
31
|
+
if not isinstance(type_, Unset):
|
|
32
|
+
json_type_ = type_.value
|
|
33
|
+
|
|
34
|
+
params["type"] = json_type_
|
|
35
|
+
|
|
36
|
+
params["last_knowledge_of_server"] = last_knowledge_of_server
|
|
37
|
+
|
|
38
|
+
params = {k: v for k, v in params.items() if v is not UNSET and v is not None}
|
|
39
|
+
|
|
40
|
+
_kwargs: dict[str, Any] = {
|
|
41
|
+
"method": "get",
|
|
42
|
+
"url": f"/budgets/{budget_id}/payees/{payee_id}/transactions",
|
|
43
|
+
"params": params,
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
return _kwargs
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
def _parse_response(
|
|
50
|
+
*, client: AuthenticatedClient | Client, response: httpx.Response
|
|
51
|
+
) -> ErrorResponse | HybridTransactionsResponse | None:
|
|
52
|
+
if response.status_code == 200:
|
|
53
|
+
response_200 = HybridTransactionsResponse.from_dict(response.json())
|
|
54
|
+
|
|
55
|
+
return response_200
|
|
56
|
+
if response.status_code == 404:
|
|
57
|
+
response_404 = ErrorResponse.from_dict(response.json())
|
|
58
|
+
|
|
59
|
+
return response_404
|
|
60
|
+
if client.raise_on_unexpected_status:
|
|
61
|
+
raise errors.UnexpectedStatusError(response.status_code, response.content)
|
|
62
|
+
else:
|
|
63
|
+
return None
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
def _build_response(
|
|
67
|
+
*, client: AuthenticatedClient | Client, response: httpx.Response
|
|
68
|
+
) -> Response[ErrorResponse | HybridTransactionsResponse]:
|
|
69
|
+
return Response(
|
|
70
|
+
status_code=HTTPStatus(response.status_code),
|
|
71
|
+
content=response.content,
|
|
72
|
+
headers=response.headers,
|
|
73
|
+
parsed=_parse_response(client=client, response=response),
|
|
74
|
+
)
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
def sync_detailed(
|
|
78
|
+
budget_id: str,
|
|
79
|
+
payee_id: str,
|
|
80
|
+
*,
|
|
81
|
+
client: AuthenticatedClient | Client,
|
|
82
|
+
since_date: Unset | datetime.date = UNSET,
|
|
83
|
+
type_: Unset | GetTransactionsByPayeeType = UNSET,
|
|
84
|
+
last_knowledge_of_server: Unset | int = UNSET,
|
|
85
|
+
) -> Response[ErrorResponse | HybridTransactionsResponse]:
|
|
86
|
+
"""List payee transactions, excluding any pending transactions
|
|
87
|
+
|
|
88
|
+
Returns all transactions for a specified payee
|
|
89
|
+
|
|
90
|
+
Args:
|
|
91
|
+
budget_id (str):
|
|
92
|
+
payee_id (str):
|
|
93
|
+
since_date (Union[Unset, datetime.date]):
|
|
94
|
+
type_ (Union[Unset, GetTransactionsByPayeeType]):
|
|
95
|
+
last_knowledge_of_server (Union[Unset, int]):
|
|
96
|
+
|
|
97
|
+
Raises:
|
|
98
|
+
errors.UnexpectedStatusError: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
99
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
100
|
+
|
|
101
|
+
Returns:
|
|
102
|
+
Response[Union[ErrorResponse, HybridTransactionsResponse]]
|
|
103
|
+
"""
|
|
104
|
+
|
|
105
|
+
kwargs = _get_kwargs(
|
|
106
|
+
budget_id=budget_id,
|
|
107
|
+
payee_id=payee_id,
|
|
108
|
+
since_date=since_date,
|
|
109
|
+
type_=type_,
|
|
110
|
+
last_knowledge_of_server=last_knowledge_of_server,
|
|
111
|
+
)
|
|
112
|
+
|
|
113
|
+
response = client.get_httpx_client().request(
|
|
114
|
+
**kwargs,
|
|
115
|
+
)
|
|
116
|
+
|
|
117
|
+
return _build_response(client=client, response=response)
|
|
118
|
+
|
|
119
|
+
|
|
120
|
+
def sync(
|
|
121
|
+
budget_id: str,
|
|
122
|
+
payee_id: str,
|
|
123
|
+
*,
|
|
124
|
+
client: AuthenticatedClient | Client,
|
|
125
|
+
since_date: Unset | datetime.date = UNSET,
|
|
126
|
+
type_: Unset | GetTransactionsByPayeeType = UNSET,
|
|
127
|
+
last_knowledge_of_server: Unset | int = UNSET,
|
|
128
|
+
) -> ErrorResponse | HybridTransactionsResponse | None:
|
|
129
|
+
"""List payee transactions, excluding any pending transactions
|
|
130
|
+
|
|
131
|
+
Returns all transactions for a specified payee
|
|
132
|
+
|
|
133
|
+
Args:
|
|
134
|
+
budget_id (str):
|
|
135
|
+
payee_id (str):
|
|
136
|
+
since_date (Union[Unset, datetime.date]):
|
|
137
|
+
type_ (Union[Unset, GetTransactionsByPayeeType]):
|
|
138
|
+
last_knowledge_of_server (Union[Unset, int]):
|
|
139
|
+
|
|
140
|
+
Raises:
|
|
141
|
+
errors.UnexpectedStatusError: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
142
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
143
|
+
|
|
144
|
+
Returns:
|
|
145
|
+
Union[ErrorResponse, HybridTransactionsResponse]
|
|
146
|
+
"""
|
|
147
|
+
|
|
148
|
+
return sync_detailed(
|
|
149
|
+
budget_id=budget_id,
|
|
150
|
+
payee_id=payee_id,
|
|
151
|
+
client=client,
|
|
152
|
+
since_date=since_date,
|
|
153
|
+
type_=type_,
|
|
154
|
+
last_knowledge_of_server=last_knowledge_of_server,
|
|
155
|
+
).parsed
|
|
156
|
+
|
|
157
|
+
|
|
158
|
+
async def asyncio_detailed(
|
|
159
|
+
budget_id: str,
|
|
160
|
+
payee_id: str,
|
|
161
|
+
*,
|
|
162
|
+
client: AuthenticatedClient | Client,
|
|
163
|
+
since_date: Unset | datetime.date = UNSET,
|
|
164
|
+
type_: Unset | GetTransactionsByPayeeType = UNSET,
|
|
165
|
+
last_knowledge_of_server: Unset | int = UNSET,
|
|
166
|
+
) -> Response[ErrorResponse | HybridTransactionsResponse]:
|
|
167
|
+
"""List payee transactions, excluding any pending transactions
|
|
168
|
+
|
|
169
|
+
Returns all transactions for a specified payee
|
|
170
|
+
|
|
171
|
+
Args:
|
|
172
|
+
budget_id (str):
|
|
173
|
+
payee_id (str):
|
|
174
|
+
since_date (Union[Unset, datetime.date]):
|
|
175
|
+
type_ (Union[Unset, GetTransactionsByPayeeType]):
|
|
176
|
+
last_knowledge_of_server (Union[Unset, int]):
|
|
177
|
+
|
|
178
|
+
Raises:
|
|
179
|
+
errors.UnexpectedStatusError: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
180
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
181
|
+
|
|
182
|
+
Returns:
|
|
183
|
+
Response[Union[ErrorResponse, HybridTransactionsResponse]]
|
|
184
|
+
"""
|
|
185
|
+
|
|
186
|
+
kwargs = _get_kwargs(
|
|
187
|
+
budget_id=budget_id,
|
|
188
|
+
payee_id=payee_id,
|
|
189
|
+
since_date=since_date,
|
|
190
|
+
type_=type_,
|
|
191
|
+
last_knowledge_of_server=last_knowledge_of_server,
|
|
192
|
+
)
|
|
193
|
+
|
|
194
|
+
response = await client.get_async_httpx_client().request(**kwargs)
|
|
195
|
+
|
|
196
|
+
return _build_response(client=client, response=response)
|
|
197
|
+
|
|
198
|
+
|
|
199
|
+
async def asyncio(
|
|
200
|
+
budget_id: str,
|
|
201
|
+
payee_id: str,
|
|
202
|
+
*,
|
|
203
|
+
client: AuthenticatedClient | Client,
|
|
204
|
+
since_date: Unset | datetime.date = UNSET,
|
|
205
|
+
type_: Unset | GetTransactionsByPayeeType = UNSET,
|
|
206
|
+
last_knowledge_of_server: Unset | int = UNSET,
|
|
207
|
+
) -> ErrorResponse | HybridTransactionsResponse | None:
|
|
208
|
+
"""List payee transactions, excluding any pending transactions
|
|
209
|
+
|
|
210
|
+
Returns all transactions for a specified payee
|
|
211
|
+
|
|
212
|
+
Args:
|
|
213
|
+
budget_id (str):
|
|
214
|
+
payee_id (str):
|
|
215
|
+
since_date (Union[Unset, datetime.date]):
|
|
216
|
+
type_ (Union[Unset, GetTransactionsByPayeeType]):
|
|
217
|
+
last_knowledge_of_server (Union[Unset, int]):
|
|
218
|
+
|
|
219
|
+
Raises:
|
|
220
|
+
errors.UnexpectedStatusError: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
221
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
222
|
+
|
|
223
|
+
Returns:
|
|
224
|
+
Union[ErrorResponse, HybridTransactionsResponse]
|
|
225
|
+
"""
|
|
226
|
+
|
|
227
|
+
return (
|
|
228
|
+
await asyncio_detailed(
|
|
229
|
+
budget_id=budget_id,
|
|
230
|
+
payee_id=payee_id,
|
|
231
|
+
client=client,
|
|
232
|
+
since_date=since_date,
|
|
233
|
+
type_=type_,
|
|
234
|
+
last_knowledge_of_server=last_knowledge_of_server,
|
|
235
|
+
)
|
|
236
|
+
).parsed
|