lunchmoney-python 2.9.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.
- lunchmoney/__init__.py +205 -0
- lunchmoney/api/__init__.py +16 -0
- lunchmoney/api/categories_api.py +1499 -0
- lunchmoney/api/manual_accounts_api.py +1479 -0
- lunchmoney/api/me_api.py +293 -0
- lunchmoney/api/plaid_accounts_api.py +909 -0
- lunchmoney/api/recurring_items_api.py +702 -0
- lunchmoney/api/summary_api.py +434 -0
- lunchmoney/api/tags_api.py +1465 -0
- lunchmoney/api/transactions_api.py +914 -0
- lunchmoney/api/transactions_bulk_api.py +1527 -0
- lunchmoney/api/transactions_files_api.py +891 -0
- lunchmoney/api/transactions_group_api.py +601 -0
- lunchmoney/api/transactions_split_api.py +616 -0
- lunchmoney/api_client.py +805 -0
- lunchmoney/api_response.py +21 -0
- lunchmoney/configuration.py +620 -0
- lunchmoney/exceptions.py +217 -0
- lunchmoney/models/__init__.py +84 -0
- lunchmoney/models/account_type_enum.py +46 -0
- lunchmoney/models/aligned_category_totals_object.py +108 -0
- lunchmoney/models/aligned_summary_category_object.py +110 -0
- lunchmoney/models/aligned_summary_response_object.py +104 -0
- lunchmoney/models/category_object.py +146 -0
- lunchmoney/models/child_category_object.py +141 -0
- lunchmoney/models/child_transaction_object.py +219 -0
- lunchmoney/models/create_category_request_object.py +137 -0
- lunchmoney/models/create_category_request_object_children_inner.py +159 -0
- lunchmoney/models/create_manual_account_request_object.py +138 -0
- lunchmoney/models/create_manual_account_request_object_balance.py +145 -0
- lunchmoney/models/create_new_transactions_request.py +103 -0
- lunchmoney/models/create_tag_request_object.py +112 -0
- lunchmoney/models/currency_enum.py +198 -0
- lunchmoney/models/delete_category_response_with_dependencies.py +94 -0
- lunchmoney/models/delete_category_response_with_dependencies_dependents.py +98 -0
- lunchmoney/models/delete_tag_response_with_dependencies.py +94 -0
- lunchmoney/models/delete_tag_response_with_dependencies_dependents.py +90 -0
- lunchmoney/models/delete_transactions_request.py +89 -0
- lunchmoney/models/error_response_object.py +98 -0
- lunchmoney/models/error_response_object_errors_inner.py +101 -0
- lunchmoney/models/get_all_categories200_response.py +96 -0
- lunchmoney/models/get_all_manual_accounts200_response.py +96 -0
- lunchmoney/models/get_all_plaid_accounts200_response.py +96 -0
- lunchmoney/models/get_all_recurring200_response.py +96 -0
- lunchmoney/models/get_all_tags200_response.py +96 -0
- lunchmoney/models/get_all_transactions200_response.py +100 -0
- lunchmoney/models/get_all_transactions_created_since_parameter.py +145 -0
- lunchmoney/models/get_budget_summary200_response.py +138 -0
- lunchmoney/models/get_transaction_attachment_url200_response.py +91 -0
- lunchmoney/models/group_transactions_request.py +122 -0
- lunchmoney/models/insert_transaction_object.py +164 -0
- lunchmoney/models/insert_transaction_object_amount.py +145 -0
- lunchmoney/models/insert_transactions_response_object.py +106 -0
- lunchmoney/models/manual_account_object.py +158 -0
- lunchmoney/models/non_aligned_category_totals_object.py +94 -0
- lunchmoney/models/non_aligned_summary_category_object.py +94 -0
- lunchmoney/models/non_aligned_summary_response_object.py +104 -0
- lunchmoney/models/plaid_account_object.py +168 -0
- lunchmoney/models/recurring_object.py +143 -0
- lunchmoney/models/recurring_object_matches.py +105 -0
- lunchmoney/models/recurring_object_matches_found_transactions_inner.py +91 -0
- lunchmoney/models/recurring_object_overrides.py +92 -0
- lunchmoney/models/recurring_object_transaction_criteria.py +149 -0
- lunchmoney/models/skipped_existing_external_id_object.py +108 -0
- lunchmoney/models/split_transaction_object.py +102 -0
- lunchmoney/models/split_transaction_object_amount.py +145 -0
- lunchmoney/models/split_transaction_request.py +97 -0
- lunchmoney/models/summary_category_occurrence_object.py +126 -0
- lunchmoney/models/summary_recurring_transaction_object.py +100 -0
- lunchmoney/models/summary_rollover_pool_adjustment_object.py +98 -0
- lunchmoney/models/summary_rollover_pool_object.py +98 -0
- lunchmoney/models/summary_totals_breakdown_object.py +98 -0
- lunchmoney/models/summary_totals_object.py +97 -0
- lunchmoney/models/tag_object.py +125 -0
- lunchmoney/models/transaction_attachment_object.py +106 -0
- lunchmoney/models/transaction_object.py +229 -0
- lunchmoney/models/update_category_request_object.py +156 -0
- lunchmoney/models/update_manual_account_request_object.py +156 -0
- lunchmoney/models/update_manual_account_request_object_balance.py +145 -0
- lunchmoney/models/update_tag_request_object.py +126 -0
- lunchmoney/models/update_transaction_object.py +228 -0
- lunchmoney/models/update_transaction_object_amount.py +145 -0
- lunchmoney/models/update_transactions200_response.py +96 -0
- lunchmoney/models/update_transactions_request.py +97 -0
- lunchmoney/models/update_transactions_request_transactions_inner.py +228 -0
- lunchmoney/models/user_object.py +106 -0
- lunchmoney/py.typed +0 -0
- lunchmoney/rest.py +259 -0
- lunchmoney_python-2.9.0.dist-info/METADATA +285 -0
- lunchmoney_python-2.9.0.dist-info/RECORD +92 -0
- lunchmoney_python-2.9.0.dist-info/WHEEL +5 -0
- lunchmoney_python-2.9.0.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
"""
|
|
4
|
+
Lunch Money API - v2
|
|
5
|
+
|
|
6
|
+
Welcome to the Lunch Money v2 API. A working version of this API is now available through these docs, or directly at: `https://api.lunchmoney.dev/v2` <span class=\"red-text\"><strong>This is in alpha launch of a major API update. It is still subject to change during this alpha review period and bugs may still exist. Users are strongly encouraged to use the mock service or to create a test budget with example data as the first step to interacting with the v2 API.</strong></span> See the [Getting Started Guide](https://alpha.lunchmoney.dev/v2/getting-started) for more information on using a test budget.<br<br> If you are new to the v2 API, you may wish to review the [v2 API Overview of Changes](https://alpha.lunchmoney.dev/v2/changelog). ### Static Mock Server You may also use these docs to explore the API using a static mock server endpoint.<p> This enables users to become familiar with the API without having to create an access token, and eliminates the possibility of modifying real data. <p> To access this endpoint select the second endpoint in the the \"Server\" dropdown to the right. When selected you should see \"Static Mock v2 Lunch Money API Server\".<br> When using this server, set your Bearer token to any string with 11 or more characters. ### Migrating from V1 The v2 API is NOT backwards compatible with the v1 API. Developers are encouraged to review the [Migration Guide](https://alpha.lunchmoney.dev/v2/migration-guide) to understand the changes and plan their migration. ### Acknowledgments If you have been providing feedback on the API during our iterative design process, **THANK YOU**. We are happy to provide the opportunity to finally interact with the working API that was built based on your feedback. ### Useful links: - [Getting Started](https://alpha.lunchmoney.dev/v2/getting-started) - [v2 API Changelog](https://alpha.lunchmoney.dev/v2/changelog) - [Migration Guide](https://alpha.lunchmoney.dev/v2/migration-guide) - [Rate Limits](https://alpha.lunchmoney.dev/v2/rate-limits) - [Current v1 Lunch Money API Documentation](https://lunchmoney.dev) - [Awesome Lunch Money Projects](https://github.com/lunch-money/awesome-lunchmoney?tab=readme-ov-file)
|
|
7
|
+
|
|
8
|
+
The version of the OpenAPI document: 2.8.4
|
|
9
|
+
Contact: devsupport@lunchmoney.app
|
|
10
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
|
11
|
+
|
|
12
|
+
Do not edit the class manually.
|
|
13
|
+
""" # noqa: E501
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
from __future__ import annotations
|
|
17
|
+
import pprint
|
|
18
|
+
import re # noqa: F401
|
|
19
|
+
import json
|
|
20
|
+
|
|
21
|
+
from datetime import datetime
|
|
22
|
+
from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictInt, StrictStr
|
|
23
|
+
from typing import Any, ClassVar, Dict, List, Optional
|
|
24
|
+
from typing_extensions import Annotated
|
|
25
|
+
from lunchmoney.models.create_category_request_object_children_inner import CreateCategoryRequestObjectChildrenInner
|
|
26
|
+
from typing import Optional, Set
|
|
27
|
+
from typing_extensions import Self
|
|
28
|
+
|
|
29
|
+
class UpdateCategoryRequestObject(BaseModel):
|
|
30
|
+
"""
|
|
31
|
+
UpdateCategoryRequestObject
|
|
32
|
+
""" # noqa: E501
|
|
33
|
+
name: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=100)]] = Field(default=None, description="If set, the new name of the category. Must be between 1 and 100 characters.")
|
|
34
|
+
description: Optional[Annotated[str, Field(min_length=0, strict=True, max_length=200)]] = Field(default=None, description="If set, the new description of the category. Must not exceed 200 characters.")
|
|
35
|
+
is_income: Optional[StrictBool] = Field(default=None, description="If set, will indicate if this category will be treated as income. (See <a href=\"https://support.lunchmoney.app/setup/categories/category-properties\">Category Properties</a> for more details)")
|
|
36
|
+
exclude_from_budget: Optional[StrictBool] = Field(default=None, description="If set, will indicate if this category will be excluded from budgets. (See <a href=\"https://support.lunchmoney.app/setup/categories/category-properties\">Category Properties</a> for more details)")
|
|
37
|
+
exclude_from_totals: Optional[StrictBool] = Field(default=None, description="If set, will indicate if this category will be excluded from totals. (See <a href=\"https://support.lunchmoney.app/setup/categories/category-properties\">Category Properties</a> for more details)")
|
|
38
|
+
archived: Optional[StrictBool] = Field(default=None, description="If set, will indicate if this category is archived.")
|
|
39
|
+
group_id: Optional[StrictInt] = Field(default=None, description="If set to the ID of an existing category group, and this category is not itself a category group, this category will be a child of the specified group.")
|
|
40
|
+
is_group: Optional[StrictBool] = Field(default=False, description="This attribute may not be set to a value that is different than the current status of the category or category group. In other words, this API may not be used to convert a category to a category group or vice versa.")
|
|
41
|
+
children: Optional[List[CreateCategoryRequestObjectChildrenInner]] = Field(default=None, description="The list of existing category objects, or existing category IDs or names of new categories to add to the new category group. This attribute should only be set if modifying an existing category group.<br> The categories or IDs specified must already exist and not belong to an existing category group. Categories that already belong to another category group will be moved. If strings are specified, they will be used as the names of new categories that will be added to the new category group. The request will fail if any names are the same as the name of an existing category.<br> It is permissible to provide both full category objects and IDs as well as strings for names in the same request.")
|
|
42
|
+
order: Optional[StrictInt] = Field(default=None, description="An index specifying the position in which the category is displayed on the categories page in the Lunch Money GUI. For categories within a category group the order is relative to the other categories within the group.<br>While this property can be set via the API it is generally set by the user in the Lunch Money GUI. API.")
|
|
43
|
+
collapsed: Optional[StrictBool] = Field(default=None, description="If `true`, the category is collapsed in the Lunch Money GUI.<br>While this property can be set via the API it is generally set by the user in the Lunch Money GUI.")
|
|
44
|
+
id: Optional[StrictInt] = Field(default=None, description="System defined unique identifier for the category. Ignored if set.")
|
|
45
|
+
archived_at: Optional[StrictStr] = Field(default=None, description="System set date and time of when the category was last archived (in the ISO 8601 extended format). Ignored if set.")
|
|
46
|
+
updated_at: Optional[datetime] = Field(default=None, description="System set date and time of when the category was last updated (in the ISO 8601 extended format). Ignored if set.")
|
|
47
|
+
created_at: Optional[datetime] = Field(default=None, description="System set date and time of when the category was created (in the ISO 8601 extended format). Ignored if set. (in the ISO 8601 extended format). Ignored if set.")
|
|
48
|
+
__properties: ClassVar[List[str]] = ["name", "description", "is_income", "exclude_from_budget", "exclude_from_totals", "archived", "group_id", "is_group", "children", "order", "collapsed", "id", "archived_at", "updated_at", "created_at"]
|
|
49
|
+
|
|
50
|
+
model_config = ConfigDict(
|
|
51
|
+
populate_by_name=True,
|
|
52
|
+
validate_assignment=True,
|
|
53
|
+
protected_namespaces=(),
|
|
54
|
+
)
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
def to_str(self) -> str:
|
|
58
|
+
"""Returns the string representation of the model using alias"""
|
|
59
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
60
|
+
|
|
61
|
+
def to_json(self) -> str:
|
|
62
|
+
"""Returns the JSON representation of the model using alias"""
|
|
63
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
|
64
|
+
return json.dumps(self.to_dict())
|
|
65
|
+
|
|
66
|
+
@classmethod
|
|
67
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
68
|
+
"""Create an instance of UpdateCategoryRequestObject from a JSON string"""
|
|
69
|
+
return cls.from_dict(json.loads(json_str))
|
|
70
|
+
|
|
71
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
72
|
+
"""Return the dictionary representation of the model using alias.
|
|
73
|
+
|
|
74
|
+
This has the following differences from calling pydantic's
|
|
75
|
+
`self.model_dump(by_alias=True)`:
|
|
76
|
+
|
|
77
|
+
* `None` is only added to the output dict for nullable fields that
|
|
78
|
+
were set at model initialization. Other fields with value `None`
|
|
79
|
+
are ignored.
|
|
80
|
+
"""
|
|
81
|
+
excluded_fields: Set[str] = set([
|
|
82
|
+
])
|
|
83
|
+
|
|
84
|
+
_dict = self.model_dump(
|
|
85
|
+
by_alias=True,
|
|
86
|
+
exclude=excluded_fields,
|
|
87
|
+
exclude_none=True,
|
|
88
|
+
)
|
|
89
|
+
# override the default output from pydantic by calling `to_dict()` of each item in children (list)
|
|
90
|
+
_items = []
|
|
91
|
+
if self.children:
|
|
92
|
+
for _item_children in self.children:
|
|
93
|
+
if _item_children:
|
|
94
|
+
_items.append(_item_children.to_dict())
|
|
95
|
+
_dict['children'] = _items
|
|
96
|
+
# set to None if description (nullable) is None
|
|
97
|
+
# and model_fields_set contains the field
|
|
98
|
+
if self.description is None and "description" in self.model_fields_set:
|
|
99
|
+
_dict['description'] = None
|
|
100
|
+
|
|
101
|
+
# set to None if group_id (nullable) is None
|
|
102
|
+
# and model_fields_set contains the field
|
|
103
|
+
if self.group_id is None and "group_id" in self.model_fields_set:
|
|
104
|
+
_dict['group_id'] = None
|
|
105
|
+
|
|
106
|
+
# set to None if is_group (nullable) is None
|
|
107
|
+
# and model_fields_set contains the field
|
|
108
|
+
if self.is_group is None and "is_group" in self.model_fields_set:
|
|
109
|
+
_dict['is_group'] = None
|
|
110
|
+
|
|
111
|
+
# set to None if order (nullable) is None
|
|
112
|
+
# and model_fields_set contains the field
|
|
113
|
+
if self.order is None and "order" in self.model_fields_set:
|
|
114
|
+
_dict['order'] = None
|
|
115
|
+
|
|
116
|
+
# set to None if collapsed (nullable) is None
|
|
117
|
+
# and model_fields_set contains the field
|
|
118
|
+
if self.collapsed is None and "collapsed" in self.model_fields_set:
|
|
119
|
+
_dict['collapsed'] = None
|
|
120
|
+
|
|
121
|
+
# set to None if archived_at (nullable) is None
|
|
122
|
+
# and model_fields_set contains the field
|
|
123
|
+
if self.archived_at is None and "archived_at" in self.model_fields_set:
|
|
124
|
+
_dict['archived_at'] = None
|
|
125
|
+
|
|
126
|
+
return _dict
|
|
127
|
+
|
|
128
|
+
@classmethod
|
|
129
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
130
|
+
"""Create an instance of UpdateCategoryRequestObject from a dict"""
|
|
131
|
+
if obj is None:
|
|
132
|
+
return None
|
|
133
|
+
|
|
134
|
+
if not isinstance(obj, dict):
|
|
135
|
+
return cls.model_validate(obj)
|
|
136
|
+
|
|
137
|
+
_obj = cls.model_validate({
|
|
138
|
+
"name": obj.get("name"),
|
|
139
|
+
"description": obj.get("description"),
|
|
140
|
+
"is_income": obj.get("is_income"),
|
|
141
|
+
"exclude_from_budget": obj.get("exclude_from_budget"),
|
|
142
|
+
"exclude_from_totals": obj.get("exclude_from_totals"),
|
|
143
|
+
"archived": obj.get("archived"),
|
|
144
|
+
"group_id": obj.get("group_id"),
|
|
145
|
+
"is_group": obj.get("is_group") if obj.get("is_group") is not None else False,
|
|
146
|
+
"children": [CreateCategoryRequestObjectChildrenInner.from_dict(_item) for _item in obj["children"]] if obj.get("children") is not None else None,
|
|
147
|
+
"order": obj.get("order"),
|
|
148
|
+
"collapsed": obj.get("collapsed"),
|
|
149
|
+
"id": obj.get("id"),
|
|
150
|
+
"archived_at": obj.get("archived_at"),
|
|
151
|
+
"updated_at": obj.get("updated_at"),
|
|
152
|
+
"created_at": obj.get("created_at")
|
|
153
|
+
})
|
|
154
|
+
return _obj
|
|
155
|
+
|
|
156
|
+
|
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
"""
|
|
4
|
+
Lunch Money API - v2
|
|
5
|
+
|
|
6
|
+
Welcome to the Lunch Money v2 API. A working version of this API is now available through these docs, or directly at: `https://api.lunchmoney.dev/v2` <span class=\"red-text\"><strong>This is in alpha launch of a major API update. It is still subject to change during this alpha review period and bugs may still exist. Users are strongly encouraged to use the mock service or to create a test budget with example data as the first step to interacting with the v2 API.</strong></span> See the [Getting Started Guide](https://alpha.lunchmoney.dev/v2/getting-started) for more information on using a test budget.<br<br> If you are new to the v2 API, you may wish to review the [v2 API Overview of Changes](https://alpha.lunchmoney.dev/v2/changelog). ### Static Mock Server You may also use these docs to explore the API using a static mock server endpoint.<p> This enables users to become familiar with the API without having to create an access token, and eliminates the possibility of modifying real data. <p> To access this endpoint select the second endpoint in the the \"Server\" dropdown to the right. When selected you should see \"Static Mock v2 Lunch Money API Server\".<br> When using this server, set your Bearer token to any string with 11 or more characters. ### Migrating from V1 The v2 API is NOT backwards compatible with the v1 API. Developers are encouraged to review the [Migration Guide](https://alpha.lunchmoney.dev/v2/migration-guide) to understand the changes and plan their migration. ### Acknowledgments If you have been providing feedback on the API during our iterative design process, **THANK YOU**. We are happy to provide the opportunity to finally interact with the working API that was built based on your feedback. ### Useful links: - [Getting Started](https://alpha.lunchmoney.dev/v2/getting-started) - [v2 API Changelog](https://alpha.lunchmoney.dev/v2/changelog) - [Migration Guide](https://alpha.lunchmoney.dev/v2/migration-guide) - [Rate Limits](https://alpha.lunchmoney.dev/v2/rate-limits) - [Current v1 Lunch Money API Documentation](https://lunchmoney.dev) - [Awesome Lunch Money Projects](https://github.com/lunch-money/awesome-lunchmoney?tab=readme-ov-file)
|
|
7
|
+
|
|
8
|
+
The version of the OpenAPI document: 2.8.4
|
|
9
|
+
Contact: devsupport@lunchmoney.app
|
|
10
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
|
11
|
+
|
|
12
|
+
Do not edit the class manually.
|
|
13
|
+
""" # noqa: E501
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
from __future__ import annotations
|
|
17
|
+
import pprint
|
|
18
|
+
import re # noqa: F401
|
|
19
|
+
import json
|
|
20
|
+
|
|
21
|
+
from datetime import date, datetime
|
|
22
|
+
from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictFloat, StrictInt, StrictStr
|
|
23
|
+
from typing import Any, ClassVar, Dict, List, Optional, Union
|
|
24
|
+
from typing_extensions import Annotated
|
|
25
|
+
from lunchmoney.models.account_type_enum import AccountTypeEnum
|
|
26
|
+
from lunchmoney.models.currency_enum import CurrencyEnum
|
|
27
|
+
from lunchmoney.models.update_manual_account_request_object_balance import UpdateManualAccountRequestObjectBalance
|
|
28
|
+
from typing import Optional, Set
|
|
29
|
+
from typing_extensions import Self
|
|
30
|
+
|
|
31
|
+
class UpdateManualAccountRequestObject(BaseModel):
|
|
32
|
+
"""
|
|
33
|
+
UpdateManualAccountRequestObject
|
|
34
|
+
""" # noqa: E501
|
|
35
|
+
id: Optional[StrictInt] = Field(default=None, description="System defined unique identifier of this account. Ignored if set.")
|
|
36
|
+
name: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=45)]] = Field(default=None, description="If set, the new name of the manual account.")
|
|
37
|
+
type: Optional[AccountTypeEnum] = Field(default=None, description="If set, the new type of the manual account.")
|
|
38
|
+
subtype: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=100)]] = Field(default=None, description="If set, an optional account subtype. Examples include<br> - retirement - checking - savings - prepaid credit card")
|
|
39
|
+
display_name: Optional[StrictStr] = Field(default=None, description="If set, an optional display name for the manual account.<br> This must be unique for the user. If not set, it will be derived from the `institution_name` (if any) concatenated with the `name`.")
|
|
40
|
+
balance: Optional[UpdateManualAccountRequestObjectBalance] = None
|
|
41
|
+
balance_as_of: Optional[StrictStr] = Field(default=None, description="A new date for the `updated_at` property. May be set as a date, ie: YYYY-MM-DD, or date-time string in ISO 8601 extended format. This property is ignored if `balance` is not also set. If `balance` is set and this property is not set the current time is used.")
|
|
42
|
+
closed_on: Optional[date] = Field(default=None, description="If set, the date this manual account was closed in YYYY-MM-DD format.")
|
|
43
|
+
currency: Optional[CurrencyEnum] = Field(default=None, description="If set, the new three-letter lowercase currency code of the manual account balance.")
|
|
44
|
+
institution_name: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=50)]] = Field(default=None, description="If set, the name of institution holding the account.")
|
|
45
|
+
external_id: Optional[Annotated[str, Field(min_length=0, strict=True, max_length=75)]] = Field(default=None, description="An optional user-defined ID for the manual account.")
|
|
46
|
+
custom_metadata: Optional[Dict[str, Any]] = Field(default=None, description="An optional JSON object that includes additional data related to this account. This must be a valid JSON object and, when stringified, must not exceed 4096 characters.")
|
|
47
|
+
exclude_from_transactions: Optional[StrictBool] = Field(default=None, description="If set, transactions may not be assigned to this manual account.")
|
|
48
|
+
to_base: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="System defined balance converted to the user's primary currency. Ignored if set. Use `balance` to update the balance in the account.")
|
|
49
|
+
created_at: Optional[datetime] = Field(default=None, description="System defined date/time the account was created in ISO 8601 extended format. Ignored if set.")
|
|
50
|
+
updated_at: Optional[datetime] = Field(default=None, description="System defined date/time the account was created in ISO 8601 extended format. Ignored if set.")
|
|
51
|
+
__properties: ClassVar[List[str]] = ["id", "name", "type", "subtype", "display_name", "balance", "balance_as_of", "closed_on", "currency", "institution_name", "external_id", "custom_metadata", "exclude_from_transactions", "to_base", "created_at", "updated_at"]
|
|
52
|
+
|
|
53
|
+
model_config = ConfigDict(
|
|
54
|
+
populate_by_name=True,
|
|
55
|
+
validate_assignment=True,
|
|
56
|
+
protected_namespaces=(),
|
|
57
|
+
)
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
def to_str(self) -> str:
|
|
61
|
+
"""Returns the string representation of the model using alias"""
|
|
62
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
63
|
+
|
|
64
|
+
def to_json(self) -> str:
|
|
65
|
+
"""Returns the JSON representation of the model using alias"""
|
|
66
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
|
67
|
+
return json.dumps(self.to_dict())
|
|
68
|
+
|
|
69
|
+
@classmethod
|
|
70
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
71
|
+
"""Create an instance of UpdateManualAccountRequestObject from a JSON string"""
|
|
72
|
+
return cls.from_dict(json.loads(json_str))
|
|
73
|
+
|
|
74
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
75
|
+
"""Return the dictionary representation of the model using alias.
|
|
76
|
+
|
|
77
|
+
This has the following differences from calling pydantic's
|
|
78
|
+
`self.model_dump(by_alias=True)`:
|
|
79
|
+
|
|
80
|
+
* `None` is only added to the output dict for nullable fields that
|
|
81
|
+
were set at model initialization. Other fields with value `None`
|
|
82
|
+
are ignored.
|
|
83
|
+
"""
|
|
84
|
+
excluded_fields: Set[str] = set([
|
|
85
|
+
])
|
|
86
|
+
|
|
87
|
+
_dict = self.model_dump(
|
|
88
|
+
by_alias=True,
|
|
89
|
+
exclude=excluded_fields,
|
|
90
|
+
exclude_none=True,
|
|
91
|
+
)
|
|
92
|
+
# override the default output from pydantic by calling `to_dict()` of balance
|
|
93
|
+
if self.balance:
|
|
94
|
+
_dict['balance'] = self.balance.to_dict()
|
|
95
|
+
# set to None if display_name (nullable) is None
|
|
96
|
+
# and model_fields_set contains the field
|
|
97
|
+
if self.display_name is None and "display_name" in self.model_fields_set:
|
|
98
|
+
_dict['display_name'] = None
|
|
99
|
+
|
|
100
|
+
# set to None if balance_as_of (nullable) is None
|
|
101
|
+
# and model_fields_set contains the field
|
|
102
|
+
if self.balance_as_of is None and "balance_as_of" in self.model_fields_set:
|
|
103
|
+
_dict['balance_as_of'] = None
|
|
104
|
+
|
|
105
|
+
# set to None if closed_on (nullable) is None
|
|
106
|
+
# and model_fields_set contains the field
|
|
107
|
+
if self.closed_on is None and "closed_on" in self.model_fields_set:
|
|
108
|
+
_dict['closed_on'] = None
|
|
109
|
+
|
|
110
|
+
# set to None if institution_name (nullable) is None
|
|
111
|
+
# and model_fields_set contains the field
|
|
112
|
+
if self.institution_name is None and "institution_name" in self.model_fields_set:
|
|
113
|
+
_dict['institution_name'] = None
|
|
114
|
+
|
|
115
|
+
# set to None if external_id (nullable) is None
|
|
116
|
+
# and model_fields_set contains the field
|
|
117
|
+
if self.external_id is None and "external_id" in self.model_fields_set:
|
|
118
|
+
_dict['external_id'] = None
|
|
119
|
+
|
|
120
|
+
# set to None if custom_metadata (nullable) is None
|
|
121
|
+
# and model_fields_set contains the field
|
|
122
|
+
if self.custom_metadata is None and "custom_metadata" in self.model_fields_set:
|
|
123
|
+
_dict['custom_metadata'] = None
|
|
124
|
+
|
|
125
|
+
return _dict
|
|
126
|
+
|
|
127
|
+
@classmethod
|
|
128
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
129
|
+
"""Create an instance of UpdateManualAccountRequestObject from a dict"""
|
|
130
|
+
if obj is None:
|
|
131
|
+
return None
|
|
132
|
+
|
|
133
|
+
if not isinstance(obj, dict):
|
|
134
|
+
return cls.model_validate(obj)
|
|
135
|
+
|
|
136
|
+
_obj = cls.model_validate({
|
|
137
|
+
"id": obj.get("id"),
|
|
138
|
+
"name": obj.get("name"),
|
|
139
|
+
"type": obj.get("type"),
|
|
140
|
+
"subtype": obj.get("subtype"),
|
|
141
|
+
"display_name": obj.get("display_name"),
|
|
142
|
+
"balance": UpdateManualAccountRequestObjectBalance.from_dict(obj["balance"]) if obj.get("balance") is not None else None,
|
|
143
|
+
"balance_as_of": obj.get("balance_as_of"),
|
|
144
|
+
"closed_on": obj.get("closed_on"),
|
|
145
|
+
"currency": obj.get("currency"),
|
|
146
|
+
"institution_name": obj.get("institution_name"),
|
|
147
|
+
"external_id": obj.get("external_id"),
|
|
148
|
+
"custom_metadata": obj.get("custom_metadata"),
|
|
149
|
+
"exclude_from_transactions": obj.get("exclude_from_transactions"),
|
|
150
|
+
"to_base": obj.get("to_base"),
|
|
151
|
+
"created_at": obj.get("created_at"),
|
|
152
|
+
"updated_at": obj.get("updated_at")
|
|
153
|
+
})
|
|
154
|
+
return _obj
|
|
155
|
+
|
|
156
|
+
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
"""
|
|
4
|
+
Lunch Money API - v2
|
|
5
|
+
|
|
6
|
+
Welcome to the Lunch Money v2 API. A working version of this API is now available through these docs, or directly at: `https://api.lunchmoney.dev/v2` <span class=\"red-text\"><strong>This is in alpha launch of a major API update. It is still subject to change during this alpha review period and bugs may still exist. Users are strongly encouraged to use the mock service or to create a test budget with example data as the first step to interacting with the v2 API.</strong></span> See the [Getting Started Guide](https://alpha.lunchmoney.dev/v2/getting-started) for more information on using a test budget.<br<br> If you are new to the v2 API, you may wish to review the [v2 API Overview of Changes](https://alpha.lunchmoney.dev/v2/changelog). ### Static Mock Server You may also use these docs to explore the API using a static mock server endpoint.<p> This enables users to become familiar with the API without having to create an access token, and eliminates the possibility of modifying real data. <p> To access this endpoint select the second endpoint in the the \"Server\" dropdown to the right. When selected you should see \"Static Mock v2 Lunch Money API Server\".<br> When using this server, set your Bearer token to any string with 11 or more characters. ### Migrating from V1 The v2 API is NOT backwards compatible with the v1 API. Developers are encouraged to review the [Migration Guide](https://alpha.lunchmoney.dev/v2/migration-guide) to understand the changes and plan their migration. ### Acknowledgments If you have been providing feedback on the API during our iterative design process, **THANK YOU**. We are happy to provide the opportunity to finally interact with the working API that was built based on your feedback. ### Useful links: - [Getting Started](https://alpha.lunchmoney.dev/v2/getting-started) - [v2 API Changelog](https://alpha.lunchmoney.dev/v2/changelog) - [Migration Guide](https://alpha.lunchmoney.dev/v2/migration-guide) - [Rate Limits](https://alpha.lunchmoney.dev/v2/rate-limits) - [Current v1 Lunch Money API Documentation](https://lunchmoney.dev) - [Awesome Lunch Money Projects](https://github.com/lunch-money/awesome-lunchmoney?tab=readme-ov-file)
|
|
7
|
+
|
|
8
|
+
The version of the OpenAPI document: 2.8.4
|
|
9
|
+
Contact: devsupport@lunchmoney.app
|
|
10
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
|
11
|
+
|
|
12
|
+
Do not edit the class manually.
|
|
13
|
+
""" # noqa: E501
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
from __future__ import annotations
|
|
17
|
+
import json
|
|
18
|
+
import pprint
|
|
19
|
+
from pydantic import BaseModel, ConfigDict, Field, StrictFloat, StrictInt, StrictStr, ValidationError, field_validator
|
|
20
|
+
from typing import Any, List, Optional, Union
|
|
21
|
+
from typing_extensions import Annotated
|
|
22
|
+
from pydantic import StrictStr, Field
|
|
23
|
+
from typing import Union, List, Set, Optional, Dict
|
|
24
|
+
from typing_extensions import Literal, Self
|
|
25
|
+
|
|
26
|
+
UPDATEMANUALACCOUNTREQUESTOBJECTBALANCE_ONE_OF_SCHEMAS = ["float", "str"]
|
|
27
|
+
|
|
28
|
+
class UpdateManualAccountRequestObjectBalance(BaseModel):
|
|
29
|
+
"""
|
|
30
|
+
Numeric value of the current balance, up to four decimal places, of the manual account as a number or string. Do not include any special characters aside from a decimal point.
|
|
31
|
+
"""
|
|
32
|
+
# data type: float
|
|
33
|
+
oneof_schema_1_validator: Optional[Union[StrictFloat, StrictInt]] = None
|
|
34
|
+
# data type: str
|
|
35
|
+
oneof_schema_2_validator: Optional[Annotated[str, Field(strict=True)]] = None
|
|
36
|
+
actual_instance: Optional[Union[float, str]] = None
|
|
37
|
+
one_of_schemas: Set[str] = { "float", "str" }
|
|
38
|
+
|
|
39
|
+
model_config = ConfigDict(
|
|
40
|
+
validate_assignment=True,
|
|
41
|
+
protected_namespaces=(),
|
|
42
|
+
)
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
def __init__(self, *args, **kwargs) -> None:
|
|
46
|
+
if args:
|
|
47
|
+
if len(args) > 1:
|
|
48
|
+
raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`")
|
|
49
|
+
if kwargs:
|
|
50
|
+
raise ValueError("If a position argument is used, keyword arguments cannot be used.")
|
|
51
|
+
super().__init__(actual_instance=args[0])
|
|
52
|
+
else:
|
|
53
|
+
super().__init__(**kwargs)
|
|
54
|
+
|
|
55
|
+
@field_validator('actual_instance')
|
|
56
|
+
def actual_instance_must_validate_oneof(cls, v):
|
|
57
|
+
instance = UpdateManualAccountRequestObjectBalance.model_construct()
|
|
58
|
+
error_messages = []
|
|
59
|
+
match = 0
|
|
60
|
+
# validate data type: float
|
|
61
|
+
try:
|
|
62
|
+
instance.oneof_schema_1_validator = v
|
|
63
|
+
match += 1
|
|
64
|
+
except (ValidationError, ValueError) as e:
|
|
65
|
+
error_messages.append(str(e))
|
|
66
|
+
# validate data type: str
|
|
67
|
+
try:
|
|
68
|
+
instance.oneof_schema_2_validator = v
|
|
69
|
+
match += 1
|
|
70
|
+
except (ValidationError, ValueError) as e:
|
|
71
|
+
error_messages.append(str(e))
|
|
72
|
+
if match > 1:
|
|
73
|
+
# more than 1 match
|
|
74
|
+
raise ValueError("Multiple matches found when setting `actual_instance` in UpdateManualAccountRequestObjectBalance with oneOf schemas: float, str. Details: " + ", ".join(error_messages))
|
|
75
|
+
elif match == 0:
|
|
76
|
+
# no match
|
|
77
|
+
raise ValueError("No match found when setting `actual_instance` in UpdateManualAccountRequestObjectBalance with oneOf schemas: float, str. Details: " + ", ".join(error_messages))
|
|
78
|
+
else:
|
|
79
|
+
return v
|
|
80
|
+
|
|
81
|
+
@classmethod
|
|
82
|
+
def from_dict(cls, obj: Union[str, Dict[str, Any]]) -> Self:
|
|
83
|
+
return cls.from_json(json.dumps(obj))
|
|
84
|
+
|
|
85
|
+
@classmethod
|
|
86
|
+
def from_json(cls, json_str: str) -> Self:
|
|
87
|
+
"""Returns the object represented by the json string"""
|
|
88
|
+
instance = cls.model_construct()
|
|
89
|
+
error_messages = []
|
|
90
|
+
match = 0
|
|
91
|
+
|
|
92
|
+
# deserialize data into float
|
|
93
|
+
try:
|
|
94
|
+
# validation
|
|
95
|
+
instance.oneof_schema_1_validator = json.loads(json_str)
|
|
96
|
+
# assign value to actual_instance
|
|
97
|
+
instance.actual_instance = instance.oneof_schema_1_validator
|
|
98
|
+
match += 1
|
|
99
|
+
except (ValidationError, ValueError) as e:
|
|
100
|
+
error_messages.append(str(e))
|
|
101
|
+
# deserialize data into str
|
|
102
|
+
try:
|
|
103
|
+
# validation
|
|
104
|
+
instance.oneof_schema_2_validator = json.loads(json_str)
|
|
105
|
+
# assign value to actual_instance
|
|
106
|
+
instance.actual_instance = instance.oneof_schema_2_validator
|
|
107
|
+
match += 1
|
|
108
|
+
except (ValidationError, ValueError) as e:
|
|
109
|
+
error_messages.append(str(e))
|
|
110
|
+
|
|
111
|
+
if match > 1:
|
|
112
|
+
# more than 1 match
|
|
113
|
+
raise ValueError("Multiple matches found when deserializing the JSON string into UpdateManualAccountRequestObjectBalance with oneOf schemas: float, str. Details: " + ", ".join(error_messages))
|
|
114
|
+
elif match == 0:
|
|
115
|
+
# no match
|
|
116
|
+
raise ValueError("No match found when deserializing the JSON string into UpdateManualAccountRequestObjectBalance with oneOf schemas: float, str. Details: " + ", ".join(error_messages))
|
|
117
|
+
else:
|
|
118
|
+
return instance
|
|
119
|
+
|
|
120
|
+
def to_json(self) -> str:
|
|
121
|
+
"""Returns the JSON representation of the actual instance"""
|
|
122
|
+
if self.actual_instance is None:
|
|
123
|
+
return "null"
|
|
124
|
+
|
|
125
|
+
if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json):
|
|
126
|
+
return self.actual_instance.to_json()
|
|
127
|
+
else:
|
|
128
|
+
return json.dumps(self.actual_instance)
|
|
129
|
+
|
|
130
|
+
def to_dict(self) -> Optional[Union[Dict[str, Any], float, str]]:
|
|
131
|
+
"""Returns the dict representation of the actual instance"""
|
|
132
|
+
if self.actual_instance is None:
|
|
133
|
+
return None
|
|
134
|
+
|
|
135
|
+
if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict):
|
|
136
|
+
return self.actual_instance.to_dict()
|
|
137
|
+
else:
|
|
138
|
+
# primitive type
|
|
139
|
+
return self.actual_instance
|
|
140
|
+
|
|
141
|
+
def to_str(self) -> str:
|
|
142
|
+
"""Returns the string representation of the actual instance"""
|
|
143
|
+
return pprint.pformat(self.model_dump())
|
|
144
|
+
|
|
145
|
+
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
"""
|
|
4
|
+
Lunch Money API - v2
|
|
5
|
+
|
|
6
|
+
Welcome to the Lunch Money v2 API. A working version of this API is now available through these docs, or directly at: `https://api.lunchmoney.dev/v2` <span class=\"red-text\"><strong>This is in alpha launch of a major API update. It is still subject to change during this alpha review period and bugs may still exist. Users are strongly encouraged to use the mock service or to create a test budget with example data as the first step to interacting with the v2 API.</strong></span> See the [Getting Started Guide](https://alpha.lunchmoney.dev/v2/getting-started) for more information on using a test budget.<br<br> If you are new to the v2 API, you may wish to review the [v2 API Overview of Changes](https://alpha.lunchmoney.dev/v2/changelog). ### Static Mock Server You may also use these docs to explore the API using a static mock server endpoint.<p> This enables users to become familiar with the API without having to create an access token, and eliminates the possibility of modifying real data. <p> To access this endpoint select the second endpoint in the the \"Server\" dropdown to the right. When selected you should see \"Static Mock v2 Lunch Money API Server\".<br> When using this server, set your Bearer token to any string with 11 or more characters. ### Migrating from V1 The v2 API is NOT backwards compatible with the v1 API. Developers are encouraged to review the [Migration Guide](https://alpha.lunchmoney.dev/v2/migration-guide) to understand the changes and plan their migration. ### Acknowledgments If you have been providing feedback on the API during our iterative design process, **THANK YOU**. We are happy to provide the opportunity to finally interact with the working API that was built based on your feedback. ### Useful links: - [Getting Started](https://alpha.lunchmoney.dev/v2/getting-started) - [v2 API Changelog](https://alpha.lunchmoney.dev/v2/changelog) - [Migration Guide](https://alpha.lunchmoney.dev/v2/migration-guide) - [Rate Limits](https://alpha.lunchmoney.dev/v2/rate-limits) - [Current v1 Lunch Money API Documentation](https://lunchmoney.dev) - [Awesome Lunch Money Projects](https://github.com/lunch-money/awesome-lunchmoney?tab=readme-ov-file)
|
|
7
|
+
|
|
8
|
+
The version of the OpenAPI document: 2.8.4
|
|
9
|
+
Contact: devsupport@lunchmoney.app
|
|
10
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
|
11
|
+
|
|
12
|
+
Do not edit the class manually.
|
|
13
|
+
""" # noqa: E501
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
from __future__ import annotations
|
|
17
|
+
import pprint
|
|
18
|
+
import re # noqa: F401
|
|
19
|
+
import json
|
|
20
|
+
|
|
21
|
+
from datetime import datetime
|
|
22
|
+
from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictInt, StrictStr
|
|
23
|
+
from typing import Any, ClassVar, Dict, List, Optional
|
|
24
|
+
from typing_extensions import Annotated
|
|
25
|
+
from typing import Optional, Set
|
|
26
|
+
from typing_extensions import Self
|
|
27
|
+
|
|
28
|
+
class UpdateTagRequestObject(BaseModel):
|
|
29
|
+
"""
|
|
30
|
+
UpdateTagRequestObject
|
|
31
|
+
""" # noqa: E501
|
|
32
|
+
name: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=100)]] = Field(default=None, description="If set, the new name of the category. Must be between 1 and 100 characters.")
|
|
33
|
+
description: Optional[Annotated[str, Field(strict=True, max_length=200)]] = Field(default=None, description="If set, the new description of the category. Must not exceed 200 characters.")
|
|
34
|
+
text_color: Optional[StrictStr] = Field(default=None, description="The text color of the tag.")
|
|
35
|
+
background_color: Optional[StrictStr] = Field(default=None, description="The background color of the tag.")
|
|
36
|
+
archived: Optional[StrictBool] = Field(default=None, description="If set, will indicate if this category is archived.")
|
|
37
|
+
id: Optional[StrictInt] = Field(default=None, description="System-defined unique identifier for the category. Ignored if set.")
|
|
38
|
+
updated_at: Optional[datetime] = Field(default=None, description="System-set time the tag was last updated. Ignored if set")
|
|
39
|
+
created_at: Optional[datetime] = Field(default=None, description="System-set time the tag was created. Ignored if set.")
|
|
40
|
+
archived_at: Optional[datetime] = Field(default=None, description="System-set time the tag was archived. Ignored if set.")
|
|
41
|
+
__properties: ClassVar[List[str]] = ["name", "description", "text_color", "background_color", "archived", "id", "updated_at", "created_at", "archived_at"]
|
|
42
|
+
|
|
43
|
+
model_config = ConfigDict(
|
|
44
|
+
populate_by_name=True,
|
|
45
|
+
validate_assignment=True,
|
|
46
|
+
protected_namespaces=(),
|
|
47
|
+
)
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
def to_str(self) -> str:
|
|
51
|
+
"""Returns the string representation of the model using alias"""
|
|
52
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
53
|
+
|
|
54
|
+
def to_json(self) -> str:
|
|
55
|
+
"""Returns the JSON representation of the model using alias"""
|
|
56
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
|
57
|
+
return json.dumps(self.to_dict())
|
|
58
|
+
|
|
59
|
+
@classmethod
|
|
60
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
61
|
+
"""Create an instance of UpdateTagRequestObject from a JSON string"""
|
|
62
|
+
return cls.from_dict(json.loads(json_str))
|
|
63
|
+
|
|
64
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
65
|
+
"""Return the dictionary representation of the model using alias.
|
|
66
|
+
|
|
67
|
+
This has the following differences from calling pydantic's
|
|
68
|
+
`self.model_dump(by_alias=True)`:
|
|
69
|
+
|
|
70
|
+
* `None` is only added to the output dict for nullable fields that
|
|
71
|
+
were set at model initialization. Other fields with value `None`
|
|
72
|
+
are ignored.
|
|
73
|
+
"""
|
|
74
|
+
excluded_fields: Set[str] = set([
|
|
75
|
+
])
|
|
76
|
+
|
|
77
|
+
_dict = self.model_dump(
|
|
78
|
+
by_alias=True,
|
|
79
|
+
exclude=excluded_fields,
|
|
80
|
+
exclude_none=True,
|
|
81
|
+
)
|
|
82
|
+
# set to None if description (nullable) is None
|
|
83
|
+
# and model_fields_set contains the field
|
|
84
|
+
if self.description is None and "description" in self.model_fields_set:
|
|
85
|
+
_dict['description'] = None
|
|
86
|
+
|
|
87
|
+
# set to None if text_color (nullable) is None
|
|
88
|
+
# and model_fields_set contains the field
|
|
89
|
+
if self.text_color is None and "text_color" in self.model_fields_set:
|
|
90
|
+
_dict['text_color'] = None
|
|
91
|
+
|
|
92
|
+
# set to None if background_color (nullable) is None
|
|
93
|
+
# and model_fields_set contains the field
|
|
94
|
+
if self.background_color is None and "background_color" in self.model_fields_set:
|
|
95
|
+
_dict['background_color'] = None
|
|
96
|
+
|
|
97
|
+
# set to None if archived_at (nullable) is None
|
|
98
|
+
# and model_fields_set contains the field
|
|
99
|
+
if self.archived_at is None and "archived_at" in self.model_fields_set:
|
|
100
|
+
_dict['archived_at'] = None
|
|
101
|
+
|
|
102
|
+
return _dict
|
|
103
|
+
|
|
104
|
+
@classmethod
|
|
105
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
106
|
+
"""Create an instance of UpdateTagRequestObject from a dict"""
|
|
107
|
+
if obj is None:
|
|
108
|
+
return None
|
|
109
|
+
|
|
110
|
+
if not isinstance(obj, dict):
|
|
111
|
+
return cls.model_validate(obj)
|
|
112
|
+
|
|
113
|
+
_obj = cls.model_validate({
|
|
114
|
+
"name": obj.get("name"),
|
|
115
|
+
"description": obj.get("description"),
|
|
116
|
+
"text_color": obj.get("text_color"),
|
|
117
|
+
"background_color": obj.get("background_color"),
|
|
118
|
+
"archived": obj.get("archived"),
|
|
119
|
+
"id": obj.get("id"),
|
|
120
|
+
"updated_at": obj.get("updated_at"),
|
|
121
|
+
"created_at": obj.get("created_at"),
|
|
122
|
+
"archived_at": obj.get("archived_at")
|
|
123
|
+
})
|
|
124
|
+
return _obj
|
|
125
|
+
|
|
126
|
+
|