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,381 @@
|
|
|
1
|
+
import datetime
|
|
2
|
+
from collections.abc import Mapping
|
|
3
|
+
from typing import TYPE_CHECKING, Any, TypeVar, cast
|
|
4
|
+
from uuid import UUID
|
|
5
|
+
|
|
6
|
+
from attrs import define as _attrs_define
|
|
7
|
+
from attrs import field as _attrs_field
|
|
8
|
+
from dateutil.parser import isoparse
|
|
9
|
+
|
|
10
|
+
from ynab_cli.adapters.ynab.models.scheduled_transaction_summary_frequency import ScheduledTransactionSummaryFrequency
|
|
11
|
+
from ynab_cli.adapters.ynab.models.transaction_flag_color_type_1 import TransactionFlagColorType1
|
|
12
|
+
from ynab_cli.adapters.ynab.models.transaction_flag_color_type_2_type_1 import TransactionFlagColorType2Type1
|
|
13
|
+
from ynab_cli.adapters.ynab.models.transaction_flag_color_type_3_type_1 import TransactionFlagColorType3Type1
|
|
14
|
+
from ynab_cli.adapters.ynab.types import UNSET, Unset
|
|
15
|
+
|
|
16
|
+
if TYPE_CHECKING:
|
|
17
|
+
from ynab_cli.adapters.ynab.models.scheduled_sub_transaction import ScheduledSubTransaction
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
T = TypeVar("T", bound="ScheduledTransactionDetail")
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
@_attrs_define
|
|
24
|
+
class ScheduledTransactionDetail:
|
|
25
|
+
"""
|
|
26
|
+
Attributes:
|
|
27
|
+
id (UUID):
|
|
28
|
+
date_first (datetime.date): The first date for which the Scheduled Transaction was scheduled.
|
|
29
|
+
date_next (datetime.date): The next date for which the Scheduled Transaction is scheduled.
|
|
30
|
+
frequency (ScheduledTransactionSummaryFrequency):
|
|
31
|
+
amount (int): The scheduled transaction amount in milliunits format
|
|
32
|
+
account_id (UUID):
|
|
33
|
+
deleted (bool): Whether or not the scheduled transaction has been deleted. Deleted scheduled transactions will
|
|
34
|
+
only be included in delta requests.
|
|
35
|
+
account_name (str):
|
|
36
|
+
subtransactions (list['ScheduledSubTransaction']): If a split scheduled transaction, the subtransactions.
|
|
37
|
+
memo (Union[None, Unset, str]):
|
|
38
|
+
flag_color (Union[None, TransactionFlagColorType1, TransactionFlagColorType2Type1,
|
|
39
|
+
TransactionFlagColorType3Type1, Unset]): The transaction flag
|
|
40
|
+
flag_name (Union[None, Unset, str]): The customized name of a transaction flag
|
|
41
|
+
payee_id (Union[None, UUID, Unset]):
|
|
42
|
+
category_id (Union[None, UUID, Unset]):
|
|
43
|
+
transfer_account_id (Union[None, UUID, Unset]): If a transfer, the account_id which the scheduled transaction
|
|
44
|
+
transfers to
|
|
45
|
+
payee_name (Union[None, Unset, str]):
|
|
46
|
+
category_name (Union[None, Unset, str]): The name of the category. If a split scheduled transaction, this will
|
|
47
|
+
be 'Split'.
|
|
48
|
+
"""
|
|
49
|
+
|
|
50
|
+
id: UUID
|
|
51
|
+
date_first: datetime.date
|
|
52
|
+
date_next: datetime.date
|
|
53
|
+
frequency: ScheduledTransactionSummaryFrequency
|
|
54
|
+
amount: int
|
|
55
|
+
account_id: UUID
|
|
56
|
+
deleted: bool
|
|
57
|
+
account_name: str
|
|
58
|
+
subtransactions: list["ScheduledSubTransaction"]
|
|
59
|
+
memo: None | Unset | str = UNSET
|
|
60
|
+
flag_color: (
|
|
61
|
+
None | TransactionFlagColorType1 | TransactionFlagColorType2Type1 | TransactionFlagColorType3Type1 | Unset
|
|
62
|
+
) = UNSET
|
|
63
|
+
flag_name: None | Unset | str = UNSET
|
|
64
|
+
payee_id: None | UUID | Unset = UNSET
|
|
65
|
+
category_id: None | UUID | Unset = UNSET
|
|
66
|
+
transfer_account_id: None | UUID | Unset = UNSET
|
|
67
|
+
payee_name: None | Unset | str = UNSET
|
|
68
|
+
category_name: None | Unset | str = UNSET
|
|
69
|
+
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
|
70
|
+
|
|
71
|
+
def to_dict(self) -> dict[str, Any]:
|
|
72
|
+
id = str(self.id)
|
|
73
|
+
|
|
74
|
+
date_first = self.date_first.isoformat()
|
|
75
|
+
|
|
76
|
+
date_next = self.date_next.isoformat()
|
|
77
|
+
|
|
78
|
+
frequency = self.frequency.value
|
|
79
|
+
|
|
80
|
+
amount = self.amount
|
|
81
|
+
|
|
82
|
+
account_id = str(self.account_id)
|
|
83
|
+
|
|
84
|
+
deleted = self.deleted
|
|
85
|
+
|
|
86
|
+
account_name = self.account_name
|
|
87
|
+
|
|
88
|
+
subtransactions = []
|
|
89
|
+
for subtransactions_item_data in self.subtransactions:
|
|
90
|
+
subtransactions_item = subtransactions_item_data.to_dict()
|
|
91
|
+
subtransactions.append(subtransactions_item)
|
|
92
|
+
|
|
93
|
+
memo: None | Unset | str
|
|
94
|
+
if isinstance(self.memo, Unset):
|
|
95
|
+
memo = UNSET
|
|
96
|
+
else:
|
|
97
|
+
memo = self.memo
|
|
98
|
+
|
|
99
|
+
flag_color: None | Unset | str
|
|
100
|
+
if isinstance(self.flag_color, Unset):
|
|
101
|
+
flag_color = UNSET
|
|
102
|
+
elif isinstance(self.flag_color, TransactionFlagColorType1):
|
|
103
|
+
flag_color = self.flag_color.value
|
|
104
|
+
elif isinstance(self.flag_color, TransactionFlagColorType2Type1):
|
|
105
|
+
flag_color = self.flag_color.value
|
|
106
|
+
elif isinstance(self.flag_color, TransactionFlagColorType3Type1):
|
|
107
|
+
flag_color = self.flag_color.value
|
|
108
|
+
else:
|
|
109
|
+
flag_color = self.flag_color
|
|
110
|
+
|
|
111
|
+
flag_name: None | Unset | str
|
|
112
|
+
if isinstance(self.flag_name, Unset):
|
|
113
|
+
flag_name = UNSET
|
|
114
|
+
else:
|
|
115
|
+
flag_name = self.flag_name
|
|
116
|
+
|
|
117
|
+
payee_id: None | Unset | str
|
|
118
|
+
if isinstance(self.payee_id, Unset):
|
|
119
|
+
payee_id = UNSET
|
|
120
|
+
elif isinstance(self.payee_id, UUID):
|
|
121
|
+
payee_id = str(self.payee_id)
|
|
122
|
+
else:
|
|
123
|
+
payee_id = self.payee_id
|
|
124
|
+
|
|
125
|
+
category_id: None | Unset | str
|
|
126
|
+
if isinstance(self.category_id, Unset):
|
|
127
|
+
category_id = UNSET
|
|
128
|
+
elif isinstance(self.category_id, UUID):
|
|
129
|
+
category_id = str(self.category_id)
|
|
130
|
+
else:
|
|
131
|
+
category_id = self.category_id
|
|
132
|
+
|
|
133
|
+
transfer_account_id: None | Unset | str
|
|
134
|
+
if isinstance(self.transfer_account_id, Unset):
|
|
135
|
+
transfer_account_id = UNSET
|
|
136
|
+
elif isinstance(self.transfer_account_id, UUID):
|
|
137
|
+
transfer_account_id = str(self.transfer_account_id)
|
|
138
|
+
else:
|
|
139
|
+
transfer_account_id = self.transfer_account_id
|
|
140
|
+
|
|
141
|
+
payee_name: None | Unset | str
|
|
142
|
+
if isinstance(self.payee_name, Unset):
|
|
143
|
+
payee_name = UNSET
|
|
144
|
+
else:
|
|
145
|
+
payee_name = self.payee_name
|
|
146
|
+
|
|
147
|
+
category_name: None | Unset | str
|
|
148
|
+
if isinstance(self.category_name, Unset):
|
|
149
|
+
category_name = UNSET
|
|
150
|
+
else:
|
|
151
|
+
category_name = self.category_name
|
|
152
|
+
|
|
153
|
+
field_dict: dict[str, Any] = {}
|
|
154
|
+
field_dict.update(self.additional_properties)
|
|
155
|
+
field_dict.update(
|
|
156
|
+
{
|
|
157
|
+
"id": id,
|
|
158
|
+
"date_first": date_first,
|
|
159
|
+
"date_next": date_next,
|
|
160
|
+
"frequency": frequency,
|
|
161
|
+
"amount": amount,
|
|
162
|
+
"account_id": account_id,
|
|
163
|
+
"deleted": deleted,
|
|
164
|
+
"account_name": account_name,
|
|
165
|
+
"subtransactions": subtransactions,
|
|
166
|
+
}
|
|
167
|
+
)
|
|
168
|
+
if memo is not UNSET:
|
|
169
|
+
field_dict["memo"] = memo
|
|
170
|
+
if flag_color is not UNSET:
|
|
171
|
+
field_dict["flag_color"] = flag_color
|
|
172
|
+
if flag_name is not UNSET:
|
|
173
|
+
field_dict["flag_name"] = flag_name
|
|
174
|
+
if payee_id is not UNSET:
|
|
175
|
+
field_dict["payee_id"] = payee_id
|
|
176
|
+
if category_id is not UNSET:
|
|
177
|
+
field_dict["category_id"] = category_id
|
|
178
|
+
if transfer_account_id is not UNSET:
|
|
179
|
+
field_dict["transfer_account_id"] = transfer_account_id
|
|
180
|
+
if payee_name is not UNSET:
|
|
181
|
+
field_dict["payee_name"] = payee_name
|
|
182
|
+
if category_name is not UNSET:
|
|
183
|
+
field_dict["category_name"] = category_name
|
|
184
|
+
|
|
185
|
+
return field_dict
|
|
186
|
+
|
|
187
|
+
@classmethod
|
|
188
|
+
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
|
189
|
+
from ynab_cli.adapters.ynab.models.scheduled_sub_transaction import ScheduledSubTransaction
|
|
190
|
+
|
|
191
|
+
d = dict(src_dict)
|
|
192
|
+
id = UUID(d.pop("id"))
|
|
193
|
+
|
|
194
|
+
date_first = isoparse(d.pop("date_first")).date()
|
|
195
|
+
|
|
196
|
+
date_next = isoparse(d.pop("date_next")).date()
|
|
197
|
+
|
|
198
|
+
frequency = ScheduledTransactionSummaryFrequency(d.pop("frequency"))
|
|
199
|
+
|
|
200
|
+
amount = d.pop("amount")
|
|
201
|
+
|
|
202
|
+
account_id = UUID(d.pop("account_id"))
|
|
203
|
+
|
|
204
|
+
deleted = d.pop("deleted")
|
|
205
|
+
|
|
206
|
+
account_name = d.pop("account_name")
|
|
207
|
+
|
|
208
|
+
subtransactions = []
|
|
209
|
+
_subtransactions = d.pop("subtransactions")
|
|
210
|
+
for subtransactions_item_data in _subtransactions:
|
|
211
|
+
subtransactions_item = ScheduledSubTransaction.from_dict(subtransactions_item_data)
|
|
212
|
+
|
|
213
|
+
subtransactions.append(subtransactions_item)
|
|
214
|
+
|
|
215
|
+
def _parse_memo(data: object) -> None | Unset | str:
|
|
216
|
+
if data is None:
|
|
217
|
+
return data
|
|
218
|
+
if isinstance(data, Unset):
|
|
219
|
+
return data
|
|
220
|
+
return cast(None | Unset | str, data)
|
|
221
|
+
|
|
222
|
+
memo = _parse_memo(d.pop("memo", UNSET))
|
|
223
|
+
|
|
224
|
+
def _parse_flag_color(
|
|
225
|
+
data: object,
|
|
226
|
+
) -> None | TransactionFlagColorType1 | TransactionFlagColorType2Type1 | TransactionFlagColorType3Type1 | Unset:
|
|
227
|
+
if data is None:
|
|
228
|
+
return data
|
|
229
|
+
if isinstance(data, Unset):
|
|
230
|
+
return data
|
|
231
|
+
try:
|
|
232
|
+
if not isinstance(data, str):
|
|
233
|
+
raise TypeError()
|
|
234
|
+
componentsschemas_transaction_flag_color_type_1 = TransactionFlagColorType1(data)
|
|
235
|
+
|
|
236
|
+
return componentsschemas_transaction_flag_color_type_1
|
|
237
|
+
except: # noqa: E722
|
|
238
|
+
pass
|
|
239
|
+
try:
|
|
240
|
+
if not isinstance(data, str):
|
|
241
|
+
raise TypeError()
|
|
242
|
+
componentsschemas_transaction_flag_color_type_2_type_1 = TransactionFlagColorType2Type1(data)
|
|
243
|
+
|
|
244
|
+
return componentsschemas_transaction_flag_color_type_2_type_1
|
|
245
|
+
except: # noqa: E722
|
|
246
|
+
pass
|
|
247
|
+
try:
|
|
248
|
+
if not isinstance(data, str):
|
|
249
|
+
raise TypeError()
|
|
250
|
+
componentsschemas_transaction_flag_color_type_3_type_1 = TransactionFlagColorType3Type1(data)
|
|
251
|
+
|
|
252
|
+
return componentsschemas_transaction_flag_color_type_3_type_1
|
|
253
|
+
except: # noqa: E722
|
|
254
|
+
pass
|
|
255
|
+
return cast(
|
|
256
|
+
None
|
|
257
|
+
| TransactionFlagColorType1
|
|
258
|
+
| TransactionFlagColorType2Type1
|
|
259
|
+
| TransactionFlagColorType3Type1
|
|
260
|
+
| Unset,
|
|
261
|
+
data,
|
|
262
|
+
)
|
|
263
|
+
|
|
264
|
+
flag_color = _parse_flag_color(d.pop("flag_color", UNSET))
|
|
265
|
+
|
|
266
|
+
def _parse_flag_name(data: object) -> None | Unset | str:
|
|
267
|
+
if data is None:
|
|
268
|
+
return data
|
|
269
|
+
if isinstance(data, Unset):
|
|
270
|
+
return data
|
|
271
|
+
return cast(None | Unset | str, data)
|
|
272
|
+
|
|
273
|
+
flag_name = _parse_flag_name(d.pop("flag_name", UNSET))
|
|
274
|
+
|
|
275
|
+
def _parse_payee_id(data: object) -> None | UUID | Unset:
|
|
276
|
+
if data is None:
|
|
277
|
+
return data
|
|
278
|
+
if isinstance(data, Unset):
|
|
279
|
+
return data
|
|
280
|
+
try:
|
|
281
|
+
if not isinstance(data, str):
|
|
282
|
+
raise TypeError()
|
|
283
|
+
payee_id_type_0 = UUID(data)
|
|
284
|
+
|
|
285
|
+
return payee_id_type_0
|
|
286
|
+
except: # noqa: E722
|
|
287
|
+
pass
|
|
288
|
+
return cast(None | UUID | Unset, data)
|
|
289
|
+
|
|
290
|
+
payee_id = _parse_payee_id(d.pop("payee_id", UNSET))
|
|
291
|
+
|
|
292
|
+
def _parse_category_id(data: object) -> None | UUID | Unset:
|
|
293
|
+
if data is None:
|
|
294
|
+
return data
|
|
295
|
+
if isinstance(data, Unset):
|
|
296
|
+
return data
|
|
297
|
+
try:
|
|
298
|
+
if not isinstance(data, str):
|
|
299
|
+
raise TypeError()
|
|
300
|
+
category_id_type_0 = UUID(data)
|
|
301
|
+
|
|
302
|
+
return category_id_type_0
|
|
303
|
+
except: # noqa: E722
|
|
304
|
+
pass
|
|
305
|
+
return cast(None | UUID | Unset, data)
|
|
306
|
+
|
|
307
|
+
category_id = _parse_category_id(d.pop("category_id", UNSET))
|
|
308
|
+
|
|
309
|
+
def _parse_transfer_account_id(data: object) -> None | UUID | Unset:
|
|
310
|
+
if data is None:
|
|
311
|
+
return data
|
|
312
|
+
if isinstance(data, Unset):
|
|
313
|
+
return data
|
|
314
|
+
try:
|
|
315
|
+
if not isinstance(data, str):
|
|
316
|
+
raise TypeError()
|
|
317
|
+
transfer_account_id_type_0 = UUID(data)
|
|
318
|
+
|
|
319
|
+
return transfer_account_id_type_0
|
|
320
|
+
except: # noqa: E722
|
|
321
|
+
pass
|
|
322
|
+
return cast(None | UUID | Unset, data)
|
|
323
|
+
|
|
324
|
+
transfer_account_id = _parse_transfer_account_id(d.pop("transfer_account_id", UNSET))
|
|
325
|
+
|
|
326
|
+
def _parse_payee_name(data: object) -> None | Unset | str:
|
|
327
|
+
if data is None:
|
|
328
|
+
return data
|
|
329
|
+
if isinstance(data, Unset):
|
|
330
|
+
return data
|
|
331
|
+
return cast(None | Unset | str, data)
|
|
332
|
+
|
|
333
|
+
payee_name = _parse_payee_name(d.pop("payee_name", UNSET))
|
|
334
|
+
|
|
335
|
+
def _parse_category_name(data: object) -> None | Unset | str:
|
|
336
|
+
if data is None:
|
|
337
|
+
return data
|
|
338
|
+
if isinstance(data, Unset):
|
|
339
|
+
return data
|
|
340
|
+
return cast(None | Unset | str, data)
|
|
341
|
+
|
|
342
|
+
category_name = _parse_category_name(d.pop("category_name", UNSET))
|
|
343
|
+
|
|
344
|
+
scheduled_transaction_detail = cls(
|
|
345
|
+
id=id,
|
|
346
|
+
date_first=date_first,
|
|
347
|
+
date_next=date_next,
|
|
348
|
+
frequency=frequency,
|
|
349
|
+
amount=amount,
|
|
350
|
+
account_id=account_id,
|
|
351
|
+
deleted=deleted,
|
|
352
|
+
account_name=account_name,
|
|
353
|
+
subtransactions=subtransactions,
|
|
354
|
+
memo=memo,
|
|
355
|
+
flag_color=flag_color,
|
|
356
|
+
flag_name=flag_name,
|
|
357
|
+
payee_id=payee_id,
|
|
358
|
+
category_id=category_id,
|
|
359
|
+
transfer_account_id=transfer_account_id,
|
|
360
|
+
payee_name=payee_name,
|
|
361
|
+
category_name=category_name,
|
|
362
|
+
)
|
|
363
|
+
|
|
364
|
+
scheduled_transaction_detail.additional_properties = d
|
|
365
|
+
return scheduled_transaction_detail
|
|
366
|
+
|
|
367
|
+
@property
|
|
368
|
+
def additional_keys(self) -> list[str]:
|
|
369
|
+
return list(self.additional_properties.keys())
|
|
370
|
+
|
|
371
|
+
def __getitem__(self, key: str) -> Any:
|
|
372
|
+
return self.additional_properties[key]
|
|
373
|
+
|
|
374
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
|
375
|
+
self.additional_properties[key] = value
|
|
376
|
+
|
|
377
|
+
def __delitem__(self, key: str) -> None:
|
|
378
|
+
del self.additional_properties[key]
|
|
379
|
+
|
|
380
|
+
def __contains__(self, key: str) -> bool:
|
|
381
|
+
return key in self.additional_properties
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
from enum import Enum
|
|
2
|
+
|
|
3
|
+
from typing_extensions import override
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
class ScheduledTransactionFrequency(str, Enum):
|
|
7
|
+
DAILY = "daily"
|
|
8
|
+
EVERY3MONTHS = "every3Months"
|
|
9
|
+
EVERY4MONTHS = "every4Months"
|
|
10
|
+
EVERY4WEEKS = "every4Weeks"
|
|
11
|
+
EVERYOTHERMONTH = "everyOtherMonth"
|
|
12
|
+
EVERYOTHERWEEK = "everyOtherWeek"
|
|
13
|
+
EVERYOTHERYEAR = "everyOtherYear"
|
|
14
|
+
MONTHLY = "monthly"
|
|
15
|
+
NEVER = "never"
|
|
16
|
+
TWICEAMONTH = "twiceAMonth"
|
|
17
|
+
TWICEAYEAR = "twiceAYear"
|
|
18
|
+
WEEKLY = "weekly"
|
|
19
|
+
YEARLY = "yearly"
|
|
20
|
+
|
|
21
|
+
@override
|
|
22
|
+
def __str__(self) -> str:
|
|
23
|
+
return str(self.value)
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
from collections.abc import Mapping
|
|
2
|
+
from typing import TYPE_CHECKING, Any, TypeVar
|
|
3
|
+
|
|
4
|
+
from attrs import define as _attrs_define
|
|
5
|
+
from attrs import field as _attrs_field
|
|
6
|
+
|
|
7
|
+
if TYPE_CHECKING:
|
|
8
|
+
from ynab_cli.adapters.ynab.models.scheduled_transaction_response_data import ScheduledTransactionResponseData
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
T = TypeVar("T", bound="ScheduledTransactionResponse")
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
@_attrs_define
|
|
15
|
+
class ScheduledTransactionResponse:
|
|
16
|
+
"""
|
|
17
|
+
Attributes:
|
|
18
|
+
data (ScheduledTransactionResponseData):
|
|
19
|
+
"""
|
|
20
|
+
|
|
21
|
+
data: "ScheduledTransactionResponseData"
|
|
22
|
+
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
|
23
|
+
|
|
24
|
+
def to_dict(self) -> dict[str, Any]:
|
|
25
|
+
data = self.data.to_dict()
|
|
26
|
+
|
|
27
|
+
field_dict: dict[str, Any] = {}
|
|
28
|
+
field_dict.update(self.additional_properties)
|
|
29
|
+
field_dict.update(
|
|
30
|
+
{
|
|
31
|
+
"data": data,
|
|
32
|
+
}
|
|
33
|
+
)
|
|
34
|
+
|
|
35
|
+
return field_dict
|
|
36
|
+
|
|
37
|
+
@classmethod
|
|
38
|
+
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
|
39
|
+
from ynab_cli.adapters.ynab.models.scheduled_transaction_response_data import ScheduledTransactionResponseData
|
|
40
|
+
|
|
41
|
+
d = dict(src_dict)
|
|
42
|
+
data = ScheduledTransactionResponseData.from_dict(d.pop("data"))
|
|
43
|
+
|
|
44
|
+
scheduled_transaction_response = cls(
|
|
45
|
+
data=data,
|
|
46
|
+
)
|
|
47
|
+
|
|
48
|
+
scheduled_transaction_response.additional_properties = d
|
|
49
|
+
return scheduled_transaction_response
|
|
50
|
+
|
|
51
|
+
@property
|
|
52
|
+
def additional_keys(self) -> list[str]:
|
|
53
|
+
return list(self.additional_properties.keys())
|
|
54
|
+
|
|
55
|
+
def __getitem__(self, key: str) -> Any:
|
|
56
|
+
return self.additional_properties[key]
|
|
57
|
+
|
|
58
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
|
59
|
+
self.additional_properties[key] = value
|
|
60
|
+
|
|
61
|
+
def __delitem__(self, key: str) -> None:
|
|
62
|
+
del self.additional_properties[key]
|
|
63
|
+
|
|
64
|
+
def __contains__(self, key: str) -> bool:
|
|
65
|
+
return key in self.additional_properties
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
from collections.abc import Mapping
|
|
2
|
+
from typing import TYPE_CHECKING, Any, TypeVar
|
|
3
|
+
|
|
4
|
+
from attrs import define as _attrs_define
|
|
5
|
+
from attrs import field as _attrs_field
|
|
6
|
+
|
|
7
|
+
if TYPE_CHECKING:
|
|
8
|
+
from ynab_cli.adapters.ynab.models.scheduled_transaction_detail import ScheduledTransactionDetail
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
T = TypeVar("T", bound="ScheduledTransactionResponseData")
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
@_attrs_define
|
|
15
|
+
class ScheduledTransactionResponseData:
|
|
16
|
+
"""
|
|
17
|
+
Attributes:
|
|
18
|
+
scheduled_transaction (ScheduledTransactionDetail):
|
|
19
|
+
"""
|
|
20
|
+
|
|
21
|
+
scheduled_transaction: "ScheduledTransactionDetail"
|
|
22
|
+
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
|
23
|
+
|
|
24
|
+
def to_dict(self) -> dict[str, Any]:
|
|
25
|
+
scheduled_transaction = self.scheduled_transaction.to_dict()
|
|
26
|
+
|
|
27
|
+
field_dict: dict[str, Any] = {}
|
|
28
|
+
field_dict.update(self.additional_properties)
|
|
29
|
+
field_dict.update(
|
|
30
|
+
{
|
|
31
|
+
"scheduled_transaction": scheduled_transaction,
|
|
32
|
+
}
|
|
33
|
+
)
|
|
34
|
+
|
|
35
|
+
return field_dict
|
|
36
|
+
|
|
37
|
+
@classmethod
|
|
38
|
+
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
|
39
|
+
from ynab_cli.adapters.ynab.models.scheduled_transaction_detail import ScheduledTransactionDetail
|
|
40
|
+
|
|
41
|
+
d = dict(src_dict)
|
|
42
|
+
scheduled_transaction = ScheduledTransactionDetail.from_dict(d.pop("scheduled_transaction"))
|
|
43
|
+
|
|
44
|
+
scheduled_transaction_response_data = cls(
|
|
45
|
+
scheduled_transaction=scheduled_transaction,
|
|
46
|
+
)
|
|
47
|
+
|
|
48
|
+
scheduled_transaction_response_data.additional_properties = d
|
|
49
|
+
return scheduled_transaction_response_data
|
|
50
|
+
|
|
51
|
+
@property
|
|
52
|
+
def additional_keys(self) -> list[str]:
|
|
53
|
+
return list(self.additional_properties.keys())
|
|
54
|
+
|
|
55
|
+
def __getitem__(self, key: str) -> Any:
|
|
56
|
+
return self.additional_properties[key]
|
|
57
|
+
|
|
58
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
|
59
|
+
self.additional_properties[key] = value
|
|
60
|
+
|
|
61
|
+
def __delitem__(self, key: str) -> None:
|
|
62
|
+
del self.additional_properties[key]
|
|
63
|
+
|
|
64
|
+
def __contains__(self, key: str) -> bool:
|
|
65
|
+
return key in self.additional_properties
|