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,1465 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ Lunch Money API - v2
5
+
6
+ Welcome to the Lunch Money v2 API. A working version of this API is now available through these docs, or directly at: `https://api.lunchmoney.dev/v2` <span class=\"red-text\"><strong>This is in alpha launch of a major API update. It is still subject to change during this alpha review period and bugs may still exist. Users are strongly encouraged to use the mock service or to create a test budget with example data as the first step to interacting with the v2 API.</strong></span> See the [Getting Started Guide](https://alpha.lunchmoney.dev/v2/getting-started) for more information on using a test budget.<br<br> If you are new to the v2 API, you may wish to review the [v2 API Overview of Changes](https://alpha.lunchmoney.dev/v2/changelog). ### Static Mock Server You may also use these docs to explore the API using a static mock server endpoint.<p> This enables users to become familiar with the API without having to create an access token, and eliminates the possibility of modifying real data. <p> To access this endpoint select the second endpoint in the the \"Server\" dropdown to the right. When selected you should see \"Static Mock v2 Lunch Money API Server\".<br> When using this server, set your Bearer token to any string with 11 or more characters. ### Migrating from V1 The v2 API is NOT backwards compatible with the v1 API. Developers are encouraged to review the [Migration Guide](https://alpha.lunchmoney.dev/v2/migration-guide) to understand the changes and plan their migration. ### Acknowledgments If you have been providing feedback on the API during our iterative design process, **THANK YOU**. We are happy to provide the opportunity to finally interact with the working API that was built based on your feedback. ### Useful links: - [Getting Started](https://alpha.lunchmoney.dev/v2/getting-started) - [v2 API Changelog](https://alpha.lunchmoney.dev/v2/changelog) - [Migration Guide](https://alpha.lunchmoney.dev/v2/migration-guide) - [Rate Limits](https://alpha.lunchmoney.dev/v2/rate-limits) - [Current v1 Lunch Money API Documentation](https://lunchmoney.dev) - [Awesome Lunch Money Projects](https://github.com/lunch-money/awesome-lunchmoney?tab=readme-ov-file)
7
+
8
+ The version of the OpenAPI document: 2.8.4
9
+ Contact: devsupport@lunchmoney.app
10
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
11
+
12
+ Do not edit the class manually.
13
+ """ # noqa: E501
14
+
15
+ import warnings
16
+ from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt
17
+ from typing import Any, Dict, List, Optional, Tuple, Union
18
+ from typing_extensions import Annotated
19
+
20
+ from pydantic import Field, StrictBool, StrictInt
21
+ from typing import Optional
22
+ from typing_extensions import Annotated
23
+ from lunchmoney.models.create_tag_request_object import CreateTagRequestObject
24
+ from lunchmoney.models.get_all_tags200_response import GetAllTags200Response
25
+ from lunchmoney.models.tag_object import TagObject
26
+ from lunchmoney.models.update_tag_request_object import UpdateTagRequestObject
27
+
28
+ from lunchmoney.api_client import ApiClient, RequestSerialized
29
+ from lunchmoney.api_response import ApiResponse
30
+ from lunchmoney.rest import RESTResponseType
31
+
32
+
33
+ class TagsApi:
34
+ """NOTE: This class is auto generated by OpenAPI Generator
35
+ Ref: https://openapi-generator.tech
36
+
37
+ Do not edit the class manually.
38
+ """
39
+
40
+ def __init__(self, api_client=None) -> None:
41
+ if api_client is None:
42
+ api_client = ApiClient.get_default()
43
+ self.api_client = api_client
44
+
45
+
46
+ @validate_call
47
+ def create_tag(
48
+ self,
49
+ create_tag_request_object: CreateTagRequestObject,
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
+ ) -> TagObject:
63
+ """Create a new tag
64
+
65
+ Creates a new tag with the given name
66
+
67
+ :param create_tag_request_object: (required)
68
+ :type create_tag_request_object: CreateTagRequestObject
69
+ :param _request_timeout: timeout setting for this request. If one
70
+ number provided, it will be total request
71
+ timeout. It can also be a pair (tuple) of
72
+ (connection, read) timeouts.
73
+ :type _request_timeout: int, tuple(int, int), optional
74
+ :param _request_auth: set to override the auth_settings for an a single
75
+ request; this effectively ignores the
76
+ authentication in the spec for a single request.
77
+ :type _request_auth: dict, optional
78
+ :param _content_type: force content-type for the request.
79
+ :type _content_type: str, Optional
80
+ :param _headers: set to override the headers for a single
81
+ request; this effectively ignores the headers
82
+ in the spec for a single request.
83
+ :type _headers: dict, optional
84
+ :param _host_index: set to override the host_index for a single
85
+ request; this effectively ignores the host_index
86
+ in the spec for a single request.
87
+ :type _host_index: int, optional
88
+ :return: Returns the result object.
89
+ """ # noqa: E501
90
+
91
+ _param = self._create_tag_serialize(
92
+ create_tag_request_object=create_tag_request_object,
93
+ _request_auth=_request_auth,
94
+ _content_type=_content_type,
95
+ _headers=_headers,
96
+ _host_index=_host_index
97
+ )
98
+
99
+ _response_types_map: Dict[str, Optional[str]] = {
100
+ '201': "TagObject",
101
+ '400': "ErrorResponseObject",
102
+ '401': "ErrorResponseObject",
103
+ '429': "ErrorResponseObject",
104
+ '500': "ErrorResponseObject",
105
+ }
106
+ response_data = self.api_client.call_api(
107
+ *_param,
108
+ _request_timeout=_request_timeout
109
+ )
110
+ response_data.read()
111
+ return self.api_client.response_deserialize(
112
+ response_data=response_data,
113
+ response_types_map=_response_types_map,
114
+ ).data
115
+
116
+
117
+ @validate_call
118
+ def create_tag_with_http_info(
119
+ self,
120
+ create_tag_request_object: CreateTagRequestObject,
121
+ _request_timeout: Union[
122
+ None,
123
+ Annotated[StrictFloat, Field(gt=0)],
124
+ Tuple[
125
+ Annotated[StrictFloat, Field(gt=0)],
126
+ Annotated[StrictFloat, Field(gt=0)]
127
+ ]
128
+ ] = None,
129
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
130
+ _content_type: Optional[StrictStr] = None,
131
+ _headers: Optional[Dict[StrictStr, Any]] = None,
132
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
133
+ ) -> ApiResponse[TagObject]:
134
+ """Create a new tag
135
+
136
+ Creates a new tag with the given name
137
+
138
+ :param create_tag_request_object: (required)
139
+ :type create_tag_request_object: CreateTagRequestObject
140
+ :param _request_timeout: timeout setting for this request. If one
141
+ number provided, it will be total request
142
+ timeout. It can also be a pair (tuple) of
143
+ (connection, read) timeouts.
144
+ :type _request_timeout: int, tuple(int, int), optional
145
+ :param _request_auth: set to override the auth_settings for an a single
146
+ request; this effectively ignores the
147
+ authentication in the spec for a single request.
148
+ :type _request_auth: dict, optional
149
+ :param _content_type: force content-type for the request.
150
+ :type _content_type: str, Optional
151
+ :param _headers: set to override the headers for a single
152
+ request; this effectively ignores the headers
153
+ in the spec for a single request.
154
+ :type _headers: dict, optional
155
+ :param _host_index: set to override the host_index for a single
156
+ request; this effectively ignores the host_index
157
+ in the spec for a single request.
158
+ :type _host_index: int, optional
159
+ :return: Returns the result object.
160
+ """ # noqa: E501
161
+
162
+ _param = self._create_tag_serialize(
163
+ create_tag_request_object=create_tag_request_object,
164
+ _request_auth=_request_auth,
165
+ _content_type=_content_type,
166
+ _headers=_headers,
167
+ _host_index=_host_index
168
+ )
169
+
170
+ _response_types_map: Dict[str, Optional[str]] = {
171
+ '201': "TagObject",
172
+ '400': "ErrorResponseObject",
173
+ '401': "ErrorResponseObject",
174
+ '429': "ErrorResponseObject",
175
+ '500': "ErrorResponseObject",
176
+ }
177
+ response_data = self.api_client.call_api(
178
+ *_param,
179
+ _request_timeout=_request_timeout
180
+ )
181
+ response_data.read()
182
+ return self.api_client.response_deserialize(
183
+ response_data=response_data,
184
+ response_types_map=_response_types_map,
185
+ )
186
+
187
+
188
+ @validate_call
189
+ def create_tag_without_preload_content(
190
+ self,
191
+ create_tag_request_object: CreateTagRequestObject,
192
+ _request_timeout: Union[
193
+ None,
194
+ Annotated[StrictFloat, Field(gt=0)],
195
+ Tuple[
196
+ Annotated[StrictFloat, Field(gt=0)],
197
+ Annotated[StrictFloat, Field(gt=0)]
198
+ ]
199
+ ] = None,
200
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
201
+ _content_type: Optional[StrictStr] = None,
202
+ _headers: Optional[Dict[StrictStr, Any]] = None,
203
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
204
+ ) -> RESTResponseType:
205
+ """Create a new tag
206
+
207
+ Creates a new tag with the given name
208
+
209
+ :param create_tag_request_object: (required)
210
+ :type create_tag_request_object: CreateTagRequestObject
211
+ :param _request_timeout: timeout setting for this request. If one
212
+ number provided, it will be total request
213
+ timeout. It can also be a pair (tuple) of
214
+ (connection, read) timeouts.
215
+ :type _request_timeout: int, tuple(int, int), optional
216
+ :param _request_auth: set to override the auth_settings for an a single
217
+ request; this effectively ignores the
218
+ authentication in the spec for a single request.
219
+ :type _request_auth: dict, optional
220
+ :param _content_type: force content-type for the request.
221
+ :type _content_type: str, Optional
222
+ :param _headers: set to override the headers for a single
223
+ request; this effectively ignores the headers
224
+ in the spec for a single request.
225
+ :type _headers: dict, optional
226
+ :param _host_index: set to override the host_index for a single
227
+ request; this effectively ignores the host_index
228
+ in the spec for a single request.
229
+ :type _host_index: int, optional
230
+ :return: Returns the result object.
231
+ """ # noqa: E501
232
+
233
+ _param = self._create_tag_serialize(
234
+ create_tag_request_object=create_tag_request_object,
235
+ _request_auth=_request_auth,
236
+ _content_type=_content_type,
237
+ _headers=_headers,
238
+ _host_index=_host_index
239
+ )
240
+
241
+ _response_types_map: Dict[str, Optional[str]] = {
242
+ '201': "TagObject",
243
+ '400': "ErrorResponseObject",
244
+ '401': "ErrorResponseObject",
245
+ '429': "ErrorResponseObject",
246
+ '500': "ErrorResponseObject",
247
+ }
248
+ response_data = self.api_client.call_api(
249
+ *_param,
250
+ _request_timeout=_request_timeout
251
+ )
252
+ return response_data.response
253
+
254
+
255
+ def _create_tag_serialize(
256
+ self,
257
+ create_tag_request_object,
258
+ _request_auth,
259
+ _content_type,
260
+ _headers,
261
+ _host_index,
262
+ ) -> RequestSerialized:
263
+
264
+ _host = None
265
+
266
+ _collection_formats: Dict[str, str] = {
267
+ }
268
+
269
+ _path_params: Dict[str, str] = {}
270
+ _query_params: List[Tuple[str, str]] = []
271
+ _header_params: Dict[str, Optional[str]] = _headers or {}
272
+ _form_params: List[Tuple[str, str]] = []
273
+ _files: Dict[
274
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
275
+ ] = {}
276
+ _body_params: Optional[bytes] = None
277
+
278
+ # process the path parameters
279
+ # process the query parameters
280
+ # process the header parameters
281
+ # process the form parameters
282
+ # process the body parameter
283
+ if create_tag_request_object is not None:
284
+ _body_params = create_tag_request_object
285
+
286
+
287
+ # set the HTTP header `Accept`
288
+ if 'Accept' not in _header_params:
289
+ _header_params['Accept'] = self.api_client.select_header_accept(
290
+ [
291
+ 'application/json'
292
+ ]
293
+ )
294
+
295
+ # set the HTTP header `Content-Type`
296
+ if _content_type:
297
+ _header_params['Content-Type'] = _content_type
298
+ else:
299
+ _default_content_type = (
300
+ self.api_client.select_header_content_type(
301
+ [
302
+ 'application/json'
303
+ ]
304
+ )
305
+ )
306
+ if _default_content_type is not None:
307
+ _header_params['Content-Type'] = _default_content_type
308
+
309
+ # authentication setting
310
+ _auth_settings: List[str] = [
311
+ 'cookieAuth',
312
+ 'bearerSecurity'
313
+ ]
314
+
315
+ return self.api_client.param_serialize(
316
+ method='POST',
317
+ resource_path='/tags',
318
+ path_params=_path_params,
319
+ query_params=_query_params,
320
+ header_params=_header_params,
321
+ body=_body_params,
322
+ post_params=_form_params,
323
+ files=_files,
324
+ auth_settings=_auth_settings,
325
+ collection_formats=_collection_formats,
326
+ _host=_host,
327
+ _request_auth=_request_auth
328
+ )
329
+
330
+
331
+
332
+
333
+ @validate_call
334
+ def delete_tag(
335
+ self,
336
+ id: Annotated[StrictInt, Field(description="ID of the tag to delete")],
337
+ force: Annotated[Optional[StrictBool], Field(description="Set to true to force deletion even if there are dependencies")] = None,
338
+ _request_timeout: Union[
339
+ None,
340
+ Annotated[StrictFloat, Field(gt=0)],
341
+ Tuple[
342
+ Annotated[StrictFloat, Field(gt=0)],
343
+ Annotated[StrictFloat, Field(gt=0)]
344
+ ]
345
+ ] = None,
346
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
347
+ _content_type: Optional[StrictStr] = None,
348
+ _headers: Optional[Dict[StrictStr, Any]] = None,
349
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
350
+ ) -> None:
351
+ """Delete a tag
352
+
353
+ Deletes the tag with the ID specified on the path.<br> If transaction or rules exist with the tag a dependents object is returned and the tag is not deleted. This behavior can be overridden by setting the `force` param to `true`.
354
+
355
+ :param id: ID of the tag to delete (required)
356
+ :type id: int
357
+ :param force: Set to true to force deletion even if there are dependencies
358
+ :type force: bool
359
+ :param _request_timeout: timeout setting for this request. If one
360
+ number provided, it will be total request
361
+ timeout. It can also be a pair (tuple) of
362
+ (connection, read) timeouts.
363
+ :type _request_timeout: int, tuple(int, int), optional
364
+ :param _request_auth: set to override the auth_settings for an a single
365
+ request; this effectively ignores the
366
+ authentication in the spec for a single request.
367
+ :type _request_auth: dict, optional
368
+ :param _content_type: force content-type for the request.
369
+ :type _content_type: str, Optional
370
+ :param _headers: set to override the headers for a single
371
+ request; this effectively ignores the headers
372
+ in the spec for a single request.
373
+ :type _headers: dict, optional
374
+ :param _host_index: set to override the host_index for a single
375
+ request; this effectively ignores the host_index
376
+ in the spec for a single request.
377
+ :type _host_index: int, optional
378
+ :return: Returns the result object.
379
+ """ # noqa: E501
380
+
381
+ _param = self._delete_tag_serialize(
382
+ id=id,
383
+ force=force,
384
+ _request_auth=_request_auth,
385
+ _content_type=_content_type,
386
+ _headers=_headers,
387
+ _host_index=_host_index
388
+ )
389
+
390
+ _response_types_map: Dict[str, Optional[str]] = {
391
+ '204': None,
392
+ '401': "ErrorResponseObject",
393
+ '404': "ErrorResponseObject",
394
+ '422': "DeleteTagResponseWithDependencies",
395
+ '429': "ErrorResponseObject",
396
+ '500': "ErrorResponseObject",
397
+ }
398
+ response_data = self.api_client.call_api(
399
+ *_param,
400
+ _request_timeout=_request_timeout
401
+ )
402
+ response_data.read()
403
+ return self.api_client.response_deserialize(
404
+ response_data=response_data,
405
+ response_types_map=_response_types_map,
406
+ ).data
407
+
408
+
409
+ @validate_call
410
+ def delete_tag_with_http_info(
411
+ self,
412
+ id: Annotated[StrictInt, Field(description="ID of the tag to delete")],
413
+ force: Annotated[Optional[StrictBool], Field(description="Set to true to force deletion even if there are dependencies")] = None,
414
+ _request_timeout: Union[
415
+ None,
416
+ Annotated[StrictFloat, Field(gt=0)],
417
+ Tuple[
418
+ Annotated[StrictFloat, Field(gt=0)],
419
+ Annotated[StrictFloat, Field(gt=0)]
420
+ ]
421
+ ] = None,
422
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
423
+ _content_type: Optional[StrictStr] = None,
424
+ _headers: Optional[Dict[StrictStr, Any]] = None,
425
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
426
+ ) -> ApiResponse[None]:
427
+ """Delete a tag
428
+
429
+ Deletes the tag with the ID specified on the path.<br> If transaction or rules exist with the tag a dependents object is returned and the tag is not deleted. This behavior can be overridden by setting the `force` param to `true`.
430
+
431
+ :param id: ID of the tag to delete (required)
432
+ :type id: int
433
+ :param force: Set to true to force deletion even if there are dependencies
434
+ :type force: bool
435
+ :param _request_timeout: timeout setting for this request. If one
436
+ number provided, it will be total request
437
+ timeout. It can also be a pair (tuple) of
438
+ (connection, read) timeouts.
439
+ :type _request_timeout: int, tuple(int, int), optional
440
+ :param _request_auth: set to override the auth_settings for an a single
441
+ request; this effectively ignores the
442
+ authentication in the spec for a single request.
443
+ :type _request_auth: dict, optional
444
+ :param _content_type: force content-type for the request.
445
+ :type _content_type: str, Optional
446
+ :param _headers: set to override the headers for a single
447
+ request; this effectively ignores the headers
448
+ in the spec for a single request.
449
+ :type _headers: dict, optional
450
+ :param _host_index: set to override the host_index for a single
451
+ request; this effectively ignores the host_index
452
+ in the spec for a single request.
453
+ :type _host_index: int, optional
454
+ :return: Returns the result object.
455
+ """ # noqa: E501
456
+
457
+ _param = self._delete_tag_serialize(
458
+ id=id,
459
+ force=force,
460
+ _request_auth=_request_auth,
461
+ _content_type=_content_type,
462
+ _headers=_headers,
463
+ _host_index=_host_index
464
+ )
465
+
466
+ _response_types_map: Dict[str, Optional[str]] = {
467
+ '204': None,
468
+ '401': "ErrorResponseObject",
469
+ '404': "ErrorResponseObject",
470
+ '422': "DeleteTagResponseWithDependencies",
471
+ '429': "ErrorResponseObject",
472
+ '500': "ErrorResponseObject",
473
+ }
474
+ response_data = self.api_client.call_api(
475
+ *_param,
476
+ _request_timeout=_request_timeout
477
+ )
478
+ response_data.read()
479
+ return self.api_client.response_deserialize(
480
+ response_data=response_data,
481
+ response_types_map=_response_types_map,
482
+ )
483
+
484
+
485
+ @validate_call
486
+ def delete_tag_without_preload_content(
487
+ self,
488
+ id: Annotated[StrictInt, Field(description="ID of the tag to delete")],
489
+ force: Annotated[Optional[StrictBool], Field(description="Set to true to force deletion even if there are dependencies")] = None,
490
+ _request_timeout: Union[
491
+ None,
492
+ Annotated[StrictFloat, Field(gt=0)],
493
+ Tuple[
494
+ Annotated[StrictFloat, Field(gt=0)],
495
+ Annotated[StrictFloat, Field(gt=0)]
496
+ ]
497
+ ] = None,
498
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
499
+ _content_type: Optional[StrictStr] = None,
500
+ _headers: Optional[Dict[StrictStr, Any]] = None,
501
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
502
+ ) -> RESTResponseType:
503
+ """Delete a tag
504
+
505
+ Deletes the tag with the ID specified on the path.<br> If transaction or rules exist with the tag a dependents object is returned and the tag is not deleted. This behavior can be overridden by setting the `force` param to `true`.
506
+
507
+ :param id: ID of the tag to delete (required)
508
+ :type id: int
509
+ :param force: Set to true to force deletion even if there are dependencies
510
+ :type force: bool
511
+ :param _request_timeout: timeout setting for this request. If one
512
+ number provided, it will be total request
513
+ timeout. It can also be a pair (tuple) of
514
+ (connection, read) timeouts.
515
+ :type _request_timeout: int, tuple(int, int), optional
516
+ :param _request_auth: set to override the auth_settings for an a single
517
+ request; this effectively ignores the
518
+ authentication in the spec for a single request.
519
+ :type _request_auth: dict, optional
520
+ :param _content_type: force content-type for the request.
521
+ :type _content_type: str, Optional
522
+ :param _headers: set to override the headers for a single
523
+ request; this effectively ignores the headers
524
+ in the spec for a single request.
525
+ :type _headers: dict, optional
526
+ :param _host_index: set to override the host_index for a single
527
+ request; this effectively ignores the host_index
528
+ in the spec for a single request.
529
+ :type _host_index: int, optional
530
+ :return: Returns the result object.
531
+ """ # noqa: E501
532
+
533
+ _param = self._delete_tag_serialize(
534
+ id=id,
535
+ force=force,
536
+ _request_auth=_request_auth,
537
+ _content_type=_content_type,
538
+ _headers=_headers,
539
+ _host_index=_host_index
540
+ )
541
+
542
+ _response_types_map: Dict[str, Optional[str]] = {
543
+ '204': None,
544
+ '401': "ErrorResponseObject",
545
+ '404': "ErrorResponseObject",
546
+ '422': "DeleteTagResponseWithDependencies",
547
+ '429': "ErrorResponseObject",
548
+ '500': "ErrorResponseObject",
549
+ }
550
+ response_data = self.api_client.call_api(
551
+ *_param,
552
+ _request_timeout=_request_timeout
553
+ )
554
+ return response_data.response
555
+
556
+
557
+ def _delete_tag_serialize(
558
+ self,
559
+ id,
560
+ force,
561
+ _request_auth,
562
+ _content_type,
563
+ _headers,
564
+ _host_index,
565
+ ) -> RequestSerialized:
566
+
567
+ _host = None
568
+
569
+ _collection_formats: Dict[str, str] = {
570
+ }
571
+
572
+ _path_params: Dict[str, str] = {}
573
+ _query_params: List[Tuple[str, str]] = []
574
+ _header_params: Dict[str, Optional[str]] = _headers or {}
575
+ _form_params: List[Tuple[str, str]] = []
576
+ _files: Dict[
577
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
578
+ ] = {}
579
+ _body_params: Optional[bytes] = None
580
+
581
+ # process the path parameters
582
+ if id is not None:
583
+ _path_params['id'] = id
584
+ # process the query parameters
585
+ if force is not None:
586
+
587
+ _query_params.append(('force', force))
588
+
589
+ # process the header parameters
590
+ # process the form parameters
591
+ # process the body parameter
592
+
593
+
594
+ # set the HTTP header `Accept`
595
+ if 'Accept' not in _header_params:
596
+ _header_params['Accept'] = self.api_client.select_header_accept(
597
+ [
598
+ 'application/json'
599
+ ]
600
+ )
601
+
602
+
603
+ # authentication setting
604
+ _auth_settings: List[str] = [
605
+ 'cookieAuth',
606
+ 'bearerSecurity'
607
+ ]
608
+
609
+ return self.api_client.param_serialize(
610
+ method='DELETE',
611
+ resource_path='/tags/{id}',
612
+ path_params=_path_params,
613
+ query_params=_query_params,
614
+ header_params=_header_params,
615
+ body=_body_params,
616
+ post_params=_form_params,
617
+ files=_files,
618
+ auth_settings=_auth_settings,
619
+ collection_formats=_collection_formats,
620
+ _host=_host,
621
+ _request_auth=_request_auth
622
+ )
623
+
624
+
625
+
626
+
627
+ @validate_call
628
+ def get_all_tags(
629
+ self,
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
+ ) -> GetAllTags200Response:
643
+ """Get All Tags
644
+
645
+ Retrieve a list of all tags associated with the user's account.
646
+
647
+ :param _request_timeout: timeout setting for this request. If one
648
+ number provided, it will be total request
649
+ timeout. It can also be a pair (tuple) of
650
+ (connection, read) timeouts.
651
+ :type _request_timeout: int, tuple(int, int), optional
652
+ :param _request_auth: set to override the auth_settings for an a single
653
+ request; this effectively ignores the
654
+ authentication in the spec for a single request.
655
+ :type _request_auth: dict, optional
656
+ :param _content_type: force content-type for the request.
657
+ :type _content_type: str, Optional
658
+ :param _headers: set to override the headers for a single
659
+ request; this effectively ignores the headers
660
+ in the spec for a single request.
661
+ :type _headers: dict, optional
662
+ :param _host_index: set to override the host_index for a single
663
+ request; this effectively ignores the host_index
664
+ in the spec for a single request.
665
+ :type _host_index: int, optional
666
+ :return: Returns the result object.
667
+ """ # noqa: E501
668
+
669
+ _param = self._get_all_tags_serialize(
670
+ _request_auth=_request_auth,
671
+ _content_type=_content_type,
672
+ _headers=_headers,
673
+ _host_index=_host_index
674
+ )
675
+
676
+ _response_types_map: Dict[str, Optional[str]] = {
677
+ '200': "GetAllTags200Response",
678
+ '400': "ErrorResponseObject",
679
+ '401': "ErrorResponseObject",
680
+ '429': "ErrorResponseObject",
681
+ '500': "ErrorResponseObject",
682
+ }
683
+ response_data = self.api_client.call_api(
684
+ *_param,
685
+ _request_timeout=_request_timeout
686
+ )
687
+ response_data.read()
688
+ return self.api_client.response_deserialize(
689
+ response_data=response_data,
690
+ response_types_map=_response_types_map,
691
+ ).data
692
+
693
+
694
+ @validate_call
695
+ def get_all_tags_with_http_info(
696
+ self,
697
+ _request_timeout: Union[
698
+ None,
699
+ Annotated[StrictFloat, Field(gt=0)],
700
+ Tuple[
701
+ Annotated[StrictFloat, Field(gt=0)],
702
+ Annotated[StrictFloat, Field(gt=0)]
703
+ ]
704
+ ] = None,
705
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
706
+ _content_type: Optional[StrictStr] = None,
707
+ _headers: Optional[Dict[StrictStr, Any]] = None,
708
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
709
+ ) -> ApiResponse[GetAllTags200Response]:
710
+ """Get All Tags
711
+
712
+ Retrieve a list of all tags associated with the user's account.
713
+
714
+ :param _request_timeout: timeout setting for this request. If one
715
+ number provided, it will be total request
716
+ timeout. It can also be a pair (tuple) of
717
+ (connection, read) timeouts.
718
+ :type _request_timeout: int, tuple(int, int), optional
719
+ :param _request_auth: set to override the auth_settings for an a single
720
+ request; this effectively ignores the
721
+ authentication in the spec for a single request.
722
+ :type _request_auth: dict, optional
723
+ :param _content_type: force content-type for the request.
724
+ :type _content_type: str, Optional
725
+ :param _headers: set to override the headers for a single
726
+ request; this effectively ignores the headers
727
+ in the spec for a single request.
728
+ :type _headers: dict, optional
729
+ :param _host_index: set to override the host_index for a single
730
+ request; this effectively ignores the host_index
731
+ in the spec for a single request.
732
+ :type _host_index: int, optional
733
+ :return: Returns the result object.
734
+ """ # noqa: E501
735
+
736
+ _param = self._get_all_tags_serialize(
737
+ _request_auth=_request_auth,
738
+ _content_type=_content_type,
739
+ _headers=_headers,
740
+ _host_index=_host_index
741
+ )
742
+
743
+ _response_types_map: Dict[str, Optional[str]] = {
744
+ '200': "GetAllTags200Response",
745
+ '400': "ErrorResponseObject",
746
+ '401': "ErrorResponseObject",
747
+ '429': "ErrorResponseObject",
748
+ '500': "ErrorResponseObject",
749
+ }
750
+ response_data = self.api_client.call_api(
751
+ *_param,
752
+ _request_timeout=_request_timeout
753
+ )
754
+ response_data.read()
755
+ return self.api_client.response_deserialize(
756
+ response_data=response_data,
757
+ response_types_map=_response_types_map,
758
+ )
759
+
760
+
761
+ @validate_call
762
+ def get_all_tags_without_preload_content(
763
+ self,
764
+ _request_timeout: Union[
765
+ None,
766
+ Annotated[StrictFloat, Field(gt=0)],
767
+ Tuple[
768
+ Annotated[StrictFloat, Field(gt=0)],
769
+ Annotated[StrictFloat, Field(gt=0)]
770
+ ]
771
+ ] = None,
772
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
773
+ _content_type: Optional[StrictStr] = None,
774
+ _headers: Optional[Dict[StrictStr, Any]] = None,
775
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
776
+ ) -> RESTResponseType:
777
+ """Get All Tags
778
+
779
+ Retrieve a list of all tags associated with the user's account.
780
+
781
+ :param _request_timeout: timeout setting for this request. If one
782
+ number provided, it will be total request
783
+ timeout. It can also be a pair (tuple) of
784
+ (connection, read) timeouts.
785
+ :type _request_timeout: int, tuple(int, int), optional
786
+ :param _request_auth: set to override the auth_settings for an a single
787
+ request; this effectively ignores the
788
+ authentication in the spec for a single request.
789
+ :type _request_auth: dict, optional
790
+ :param _content_type: force content-type for the request.
791
+ :type _content_type: str, Optional
792
+ :param _headers: set to override the headers for a single
793
+ request; this effectively ignores the headers
794
+ in the spec for a single request.
795
+ :type _headers: dict, optional
796
+ :param _host_index: set to override the host_index for a single
797
+ request; this effectively ignores the host_index
798
+ in the spec for a single request.
799
+ :type _host_index: int, optional
800
+ :return: Returns the result object.
801
+ """ # noqa: E501
802
+
803
+ _param = self._get_all_tags_serialize(
804
+ _request_auth=_request_auth,
805
+ _content_type=_content_type,
806
+ _headers=_headers,
807
+ _host_index=_host_index
808
+ )
809
+
810
+ _response_types_map: Dict[str, Optional[str]] = {
811
+ '200': "GetAllTags200Response",
812
+ '400': "ErrorResponseObject",
813
+ '401': "ErrorResponseObject",
814
+ '429': "ErrorResponseObject",
815
+ '500': "ErrorResponseObject",
816
+ }
817
+ response_data = self.api_client.call_api(
818
+ *_param,
819
+ _request_timeout=_request_timeout
820
+ )
821
+ return response_data.response
822
+
823
+
824
+ def _get_all_tags_serialize(
825
+ self,
826
+ _request_auth,
827
+ _content_type,
828
+ _headers,
829
+ _host_index,
830
+ ) -> RequestSerialized:
831
+
832
+ _host = None
833
+
834
+ _collection_formats: Dict[str, str] = {
835
+ }
836
+
837
+ _path_params: Dict[str, str] = {}
838
+ _query_params: List[Tuple[str, str]] = []
839
+ _header_params: Dict[str, Optional[str]] = _headers or {}
840
+ _form_params: List[Tuple[str, str]] = []
841
+ _files: Dict[
842
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
843
+ ] = {}
844
+ _body_params: Optional[bytes] = None
845
+
846
+ # process the path parameters
847
+ # process the query parameters
848
+ # process the header parameters
849
+ # process the form parameters
850
+ # process the body parameter
851
+
852
+
853
+ # set the HTTP header `Accept`
854
+ if 'Accept' not in _header_params:
855
+ _header_params['Accept'] = self.api_client.select_header_accept(
856
+ [
857
+ 'application/json'
858
+ ]
859
+ )
860
+
861
+
862
+ # authentication setting
863
+ _auth_settings: List[str] = [
864
+ 'cookieAuth',
865
+ 'bearerSecurity'
866
+ ]
867
+
868
+ return self.api_client.param_serialize(
869
+ method='GET',
870
+ resource_path='/tags',
871
+ path_params=_path_params,
872
+ query_params=_query_params,
873
+ header_params=_header_params,
874
+ body=_body_params,
875
+ post_params=_form_params,
876
+ files=_files,
877
+ auth_settings=_auth_settings,
878
+ collection_formats=_collection_formats,
879
+ _host=_host,
880
+ _request_auth=_request_auth
881
+ )
882
+
883
+
884
+
885
+
886
+ @validate_call
887
+ def get_tag_by_id(
888
+ self,
889
+ id: Annotated[StrictInt, Field(description="ID of the tag to retrieve")],
890
+ _request_timeout: Union[
891
+ None,
892
+ Annotated[StrictFloat, Field(gt=0)],
893
+ Tuple[
894
+ Annotated[StrictFloat, Field(gt=0)],
895
+ Annotated[StrictFloat, Field(gt=0)]
896
+ ]
897
+ ] = None,
898
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
899
+ _content_type: Optional[StrictStr] = None,
900
+ _headers: Optional[Dict[StrictStr, Any]] = None,
901
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
902
+ ) -> TagObject:
903
+ """Get a single tag
904
+
905
+ Retrieve the details of a specific tag with the specified ID.
906
+
907
+ :param id: ID of the tag to retrieve (required)
908
+ :type id: int
909
+ :param _request_timeout: timeout setting for this request. If one
910
+ number provided, it will be total request
911
+ timeout. It can also be a pair (tuple) of
912
+ (connection, read) timeouts.
913
+ :type _request_timeout: int, tuple(int, int), optional
914
+ :param _request_auth: set to override the auth_settings for an a single
915
+ request; this effectively ignores the
916
+ authentication in the spec for a single request.
917
+ :type _request_auth: dict, optional
918
+ :param _content_type: force content-type for the request.
919
+ :type _content_type: str, Optional
920
+ :param _headers: set to override the headers for a single
921
+ request; this effectively ignores the headers
922
+ in the spec for a single request.
923
+ :type _headers: dict, optional
924
+ :param _host_index: set to override the host_index for a single
925
+ request; this effectively ignores the host_index
926
+ in the spec for a single request.
927
+ :type _host_index: int, optional
928
+ :return: Returns the result object.
929
+ """ # noqa: E501
930
+
931
+ _param = self._get_tag_by_id_serialize(
932
+ id=id,
933
+ _request_auth=_request_auth,
934
+ _content_type=_content_type,
935
+ _headers=_headers,
936
+ _host_index=_host_index
937
+ )
938
+
939
+ _response_types_map: Dict[str, Optional[str]] = {
940
+ '200': "TagObject",
941
+ '400': "ErrorResponseObject",
942
+ '401': "ErrorResponseObject",
943
+ '404': "ErrorResponseObject",
944
+ '429': "ErrorResponseObject",
945
+ '500': "ErrorResponseObject",
946
+ }
947
+ response_data = self.api_client.call_api(
948
+ *_param,
949
+ _request_timeout=_request_timeout
950
+ )
951
+ response_data.read()
952
+ return self.api_client.response_deserialize(
953
+ response_data=response_data,
954
+ response_types_map=_response_types_map,
955
+ ).data
956
+
957
+
958
+ @validate_call
959
+ def get_tag_by_id_with_http_info(
960
+ self,
961
+ id: Annotated[StrictInt, Field(description="ID of the tag to retrieve")],
962
+ _request_timeout: Union[
963
+ None,
964
+ Annotated[StrictFloat, Field(gt=0)],
965
+ Tuple[
966
+ Annotated[StrictFloat, Field(gt=0)],
967
+ Annotated[StrictFloat, Field(gt=0)]
968
+ ]
969
+ ] = None,
970
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
971
+ _content_type: Optional[StrictStr] = None,
972
+ _headers: Optional[Dict[StrictStr, Any]] = None,
973
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
974
+ ) -> ApiResponse[TagObject]:
975
+ """Get a single tag
976
+
977
+ Retrieve the details of a specific tag with the specified ID.
978
+
979
+ :param id: ID of the tag to retrieve (required)
980
+ :type id: int
981
+ :param _request_timeout: timeout setting for this request. If one
982
+ number provided, it will be total request
983
+ timeout. It can also be a pair (tuple) of
984
+ (connection, read) timeouts.
985
+ :type _request_timeout: int, tuple(int, int), optional
986
+ :param _request_auth: set to override the auth_settings for an a single
987
+ request; this effectively ignores the
988
+ authentication in the spec for a single request.
989
+ :type _request_auth: dict, optional
990
+ :param _content_type: force content-type for the request.
991
+ :type _content_type: str, Optional
992
+ :param _headers: set to override the headers for a single
993
+ request; this effectively ignores the headers
994
+ in the spec for a single request.
995
+ :type _headers: dict, optional
996
+ :param _host_index: set to override the host_index for a single
997
+ request; this effectively ignores the host_index
998
+ in the spec for a single request.
999
+ :type _host_index: int, optional
1000
+ :return: Returns the result object.
1001
+ """ # noqa: E501
1002
+
1003
+ _param = self._get_tag_by_id_serialize(
1004
+ id=id,
1005
+ _request_auth=_request_auth,
1006
+ _content_type=_content_type,
1007
+ _headers=_headers,
1008
+ _host_index=_host_index
1009
+ )
1010
+
1011
+ _response_types_map: Dict[str, Optional[str]] = {
1012
+ '200': "TagObject",
1013
+ '400': "ErrorResponseObject",
1014
+ '401': "ErrorResponseObject",
1015
+ '404': "ErrorResponseObject",
1016
+ '429': "ErrorResponseObject",
1017
+ '500': "ErrorResponseObject",
1018
+ }
1019
+ response_data = self.api_client.call_api(
1020
+ *_param,
1021
+ _request_timeout=_request_timeout
1022
+ )
1023
+ response_data.read()
1024
+ return self.api_client.response_deserialize(
1025
+ response_data=response_data,
1026
+ response_types_map=_response_types_map,
1027
+ )
1028
+
1029
+
1030
+ @validate_call
1031
+ def get_tag_by_id_without_preload_content(
1032
+ self,
1033
+ id: Annotated[StrictInt, Field(description="ID of the tag to retrieve")],
1034
+ _request_timeout: Union[
1035
+ None,
1036
+ Annotated[StrictFloat, Field(gt=0)],
1037
+ Tuple[
1038
+ Annotated[StrictFloat, Field(gt=0)],
1039
+ Annotated[StrictFloat, Field(gt=0)]
1040
+ ]
1041
+ ] = None,
1042
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1043
+ _content_type: Optional[StrictStr] = None,
1044
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1045
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1046
+ ) -> RESTResponseType:
1047
+ """Get a single tag
1048
+
1049
+ Retrieve the details of a specific tag with the specified ID.
1050
+
1051
+ :param id: ID of the tag to retrieve (required)
1052
+ :type id: int
1053
+ :param _request_timeout: timeout setting for this request. If one
1054
+ number provided, it will be total request
1055
+ timeout. It can also be a pair (tuple) of
1056
+ (connection, read) timeouts.
1057
+ :type _request_timeout: int, tuple(int, int), optional
1058
+ :param _request_auth: set to override the auth_settings for an a single
1059
+ request; this effectively ignores the
1060
+ authentication in the spec for a single request.
1061
+ :type _request_auth: dict, optional
1062
+ :param _content_type: force content-type for the request.
1063
+ :type _content_type: str, Optional
1064
+ :param _headers: set to override the headers for a single
1065
+ request; this effectively ignores the headers
1066
+ in the spec for a single request.
1067
+ :type _headers: dict, optional
1068
+ :param _host_index: set to override the host_index for a single
1069
+ request; this effectively ignores the host_index
1070
+ in the spec for a single request.
1071
+ :type _host_index: int, optional
1072
+ :return: Returns the result object.
1073
+ """ # noqa: E501
1074
+
1075
+ _param = self._get_tag_by_id_serialize(
1076
+ id=id,
1077
+ _request_auth=_request_auth,
1078
+ _content_type=_content_type,
1079
+ _headers=_headers,
1080
+ _host_index=_host_index
1081
+ )
1082
+
1083
+ _response_types_map: Dict[str, Optional[str]] = {
1084
+ '200': "TagObject",
1085
+ '400': "ErrorResponseObject",
1086
+ '401': "ErrorResponseObject",
1087
+ '404': "ErrorResponseObject",
1088
+ '429': "ErrorResponseObject",
1089
+ '500': "ErrorResponseObject",
1090
+ }
1091
+ response_data = self.api_client.call_api(
1092
+ *_param,
1093
+ _request_timeout=_request_timeout
1094
+ )
1095
+ return response_data.response
1096
+
1097
+
1098
+ def _get_tag_by_id_serialize(
1099
+ self,
1100
+ id,
1101
+ _request_auth,
1102
+ _content_type,
1103
+ _headers,
1104
+ _host_index,
1105
+ ) -> RequestSerialized:
1106
+
1107
+ _host = None
1108
+
1109
+ _collection_formats: Dict[str, str] = {
1110
+ }
1111
+
1112
+ _path_params: Dict[str, str] = {}
1113
+ _query_params: List[Tuple[str, str]] = []
1114
+ _header_params: Dict[str, Optional[str]] = _headers or {}
1115
+ _form_params: List[Tuple[str, str]] = []
1116
+ _files: Dict[
1117
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
1118
+ ] = {}
1119
+ _body_params: Optional[bytes] = None
1120
+
1121
+ # process the path parameters
1122
+ if id is not None:
1123
+ _path_params['id'] = id
1124
+ # process the query parameters
1125
+ # process the header parameters
1126
+ # process the form parameters
1127
+ # process the body parameter
1128
+
1129
+
1130
+ # set the HTTP header `Accept`
1131
+ if 'Accept' not in _header_params:
1132
+ _header_params['Accept'] = self.api_client.select_header_accept(
1133
+ [
1134
+ 'application/json'
1135
+ ]
1136
+ )
1137
+
1138
+
1139
+ # authentication setting
1140
+ _auth_settings: List[str] = [
1141
+ 'cookieAuth',
1142
+ 'bearerSecurity'
1143
+ ]
1144
+
1145
+ return self.api_client.param_serialize(
1146
+ method='GET',
1147
+ resource_path='/tags/{id}',
1148
+ path_params=_path_params,
1149
+ query_params=_query_params,
1150
+ header_params=_header_params,
1151
+ body=_body_params,
1152
+ post_params=_form_params,
1153
+ files=_files,
1154
+ auth_settings=_auth_settings,
1155
+ collection_formats=_collection_formats,
1156
+ _host=_host,
1157
+ _request_auth=_request_auth
1158
+ )
1159
+
1160
+
1161
+
1162
+
1163
+ @validate_call
1164
+ def update_tag(
1165
+ self,
1166
+ id: Annotated[StrictInt, Field(description="ID of the tag to update")],
1167
+ update_tag_request_object: UpdateTagRequestObject,
1168
+ _request_timeout: Union[
1169
+ None,
1170
+ Annotated[StrictFloat, Field(gt=0)],
1171
+ Tuple[
1172
+ Annotated[StrictFloat, Field(gt=0)],
1173
+ Annotated[StrictFloat, Field(gt=0)]
1174
+ ]
1175
+ ] = None,
1176
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1177
+ _content_type: Optional[StrictStr] = None,
1178
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1179
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1180
+ ) -> TagObject:
1181
+ """Update an existing tag
1182
+
1183
+ Updates an existing tag.<br><br> You may submit the response from a `GET /tags/{id}` as the request body, however only certain properties can be updated using this API. The following system set properties are accepted in the request body but their values will be ignored: `id`, `updated_at`, `created_at`, and `archived_at`.<br><br> It is also possible to provide only the properties to be updated in the request body, as long as the request includes at least one of the properties that is not listed above. For example a request body that contains only a `name` attribute is valid.
1184
+
1185
+ :param id: ID of the tag to update (required)
1186
+ :type id: int
1187
+ :param update_tag_request_object: (required)
1188
+ :type update_tag_request_object: UpdateTagRequestObject
1189
+ :param _request_timeout: timeout setting for this request. If one
1190
+ number provided, it will be total request
1191
+ timeout. It can also be a pair (tuple) of
1192
+ (connection, read) timeouts.
1193
+ :type _request_timeout: int, tuple(int, int), optional
1194
+ :param _request_auth: set to override the auth_settings for an a single
1195
+ request; this effectively ignores the
1196
+ authentication in the spec for a single request.
1197
+ :type _request_auth: dict, optional
1198
+ :param _content_type: force content-type for the request.
1199
+ :type _content_type: str, Optional
1200
+ :param _headers: set to override the headers for a single
1201
+ request; this effectively ignores the headers
1202
+ in the spec for a single request.
1203
+ :type _headers: dict, optional
1204
+ :param _host_index: set to override the host_index for a single
1205
+ request; this effectively ignores the host_index
1206
+ in the spec for a single request.
1207
+ :type _host_index: int, optional
1208
+ :return: Returns the result object.
1209
+ """ # noqa: E501
1210
+
1211
+ _param = self._update_tag_serialize(
1212
+ id=id,
1213
+ update_tag_request_object=update_tag_request_object,
1214
+ _request_auth=_request_auth,
1215
+ _content_type=_content_type,
1216
+ _headers=_headers,
1217
+ _host_index=_host_index
1218
+ )
1219
+
1220
+ _response_types_map: Dict[str, Optional[str]] = {
1221
+ '200': "TagObject",
1222
+ '400': "ErrorResponseObject",
1223
+ '401': "ErrorResponseObject",
1224
+ '404': "ErrorResponseObject",
1225
+ '429': "ErrorResponseObject",
1226
+ '500': "ErrorResponseObject",
1227
+ }
1228
+ response_data = self.api_client.call_api(
1229
+ *_param,
1230
+ _request_timeout=_request_timeout
1231
+ )
1232
+ response_data.read()
1233
+ return self.api_client.response_deserialize(
1234
+ response_data=response_data,
1235
+ response_types_map=_response_types_map,
1236
+ ).data
1237
+
1238
+
1239
+ @validate_call
1240
+ def update_tag_with_http_info(
1241
+ self,
1242
+ id: Annotated[StrictInt, Field(description="ID of the tag to update")],
1243
+ update_tag_request_object: UpdateTagRequestObject,
1244
+ _request_timeout: Union[
1245
+ None,
1246
+ Annotated[StrictFloat, Field(gt=0)],
1247
+ Tuple[
1248
+ Annotated[StrictFloat, Field(gt=0)],
1249
+ Annotated[StrictFloat, Field(gt=0)]
1250
+ ]
1251
+ ] = None,
1252
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1253
+ _content_type: Optional[StrictStr] = None,
1254
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1255
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1256
+ ) -> ApiResponse[TagObject]:
1257
+ """Update an existing tag
1258
+
1259
+ Updates an existing tag.<br><br> You may submit the response from a `GET /tags/{id}` as the request body, however only certain properties can be updated using this API. The following system set properties are accepted in the request body but their values will be ignored: `id`, `updated_at`, `created_at`, and `archived_at`.<br><br> It is also possible to provide only the properties to be updated in the request body, as long as the request includes at least one of the properties that is not listed above. For example a request body that contains only a `name` attribute is valid.
1260
+
1261
+ :param id: ID of the tag to update (required)
1262
+ :type id: int
1263
+ :param update_tag_request_object: (required)
1264
+ :type update_tag_request_object: UpdateTagRequestObject
1265
+ :param _request_timeout: timeout setting for this request. If one
1266
+ number provided, it will be total request
1267
+ timeout. It can also be a pair (tuple) of
1268
+ (connection, read) timeouts.
1269
+ :type _request_timeout: int, tuple(int, int), optional
1270
+ :param _request_auth: set to override the auth_settings for an a single
1271
+ request; this effectively ignores the
1272
+ authentication in the spec for a single request.
1273
+ :type _request_auth: dict, optional
1274
+ :param _content_type: force content-type for the request.
1275
+ :type _content_type: str, Optional
1276
+ :param _headers: set to override the headers for a single
1277
+ request; this effectively ignores the headers
1278
+ in the spec for a single request.
1279
+ :type _headers: dict, optional
1280
+ :param _host_index: set to override the host_index for a single
1281
+ request; this effectively ignores the host_index
1282
+ in the spec for a single request.
1283
+ :type _host_index: int, optional
1284
+ :return: Returns the result object.
1285
+ """ # noqa: E501
1286
+
1287
+ _param = self._update_tag_serialize(
1288
+ id=id,
1289
+ update_tag_request_object=update_tag_request_object,
1290
+ _request_auth=_request_auth,
1291
+ _content_type=_content_type,
1292
+ _headers=_headers,
1293
+ _host_index=_host_index
1294
+ )
1295
+
1296
+ _response_types_map: Dict[str, Optional[str]] = {
1297
+ '200': "TagObject",
1298
+ '400': "ErrorResponseObject",
1299
+ '401': "ErrorResponseObject",
1300
+ '404': "ErrorResponseObject",
1301
+ '429': "ErrorResponseObject",
1302
+ '500': "ErrorResponseObject",
1303
+ }
1304
+ response_data = self.api_client.call_api(
1305
+ *_param,
1306
+ _request_timeout=_request_timeout
1307
+ )
1308
+ response_data.read()
1309
+ return self.api_client.response_deserialize(
1310
+ response_data=response_data,
1311
+ response_types_map=_response_types_map,
1312
+ )
1313
+
1314
+
1315
+ @validate_call
1316
+ def update_tag_without_preload_content(
1317
+ self,
1318
+ id: Annotated[StrictInt, Field(description="ID of the tag to update")],
1319
+ update_tag_request_object: UpdateTagRequestObject,
1320
+ _request_timeout: Union[
1321
+ None,
1322
+ Annotated[StrictFloat, Field(gt=0)],
1323
+ Tuple[
1324
+ Annotated[StrictFloat, Field(gt=0)],
1325
+ Annotated[StrictFloat, Field(gt=0)]
1326
+ ]
1327
+ ] = None,
1328
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1329
+ _content_type: Optional[StrictStr] = None,
1330
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1331
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1332
+ ) -> RESTResponseType:
1333
+ """Update an existing tag
1334
+
1335
+ Updates an existing tag.<br><br> You may submit the response from a `GET /tags/{id}` as the request body, however only certain properties can be updated using this API. The following system set properties are accepted in the request body but their values will be ignored: `id`, `updated_at`, `created_at`, and `archived_at`.<br><br> It is also possible to provide only the properties to be updated in the request body, as long as the request includes at least one of the properties that is not listed above. For example a request body that contains only a `name` attribute is valid.
1336
+
1337
+ :param id: ID of the tag to update (required)
1338
+ :type id: int
1339
+ :param update_tag_request_object: (required)
1340
+ :type update_tag_request_object: UpdateTagRequestObject
1341
+ :param _request_timeout: timeout setting for this request. If one
1342
+ number provided, it will be total request
1343
+ timeout. It can also be a pair (tuple) of
1344
+ (connection, read) timeouts.
1345
+ :type _request_timeout: int, tuple(int, int), optional
1346
+ :param _request_auth: set to override the auth_settings for an a single
1347
+ request; this effectively ignores the
1348
+ authentication in the spec for a single request.
1349
+ :type _request_auth: dict, optional
1350
+ :param _content_type: force content-type for the request.
1351
+ :type _content_type: str, Optional
1352
+ :param _headers: set to override the headers for a single
1353
+ request; this effectively ignores the headers
1354
+ in the spec for a single request.
1355
+ :type _headers: dict, optional
1356
+ :param _host_index: set to override the host_index for a single
1357
+ request; this effectively ignores the host_index
1358
+ in the spec for a single request.
1359
+ :type _host_index: int, optional
1360
+ :return: Returns the result object.
1361
+ """ # noqa: E501
1362
+
1363
+ _param = self._update_tag_serialize(
1364
+ id=id,
1365
+ update_tag_request_object=update_tag_request_object,
1366
+ _request_auth=_request_auth,
1367
+ _content_type=_content_type,
1368
+ _headers=_headers,
1369
+ _host_index=_host_index
1370
+ )
1371
+
1372
+ _response_types_map: Dict[str, Optional[str]] = {
1373
+ '200': "TagObject",
1374
+ '400': "ErrorResponseObject",
1375
+ '401': "ErrorResponseObject",
1376
+ '404': "ErrorResponseObject",
1377
+ '429': "ErrorResponseObject",
1378
+ '500': "ErrorResponseObject",
1379
+ }
1380
+ response_data = self.api_client.call_api(
1381
+ *_param,
1382
+ _request_timeout=_request_timeout
1383
+ )
1384
+ return response_data.response
1385
+
1386
+
1387
+ def _update_tag_serialize(
1388
+ self,
1389
+ id,
1390
+ update_tag_request_object,
1391
+ _request_auth,
1392
+ _content_type,
1393
+ _headers,
1394
+ _host_index,
1395
+ ) -> RequestSerialized:
1396
+
1397
+ _host = None
1398
+
1399
+ _collection_formats: Dict[str, str] = {
1400
+ }
1401
+
1402
+ _path_params: Dict[str, str] = {}
1403
+ _query_params: List[Tuple[str, str]] = []
1404
+ _header_params: Dict[str, Optional[str]] = _headers or {}
1405
+ _form_params: List[Tuple[str, str]] = []
1406
+ _files: Dict[
1407
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
1408
+ ] = {}
1409
+ _body_params: Optional[bytes] = None
1410
+
1411
+ # process the path parameters
1412
+ if id is not None:
1413
+ _path_params['id'] = id
1414
+ # process the query parameters
1415
+ # process the header parameters
1416
+ # process the form parameters
1417
+ # process the body parameter
1418
+ if update_tag_request_object is not None:
1419
+ _body_params = update_tag_request_object
1420
+
1421
+
1422
+ # set the HTTP header `Accept`
1423
+ if 'Accept' not in _header_params:
1424
+ _header_params['Accept'] = self.api_client.select_header_accept(
1425
+ [
1426
+ 'application/json'
1427
+ ]
1428
+ )
1429
+
1430
+ # set the HTTP header `Content-Type`
1431
+ if _content_type:
1432
+ _header_params['Content-Type'] = _content_type
1433
+ else:
1434
+ _default_content_type = (
1435
+ self.api_client.select_header_content_type(
1436
+ [
1437
+ 'application/json'
1438
+ ]
1439
+ )
1440
+ )
1441
+ if _default_content_type is not None:
1442
+ _header_params['Content-Type'] = _default_content_type
1443
+
1444
+ # authentication setting
1445
+ _auth_settings: List[str] = [
1446
+ 'cookieAuth',
1447
+ 'bearerSecurity'
1448
+ ]
1449
+
1450
+ return self.api_client.param_serialize(
1451
+ method='PUT',
1452
+ resource_path='/tags/{id}',
1453
+ path_params=_path_params,
1454
+ query_params=_query_params,
1455
+ header_params=_header_params,
1456
+ body=_body_params,
1457
+ post_params=_form_params,
1458
+ files=_files,
1459
+ auth_settings=_auth_settings,
1460
+ collection_formats=_collection_formats,
1461
+ _host=_host,
1462
+ _request_auth=_request_auth
1463
+ )
1464
+
1465
+