docspring 3.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.
- docspring/__init__.py +250 -0
- docspring/api/__init__.py +20 -0
- docspring/api/client.py +13430 -0
- docspring/api_client.py +805 -0
- docspring/api_response.py +21 -0
- docspring/configuration.py +598 -0
- docspring/exceptions.py +217 -0
- docspring/models/__init__.py +146 -0
- docspring/models/add_fields_data.py +88 -0
- docspring/models/batch_generate_pdfs201_response.py +111 -0
- docspring/models/combine_pdfs_data.py +98 -0
- docspring/models/combined_submission.py +173 -0
- docspring/models/combined_submission_action.py +156 -0
- docspring/models/copy_template_options.py +92 -0
- docspring/models/create_combined_submission_response.py +107 -0
- docspring/models/create_custom_file_data.py +89 -0
- docspring/models/create_custom_file_response.py +107 -0
- docspring/models/create_folder_data.py +88 -0
- docspring/models/create_html_template.py +88 -0
- docspring/models/create_pdf_submission_data.py +112 -0
- docspring/models/create_pdf_template.py +88 -0
- docspring/models/create_submission_data_request_data.py +187 -0
- docspring/models/create_submission_data_request_event_request.py +134 -0
- docspring/models/create_submission_data_request_event_response.py +107 -0
- docspring/models/create_submission_data_request_response.py +107 -0
- docspring/models/create_submission_data_request_token_response.py +107 -0
- docspring/models/create_submission_response.py +107 -0
- docspring/models/create_webhook_data.py +88 -0
- docspring/models/custom_file.py +100 -0
- docspring/models/error_or_multiple_errors_response.py +103 -0
- docspring/models/error_response.py +101 -0
- docspring/models/folder.py +114 -0
- docspring/models/json_schema.py +110 -0
- docspring/models/list_submissions_response.py +105 -0
- docspring/models/move_folder_data.py +93 -0
- docspring/models/move_template_data.py +95 -0
- docspring/models/multiple_errors_response.py +101 -0
- docspring/models/publish_version_data.py +90 -0
- docspring/models/rename_folder_data.py +88 -0
- docspring/models/restore_version_data.py +88 -0
- docspring/models/submission.py +287 -0
- docspring/models/submission422_response.py +109 -0
- docspring/models/submission_action.py +148 -0
- docspring/models/submission_batch.py +123 -0
- docspring/models/submission_batch_data.py +106 -0
- docspring/models/submission_batch_with_submissions.py +133 -0
- docspring/models/submission_data_request.py +253 -0
- docspring/models/submission_data_request_event.py +155 -0
- docspring/models/submission_data_request_show.py +260 -0
- docspring/models/submission_data_request_token.py +109 -0
- docspring/models/submission_preview.py +257 -0
- docspring/models/success_error_response.py +101 -0
- docspring/models/success_multiple_errors_response.py +101 -0
- docspring/models/template.py +402 -0
- docspring/models/template_add_fields_response.py +103 -0
- docspring/models/template_delete_response.py +110 -0
- docspring/models/template_model_code_response.py +103 -0
- docspring/models/template_preview.py +356 -0
- docspring/models/template_publish_version_response.py +103 -0
- docspring/models/update_html_template.py +88 -0
- docspring/models/update_pdf_template.py +88 -0
- docspring/models/update_submission_data_request_data.py +185 -0
- docspring/models/update_webhook_data.py +88 -0
- docspring/models/upload_presign_response.py +108 -0
- docspring/models/webhook.py +185 -0
- docspring/py.typed +0 -0
- docspring/rest.py +259 -0
- docspring-3.1.0.dist-info/METADATA +245 -0
- docspring-3.1.0.dist-info/RECORD +72 -0
- docspring-3.1.0.dist-info/WHEEL +5 -0
- docspring-3.1.0.dist-info/licenses/LICENSE +7 -0
- docspring-3.1.0.dist-info/top_level.txt +1 -0
docspring/exceptions.py
ADDED
|
@@ -0,0 +1,217 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
"""
|
|
4
|
+
DocSpring API
|
|
5
|
+
|
|
6
|
+
Use DocSpring's API to programmatically fill out PDF forms, convert HTML to PDFs, merge PDFs, or request legally binding e-signatures.
|
|
7
|
+
|
|
8
|
+
The version of the OpenAPI document: v1
|
|
9
|
+
Contact: support@docspring.com
|
|
10
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
|
11
|
+
|
|
12
|
+
Do not edit the class manually.
|
|
13
|
+
""" # noqa: E501
|
|
14
|
+
|
|
15
|
+
from typing import Any, Optional
|
|
16
|
+
from typing_extensions import Self
|
|
17
|
+
|
|
18
|
+
class OpenApiException(Exception):
|
|
19
|
+
"""The base exception class for all OpenAPIExceptions"""
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
class ApiTypeError(OpenApiException, TypeError):
|
|
23
|
+
def __init__(self, msg, path_to_item=None, valid_classes=None,
|
|
24
|
+
key_type=None) -> None:
|
|
25
|
+
""" Raises an exception for TypeErrors
|
|
26
|
+
|
|
27
|
+
Args:
|
|
28
|
+
msg (str): the exception message
|
|
29
|
+
|
|
30
|
+
Keyword Args:
|
|
31
|
+
path_to_item (list): a list of keys an indices to get to the
|
|
32
|
+
current_item
|
|
33
|
+
None if unset
|
|
34
|
+
valid_classes (tuple): the primitive classes that current item
|
|
35
|
+
should be an instance of
|
|
36
|
+
None if unset
|
|
37
|
+
key_type (bool): False if our value is a value in a dict
|
|
38
|
+
True if it is a key in a dict
|
|
39
|
+
False if our item is an item in a list
|
|
40
|
+
None if unset
|
|
41
|
+
"""
|
|
42
|
+
self.path_to_item = path_to_item
|
|
43
|
+
self.valid_classes = valid_classes
|
|
44
|
+
self.key_type = key_type
|
|
45
|
+
full_msg = msg
|
|
46
|
+
if path_to_item:
|
|
47
|
+
full_msg = "{0} at {1}".format(msg, render_path(path_to_item))
|
|
48
|
+
super(ApiTypeError, self).__init__(full_msg)
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
class ApiValueError(OpenApiException, ValueError):
|
|
52
|
+
def __init__(self, msg, path_to_item=None) -> None:
|
|
53
|
+
"""
|
|
54
|
+
Args:
|
|
55
|
+
msg (str): the exception message
|
|
56
|
+
|
|
57
|
+
Keyword Args:
|
|
58
|
+
path_to_item (list) the path to the exception in the
|
|
59
|
+
received_data dict. None if unset
|
|
60
|
+
"""
|
|
61
|
+
|
|
62
|
+
self.path_to_item = path_to_item
|
|
63
|
+
full_msg = msg
|
|
64
|
+
if path_to_item:
|
|
65
|
+
full_msg = "{0} at {1}".format(msg, render_path(path_to_item))
|
|
66
|
+
super(ApiValueError, self).__init__(full_msg)
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
class ApiAttributeError(OpenApiException, AttributeError):
|
|
70
|
+
def __init__(self, msg, path_to_item=None) -> None:
|
|
71
|
+
"""
|
|
72
|
+
Raised when an attribute reference or assignment fails.
|
|
73
|
+
|
|
74
|
+
Args:
|
|
75
|
+
msg (str): the exception message
|
|
76
|
+
|
|
77
|
+
Keyword Args:
|
|
78
|
+
path_to_item (None/list) the path to the exception in the
|
|
79
|
+
received_data dict
|
|
80
|
+
"""
|
|
81
|
+
self.path_to_item = path_to_item
|
|
82
|
+
full_msg = msg
|
|
83
|
+
if path_to_item:
|
|
84
|
+
full_msg = "{0} at {1}".format(msg, render_path(path_to_item))
|
|
85
|
+
super(ApiAttributeError, self).__init__(full_msg)
|
|
86
|
+
|
|
87
|
+
|
|
88
|
+
class ApiKeyError(OpenApiException, KeyError):
|
|
89
|
+
def __init__(self, msg, path_to_item=None) -> None:
|
|
90
|
+
"""
|
|
91
|
+
Args:
|
|
92
|
+
msg (str): the exception message
|
|
93
|
+
|
|
94
|
+
Keyword Args:
|
|
95
|
+
path_to_item (None/list) the path to the exception in the
|
|
96
|
+
received_data dict
|
|
97
|
+
"""
|
|
98
|
+
self.path_to_item = path_to_item
|
|
99
|
+
full_msg = msg
|
|
100
|
+
if path_to_item:
|
|
101
|
+
full_msg = "{0} at {1}".format(msg, render_path(path_to_item))
|
|
102
|
+
super(ApiKeyError, self).__init__(full_msg)
|
|
103
|
+
|
|
104
|
+
|
|
105
|
+
class ApiException(OpenApiException):
|
|
106
|
+
|
|
107
|
+
def __init__(
|
|
108
|
+
self,
|
|
109
|
+
status=None,
|
|
110
|
+
reason=None,
|
|
111
|
+
http_resp=None,
|
|
112
|
+
*,
|
|
113
|
+
body: Optional[str] = None,
|
|
114
|
+
data: Optional[Any] = None,
|
|
115
|
+
) -> None:
|
|
116
|
+
self.status = status
|
|
117
|
+
self.reason = reason
|
|
118
|
+
self.body = body
|
|
119
|
+
self.data = data
|
|
120
|
+
self.headers = None
|
|
121
|
+
|
|
122
|
+
if http_resp:
|
|
123
|
+
if self.status is None:
|
|
124
|
+
self.status = http_resp.status
|
|
125
|
+
if self.reason is None:
|
|
126
|
+
self.reason = http_resp.reason
|
|
127
|
+
if self.body is None:
|
|
128
|
+
try:
|
|
129
|
+
self.body = http_resp.data.decode('utf-8')
|
|
130
|
+
except Exception:
|
|
131
|
+
pass
|
|
132
|
+
self.headers = http_resp.getheaders()
|
|
133
|
+
|
|
134
|
+
@classmethod
|
|
135
|
+
def from_response(
|
|
136
|
+
cls,
|
|
137
|
+
*,
|
|
138
|
+
http_resp,
|
|
139
|
+
body: Optional[str],
|
|
140
|
+
data: Optional[Any],
|
|
141
|
+
) -> Self:
|
|
142
|
+
if http_resp.status == 400:
|
|
143
|
+
raise BadRequestException(http_resp=http_resp, body=body, data=data)
|
|
144
|
+
|
|
145
|
+
if http_resp.status == 401:
|
|
146
|
+
raise UnauthorizedException(http_resp=http_resp, body=body, data=data)
|
|
147
|
+
|
|
148
|
+
if http_resp.status == 403:
|
|
149
|
+
raise ForbiddenException(http_resp=http_resp, body=body, data=data)
|
|
150
|
+
|
|
151
|
+
if http_resp.status == 404:
|
|
152
|
+
raise NotFoundException(http_resp=http_resp, body=body, data=data)
|
|
153
|
+
|
|
154
|
+
# Added new conditions for 409 and 422
|
|
155
|
+
if http_resp.status == 409:
|
|
156
|
+
raise ConflictException(http_resp=http_resp, body=body, data=data)
|
|
157
|
+
|
|
158
|
+
if http_resp.status == 422:
|
|
159
|
+
raise UnprocessableEntityException(http_resp=http_resp, body=body, data=data)
|
|
160
|
+
|
|
161
|
+
if 500 <= http_resp.status <= 599:
|
|
162
|
+
raise ServiceException(http_resp=http_resp, body=body, data=data)
|
|
163
|
+
raise ApiException(http_resp=http_resp, body=body, data=data)
|
|
164
|
+
|
|
165
|
+
def __str__(self):
|
|
166
|
+
"""Custom error messages for exception"""
|
|
167
|
+
error_message = "({0})\n"\
|
|
168
|
+
"Reason: {1}\n".format(self.status, self.reason)
|
|
169
|
+
if self.headers:
|
|
170
|
+
error_message += "HTTP response headers: {0}\n".format(
|
|
171
|
+
self.headers)
|
|
172
|
+
|
|
173
|
+
if self.data or self.body:
|
|
174
|
+
error_message += "HTTP response body: {0}\n".format(self.data or self.body)
|
|
175
|
+
|
|
176
|
+
return error_message
|
|
177
|
+
|
|
178
|
+
|
|
179
|
+
class BadRequestException(ApiException):
|
|
180
|
+
pass
|
|
181
|
+
|
|
182
|
+
|
|
183
|
+
class NotFoundException(ApiException):
|
|
184
|
+
pass
|
|
185
|
+
|
|
186
|
+
|
|
187
|
+
class UnauthorizedException(ApiException):
|
|
188
|
+
pass
|
|
189
|
+
|
|
190
|
+
|
|
191
|
+
class ForbiddenException(ApiException):
|
|
192
|
+
pass
|
|
193
|
+
|
|
194
|
+
|
|
195
|
+
class ServiceException(ApiException):
|
|
196
|
+
pass
|
|
197
|
+
|
|
198
|
+
|
|
199
|
+
class ConflictException(ApiException):
|
|
200
|
+
"""Exception for HTTP 409 Conflict."""
|
|
201
|
+
pass
|
|
202
|
+
|
|
203
|
+
|
|
204
|
+
class UnprocessableEntityException(ApiException):
|
|
205
|
+
"""Exception for HTTP 422 Unprocessable Entity."""
|
|
206
|
+
pass
|
|
207
|
+
|
|
208
|
+
|
|
209
|
+
def render_path(path_to_item):
|
|
210
|
+
"""Returns a string representation of a path"""
|
|
211
|
+
result = ""
|
|
212
|
+
for pth in path_to_item:
|
|
213
|
+
if isinstance(pth, int):
|
|
214
|
+
result += "[{0}]".format(pth)
|
|
215
|
+
else:
|
|
216
|
+
result += "['{0}']".format(pth)
|
|
217
|
+
return result
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
# flake8: noqa
|
|
4
|
+
"""
|
|
5
|
+
DocSpring API
|
|
6
|
+
|
|
7
|
+
Use DocSpring's API to programmatically fill out PDF forms, convert HTML to PDFs, merge PDFs, or request legally binding e-signatures.
|
|
8
|
+
|
|
9
|
+
The version of the OpenAPI document: v1
|
|
10
|
+
Contact: support@docspring.com
|
|
11
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
|
12
|
+
|
|
13
|
+
Do not edit the class manually.
|
|
14
|
+
""" # noqa: E501
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
if __import__("typing").TYPE_CHECKING:
|
|
18
|
+
# import models into model package
|
|
19
|
+
from docspring.models.add_fields_data import AddFieldsData
|
|
20
|
+
from docspring.models.batch_generate_pdfs201_response import BatchGeneratePdfs201Response
|
|
21
|
+
from docspring.models.combine_pdfs_data import CombinePdfsData
|
|
22
|
+
from docspring.models.combined_submission import CombinedSubmission
|
|
23
|
+
from docspring.models.combined_submission_action import CombinedSubmissionAction
|
|
24
|
+
from docspring.models.copy_template_options import CopyTemplateOptions
|
|
25
|
+
from docspring.models.create_combined_submission_response import CreateCombinedSubmissionResponse
|
|
26
|
+
from docspring.models.create_custom_file_data import CreateCustomFileData
|
|
27
|
+
from docspring.models.create_custom_file_response import CreateCustomFileResponse
|
|
28
|
+
from docspring.models.create_folder_data import CreateFolderData
|
|
29
|
+
from docspring.models.create_html_template import CreateHtmlTemplate
|
|
30
|
+
from docspring.models.create_pdf_submission_data import CreatePdfSubmissionData
|
|
31
|
+
from docspring.models.create_pdf_template import CreatePdfTemplate
|
|
32
|
+
from docspring.models.create_submission_data_request_data import CreateSubmissionDataRequestData
|
|
33
|
+
from docspring.models.create_submission_data_request_event_request import CreateSubmissionDataRequestEventRequest
|
|
34
|
+
from docspring.models.create_submission_data_request_event_response import CreateSubmissionDataRequestEventResponse
|
|
35
|
+
from docspring.models.create_submission_data_request_response import CreateSubmissionDataRequestResponse
|
|
36
|
+
from docspring.models.create_submission_data_request_token_response import CreateSubmissionDataRequestTokenResponse
|
|
37
|
+
from docspring.models.create_submission_response import CreateSubmissionResponse
|
|
38
|
+
from docspring.models.create_webhook_data import CreateWebhookData
|
|
39
|
+
from docspring.models.custom_file import CustomFile
|
|
40
|
+
from docspring.models.error_or_multiple_errors_response import ErrorOrMultipleErrorsResponse
|
|
41
|
+
from docspring.models.error_response import ErrorResponse
|
|
42
|
+
from docspring.models.folder import Folder
|
|
43
|
+
from docspring.models.json_schema import JsonSchema
|
|
44
|
+
from docspring.models.list_submissions_response import ListSubmissionsResponse
|
|
45
|
+
from docspring.models.move_folder_data import MoveFolderData
|
|
46
|
+
from docspring.models.move_template_data import MoveTemplateData
|
|
47
|
+
from docspring.models.multiple_errors_response import MultipleErrorsResponse
|
|
48
|
+
from docspring.models.publish_version_data import PublishVersionData
|
|
49
|
+
from docspring.models.rename_folder_data import RenameFolderData
|
|
50
|
+
from docspring.models.restore_version_data import RestoreVersionData
|
|
51
|
+
from docspring.models.submission import Submission
|
|
52
|
+
from docspring.models.submission422_response import Submission422Response
|
|
53
|
+
from docspring.models.submission_action import SubmissionAction
|
|
54
|
+
from docspring.models.submission_batch import SubmissionBatch
|
|
55
|
+
from docspring.models.submission_batch_data import SubmissionBatchData
|
|
56
|
+
from docspring.models.submission_batch_with_submissions import SubmissionBatchWithSubmissions
|
|
57
|
+
from docspring.models.submission_data_request import SubmissionDataRequest
|
|
58
|
+
from docspring.models.submission_data_request_event import SubmissionDataRequestEvent
|
|
59
|
+
from docspring.models.submission_data_request_show import SubmissionDataRequestShow
|
|
60
|
+
from docspring.models.submission_data_request_token import SubmissionDataRequestToken
|
|
61
|
+
from docspring.models.submission_preview import SubmissionPreview
|
|
62
|
+
from docspring.models.success_error_response import SuccessErrorResponse
|
|
63
|
+
from docspring.models.success_multiple_errors_response import SuccessMultipleErrorsResponse
|
|
64
|
+
from docspring.models.template import Template
|
|
65
|
+
from docspring.models.template_add_fields_response import TemplateAddFieldsResponse
|
|
66
|
+
from docspring.models.template_delete_response import TemplateDeleteResponse
|
|
67
|
+
from docspring.models.template_model_code_response import TemplateModelCodeResponse
|
|
68
|
+
from docspring.models.template_preview import TemplatePreview
|
|
69
|
+
from docspring.models.template_publish_version_response import TemplatePublishVersionResponse
|
|
70
|
+
from docspring.models.update_html_template import UpdateHtmlTemplate
|
|
71
|
+
from docspring.models.update_pdf_template import UpdatePdfTemplate
|
|
72
|
+
from docspring.models.update_submission_data_request_data import UpdateSubmissionDataRequestData
|
|
73
|
+
from docspring.models.update_webhook_data import UpdateWebhookData
|
|
74
|
+
from docspring.models.upload_presign_response import UploadPresignResponse
|
|
75
|
+
from docspring.models.webhook import Webhook
|
|
76
|
+
|
|
77
|
+
else:
|
|
78
|
+
from lazy_imports import LazyModule, as_package, load
|
|
79
|
+
|
|
80
|
+
load(
|
|
81
|
+
LazyModule(
|
|
82
|
+
*as_package(__file__),
|
|
83
|
+
"""# import models into model package
|
|
84
|
+
from docspring.models.add_fields_data import AddFieldsData
|
|
85
|
+
from docspring.models.batch_generate_pdfs201_response import BatchGeneratePdfs201Response
|
|
86
|
+
from docspring.models.combine_pdfs_data import CombinePdfsData
|
|
87
|
+
from docspring.models.combined_submission import CombinedSubmission
|
|
88
|
+
from docspring.models.combined_submission_action import CombinedSubmissionAction
|
|
89
|
+
from docspring.models.copy_template_options import CopyTemplateOptions
|
|
90
|
+
from docspring.models.create_combined_submission_response import CreateCombinedSubmissionResponse
|
|
91
|
+
from docspring.models.create_custom_file_data import CreateCustomFileData
|
|
92
|
+
from docspring.models.create_custom_file_response import CreateCustomFileResponse
|
|
93
|
+
from docspring.models.create_folder_data import CreateFolderData
|
|
94
|
+
from docspring.models.create_html_template import CreateHtmlTemplate
|
|
95
|
+
from docspring.models.create_pdf_submission_data import CreatePdfSubmissionData
|
|
96
|
+
from docspring.models.create_pdf_template import CreatePdfTemplate
|
|
97
|
+
from docspring.models.create_submission_data_request_data import CreateSubmissionDataRequestData
|
|
98
|
+
from docspring.models.create_submission_data_request_event_request import CreateSubmissionDataRequestEventRequest
|
|
99
|
+
from docspring.models.create_submission_data_request_event_response import CreateSubmissionDataRequestEventResponse
|
|
100
|
+
from docspring.models.create_submission_data_request_response import CreateSubmissionDataRequestResponse
|
|
101
|
+
from docspring.models.create_submission_data_request_token_response import CreateSubmissionDataRequestTokenResponse
|
|
102
|
+
from docspring.models.create_submission_response import CreateSubmissionResponse
|
|
103
|
+
from docspring.models.create_webhook_data import CreateWebhookData
|
|
104
|
+
from docspring.models.custom_file import CustomFile
|
|
105
|
+
from docspring.models.error_or_multiple_errors_response import ErrorOrMultipleErrorsResponse
|
|
106
|
+
from docspring.models.error_response import ErrorResponse
|
|
107
|
+
from docspring.models.folder import Folder
|
|
108
|
+
from docspring.models.json_schema import JsonSchema
|
|
109
|
+
from docspring.models.list_submissions_response import ListSubmissionsResponse
|
|
110
|
+
from docspring.models.move_folder_data import MoveFolderData
|
|
111
|
+
from docspring.models.move_template_data import MoveTemplateData
|
|
112
|
+
from docspring.models.multiple_errors_response import MultipleErrorsResponse
|
|
113
|
+
from docspring.models.publish_version_data import PublishVersionData
|
|
114
|
+
from docspring.models.rename_folder_data import RenameFolderData
|
|
115
|
+
from docspring.models.restore_version_data import RestoreVersionData
|
|
116
|
+
from docspring.models.submission import Submission
|
|
117
|
+
from docspring.models.submission422_response import Submission422Response
|
|
118
|
+
from docspring.models.submission_action import SubmissionAction
|
|
119
|
+
from docspring.models.submission_batch import SubmissionBatch
|
|
120
|
+
from docspring.models.submission_batch_data import SubmissionBatchData
|
|
121
|
+
from docspring.models.submission_batch_with_submissions import SubmissionBatchWithSubmissions
|
|
122
|
+
from docspring.models.submission_data_request import SubmissionDataRequest
|
|
123
|
+
from docspring.models.submission_data_request_event import SubmissionDataRequestEvent
|
|
124
|
+
from docspring.models.submission_data_request_show import SubmissionDataRequestShow
|
|
125
|
+
from docspring.models.submission_data_request_token import SubmissionDataRequestToken
|
|
126
|
+
from docspring.models.submission_preview import SubmissionPreview
|
|
127
|
+
from docspring.models.success_error_response import SuccessErrorResponse
|
|
128
|
+
from docspring.models.success_multiple_errors_response import SuccessMultipleErrorsResponse
|
|
129
|
+
from docspring.models.template import Template
|
|
130
|
+
from docspring.models.template_add_fields_response import TemplateAddFieldsResponse
|
|
131
|
+
from docspring.models.template_delete_response import TemplateDeleteResponse
|
|
132
|
+
from docspring.models.template_model_code_response import TemplateModelCodeResponse
|
|
133
|
+
from docspring.models.template_preview import TemplatePreview
|
|
134
|
+
from docspring.models.template_publish_version_response import TemplatePublishVersionResponse
|
|
135
|
+
from docspring.models.update_html_template import UpdateHtmlTemplate
|
|
136
|
+
from docspring.models.update_pdf_template import UpdatePdfTemplate
|
|
137
|
+
from docspring.models.update_submission_data_request_data import UpdateSubmissionDataRequestData
|
|
138
|
+
from docspring.models.update_webhook_data import UpdateWebhookData
|
|
139
|
+
from docspring.models.upload_presign_response import UploadPresignResponse
|
|
140
|
+
from docspring.models.webhook import Webhook
|
|
141
|
+
|
|
142
|
+
""",
|
|
143
|
+
name=__name__,
|
|
144
|
+
doc=__doc__,
|
|
145
|
+
)
|
|
146
|
+
)
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
"""
|
|
4
|
+
DocSpring API
|
|
5
|
+
|
|
6
|
+
Use DocSpring's API to programmatically fill out PDF forms, convert HTML to PDFs, merge PDFs, or request legally binding e-signatures.
|
|
7
|
+
|
|
8
|
+
The version of the OpenAPI document: v1
|
|
9
|
+
Contact: support@docspring.com
|
|
10
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
|
11
|
+
|
|
12
|
+
Do not edit the class manually.
|
|
13
|
+
""" # noqa: E501
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
from __future__ import annotations
|
|
17
|
+
import pprint
|
|
18
|
+
import re # noqa: F401
|
|
19
|
+
import json
|
|
20
|
+
|
|
21
|
+
from pydantic import BaseModel, ConfigDict
|
|
22
|
+
from typing import Any, ClassVar, Dict, List
|
|
23
|
+
from typing import Optional, Set
|
|
24
|
+
from typing_extensions import Self
|
|
25
|
+
|
|
26
|
+
class AddFieldsData(BaseModel):
|
|
27
|
+
"""
|
|
28
|
+
AddFieldsData
|
|
29
|
+
""" # noqa: E501
|
|
30
|
+
fields: List[Dict[str, Any]]
|
|
31
|
+
__properties: ClassVar[List[str]] = ["fields"]
|
|
32
|
+
|
|
33
|
+
model_config = ConfigDict(
|
|
34
|
+
populate_by_name=True,
|
|
35
|
+
validate_assignment=True,
|
|
36
|
+
protected_namespaces=(),
|
|
37
|
+
)
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
def to_str(self) -> str:
|
|
41
|
+
"""Returns the string representation of the model using alias"""
|
|
42
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
43
|
+
|
|
44
|
+
def to_json(self) -> str:
|
|
45
|
+
"""Returns the JSON representation of the model using alias"""
|
|
46
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
|
47
|
+
return json.dumps(self.to_dict())
|
|
48
|
+
|
|
49
|
+
@classmethod
|
|
50
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
51
|
+
"""Create an instance of AddFieldsData from a JSON string"""
|
|
52
|
+
return cls.from_dict(json.loads(json_str))
|
|
53
|
+
|
|
54
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
55
|
+
"""Return the dictionary representation of the model using alias.
|
|
56
|
+
|
|
57
|
+
This has the following differences from calling pydantic's
|
|
58
|
+
`self.model_dump(by_alias=True)`:
|
|
59
|
+
|
|
60
|
+
* `None` is only added to the output dict for nullable fields that
|
|
61
|
+
were set at model initialization. Other fields with value `None`
|
|
62
|
+
are ignored.
|
|
63
|
+
"""
|
|
64
|
+
excluded_fields: Set[str] = set([
|
|
65
|
+
])
|
|
66
|
+
|
|
67
|
+
_dict = self.model_dump(
|
|
68
|
+
by_alias=True,
|
|
69
|
+
exclude=excluded_fields,
|
|
70
|
+
exclude_none=True,
|
|
71
|
+
)
|
|
72
|
+
return _dict
|
|
73
|
+
|
|
74
|
+
@classmethod
|
|
75
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
76
|
+
"""Create an instance of AddFieldsData from a dict"""
|
|
77
|
+
if obj is None:
|
|
78
|
+
return None
|
|
79
|
+
|
|
80
|
+
if not isinstance(obj, dict):
|
|
81
|
+
return cls.model_validate(obj, context={"skip_enum_validation": True})
|
|
82
|
+
|
|
83
|
+
_obj = cls.model_validate({
|
|
84
|
+
"fields": obj.get("fields")
|
|
85
|
+
}, context={"skip_enum_validation": True})
|
|
86
|
+
return _obj
|
|
87
|
+
|
|
88
|
+
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
"""
|
|
4
|
+
DocSpring API
|
|
5
|
+
|
|
6
|
+
Use DocSpring's API to programmatically fill out PDF forms, convert HTML to PDFs, merge PDFs, or request legally binding e-signatures.
|
|
7
|
+
|
|
8
|
+
The version of the OpenAPI document: v1
|
|
9
|
+
Contact: support@docspring.com
|
|
10
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
|
11
|
+
|
|
12
|
+
Do not edit the class manually.
|
|
13
|
+
""" # noqa: E501
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
from __future__ import annotations
|
|
17
|
+
import pprint
|
|
18
|
+
import re # noqa: F401
|
|
19
|
+
import json
|
|
20
|
+
|
|
21
|
+
from pydantic import BaseModel, ConfigDict, StrictStr, ValidationInfo, field_validator
|
|
22
|
+
from typing import Any, ClassVar, Dict, List, Optional
|
|
23
|
+
from docspring.models.submission_batch import SubmissionBatch
|
|
24
|
+
from typing import Optional, Set
|
|
25
|
+
from typing_extensions import Self
|
|
26
|
+
|
|
27
|
+
class BatchGeneratePdfs201Response(BaseModel):
|
|
28
|
+
"""
|
|
29
|
+
BatchGeneratePdfs201Response
|
|
30
|
+
""" # noqa: E501
|
|
31
|
+
status: StrictStr
|
|
32
|
+
error: Optional[StrictStr] = None
|
|
33
|
+
errors: Optional[List[StrictStr]] = None
|
|
34
|
+
submission_batch: SubmissionBatch
|
|
35
|
+
submissions: List[Dict[str, Any]]
|
|
36
|
+
__properties: ClassVar[List[str]] = ["status", "error", "errors", "submission_batch", "submissions"]
|
|
37
|
+
|
|
38
|
+
@field_validator('status')
|
|
39
|
+
def status_validate_enum(cls, value, info: ValidationInfo):
|
|
40
|
+
"""Validates the enum"""
|
|
41
|
+
# from_dict accepts enum values this client doesn't know about yet
|
|
42
|
+
if info.context and info.context.get("skip_enum_validation"):
|
|
43
|
+
return value
|
|
44
|
+
|
|
45
|
+
if value not in set(['success', 'error']):
|
|
46
|
+
raise ValueError("must be one of enum values ('success', 'error')")
|
|
47
|
+
return value
|
|
48
|
+
|
|
49
|
+
model_config = ConfigDict(
|
|
50
|
+
populate_by_name=True,
|
|
51
|
+
validate_assignment=True,
|
|
52
|
+
protected_namespaces=(),
|
|
53
|
+
)
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
def to_str(self) -> str:
|
|
57
|
+
"""Returns the string representation of the model using alias"""
|
|
58
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
59
|
+
|
|
60
|
+
def to_json(self) -> str:
|
|
61
|
+
"""Returns the JSON representation of the model using alias"""
|
|
62
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
|
63
|
+
return json.dumps(self.to_dict())
|
|
64
|
+
|
|
65
|
+
@classmethod
|
|
66
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
67
|
+
"""Create an instance of BatchGeneratePdfs201Response from a JSON string"""
|
|
68
|
+
return cls.from_dict(json.loads(json_str))
|
|
69
|
+
|
|
70
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
71
|
+
"""Return the dictionary representation of the model using alias.
|
|
72
|
+
|
|
73
|
+
This has the following differences from calling pydantic's
|
|
74
|
+
`self.model_dump(by_alias=True)`:
|
|
75
|
+
|
|
76
|
+
* `None` is only added to the output dict for nullable fields that
|
|
77
|
+
were set at model initialization. Other fields with value `None`
|
|
78
|
+
are ignored.
|
|
79
|
+
"""
|
|
80
|
+
excluded_fields: Set[str] = set([
|
|
81
|
+
])
|
|
82
|
+
|
|
83
|
+
_dict = self.model_dump(
|
|
84
|
+
by_alias=True,
|
|
85
|
+
exclude=excluded_fields,
|
|
86
|
+
exclude_none=True,
|
|
87
|
+
)
|
|
88
|
+
# override the default output from pydantic by calling `to_dict()` of submission_batch
|
|
89
|
+
if self.submission_batch:
|
|
90
|
+
_dict['submission_batch'] = self.submission_batch.to_dict()
|
|
91
|
+
return _dict
|
|
92
|
+
|
|
93
|
+
@classmethod
|
|
94
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
95
|
+
"""Create an instance of BatchGeneratePdfs201Response from a dict"""
|
|
96
|
+
if obj is None:
|
|
97
|
+
return None
|
|
98
|
+
|
|
99
|
+
if not isinstance(obj, dict):
|
|
100
|
+
return cls.model_validate(obj, context={"skip_enum_validation": True})
|
|
101
|
+
|
|
102
|
+
_obj = cls.model_validate({
|
|
103
|
+
"status": obj.get("status"),
|
|
104
|
+
"error": obj.get("error"),
|
|
105
|
+
"errors": obj.get("errors"),
|
|
106
|
+
"submission_batch": SubmissionBatch.from_dict(obj["submission_batch"]) if obj.get("submission_batch") is not None else None,
|
|
107
|
+
"submissions": obj.get("submissions")
|
|
108
|
+
}, context={"skip_enum_validation": True})
|
|
109
|
+
return _obj
|
|
110
|
+
|
|
111
|
+
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
"""
|
|
4
|
+
DocSpring API
|
|
5
|
+
|
|
6
|
+
Use DocSpring's API to programmatically fill out PDF forms, convert HTML to PDFs, merge PDFs, or request legally binding e-signatures.
|
|
7
|
+
|
|
8
|
+
The version of the OpenAPI document: v1
|
|
9
|
+
Contact: support@docspring.com
|
|
10
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
|
11
|
+
|
|
12
|
+
Do not edit the class manually.
|
|
13
|
+
""" # noqa: E501
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
from __future__ import annotations
|
|
17
|
+
import pprint
|
|
18
|
+
import re # noqa: F401
|
|
19
|
+
import json
|
|
20
|
+
|
|
21
|
+
from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictInt, StrictStr
|
|
22
|
+
from typing import Any, ClassVar, Dict, List, Optional
|
|
23
|
+
from typing import Optional, Set
|
|
24
|
+
from typing_extensions import Self
|
|
25
|
+
|
|
26
|
+
class CombinePdfsData(BaseModel):
|
|
27
|
+
"""
|
|
28
|
+
CombinePdfsData
|
|
29
|
+
""" # noqa: E501
|
|
30
|
+
delete_custom_files: Optional[StrictBool] = Field(default=None, description="Delete the custom files in source_pdfs once the combined PDF has been processed (they're kept if it fails). Other combined submissions can't use them after that. A test API token can't delete custom files.")
|
|
31
|
+
expires_in: Optional[StrictInt] = None
|
|
32
|
+
metadata: Optional[Dict[str, Any]] = None
|
|
33
|
+
password: Optional[StrictStr] = None
|
|
34
|
+
source_pdfs: List[Dict[str, Any]]
|
|
35
|
+
test: Optional[StrictBool] = Field(default=None, description="Deprecated, and has no effect. A combined PDF is a test or live document because of its source PDFs.")
|
|
36
|
+
__properties: ClassVar[List[str]] = ["delete_custom_files", "expires_in", "metadata", "password", "source_pdfs", "test"]
|
|
37
|
+
|
|
38
|
+
model_config = ConfigDict(
|
|
39
|
+
populate_by_name=True,
|
|
40
|
+
validate_assignment=True,
|
|
41
|
+
protected_namespaces=(),
|
|
42
|
+
)
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
def to_str(self) -> str:
|
|
46
|
+
"""Returns the string representation of the model using alias"""
|
|
47
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
48
|
+
|
|
49
|
+
def to_json(self) -> str:
|
|
50
|
+
"""Returns the JSON representation of the model using alias"""
|
|
51
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
|
52
|
+
return json.dumps(self.to_dict())
|
|
53
|
+
|
|
54
|
+
@classmethod
|
|
55
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
56
|
+
"""Create an instance of CombinePdfsData from a JSON string"""
|
|
57
|
+
return cls.from_dict(json.loads(json_str))
|
|
58
|
+
|
|
59
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
60
|
+
"""Return the dictionary representation of the model using alias.
|
|
61
|
+
|
|
62
|
+
This has the following differences from calling pydantic's
|
|
63
|
+
`self.model_dump(by_alias=True)`:
|
|
64
|
+
|
|
65
|
+
* `None` is only added to the output dict for nullable fields that
|
|
66
|
+
were set at model initialization. Other fields with value `None`
|
|
67
|
+
are ignored.
|
|
68
|
+
"""
|
|
69
|
+
excluded_fields: Set[str] = set([
|
|
70
|
+
])
|
|
71
|
+
|
|
72
|
+
_dict = self.model_dump(
|
|
73
|
+
by_alias=True,
|
|
74
|
+
exclude=excluded_fields,
|
|
75
|
+
exclude_none=True,
|
|
76
|
+
)
|
|
77
|
+
return _dict
|
|
78
|
+
|
|
79
|
+
@classmethod
|
|
80
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
81
|
+
"""Create an instance of CombinePdfsData from a dict"""
|
|
82
|
+
if obj is None:
|
|
83
|
+
return None
|
|
84
|
+
|
|
85
|
+
if not isinstance(obj, dict):
|
|
86
|
+
return cls.model_validate(obj, context={"skip_enum_validation": True})
|
|
87
|
+
|
|
88
|
+
_obj = cls.model_validate({
|
|
89
|
+
"delete_custom_files": obj.get("delete_custom_files"),
|
|
90
|
+
"expires_in": obj.get("expires_in"),
|
|
91
|
+
"metadata": obj.get("metadata"),
|
|
92
|
+
"password": obj.get("password"),
|
|
93
|
+
"source_pdfs": obj.get("source_pdfs"),
|
|
94
|
+
"test": obj.get("test")
|
|
95
|
+
}, context={"skip_enum_validation": True})
|
|
96
|
+
return _obj
|
|
97
|
+
|
|
98
|
+
|