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.
Files changed (92) hide show
  1. lunchmoney/__init__.py +205 -0
  2. lunchmoney/api/__init__.py +16 -0
  3. lunchmoney/api/categories_api.py +1499 -0
  4. lunchmoney/api/manual_accounts_api.py +1479 -0
  5. lunchmoney/api/me_api.py +293 -0
  6. lunchmoney/api/plaid_accounts_api.py +909 -0
  7. lunchmoney/api/recurring_items_api.py +702 -0
  8. lunchmoney/api/summary_api.py +434 -0
  9. lunchmoney/api/tags_api.py +1465 -0
  10. lunchmoney/api/transactions_api.py +914 -0
  11. lunchmoney/api/transactions_bulk_api.py +1527 -0
  12. lunchmoney/api/transactions_files_api.py +891 -0
  13. lunchmoney/api/transactions_group_api.py +601 -0
  14. lunchmoney/api/transactions_split_api.py +616 -0
  15. lunchmoney/api_client.py +805 -0
  16. lunchmoney/api_response.py +21 -0
  17. lunchmoney/configuration.py +620 -0
  18. lunchmoney/exceptions.py +217 -0
  19. lunchmoney/models/__init__.py +84 -0
  20. lunchmoney/models/account_type_enum.py +46 -0
  21. lunchmoney/models/aligned_category_totals_object.py +108 -0
  22. lunchmoney/models/aligned_summary_category_object.py +110 -0
  23. lunchmoney/models/aligned_summary_response_object.py +104 -0
  24. lunchmoney/models/category_object.py +146 -0
  25. lunchmoney/models/child_category_object.py +141 -0
  26. lunchmoney/models/child_transaction_object.py +219 -0
  27. lunchmoney/models/create_category_request_object.py +137 -0
  28. lunchmoney/models/create_category_request_object_children_inner.py +159 -0
  29. lunchmoney/models/create_manual_account_request_object.py +138 -0
  30. lunchmoney/models/create_manual_account_request_object_balance.py +145 -0
  31. lunchmoney/models/create_new_transactions_request.py +103 -0
  32. lunchmoney/models/create_tag_request_object.py +112 -0
  33. lunchmoney/models/currency_enum.py +198 -0
  34. lunchmoney/models/delete_category_response_with_dependencies.py +94 -0
  35. lunchmoney/models/delete_category_response_with_dependencies_dependents.py +98 -0
  36. lunchmoney/models/delete_tag_response_with_dependencies.py +94 -0
  37. lunchmoney/models/delete_tag_response_with_dependencies_dependents.py +90 -0
  38. lunchmoney/models/delete_transactions_request.py +89 -0
  39. lunchmoney/models/error_response_object.py +98 -0
  40. lunchmoney/models/error_response_object_errors_inner.py +101 -0
  41. lunchmoney/models/get_all_categories200_response.py +96 -0
  42. lunchmoney/models/get_all_manual_accounts200_response.py +96 -0
  43. lunchmoney/models/get_all_plaid_accounts200_response.py +96 -0
  44. lunchmoney/models/get_all_recurring200_response.py +96 -0
  45. lunchmoney/models/get_all_tags200_response.py +96 -0
  46. lunchmoney/models/get_all_transactions200_response.py +100 -0
  47. lunchmoney/models/get_all_transactions_created_since_parameter.py +145 -0
  48. lunchmoney/models/get_budget_summary200_response.py +138 -0
  49. lunchmoney/models/get_transaction_attachment_url200_response.py +91 -0
  50. lunchmoney/models/group_transactions_request.py +122 -0
  51. lunchmoney/models/insert_transaction_object.py +164 -0
  52. lunchmoney/models/insert_transaction_object_amount.py +145 -0
  53. lunchmoney/models/insert_transactions_response_object.py +106 -0
  54. lunchmoney/models/manual_account_object.py +158 -0
  55. lunchmoney/models/non_aligned_category_totals_object.py +94 -0
  56. lunchmoney/models/non_aligned_summary_category_object.py +94 -0
  57. lunchmoney/models/non_aligned_summary_response_object.py +104 -0
  58. lunchmoney/models/plaid_account_object.py +168 -0
  59. lunchmoney/models/recurring_object.py +143 -0
  60. lunchmoney/models/recurring_object_matches.py +105 -0
  61. lunchmoney/models/recurring_object_matches_found_transactions_inner.py +91 -0
  62. lunchmoney/models/recurring_object_overrides.py +92 -0
  63. lunchmoney/models/recurring_object_transaction_criteria.py +149 -0
  64. lunchmoney/models/skipped_existing_external_id_object.py +108 -0
  65. lunchmoney/models/split_transaction_object.py +102 -0
  66. lunchmoney/models/split_transaction_object_amount.py +145 -0
  67. lunchmoney/models/split_transaction_request.py +97 -0
  68. lunchmoney/models/summary_category_occurrence_object.py +126 -0
  69. lunchmoney/models/summary_recurring_transaction_object.py +100 -0
  70. lunchmoney/models/summary_rollover_pool_adjustment_object.py +98 -0
  71. lunchmoney/models/summary_rollover_pool_object.py +98 -0
  72. lunchmoney/models/summary_totals_breakdown_object.py +98 -0
  73. lunchmoney/models/summary_totals_object.py +97 -0
  74. lunchmoney/models/tag_object.py +125 -0
  75. lunchmoney/models/transaction_attachment_object.py +106 -0
  76. lunchmoney/models/transaction_object.py +229 -0
  77. lunchmoney/models/update_category_request_object.py +156 -0
  78. lunchmoney/models/update_manual_account_request_object.py +156 -0
  79. lunchmoney/models/update_manual_account_request_object_balance.py +145 -0
  80. lunchmoney/models/update_tag_request_object.py +126 -0
  81. lunchmoney/models/update_transaction_object.py +228 -0
  82. lunchmoney/models/update_transaction_object_amount.py +145 -0
  83. lunchmoney/models/update_transactions200_response.py +96 -0
  84. lunchmoney/models/update_transactions_request.py +97 -0
  85. lunchmoney/models/update_transactions_request_transactions_inner.py +228 -0
  86. lunchmoney/models/user_object.py +106 -0
  87. lunchmoney/py.typed +0 -0
  88. lunchmoney/rest.py +259 -0
  89. lunchmoney_python-2.9.0.dist-info/METADATA +285 -0
  90. lunchmoney_python-2.9.0.dist-info/RECORD +92 -0
  91. lunchmoney_python-2.9.0.dist-info/WHEEL +5 -0
  92. lunchmoney_python-2.9.0.dist-info/top_level.txt +1 -0
@@ -0,0 +1,914 @@
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, StrictBool, StrictInt
21
+ from typing import Optional
22
+ from typing_extensions import Annotated
23
+ from lunchmoney.models.transaction_object import TransactionObject
24
+ from lunchmoney.models.update_transaction_object import UpdateTransactionObject
25
+
26
+ from lunchmoney.api_client import ApiClient, RequestSerialized
27
+ from lunchmoney.api_response import ApiResponse
28
+ from lunchmoney.rest import RESTResponseType
29
+
30
+
31
+ class TransactionsApi:
32
+ """NOTE: This class is auto generated by OpenAPI Generator
33
+ Ref: https://openapi-generator.tech
34
+
35
+ Do not edit the class manually.
36
+ """
37
+
38
+ def __init__(self, api_client=None) -> None:
39
+ if api_client is None:
40
+ api_client = ApiClient.get_default()
41
+ self.api_client = api_client
42
+
43
+
44
+ @validate_call
45
+ def delete_transaction_by_id(
46
+ self,
47
+ id: Annotated[StrictInt, Field(description="ID of the transaction to delete")],
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
+ ) -> None:
61
+ """Delete a transaction
62
+
63
+ Deletes the transaction with the ID specified on the path.<br> If the specified transaction is a split transaction or a split parent, or if it is a grouped transactions or part of a transaction group, the request will fail with a suggestion on how to unsplit or ungroup the transaction(s) prior to deletion. Otherwise, the specified transaction is deleted. <br> This action is not reversible!
64
+
65
+ :param id: ID of the transaction to delete (required)
66
+ :type id: int
67
+ :param _request_timeout: timeout setting for this request. If one
68
+ number provided, it will be total request
69
+ timeout. It can also be a pair (tuple) of
70
+ (connection, read) timeouts.
71
+ :type _request_timeout: int, tuple(int, int), optional
72
+ :param _request_auth: set to override the auth_settings for an a single
73
+ request; this effectively ignores the
74
+ authentication in the spec for a single request.
75
+ :type _request_auth: dict, optional
76
+ :param _content_type: force content-type for the request.
77
+ :type _content_type: str, Optional
78
+ :param _headers: set to override the headers for a single
79
+ request; this effectively ignores the headers
80
+ in the spec for a single request.
81
+ :type _headers: dict, optional
82
+ :param _host_index: set to override the host_index for a single
83
+ request; this effectively ignores the host_index
84
+ in the spec for a single request.
85
+ :type _host_index: int, optional
86
+ :return: Returns the result object.
87
+ """ # noqa: E501
88
+
89
+ _param = self._delete_transaction_by_id_serialize(
90
+ id=id,
91
+ _request_auth=_request_auth,
92
+ _content_type=_content_type,
93
+ _headers=_headers,
94
+ _host_index=_host_index
95
+ )
96
+
97
+ _response_types_map: Dict[str, Optional[str]] = {
98
+ '204': None,
99
+ '401': "ErrorResponseObject",
100
+ '404': "ErrorResponseObject",
101
+ '429': "ErrorResponseObject",
102
+ '500': "ErrorResponseObject",
103
+ }
104
+ response_data = self.api_client.call_api(
105
+ *_param,
106
+ _request_timeout=_request_timeout
107
+ )
108
+ response_data.read()
109
+ return self.api_client.response_deserialize(
110
+ response_data=response_data,
111
+ response_types_map=_response_types_map,
112
+ ).data
113
+
114
+
115
+ @validate_call
116
+ def delete_transaction_by_id_with_http_info(
117
+ self,
118
+ id: Annotated[StrictInt, Field(description="ID of the transaction to delete")],
119
+ _request_timeout: Union[
120
+ None,
121
+ Annotated[StrictFloat, Field(gt=0)],
122
+ Tuple[
123
+ Annotated[StrictFloat, Field(gt=0)],
124
+ Annotated[StrictFloat, Field(gt=0)]
125
+ ]
126
+ ] = None,
127
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
128
+ _content_type: Optional[StrictStr] = None,
129
+ _headers: Optional[Dict[StrictStr, Any]] = None,
130
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
131
+ ) -> ApiResponse[None]:
132
+ """Delete a transaction
133
+
134
+ Deletes the transaction with the ID specified on the path.<br> If the specified transaction is a split transaction or a split parent, or if it is a grouped transactions or part of a transaction group, the request will fail with a suggestion on how to unsplit or ungroup the transaction(s) prior to deletion. Otherwise, the specified transaction is deleted. <br> This action is not reversible!
135
+
136
+ :param id: ID of the transaction to delete (required)
137
+ :type id: int
138
+ :param _request_timeout: timeout setting for this request. If one
139
+ number provided, it will be total request
140
+ timeout. It can also be a pair (tuple) of
141
+ (connection, read) timeouts.
142
+ :type _request_timeout: int, tuple(int, int), optional
143
+ :param _request_auth: set to override the auth_settings for an a single
144
+ request; this effectively ignores the
145
+ authentication in the spec for a single request.
146
+ :type _request_auth: dict, optional
147
+ :param _content_type: force content-type for the request.
148
+ :type _content_type: str, Optional
149
+ :param _headers: set to override the headers for a single
150
+ request; this effectively ignores the headers
151
+ in the spec for a single request.
152
+ :type _headers: dict, optional
153
+ :param _host_index: set to override the host_index for a single
154
+ request; this effectively ignores the host_index
155
+ in the spec for a single request.
156
+ :type _host_index: int, optional
157
+ :return: Returns the result object.
158
+ """ # noqa: E501
159
+
160
+ _param = self._delete_transaction_by_id_serialize(
161
+ id=id,
162
+ _request_auth=_request_auth,
163
+ _content_type=_content_type,
164
+ _headers=_headers,
165
+ _host_index=_host_index
166
+ )
167
+
168
+ _response_types_map: Dict[str, Optional[str]] = {
169
+ '204': None,
170
+ '401': "ErrorResponseObject",
171
+ '404': "ErrorResponseObject",
172
+ '429': "ErrorResponseObject",
173
+ '500': "ErrorResponseObject",
174
+ }
175
+ response_data = self.api_client.call_api(
176
+ *_param,
177
+ _request_timeout=_request_timeout
178
+ )
179
+ response_data.read()
180
+ return self.api_client.response_deserialize(
181
+ response_data=response_data,
182
+ response_types_map=_response_types_map,
183
+ )
184
+
185
+
186
+ @validate_call
187
+ def delete_transaction_by_id_without_preload_content(
188
+ self,
189
+ id: Annotated[StrictInt, Field(description="ID of the transaction to delete")],
190
+ _request_timeout: Union[
191
+ None,
192
+ Annotated[StrictFloat, Field(gt=0)],
193
+ Tuple[
194
+ Annotated[StrictFloat, Field(gt=0)],
195
+ Annotated[StrictFloat, Field(gt=0)]
196
+ ]
197
+ ] = None,
198
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
199
+ _content_type: Optional[StrictStr] = None,
200
+ _headers: Optional[Dict[StrictStr, Any]] = None,
201
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
202
+ ) -> RESTResponseType:
203
+ """Delete a transaction
204
+
205
+ Deletes the transaction with the ID specified on the path.<br> If the specified transaction is a split transaction or a split parent, or if it is a grouped transactions or part of a transaction group, the request will fail with a suggestion on how to unsplit or ungroup the transaction(s) prior to deletion. Otherwise, the specified transaction is deleted. <br> This action is not reversible!
206
+
207
+ :param id: ID of the transaction to delete (required)
208
+ :type id: int
209
+ :param _request_timeout: timeout setting for this request. If one
210
+ number provided, it will be total request
211
+ timeout. It can also be a pair (tuple) of
212
+ (connection, read) timeouts.
213
+ :type _request_timeout: int, tuple(int, int), optional
214
+ :param _request_auth: set to override the auth_settings for an a single
215
+ request; this effectively ignores the
216
+ authentication in the spec for a single request.
217
+ :type _request_auth: dict, optional
218
+ :param _content_type: force content-type for the request.
219
+ :type _content_type: str, Optional
220
+ :param _headers: set to override the headers for a single
221
+ request; this effectively ignores the headers
222
+ in the spec for a single request.
223
+ :type _headers: dict, optional
224
+ :param _host_index: set to override the host_index for a single
225
+ request; this effectively ignores the host_index
226
+ in the spec for a single request.
227
+ :type _host_index: int, optional
228
+ :return: Returns the result object.
229
+ """ # noqa: E501
230
+
231
+ _param = self._delete_transaction_by_id_serialize(
232
+ id=id,
233
+ _request_auth=_request_auth,
234
+ _content_type=_content_type,
235
+ _headers=_headers,
236
+ _host_index=_host_index
237
+ )
238
+
239
+ _response_types_map: Dict[str, Optional[str]] = {
240
+ '204': None,
241
+ '401': "ErrorResponseObject",
242
+ '404': "ErrorResponseObject",
243
+ '429': "ErrorResponseObject",
244
+ '500': "ErrorResponseObject",
245
+ }
246
+ response_data = self.api_client.call_api(
247
+ *_param,
248
+ _request_timeout=_request_timeout
249
+ )
250
+ return response_data.response
251
+
252
+
253
+ def _delete_transaction_by_id_serialize(
254
+ self,
255
+ id,
256
+ _request_auth,
257
+ _content_type,
258
+ _headers,
259
+ _host_index,
260
+ ) -> RequestSerialized:
261
+
262
+ _host = None
263
+
264
+ _collection_formats: Dict[str, str] = {
265
+ }
266
+
267
+ _path_params: Dict[str, str] = {}
268
+ _query_params: List[Tuple[str, str]] = []
269
+ _header_params: Dict[str, Optional[str]] = _headers or {}
270
+ _form_params: List[Tuple[str, str]] = []
271
+ _files: Dict[
272
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
273
+ ] = {}
274
+ _body_params: Optional[bytes] = None
275
+
276
+ # process the path parameters
277
+ if id is not None:
278
+ _path_params['id'] = id
279
+ # process the query parameters
280
+ # process the header parameters
281
+ # process the form parameters
282
+ # process the body parameter
283
+
284
+
285
+ # set the HTTP header `Accept`
286
+ if 'Accept' not in _header_params:
287
+ _header_params['Accept'] = self.api_client.select_header_accept(
288
+ [
289
+ 'application/json'
290
+ ]
291
+ )
292
+
293
+
294
+ # authentication setting
295
+ _auth_settings: List[str] = [
296
+ 'cookieAuth',
297
+ 'bearerSecurity'
298
+ ]
299
+
300
+ return self.api_client.param_serialize(
301
+ method='DELETE',
302
+ resource_path='/transactions/{id}',
303
+ path_params=_path_params,
304
+ query_params=_query_params,
305
+ header_params=_header_params,
306
+ body=_body_params,
307
+ post_params=_form_params,
308
+ files=_files,
309
+ auth_settings=_auth_settings,
310
+ collection_formats=_collection_formats,
311
+ _host=_host,
312
+ _request_auth=_request_auth
313
+ )
314
+
315
+
316
+
317
+
318
+ @validate_call
319
+ def get_transaction_by_id(
320
+ self,
321
+ id: Annotated[StrictInt, Field(description="ID of the transaction to retrieve")],
322
+ _request_timeout: Union[
323
+ None,
324
+ Annotated[StrictFloat, Field(gt=0)],
325
+ Tuple[
326
+ Annotated[StrictFloat, Field(gt=0)],
327
+ Annotated[StrictFloat, Field(gt=0)]
328
+ ]
329
+ ] = None,
330
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
331
+ _content_type: Optional[StrictStr] = None,
332
+ _headers: Optional[Dict[StrictStr, Any]] = None,
333
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
334
+ ) -> TransactionObject:
335
+ """Get a single transaction
336
+
337
+ Retrieves the details of a specific transaction by its ID, including the following properties which are not returned by default in the response to a `GET /transactions` request:<br> - `plaid_metadata` will either be `null` or contain the metadata for transactions associated with an account that is synced via plaid. - `custom_metadata` will either be `null` or contain any custom_metadata added to transactions that were inserted or updated via the API. - `files` will be a list of objects that describe any attachments to the transaction. If `is_group_parent` is true in the returned transaction, the object will also include the `children` property which will contain a list of the original transactions that make up the transaction group.<br> If `is_split_parent` is true in the returned transaction, the object will also include the `children` property which will contain a list of the split transactions.
338
+
339
+ :param id: ID of the transaction to retrieve (required)
340
+ :type id: int
341
+ :param _request_timeout: timeout setting for this request. If one
342
+ number provided, it will be total request
343
+ timeout. It can also be a pair (tuple) of
344
+ (connection, read) timeouts.
345
+ :type _request_timeout: int, tuple(int, int), optional
346
+ :param _request_auth: set to override the auth_settings for an a single
347
+ request; this effectively ignores the
348
+ authentication in the spec for a single request.
349
+ :type _request_auth: dict, optional
350
+ :param _content_type: force content-type for the request.
351
+ :type _content_type: str, Optional
352
+ :param _headers: set to override the headers for a single
353
+ request; this effectively ignores the headers
354
+ in the spec for a single request.
355
+ :type _headers: dict, optional
356
+ :param _host_index: set to override the host_index for a single
357
+ request; this effectively ignores the host_index
358
+ in the spec for a single request.
359
+ :type _host_index: int, optional
360
+ :return: Returns the result object.
361
+ """ # noqa: E501
362
+
363
+ _param = self._get_transaction_by_id_serialize(
364
+ id=id,
365
+ _request_auth=_request_auth,
366
+ _content_type=_content_type,
367
+ _headers=_headers,
368
+ _host_index=_host_index
369
+ )
370
+
371
+ _response_types_map: Dict[str, Optional[str]] = {
372
+ '200': "TransactionObject",
373
+ '400': "ErrorResponseObject",
374
+ '401': "ErrorResponseObject",
375
+ '404': "ErrorResponseObject",
376
+ '429': "ErrorResponseObject",
377
+ '500': "ErrorResponseObject",
378
+ }
379
+ response_data = self.api_client.call_api(
380
+ *_param,
381
+ _request_timeout=_request_timeout
382
+ )
383
+ response_data.read()
384
+ return self.api_client.response_deserialize(
385
+ response_data=response_data,
386
+ response_types_map=_response_types_map,
387
+ ).data
388
+
389
+
390
+ @validate_call
391
+ def get_transaction_by_id_with_http_info(
392
+ self,
393
+ id: Annotated[StrictInt, Field(description="ID of the transaction to retrieve")],
394
+ _request_timeout: Union[
395
+ None,
396
+ Annotated[StrictFloat, Field(gt=0)],
397
+ Tuple[
398
+ Annotated[StrictFloat, Field(gt=0)],
399
+ Annotated[StrictFloat, Field(gt=0)]
400
+ ]
401
+ ] = None,
402
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
403
+ _content_type: Optional[StrictStr] = None,
404
+ _headers: Optional[Dict[StrictStr, Any]] = None,
405
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
406
+ ) -> ApiResponse[TransactionObject]:
407
+ """Get a single transaction
408
+
409
+ Retrieves the details of a specific transaction by its ID, including the following properties which are not returned by default in the response to a `GET /transactions` request:<br> - `plaid_metadata` will either be `null` or contain the metadata for transactions associated with an account that is synced via plaid. - `custom_metadata` will either be `null` or contain any custom_metadata added to transactions that were inserted or updated via the API. - `files` will be a list of objects that describe any attachments to the transaction. If `is_group_parent` is true in the returned transaction, the object will also include the `children` property which will contain a list of the original transactions that make up the transaction group.<br> If `is_split_parent` is true in the returned transaction, the object will also include the `children` property which will contain a list of the split transactions.
410
+
411
+ :param id: ID of the transaction to retrieve (required)
412
+ :type id: int
413
+ :param _request_timeout: timeout setting for this request. If one
414
+ number provided, it will be total request
415
+ timeout. It can also be a pair (tuple) of
416
+ (connection, read) timeouts.
417
+ :type _request_timeout: int, tuple(int, int), optional
418
+ :param _request_auth: set to override the auth_settings for an a single
419
+ request; this effectively ignores the
420
+ authentication in the spec for a single request.
421
+ :type _request_auth: dict, optional
422
+ :param _content_type: force content-type for the request.
423
+ :type _content_type: str, Optional
424
+ :param _headers: set to override the headers for a single
425
+ request; this effectively ignores the headers
426
+ in the spec for a single request.
427
+ :type _headers: dict, optional
428
+ :param _host_index: set to override the host_index for a single
429
+ request; this effectively ignores the host_index
430
+ in the spec for a single request.
431
+ :type _host_index: int, optional
432
+ :return: Returns the result object.
433
+ """ # noqa: E501
434
+
435
+ _param = self._get_transaction_by_id_serialize(
436
+ id=id,
437
+ _request_auth=_request_auth,
438
+ _content_type=_content_type,
439
+ _headers=_headers,
440
+ _host_index=_host_index
441
+ )
442
+
443
+ _response_types_map: Dict[str, Optional[str]] = {
444
+ '200': "TransactionObject",
445
+ '400': "ErrorResponseObject",
446
+ '401': "ErrorResponseObject",
447
+ '404': "ErrorResponseObject",
448
+ '429': "ErrorResponseObject",
449
+ '500': "ErrorResponseObject",
450
+ }
451
+ response_data = self.api_client.call_api(
452
+ *_param,
453
+ _request_timeout=_request_timeout
454
+ )
455
+ response_data.read()
456
+ return self.api_client.response_deserialize(
457
+ response_data=response_data,
458
+ response_types_map=_response_types_map,
459
+ )
460
+
461
+
462
+ @validate_call
463
+ def get_transaction_by_id_without_preload_content(
464
+ self,
465
+ id: Annotated[StrictInt, Field(description="ID of the transaction to retrieve")],
466
+ _request_timeout: Union[
467
+ None,
468
+ Annotated[StrictFloat, Field(gt=0)],
469
+ Tuple[
470
+ Annotated[StrictFloat, Field(gt=0)],
471
+ Annotated[StrictFloat, Field(gt=0)]
472
+ ]
473
+ ] = None,
474
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
475
+ _content_type: Optional[StrictStr] = None,
476
+ _headers: Optional[Dict[StrictStr, Any]] = None,
477
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
478
+ ) -> RESTResponseType:
479
+ """Get a single transaction
480
+
481
+ Retrieves the details of a specific transaction by its ID, including the following properties which are not returned by default in the response to a `GET /transactions` request:<br> - `plaid_metadata` will either be `null` or contain the metadata for transactions associated with an account that is synced via plaid. - `custom_metadata` will either be `null` or contain any custom_metadata added to transactions that were inserted or updated via the API. - `files` will be a list of objects that describe any attachments to the transaction. If `is_group_parent` is true in the returned transaction, the object will also include the `children` property which will contain a list of the original transactions that make up the transaction group.<br> If `is_split_parent` is true in the returned transaction, the object will also include the `children` property which will contain a list of the split transactions.
482
+
483
+ :param id: ID of the transaction to retrieve (required)
484
+ :type id: int
485
+ :param _request_timeout: timeout setting for this request. If one
486
+ number provided, it will be total request
487
+ timeout. It can also be a pair (tuple) of
488
+ (connection, read) timeouts.
489
+ :type _request_timeout: int, tuple(int, int), optional
490
+ :param _request_auth: set to override the auth_settings for an a single
491
+ request; this effectively ignores the
492
+ authentication in the spec for a single request.
493
+ :type _request_auth: dict, optional
494
+ :param _content_type: force content-type for the request.
495
+ :type _content_type: str, Optional
496
+ :param _headers: set to override the headers for a single
497
+ request; this effectively ignores the headers
498
+ in the spec for a single request.
499
+ :type _headers: dict, optional
500
+ :param _host_index: set to override the host_index for a single
501
+ request; this effectively ignores the host_index
502
+ in the spec for a single request.
503
+ :type _host_index: int, optional
504
+ :return: Returns the result object.
505
+ """ # noqa: E501
506
+
507
+ _param = self._get_transaction_by_id_serialize(
508
+ id=id,
509
+ _request_auth=_request_auth,
510
+ _content_type=_content_type,
511
+ _headers=_headers,
512
+ _host_index=_host_index
513
+ )
514
+
515
+ _response_types_map: Dict[str, Optional[str]] = {
516
+ '200': "TransactionObject",
517
+ '400': "ErrorResponseObject",
518
+ '401': "ErrorResponseObject",
519
+ '404': "ErrorResponseObject",
520
+ '429': "ErrorResponseObject",
521
+ '500': "ErrorResponseObject",
522
+ }
523
+ response_data = self.api_client.call_api(
524
+ *_param,
525
+ _request_timeout=_request_timeout
526
+ )
527
+ return response_data.response
528
+
529
+
530
+ def _get_transaction_by_id_serialize(
531
+ self,
532
+ id,
533
+ _request_auth,
534
+ _content_type,
535
+ _headers,
536
+ _host_index,
537
+ ) -> RequestSerialized:
538
+
539
+ _host = None
540
+
541
+ _collection_formats: Dict[str, str] = {
542
+ }
543
+
544
+ _path_params: Dict[str, str] = {}
545
+ _query_params: List[Tuple[str, str]] = []
546
+ _header_params: Dict[str, Optional[str]] = _headers or {}
547
+ _form_params: List[Tuple[str, str]] = []
548
+ _files: Dict[
549
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
550
+ ] = {}
551
+ _body_params: Optional[bytes] = None
552
+
553
+ # process the path parameters
554
+ if id is not None:
555
+ _path_params['id'] = id
556
+ # process the query parameters
557
+ # process the header parameters
558
+ # process the form parameters
559
+ # process the body parameter
560
+
561
+
562
+ # set the HTTP header `Accept`
563
+ if 'Accept' not in _header_params:
564
+ _header_params['Accept'] = self.api_client.select_header_accept(
565
+ [
566
+ 'application/json'
567
+ ]
568
+ )
569
+
570
+
571
+ # authentication setting
572
+ _auth_settings: List[str] = [
573
+ 'cookieAuth',
574
+ 'bearerSecurity'
575
+ ]
576
+
577
+ return self.api_client.param_serialize(
578
+ method='GET',
579
+ resource_path='/transactions/{id}',
580
+ path_params=_path_params,
581
+ query_params=_query_params,
582
+ header_params=_header_params,
583
+ body=_body_params,
584
+ post_params=_form_params,
585
+ files=_files,
586
+ auth_settings=_auth_settings,
587
+ collection_formats=_collection_formats,
588
+ _host=_host,
589
+ _request_auth=_request_auth
590
+ )
591
+
592
+
593
+
594
+
595
+ @validate_call
596
+ def update_transaction(
597
+ self,
598
+ id: Annotated[StrictInt, Field(description="ID of the transaction to update")],
599
+ update_transaction_object: UpdateTransactionObject,
600
+ update_balance: Annotated[Optional[StrictBool], Field(description="Set this to `false` to skip updating the transaction's associated account balance. Default behavior is to update balances.")] = None,
601
+ _request_timeout: Union[
602
+ None,
603
+ Annotated[StrictFloat, Field(gt=0)],
604
+ Tuple[
605
+ Annotated[StrictFloat, Field(gt=0)],
606
+ Annotated[StrictFloat, Field(gt=0)]
607
+ ]
608
+ ] = None,
609
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
610
+ _content_type: Optional[StrictStr] = None,
611
+ _headers: Optional[Dict[StrictStr, Any]] = None,
612
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
613
+ ) -> TransactionObject:
614
+ """Update an existing transaction
615
+
616
+ Modifies the properties of an existing transaction.<br><br> You may submit the response from a `GET /transactions/{id}` as the request body, however only certain properties can be updated using this API. The following system set properties are accepted in the request body but their values will be ignored: `id`, `to_base`, `is_pending`, `created_at`, `updated_at`, `source`, and `plaid_metadata`.<br><br> Transactions that have been previously split or grouped may not be modified by this endpoint. Therefore the `is_split_parent`, `split_parent_id`, `is_group_parent`, `group_parent_id`, and `children` properties are also ignored when provided in the request body.<br><br> It is also possible to provide only the properties to be updated in the request body, as long as the request includes at least one of the properties that is not listed above. For example a request body that contains only an `category_id` attribute is valid.
617
+
618
+ :param id: ID of the transaction to update (required)
619
+ :type id: int
620
+ :param update_transaction_object: (required)
621
+ :type update_transaction_object: UpdateTransactionObject
622
+ :param update_balance: Set this to `false` to skip updating the transaction's associated account balance. Default behavior is to update balances.
623
+ :type update_balance: bool
624
+ :param _request_timeout: timeout setting for this request. If one
625
+ number provided, it will be total request
626
+ timeout. It can also be a pair (tuple) of
627
+ (connection, read) timeouts.
628
+ :type _request_timeout: int, tuple(int, int), optional
629
+ :param _request_auth: set to override the auth_settings for an a single
630
+ request; this effectively ignores the
631
+ authentication in the spec for a single request.
632
+ :type _request_auth: dict, optional
633
+ :param _content_type: force content-type for the request.
634
+ :type _content_type: str, Optional
635
+ :param _headers: set to override the headers for a single
636
+ request; this effectively ignores the headers
637
+ in the spec for a single request.
638
+ :type _headers: dict, optional
639
+ :param _host_index: set to override the host_index for a single
640
+ request; this effectively ignores the host_index
641
+ in the spec for a single request.
642
+ :type _host_index: int, optional
643
+ :return: Returns the result object.
644
+ """ # noqa: E501
645
+
646
+ _param = self._update_transaction_serialize(
647
+ id=id,
648
+ update_transaction_object=update_transaction_object,
649
+ update_balance=update_balance,
650
+ _request_auth=_request_auth,
651
+ _content_type=_content_type,
652
+ _headers=_headers,
653
+ _host_index=_host_index
654
+ )
655
+
656
+ _response_types_map: Dict[str, Optional[str]] = {
657
+ '201': "TransactionObject",
658
+ '400': "ErrorResponseObject",
659
+ '401': "ErrorResponseObject",
660
+ '404': "ErrorResponseObject",
661
+ '429': "ErrorResponseObject",
662
+ '500': "ErrorResponseObject",
663
+ }
664
+ response_data = self.api_client.call_api(
665
+ *_param,
666
+ _request_timeout=_request_timeout
667
+ )
668
+ response_data.read()
669
+ return self.api_client.response_deserialize(
670
+ response_data=response_data,
671
+ response_types_map=_response_types_map,
672
+ ).data
673
+
674
+
675
+ @validate_call
676
+ def update_transaction_with_http_info(
677
+ self,
678
+ id: Annotated[StrictInt, Field(description="ID of the transaction to update")],
679
+ update_transaction_object: UpdateTransactionObject,
680
+ update_balance: Annotated[Optional[StrictBool], Field(description="Set this to `false` to skip updating the transaction's associated account balance. Default behavior is to update balances.")] = None,
681
+ _request_timeout: Union[
682
+ None,
683
+ Annotated[StrictFloat, Field(gt=0)],
684
+ Tuple[
685
+ Annotated[StrictFloat, Field(gt=0)],
686
+ Annotated[StrictFloat, Field(gt=0)]
687
+ ]
688
+ ] = None,
689
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
690
+ _content_type: Optional[StrictStr] = None,
691
+ _headers: Optional[Dict[StrictStr, Any]] = None,
692
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
693
+ ) -> ApiResponse[TransactionObject]:
694
+ """Update an existing transaction
695
+
696
+ Modifies the properties of an existing transaction.<br><br> You may submit the response from a `GET /transactions/{id}` as the request body, however only certain properties can be updated using this API. The following system set properties are accepted in the request body but their values will be ignored: `id`, `to_base`, `is_pending`, `created_at`, `updated_at`, `source`, and `plaid_metadata`.<br><br> Transactions that have been previously split or grouped may not be modified by this endpoint. Therefore the `is_split_parent`, `split_parent_id`, `is_group_parent`, `group_parent_id`, and `children` properties are also ignored when provided in the request body.<br><br> It is also possible to provide only the properties to be updated in the request body, as long as the request includes at least one of the properties that is not listed above. For example a request body that contains only an `category_id` attribute is valid.
697
+
698
+ :param id: ID of the transaction to update (required)
699
+ :type id: int
700
+ :param update_transaction_object: (required)
701
+ :type update_transaction_object: UpdateTransactionObject
702
+ :param update_balance: Set this to `false` to skip updating the transaction's associated account balance. Default behavior is to update balances.
703
+ :type update_balance: bool
704
+ :param _request_timeout: timeout setting for this request. If one
705
+ number provided, it will be total request
706
+ timeout. It can also be a pair (tuple) of
707
+ (connection, read) timeouts.
708
+ :type _request_timeout: int, tuple(int, int), optional
709
+ :param _request_auth: set to override the auth_settings for an a single
710
+ request; this effectively ignores the
711
+ authentication in the spec for a single request.
712
+ :type _request_auth: dict, optional
713
+ :param _content_type: force content-type for the request.
714
+ :type _content_type: str, Optional
715
+ :param _headers: set to override the headers for a single
716
+ request; this effectively ignores the headers
717
+ in the spec for a single request.
718
+ :type _headers: dict, optional
719
+ :param _host_index: set to override the host_index for a single
720
+ request; this effectively ignores the host_index
721
+ in the spec for a single request.
722
+ :type _host_index: int, optional
723
+ :return: Returns the result object.
724
+ """ # noqa: E501
725
+
726
+ _param = self._update_transaction_serialize(
727
+ id=id,
728
+ update_transaction_object=update_transaction_object,
729
+ update_balance=update_balance,
730
+ _request_auth=_request_auth,
731
+ _content_type=_content_type,
732
+ _headers=_headers,
733
+ _host_index=_host_index
734
+ )
735
+
736
+ _response_types_map: Dict[str, Optional[str]] = {
737
+ '201': "TransactionObject",
738
+ '400': "ErrorResponseObject",
739
+ '401': "ErrorResponseObject",
740
+ '404': "ErrorResponseObject",
741
+ '429': "ErrorResponseObject",
742
+ '500': "ErrorResponseObject",
743
+ }
744
+ response_data = self.api_client.call_api(
745
+ *_param,
746
+ _request_timeout=_request_timeout
747
+ )
748
+ response_data.read()
749
+ return self.api_client.response_deserialize(
750
+ response_data=response_data,
751
+ response_types_map=_response_types_map,
752
+ )
753
+
754
+
755
+ @validate_call
756
+ def update_transaction_without_preload_content(
757
+ self,
758
+ id: Annotated[StrictInt, Field(description="ID of the transaction to update")],
759
+ update_transaction_object: UpdateTransactionObject,
760
+ update_balance: Annotated[Optional[StrictBool], Field(description="Set this to `false` to skip updating the transaction's associated account balance. Default behavior is to update balances.")] = None,
761
+ _request_timeout: Union[
762
+ None,
763
+ Annotated[StrictFloat, Field(gt=0)],
764
+ Tuple[
765
+ Annotated[StrictFloat, Field(gt=0)],
766
+ Annotated[StrictFloat, Field(gt=0)]
767
+ ]
768
+ ] = None,
769
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
770
+ _content_type: Optional[StrictStr] = None,
771
+ _headers: Optional[Dict[StrictStr, Any]] = None,
772
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
773
+ ) -> RESTResponseType:
774
+ """Update an existing transaction
775
+
776
+ Modifies the properties of an existing transaction.<br><br> You may submit the response from a `GET /transactions/{id}` as the request body, however only certain properties can be updated using this API. The following system set properties are accepted in the request body but their values will be ignored: `id`, `to_base`, `is_pending`, `created_at`, `updated_at`, `source`, and `plaid_metadata`.<br><br> Transactions that have been previously split or grouped may not be modified by this endpoint. Therefore the `is_split_parent`, `split_parent_id`, `is_group_parent`, `group_parent_id`, and `children` properties are also ignored when provided in the request body.<br><br> It is also possible to provide only the properties to be updated in the request body, as long as the request includes at least one of the properties that is not listed above. For example a request body that contains only an `category_id` attribute is valid.
777
+
778
+ :param id: ID of the transaction to update (required)
779
+ :type id: int
780
+ :param update_transaction_object: (required)
781
+ :type update_transaction_object: UpdateTransactionObject
782
+ :param update_balance: Set this to `false` to skip updating the transaction's associated account balance. Default behavior is to update balances.
783
+ :type update_balance: bool
784
+ :param _request_timeout: timeout setting for this request. If one
785
+ number provided, it will be total request
786
+ timeout. It can also be a pair (tuple) of
787
+ (connection, read) timeouts.
788
+ :type _request_timeout: int, tuple(int, int), optional
789
+ :param _request_auth: set to override the auth_settings for an a single
790
+ request; this effectively ignores the
791
+ authentication in the spec for a single request.
792
+ :type _request_auth: dict, optional
793
+ :param _content_type: force content-type for the request.
794
+ :type _content_type: str, Optional
795
+ :param _headers: set to override the headers for a single
796
+ request; this effectively ignores the headers
797
+ in the spec for a single request.
798
+ :type _headers: dict, optional
799
+ :param _host_index: set to override the host_index for a single
800
+ request; this effectively ignores the host_index
801
+ in the spec for a single request.
802
+ :type _host_index: int, optional
803
+ :return: Returns the result object.
804
+ """ # noqa: E501
805
+
806
+ _param = self._update_transaction_serialize(
807
+ id=id,
808
+ update_transaction_object=update_transaction_object,
809
+ update_balance=update_balance,
810
+ _request_auth=_request_auth,
811
+ _content_type=_content_type,
812
+ _headers=_headers,
813
+ _host_index=_host_index
814
+ )
815
+
816
+ _response_types_map: Dict[str, Optional[str]] = {
817
+ '201': "TransactionObject",
818
+ '400': "ErrorResponseObject",
819
+ '401': "ErrorResponseObject",
820
+ '404': "ErrorResponseObject",
821
+ '429': "ErrorResponseObject",
822
+ '500': "ErrorResponseObject",
823
+ }
824
+ response_data = self.api_client.call_api(
825
+ *_param,
826
+ _request_timeout=_request_timeout
827
+ )
828
+ return response_data.response
829
+
830
+
831
+ def _update_transaction_serialize(
832
+ self,
833
+ id,
834
+ update_transaction_object,
835
+ update_balance,
836
+ _request_auth,
837
+ _content_type,
838
+ _headers,
839
+ _host_index,
840
+ ) -> RequestSerialized:
841
+
842
+ _host = None
843
+
844
+ _collection_formats: Dict[str, str] = {
845
+ }
846
+
847
+ _path_params: Dict[str, str] = {}
848
+ _query_params: List[Tuple[str, str]] = []
849
+ _header_params: Dict[str, Optional[str]] = _headers or {}
850
+ _form_params: List[Tuple[str, str]] = []
851
+ _files: Dict[
852
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
853
+ ] = {}
854
+ _body_params: Optional[bytes] = None
855
+
856
+ # process the path parameters
857
+ if id is not None:
858
+ _path_params['id'] = id
859
+ # process the query parameters
860
+ if update_balance is not None:
861
+
862
+ _query_params.append(('update_balance', update_balance))
863
+
864
+ # process the header parameters
865
+ # process the form parameters
866
+ # process the body parameter
867
+ if update_transaction_object is not None:
868
+ _body_params = update_transaction_object
869
+
870
+
871
+ # set the HTTP header `Accept`
872
+ if 'Accept' not in _header_params:
873
+ _header_params['Accept'] = self.api_client.select_header_accept(
874
+ [
875
+ 'application/json'
876
+ ]
877
+ )
878
+
879
+ # set the HTTP header `Content-Type`
880
+ if _content_type:
881
+ _header_params['Content-Type'] = _content_type
882
+ else:
883
+ _default_content_type = (
884
+ self.api_client.select_header_content_type(
885
+ [
886
+ 'application/json'
887
+ ]
888
+ )
889
+ )
890
+ if _default_content_type is not None:
891
+ _header_params['Content-Type'] = _default_content_type
892
+
893
+ # authentication setting
894
+ _auth_settings: List[str] = [
895
+ 'cookieAuth',
896
+ 'bearerSecurity'
897
+ ]
898
+
899
+ return self.api_client.param_serialize(
900
+ method='PUT',
901
+ resource_path='/transactions/{id}',
902
+ path_params=_path_params,
903
+ query_params=_query_params,
904
+ header_params=_header_params,
905
+ body=_body_params,
906
+ post_params=_form_params,
907
+ files=_files,
908
+ auth_settings=_auth_settings,
909
+ collection_formats=_collection_formats,
910
+ _host=_host,
911
+ _request_auth=_request_auth
912
+ )
913
+
914
+