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,702 @@
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, StrictBool, StrictInt
22
+ from typing import Optional
23
+ from typing_extensions import Annotated
24
+ from lunchmoney.models.get_all_recurring200_response import GetAllRecurring200Response
25
+ from lunchmoney.models.recurring_object import RecurringObject
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 RecurringItemsApi:
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_recurring(
47
+ self,
48
+ start_date: Annotated[Optional[date], Field(description="Denotes the beginning of the range used to populate the `matching` object in the recurring items. If omitted, the current month will be used as the range.<br> Required if end_date exists.")] = None,
49
+ end_date: Annotated[Optional[date], Field(description="Denotes the end of the the range used to populate the `matching` object in the recurring items. Required if start_date exists. ")] = None,
50
+ include_suggested: Optional[StrictBool] = None,
51
+ _request_timeout: Union[
52
+ None,
53
+ Annotated[StrictFloat, Field(gt=0)],
54
+ Tuple[
55
+ Annotated[StrictFloat, Field(gt=0)],
56
+ Annotated[StrictFloat, Field(gt=0)]
57
+ ]
58
+ ] = None,
59
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
60
+ _content_type: Optional[StrictStr] = None,
61
+ _headers: Optional[Dict[StrictStr, Any]] = None,
62
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
63
+ ) -> GetAllRecurring200Response:
64
+ """Get all recurring items
65
+
66
+ Get info about the recurring items for a specified time frame
67
+
68
+ :param start_date: Denotes the beginning of the range used to populate the `matching` object in the recurring items. If omitted, the current month will be used as the range.<br> Required if end_date exists.
69
+ :type start_date: date
70
+ :param end_date: Denotes the end of the the range used to populate the `matching` object in the recurring items. Required if start_date exists.
71
+ :type end_date: date
72
+ :param include_suggested:
73
+ :type include_suggested: bool
74
+ :param _request_timeout: timeout setting for this request. If one
75
+ number provided, it will be total request
76
+ timeout. It can also be a pair (tuple) of
77
+ (connection, read) timeouts.
78
+ :type _request_timeout: int, tuple(int, int), optional
79
+ :param _request_auth: set to override the auth_settings for an a single
80
+ request; this effectively ignores the
81
+ authentication in the spec for a single request.
82
+ :type _request_auth: dict, optional
83
+ :param _content_type: force content-type for the request.
84
+ :type _content_type: str, Optional
85
+ :param _headers: set to override the headers for a single
86
+ request; this effectively ignores the headers
87
+ in the spec for a single request.
88
+ :type _headers: dict, optional
89
+ :param _host_index: set to override the host_index for a single
90
+ request; this effectively ignores the host_index
91
+ in the spec for a single request.
92
+ :type _host_index: int, optional
93
+ :return: Returns the result object.
94
+ """ # noqa: E501
95
+
96
+ _param = self._get_all_recurring_serialize(
97
+ start_date=start_date,
98
+ end_date=end_date,
99
+ include_suggested=include_suggested,
100
+ _request_auth=_request_auth,
101
+ _content_type=_content_type,
102
+ _headers=_headers,
103
+ _host_index=_host_index
104
+ )
105
+
106
+ _response_types_map: Dict[str, Optional[str]] = {
107
+ '200': "GetAllRecurring200Response",
108
+ '400': "ErrorResponseObject",
109
+ '401': "ErrorResponseObject",
110
+ '404': "ErrorResponseObject",
111
+ '429': "ErrorResponseObject",
112
+ '500': "ErrorResponseObject",
113
+ }
114
+ response_data = self.api_client.call_api(
115
+ *_param,
116
+ _request_timeout=_request_timeout
117
+ )
118
+ response_data.read()
119
+ return self.api_client.response_deserialize(
120
+ response_data=response_data,
121
+ response_types_map=_response_types_map,
122
+ ).data
123
+
124
+
125
+ @validate_call
126
+ def get_all_recurring_with_http_info(
127
+ self,
128
+ start_date: Annotated[Optional[date], Field(description="Denotes the beginning of the range used to populate the `matching` object in the recurring items. If omitted, the current month will be used as the range.<br> Required if end_date exists.")] = None,
129
+ end_date: Annotated[Optional[date], Field(description="Denotes the end of the the range used to populate the `matching` object in the recurring items. Required if start_date exists. ")] = None,
130
+ include_suggested: Optional[StrictBool] = None,
131
+ _request_timeout: Union[
132
+ None,
133
+ Annotated[StrictFloat, Field(gt=0)],
134
+ Tuple[
135
+ Annotated[StrictFloat, Field(gt=0)],
136
+ Annotated[StrictFloat, Field(gt=0)]
137
+ ]
138
+ ] = None,
139
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
140
+ _content_type: Optional[StrictStr] = None,
141
+ _headers: Optional[Dict[StrictStr, Any]] = None,
142
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
143
+ ) -> ApiResponse[GetAllRecurring200Response]:
144
+ """Get all recurring items
145
+
146
+ Get info about the recurring items for a specified time frame
147
+
148
+ :param start_date: Denotes the beginning of the range used to populate the `matching` object in the recurring items. If omitted, the current month will be used as the range.<br> Required if end_date exists.
149
+ :type start_date: date
150
+ :param end_date: Denotes the end of the the range used to populate the `matching` object in the recurring items. Required if start_date exists.
151
+ :type end_date: date
152
+ :param include_suggested:
153
+ :type include_suggested: bool
154
+ :param _request_timeout: timeout setting for this request. If one
155
+ number provided, it will be total request
156
+ timeout. It can also be a pair (tuple) of
157
+ (connection, read) timeouts.
158
+ :type _request_timeout: int, tuple(int, int), optional
159
+ :param _request_auth: set to override the auth_settings for an a single
160
+ request; this effectively ignores the
161
+ authentication in the spec for a single request.
162
+ :type _request_auth: dict, optional
163
+ :param _content_type: force content-type for the request.
164
+ :type _content_type: str, Optional
165
+ :param _headers: set to override the headers for a single
166
+ request; this effectively ignores the headers
167
+ in the spec for a single request.
168
+ :type _headers: dict, optional
169
+ :param _host_index: set to override the host_index for a single
170
+ request; this effectively ignores the host_index
171
+ in the spec for a single request.
172
+ :type _host_index: int, optional
173
+ :return: Returns the result object.
174
+ """ # noqa: E501
175
+
176
+ _param = self._get_all_recurring_serialize(
177
+ start_date=start_date,
178
+ end_date=end_date,
179
+ include_suggested=include_suggested,
180
+ _request_auth=_request_auth,
181
+ _content_type=_content_type,
182
+ _headers=_headers,
183
+ _host_index=_host_index
184
+ )
185
+
186
+ _response_types_map: Dict[str, Optional[str]] = {
187
+ '200': "GetAllRecurring200Response",
188
+ '400': "ErrorResponseObject",
189
+ '401': "ErrorResponseObject",
190
+ '404': "ErrorResponseObject",
191
+ '429': "ErrorResponseObject",
192
+ '500': "ErrorResponseObject",
193
+ }
194
+ response_data = self.api_client.call_api(
195
+ *_param,
196
+ _request_timeout=_request_timeout
197
+ )
198
+ response_data.read()
199
+ return self.api_client.response_deserialize(
200
+ response_data=response_data,
201
+ response_types_map=_response_types_map,
202
+ )
203
+
204
+
205
+ @validate_call
206
+ def get_all_recurring_without_preload_content(
207
+ self,
208
+ start_date: Annotated[Optional[date], Field(description="Denotes the beginning of the range used to populate the `matching` object in the recurring items. If omitted, the current month will be used as the range.<br> Required if end_date exists.")] = None,
209
+ end_date: Annotated[Optional[date], Field(description="Denotes the end of the the range used to populate the `matching` object in the recurring items. Required if start_date exists. ")] = None,
210
+ include_suggested: Optional[StrictBool] = None,
211
+ _request_timeout: Union[
212
+ None,
213
+ Annotated[StrictFloat, Field(gt=0)],
214
+ Tuple[
215
+ Annotated[StrictFloat, Field(gt=0)],
216
+ Annotated[StrictFloat, Field(gt=0)]
217
+ ]
218
+ ] = None,
219
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
220
+ _content_type: Optional[StrictStr] = None,
221
+ _headers: Optional[Dict[StrictStr, Any]] = None,
222
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
223
+ ) -> RESTResponseType:
224
+ """Get all recurring items
225
+
226
+ Get info about the recurring items for a specified time frame
227
+
228
+ :param start_date: Denotes the beginning of the range used to populate the `matching` object in the recurring items. If omitted, the current month will be used as the range.<br> Required if end_date exists.
229
+ :type start_date: date
230
+ :param end_date: Denotes the end of the the range used to populate the `matching` object in the recurring items. Required if start_date exists.
231
+ :type end_date: date
232
+ :param include_suggested:
233
+ :type include_suggested: bool
234
+ :param _request_timeout: timeout setting for this request. If one
235
+ number provided, it will be total request
236
+ timeout. It can also be a pair (tuple) of
237
+ (connection, read) timeouts.
238
+ :type _request_timeout: int, tuple(int, int), optional
239
+ :param _request_auth: set to override the auth_settings for an a single
240
+ request; this effectively ignores the
241
+ authentication in the spec for a single request.
242
+ :type _request_auth: dict, optional
243
+ :param _content_type: force content-type for the request.
244
+ :type _content_type: str, Optional
245
+ :param _headers: set to override the headers for a single
246
+ request; this effectively ignores the headers
247
+ in the spec for a single request.
248
+ :type _headers: dict, optional
249
+ :param _host_index: set to override the host_index for a single
250
+ request; this effectively ignores the host_index
251
+ in the spec for a single request.
252
+ :type _host_index: int, optional
253
+ :return: Returns the result object.
254
+ """ # noqa: E501
255
+
256
+ _param = self._get_all_recurring_serialize(
257
+ start_date=start_date,
258
+ end_date=end_date,
259
+ include_suggested=include_suggested,
260
+ _request_auth=_request_auth,
261
+ _content_type=_content_type,
262
+ _headers=_headers,
263
+ _host_index=_host_index
264
+ )
265
+
266
+ _response_types_map: Dict[str, Optional[str]] = {
267
+ '200': "GetAllRecurring200Response",
268
+ '400': "ErrorResponseObject",
269
+ '401': "ErrorResponseObject",
270
+ '404': "ErrorResponseObject",
271
+ '429': "ErrorResponseObject",
272
+ '500': "ErrorResponseObject",
273
+ }
274
+ response_data = self.api_client.call_api(
275
+ *_param,
276
+ _request_timeout=_request_timeout
277
+ )
278
+ return response_data.response
279
+
280
+
281
+ def _get_all_recurring_serialize(
282
+ self,
283
+ start_date,
284
+ end_date,
285
+ include_suggested,
286
+ _request_auth,
287
+ _content_type,
288
+ _headers,
289
+ _host_index,
290
+ ) -> RequestSerialized:
291
+
292
+ _host = None
293
+
294
+ _collection_formats: Dict[str, str] = {
295
+ }
296
+
297
+ _path_params: Dict[str, str] = {}
298
+ _query_params: List[Tuple[str, str]] = []
299
+ _header_params: Dict[str, Optional[str]] = _headers or {}
300
+ _form_params: List[Tuple[str, str]] = []
301
+ _files: Dict[
302
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
303
+ ] = {}
304
+ _body_params: Optional[bytes] = None
305
+
306
+ # process the path parameters
307
+ # process the query parameters
308
+ if start_date is not None:
309
+ if isinstance(start_date, date):
310
+ _query_params.append(
311
+ (
312
+ 'start_date',
313
+ start_date.strftime(
314
+ self.api_client.configuration.date_format
315
+ )
316
+ )
317
+ )
318
+ else:
319
+ _query_params.append(('start_date', start_date))
320
+
321
+ if end_date is not None:
322
+ if isinstance(end_date, date):
323
+ _query_params.append(
324
+ (
325
+ 'end_date',
326
+ end_date.strftime(
327
+ self.api_client.configuration.date_format
328
+ )
329
+ )
330
+ )
331
+ else:
332
+ _query_params.append(('end_date', end_date))
333
+
334
+ if include_suggested is not None:
335
+
336
+ _query_params.append(('include_suggested', include_suggested))
337
+
338
+ # process the header parameters
339
+ # process the form parameters
340
+ # process the body parameter
341
+
342
+
343
+ # set the HTTP header `Accept`
344
+ if 'Accept' not in _header_params:
345
+ _header_params['Accept'] = self.api_client.select_header_accept(
346
+ [
347
+ 'application/json'
348
+ ]
349
+ )
350
+
351
+
352
+ # authentication setting
353
+ _auth_settings: List[str] = [
354
+ 'cookieAuth',
355
+ 'bearerSecurity'
356
+ ]
357
+
358
+ return self.api_client.param_serialize(
359
+ method='GET',
360
+ resource_path='/recurring_items',
361
+ path_params=_path_params,
362
+ query_params=_query_params,
363
+ header_params=_header_params,
364
+ body=_body_params,
365
+ post_params=_form_params,
366
+ files=_files,
367
+ auth_settings=_auth_settings,
368
+ collection_formats=_collection_formats,
369
+ _host=_host,
370
+ _request_auth=_request_auth
371
+ )
372
+
373
+
374
+
375
+
376
+ @validate_call
377
+ def get_recurring_by_id(
378
+ self,
379
+ id: Annotated[StrictInt, Field(description="ID of the recurring item to retrieve")],
380
+ start_date: Annotated[Optional[date], Field(description="Denotes the beginning of the range used to populate the `matching` object in the recurring items. If omitted, the current month will be used as the range.<br> Required if end_date exists.")] = None,
381
+ end_date: Annotated[Optional[date], Field(description="Denotes the end of the the range used to populate the `matching` object in the recurring items. Required if start_date exists. ")] = None,
382
+ _request_timeout: Union[
383
+ None,
384
+ Annotated[StrictFloat, Field(gt=0)],
385
+ Tuple[
386
+ Annotated[StrictFloat, Field(gt=0)],
387
+ Annotated[StrictFloat, Field(gt=0)]
388
+ ]
389
+ ] = None,
390
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
391
+ _content_type: Optional[StrictStr] = None,
392
+ _headers: Optional[Dict[StrictStr, Any]] = None,
393
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
394
+ ) -> RecurringObject:
395
+ """Get a single recurring item
396
+
397
+ Retrieve the details of a specific recurring item with the specified ID.
398
+
399
+ :param id: ID of the recurring item to retrieve (required)
400
+ :type id: int
401
+ :param start_date: Denotes the beginning of the range used to populate the `matching` object in the recurring items. If omitted, the current month will be used as the range.<br> Required if end_date exists.
402
+ :type start_date: date
403
+ :param end_date: Denotes the end of the the range used to populate the `matching` object in the recurring items. Required if start_date exists.
404
+ :type end_date: date
405
+ :param _request_timeout: timeout setting for this request. If one
406
+ number provided, it will be total request
407
+ timeout. It can also be a pair (tuple) of
408
+ (connection, read) timeouts.
409
+ :type _request_timeout: int, tuple(int, int), optional
410
+ :param _request_auth: set to override the auth_settings for an a single
411
+ request; this effectively ignores the
412
+ authentication in the spec for a single request.
413
+ :type _request_auth: dict, optional
414
+ :param _content_type: force content-type for the request.
415
+ :type _content_type: str, Optional
416
+ :param _headers: set to override the headers for a single
417
+ request; this effectively ignores the headers
418
+ in the spec for a single request.
419
+ :type _headers: dict, optional
420
+ :param _host_index: set to override the host_index for a single
421
+ request; this effectively ignores the host_index
422
+ in the spec for a single request.
423
+ :type _host_index: int, optional
424
+ :return: Returns the result object.
425
+ """ # noqa: E501
426
+
427
+ _param = self._get_recurring_by_id_serialize(
428
+ id=id,
429
+ start_date=start_date,
430
+ end_date=end_date,
431
+ _request_auth=_request_auth,
432
+ _content_type=_content_type,
433
+ _headers=_headers,
434
+ _host_index=_host_index
435
+ )
436
+
437
+ _response_types_map: Dict[str, Optional[str]] = {
438
+ '200': "RecurringObject",
439
+ '400': "ErrorResponseObject",
440
+ '401': "ErrorResponseObject",
441
+ '404': "ErrorResponseObject",
442
+ '429': "ErrorResponseObject",
443
+ '500': "ErrorResponseObject",
444
+ }
445
+ response_data = self.api_client.call_api(
446
+ *_param,
447
+ _request_timeout=_request_timeout
448
+ )
449
+ response_data.read()
450
+ return self.api_client.response_deserialize(
451
+ response_data=response_data,
452
+ response_types_map=_response_types_map,
453
+ ).data
454
+
455
+
456
+ @validate_call
457
+ def get_recurring_by_id_with_http_info(
458
+ self,
459
+ id: Annotated[StrictInt, Field(description="ID of the recurring item to retrieve")],
460
+ start_date: Annotated[Optional[date], Field(description="Denotes the beginning of the range used to populate the `matching` object in the recurring items. If omitted, the current month will be used as the range.<br> Required if end_date exists.")] = None,
461
+ end_date: Annotated[Optional[date], Field(description="Denotes the end of the the range used to populate the `matching` object in the recurring items. Required if start_date exists. ")] = None,
462
+ _request_timeout: Union[
463
+ None,
464
+ Annotated[StrictFloat, Field(gt=0)],
465
+ Tuple[
466
+ Annotated[StrictFloat, Field(gt=0)],
467
+ Annotated[StrictFloat, Field(gt=0)]
468
+ ]
469
+ ] = None,
470
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
471
+ _content_type: Optional[StrictStr] = None,
472
+ _headers: Optional[Dict[StrictStr, Any]] = None,
473
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
474
+ ) -> ApiResponse[RecurringObject]:
475
+ """Get a single recurring item
476
+
477
+ Retrieve the details of a specific recurring item with the specified ID.
478
+
479
+ :param id: ID of the recurring item to retrieve (required)
480
+ :type id: int
481
+ :param start_date: Denotes the beginning of the range used to populate the `matching` object in the recurring items. If omitted, the current month will be used as the range.<br> Required if end_date exists.
482
+ :type start_date: date
483
+ :param end_date: Denotes the end of the the range used to populate the `matching` object in the recurring items. Required if start_date exists.
484
+ :type end_date: date
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_recurring_by_id_serialize(
508
+ id=id,
509
+ start_date=start_date,
510
+ end_date=end_date,
511
+ _request_auth=_request_auth,
512
+ _content_type=_content_type,
513
+ _headers=_headers,
514
+ _host_index=_host_index
515
+ )
516
+
517
+ _response_types_map: Dict[str, Optional[str]] = {
518
+ '200': "RecurringObject",
519
+ '400': "ErrorResponseObject",
520
+ '401': "ErrorResponseObject",
521
+ '404': "ErrorResponseObject",
522
+ '429': "ErrorResponseObject",
523
+ '500': "ErrorResponseObject",
524
+ }
525
+ response_data = self.api_client.call_api(
526
+ *_param,
527
+ _request_timeout=_request_timeout
528
+ )
529
+ response_data.read()
530
+ return self.api_client.response_deserialize(
531
+ response_data=response_data,
532
+ response_types_map=_response_types_map,
533
+ )
534
+
535
+
536
+ @validate_call
537
+ def get_recurring_by_id_without_preload_content(
538
+ self,
539
+ id: Annotated[StrictInt, Field(description="ID of the recurring item to retrieve")],
540
+ start_date: Annotated[Optional[date], Field(description="Denotes the beginning of the range used to populate the `matching` object in the recurring items. If omitted, the current month will be used as the range.<br> Required if end_date exists.")] = None,
541
+ end_date: Annotated[Optional[date], Field(description="Denotes the end of the the range used to populate the `matching` object in the recurring items. Required if start_date exists. ")] = None,
542
+ _request_timeout: Union[
543
+ None,
544
+ Annotated[StrictFloat, Field(gt=0)],
545
+ Tuple[
546
+ Annotated[StrictFloat, Field(gt=0)],
547
+ Annotated[StrictFloat, Field(gt=0)]
548
+ ]
549
+ ] = None,
550
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
551
+ _content_type: Optional[StrictStr] = None,
552
+ _headers: Optional[Dict[StrictStr, Any]] = None,
553
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
554
+ ) -> RESTResponseType:
555
+ """Get a single recurring item
556
+
557
+ Retrieve the details of a specific recurring item with the specified ID.
558
+
559
+ :param id: ID of the recurring item to retrieve (required)
560
+ :type id: int
561
+ :param start_date: Denotes the beginning of the range used to populate the `matching` object in the recurring items. If omitted, the current month will be used as the range.<br> Required if end_date exists.
562
+ :type start_date: date
563
+ :param end_date: Denotes the end of the the range used to populate the `matching` object in the recurring items. Required if start_date exists.
564
+ :type end_date: date
565
+ :param _request_timeout: timeout setting for this request. If one
566
+ number provided, it will be total request
567
+ timeout. It can also be a pair (tuple) of
568
+ (connection, read) timeouts.
569
+ :type _request_timeout: int, tuple(int, int), optional
570
+ :param _request_auth: set to override the auth_settings for an a single
571
+ request; this effectively ignores the
572
+ authentication in the spec for a single request.
573
+ :type _request_auth: dict, optional
574
+ :param _content_type: force content-type for the request.
575
+ :type _content_type: str, Optional
576
+ :param _headers: set to override the headers for a single
577
+ request; this effectively ignores the headers
578
+ in the spec for a single request.
579
+ :type _headers: dict, optional
580
+ :param _host_index: set to override the host_index for a single
581
+ request; this effectively ignores the host_index
582
+ in the spec for a single request.
583
+ :type _host_index: int, optional
584
+ :return: Returns the result object.
585
+ """ # noqa: E501
586
+
587
+ _param = self._get_recurring_by_id_serialize(
588
+ id=id,
589
+ start_date=start_date,
590
+ end_date=end_date,
591
+ _request_auth=_request_auth,
592
+ _content_type=_content_type,
593
+ _headers=_headers,
594
+ _host_index=_host_index
595
+ )
596
+
597
+ _response_types_map: Dict[str, Optional[str]] = {
598
+ '200': "RecurringObject",
599
+ '400': "ErrorResponseObject",
600
+ '401': "ErrorResponseObject",
601
+ '404': "ErrorResponseObject",
602
+ '429': "ErrorResponseObject",
603
+ '500': "ErrorResponseObject",
604
+ }
605
+ response_data = self.api_client.call_api(
606
+ *_param,
607
+ _request_timeout=_request_timeout
608
+ )
609
+ return response_data.response
610
+
611
+
612
+ def _get_recurring_by_id_serialize(
613
+ self,
614
+ id,
615
+ start_date,
616
+ end_date,
617
+ _request_auth,
618
+ _content_type,
619
+ _headers,
620
+ _host_index,
621
+ ) -> RequestSerialized:
622
+
623
+ _host = None
624
+
625
+ _collection_formats: Dict[str, str] = {
626
+ }
627
+
628
+ _path_params: Dict[str, str] = {}
629
+ _query_params: List[Tuple[str, str]] = []
630
+ _header_params: Dict[str, Optional[str]] = _headers or {}
631
+ _form_params: List[Tuple[str, str]] = []
632
+ _files: Dict[
633
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
634
+ ] = {}
635
+ _body_params: Optional[bytes] = None
636
+
637
+ # process the path parameters
638
+ if id is not None:
639
+ _path_params['id'] = id
640
+ # process the query parameters
641
+ if start_date is not None:
642
+ if isinstance(start_date, date):
643
+ _query_params.append(
644
+ (
645
+ 'start_date',
646
+ start_date.strftime(
647
+ self.api_client.configuration.date_format
648
+ )
649
+ )
650
+ )
651
+ else:
652
+ _query_params.append(('start_date', start_date))
653
+
654
+ if end_date is not None:
655
+ if isinstance(end_date, date):
656
+ _query_params.append(
657
+ (
658
+ 'end_date',
659
+ end_date.strftime(
660
+ self.api_client.configuration.date_format
661
+ )
662
+ )
663
+ )
664
+ else:
665
+ _query_params.append(('end_date', end_date))
666
+
667
+ # process the header parameters
668
+ # process the form parameters
669
+ # process the body parameter
670
+
671
+
672
+ # set the HTTP header `Accept`
673
+ if 'Accept' not in _header_params:
674
+ _header_params['Accept'] = self.api_client.select_header_accept(
675
+ [
676
+ 'application/json'
677
+ ]
678
+ )
679
+
680
+
681
+ # authentication setting
682
+ _auth_settings: List[str] = [
683
+ 'cookieAuth',
684
+ 'bearerSecurity'
685
+ ]
686
+
687
+ return self.api_client.param_serialize(
688
+ method='GET',
689
+ resource_path='/recurring_items/{id}',
690
+ path_params=_path_params,
691
+ query_params=_query_params,
692
+ header_params=_header_params,
693
+ body=_body_params,
694
+ post_params=_form_params,
695
+ files=_files,
696
+ auth_settings=_auth_settings,
697
+ collection_formats=_collection_formats,
698
+ _host=_host,
699
+ _request_auth=_request_auth
700
+ )
701
+
702
+