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