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,616 @@
|
|
|
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
|
+
import warnings
|
|
16
|
+
from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt
|
|
17
|
+
from typing import Any, Dict, List, Optional, Tuple, Union
|
|
18
|
+
from typing_extensions import Annotated
|
|
19
|
+
|
|
20
|
+
from pydantic import Field, StrictInt
|
|
21
|
+
from typing_extensions import Annotated
|
|
22
|
+
from lunchmoney.models.split_transaction_request import SplitTransactionRequest
|
|
23
|
+
from lunchmoney.models.transaction_object import TransactionObject
|
|
24
|
+
|
|
25
|
+
from lunchmoney.api_client import ApiClient, RequestSerialized
|
|
26
|
+
from lunchmoney.api_response import ApiResponse
|
|
27
|
+
from lunchmoney.rest import RESTResponseType
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
class TransactionsSplitApi:
|
|
31
|
+
"""NOTE: This class is auto generated by OpenAPI Generator
|
|
32
|
+
Ref: https://openapi-generator.tech
|
|
33
|
+
|
|
34
|
+
Do not edit the class manually.
|
|
35
|
+
"""
|
|
36
|
+
|
|
37
|
+
def __init__(self, api_client=None) -> None:
|
|
38
|
+
if api_client is None:
|
|
39
|
+
api_client = ApiClient.get_default()
|
|
40
|
+
self.api_client = api_client
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
@validate_call
|
|
44
|
+
def split_transaction(
|
|
45
|
+
self,
|
|
46
|
+
id: Annotated[StrictInt, Field(description="ID of the transaction to spit")],
|
|
47
|
+
split_transaction_request: SplitTransactionRequest,
|
|
48
|
+
_request_timeout: Union[
|
|
49
|
+
None,
|
|
50
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
51
|
+
Tuple[
|
|
52
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
53
|
+
Annotated[StrictFloat, Field(gt=0)]
|
|
54
|
+
]
|
|
55
|
+
] = None,
|
|
56
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
57
|
+
_content_type: Optional[StrictStr] = None,
|
|
58
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
59
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
60
|
+
) -> TransactionObject:
|
|
61
|
+
"""Split a transaction
|
|
62
|
+
|
|
63
|
+
Splits an existing transaction into a set of smaller child transactions.<br><br> After a transaction has been split, the original transaction is no longer shown on the transactions page or returned by a `GET /transactions` request. The newly created child transactions are returned instead. To see the details of the original parent transaction after it has been split, use the `GET /transactions/{id}` endpoint and pass the value of the `split_parent_id` of one of the children.
|
|
64
|
+
|
|
65
|
+
:param id: ID of the transaction to spit (required)
|
|
66
|
+
:type id: int
|
|
67
|
+
:param split_transaction_request: (required)
|
|
68
|
+
:type split_transaction_request: SplitTransactionRequest
|
|
69
|
+
:param _request_timeout: timeout setting for this request. If one
|
|
70
|
+
number provided, it will be total request
|
|
71
|
+
timeout. It can also be a pair (tuple) of
|
|
72
|
+
(connection, read) timeouts.
|
|
73
|
+
:type _request_timeout: int, tuple(int, int), optional
|
|
74
|
+
:param _request_auth: set to override the auth_settings for an a single
|
|
75
|
+
request; this effectively ignores the
|
|
76
|
+
authentication in the spec for a single request.
|
|
77
|
+
:type _request_auth: dict, optional
|
|
78
|
+
:param _content_type: force content-type for the request.
|
|
79
|
+
:type _content_type: str, Optional
|
|
80
|
+
:param _headers: set to override the headers for a single
|
|
81
|
+
request; this effectively ignores the headers
|
|
82
|
+
in the spec for a single request.
|
|
83
|
+
:type _headers: dict, optional
|
|
84
|
+
:param _host_index: set to override the host_index for a single
|
|
85
|
+
request; this effectively ignores the host_index
|
|
86
|
+
in the spec for a single request.
|
|
87
|
+
:type _host_index: int, optional
|
|
88
|
+
:return: Returns the result object.
|
|
89
|
+
""" # noqa: E501
|
|
90
|
+
|
|
91
|
+
_param = self._split_transaction_serialize(
|
|
92
|
+
id=id,
|
|
93
|
+
split_transaction_request=split_transaction_request,
|
|
94
|
+
_request_auth=_request_auth,
|
|
95
|
+
_content_type=_content_type,
|
|
96
|
+
_headers=_headers,
|
|
97
|
+
_host_index=_host_index
|
|
98
|
+
)
|
|
99
|
+
|
|
100
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
|
101
|
+
'201': "TransactionObject",
|
|
102
|
+
'400': "ErrorResponseObject",
|
|
103
|
+
'401': "ErrorResponseObject",
|
|
104
|
+
'429': "ErrorResponseObject",
|
|
105
|
+
'500': "ErrorResponseObject",
|
|
106
|
+
}
|
|
107
|
+
response_data = self.api_client.call_api(
|
|
108
|
+
*_param,
|
|
109
|
+
_request_timeout=_request_timeout
|
|
110
|
+
)
|
|
111
|
+
response_data.read()
|
|
112
|
+
return self.api_client.response_deserialize(
|
|
113
|
+
response_data=response_data,
|
|
114
|
+
response_types_map=_response_types_map,
|
|
115
|
+
).data
|
|
116
|
+
|
|
117
|
+
|
|
118
|
+
@validate_call
|
|
119
|
+
def split_transaction_with_http_info(
|
|
120
|
+
self,
|
|
121
|
+
id: Annotated[StrictInt, Field(description="ID of the transaction to spit")],
|
|
122
|
+
split_transaction_request: SplitTransactionRequest,
|
|
123
|
+
_request_timeout: Union[
|
|
124
|
+
None,
|
|
125
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
126
|
+
Tuple[
|
|
127
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
128
|
+
Annotated[StrictFloat, Field(gt=0)]
|
|
129
|
+
]
|
|
130
|
+
] = None,
|
|
131
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
132
|
+
_content_type: Optional[StrictStr] = None,
|
|
133
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
134
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
135
|
+
) -> ApiResponse[TransactionObject]:
|
|
136
|
+
"""Split a transaction
|
|
137
|
+
|
|
138
|
+
Splits an existing transaction into a set of smaller child transactions.<br><br> After a transaction has been split, the original transaction is no longer shown on the transactions page or returned by a `GET /transactions` request. The newly created child transactions are returned instead. To see the details of the original parent transaction after it has been split, use the `GET /transactions/{id}` endpoint and pass the value of the `split_parent_id` of one of the children.
|
|
139
|
+
|
|
140
|
+
:param id: ID of the transaction to spit (required)
|
|
141
|
+
:type id: int
|
|
142
|
+
:param split_transaction_request: (required)
|
|
143
|
+
:type split_transaction_request: SplitTransactionRequest
|
|
144
|
+
:param _request_timeout: timeout setting for this request. If one
|
|
145
|
+
number provided, it will be total request
|
|
146
|
+
timeout. It can also be a pair (tuple) of
|
|
147
|
+
(connection, read) timeouts.
|
|
148
|
+
:type _request_timeout: int, tuple(int, int), optional
|
|
149
|
+
:param _request_auth: set to override the auth_settings for an a single
|
|
150
|
+
request; this effectively ignores the
|
|
151
|
+
authentication in the spec for a single request.
|
|
152
|
+
:type _request_auth: dict, optional
|
|
153
|
+
:param _content_type: force content-type for the request.
|
|
154
|
+
:type _content_type: str, Optional
|
|
155
|
+
:param _headers: set to override the headers for a single
|
|
156
|
+
request; this effectively ignores the headers
|
|
157
|
+
in the spec for a single request.
|
|
158
|
+
:type _headers: dict, optional
|
|
159
|
+
:param _host_index: set to override the host_index for a single
|
|
160
|
+
request; this effectively ignores the host_index
|
|
161
|
+
in the spec for a single request.
|
|
162
|
+
:type _host_index: int, optional
|
|
163
|
+
:return: Returns the result object.
|
|
164
|
+
""" # noqa: E501
|
|
165
|
+
|
|
166
|
+
_param = self._split_transaction_serialize(
|
|
167
|
+
id=id,
|
|
168
|
+
split_transaction_request=split_transaction_request,
|
|
169
|
+
_request_auth=_request_auth,
|
|
170
|
+
_content_type=_content_type,
|
|
171
|
+
_headers=_headers,
|
|
172
|
+
_host_index=_host_index
|
|
173
|
+
)
|
|
174
|
+
|
|
175
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
|
176
|
+
'201': "TransactionObject",
|
|
177
|
+
'400': "ErrorResponseObject",
|
|
178
|
+
'401': "ErrorResponseObject",
|
|
179
|
+
'429': "ErrorResponseObject",
|
|
180
|
+
'500': "ErrorResponseObject",
|
|
181
|
+
}
|
|
182
|
+
response_data = self.api_client.call_api(
|
|
183
|
+
*_param,
|
|
184
|
+
_request_timeout=_request_timeout
|
|
185
|
+
)
|
|
186
|
+
response_data.read()
|
|
187
|
+
return self.api_client.response_deserialize(
|
|
188
|
+
response_data=response_data,
|
|
189
|
+
response_types_map=_response_types_map,
|
|
190
|
+
)
|
|
191
|
+
|
|
192
|
+
|
|
193
|
+
@validate_call
|
|
194
|
+
def split_transaction_without_preload_content(
|
|
195
|
+
self,
|
|
196
|
+
id: Annotated[StrictInt, Field(description="ID of the transaction to spit")],
|
|
197
|
+
split_transaction_request: SplitTransactionRequest,
|
|
198
|
+
_request_timeout: Union[
|
|
199
|
+
None,
|
|
200
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
201
|
+
Tuple[
|
|
202
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
203
|
+
Annotated[StrictFloat, Field(gt=0)]
|
|
204
|
+
]
|
|
205
|
+
] = None,
|
|
206
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
207
|
+
_content_type: Optional[StrictStr] = None,
|
|
208
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
209
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
210
|
+
) -> RESTResponseType:
|
|
211
|
+
"""Split a transaction
|
|
212
|
+
|
|
213
|
+
Splits an existing transaction into a set of smaller child transactions.<br><br> After a transaction has been split, the original transaction is no longer shown on the transactions page or returned by a `GET /transactions` request. The newly created child transactions are returned instead. To see the details of the original parent transaction after it has been split, use the `GET /transactions/{id}` endpoint and pass the value of the `split_parent_id` of one of the children.
|
|
214
|
+
|
|
215
|
+
:param id: ID of the transaction to spit (required)
|
|
216
|
+
:type id: int
|
|
217
|
+
:param split_transaction_request: (required)
|
|
218
|
+
:type split_transaction_request: SplitTransactionRequest
|
|
219
|
+
:param _request_timeout: timeout setting for this request. If one
|
|
220
|
+
number provided, it will be total request
|
|
221
|
+
timeout. It can also be a pair (tuple) of
|
|
222
|
+
(connection, read) timeouts.
|
|
223
|
+
:type _request_timeout: int, tuple(int, int), optional
|
|
224
|
+
:param _request_auth: set to override the auth_settings for an a single
|
|
225
|
+
request; this effectively ignores the
|
|
226
|
+
authentication in the spec for a single request.
|
|
227
|
+
:type _request_auth: dict, optional
|
|
228
|
+
:param _content_type: force content-type for the request.
|
|
229
|
+
:type _content_type: str, Optional
|
|
230
|
+
:param _headers: set to override the headers for a single
|
|
231
|
+
request; this effectively ignores the headers
|
|
232
|
+
in the spec for a single request.
|
|
233
|
+
:type _headers: dict, optional
|
|
234
|
+
:param _host_index: set to override the host_index for a single
|
|
235
|
+
request; this effectively ignores the host_index
|
|
236
|
+
in the spec for a single request.
|
|
237
|
+
:type _host_index: int, optional
|
|
238
|
+
:return: Returns the result object.
|
|
239
|
+
""" # noqa: E501
|
|
240
|
+
|
|
241
|
+
_param = self._split_transaction_serialize(
|
|
242
|
+
id=id,
|
|
243
|
+
split_transaction_request=split_transaction_request,
|
|
244
|
+
_request_auth=_request_auth,
|
|
245
|
+
_content_type=_content_type,
|
|
246
|
+
_headers=_headers,
|
|
247
|
+
_host_index=_host_index
|
|
248
|
+
)
|
|
249
|
+
|
|
250
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
|
251
|
+
'201': "TransactionObject",
|
|
252
|
+
'400': "ErrorResponseObject",
|
|
253
|
+
'401': "ErrorResponseObject",
|
|
254
|
+
'429': "ErrorResponseObject",
|
|
255
|
+
'500': "ErrorResponseObject",
|
|
256
|
+
}
|
|
257
|
+
response_data = self.api_client.call_api(
|
|
258
|
+
*_param,
|
|
259
|
+
_request_timeout=_request_timeout
|
|
260
|
+
)
|
|
261
|
+
return response_data.response
|
|
262
|
+
|
|
263
|
+
|
|
264
|
+
def _split_transaction_serialize(
|
|
265
|
+
self,
|
|
266
|
+
id,
|
|
267
|
+
split_transaction_request,
|
|
268
|
+
_request_auth,
|
|
269
|
+
_content_type,
|
|
270
|
+
_headers,
|
|
271
|
+
_host_index,
|
|
272
|
+
) -> RequestSerialized:
|
|
273
|
+
|
|
274
|
+
_host = None
|
|
275
|
+
|
|
276
|
+
_collection_formats: Dict[str, str] = {
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
_path_params: Dict[str, str] = {}
|
|
280
|
+
_query_params: List[Tuple[str, str]] = []
|
|
281
|
+
_header_params: Dict[str, Optional[str]] = _headers or {}
|
|
282
|
+
_form_params: List[Tuple[str, str]] = []
|
|
283
|
+
_files: Dict[
|
|
284
|
+
str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
|
|
285
|
+
] = {}
|
|
286
|
+
_body_params: Optional[bytes] = None
|
|
287
|
+
|
|
288
|
+
# process the path parameters
|
|
289
|
+
if id is not None:
|
|
290
|
+
_path_params['id'] = id
|
|
291
|
+
# process the query parameters
|
|
292
|
+
# process the header parameters
|
|
293
|
+
# process the form parameters
|
|
294
|
+
# process the body parameter
|
|
295
|
+
if split_transaction_request is not None:
|
|
296
|
+
_body_params = split_transaction_request
|
|
297
|
+
|
|
298
|
+
|
|
299
|
+
# set the HTTP header `Accept`
|
|
300
|
+
if 'Accept' not in _header_params:
|
|
301
|
+
_header_params['Accept'] = self.api_client.select_header_accept(
|
|
302
|
+
[
|
|
303
|
+
'application/json'
|
|
304
|
+
]
|
|
305
|
+
)
|
|
306
|
+
|
|
307
|
+
# set the HTTP header `Content-Type`
|
|
308
|
+
if _content_type:
|
|
309
|
+
_header_params['Content-Type'] = _content_type
|
|
310
|
+
else:
|
|
311
|
+
_default_content_type = (
|
|
312
|
+
self.api_client.select_header_content_type(
|
|
313
|
+
[
|
|
314
|
+
'application/json'
|
|
315
|
+
]
|
|
316
|
+
)
|
|
317
|
+
)
|
|
318
|
+
if _default_content_type is not None:
|
|
319
|
+
_header_params['Content-Type'] = _default_content_type
|
|
320
|
+
|
|
321
|
+
# authentication setting
|
|
322
|
+
_auth_settings: List[str] = [
|
|
323
|
+
'cookieAuth',
|
|
324
|
+
'bearerSecurity'
|
|
325
|
+
]
|
|
326
|
+
|
|
327
|
+
return self.api_client.param_serialize(
|
|
328
|
+
method='POST',
|
|
329
|
+
resource_path='/transactions/split/{id}',
|
|
330
|
+
path_params=_path_params,
|
|
331
|
+
query_params=_query_params,
|
|
332
|
+
header_params=_header_params,
|
|
333
|
+
body=_body_params,
|
|
334
|
+
post_params=_form_params,
|
|
335
|
+
files=_files,
|
|
336
|
+
auth_settings=_auth_settings,
|
|
337
|
+
collection_formats=_collection_formats,
|
|
338
|
+
_host=_host,
|
|
339
|
+
_request_auth=_request_auth
|
|
340
|
+
)
|
|
341
|
+
|
|
342
|
+
|
|
343
|
+
|
|
344
|
+
|
|
345
|
+
@validate_call
|
|
346
|
+
def unsplit_transaction(
|
|
347
|
+
self,
|
|
348
|
+
id: Annotated[StrictInt, Field(description="ID of the previously split transaction to delete.")],
|
|
349
|
+
_request_timeout: Union[
|
|
350
|
+
None,
|
|
351
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
352
|
+
Tuple[
|
|
353
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
354
|
+
Annotated[StrictFloat, Field(gt=0)]
|
|
355
|
+
]
|
|
356
|
+
] = None,
|
|
357
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
358
|
+
_content_type: Optional[StrictStr] = None,
|
|
359
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
360
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
361
|
+
) -> None:
|
|
362
|
+
"""Unsplit a previously split transactions
|
|
363
|
+
|
|
364
|
+
Deletes the split children of a previously split transactions and restores the parent transactions to the normal unsplit state.<br><br> Use the value of the `split_parent_id`property of a split transaction to specify the parent ID.
|
|
365
|
+
|
|
366
|
+
:param id: ID of the previously split transaction to delete. (required)
|
|
367
|
+
:type id: int
|
|
368
|
+
:param _request_timeout: timeout setting for this request. If one
|
|
369
|
+
number provided, it will be total request
|
|
370
|
+
timeout. It can also be a pair (tuple) of
|
|
371
|
+
(connection, read) timeouts.
|
|
372
|
+
:type _request_timeout: int, tuple(int, int), optional
|
|
373
|
+
:param _request_auth: set to override the auth_settings for an a single
|
|
374
|
+
request; this effectively ignores the
|
|
375
|
+
authentication in the spec for a single request.
|
|
376
|
+
:type _request_auth: dict, optional
|
|
377
|
+
:param _content_type: force content-type for the request.
|
|
378
|
+
:type _content_type: str, Optional
|
|
379
|
+
:param _headers: set to override the headers for a single
|
|
380
|
+
request; this effectively ignores the headers
|
|
381
|
+
in the spec for a single request.
|
|
382
|
+
:type _headers: dict, optional
|
|
383
|
+
:param _host_index: set to override the host_index for a single
|
|
384
|
+
request; this effectively ignores the host_index
|
|
385
|
+
in the spec for a single request.
|
|
386
|
+
:type _host_index: int, optional
|
|
387
|
+
:return: Returns the result object.
|
|
388
|
+
""" # noqa: E501
|
|
389
|
+
|
|
390
|
+
_param = self._unsplit_transaction_serialize(
|
|
391
|
+
id=id,
|
|
392
|
+
_request_auth=_request_auth,
|
|
393
|
+
_content_type=_content_type,
|
|
394
|
+
_headers=_headers,
|
|
395
|
+
_host_index=_host_index
|
|
396
|
+
)
|
|
397
|
+
|
|
398
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
|
399
|
+
'204': None,
|
|
400
|
+
'400': "ErrorResponseObject",
|
|
401
|
+
'401': "ErrorResponseObject",
|
|
402
|
+
'429': "ErrorResponseObject",
|
|
403
|
+
'500': "ErrorResponseObject",
|
|
404
|
+
}
|
|
405
|
+
response_data = self.api_client.call_api(
|
|
406
|
+
*_param,
|
|
407
|
+
_request_timeout=_request_timeout
|
|
408
|
+
)
|
|
409
|
+
response_data.read()
|
|
410
|
+
return self.api_client.response_deserialize(
|
|
411
|
+
response_data=response_data,
|
|
412
|
+
response_types_map=_response_types_map,
|
|
413
|
+
).data
|
|
414
|
+
|
|
415
|
+
|
|
416
|
+
@validate_call
|
|
417
|
+
def unsplit_transaction_with_http_info(
|
|
418
|
+
self,
|
|
419
|
+
id: Annotated[StrictInt, Field(description="ID of the previously split transaction to delete.")],
|
|
420
|
+
_request_timeout: Union[
|
|
421
|
+
None,
|
|
422
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
423
|
+
Tuple[
|
|
424
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
425
|
+
Annotated[StrictFloat, Field(gt=0)]
|
|
426
|
+
]
|
|
427
|
+
] = None,
|
|
428
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
429
|
+
_content_type: Optional[StrictStr] = None,
|
|
430
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
431
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
432
|
+
) -> ApiResponse[None]:
|
|
433
|
+
"""Unsplit a previously split transactions
|
|
434
|
+
|
|
435
|
+
Deletes the split children of a previously split transactions and restores the parent transactions to the normal unsplit state.<br><br> Use the value of the `split_parent_id`property of a split transaction to specify the parent ID.
|
|
436
|
+
|
|
437
|
+
:param id: ID of the previously split transaction to delete. (required)
|
|
438
|
+
:type id: int
|
|
439
|
+
:param _request_timeout: timeout setting for this request. If one
|
|
440
|
+
number provided, it will be total request
|
|
441
|
+
timeout. It can also be a pair (tuple) of
|
|
442
|
+
(connection, read) timeouts.
|
|
443
|
+
:type _request_timeout: int, tuple(int, int), optional
|
|
444
|
+
:param _request_auth: set to override the auth_settings for an a single
|
|
445
|
+
request; this effectively ignores the
|
|
446
|
+
authentication in the spec for a single request.
|
|
447
|
+
:type _request_auth: dict, optional
|
|
448
|
+
:param _content_type: force content-type for the request.
|
|
449
|
+
:type _content_type: str, Optional
|
|
450
|
+
:param _headers: set to override the headers for a single
|
|
451
|
+
request; this effectively ignores the headers
|
|
452
|
+
in the spec for a single request.
|
|
453
|
+
:type _headers: dict, optional
|
|
454
|
+
:param _host_index: set to override the host_index for a single
|
|
455
|
+
request; this effectively ignores the host_index
|
|
456
|
+
in the spec for a single request.
|
|
457
|
+
:type _host_index: int, optional
|
|
458
|
+
:return: Returns the result object.
|
|
459
|
+
""" # noqa: E501
|
|
460
|
+
|
|
461
|
+
_param = self._unsplit_transaction_serialize(
|
|
462
|
+
id=id,
|
|
463
|
+
_request_auth=_request_auth,
|
|
464
|
+
_content_type=_content_type,
|
|
465
|
+
_headers=_headers,
|
|
466
|
+
_host_index=_host_index
|
|
467
|
+
)
|
|
468
|
+
|
|
469
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
|
470
|
+
'204': None,
|
|
471
|
+
'400': "ErrorResponseObject",
|
|
472
|
+
'401': "ErrorResponseObject",
|
|
473
|
+
'429': "ErrorResponseObject",
|
|
474
|
+
'500': "ErrorResponseObject",
|
|
475
|
+
}
|
|
476
|
+
response_data = self.api_client.call_api(
|
|
477
|
+
*_param,
|
|
478
|
+
_request_timeout=_request_timeout
|
|
479
|
+
)
|
|
480
|
+
response_data.read()
|
|
481
|
+
return self.api_client.response_deserialize(
|
|
482
|
+
response_data=response_data,
|
|
483
|
+
response_types_map=_response_types_map,
|
|
484
|
+
)
|
|
485
|
+
|
|
486
|
+
|
|
487
|
+
@validate_call
|
|
488
|
+
def unsplit_transaction_without_preload_content(
|
|
489
|
+
self,
|
|
490
|
+
id: Annotated[StrictInt, Field(description="ID of the previously split transaction to delete.")],
|
|
491
|
+
_request_timeout: Union[
|
|
492
|
+
None,
|
|
493
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
494
|
+
Tuple[
|
|
495
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
496
|
+
Annotated[StrictFloat, Field(gt=0)]
|
|
497
|
+
]
|
|
498
|
+
] = None,
|
|
499
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
500
|
+
_content_type: Optional[StrictStr] = None,
|
|
501
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
502
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
503
|
+
) -> RESTResponseType:
|
|
504
|
+
"""Unsplit a previously split transactions
|
|
505
|
+
|
|
506
|
+
Deletes the split children of a previously split transactions and restores the parent transactions to the normal unsplit state.<br><br> Use the value of the `split_parent_id`property of a split transaction to specify the parent ID.
|
|
507
|
+
|
|
508
|
+
:param id: ID of the previously split transaction to delete. (required)
|
|
509
|
+
:type id: int
|
|
510
|
+
:param _request_timeout: timeout setting for this request. If one
|
|
511
|
+
number provided, it will be total request
|
|
512
|
+
timeout. It can also be a pair (tuple) of
|
|
513
|
+
(connection, read) timeouts.
|
|
514
|
+
:type _request_timeout: int, tuple(int, int), optional
|
|
515
|
+
:param _request_auth: set to override the auth_settings for an a single
|
|
516
|
+
request; this effectively ignores the
|
|
517
|
+
authentication in the spec for a single request.
|
|
518
|
+
:type _request_auth: dict, optional
|
|
519
|
+
:param _content_type: force content-type for the request.
|
|
520
|
+
:type _content_type: str, Optional
|
|
521
|
+
:param _headers: set to override the headers for a single
|
|
522
|
+
request; this effectively ignores the headers
|
|
523
|
+
in the spec for a single request.
|
|
524
|
+
:type _headers: dict, optional
|
|
525
|
+
:param _host_index: set to override the host_index for a single
|
|
526
|
+
request; this effectively ignores the host_index
|
|
527
|
+
in the spec for a single request.
|
|
528
|
+
:type _host_index: int, optional
|
|
529
|
+
:return: Returns the result object.
|
|
530
|
+
""" # noqa: E501
|
|
531
|
+
|
|
532
|
+
_param = self._unsplit_transaction_serialize(
|
|
533
|
+
id=id,
|
|
534
|
+
_request_auth=_request_auth,
|
|
535
|
+
_content_type=_content_type,
|
|
536
|
+
_headers=_headers,
|
|
537
|
+
_host_index=_host_index
|
|
538
|
+
)
|
|
539
|
+
|
|
540
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
|
541
|
+
'204': None,
|
|
542
|
+
'400': "ErrorResponseObject",
|
|
543
|
+
'401': "ErrorResponseObject",
|
|
544
|
+
'429': "ErrorResponseObject",
|
|
545
|
+
'500': "ErrorResponseObject",
|
|
546
|
+
}
|
|
547
|
+
response_data = self.api_client.call_api(
|
|
548
|
+
*_param,
|
|
549
|
+
_request_timeout=_request_timeout
|
|
550
|
+
)
|
|
551
|
+
return response_data.response
|
|
552
|
+
|
|
553
|
+
|
|
554
|
+
def _unsplit_transaction_serialize(
|
|
555
|
+
self,
|
|
556
|
+
id,
|
|
557
|
+
_request_auth,
|
|
558
|
+
_content_type,
|
|
559
|
+
_headers,
|
|
560
|
+
_host_index,
|
|
561
|
+
) -> RequestSerialized:
|
|
562
|
+
|
|
563
|
+
_host = None
|
|
564
|
+
|
|
565
|
+
_collection_formats: Dict[str, str] = {
|
|
566
|
+
}
|
|
567
|
+
|
|
568
|
+
_path_params: Dict[str, str] = {}
|
|
569
|
+
_query_params: List[Tuple[str, str]] = []
|
|
570
|
+
_header_params: Dict[str, Optional[str]] = _headers or {}
|
|
571
|
+
_form_params: List[Tuple[str, str]] = []
|
|
572
|
+
_files: Dict[
|
|
573
|
+
str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
|
|
574
|
+
] = {}
|
|
575
|
+
_body_params: Optional[bytes] = None
|
|
576
|
+
|
|
577
|
+
# process the path parameters
|
|
578
|
+
if id is not None:
|
|
579
|
+
_path_params['id'] = id
|
|
580
|
+
# process the query parameters
|
|
581
|
+
# process the header parameters
|
|
582
|
+
# process the form parameters
|
|
583
|
+
# process the body parameter
|
|
584
|
+
|
|
585
|
+
|
|
586
|
+
# set the HTTP header `Accept`
|
|
587
|
+
if 'Accept' not in _header_params:
|
|
588
|
+
_header_params['Accept'] = self.api_client.select_header_accept(
|
|
589
|
+
[
|
|
590
|
+
'application/json'
|
|
591
|
+
]
|
|
592
|
+
)
|
|
593
|
+
|
|
594
|
+
|
|
595
|
+
# authentication setting
|
|
596
|
+
_auth_settings: List[str] = [
|
|
597
|
+
'cookieAuth',
|
|
598
|
+
'bearerSecurity'
|
|
599
|
+
]
|
|
600
|
+
|
|
601
|
+
return self.api_client.param_serialize(
|
|
602
|
+
method='DELETE',
|
|
603
|
+
resource_path='/transactions/split/{id}',
|
|
604
|
+
path_params=_path_params,
|
|
605
|
+
query_params=_query_params,
|
|
606
|
+
header_params=_header_params,
|
|
607
|
+
body=_body_params,
|
|
608
|
+
post_params=_form_params,
|
|
609
|
+
files=_files,
|
|
610
|
+
auth_settings=_auth_settings,
|
|
611
|
+
collection_formats=_collection_formats,
|
|
612
|
+
_host=_host,
|
|
613
|
+
_request_auth=_request_auth
|
|
614
|
+
)
|
|
615
|
+
|
|
616
|
+
|