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,246 @@
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.me_response import MeResponse
20
+ from signwell_sdk.api_client import ApiClient, RequestSerialized
21
+ from signwell_sdk.api_response import ApiResponse
22
+ from signwell_sdk.rest import RESTResponseType
23
+
24
+
25
+ class MeApi:
26
+ """NOTE: This class is auto generated by OpenAPI Generator
27
+ Ref: https://openapi-generator.tech
28
+
29
+ Do not edit the class manually.
30
+ """
31
+
32
+ def __init__(self, api_client=None) -> None:
33
+ if api_client is None:
34
+ api_client = ApiClient.get_default()
35
+ self.api_client = api_client
36
+
37
+ @validate_call
38
+ def get_me(
39
+ self,
40
+ _request_timeout: Union[
41
+ None,
42
+ Annotated[StrictFloat, Field(gt=0)],
43
+ Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
44
+ ] = None,
45
+ _request_auth: Dict[StrictStr, Any] | None = None,
46
+ _content_type: StrictStr | None = None,
47
+ _headers: Dict[StrictStr, Any] | None = None,
48
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
49
+ ) -> MeResponse:
50
+ """Get credentials
51
+
52
+ Retrieves the account information associated with the API key being used.
53
+
54
+ :param _request_timeout: timeout setting for this request. If one
55
+ number provided, it will be total request
56
+ timeout. It can also be a pair (tuple) of
57
+ (connection, read) timeouts.
58
+ :type _request_timeout: int, tuple(int, int), optional
59
+ :param _request_auth: set to override the auth_settings for an a single
60
+ request; this effectively ignores the
61
+ authentication in the spec for a single request.
62
+ :type _request_auth: dict, optional
63
+ :param _content_type: force content-type for the request.
64
+ :type _content_type: str, Optional
65
+ :param _headers: set to override the headers for a single
66
+ request; this effectively ignores the headers
67
+ in the spec for a single request.
68
+ :type _headers: dict, optional
69
+ :param _host_index: set to override the host_index for a single
70
+ request; this effectively ignores the host_index
71
+ in the spec for a single request.
72
+ :type _host_index: int, optional
73
+ :return: Returns the result object.
74
+ """ # noqa: E501
75
+
76
+ _param = self._get_me_serialize(
77
+ _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, _host_index=_host_index
78
+ )
79
+
80
+ _response_types_map: Dict[str, str | None] = {
81
+ "200": "MeResponse",
82
+ "401": "ErrorResponse",
83
+ "429": "RateLimitErrorResponse",
84
+ }
85
+
86
+ response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
87
+ response_data.read()
88
+ return self.api_client.response_deserialize(
89
+ response_data=response_data,
90
+ response_types_map=_response_types_map,
91
+ ).data
92
+
93
+ @validate_call
94
+ def get_me_with_http_info(
95
+ self,
96
+ _request_timeout: Union[
97
+ None,
98
+ Annotated[StrictFloat, Field(gt=0)],
99
+ Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
100
+ ] = None,
101
+ _request_auth: Dict[StrictStr, Any] | None = None,
102
+ _content_type: StrictStr | None = None,
103
+ _headers: Dict[StrictStr, Any] | None = None,
104
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
105
+ ) -> ApiResponse[MeResponse]:
106
+ """Get credentials
107
+
108
+ Retrieves the account information associated with the API key being used.
109
+
110
+ :param _request_timeout: timeout setting for this request. If one
111
+ number provided, it will be total request
112
+ timeout. It can also be a pair (tuple) of
113
+ (connection, read) timeouts.
114
+ :type _request_timeout: int, tuple(int, int), optional
115
+ :param _request_auth: set to override the auth_settings for an a single
116
+ request; this effectively ignores the
117
+ authentication in the spec for a single request.
118
+ :type _request_auth: dict, optional
119
+ :param _content_type: force content-type for the request.
120
+ :type _content_type: str, Optional
121
+ :param _headers: set to override the headers for a single
122
+ request; this effectively ignores the headers
123
+ in the spec for a single request.
124
+ :type _headers: dict, optional
125
+ :param _host_index: set to override the host_index for a single
126
+ request; this effectively ignores the host_index
127
+ in the spec for a single request.
128
+ :type _host_index: int, optional
129
+ :return: Returns the result object.
130
+ """ # noqa: E501
131
+
132
+ _param = self._get_me_serialize(
133
+ _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, _host_index=_host_index
134
+ )
135
+
136
+ _response_types_map: Dict[str, str | None] = {
137
+ "200": "MeResponse",
138
+ "401": "ErrorResponse",
139
+ "429": "RateLimitErrorResponse",
140
+ }
141
+
142
+ response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
143
+ response_data.read()
144
+ return self.api_client.response_deserialize(
145
+ response_data=response_data,
146
+ response_types_map=_response_types_map,
147
+ )
148
+
149
+ @validate_call
150
+ def get_me_without_preload_content(
151
+ self,
152
+ _request_timeout: Union[
153
+ None,
154
+ Annotated[StrictFloat, Field(gt=0)],
155
+ Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
156
+ ] = None,
157
+ _request_auth: Dict[StrictStr, Any] | None = None,
158
+ _content_type: StrictStr | None = None,
159
+ _headers: Dict[StrictStr, Any] | None = None,
160
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
161
+ ) -> RESTResponseType:
162
+ """Get credentials
163
+
164
+ Retrieves the account information associated with the API key being used.
165
+
166
+ :param _request_timeout: timeout setting for this request. If one
167
+ number provided, it will be total request
168
+ timeout. It can also be a pair (tuple) of
169
+ (connection, read) timeouts.
170
+ :type _request_timeout: int, tuple(int, int), optional
171
+ :param _request_auth: set to override the auth_settings for an a single
172
+ request; this effectively ignores the
173
+ authentication in the spec for a single request.
174
+ :type _request_auth: dict, optional
175
+ :param _content_type: force content-type for the request.
176
+ :type _content_type: str, Optional
177
+ :param _headers: set to override the headers for a single
178
+ request; this effectively ignores the headers
179
+ in the spec for a single request.
180
+ :type _headers: dict, optional
181
+ :param _host_index: set to override the host_index for a single
182
+ request; this effectively ignores the host_index
183
+ in the spec for a single request.
184
+ :type _host_index: int, optional
185
+ :return: Returns the result object.
186
+ """ # noqa: E501
187
+
188
+ _param = self._get_me_serialize(
189
+ _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, _host_index=_host_index
190
+ )
191
+
192
+ _response_types_map: Dict[str, str | None] = {
193
+ "200": "MeResponse",
194
+ "401": "ErrorResponse",
195
+ "429": "RateLimitErrorResponse",
196
+ }
197
+
198
+ response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
199
+ return response_data.response
200
+
201
+ def _get_me_serialize(
202
+ self,
203
+ _request_auth,
204
+ _content_type,
205
+ _headers,
206
+ _host_index,
207
+ ) -> RequestSerialized:
208
+
209
+ _host = None
210
+
211
+ _collection_formats: Dict[str, str] = {}
212
+
213
+ _path_params: Dict[str, str] = {}
214
+ _query_params: List[Tuple[str, str]] = []
215
+ _header_params: Dict[str, str | None] = _headers or {}
216
+ _form_params: List[Tuple[str, str]] = []
217
+ _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {}
218
+ _body_params: bytes | None = None
219
+
220
+ # process the path parameters
221
+ # process the query parameters
222
+ # process the header parameters
223
+ # process the form parameters
224
+ # process the body parameter
225
+
226
+ # set the HTTP header `Accept`
227
+ if "Accept" not in _header_params:
228
+ _header_params["Accept"] = self.api_client.select_header_accept(["application/json"])
229
+
230
+ # authentication setting
231
+ _auth_settings: List[str] = ["api_key"]
232
+
233
+ return self.api_client.param_serialize(
234
+ method="GET",
235
+ resource_path="/api/v1/me",
236
+ path_params=_path_params,
237
+ query_params=_query_params,
238
+ header_params=_header_params,
239
+ body=_body_params,
240
+ post_params=_form_params,
241
+ files=_files,
242
+ auth_settings=_auth_settings,
243
+ collection_formats=_collection_formats,
244
+ _host=_host,
245
+ _request_auth=_request_auth,
246
+ )
@@ -0,0 +1,345 @@
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, StrictBool
17
+ from typing import Any, Dict, List, Optional, Tuple, Union
18
+ from typing_extensions import Annotated
19
+ from signwell_sdk.models.nom151_url_response import Nom151UrlResponse
20
+ from signwell_sdk.models.nom151_certificate_response import Nom151CertificateResponse
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 RegionalApi:
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 get_nom151_certificate(
40
+ self,
41
+ id: Annotated[str, Field(min_length=1, strict=True)],
42
+ url_only: Annotated[
43
+ StrictBool | None,
44
+ Field(description="If true, returns JSON with download URL instead of downloading the file"),
45
+ ] = None,
46
+ object_only: StrictBool | None = None,
47
+ _request_timeout: Union[
48
+ None,
49
+ Annotated[StrictFloat, Field(gt=0)],
50
+ Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
51
+ ] = None,
52
+ _request_auth: Dict[StrictStr, Any] | None = None,
53
+ _content_type: StrictStr | None = None,
54
+ _headers: Dict[StrictStr, Any] | None = None,
55
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
56
+ ) -> bytes | Nom151UrlResponse | Nom151CertificateResponse:
57
+ """MX – NOM-151 Certificate
58
+
59
+ Download NOM-151 certificate for a completed document. Returns a ZIP file, download URL, or raw certificate data based on query parameters.
60
+
61
+ :param id: (required)
62
+ :type id: str
63
+ :param url_only: If true, returns JSON with download URL instead of downloading the file
64
+ :type url_only: bool
65
+ :param object_only:
66
+ :type object_only: bool
67
+ :param _request_timeout: timeout setting for this request. If one
68
+ number provided, it will be total request
69
+ timeout. It can also be a pair (tuple) of
70
+ (connection, read) timeouts.
71
+ :type _request_timeout: int, tuple(int, int), optional
72
+ :param _request_auth: set to override the auth_settings for an a single
73
+ request; this effectively ignores the
74
+ authentication in the spec for a single request.
75
+ :type _request_auth: dict, optional
76
+ :param _content_type: force content-type for the request.
77
+ :type _content_type: str, Optional
78
+ :param _headers: set to override the headers for a single
79
+ request; this effectively ignores the headers
80
+ in the spec for a single request.
81
+ :type _headers: dict, optional
82
+ :param _host_index: set to override the host_index for a single
83
+ request; this effectively ignores the host_index
84
+ in the spec for a single request.
85
+ :type _host_index: int, optional
86
+ :return: Returns the result object.
87
+ """ # noqa: E501
88
+ if url_only is True and object_only is True:
89
+ raise ValueError("get_nom151_certificate does not support url_only and object_only together.")
90
+
91
+ _param = self._get_nom151_certificate_serialize(
92
+ id=id,
93
+ url_only=url_only,
94
+ object_only=object_only,
95
+ _request_auth=_request_auth,
96
+ _content_type=_content_type,
97
+ _headers=_headers,
98
+ _host_index=_host_index,
99
+ )
100
+ if url_only is True:
101
+ _return_type = "Nom151UrlResponse"
102
+ elif object_only is True:
103
+ _return_type = "Nom151CertificateResponse"
104
+ else:
105
+ _return_type = "bytes"
106
+
107
+ _response_types_map: Dict[str, str | None] = {
108
+ "200": "Nom151UrlResponse",
109
+ "404": "ErrorResponse",
110
+ "422": "ValidationErrorResponse",
111
+ "429": "RateLimitErrorResponse",
112
+ }
113
+ _response_types_map["200"] = _return_type
114
+
115
+ response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
116
+ response_data.read()
117
+ return self.api_client.response_deserialize(
118
+ response_data=response_data,
119
+ response_types_map=_response_types_map,
120
+ ).data
121
+
122
+ @validate_call
123
+ def get_nom151_certificate_with_http_info(
124
+ self,
125
+ id: Annotated[str, Field(min_length=1, strict=True)],
126
+ url_only: Annotated[
127
+ StrictBool | None,
128
+ Field(description="If true, returns JSON with download URL instead of downloading the file"),
129
+ ] = None,
130
+ object_only: StrictBool | None = None,
131
+ _request_timeout: Union[
132
+ None,
133
+ Annotated[StrictFloat, Field(gt=0)],
134
+ Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
135
+ ] = None,
136
+ _request_auth: Dict[StrictStr, Any] | None = None,
137
+ _content_type: StrictStr | None = None,
138
+ _headers: Dict[StrictStr, Any] | None = None,
139
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
140
+ ) -> ApiResponse[bytes | Nom151UrlResponse | Nom151CertificateResponse]:
141
+ """MX – NOM-151 Certificate
142
+
143
+ Download NOM-151 certificate for a completed document. Returns a ZIP file, download URL, or raw certificate data based on query parameters.
144
+
145
+ :param id: (required)
146
+ :type id: str
147
+ :param url_only: If true, returns JSON with download URL instead of downloading the file
148
+ :type url_only: bool
149
+ :param object_only:
150
+ :type object_only: bool
151
+ :param _request_timeout: timeout setting for this request. If one
152
+ number provided, it will be total request
153
+ timeout. It can also be a pair (tuple) of
154
+ (connection, read) timeouts.
155
+ :type _request_timeout: int, tuple(int, int), optional
156
+ :param _request_auth: set to override the auth_settings for an a single
157
+ request; this effectively ignores the
158
+ authentication in the spec for a single request.
159
+ :type _request_auth: dict, optional
160
+ :param _content_type: force content-type for the request.
161
+ :type _content_type: str, Optional
162
+ :param _headers: set to override the headers for a single
163
+ request; this effectively ignores the headers
164
+ in the spec for a single request.
165
+ :type _headers: dict, optional
166
+ :param _host_index: set to override the host_index for a single
167
+ request; this effectively ignores the host_index
168
+ in the spec for a single request.
169
+ :type _host_index: int, optional
170
+ :return: Returns the result object.
171
+ """ # noqa: E501
172
+ if url_only is True and object_only is True:
173
+ raise ValueError("get_nom151_certificate does not support url_only and object_only together.")
174
+
175
+ _param = self._get_nom151_certificate_serialize(
176
+ id=id,
177
+ url_only=url_only,
178
+ object_only=object_only,
179
+ _request_auth=_request_auth,
180
+ _content_type=_content_type,
181
+ _headers=_headers,
182
+ _host_index=_host_index,
183
+ )
184
+ if url_only is True:
185
+ _return_type = "Nom151UrlResponse"
186
+ elif object_only is True:
187
+ _return_type = "Nom151CertificateResponse"
188
+ else:
189
+ _return_type = "bytes"
190
+
191
+ _response_types_map: Dict[str, str | None] = {
192
+ "200": "Nom151UrlResponse",
193
+ "404": "ErrorResponse",
194
+ "422": "ValidationErrorResponse",
195
+ "429": "RateLimitErrorResponse",
196
+ }
197
+ _response_types_map["200"] = _return_type
198
+
199
+ response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
200
+ response_data.read()
201
+ return self.api_client.response_deserialize(
202
+ response_data=response_data,
203
+ response_types_map=_response_types_map,
204
+ )
205
+
206
+ @validate_call
207
+ def get_nom151_certificate_without_preload_content(
208
+ self,
209
+ id: Annotated[str, Field(min_length=1, strict=True)],
210
+ url_only: Annotated[
211
+ StrictBool | None,
212
+ Field(description="If true, returns JSON with download URL instead of downloading the file"),
213
+ ] = None,
214
+ object_only: StrictBool | None = None,
215
+ _request_timeout: Union[
216
+ None,
217
+ Annotated[StrictFloat, Field(gt=0)],
218
+ Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
219
+ ] = None,
220
+ _request_auth: Dict[StrictStr, Any] | None = None,
221
+ _content_type: StrictStr | None = None,
222
+ _headers: Dict[StrictStr, Any] | None = None,
223
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
224
+ ) -> RESTResponseType:
225
+ """MX – NOM-151 Certificate
226
+
227
+ Download NOM-151 certificate for a completed document. Returns a ZIP file, download URL, or raw certificate data based on query parameters.
228
+
229
+ :param id: (required)
230
+ :type id: str
231
+ :param url_only: If true, returns JSON with download URL instead of downloading the file
232
+ :type url_only: bool
233
+ :param object_only:
234
+ :type object_only: bool
235
+ :param _request_timeout: timeout setting for this request. If one
236
+ number provided, it will be total request
237
+ timeout. It can also be a pair (tuple) of
238
+ (connection, read) timeouts.
239
+ :type _request_timeout: int, tuple(int, int), optional
240
+ :param _request_auth: set to override the auth_settings for an a single
241
+ request; this effectively ignores the
242
+ authentication in the spec for a single request.
243
+ :type _request_auth: dict, optional
244
+ :param _content_type: force content-type for the request.
245
+ :type _content_type: str, Optional
246
+ :param _headers: set to override the headers for a single
247
+ request; this effectively ignores the headers
248
+ in the spec for a single request.
249
+ :type _headers: dict, optional
250
+ :param _host_index: set to override the host_index for a single
251
+ request; this effectively ignores the host_index
252
+ in the spec for a single request.
253
+ :type _host_index: int, optional
254
+ :return: Returns the result object.
255
+ """ # noqa: E501
256
+ if url_only is True and object_only is True:
257
+ raise ValueError("get_nom151_certificate does not support url_only and object_only together.")
258
+
259
+ _param = self._get_nom151_certificate_serialize(
260
+ id=id,
261
+ url_only=url_only,
262
+ object_only=object_only,
263
+ _request_auth=_request_auth,
264
+ _content_type=_content_type,
265
+ _headers=_headers,
266
+ _host_index=_host_index,
267
+ )
268
+ if url_only is True:
269
+ _return_type = "Nom151UrlResponse"
270
+ elif object_only is True:
271
+ _return_type = "Nom151CertificateResponse"
272
+ else:
273
+ _return_type = "bytes"
274
+
275
+ _response_types_map: Dict[str, str | None] = {
276
+ "200": "Nom151UrlResponse",
277
+ "404": "ErrorResponse",
278
+ "422": "ValidationErrorResponse",
279
+ "429": "RateLimitErrorResponse",
280
+ }
281
+ _response_types_map["200"] = _return_type
282
+
283
+ response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
284
+ return response_data.response
285
+
286
+ def _get_nom151_certificate_serialize(
287
+ self,
288
+ id,
289
+ url_only,
290
+ object_only,
291
+ _request_auth,
292
+ _content_type,
293
+ _headers,
294
+ _host_index,
295
+ ) -> RequestSerialized:
296
+
297
+ _host = None
298
+
299
+ _collection_formats: Dict[str, str] = {}
300
+
301
+ _path_params: Dict[str, str] = {}
302
+ _query_params: List[Tuple[str, str]] = []
303
+ _header_params: Dict[str, str | None] = _headers or {}
304
+ _form_params: List[Tuple[str, str]] = []
305
+ _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {}
306
+ _body_params: bytes | None = None
307
+
308
+ # process the path parameters
309
+ if id is not None:
310
+ _path_params["id"] = id
311
+ # process the query parameters
312
+ if url_only is not None:
313
+ _query_params.append(("url_only", url_only))
314
+
315
+ if object_only is not None:
316
+ _query_params.append(("object_only", object_only))
317
+
318
+ # process the header parameters
319
+ # process the form parameters
320
+ # process the body parameter
321
+
322
+ # set the HTTP header `Accept`
323
+ if "Accept" not in _header_params:
324
+ if url_only is True or object_only is True:
325
+ _header_params["Accept"] = "application/json"
326
+ else:
327
+ _header_params["Accept"] = "application/octet-stream"
328
+
329
+ # authentication setting
330
+ _auth_settings: List[str] = ["api_key"]
331
+
332
+ return self.api_client.param_serialize(
333
+ method="GET",
334
+ resource_path="/api/v1/documents/{id}/nom151_certificate",
335
+ path_params=_path_params,
336
+ query_params=_query_params,
337
+ header_params=_header_params,
338
+ body=_body_params,
339
+ post_params=_form_params,
340
+ files=_files,
341
+ auth_settings=_auth_settings,
342
+ collection_formats=_collection_formats,
343
+ _host=_host,
344
+ _request_auth=_request_auth,
345
+ )