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,909 @@
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 datetime import date
21
+ from pydantic import Field, StrictInt
22
+ from typing import Optional
23
+ from typing_extensions import Annotated
24
+ from lunchmoney.models.get_all_plaid_accounts200_response import GetAllPlaidAccounts200Response
25
+ from lunchmoney.models.plaid_account_object import PlaidAccountObject
26
+
27
+ from lunchmoney.api_client import ApiClient, RequestSerialized
28
+ from lunchmoney.api_response import ApiResponse
29
+ from lunchmoney.rest import RESTResponseType
30
+
31
+
32
+ class PlaidAccountsApi:
33
+ """NOTE: This class is auto generated by OpenAPI Generator
34
+ Ref: https://openapi-generator.tech
35
+
36
+ Do not edit the class manually.
37
+ """
38
+
39
+ def __init__(self, api_client=None) -> None:
40
+ if api_client is None:
41
+ api_client = ApiClient.get_default()
42
+ self.api_client = api_client
43
+
44
+
45
+ @validate_call
46
+ def get_all_plaid_accounts(
47
+ self,
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
+ ) -> GetAllPlaidAccounts200Response:
61
+ """Get all accounts synced via Plaid
62
+
63
+ Retrieve a list of all synced accounts associated with the user's account.
64
+
65
+ :param _request_timeout: timeout setting for this request. If one
66
+ number provided, it will be total request
67
+ timeout. It can also be a pair (tuple) of
68
+ (connection, read) timeouts.
69
+ :type _request_timeout: int, tuple(int, int), optional
70
+ :param _request_auth: set to override the auth_settings for an a single
71
+ request; this effectively ignores the
72
+ authentication in the spec for a single request.
73
+ :type _request_auth: dict, optional
74
+ :param _content_type: force content-type for the request.
75
+ :type _content_type: str, Optional
76
+ :param _headers: set to override the headers for a single
77
+ request; this effectively ignores the headers
78
+ in the spec for a single request.
79
+ :type _headers: dict, optional
80
+ :param _host_index: set to override the host_index for a single
81
+ request; this effectively ignores the host_index
82
+ in the spec for a single request.
83
+ :type _host_index: int, optional
84
+ :return: Returns the result object.
85
+ """ # noqa: E501
86
+
87
+ _param = self._get_all_plaid_accounts_serialize(
88
+ _request_auth=_request_auth,
89
+ _content_type=_content_type,
90
+ _headers=_headers,
91
+ _host_index=_host_index
92
+ )
93
+
94
+ _response_types_map: Dict[str, Optional[str]] = {
95
+ '200': "GetAllPlaidAccounts200Response",
96
+ '400': "ErrorResponseObject",
97
+ '401': "ErrorResponseObject",
98
+ '429': "ErrorResponseObject",
99
+ '500': "ErrorResponseObject",
100
+ }
101
+ response_data = self.api_client.call_api(
102
+ *_param,
103
+ _request_timeout=_request_timeout
104
+ )
105
+ response_data.read()
106
+ return self.api_client.response_deserialize(
107
+ response_data=response_data,
108
+ response_types_map=_response_types_map,
109
+ ).data
110
+
111
+
112
+ @validate_call
113
+ def get_all_plaid_accounts_with_http_info(
114
+ self,
115
+ _request_timeout: Union[
116
+ None,
117
+ Annotated[StrictFloat, Field(gt=0)],
118
+ Tuple[
119
+ Annotated[StrictFloat, Field(gt=0)],
120
+ Annotated[StrictFloat, Field(gt=0)]
121
+ ]
122
+ ] = None,
123
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
124
+ _content_type: Optional[StrictStr] = None,
125
+ _headers: Optional[Dict[StrictStr, Any]] = None,
126
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
127
+ ) -> ApiResponse[GetAllPlaidAccounts200Response]:
128
+ """Get all accounts synced via Plaid
129
+
130
+ Retrieve a list of all synced accounts associated with the user's account.
131
+
132
+ :param _request_timeout: timeout setting for this request. If one
133
+ number provided, it will be total request
134
+ timeout. It can also be a pair (tuple) of
135
+ (connection, read) timeouts.
136
+ :type _request_timeout: int, tuple(int, int), optional
137
+ :param _request_auth: set to override the auth_settings for an a single
138
+ request; this effectively ignores the
139
+ authentication in the spec for a single request.
140
+ :type _request_auth: dict, optional
141
+ :param _content_type: force content-type for the request.
142
+ :type _content_type: str, Optional
143
+ :param _headers: set to override the headers for a single
144
+ request; this effectively ignores the headers
145
+ in the spec for a single request.
146
+ :type _headers: dict, optional
147
+ :param _host_index: set to override the host_index for a single
148
+ request; this effectively ignores the host_index
149
+ in the spec for a single request.
150
+ :type _host_index: int, optional
151
+ :return: Returns the result object.
152
+ """ # noqa: E501
153
+
154
+ _param = self._get_all_plaid_accounts_serialize(
155
+ _request_auth=_request_auth,
156
+ _content_type=_content_type,
157
+ _headers=_headers,
158
+ _host_index=_host_index
159
+ )
160
+
161
+ _response_types_map: Dict[str, Optional[str]] = {
162
+ '200': "GetAllPlaidAccounts200Response",
163
+ '400': "ErrorResponseObject",
164
+ '401': "ErrorResponseObject",
165
+ '429': "ErrorResponseObject",
166
+ '500': "ErrorResponseObject",
167
+ }
168
+ response_data = self.api_client.call_api(
169
+ *_param,
170
+ _request_timeout=_request_timeout
171
+ )
172
+ response_data.read()
173
+ return self.api_client.response_deserialize(
174
+ response_data=response_data,
175
+ response_types_map=_response_types_map,
176
+ )
177
+
178
+
179
+ @validate_call
180
+ def get_all_plaid_accounts_without_preload_content(
181
+ self,
182
+ _request_timeout: Union[
183
+ None,
184
+ Annotated[StrictFloat, Field(gt=0)],
185
+ Tuple[
186
+ Annotated[StrictFloat, Field(gt=0)],
187
+ Annotated[StrictFloat, Field(gt=0)]
188
+ ]
189
+ ] = None,
190
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
191
+ _content_type: Optional[StrictStr] = None,
192
+ _headers: Optional[Dict[StrictStr, Any]] = None,
193
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
194
+ ) -> RESTResponseType:
195
+ """Get all accounts synced via Plaid
196
+
197
+ Retrieve a list of all synced accounts associated with the user's account.
198
+
199
+ :param _request_timeout: timeout setting for this request. If one
200
+ number provided, it will be total request
201
+ timeout. It can also be a pair (tuple) of
202
+ (connection, read) timeouts.
203
+ :type _request_timeout: int, tuple(int, int), optional
204
+ :param _request_auth: set to override the auth_settings for an a single
205
+ request; this effectively ignores the
206
+ authentication in the spec for a single request.
207
+ :type _request_auth: dict, optional
208
+ :param _content_type: force content-type for the request.
209
+ :type _content_type: str, Optional
210
+ :param _headers: set to override the headers for a single
211
+ request; this effectively ignores the headers
212
+ in the spec for a single request.
213
+ :type _headers: dict, optional
214
+ :param _host_index: set to override the host_index for a single
215
+ request; this effectively ignores the host_index
216
+ in the spec for a single request.
217
+ :type _host_index: int, optional
218
+ :return: Returns the result object.
219
+ """ # noqa: E501
220
+
221
+ _param = self._get_all_plaid_accounts_serialize(
222
+ _request_auth=_request_auth,
223
+ _content_type=_content_type,
224
+ _headers=_headers,
225
+ _host_index=_host_index
226
+ )
227
+
228
+ _response_types_map: Dict[str, Optional[str]] = {
229
+ '200': "GetAllPlaidAccounts200Response",
230
+ '400': "ErrorResponseObject",
231
+ '401': "ErrorResponseObject",
232
+ '429': "ErrorResponseObject",
233
+ '500': "ErrorResponseObject",
234
+ }
235
+ response_data = self.api_client.call_api(
236
+ *_param,
237
+ _request_timeout=_request_timeout
238
+ )
239
+ return response_data.response
240
+
241
+
242
+ def _get_all_plaid_accounts_serialize(
243
+ self,
244
+ _request_auth,
245
+ _content_type,
246
+ _headers,
247
+ _host_index,
248
+ ) -> RequestSerialized:
249
+
250
+ _host = None
251
+
252
+ _collection_formats: Dict[str, str] = {
253
+ }
254
+
255
+ _path_params: Dict[str, str] = {}
256
+ _query_params: List[Tuple[str, str]] = []
257
+ _header_params: Dict[str, Optional[str]] = _headers or {}
258
+ _form_params: List[Tuple[str, str]] = []
259
+ _files: Dict[
260
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
261
+ ] = {}
262
+ _body_params: Optional[bytes] = None
263
+
264
+ # process the path parameters
265
+ # process the query parameters
266
+ # process the header parameters
267
+ # process the form parameters
268
+ # process the body parameter
269
+
270
+
271
+ # set the HTTP header `Accept`
272
+ if 'Accept' not in _header_params:
273
+ _header_params['Accept'] = self.api_client.select_header_accept(
274
+ [
275
+ 'application/json'
276
+ ]
277
+ )
278
+
279
+
280
+ # authentication setting
281
+ _auth_settings: List[str] = [
282
+ 'cookieAuth',
283
+ 'bearerSecurity'
284
+ ]
285
+
286
+ return self.api_client.param_serialize(
287
+ method='GET',
288
+ resource_path='/plaid_accounts',
289
+ path_params=_path_params,
290
+ query_params=_query_params,
291
+ header_params=_header_params,
292
+ body=_body_params,
293
+ post_params=_form_params,
294
+ files=_files,
295
+ auth_settings=_auth_settings,
296
+ collection_formats=_collection_formats,
297
+ _host=_host,
298
+ _request_auth=_request_auth
299
+ )
300
+
301
+
302
+
303
+
304
+ @validate_call
305
+ def get_plaid_account_by_id(
306
+ self,
307
+ id: Annotated[StrictInt, Field(description="ID of the plaid account to retrieve")],
308
+ _request_timeout: Union[
309
+ None,
310
+ Annotated[StrictFloat, Field(gt=0)],
311
+ Tuple[
312
+ Annotated[StrictFloat, Field(gt=0)],
313
+ Annotated[StrictFloat, Field(gt=0)]
314
+ ]
315
+ ] = None,
316
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
317
+ _content_type: Optional[StrictStr] = None,
318
+ _headers: Optional[Dict[StrictStr, Any]] = None,
319
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
320
+ ) -> PlaidAccountObject:
321
+ """Get a single account that is synced via Plaid
322
+
323
+ Retrieve the details of the plaid account with the specified ID.
324
+
325
+ :param id: ID of the plaid account to retrieve (required)
326
+ :type id: int
327
+ :param _request_timeout: timeout setting for this request. If one
328
+ number provided, it will be total request
329
+ timeout. It can also be a pair (tuple) of
330
+ (connection, read) timeouts.
331
+ :type _request_timeout: int, tuple(int, int), optional
332
+ :param _request_auth: set to override the auth_settings for an a single
333
+ request; this effectively ignores the
334
+ authentication in the spec for a single request.
335
+ :type _request_auth: dict, optional
336
+ :param _content_type: force content-type for the request.
337
+ :type _content_type: str, Optional
338
+ :param _headers: set to override the headers for a single
339
+ request; this effectively ignores the headers
340
+ in the spec for a single request.
341
+ :type _headers: dict, optional
342
+ :param _host_index: set to override the host_index for a single
343
+ request; this effectively ignores the host_index
344
+ in the spec for a single request.
345
+ :type _host_index: int, optional
346
+ :return: Returns the result object.
347
+ """ # noqa: E501
348
+
349
+ _param = self._get_plaid_account_by_id_serialize(
350
+ id=id,
351
+ _request_auth=_request_auth,
352
+ _content_type=_content_type,
353
+ _headers=_headers,
354
+ _host_index=_host_index
355
+ )
356
+
357
+ _response_types_map: Dict[str, Optional[str]] = {
358
+ '200': "PlaidAccountObject",
359
+ '400': "ErrorResponseObject",
360
+ '401': "ErrorResponseObject",
361
+ '404': "ErrorResponseObject",
362
+ '429': "ErrorResponseObject",
363
+ '500': "ErrorResponseObject",
364
+ }
365
+ response_data = self.api_client.call_api(
366
+ *_param,
367
+ _request_timeout=_request_timeout
368
+ )
369
+ response_data.read()
370
+ return self.api_client.response_deserialize(
371
+ response_data=response_data,
372
+ response_types_map=_response_types_map,
373
+ ).data
374
+
375
+
376
+ @validate_call
377
+ def get_plaid_account_by_id_with_http_info(
378
+ self,
379
+ id: Annotated[StrictInt, Field(description="ID of the plaid account to retrieve")],
380
+ _request_timeout: Union[
381
+ None,
382
+ Annotated[StrictFloat, Field(gt=0)],
383
+ Tuple[
384
+ Annotated[StrictFloat, Field(gt=0)],
385
+ Annotated[StrictFloat, Field(gt=0)]
386
+ ]
387
+ ] = None,
388
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
389
+ _content_type: Optional[StrictStr] = None,
390
+ _headers: Optional[Dict[StrictStr, Any]] = None,
391
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
392
+ ) -> ApiResponse[PlaidAccountObject]:
393
+ """Get a single account that is synced via Plaid
394
+
395
+ Retrieve the details of the plaid account with the specified ID.
396
+
397
+ :param id: ID of the plaid account to retrieve (required)
398
+ :type id: int
399
+ :param _request_timeout: timeout setting for this request. If one
400
+ number provided, it will be total request
401
+ timeout. It can also be a pair (tuple) of
402
+ (connection, read) timeouts.
403
+ :type _request_timeout: int, tuple(int, int), optional
404
+ :param _request_auth: set to override the auth_settings for an a single
405
+ request; this effectively ignores the
406
+ authentication in the spec for a single request.
407
+ :type _request_auth: dict, optional
408
+ :param _content_type: force content-type for the request.
409
+ :type _content_type: str, Optional
410
+ :param _headers: set to override the headers for a single
411
+ request; this effectively ignores the headers
412
+ in the spec for a single request.
413
+ :type _headers: dict, optional
414
+ :param _host_index: set to override the host_index for a single
415
+ request; this effectively ignores the host_index
416
+ in the spec for a single request.
417
+ :type _host_index: int, optional
418
+ :return: Returns the result object.
419
+ """ # noqa: E501
420
+
421
+ _param = self._get_plaid_account_by_id_serialize(
422
+ id=id,
423
+ _request_auth=_request_auth,
424
+ _content_type=_content_type,
425
+ _headers=_headers,
426
+ _host_index=_host_index
427
+ )
428
+
429
+ _response_types_map: Dict[str, Optional[str]] = {
430
+ '200': "PlaidAccountObject",
431
+ '400': "ErrorResponseObject",
432
+ '401': "ErrorResponseObject",
433
+ '404': "ErrorResponseObject",
434
+ '429': "ErrorResponseObject",
435
+ '500': "ErrorResponseObject",
436
+ }
437
+ response_data = self.api_client.call_api(
438
+ *_param,
439
+ _request_timeout=_request_timeout
440
+ )
441
+ response_data.read()
442
+ return self.api_client.response_deserialize(
443
+ response_data=response_data,
444
+ response_types_map=_response_types_map,
445
+ )
446
+
447
+
448
+ @validate_call
449
+ def get_plaid_account_by_id_without_preload_content(
450
+ self,
451
+ id: Annotated[StrictInt, Field(description="ID of the plaid account to retrieve")],
452
+ _request_timeout: Union[
453
+ None,
454
+ Annotated[StrictFloat, Field(gt=0)],
455
+ Tuple[
456
+ Annotated[StrictFloat, Field(gt=0)],
457
+ Annotated[StrictFloat, Field(gt=0)]
458
+ ]
459
+ ] = None,
460
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
461
+ _content_type: Optional[StrictStr] = None,
462
+ _headers: Optional[Dict[StrictStr, Any]] = None,
463
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
464
+ ) -> RESTResponseType:
465
+ """Get a single account that is synced via Plaid
466
+
467
+ Retrieve the details of the plaid account with the specified ID.
468
+
469
+ :param id: ID of the plaid account to retrieve (required)
470
+ :type id: int
471
+ :param _request_timeout: timeout setting for this request. If one
472
+ number provided, it will be total request
473
+ timeout. It can also be a pair (tuple) of
474
+ (connection, read) timeouts.
475
+ :type _request_timeout: int, tuple(int, int), optional
476
+ :param _request_auth: set to override the auth_settings for an a single
477
+ request; this effectively ignores the
478
+ authentication in the spec for a single request.
479
+ :type _request_auth: dict, optional
480
+ :param _content_type: force content-type for the request.
481
+ :type _content_type: str, Optional
482
+ :param _headers: set to override the headers for a single
483
+ request; this effectively ignores the headers
484
+ in the spec for a single request.
485
+ :type _headers: dict, optional
486
+ :param _host_index: set to override the host_index for a single
487
+ request; this effectively ignores the host_index
488
+ in the spec for a single request.
489
+ :type _host_index: int, optional
490
+ :return: Returns the result object.
491
+ """ # noqa: E501
492
+
493
+ _param = self._get_plaid_account_by_id_serialize(
494
+ id=id,
495
+ _request_auth=_request_auth,
496
+ _content_type=_content_type,
497
+ _headers=_headers,
498
+ _host_index=_host_index
499
+ )
500
+
501
+ _response_types_map: Dict[str, Optional[str]] = {
502
+ '200': "PlaidAccountObject",
503
+ '400': "ErrorResponseObject",
504
+ '401': "ErrorResponseObject",
505
+ '404': "ErrorResponseObject",
506
+ '429': "ErrorResponseObject",
507
+ '500': "ErrorResponseObject",
508
+ }
509
+ response_data = self.api_client.call_api(
510
+ *_param,
511
+ _request_timeout=_request_timeout
512
+ )
513
+ return response_data.response
514
+
515
+
516
+ def _get_plaid_account_by_id_serialize(
517
+ self,
518
+ id,
519
+ _request_auth,
520
+ _content_type,
521
+ _headers,
522
+ _host_index,
523
+ ) -> RequestSerialized:
524
+
525
+ _host = None
526
+
527
+ _collection_formats: Dict[str, str] = {
528
+ }
529
+
530
+ _path_params: Dict[str, str] = {}
531
+ _query_params: List[Tuple[str, str]] = []
532
+ _header_params: Dict[str, Optional[str]] = _headers or {}
533
+ _form_params: List[Tuple[str, str]] = []
534
+ _files: Dict[
535
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
536
+ ] = {}
537
+ _body_params: Optional[bytes] = None
538
+
539
+ # process the path parameters
540
+ if id is not None:
541
+ _path_params['id'] = id
542
+ # process the query parameters
543
+ # process the header parameters
544
+ # process the form parameters
545
+ # process the body parameter
546
+
547
+
548
+ # set the HTTP header `Accept`
549
+ if 'Accept' not in _header_params:
550
+ _header_params['Accept'] = self.api_client.select_header_accept(
551
+ [
552
+ 'application/json'
553
+ ]
554
+ )
555
+
556
+
557
+ # authentication setting
558
+ _auth_settings: List[str] = [
559
+ 'cookieAuth',
560
+ 'bearerSecurity'
561
+ ]
562
+
563
+ return self.api_client.param_serialize(
564
+ method='GET',
565
+ resource_path='/plaid_accounts/{id}',
566
+ path_params=_path_params,
567
+ query_params=_query_params,
568
+ header_params=_header_params,
569
+ body=_body_params,
570
+ post_params=_form_params,
571
+ files=_files,
572
+ auth_settings=_auth_settings,
573
+ collection_formats=_collection_formats,
574
+ _host=_host,
575
+ _request_auth=_request_auth
576
+ )
577
+
578
+
579
+
580
+
581
+ @validate_call
582
+ def trigger_plaid_account_fetch(
583
+ self,
584
+ start_date: Annotated[Optional[date], Field(description="Denotes the beginning of the time period to fetch transactions for. If omitted, the most recent transactions will be returned. <br> Required if end_date exists. <br>")] = None,
585
+ end_date: Annotated[Optional[date], Field(description="Denotes the end of the time period you'd like to get transactions for. Required if start_date exists. ")] = None,
586
+ id: Annotated[Optional[StrictInt], Field(description="Specific ID of a plaid account to fetch. If not set the endpoint will trigger a fetch for all eligible accounts.")] = None,
587
+ _request_timeout: Union[
588
+ None,
589
+ Annotated[StrictFloat, Field(gt=0)],
590
+ Tuple[
591
+ Annotated[StrictFloat, Field(gt=0)],
592
+ Annotated[StrictFloat, Field(gt=0)]
593
+ ]
594
+ ] = None,
595
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
596
+ _content_type: Optional[StrictStr] = None,
597
+ _headers: Optional[Dict[StrictStr, Any]] = None,
598
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
599
+ ) -> None:
600
+ """Trigger Fetch from Plaid
601
+
602
+ Use this endpoint to trigger a fetch for latest data from Plaid.<br><br> Eligible accounts are those who last_fetch value is over 1 minute ago. (Although the limit is every minute, please use this endpoint sparingly!) Successive calls to this endpoint under a minute after the first will return a 425 TOO EARLY response.<br><br> Successful calls will return a 202 ACCEPTED response. Note that fetching from Plaid is a background job. This endpoint simply queues up the job. You may track the `plaid_last_successful_update`, `last_fetch` and `last_import` properties to verify the results of the fetch. The `last fetch` property is updated when Plaid accepts a request to fetch data. The `plaid_last_successful_update`is updated when it successfully contacts the associated financial institution. The `last_import` field is updated only when new transactions have been imported.
603
+
604
+ :param start_date: Denotes the beginning of the time period to fetch transactions for. If omitted, the most recent transactions will be returned. <br> Required if end_date exists. <br>
605
+ :type start_date: date
606
+ :param end_date: Denotes the end of the time period you'd like to get transactions for. Required if start_date exists.
607
+ :type end_date: date
608
+ :param id: Specific ID of a plaid account to fetch. If not set the endpoint will trigger a fetch for all eligible accounts.
609
+ :type id: int
610
+ :param _request_timeout: timeout setting for this request. If one
611
+ number provided, it will be total request
612
+ timeout. It can also be a pair (tuple) of
613
+ (connection, read) timeouts.
614
+ :type _request_timeout: int, tuple(int, int), optional
615
+ :param _request_auth: set to override the auth_settings for an a single
616
+ request; this effectively ignores the
617
+ authentication in the spec for a single request.
618
+ :type _request_auth: dict, optional
619
+ :param _content_type: force content-type for the request.
620
+ :type _content_type: str, Optional
621
+ :param _headers: set to override the headers for a single
622
+ request; this effectively ignores the headers
623
+ in the spec for a single request.
624
+ :type _headers: dict, optional
625
+ :param _host_index: set to override the host_index for a single
626
+ request; this effectively ignores the host_index
627
+ in the spec for a single request.
628
+ :type _host_index: int, optional
629
+ :return: Returns the result object.
630
+ """ # noqa: E501
631
+
632
+ _param = self._trigger_plaid_account_fetch_serialize(
633
+ start_date=start_date,
634
+ end_date=end_date,
635
+ id=id,
636
+ _request_auth=_request_auth,
637
+ _content_type=_content_type,
638
+ _headers=_headers,
639
+ _host_index=_host_index
640
+ )
641
+
642
+ _response_types_map: Dict[str, Optional[str]] = {
643
+ '202': None,
644
+ '400': "ErrorResponseObject",
645
+ '401': "ErrorResponseObject",
646
+ '425': "ErrorResponseObject",
647
+ '429': "ErrorResponseObject",
648
+ '500': "ErrorResponseObject",
649
+ }
650
+ response_data = self.api_client.call_api(
651
+ *_param,
652
+ _request_timeout=_request_timeout
653
+ )
654
+ response_data.read()
655
+ return self.api_client.response_deserialize(
656
+ response_data=response_data,
657
+ response_types_map=_response_types_map,
658
+ ).data
659
+
660
+
661
+ @validate_call
662
+ def trigger_plaid_account_fetch_with_http_info(
663
+ self,
664
+ start_date: Annotated[Optional[date], Field(description="Denotes the beginning of the time period to fetch transactions for. If omitted, the most recent transactions will be returned. <br> Required if end_date exists. <br>")] = None,
665
+ end_date: Annotated[Optional[date], Field(description="Denotes the end of the time period you'd like to get transactions for. Required if start_date exists. ")] = None,
666
+ id: Annotated[Optional[StrictInt], Field(description="Specific ID of a plaid account to fetch. If not set the endpoint will trigger a fetch for all eligible accounts.")] = None,
667
+ _request_timeout: Union[
668
+ None,
669
+ Annotated[StrictFloat, Field(gt=0)],
670
+ Tuple[
671
+ Annotated[StrictFloat, Field(gt=0)],
672
+ Annotated[StrictFloat, Field(gt=0)]
673
+ ]
674
+ ] = None,
675
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
676
+ _content_type: Optional[StrictStr] = None,
677
+ _headers: Optional[Dict[StrictStr, Any]] = None,
678
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
679
+ ) -> ApiResponse[None]:
680
+ """Trigger Fetch from Plaid
681
+
682
+ Use this endpoint to trigger a fetch for latest data from Plaid.<br><br> Eligible accounts are those who last_fetch value is over 1 minute ago. (Although the limit is every minute, please use this endpoint sparingly!) Successive calls to this endpoint under a minute after the first will return a 425 TOO EARLY response.<br><br> Successful calls will return a 202 ACCEPTED response. Note that fetching from Plaid is a background job. This endpoint simply queues up the job. You may track the `plaid_last_successful_update`, `last_fetch` and `last_import` properties to verify the results of the fetch. The `last fetch` property is updated when Plaid accepts a request to fetch data. The `plaid_last_successful_update`is updated when it successfully contacts the associated financial institution. The `last_import` field is updated only when new transactions have been imported.
683
+
684
+ :param start_date: Denotes the beginning of the time period to fetch transactions for. If omitted, the most recent transactions will be returned. <br> Required if end_date exists. <br>
685
+ :type start_date: date
686
+ :param end_date: Denotes the end of the time period you'd like to get transactions for. Required if start_date exists.
687
+ :type end_date: date
688
+ :param id: Specific ID of a plaid account to fetch. If not set the endpoint will trigger a fetch for all eligible accounts.
689
+ :type id: int
690
+ :param _request_timeout: timeout setting for this request. If one
691
+ number provided, it will be total request
692
+ timeout. It can also be a pair (tuple) of
693
+ (connection, read) timeouts.
694
+ :type _request_timeout: int, tuple(int, int), optional
695
+ :param _request_auth: set to override the auth_settings for an a single
696
+ request; this effectively ignores the
697
+ authentication in the spec for a single request.
698
+ :type _request_auth: dict, optional
699
+ :param _content_type: force content-type for the request.
700
+ :type _content_type: str, Optional
701
+ :param _headers: set to override the headers for a single
702
+ request; this effectively ignores the headers
703
+ in the spec for a single request.
704
+ :type _headers: dict, optional
705
+ :param _host_index: set to override the host_index for a single
706
+ request; this effectively ignores the host_index
707
+ in the spec for a single request.
708
+ :type _host_index: int, optional
709
+ :return: Returns the result object.
710
+ """ # noqa: E501
711
+
712
+ _param = self._trigger_plaid_account_fetch_serialize(
713
+ start_date=start_date,
714
+ end_date=end_date,
715
+ id=id,
716
+ _request_auth=_request_auth,
717
+ _content_type=_content_type,
718
+ _headers=_headers,
719
+ _host_index=_host_index
720
+ )
721
+
722
+ _response_types_map: Dict[str, Optional[str]] = {
723
+ '202': None,
724
+ '400': "ErrorResponseObject",
725
+ '401': "ErrorResponseObject",
726
+ '425': "ErrorResponseObject",
727
+ '429': "ErrorResponseObject",
728
+ '500': "ErrorResponseObject",
729
+ }
730
+ response_data = self.api_client.call_api(
731
+ *_param,
732
+ _request_timeout=_request_timeout
733
+ )
734
+ response_data.read()
735
+ return self.api_client.response_deserialize(
736
+ response_data=response_data,
737
+ response_types_map=_response_types_map,
738
+ )
739
+
740
+
741
+ @validate_call
742
+ def trigger_plaid_account_fetch_without_preload_content(
743
+ self,
744
+ start_date: Annotated[Optional[date], Field(description="Denotes the beginning of the time period to fetch transactions for. If omitted, the most recent transactions will be returned. <br> Required if end_date exists. <br>")] = None,
745
+ end_date: Annotated[Optional[date], Field(description="Denotes the end of the time period you'd like to get transactions for. Required if start_date exists. ")] = None,
746
+ id: Annotated[Optional[StrictInt], Field(description="Specific ID of a plaid account to fetch. If not set the endpoint will trigger a fetch for all eligible accounts.")] = None,
747
+ _request_timeout: Union[
748
+ None,
749
+ Annotated[StrictFloat, Field(gt=0)],
750
+ Tuple[
751
+ Annotated[StrictFloat, Field(gt=0)],
752
+ Annotated[StrictFloat, Field(gt=0)]
753
+ ]
754
+ ] = None,
755
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
756
+ _content_type: Optional[StrictStr] = None,
757
+ _headers: Optional[Dict[StrictStr, Any]] = None,
758
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
759
+ ) -> RESTResponseType:
760
+ """Trigger Fetch from Plaid
761
+
762
+ Use this endpoint to trigger a fetch for latest data from Plaid.<br><br> Eligible accounts are those who last_fetch value is over 1 minute ago. (Although the limit is every minute, please use this endpoint sparingly!) Successive calls to this endpoint under a minute after the first will return a 425 TOO EARLY response.<br><br> Successful calls will return a 202 ACCEPTED response. Note that fetching from Plaid is a background job. This endpoint simply queues up the job. You may track the `plaid_last_successful_update`, `last_fetch` and `last_import` properties to verify the results of the fetch. The `last fetch` property is updated when Plaid accepts a request to fetch data. The `plaid_last_successful_update`is updated when it successfully contacts the associated financial institution. The `last_import` field is updated only when new transactions have been imported.
763
+
764
+ :param start_date: Denotes the beginning of the time period to fetch transactions for. If omitted, the most recent transactions will be returned. <br> Required if end_date exists. <br>
765
+ :type start_date: date
766
+ :param end_date: Denotes the end of the time period you'd like to get transactions for. Required if start_date exists.
767
+ :type end_date: date
768
+ :param id: Specific ID of a plaid account to fetch. If not set the endpoint will trigger a fetch for all eligible accounts.
769
+ :type id: int
770
+ :param _request_timeout: timeout setting for this request. If one
771
+ number provided, it will be total request
772
+ timeout. It can also be a pair (tuple) of
773
+ (connection, read) timeouts.
774
+ :type _request_timeout: int, tuple(int, int), optional
775
+ :param _request_auth: set to override the auth_settings for an a single
776
+ request; this effectively ignores the
777
+ authentication in the spec for a single request.
778
+ :type _request_auth: dict, optional
779
+ :param _content_type: force content-type for the request.
780
+ :type _content_type: str, Optional
781
+ :param _headers: set to override the headers for a single
782
+ request; this effectively ignores the headers
783
+ in the spec for a single request.
784
+ :type _headers: dict, optional
785
+ :param _host_index: set to override the host_index for a single
786
+ request; this effectively ignores the host_index
787
+ in the spec for a single request.
788
+ :type _host_index: int, optional
789
+ :return: Returns the result object.
790
+ """ # noqa: E501
791
+
792
+ _param = self._trigger_plaid_account_fetch_serialize(
793
+ start_date=start_date,
794
+ end_date=end_date,
795
+ id=id,
796
+ _request_auth=_request_auth,
797
+ _content_type=_content_type,
798
+ _headers=_headers,
799
+ _host_index=_host_index
800
+ )
801
+
802
+ _response_types_map: Dict[str, Optional[str]] = {
803
+ '202': None,
804
+ '400': "ErrorResponseObject",
805
+ '401': "ErrorResponseObject",
806
+ '425': "ErrorResponseObject",
807
+ '429': "ErrorResponseObject",
808
+ '500': "ErrorResponseObject",
809
+ }
810
+ response_data = self.api_client.call_api(
811
+ *_param,
812
+ _request_timeout=_request_timeout
813
+ )
814
+ return response_data.response
815
+
816
+
817
+ def _trigger_plaid_account_fetch_serialize(
818
+ self,
819
+ start_date,
820
+ end_date,
821
+ id,
822
+ _request_auth,
823
+ _content_type,
824
+ _headers,
825
+ _host_index,
826
+ ) -> RequestSerialized:
827
+
828
+ _host = None
829
+
830
+ _collection_formats: Dict[str, str] = {
831
+ }
832
+
833
+ _path_params: Dict[str, str] = {}
834
+ _query_params: List[Tuple[str, str]] = []
835
+ _header_params: Dict[str, Optional[str]] = _headers or {}
836
+ _form_params: List[Tuple[str, str]] = []
837
+ _files: Dict[
838
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
839
+ ] = {}
840
+ _body_params: Optional[bytes] = None
841
+
842
+ # process the path parameters
843
+ # process the query parameters
844
+ if start_date is not None:
845
+ if isinstance(start_date, date):
846
+ _query_params.append(
847
+ (
848
+ 'start_date',
849
+ start_date.strftime(
850
+ self.api_client.configuration.date_format
851
+ )
852
+ )
853
+ )
854
+ else:
855
+ _query_params.append(('start_date', start_date))
856
+
857
+ if end_date is not None:
858
+ if isinstance(end_date, date):
859
+ _query_params.append(
860
+ (
861
+ 'end_date',
862
+ end_date.strftime(
863
+ self.api_client.configuration.date_format
864
+ )
865
+ )
866
+ )
867
+ else:
868
+ _query_params.append(('end_date', end_date))
869
+
870
+ if id is not None:
871
+
872
+ _query_params.append(('id', id))
873
+
874
+ # process the header parameters
875
+ # process the form parameters
876
+ # process the body parameter
877
+
878
+
879
+ # set the HTTP header `Accept`
880
+ if 'Accept' not in _header_params:
881
+ _header_params['Accept'] = self.api_client.select_header_accept(
882
+ [
883
+ 'application/json'
884
+ ]
885
+ )
886
+
887
+
888
+ # authentication setting
889
+ _auth_settings: List[str] = [
890
+ 'cookieAuth',
891
+ 'bearerSecurity'
892
+ ]
893
+
894
+ return self.api_client.param_serialize(
895
+ method='POST',
896
+ resource_path='/plaid_accounts/fetch',
897
+ path_params=_path_params,
898
+ query_params=_query_params,
899
+ header_params=_header_params,
900
+ body=_body_params,
901
+ post_params=_form_params,
902
+ files=_files,
903
+ auth_settings=_auth_settings,
904
+ collection_formats=_collection_formats,
905
+ _host=_host,
906
+ _request_auth=_request_auth
907
+ )
908
+
909
+