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
|
@@ -0,0 +1,173 @@
|
|
|
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, StrictBool, StrictInt, StrictStr, ValidationInfo, field_validator
|
|
22
|
+
from typing import Any, ClassVar, Dict, List, Optional
|
|
23
|
+
from docspring.models.combined_submission_action import CombinedSubmissionAction
|
|
24
|
+
from typing import Optional, Set
|
|
25
|
+
from typing_extensions import Self
|
|
26
|
+
|
|
27
|
+
class CombinedSubmission(BaseModel):
|
|
28
|
+
"""
|
|
29
|
+
CombinedSubmission
|
|
30
|
+
""" # noqa: E501
|
|
31
|
+
id: Optional[StrictStr]
|
|
32
|
+
state: StrictStr
|
|
33
|
+
expired: StrictBool
|
|
34
|
+
expires_in: Optional[StrictInt]
|
|
35
|
+
expires_at: Optional[StrictStr]
|
|
36
|
+
processed_at: Optional[StrictStr]
|
|
37
|
+
error_message: Optional[StrictStr]
|
|
38
|
+
submission_ids: List[StrictStr]
|
|
39
|
+
source_pdfs: List[Dict[str, Any]]
|
|
40
|
+
metadata: Dict[str, Any]
|
|
41
|
+
password: Optional[StrictStr]
|
|
42
|
+
pdf_hash: Optional[StrictStr]
|
|
43
|
+
download_url: Optional[StrictStr]
|
|
44
|
+
actions: List[CombinedSubmissionAction]
|
|
45
|
+
__properties: ClassVar[List[str]] = ["id", "state", "expired", "expires_in", "expires_at", "processed_at", "error_message", "submission_ids", "source_pdfs", "metadata", "password", "pdf_hash", "download_url", "actions"]
|
|
46
|
+
|
|
47
|
+
@field_validator('state')
|
|
48
|
+
def state_validate_enum(cls, value, info: ValidationInfo):
|
|
49
|
+
"""Validates the enum"""
|
|
50
|
+
# from_dict accepts enum values this client doesn't know about yet
|
|
51
|
+
if info.context and info.context.get("skip_enum_validation"):
|
|
52
|
+
return value
|
|
53
|
+
|
|
54
|
+
if value not in set(['pending', 'processed', 'error']):
|
|
55
|
+
raise ValueError("must be one of enum values ('pending', 'processed', 'error')")
|
|
56
|
+
return value
|
|
57
|
+
|
|
58
|
+
model_config = ConfigDict(
|
|
59
|
+
populate_by_name=True,
|
|
60
|
+
validate_assignment=True,
|
|
61
|
+
protected_namespaces=(),
|
|
62
|
+
)
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
def to_str(self) -> str:
|
|
66
|
+
"""Returns the string representation of the model using alias"""
|
|
67
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
68
|
+
|
|
69
|
+
def to_json(self) -> str:
|
|
70
|
+
"""Returns the JSON representation of the model using alias"""
|
|
71
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
|
72
|
+
return json.dumps(self.to_dict())
|
|
73
|
+
|
|
74
|
+
@classmethod
|
|
75
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
76
|
+
"""Create an instance of CombinedSubmission from a JSON string"""
|
|
77
|
+
return cls.from_dict(json.loads(json_str))
|
|
78
|
+
|
|
79
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
80
|
+
"""Return the dictionary representation of the model using alias.
|
|
81
|
+
|
|
82
|
+
This has the following differences from calling pydantic's
|
|
83
|
+
`self.model_dump(by_alias=True)`:
|
|
84
|
+
|
|
85
|
+
* `None` is only added to the output dict for nullable fields that
|
|
86
|
+
were set at model initialization. Other fields with value `None`
|
|
87
|
+
are ignored.
|
|
88
|
+
"""
|
|
89
|
+
excluded_fields: Set[str] = set([
|
|
90
|
+
])
|
|
91
|
+
|
|
92
|
+
_dict = self.model_dump(
|
|
93
|
+
by_alias=True,
|
|
94
|
+
exclude=excluded_fields,
|
|
95
|
+
exclude_none=True,
|
|
96
|
+
)
|
|
97
|
+
# override the default output from pydantic by calling `to_dict()` of each item in actions (list)
|
|
98
|
+
_items = []
|
|
99
|
+
if self.actions:
|
|
100
|
+
for _item_actions in self.actions:
|
|
101
|
+
if _item_actions:
|
|
102
|
+
_items.append(_item_actions.to_dict())
|
|
103
|
+
_dict['actions'] = _items
|
|
104
|
+
# set to None if id (nullable) is None
|
|
105
|
+
# and model_fields_set contains the field
|
|
106
|
+
if self.id is None and "id" in self.model_fields_set:
|
|
107
|
+
_dict['id'] = None
|
|
108
|
+
|
|
109
|
+
# set to None if expires_in (nullable) is None
|
|
110
|
+
# and model_fields_set contains the field
|
|
111
|
+
if self.expires_in is None and "expires_in" in self.model_fields_set:
|
|
112
|
+
_dict['expires_in'] = None
|
|
113
|
+
|
|
114
|
+
# set to None if expires_at (nullable) is None
|
|
115
|
+
# and model_fields_set contains the field
|
|
116
|
+
if self.expires_at is None and "expires_at" in self.model_fields_set:
|
|
117
|
+
_dict['expires_at'] = None
|
|
118
|
+
|
|
119
|
+
# set to None if processed_at (nullable) is None
|
|
120
|
+
# and model_fields_set contains the field
|
|
121
|
+
if self.processed_at is None and "processed_at" in self.model_fields_set:
|
|
122
|
+
_dict['processed_at'] = None
|
|
123
|
+
|
|
124
|
+
# set to None if error_message (nullable) is None
|
|
125
|
+
# and model_fields_set contains the field
|
|
126
|
+
if self.error_message is None and "error_message" in self.model_fields_set:
|
|
127
|
+
_dict['error_message'] = None
|
|
128
|
+
|
|
129
|
+
# set to None if password (nullable) is None
|
|
130
|
+
# and model_fields_set contains the field
|
|
131
|
+
if self.password is None and "password" in self.model_fields_set:
|
|
132
|
+
_dict['password'] = None
|
|
133
|
+
|
|
134
|
+
# set to None if pdf_hash (nullable) is None
|
|
135
|
+
# and model_fields_set contains the field
|
|
136
|
+
if self.pdf_hash is None and "pdf_hash" in self.model_fields_set:
|
|
137
|
+
_dict['pdf_hash'] = None
|
|
138
|
+
|
|
139
|
+
# set to None if download_url (nullable) is None
|
|
140
|
+
# and model_fields_set contains the field
|
|
141
|
+
if self.download_url is None and "download_url" in self.model_fields_set:
|
|
142
|
+
_dict['download_url'] = None
|
|
143
|
+
|
|
144
|
+
return _dict
|
|
145
|
+
|
|
146
|
+
@classmethod
|
|
147
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
148
|
+
"""Create an instance of CombinedSubmission from a dict"""
|
|
149
|
+
if obj is None:
|
|
150
|
+
return None
|
|
151
|
+
|
|
152
|
+
if not isinstance(obj, dict):
|
|
153
|
+
return cls.model_validate(obj, context={"skip_enum_validation": True})
|
|
154
|
+
|
|
155
|
+
_obj = cls.model_validate({
|
|
156
|
+
"id": obj.get("id"),
|
|
157
|
+
"state": obj.get("state"),
|
|
158
|
+
"expired": obj.get("expired"),
|
|
159
|
+
"expires_in": obj.get("expires_in"),
|
|
160
|
+
"expires_at": obj.get("expires_at"),
|
|
161
|
+
"processed_at": obj.get("processed_at"),
|
|
162
|
+
"error_message": obj.get("error_message"),
|
|
163
|
+
"submission_ids": obj.get("submission_ids"),
|
|
164
|
+
"source_pdfs": obj.get("source_pdfs"),
|
|
165
|
+
"metadata": obj.get("metadata"),
|
|
166
|
+
"password": obj.get("password"),
|
|
167
|
+
"pdf_hash": obj.get("pdf_hash"),
|
|
168
|
+
"download_url": obj.get("download_url"),
|
|
169
|
+
"actions": [CombinedSubmissionAction.from_dict(_item) for _item in obj["actions"]] if obj.get("actions") is not None else None
|
|
170
|
+
}, context={"skip_enum_validation": True})
|
|
171
|
+
return _obj
|
|
172
|
+
|
|
173
|
+
|
|
@@ -0,0 +1,156 @@
|
|
|
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 typing import Optional, Set
|
|
24
|
+
from typing_extensions import Self
|
|
25
|
+
|
|
26
|
+
class CombinedSubmissionAction(BaseModel):
|
|
27
|
+
"""
|
|
28
|
+
CombinedSubmissionAction
|
|
29
|
+
""" # noqa: E501
|
|
30
|
+
id: Optional[StrictStr]
|
|
31
|
+
integration_id: Optional[StrictStr]
|
|
32
|
+
state: StrictStr
|
|
33
|
+
action_type: Optional[StrictStr]
|
|
34
|
+
action_category: StrictStr
|
|
35
|
+
result_data: Dict[str, Any]
|
|
36
|
+
error_message: Optional[StrictStr]
|
|
37
|
+
__properties: ClassVar[List[str]] = ["id", "integration_id", "state", "action_type", "action_category", "result_data", "error_message"]
|
|
38
|
+
|
|
39
|
+
@field_validator('state')
|
|
40
|
+
def state_validate_enum(cls, value, info: ValidationInfo):
|
|
41
|
+
"""Validates the enum"""
|
|
42
|
+
# from_dict accepts enum values this client doesn't know about yet
|
|
43
|
+
if info.context and info.context.get("skip_enum_validation"):
|
|
44
|
+
return value
|
|
45
|
+
|
|
46
|
+
if value not in set(['pending', 'processed', 'failed', 'error']):
|
|
47
|
+
raise ValueError("must be one of enum values ('pending', 'processed', 'failed', 'error')")
|
|
48
|
+
return value
|
|
49
|
+
|
|
50
|
+
@field_validator('action_type')
|
|
51
|
+
def action_type_validate_enum(cls, value, info: ValidationInfo):
|
|
52
|
+
"""Validates the enum"""
|
|
53
|
+
# from_dict accepts enum values this client doesn't know about yet
|
|
54
|
+
if info.context and info.context.get("skip_enum_validation"):
|
|
55
|
+
return value
|
|
56
|
+
|
|
57
|
+
if value is None:
|
|
58
|
+
return value
|
|
59
|
+
|
|
60
|
+
if value not in set(['webhook', 'slack_webhook', 'email', 'aws_s3_upload']):
|
|
61
|
+
raise ValueError("must be one of enum values ('webhook', 'slack_webhook', 'email', 'aws_s3_upload')")
|
|
62
|
+
return value
|
|
63
|
+
|
|
64
|
+
@field_validator('action_category')
|
|
65
|
+
def action_category_validate_enum(cls, value, info: ValidationInfo):
|
|
66
|
+
"""Validates the enum"""
|
|
67
|
+
# from_dict accepts enum values this client doesn't know about yet
|
|
68
|
+
if info.context and info.context.get("skip_enum_validation"):
|
|
69
|
+
return value
|
|
70
|
+
|
|
71
|
+
if value not in set(['notification', 'file_upload']):
|
|
72
|
+
raise ValueError("must be one of enum values ('notification', 'file_upload')")
|
|
73
|
+
return value
|
|
74
|
+
|
|
75
|
+
model_config = ConfigDict(
|
|
76
|
+
populate_by_name=True,
|
|
77
|
+
validate_assignment=True,
|
|
78
|
+
protected_namespaces=(),
|
|
79
|
+
)
|
|
80
|
+
|
|
81
|
+
|
|
82
|
+
def to_str(self) -> str:
|
|
83
|
+
"""Returns the string representation of the model using alias"""
|
|
84
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
85
|
+
|
|
86
|
+
def to_json(self) -> str:
|
|
87
|
+
"""Returns the JSON representation of the model using alias"""
|
|
88
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
|
89
|
+
return json.dumps(self.to_dict())
|
|
90
|
+
|
|
91
|
+
@classmethod
|
|
92
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
93
|
+
"""Create an instance of CombinedSubmissionAction from a JSON string"""
|
|
94
|
+
return cls.from_dict(json.loads(json_str))
|
|
95
|
+
|
|
96
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
97
|
+
"""Return the dictionary representation of the model using alias.
|
|
98
|
+
|
|
99
|
+
This has the following differences from calling pydantic's
|
|
100
|
+
`self.model_dump(by_alias=True)`:
|
|
101
|
+
|
|
102
|
+
* `None` is only added to the output dict for nullable fields that
|
|
103
|
+
were set at model initialization. Other fields with value `None`
|
|
104
|
+
are ignored.
|
|
105
|
+
"""
|
|
106
|
+
excluded_fields: Set[str] = set([
|
|
107
|
+
])
|
|
108
|
+
|
|
109
|
+
_dict = self.model_dump(
|
|
110
|
+
by_alias=True,
|
|
111
|
+
exclude=excluded_fields,
|
|
112
|
+
exclude_none=True,
|
|
113
|
+
)
|
|
114
|
+
# set to None if id (nullable) is None
|
|
115
|
+
# and model_fields_set contains the field
|
|
116
|
+
if self.id is None and "id" in self.model_fields_set:
|
|
117
|
+
_dict['id'] = None
|
|
118
|
+
|
|
119
|
+
# set to None if integration_id (nullable) is None
|
|
120
|
+
# and model_fields_set contains the field
|
|
121
|
+
if self.integration_id is None and "integration_id" in self.model_fields_set:
|
|
122
|
+
_dict['integration_id'] = None
|
|
123
|
+
|
|
124
|
+
# set to None if action_type (nullable) is None
|
|
125
|
+
# and model_fields_set contains the field
|
|
126
|
+
if self.action_type is None and "action_type" in self.model_fields_set:
|
|
127
|
+
_dict['action_type'] = None
|
|
128
|
+
|
|
129
|
+
# set to None if error_message (nullable) is None
|
|
130
|
+
# and model_fields_set contains the field
|
|
131
|
+
if self.error_message is None and "error_message" in self.model_fields_set:
|
|
132
|
+
_dict['error_message'] = None
|
|
133
|
+
|
|
134
|
+
return _dict
|
|
135
|
+
|
|
136
|
+
@classmethod
|
|
137
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
138
|
+
"""Create an instance of CombinedSubmissionAction from a dict"""
|
|
139
|
+
if obj is None:
|
|
140
|
+
return None
|
|
141
|
+
|
|
142
|
+
if not isinstance(obj, dict):
|
|
143
|
+
return cls.model_validate(obj, context={"skip_enum_validation": True})
|
|
144
|
+
|
|
145
|
+
_obj = cls.model_validate({
|
|
146
|
+
"id": obj.get("id"),
|
|
147
|
+
"integration_id": obj.get("integration_id"),
|
|
148
|
+
"state": obj.get("state"),
|
|
149
|
+
"action_type": obj.get("action_type"),
|
|
150
|
+
"action_category": obj.get("action_category"),
|
|
151
|
+
"result_data": obj.get("result_data"),
|
|
152
|
+
"error_message": obj.get("error_message")
|
|
153
|
+
}, context={"skip_enum_validation": True})
|
|
154
|
+
return _obj
|
|
155
|
+
|
|
156
|
+
|
|
@@ -0,0 +1,92 @@
|
|
|
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
|
|
22
|
+
from typing import Any, ClassVar, Dict, List, Optional
|
|
23
|
+
from typing import Optional, Set
|
|
24
|
+
from typing_extensions import Self
|
|
25
|
+
|
|
26
|
+
class CopyTemplateOptions(BaseModel):
|
|
27
|
+
"""
|
|
28
|
+
CopyTemplateOptions
|
|
29
|
+
""" # noqa: E501
|
|
30
|
+
name: Optional[StrictStr] = None
|
|
31
|
+
parent_folder_id: Optional[StrictStr] = None
|
|
32
|
+
version: Optional[StrictStr] = None
|
|
33
|
+
__properties: ClassVar[List[str]] = ["name", "parent_folder_id", "version"]
|
|
34
|
+
|
|
35
|
+
model_config = ConfigDict(
|
|
36
|
+
populate_by_name=True,
|
|
37
|
+
validate_assignment=True,
|
|
38
|
+
protected_namespaces=(),
|
|
39
|
+
)
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
def to_str(self) -> str:
|
|
43
|
+
"""Returns the string representation of the model using alias"""
|
|
44
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
45
|
+
|
|
46
|
+
def to_json(self) -> str:
|
|
47
|
+
"""Returns the JSON representation of the model using alias"""
|
|
48
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
|
49
|
+
return json.dumps(self.to_dict())
|
|
50
|
+
|
|
51
|
+
@classmethod
|
|
52
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
53
|
+
"""Create an instance of CopyTemplateOptions from a JSON string"""
|
|
54
|
+
return cls.from_dict(json.loads(json_str))
|
|
55
|
+
|
|
56
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
57
|
+
"""Return the dictionary representation of the model using alias.
|
|
58
|
+
|
|
59
|
+
This has the following differences from calling pydantic's
|
|
60
|
+
`self.model_dump(by_alias=True)`:
|
|
61
|
+
|
|
62
|
+
* `None` is only added to the output dict for nullable fields that
|
|
63
|
+
were set at model initialization. Other fields with value `None`
|
|
64
|
+
are ignored.
|
|
65
|
+
"""
|
|
66
|
+
excluded_fields: Set[str] = set([
|
|
67
|
+
])
|
|
68
|
+
|
|
69
|
+
_dict = self.model_dump(
|
|
70
|
+
by_alias=True,
|
|
71
|
+
exclude=excluded_fields,
|
|
72
|
+
exclude_none=True,
|
|
73
|
+
)
|
|
74
|
+
return _dict
|
|
75
|
+
|
|
76
|
+
@classmethod
|
|
77
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
78
|
+
"""Create an instance of CopyTemplateOptions from a dict"""
|
|
79
|
+
if obj is None:
|
|
80
|
+
return None
|
|
81
|
+
|
|
82
|
+
if not isinstance(obj, dict):
|
|
83
|
+
return cls.model_validate(obj, context={"skip_enum_validation": True})
|
|
84
|
+
|
|
85
|
+
_obj = cls.model_validate({
|
|
86
|
+
"name": obj.get("name"),
|
|
87
|
+
"parent_folder_id": obj.get("parent_folder_id"),
|
|
88
|
+
"version": obj.get("version")
|
|
89
|
+
}, context={"skip_enum_validation": True})
|
|
90
|
+
return _obj
|
|
91
|
+
|
|
92
|
+
|
|
@@ -0,0 +1,107 @@
|
|
|
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.combined_submission import CombinedSubmission
|
|
24
|
+
from typing import Optional, Set
|
|
25
|
+
from typing_extensions import Self
|
|
26
|
+
|
|
27
|
+
class CreateCombinedSubmissionResponse(BaseModel):
|
|
28
|
+
"""
|
|
29
|
+
CreateCombinedSubmissionResponse
|
|
30
|
+
""" # noqa: E501
|
|
31
|
+
status: StrictStr
|
|
32
|
+
combined_submission: CombinedSubmission
|
|
33
|
+
errors: Optional[List[StrictStr]] = None
|
|
34
|
+
__properties: ClassVar[List[str]] = ["status", "combined_submission", "errors"]
|
|
35
|
+
|
|
36
|
+
@field_validator('status')
|
|
37
|
+
def status_validate_enum(cls, value, info: ValidationInfo):
|
|
38
|
+
"""Validates the enum"""
|
|
39
|
+
# from_dict accepts enum values this client doesn't know about yet
|
|
40
|
+
if info.context and info.context.get("skip_enum_validation"):
|
|
41
|
+
return value
|
|
42
|
+
|
|
43
|
+
if value not in set(['success', 'error']):
|
|
44
|
+
raise ValueError("must be one of enum values ('success', 'error')")
|
|
45
|
+
return value
|
|
46
|
+
|
|
47
|
+
model_config = ConfigDict(
|
|
48
|
+
populate_by_name=True,
|
|
49
|
+
validate_assignment=True,
|
|
50
|
+
protected_namespaces=(),
|
|
51
|
+
)
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
def to_str(self) -> str:
|
|
55
|
+
"""Returns the string representation of the model using alias"""
|
|
56
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
57
|
+
|
|
58
|
+
def to_json(self) -> str:
|
|
59
|
+
"""Returns the JSON representation of the model using alias"""
|
|
60
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
|
61
|
+
return json.dumps(self.to_dict())
|
|
62
|
+
|
|
63
|
+
@classmethod
|
|
64
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
65
|
+
"""Create an instance of CreateCombinedSubmissionResponse from a JSON string"""
|
|
66
|
+
return cls.from_dict(json.loads(json_str))
|
|
67
|
+
|
|
68
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
69
|
+
"""Return the dictionary representation of the model using alias.
|
|
70
|
+
|
|
71
|
+
This has the following differences from calling pydantic's
|
|
72
|
+
`self.model_dump(by_alias=True)`:
|
|
73
|
+
|
|
74
|
+
* `None` is only added to the output dict for nullable fields that
|
|
75
|
+
were set at model initialization. Other fields with value `None`
|
|
76
|
+
are ignored.
|
|
77
|
+
"""
|
|
78
|
+
excluded_fields: Set[str] = set([
|
|
79
|
+
])
|
|
80
|
+
|
|
81
|
+
_dict = self.model_dump(
|
|
82
|
+
by_alias=True,
|
|
83
|
+
exclude=excluded_fields,
|
|
84
|
+
exclude_none=True,
|
|
85
|
+
)
|
|
86
|
+
# override the default output from pydantic by calling `to_dict()` of combined_submission
|
|
87
|
+
if self.combined_submission:
|
|
88
|
+
_dict['combined_submission'] = self.combined_submission.to_dict()
|
|
89
|
+
return _dict
|
|
90
|
+
|
|
91
|
+
@classmethod
|
|
92
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
93
|
+
"""Create an instance of CreateCombinedSubmissionResponse from a dict"""
|
|
94
|
+
if obj is None:
|
|
95
|
+
return None
|
|
96
|
+
|
|
97
|
+
if not isinstance(obj, dict):
|
|
98
|
+
return cls.model_validate(obj, context={"skip_enum_validation": True})
|
|
99
|
+
|
|
100
|
+
_obj = cls.model_validate({
|
|
101
|
+
"status": obj.get("status"),
|
|
102
|
+
"combined_submission": CombinedSubmission.from_dict(obj["combined_submission"]) if obj.get("combined_submission") is not None else None,
|
|
103
|
+
"errors": obj.get("errors")
|
|
104
|
+
}, context={"skip_enum_validation": True})
|
|
105
|
+
return _obj
|
|
106
|
+
|
|
107
|
+
|
|
@@ -0,0 +1,89 @@
|
|
|
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
|
|
22
|
+
from typing import Any, ClassVar, Dict, List
|
|
23
|
+
from typing_extensions import Annotated
|
|
24
|
+
from typing import Optional, Set
|
|
25
|
+
from typing_extensions import Self
|
|
26
|
+
|
|
27
|
+
class CreateCustomFileData(BaseModel):
|
|
28
|
+
"""
|
|
29
|
+
CreateCustomFileData
|
|
30
|
+
""" # noqa: E501
|
|
31
|
+
cache_id: Annotated[str, Field(min_length=1, strict=True)]
|
|
32
|
+
__properties: ClassVar[List[str]] = ["cache_id"]
|
|
33
|
+
|
|
34
|
+
model_config = ConfigDict(
|
|
35
|
+
populate_by_name=True,
|
|
36
|
+
validate_assignment=True,
|
|
37
|
+
protected_namespaces=(),
|
|
38
|
+
)
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
def to_str(self) -> str:
|
|
42
|
+
"""Returns the string representation of the model using alias"""
|
|
43
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
44
|
+
|
|
45
|
+
def to_json(self) -> str:
|
|
46
|
+
"""Returns the JSON representation of the model using alias"""
|
|
47
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
|
48
|
+
return json.dumps(self.to_dict())
|
|
49
|
+
|
|
50
|
+
@classmethod
|
|
51
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
52
|
+
"""Create an instance of CreateCustomFileData from a JSON string"""
|
|
53
|
+
return cls.from_dict(json.loads(json_str))
|
|
54
|
+
|
|
55
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
56
|
+
"""Return the dictionary representation of the model using alias.
|
|
57
|
+
|
|
58
|
+
This has the following differences from calling pydantic's
|
|
59
|
+
`self.model_dump(by_alias=True)`:
|
|
60
|
+
|
|
61
|
+
* `None` is only added to the output dict for nullable fields that
|
|
62
|
+
were set at model initialization. Other fields with value `None`
|
|
63
|
+
are ignored.
|
|
64
|
+
"""
|
|
65
|
+
excluded_fields: Set[str] = set([
|
|
66
|
+
])
|
|
67
|
+
|
|
68
|
+
_dict = self.model_dump(
|
|
69
|
+
by_alias=True,
|
|
70
|
+
exclude=excluded_fields,
|
|
71
|
+
exclude_none=True,
|
|
72
|
+
)
|
|
73
|
+
return _dict
|
|
74
|
+
|
|
75
|
+
@classmethod
|
|
76
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
77
|
+
"""Create an instance of CreateCustomFileData from a dict"""
|
|
78
|
+
if obj is None:
|
|
79
|
+
return None
|
|
80
|
+
|
|
81
|
+
if not isinstance(obj, dict):
|
|
82
|
+
return cls.model_validate(obj, context={"skip_enum_validation": True})
|
|
83
|
+
|
|
84
|
+
_obj = cls.model_validate({
|
|
85
|
+
"cache_id": obj.get("cache_id")
|
|
86
|
+
}, context={"skip_enum_validation": True})
|
|
87
|
+
return _obj
|
|
88
|
+
|
|
89
|
+
|