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