signwell-sdk-python 0.1.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 (110) hide show
  1. signwell_sdk/__init__.py +287 -0
  2. signwell_sdk/api/__init__.py +10 -0
  3. signwell_sdk/api/api_application_api.py +481 -0
  4. signwell_sdk/api/bulk_send_api.py +1589 -0
  5. signwell_sdk/api/document_api.py +2425 -0
  6. signwell_sdk/api/me_api.py +246 -0
  7. signwell_sdk/api/regional_api.py +345 -0
  8. signwell_sdk/api/template_api.py +1298 -0
  9. signwell_sdk/api/webhooks_api.py +710 -0
  10. signwell_sdk/api_client.py +747 -0
  11. signwell_sdk/api_response.py +20 -0
  12. signwell_sdk/configuration.py +599 -0
  13. signwell_sdk/embedded.py +385 -0
  14. signwell_sdk/exceptions.py +314 -0
  15. signwell_sdk/models/__init__.py +114 -0
  16. signwell_sdk/models/account_info_response.py +143 -0
  17. signwell_sdk/models/account_info_response_active_users_inner.py +107 -0
  18. signwell_sdk/models/account_info_response_preferences.py +147 -0
  19. signwell_sdk/models/additional_fields_inner_inner.py +274 -0
  20. signwell_sdk/models/additional_fields_inner_inner_value.py +189 -0
  21. signwell_sdk/models/additional_files_inner.py +103 -0
  22. signwell_sdk/models/api_application_response.py +137 -0
  23. signwell_sdk/models/api_application_response_owner.py +107 -0
  24. signwell_sdk/models/api_application_response_preferences.py +135 -0
  25. signwell_sdk/models/attachment_request_info.py +99 -0
  26. signwell_sdk/models/attachment_requests_inner.py +110 -0
  27. signwell_sdk/models/bulk_send_create_response.py +132 -0
  28. signwell_sdk/models/bulk_send_csv_request.py +100 -0
  29. signwell_sdk/models/bulk_send_csv_template_response.py +97 -0
  30. signwell_sdk/models/bulk_send_documents_response.py +167 -0
  31. signwell_sdk/models/bulk_send_list_item.py +141 -0
  32. signwell_sdk/models/bulk_send_list_response.py +138 -0
  33. signwell_sdk/models/bulk_send_response.py +151 -0
  34. signwell_sdk/models/bulk_send_response_templates_inner.py +98 -0
  35. signwell_sdk/models/bulk_send_validate_csv_response.py +129 -0
  36. signwell_sdk/models/checkbox_group_info.py +138 -0
  37. signwell_sdk/models/checkbox_groups_inner.py +136 -0
  38. signwell_sdk/models/checkbox_validation.py +35 -0
  39. signwell_sdk/models/completed_pdf_response.py +177 -0
  40. signwell_sdk/models/completed_pdf_url_response.py +97 -0
  41. signwell_sdk/models/copied_contact_info.py +99 -0
  42. signwell_sdk/models/copied_contacts_inner.py +98 -0
  43. signwell_sdk/models/copied_placeholders_inner.py +111 -0
  44. signwell_sdk/models/create_bulk_send_request.py +155 -0
  45. signwell_sdk/models/create_webhook_request.py +100 -0
  46. signwell_sdk/models/date_format.py +36 -0
  47. signwell_sdk/models/detailed_option.py +105 -0
  48. signwell_sdk/models/document_from_template_request.py +377 -0
  49. signwell_sdk/models/document_from_template_response.py +353 -0
  50. signwell_sdk/models/document_from_template_response_fields_inner_inner.py +270 -0
  51. signwell_sdk/models/document_from_template_response_fields_inner_inner_recipient.py +99 -0
  52. signwell_sdk/models/document_from_template_response_recipients_inner.py +206 -0
  53. signwell_sdk/models/document_list_response.py +138 -0
  54. signwell_sdk/models/document_request.py +350 -0
  55. signwell_sdk/models/document_response.py +357 -0
  56. signwell_sdk/models/document_response_attachment_requests_inner.py +101 -0
  57. signwell_sdk/models/document_response_fields_inner_inner.py +268 -0
  58. signwell_sdk/models/document_response_fields_inner_inner_options_inner.py +101 -0
  59. signwell_sdk/models/document_response_fields_inner_inner_recipient.py +98 -0
  60. signwell_sdk/models/document_response_fields_inner_inner_value.py +195 -0
  61. signwell_sdk/models/document_response_recipients_inner.py +208 -0
  62. signwell_sdk/models/document_template_list_response.py +138 -0
  63. signwell_sdk/models/document_template_request.py +307 -0
  64. signwell_sdk/models/document_template_response.py +323 -0
  65. signwell_sdk/models/document_template_response_copied_placeholders_inner.py +131 -0
  66. signwell_sdk/models/document_template_response_placeholders_inner.py +144 -0
  67. signwell_sdk/models/document_template_update_request.py +208 -0
  68. signwell_sdk/models/dropdown_option.py +153 -0
  69. signwell_sdk/models/error_response.py +107 -0
  70. signwell_sdk/models/error_response_meta.py +101 -0
  71. signwell_sdk/models/field_type.py +46 -0
  72. signwell_sdk/models/fields_inner_inner.py +268 -0
  73. signwell_sdk/models/file_format.py +33 -0
  74. signwell_sdk/models/file_info.py +98 -0
  75. signwell_sdk/models/files_inner.py +103 -0
  76. signwell_sdk/models/label_info.py +98 -0
  77. signwell_sdk/models/label_request.py +97 -0
  78. signwell_sdk/models/label_response.py +98 -0
  79. signwell_sdk/models/me_response.py +130 -0
  80. signwell_sdk/models/me_response_contact.py +147 -0
  81. signwell_sdk/models/me_response_user.py +117 -0
  82. signwell_sdk/models/me_response_user_preferences.py +105 -0
  83. signwell_sdk/models/nom151_certificate_response.py +107 -0
  84. signwell_sdk/models/nom151_certificate_response_nom151.py +125 -0
  85. signwell_sdk/models/nom151_url_response.py +97 -0
  86. signwell_sdk/models/pagination_meta.py +119 -0
  87. signwell_sdk/models/placeholders_inner.py +115 -0
  88. signwell_sdk/models/rate_limit_error_response.py +97 -0
  89. signwell_sdk/models/recipients_inner.py +141 -0
  90. signwell_sdk/models/reminder_recipients_inner.py +100 -0
  91. signwell_sdk/models/send_reminder_request.py +114 -0
  92. signwell_sdk/models/template_attachment_requests_inner.py +110 -0
  93. signwell_sdk/models/template_checkbox_groups_inner.py +136 -0
  94. signwell_sdk/models/template_field_values_inner.py +109 -0
  95. signwell_sdk/models/template_field_values_inner_value.py +189 -0
  96. signwell_sdk/models/template_fields_inner_inner.py +266 -0
  97. signwell_sdk/models/template_recipients_inner.py +146 -0
  98. signwell_sdk/models/text_validation.py +42 -0
  99. signwell_sdk/models/update_document_and_send_request.py +234 -0
  100. signwell_sdk/models/update_recipients_map_inner.py +118 -0
  101. signwell_sdk/models/update_recipients_request.py +111 -0
  102. signwell_sdk/models/validation_error_response.py +99 -0
  103. signwell_sdk/models/webhook_response.py +110 -0
  104. signwell_sdk/py.typed +0 -0
  105. signwell_sdk/rest.py +209 -0
  106. signwell_sdk/webhook.py +214 -0
  107. signwell_sdk_python-0.1.0.dist-info/METADATA +177 -0
  108. signwell_sdk_python-0.1.0.dist-info/RECORD +110 -0
  109. signwell_sdk_python-0.1.0.dist-info/WHEEL +4 -0
  110. signwell_sdk_python-0.1.0.dist-info/licenses/LICENSE +21 -0
@@ -0,0 +1,1298 @@
1
+ """
2
+ SignWell Developer API
3
+
4
+ API for creating, managing, and tracking electronic signature workflows.
5
+
6
+ The version of the OpenAPI document: v1
7
+ Contact: support@signwell.com
8
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
9
+
10
+ Do not edit the class manually.
11
+ """ # noqa: E501
12
+
13
+ from __future__ import annotations
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
+ from collections.abc import Iterator
20
+ from signwell_sdk.models.document_template_list_response import DocumentTemplateListResponse
21
+ from signwell_sdk.models.document_template_request import DocumentTemplateRequest
22
+ from signwell_sdk.models.document_template_response import DocumentTemplateResponse
23
+ from signwell_sdk.models.document_template_update_request import DocumentTemplateUpdateRequest
24
+ from signwell_sdk.api_client import ApiClient, RequestSerialized
25
+ from signwell_sdk.api_response import ApiResponse
26
+ from signwell_sdk.rest import RESTResponseType
27
+
28
+
29
+ class TemplateApi:
30
+ """NOTE: This class is auto generated by OpenAPI Generator
31
+ Ref: https://openapi-generator.tech
32
+
33
+ Do not edit the class manually.
34
+ """
35
+
36
+ def __init__(self, api_client=None) -> None:
37
+ if api_client is None:
38
+ api_client = ApiClient.get_default()
39
+ self.api_client = api_client
40
+
41
+ @validate_call
42
+ def create_template(
43
+ self,
44
+ document_template_request: DocumentTemplateRequest,
45
+ _request_timeout: Union[
46
+ None,
47
+ Annotated[StrictFloat, Field(gt=0)],
48
+ Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
49
+ ] = None,
50
+ _request_auth: Dict[StrictStr, Any] | None = None,
51
+ _content_type: StrictStr | None = None,
52
+ _headers: Dict[StrictStr, Any] | None = None,
53
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
54
+ ) -> DocumentTemplateResponse:
55
+ """Create Template
56
+
57
+ Creates a new template.
58
+
59
+ :param document_template_request: (required)
60
+ :type document_template_request: DocumentTemplateRequest
61
+ :param _request_timeout: timeout setting for this request. If one
62
+ number provided, it will be total request
63
+ timeout. It can also be a pair (tuple) of
64
+ (connection, read) timeouts.
65
+ :type _request_timeout: int, tuple(int, int), optional
66
+ :param _request_auth: set to override the auth_settings for an a single
67
+ request; this effectively ignores the
68
+ authentication in the spec for a single request.
69
+ :type _request_auth: dict, optional
70
+ :param _content_type: force content-type for the request.
71
+ :type _content_type: str, Optional
72
+ :param _headers: set to override the headers for a single
73
+ request; this effectively ignores the headers
74
+ in the spec for a single request.
75
+ :type _headers: dict, optional
76
+ :param _host_index: set to override the host_index for a single
77
+ request; this effectively ignores the host_index
78
+ in the spec for a single request.
79
+ :type _host_index: int, optional
80
+ :return: Returns the result object.
81
+ """ # noqa: E501
82
+
83
+ _param = self._create_template_serialize(
84
+ document_template_request=document_template_request,
85
+ _request_auth=_request_auth,
86
+ _content_type=_content_type,
87
+ _headers=_headers,
88
+ _host_index=_host_index,
89
+ )
90
+
91
+ _response_types_map: Dict[str, str | None] = {
92
+ "201": "DocumentTemplateResponse",
93
+ "400": "ValidationErrorResponse",
94
+ "422": "ValidationErrorResponse",
95
+ "429": "RateLimitErrorResponse",
96
+ }
97
+
98
+ response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
99
+ response_data.read()
100
+ return self.api_client.response_deserialize(
101
+ response_data=response_data,
102
+ response_types_map=_response_types_map,
103
+ ).data
104
+
105
+ @validate_call
106
+ def create_template_with_http_info(
107
+ self,
108
+ document_template_request: DocumentTemplateRequest,
109
+ _request_timeout: Union[
110
+ None,
111
+ Annotated[StrictFloat, Field(gt=0)],
112
+ Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
113
+ ] = None,
114
+ _request_auth: Dict[StrictStr, Any] | None = None,
115
+ _content_type: StrictStr | None = None,
116
+ _headers: Dict[StrictStr, Any] | None = None,
117
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
118
+ ) -> ApiResponse[DocumentTemplateResponse]:
119
+ """Create Template
120
+
121
+ Creates a new template.
122
+
123
+ :param document_template_request: (required)
124
+ :type document_template_request: DocumentTemplateRequest
125
+ :param _request_timeout: timeout setting for this request. If one
126
+ number provided, it will be total request
127
+ timeout. It can also be a pair (tuple) of
128
+ (connection, read) timeouts.
129
+ :type _request_timeout: int, tuple(int, int), optional
130
+ :param _request_auth: set to override the auth_settings for an a single
131
+ request; this effectively ignores the
132
+ authentication in the spec for a single request.
133
+ :type _request_auth: dict, optional
134
+ :param _content_type: force content-type for the request.
135
+ :type _content_type: str, Optional
136
+ :param _headers: set to override the headers for a single
137
+ request; this effectively ignores the headers
138
+ in the spec for a single request.
139
+ :type _headers: dict, optional
140
+ :param _host_index: set to override the host_index for a single
141
+ request; this effectively ignores the host_index
142
+ in the spec for a single request.
143
+ :type _host_index: int, optional
144
+ :return: Returns the result object.
145
+ """ # noqa: E501
146
+
147
+ _param = self._create_template_serialize(
148
+ document_template_request=document_template_request,
149
+ _request_auth=_request_auth,
150
+ _content_type=_content_type,
151
+ _headers=_headers,
152
+ _host_index=_host_index,
153
+ )
154
+
155
+ _response_types_map: Dict[str, str | None] = {
156
+ "201": "DocumentTemplateResponse",
157
+ "400": "ValidationErrorResponse",
158
+ "422": "ValidationErrorResponse",
159
+ "429": "RateLimitErrorResponse",
160
+ }
161
+
162
+ response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
163
+ response_data.read()
164
+ return self.api_client.response_deserialize(
165
+ response_data=response_data,
166
+ response_types_map=_response_types_map,
167
+ )
168
+
169
+ @validate_call
170
+ def create_template_without_preload_content(
171
+ self,
172
+ document_template_request: DocumentTemplateRequest,
173
+ _request_timeout: Union[
174
+ None,
175
+ Annotated[StrictFloat, Field(gt=0)],
176
+ Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
177
+ ] = None,
178
+ _request_auth: Dict[StrictStr, Any] | None = None,
179
+ _content_type: StrictStr | None = None,
180
+ _headers: Dict[StrictStr, Any] | None = None,
181
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
182
+ ) -> RESTResponseType:
183
+ """Create Template
184
+
185
+ Creates a new template.
186
+
187
+ :param document_template_request: (required)
188
+ :type document_template_request: DocumentTemplateRequest
189
+ :param _request_timeout: timeout setting for this request. If one
190
+ number provided, it will be total request
191
+ timeout. It can also be a pair (tuple) of
192
+ (connection, read) timeouts.
193
+ :type _request_timeout: int, tuple(int, int), optional
194
+ :param _request_auth: set to override the auth_settings for an a single
195
+ request; this effectively ignores the
196
+ authentication in the spec for a single request.
197
+ :type _request_auth: dict, optional
198
+ :param _content_type: force content-type for the request.
199
+ :type _content_type: str, Optional
200
+ :param _headers: set to override the headers for a single
201
+ request; this effectively ignores the headers
202
+ in the spec for a single request.
203
+ :type _headers: dict, optional
204
+ :param _host_index: set to override the host_index for a single
205
+ request; this effectively ignores the host_index
206
+ in the spec for a single request.
207
+ :type _host_index: int, optional
208
+ :return: Returns the result object.
209
+ """ # noqa: E501
210
+
211
+ _param = self._create_template_serialize(
212
+ document_template_request=document_template_request,
213
+ _request_auth=_request_auth,
214
+ _content_type=_content_type,
215
+ _headers=_headers,
216
+ _host_index=_host_index,
217
+ )
218
+
219
+ _response_types_map: Dict[str, str | None] = {
220
+ "201": "DocumentTemplateResponse",
221
+ "400": "ValidationErrorResponse",
222
+ "422": "ValidationErrorResponse",
223
+ "429": "RateLimitErrorResponse",
224
+ }
225
+
226
+ response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
227
+ return response_data.response
228
+
229
+ def _create_template_serialize(
230
+ self,
231
+ document_template_request,
232
+ _request_auth,
233
+ _content_type,
234
+ _headers,
235
+ _host_index,
236
+ ) -> RequestSerialized:
237
+
238
+ _host = None
239
+
240
+ _collection_formats: Dict[str, str] = {}
241
+
242
+ _path_params: Dict[str, str] = {}
243
+ _query_params: List[Tuple[str, str]] = []
244
+ _header_params: Dict[str, str | None] = _headers or {}
245
+ _form_params: List[Tuple[str, str]] = []
246
+ _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {}
247
+ _body_params: bytes | None = None
248
+
249
+ # process the path parameters
250
+ # process the query parameters
251
+ # process the header parameters
252
+ # process the form parameters
253
+ # process the body parameter
254
+ if document_template_request is not None:
255
+ _body_params = document_template_request
256
+
257
+ # set the HTTP header `Accept`
258
+ if "Accept" not in _header_params:
259
+ _header_params["Accept"] = self.api_client.select_header_accept(["application/json"])
260
+
261
+ # set the HTTP header `Content-Type`
262
+ if _content_type:
263
+ _header_params["Content-Type"] = _content_type
264
+ else:
265
+ _default_content_type = self.api_client.select_header_content_type(["application/json"])
266
+ if _default_content_type is not None:
267
+ _header_params["Content-Type"] = _default_content_type
268
+
269
+ # authentication setting
270
+ _auth_settings: List[str] = ["api_key"]
271
+
272
+ return self.api_client.param_serialize(
273
+ method="POST",
274
+ resource_path="/api/v1/document_templates",
275
+ path_params=_path_params,
276
+ query_params=_query_params,
277
+ header_params=_header_params,
278
+ body=_body_params,
279
+ post_params=_form_params,
280
+ files=_files,
281
+ auth_settings=_auth_settings,
282
+ collection_formats=_collection_formats,
283
+ _host=_host,
284
+ _request_auth=_request_auth,
285
+ )
286
+
287
+ @validate_call
288
+ def delete_template(
289
+ self,
290
+ id: Annotated[str, Field(min_length=1, strict=True)],
291
+ _request_timeout: Union[
292
+ None,
293
+ Annotated[StrictFloat, Field(gt=0)],
294
+ Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
295
+ ] = None,
296
+ _request_auth: Dict[StrictStr, Any] | None = None,
297
+ _content_type: StrictStr | None = None,
298
+ _headers: Dict[StrictStr, Any] | None = None,
299
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
300
+ ) -> None:
301
+ """Delete Template
302
+
303
+ Deletes a template. Supply the unique template ID from either a Create Template request or template page URL.
304
+
305
+ :param id: (required)
306
+ :type id: str
307
+ :param _request_timeout: timeout setting for this request. If one
308
+ number provided, it will be total request
309
+ timeout. It can also be a pair (tuple) of
310
+ (connection, read) timeouts.
311
+ :type _request_timeout: int, tuple(int, int), optional
312
+ :param _request_auth: set to override the auth_settings for an a single
313
+ request; this effectively ignores the
314
+ authentication in the spec for a single request.
315
+ :type _request_auth: dict, optional
316
+ :param _content_type: force content-type for the request.
317
+ :type _content_type: str, Optional
318
+ :param _headers: set to override the headers for a single
319
+ request; this effectively ignores the headers
320
+ in the spec for a single request.
321
+ :type _headers: dict, optional
322
+ :param _host_index: set to override the host_index for a single
323
+ request; this effectively ignores the host_index
324
+ in the spec for a single request.
325
+ :type _host_index: int, optional
326
+ :return: Returns the result object.
327
+ """ # noqa: E501
328
+
329
+ _param = self._delete_template_serialize(
330
+ id=id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, _host_index=_host_index
331
+ )
332
+
333
+ _response_types_map: Dict[str, str | None] = {
334
+ "204": None,
335
+ "404": "ErrorResponse",
336
+ "429": "RateLimitErrorResponse",
337
+ }
338
+
339
+ response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
340
+ response_data.read()
341
+ return self.api_client.response_deserialize(
342
+ response_data=response_data,
343
+ response_types_map=_response_types_map,
344
+ ).data
345
+
346
+ @validate_call
347
+ def delete_template_with_http_info(
348
+ self,
349
+ id: Annotated[str, Field(min_length=1, strict=True)],
350
+ _request_timeout: Union[
351
+ None,
352
+ Annotated[StrictFloat, Field(gt=0)],
353
+ Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
354
+ ] = None,
355
+ _request_auth: Dict[StrictStr, Any] | None = None,
356
+ _content_type: StrictStr | None = None,
357
+ _headers: Dict[StrictStr, Any] | None = None,
358
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
359
+ ) -> ApiResponse[None]:
360
+ """Delete Template
361
+
362
+ Deletes a template. Supply the unique template ID from either a Create Template request or template page URL.
363
+
364
+ :param id: (required)
365
+ :type id: str
366
+ :param _request_timeout: timeout setting for this request. If one
367
+ number provided, it will be total request
368
+ timeout. It can also be a pair (tuple) of
369
+ (connection, read) timeouts.
370
+ :type _request_timeout: int, tuple(int, int), optional
371
+ :param _request_auth: set to override the auth_settings for an a single
372
+ request; this effectively ignores the
373
+ authentication in the spec for a single request.
374
+ :type _request_auth: dict, optional
375
+ :param _content_type: force content-type for the request.
376
+ :type _content_type: str, Optional
377
+ :param _headers: set to override the headers for a single
378
+ request; this effectively ignores the headers
379
+ in the spec for a single request.
380
+ :type _headers: dict, optional
381
+ :param _host_index: set to override the host_index for a single
382
+ request; this effectively ignores the host_index
383
+ in the spec for a single request.
384
+ :type _host_index: int, optional
385
+ :return: Returns the result object.
386
+ """ # noqa: E501
387
+
388
+ _param = self._delete_template_serialize(
389
+ id=id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, _host_index=_host_index
390
+ )
391
+
392
+ _response_types_map: Dict[str, str | None] = {
393
+ "204": None,
394
+ "404": "ErrorResponse",
395
+ "429": "RateLimitErrorResponse",
396
+ }
397
+
398
+ response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
399
+ response_data.read()
400
+ return self.api_client.response_deserialize(
401
+ response_data=response_data,
402
+ response_types_map=_response_types_map,
403
+ )
404
+
405
+ @validate_call
406
+ def delete_template_without_preload_content(
407
+ self,
408
+ id: Annotated[str, Field(min_length=1, strict=True)],
409
+ _request_timeout: Union[
410
+ None,
411
+ Annotated[StrictFloat, Field(gt=0)],
412
+ Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
413
+ ] = None,
414
+ _request_auth: Dict[StrictStr, Any] | None = None,
415
+ _content_type: StrictStr | None = None,
416
+ _headers: Dict[StrictStr, Any] | None = None,
417
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
418
+ ) -> RESTResponseType:
419
+ """Delete Template
420
+
421
+ Deletes a template. Supply the unique template ID from either a Create Template request or template page URL.
422
+
423
+ :param id: (required)
424
+ :type id: str
425
+ :param _request_timeout: timeout setting for this request. If one
426
+ number provided, it will be total request
427
+ timeout. It can also be a pair (tuple) of
428
+ (connection, read) timeouts.
429
+ :type _request_timeout: int, tuple(int, int), optional
430
+ :param _request_auth: set to override the auth_settings for an a single
431
+ request; this effectively ignores the
432
+ authentication in the spec for a single request.
433
+ :type _request_auth: dict, optional
434
+ :param _content_type: force content-type for the request.
435
+ :type _content_type: str, Optional
436
+ :param _headers: set to override the headers for a single
437
+ request; this effectively ignores the headers
438
+ in the spec for a single request.
439
+ :type _headers: dict, optional
440
+ :param _host_index: set to override the host_index for a single
441
+ request; this effectively ignores the host_index
442
+ in the spec for a single request.
443
+ :type _host_index: int, optional
444
+ :return: Returns the result object.
445
+ """ # noqa: E501
446
+
447
+ _param = self._delete_template_serialize(
448
+ id=id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, _host_index=_host_index
449
+ )
450
+
451
+ _response_types_map: Dict[str, str | None] = {
452
+ "204": None,
453
+ "404": "ErrorResponse",
454
+ "429": "RateLimitErrorResponse",
455
+ }
456
+
457
+ response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
458
+ return response_data.response
459
+
460
+ def _delete_template_serialize(
461
+ self,
462
+ id,
463
+ _request_auth,
464
+ _content_type,
465
+ _headers,
466
+ _host_index,
467
+ ) -> RequestSerialized:
468
+
469
+ _host = None
470
+
471
+ _collection_formats: Dict[str, str] = {}
472
+
473
+ _path_params: Dict[str, str] = {}
474
+ _query_params: List[Tuple[str, str]] = []
475
+ _header_params: Dict[str, str | None] = _headers or {}
476
+ _form_params: List[Tuple[str, str]] = []
477
+ _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {}
478
+ _body_params: bytes | None = None
479
+
480
+ # process the path parameters
481
+ if id is not None:
482
+ _path_params["id"] = id
483
+ # process the query parameters
484
+ # process the header parameters
485
+ # process the form parameters
486
+ # process the body parameter
487
+
488
+ # set the HTTP header `Accept`
489
+ if "Accept" not in _header_params:
490
+ _header_params["Accept"] = self.api_client.select_header_accept(["application/json"])
491
+
492
+ # authentication setting
493
+ _auth_settings: List[str] = ["api_key"]
494
+
495
+ return self.api_client.param_serialize(
496
+ method="DELETE",
497
+ resource_path="/api/v1/document_templates/{id}",
498
+ path_params=_path_params,
499
+ query_params=_query_params,
500
+ header_params=_header_params,
501
+ body=_body_params,
502
+ post_params=_form_params,
503
+ files=_files,
504
+ auth_settings=_auth_settings,
505
+ collection_formats=_collection_formats,
506
+ _host=_host,
507
+ _request_auth=_request_auth,
508
+ )
509
+
510
+ @validate_call
511
+ def get_template(
512
+ self,
513
+ id: Annotated[str, Field(min_length=1, strict=True)],
514
+ _request_timeout: Union[
515
+ None,
516
+ Annotated[StrictFloat, Field(gt=0)],
517
+ Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
518
+ ] = None,
519
+ _request_auth: Dict[StrictStr, Any] | None = None,
520
+ _content_type: StrictStr | None = None,
521
+ _headers: Dict[StrictStr, Any] | None = None,
522
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
523
+ ) -> DocumentTemplateResponse:
524
+ """Get Template
525
+
526
+ Returns a template and all associated template data. Supply the unique template ID from either a Create Template request or template page URL.
527
+
528
+ :param id: (required)
529
+ :type id: str
530
+ :param _request_timeout: timeout setting for this request. If one
531
+ number provided, it will be total request
532
+ timeout. It can also be a pair (tuple) of
533
+ (connection, read) timeouts.
534
+ :type _request_timeout: int, tuple(int, int), optional
535
+ :param _request_auth: set to override the auth_settings for an a single
536
+ request; this effectively ignores the
537
+ authentication in the spec for a single request.
538
+ :type _request_auth: dict, optional
539
+ :param _content_type: force content-type for the request.
540
+ :type _content_type: str, Optional
541
+ :param _headers: set to override the headers for a single
542
+ request; this effectively ignores the headers
543
+ in the spec for a single request.
544
+ :type _headers: dict, optional
545
+ :param _host_index: set to override the host_index for a single
546
+ request; this effectively ignores the host_index
547
+ in the spec for a single request.
548
+ :type _host_index: int, optional
549
+ :return: Returns the result object.
550
+ """ # noqa: E501
551
+
552
+ _param = self._get_template_serialize(
553
+ id=id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, _host_index=_host_index
554
+ )
555
+
556
+ _response_types_map: Dict[str, str | None] = {
557
+ "200": "DocumentTemplateResponse",
558
+ "404": "ErrorResponse",
559
+ "429": "RateLimitErrorResponse",
560
+ }
561
+
562
+ response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
563
+ response_data.read()
564
+ return self.api_client.response_deserialize(
565
+ response_data=response_data,
566
+ response_types_map=_response_types_map,
567
+ ).data
568
+
569
+ @validate_call
570
+ def get_template_with_http_info(
571
+ self,
572
+ id: Annotated[str, Field(min_length=1, strict=True)],
573
+ _request_timeout: Union[
574
+ None,
575
+ Annotated[StrictFloat, Field(gt=0)],
576
+ Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
577
+ ] = None,
578
+ _request_auth: Dict[StrictStr, Any] | None = None,
579
+ _content_type: StrictStr | None = None,
580
+ _headers: Dict[StrictStr, Any] | None = None,
581
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
582
+ ) -> ApiResponse[DocumentTemplateResponse]:
583
+ """Get Template
584
+
585
+ Returns a template and all associated template data. Supply the unique template ID from either a Create Template request or template page URL.
586
+
587
+ :param id: (required)
588
+ :type id: str
589
+ :param _request_timeout: timeout setting for this request. If one
590
+ number provided, it will be total request
591
+ timeout. It can also be a pair (tuple) of
592
+ (connection, read) timeouts.
593
+ :type _request_timeout: int, tuple(int, int), optional
594
+ :param _request_auth: set to override the auth_settings for an a single
595
+ request; this effectively ignores the
596
+ authentication in the spec for a single request.
597
+ :type _request_auth: dict, optional
598
+ :param _content_type: force content-type for the request.
599
+ :type _content_type: str, Optional
600
+ :param _headers: set to override the headers for a single
601
+ request; this effectively ignores the headers
602
+ in the spec for a single request.
603
+ :type _headers: dict, optional
604
+ :param _host_index: set to override the host_index for a single
605
+ request; this effectively ignores the host_index
606
+ in the spec for a single request.
607
+ :type _host_index: int, optional
608
+ :return: Returns the result object.
609
+ """ # noqa: E501
610
+
611
+ _param = self._get_template_serialize(
612
+ id=id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, _host_index=_host_index
613
+ )
614
+
615
+ _response_types_map: Dict[str, str | None] = {
616
+ "200": "DocumentTemplateResponse",
617
+ "404": "ErrorResponse",
618
+ "429": "RateLimitErrorResponse",
619
+ }
620
+
621
+ response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
622
+ response_data.read()
623
+ return self.api_client.response_deserialize(
624
+ response_data=response_data,
625
+ response_types_map=_response_types_map,
626
+ )
627
+
628
+ @validate_call
629
+ def get_template_without_preload_content(
630
+ self,
631
+ id: Annotated[str, Field(min_length=1, strict=True)],
632
+ _request_timeout: Union[
633
+ None,
634
+ Annotated[StrictFloat, Field(gt=0)],
635
+ Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
636
+ ] = None,
637
+ _request_auth: Dict[StrictStr, Any] | None = None,
638
+ _content_type: StrictStr | None = None,
639
+ _headers: Dict[StrictStr, Any] | None = None,
640
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
641
+ ) -> RESTResponseType:
642
+ """Get Template
643
+
644
+ Returns a template and all associated template data. Supply the unique template ID from either a Create Template request or template page URL.
645
+
646
+ :param id: (required)
647
+ :type id: str
648
+ :param _request_timeout: timeout setting for this request. If one
649
+ number provided, it will be total request
650
+ timeout. It can also be a pair (tuple) of
651
+ (connection, read) timeouts.
652
+ :type _request_timeout: int, tuple(int, int), optional
653
+ :param _request_auth: set to override the auth_settings for an a single
654
+ request; this effectively ignores the
655
+ authentication in the spec for a single request.
656
+ :type _request_auth: dict, optional
657
+ :param _content_type: force content-type for the request.
658
+ :type _content_type: str, Optional
659
+ :param _headers: set to override the headers for a single
660
+ request; this effectively ignores the headers
661
+ in the spec for a single request.
662
+ :type _headers: dict, optional
663
+ :param _host_index: set to override the host_index for a single
664
+ request; this effectively ignores the host_index
665
+ in the spec for a single request.
666
+ :type _host_index: int, optional
667
+ :return: Returns the result object.
668
+ """ # noqa: E501
669
+
670
+ _param = self._get_template_serialize(
671
+ id=id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, _host_index=_host_index
672
+ )
673
+
674
+ _response_types_map: Dict[str, str | None] = {
675
+ "200": "DocumentTemplateResponse",
676
+ "404": "ErrorResponse",
677
+ "429": "RateLimitErrorResponse",
678
+ }
679
+
680
+ response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
681
+ return response_data.response
682
+
683
+ def _get_template_serialize(
684
+ self,
685
+ id,
686
+ _request_auth,
687
+ _content_type,
688
+ _headers,
689
+ _host_index,
690
+ ) -> RequestSerialized:
691
+
692
+ _host = None
693
+
694
+ _collection_formats: Dict[str, str] = {}
695
+
696
+ _path_params: Dict[str, str] = {}
697
+ _query_params: List[Tuple[str, str]] = []
698
+ _header_params: Dict[str, str | None] = _headers or {}
699
+ _form_params: List[Tuple[str, str]] = []
700
+ _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {}
701
+ _body_params: bytes | None = None
702
+
703
+ # process the path parameters
704
+ if id is not None:
705
+ _path_params["id"] = id
706
+ # process the query parameters
707
+ # process the header parameters
708
+ # process the form parameters
709
+ # process the body parameter
710
+
711
+ # set the HTTP header `Accept`
712
+ if "Accept" not in _header_params:
713
+ _header_params["Accept"] = self.api_client.select_header_accept(["application/json"])
714
+
715
+ # authentication setting
716
+ _auth_settings: List[str] = ["api_key"]
717
+
718
+ return self.api_client.param_serialize(
719
+ method="GET",
720
+ resource_path="/api/v1/document_templates/{id}",
721
+ path_params=_path_params,
722
+ query_params=_query_params,
723
+ header_params=_header_params,
724
+ body=_body_params,
725
+ post_params=_form_params,
726
+ files=_files,
727
+ auth_settings=_auth_settings,
728
+ collection_formats=_collection_formats,
729
+ _host=_host,
730
+ _request_auth=_request_auth,
731
+ )
732
+
733
+ @validate_call
734
+ def list_templates(
735
+ self,
736
+ page: Annotated[int, Field(strict=True, ge=1)] | None = None,
737
+ limit: Annotated[int, Field(le=50, strict=True, ge=1)] | None = None,
738
+ query: Annotated[
739
+ Annotated[str, Field(min_length=1, strict=True)] | None,
740
+ Field(
741
+ description='Raw API filter query. Use AND between filters, for example: "name:Classic AND status:Available".'
742
+ ),
743
+ ] = None,
744
+ _request_timeout: Union[
745
+ None,
746
+ Annotated[StrictFloat, Field(gt=0)],
747
+ Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
748
+ ] = None,
749
+ _request_auth: Dict[StrictStr, Any] | None = None,
750
+ _content_type: StrictStr | None = None,
751
+ _headers: Dict[StrictStr, Any] | None = None,
752
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
753
+ ) -> DocumentTemplateListResponse:
754
+ """List Templates
755
+
756
+ Returns a paginated list of templates for the authenticated account.
757
+
758
+ :param page:
759
+ :type page: int
760
+ :param limit:
761
+ :type limit: int
762
+ :param query: Raw API filter query. Use AND between filters, for example: \"name:Classic AND status:Available\".
763
+ :type query: str
764
+ :param _request_timeout: timeout setting for this request. If one
765
+ number provided, it will be total request
766
+ timeout. It can also be a pair (tuple) of
767
+ (connection, read) timeouts.
768
+ :type _request_timeout: int, tuple(int, int), optional
769
+ :param _request_auth: set to override the auth_settings for an a single
770
+ request; this effectively ignores the
771
+ authentication in the spec for a single request.
772
+ :type _request_auth: dict, optional
773
+ :param _content_type: force content-type for the request.
774
+ :type _content_type: str, Optional
775
+ :param _headers: set to override the headers for a single
776
+ request; this effectively ignores the headers
777
+ in the spec for a single request.
778
+ :type _headers: dict, optional
779
+ :param _host_index: set to override the host_index for a single
780
+ request; this effectively ignores the host_index
781
+ in the spec for a single request.
782
+ :type _host_index: int, optional
783
+ :return: Returns the result object.
784
+ """ # noqa: E501
785
+
786
+ _param = self._list_templates_serialize(
787
+ page=page,
788
+ limit=limit,
789
+ query=query,
790
+ _request_auth=_request_auth,
791
+ _content_type=_content_type,
792
+ _headers=_headers,
793
+ _host_index=_host_index,
794
+ )
795
+
796
+ _response_types_map: Dict[str, str | None] = {
797
+ "200": "DocumentTemplateListResponse",
798
+ "401": "ErrorResponse",
799
+ "429": "RateLimitErrorResponse",
800
+ }
801
+
802
+ response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
803
+ response_data.read()
804
+ return self.api_client.response_deserialize(
805
+ response_data=response_data,
806
+ response_types_map=_response_types_map,
807
+ ).data
808
+
809
+ @validate_call
810
+ def list_templates_with_http_info(
811
+ self,
812
+ page: Annotated[int, Field(strict=True, ge=1)] | None = None,
813
+ limit: Annotated[int, Field(le=50, strict=True, ge=1)] | None = None,
814
+ query: Annotated[
815
+ Annotated[str, Field(min_length=1, strict=True)] | None,
816
+ Field(
817
+ description='Raw API filter query. Use AND between filters, for example: "name:Classic AND status:Available".'
818
+ ),
819
+ ] = None,
820
+ _request_timeout: Union[
821
+ None,
822
+ Annotated[StrictFloat, Field(gt=0)],
823
+ Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
824
+ ] = None,
825
+ _request_auth: Dict[StrictStr, Any] | None = None,
826
+ _content_type: StrictStr | None = None,
827
+ _headers: Dict[StrictStr, Any] | None = None,
828
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
829
+ ) -> ApiResponse[DocumentTemplateListResponse]:
830
+ """List Templates
831
+
832
+ Returns a paginated list of templates for the authenticated account.
833
+
834
+ :param page:
835
+ :type page: int
836
+ :param limit:
837
+ :type limit: int
838
+ :param query: Raw API filter query. Use AND between filters, for example: \"name:Classic AND status:Available\".
839
+ :type query: str
840
+ :param _request_timeout: timeout setting for this request. If one
841
+ number provided, it will be total request
842
+ timeout. It can also be a pair (tuple) of
843
+ (connection, read) timeouts.
844
+ :type _request_timeout: int, tuple(int, int), optional
845
+ :param _request_auth: set to override the auth_settings for an a single
846
+ request; this effectively ignores the
847
+ authentication in the spec for a single request.
848
+ :type _request_auth: dict, optional
849
+ :param _content_type: force content-type for the request.
850
+ :type _content_type: str, Optional
851
+ :param _headers: set to override the headers for a single
852
+ request; this effectively ignores the headers
853
+ in the spec for a single request.
854
+ :type _headers: dict, optional
855
+ :param _host_index: set to override the host_index for a single
856
+ request; this effectively ignores the host_index
857
+ in the spec for a single request.
858
+ :type _host_index: int, optional
859
+ :return: Returns the result object.
860
+ """ # noqa: E501
861
+
862
+ _param = self._list_templates_serialize(
863
+ page=page,
864
+ limit=limit,
865
+ query=query,
866
+ _request_auth=_request_auth,
867
+ _content_type=_content_type,
868
+ _headers=_headers,
869
+ _host_index=_host_index,
870
+ )
871
+
872
+ _response_types_map: Dict[str, str | None] = {
873
+ "200": "DocumentTemplateListResponse",
874
+ "401": "ErrorResponse",
875
+ "429": "RateLimitErrorResponse",
876
+ }
877
+
878
+ response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
879
+ response_data.read()
880
+ return self.api_client.response_deserialize(
881
+ response_data=response_data,
882
+ response_types_map=_response_types_map,
883
+ )
884
+
885
+ @validate_call
886
+ def list_templates_without_preload_content(
887
+ self,
888
+ page: Annotated[int, Field(strict=True, ge=1)] | None = None,
889
+ limit: Annotated[int, Field(le=50, strict=True, ge=1)] | None = None,
890
+ query: Annotated[
891
+ Annotated[str, Field(min_length=1, strict=True)] | None,
892
+ Field(
893
+ description='Raw API filter query. Use AND between filters, for example: "name:Classic AND status:Available".'
894
+ ),
895
+ ] = None,
896
+ _request_timeout: Union[
897
+ None,
898
+ Annotated[StrictFloat, Field(gt=0)],
899
+ Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
900
+ ] = None,
901
+ _request_auth: Dict[StrictStr, Any] | None = None,
902
+ _content_type: StrictStr | None = None,
903
+ _headers: Dict[StrictStr, Any] | None = None,
904
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
905
+ ) -> RESTResponseType:
906
+ """List Templates
907
+
908
+ Returns a paginated list of templates for the authenticated account.
909
+
910
+ :param page:
911
+ :type page: int
912
+ :param limit:
913
+ :type limit: int
914
+ :param query: Raw API filter query. Use AND between filters, for example: \"name:Classic AND status:Available\".
915
+ :type query: str
916
+ :param _request_timeout: timeout setting for this request. If one
917
+ number provided, it will be total request
918
+ timeout. It can also be a pair (tuple) of
919
+ (connection, read) timeouts.
920
+ :type _request_timeout: int, tuple(int, int), optional
921
+ :param _request_auth: set to override the auth_settings for an a single
922
+ request; this effectively ignores the
923
+ authentication in the spec for a single request.
924
+ :type _request_auth: dict, optional
925
+ :param _content_type: force content-type for the request.
926
+ :type _content_type: str, Optional
927
+ :param _headers: set to override the headers for a single
928
+ request; this effectively ignores the headers
929
+ in the spec for a single request.
930
+ :type _headers: dict, optional
931
+ :param _host_index: set to override the host_index for a single
932
+ request; this effectively ignores the host_index
933
+ in the spec for a single request.
934
+ :type _host_index: int, optional
935
+ :return: Returns the result object.
936
+ """ # noqa: E501
937
+
938
+ _param = self._list_templates_serialize(
939
+ page=page,
940
+ limit=limit,
941
+ query=query,
942
+ _request_auth=_request_auth,
943
+ _content_type=_content_type,
944
+ _headers=_headers,
945
+ _host_index=_host_index,
946
+ )
947
+
948
+ _response_types_map: Dict[str, str | None] = {
949
+ "200": "DocumentTemplateListResponse",
950
+ "401": "ErrorResponse",
951
+ "429": "RateLimitErrorResponse",
952
+ }
953
+
954
+ response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
955
+ return response_data.response
956
+
957
+ def _list_templates_serialize(
958
+ self,
959
+ page,
960
+ limit,
961
+ query,
962
+ _request_auth,
963
+ _content_type,
964
+ _headers,
965
+ _host_index,
966
+ ) -> RequestSerialized:
967
+
968
+ _host = None
969
+
970
+ _collection_formats: Dict[str, str] = {}
971
+
972
+ _path_params: Dict[str, str] = {}
973
+ _query_params: List[Tuple[str, str]] = []
974
+ _header_params: Dict[str, str | None] = _headers or {}
975
+ _form_params: List[Tuple[str, str]] = []
976
+ _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {}
977
+ _body_params: bytes | None = None
978
+
979
+ # process the path parameters
980
+ # process the query parameters
981
+ if page is not None:
982
+ _query_params.append(("page", page))
983
+
984
+ if limit is not None:
985
+ _query_params.append(("limit", limit))
986
+
987
+ if query is not None:
988
+ _query_params.append(("query", query))
989
+
990
+ # process the header parameters
991
+ # process the form parameters
992
+ # process the body parameter
993
+
994
+ # set the HTTP header `Accept`
995
+ if "Accept" not in _header_params:
996
+ _header_params["Accept"] = self.api_client.select_header_accept(["application/json"])
997
+
998
+ # authentication setting
999
+ _auth_settings: List[str] = ["api_key"]
1000
+
1001
+ return self.api_client.param_serialize(
1002
+ method="GET",
1003
+ resource_path="/api/v1/document_templates",
1004
+ path_params=_path_params,
1005
+ query_params=_query_params,
1006
+ header_params=_header_params,
1007
+ body=_body_params,
1008
+ post_params=_form_params,
1009
+ files=_files,
1010
+ auth_settings=_auth_settings,
1011
+ collection_formats=_collection_formats,
1012
+ _host=_host,
1013
+ _request_auth=_request_auth,
1014
+ )
1015
+
1016
+ @validate_call
1017
+ def update_template(
1018
+ self,
1019
+ id: Annotated[str, Field(min_length=1, strict=True)],
1020
+ document_template_update_request: DocumentTemplateUpdateRequest,
1021
+ _request_timeout: Union[
1022
+ None,
1023
+ Annotated[StrictFloat, Field(gt=0)],
1024
+ Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
1025
+ ] = None,
1026
+ _request_auth: Dict[StrictStr, Any] | None = None,
1027
+ _content_type: StrictStr | None = None,
1028
+ _headers: Dict[StrictStr, Any] | None = None,
1029
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1030
+ ) -> DocumentTemplateResponse:
1031
+ """Update Template
1032
+
1033
+ Updates an existing template.
1034
+
1035
+ :param id: (required)
1036
+ :type id: str
1037
+ :param document_template_update_request: (required)
1038
+ :type document_template_update_request: DocumentTemplateUpdateRequest
1039
+ :param _request_timeout: timeout setting for this request. If one
1040
+ number provided, it will be total request
1041
+ timeout. It can also be a pair (tuple) of
1042
+ (connection, read) timeouts.
1043
+ :type _request_timeout: int, tuple(int, int), optional
1044
+ :param _request_auth: set to override the auth_settings for an a single
1045
+ request; this effectively ignores the
1046
+ authentication in the spec for a single request.
1047
+ :type _request_auth: dict, optional
1048
+ :param _content_type: force content-type for the request.
1049
+ :type _content_type: str, Optional
1050
+ :param _headers: set to override the headers for a single
1051
+ request; this effectively ignores the headers
1052
+ in the spec for a single request.
1053
+ :type _headers: dict, optional
1054
+ :param _host_index: set to override the host_index for a single
1055
+ request; this effectively ignores the host_index
1056
+ in the spec for a single request.
1057
+ :type _host_index: int, optional
1058
+ :return: Returns the result object.
1059
+ """ # noqa: E501
1060
+
1061
+ _param = self._update_template_serialize(
1062
+ id=id,
1063
+ document_template_update_request=document_template_update_request,
1064
+ _request_auth=_request_auth,
1065
+ _content_type=_content_type,
1066
+ _headers=_headers,
1067
+ _host_index=_host_index,
1068
+ )
1069
+
1070
+ _response_types_map: Dict[str, str | None] = {
1071
+ "200": "DocumentTemplateResponse",
1072
+ "400": "ValidationErrorResponse",
1073
+ "422": "ValidationErrorResponse",
1074
+ "429": "RateLimitErrorResponse",
1075
+ }
1076
+
1077
+ response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
1078
+ response_data.read()
1079
+ return self.api_client.response_deserialize(
1080
+ response_data=response_data,
1081
+ response_types_map=_response_types_map,
1082
+ ).data
1083
+
1084
+ @validate_call
1085
+ def update_template_with_http_info(
1086
+ self,
1087
+ id: Annotated[str, Field(min_length=1, strict=True)],
1088
+ document_template_update_request: DocumentTemplateUpdateRequest,
1089
+ _request_timeout: Union[
1090
+ None,
1091
+ Annotated[StrictFloat, Field(gt=0)],
1092
+ Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
1093
+ ] = None,
1094
+ _request_auth: Dict[StrictStr, Any] | None = None,
1095
+ _content_type: StrictStr | None = None,
1096
+ _headers: Dict[StrictStr, Any] | None = None,
1097
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1098
+ ) -> ApiResponse[DocumentTemplateResponse]:
1099
+ """Update Template
1100
+
1101
+ Updates an existing template.
1102
+
1103
+ :param id: (required)
1104
+ :type id: str
1105
+ :param document_template_update_request: (required)
1106
+ :type document_template_update_request: DocumentTemplateUpdateRequest
1107
+ :param _request_timeout: timeout setting for this request. If one
1108
+ number provided, it will be total request
1109
+ timeout. It can also be a pair (tuple) of
1110
+ (connection, read) timeouts.
1111
+ :type _request_timeout: int, tuple(int, int), optional
1112
+ :param _request_auth: set to override the auth_settings for an a single
1113
+ request; this effectively ignores the
1114
+ authentication in the spec for a single request.
1115
+ :type _request_auth: dict, optional
1116
+ :param _content_type: force content-type for the request.
1117
+ :type _content_type: str, Optional
1118
+ :param _headers: set to override the headers for a single
1119
+ request; this effectively ignores the headers
1120
+ in the spec for a single request.
1121
+ :type _headers: dict, optional
1122
+ :param _host_index: set to override the host_index for a single
1123
+ request; this effectively ignores the host_index
1124
+ in the spec for a single request.
1125
+ :type _host_index: int, optional
1126
+ :return: Returns the result object.
1127
+ """ # noqa: E501
1128
+
1129
+ _param = self._update_template_serialize(
1130
+ id=id,
1131
+ document_template_update_request=document_template_update_request,
1132
+ _request_auth=_request_auth,
1133
+ _content_type=_content_type,
1134
+ _headers=_headers,
1135
+ _host_index=_host_index,
1136
+ )
1137
+
1138
+ _response_types_map: Dict[str, str | None] = {
1139
+ "200": "DocumentTemplateResponse",
1140
+ "400": "ValidationErrorResponse",
1141
+ "422": "ValidationErrorResponse",
1142
+ "429": "RateLimitErrorResponse",
1143
+ }
1144
+
1145
+ response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
1146
+ response_data.read()
1147
+ return self.api_client.response_deserialize(
1148
+ response_data=response_data,
1149
+ response_types_map=_response_types_map,
1150
+ )
1151
+
1152
+ @validate_call
1153
+ def update_template_without_preload_content(
1154
+ self,
1155
+ id: Annotated[str, Field(min_length=1, strict=True)],
1156
+ document_template_update_request: DocumentTemplateUpdateRequest,
1157
+ _request_timeout: Union[
1158
+ None,
1159
+ Annotated[StrictFloat, Field(gt=0)],
1160
+ Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
1161
+ ] = None,
1162
+ _request_auth: Dict[StrictStr, Any] | None = None,
1163
+ _content_type: StrictStr | None = None,
1164
+ _headers: Dict[StrictStr, Any] | None = None,
1165
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1166
+ ) -> RESTResponseType:
1167
+ """Update Template
1168
+
1169
+ Updates an existing template.
1170
+
1171
+ :param id: (required)
1172
+ :type id: str
1173
+ :param document_template_update_request: (required)
1174
+ :type document_template_update_request: DocumentTemplateUpdateRequest
1175
+ :param _request_timeout: timeout setting for this request. If one
1176
+ number provided, it will be total request
1177
+ timeout. It can also be a pair (tuple) of
1178
+ (connection, read) timeouts.
1179
+ :type _request_timeout: int, tuple(int, int), optional
1180
+ :param _request_auth: set to override the auth_settings for an a single
1181
+ request; this effectively ignores the
1182
+ authentication in the spec for a single request.
1183
+ :type _request_auth: dict, optional
1184
+ :param _content_type: force content-type for the request.
1185
+ :type _content_type: str, Optional
1186
+ :param _headers: set to override the headers for a single
1187
+ request; this effectively ignores the headers
1188
+ in the spec for a single request.
1189
+ :type _headers: dict, optional
1190
+ :param _host_index: set to override the host_index for a single
1191
+ request; this effectively ignores the host_index
1192
+ in the spec for a single request.
1193
+ :type _host_index: int, optional
1194
+ :return: Returns the result object.
1195
+ """ # noqa: E501
1196
+
1197
+ _param = self._update_template_serialize(
1198
+ id=id,
1199
+ document_template_update_request=document_template_update_request,
1200
+ _request_auth=_request_auth,
1201
+ _content_type=_content_type,
1202
+ _headers=_headers,
1203
+ _host_index=_host_index,
1204
+ )
1205
+
1206
+ _response_types_map: Dict[str, str | None] = {
1207
+ "200": "DocumentTemplateResponse",
1208
+ "400": "ValidationErrorResponse",
1209
+ "422": "ValidationErrorResponse",
1210
+ "429": "RateLimitErrorResponse",
1211
+ }
1212
+
1213
+ response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
1214
+ return response_data.response
1215
+
1216
+ def _update_template_serialize(
1217
+ self,
1218
+ id,
1219
+ document_template_update_request,
1220
+ _request_auth,
1221
+ _content_type,
1222
+ _headers,
1223
+ _host_index,
1224
+ ) -> RequestSerialized:
1225
+
1226
+ _host = None
1227
+
1228
+ _collection_formats: Dict[str, str] = {}
1229
+
1230
+ _path_params: Dict[str, str] = {}
1231
+ _query_params: List[Tuple[str, str]] = []
1232
+ _header_params: Dict[str, str | None] = _headers or {}
1233
+ _form_params: List[Tuple[str, str]] = []
1234
+ _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {}
1235
+ _body_params: bytes | None = None
1236
+
1237
+ # process the path parameters
1238
+ if id is not None:
1239
+ _path_params["id"] = id
1240
+ # process the query parameters
1241
+ # process the header parameters
1242
+ # process the form parameters
1243
+ # process the body parameter
1244
+ if document_template_update_request is not None:
1245
+ _body_params = document_template_update_request
1246
+
1247
+ # set the HTTP header `Accept`
1248
+ if "Accept" not in _header_params:
1249
+ _header_params["Accept"] = self.api_client.select_header_accept(["application/json"])
1250
+
1251
+ # set the HTTP header `Content-Type`
1252
+ if _content_type:
1253
+ _header_params["Content-Type"] = _content_type
1254
+ else:
1255
+ _default_content_type = self.api_client.select_header_content_type(["application/json"])
1256
+ if _default_content_type is not None:
1257
+ _header_params["Content-Type"] = _default_content_type
1258
+
1259
+ # authentication setting
1260
+ _auth_settings: List[str] = ["api_key"]
1261
+
1262
+ return self.api_client.param_serialize(
1263
+ method="PUT",
1264
+ resource_path="/api/v1/document_templates/{id}",
1265
+ path_params=_path_params,
1266
+ query_params=_query_params,
1267
+ header_params=_header_params,
1268
+ body=_body_params,
1269
+ post_params=_form_params,
1270
+ files=_files,
1271
+ auth_settings=_auth_settings,
1272
+ collection_formats=_collection_formats,
1273
+ _host=_host,
1274
+ _request_auth=_request_auth,
1275
+ )
1276
+
1277
+ def iterate_template_pages(
1278
+ self,
1279
+ page: int | None = 1,
1280
+ limit: int | None = 50,
1281
+ query: str | None = None,
1282
+ **kwargs: Any,
1283
+ ) -> Iterator[DocumentTemplateListResponse]:
1284
+ next_page: int | None = page or 1
1285
+ while next_page is not None:
1286
+ response = self.list_templates(page=next_page, limit=limit, query=query, **kwargs)
1287
+ yield response
1288
+ next_page = getattr(response, "next_page", None)
1289
+
1290
+ def iterate_templates(
1291
+ self,
1292
+ page: int | None = 1,
1293
+ limit: int | None = 50,
1294
+ query: str | None = None,
1295
+ **kwargs: Any,
1296
+ ) -> Iterator[Any]:
1297
+ for page_response in self.iterate_template_pages(page=page, limit=limit, query=query, **kwargs):
1298
+ yield from getattr(page_response, "templates", None) or []