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,101 @@
|
|
|
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 SuccessErrorResponse(BaseModel):
|
|
27
|
+
"""
|
|
28
|
+
SuccessErrorResponse
|
|
29
|
+
""" # noqa: E501
|
|
30
|
+
status: StrictStr
|
|
31
|
+
error: Optional[StrictStr] = None
|
|
32
|
+
__properties: ClassVar[List[str]] = ["status", "error"]
|
|
33
|
+
|
|
34
|
+
@field_validator('status')
|
|
35
|
+
def status_validate_enum(cls, value, info: ValidationInfo):
|
|
36
|
+
"""Validates the enum"""
|
|
37
|
+
# from_dict accepts enum values this client doesn't know about yet
|
|
38
|
+
if info.context and info.context.get("skip_enum_validation"):
|
|
39
|
+
return value
|
|
40
|
+
|
|
41
|
+
if value not in set(['success', 'error']):
|
|
42
|
+
raise ValueError("must be one of enum values ('success', 'error')")
|
|
43
|
+
return value
|
|
44
|
+
|
|
45
|
+
model_config = ConfigDict(
|
|
46
|
+
populate_by_name=True,
|
|
47
|
+
validate_assignment=True,
|
|
48
|
+
protected_namespaces=(),
|
|
49
|
+
)
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
def to_str(self) -> str:
|
|
53
|
+
"""Returns the string representation of the model using alias"""
|
|
54
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
55
|
+
|
|
56
|
+
def to_json(self) -> str:
|
|
57
|
+
"""Returns the JSON representation of the model using alias"""
|
|
58
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
|
59
|
+
return json.dumps(self.to_dict())
|
|
60
|
+
|
|
61
|
+
@classmethod
|
|
62
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
63
|
+
"""Create an instance of SuccessErrorResponse from a JSON string"""
|
|
64
|
+
return cls.from_dict(json.loads(json_str))
|
|
65
|
+
|
|
66
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
67
|
+
"""Return the dictionary representation of the model using alias.
|
|
68
|
+
|
|
69
|
+
This has the following differences from calling pydantic's
|
|
70
|
+
`self.model_dump(by_alias=True)`:
|
|
71
|
+
|
|
72
|
+
* `None` is only added to the output dict for nullable fields that
|
|
73
|
+
were set at model initialization. Other fields with value `None`
|
|
74
|
+
are ignored.
|
|
75
|
+
"""
|
|
76
|
+
excluded_fields: Set[str] = set([
|
|
77
|
+
])
|
|
78
|
+
|
|
79
|
+
_dict = self.model_dump(
|
|
80
|
+
by_alias=True,
|
|
81
|
+
exclude=excluded_fields,
|
|
82
|
+
exclude_none=True,
|
|
83
|
+
)
|
|
84
|
+
return _dict
|
|
85
|
+
|
|
86
|
+
@classmethod
|
|
87
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
88
|
+
"""Create an instance of SuccessErrorResponse from a dict"""
|
|
89
|
+
if obj is None:
|
|
90
|
+
return None
|
|
91
|
+
|
|
92
|
+
if not isinstance(obj, dict):
|
|
93
|
+
return cls.model_validate(obj, context={"skip_enum_validation": True})
|
|
94
|
+
|
|
95
|
+
_obj = cls.model_validate({
|
|
96
|
+
"status": obj.get("status"),
|
|
97
|
+
"error": obj.get("error")
|
|
98
|
+
}, context={"skip_enum_validation": True})
|
|
99
|
+
return _obj
|
|
100
|
+
|
|
101
|
+
|
|
@@ -0,0 +1,101 @@
|
|
|
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 SuccessMultipleErrorsResponse(BaseModel):
|
|
27
|
+
"""
|
|
28
|
+
SuccessMultipleErrorsResponse
|
|
29
|
+
""" # noqa: E501
|
|
30
|
+
status: StrictStr
|
|
31
|
+
errors: Optional[List[StrictStr]] = None
|
|
32
|
+
__properties: ClassVar[List[str]] = ["status", "errors"]
|
|
33
|
+
|
|
34
|
+
@field_validator('status')
|
|
35
|
+
def status_validate_enum(cls, value, info: ValidationInfo):
|
|
36
|
+
"""Validates the enum"""
|
|
37
|
+
# from_dict accepts enum values this client doesn't know about yet
|
|
38
|
+
if info.context and info.context.get("skip_enum_validation"):
|
|
39
|
+
return value
|
|
40
|
+
|
|
41
|
+
if value not in set(['success', 'error']):
|
|
42
|
+
raise ValueError("must be one of enum values ('success', 'error')")
|
|
43
|
+
return value
|
|
44
|
+
|
|
45
|
+
model_config = ConfigDict(
|
|
46
|
+
populate_by_name=True,
|
|
47
|
+
validate_assignment=True,
|
|
48
|
+
protected_namespaces=(),
|
|
49
|
+
)
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
def to_str(self) -> str:
|
|
53
|
+
"""Returns the string representation of the model using alias"""
|
|
54
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
55
|
+
|
|
56
|
+
def to_json(self) -> str:
|
|
57
|
+
"""Returns the JSON representation of the model using alias"""
|
|
58
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
|
59
|
+
return json.dumps(self.to_dict())
|
|
60
|
+
|
|
61
|
+
@classmethod
|
|
62
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
63
|
+
"""Create an instance of SuccessMultipleErrorsResponse from a JSON string"""
|
|
64
|
+
return cls.from_dict(json.loads(json_str))
|
|
65
|
+
|
|
66
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
67
|
+
"""Return the dictionary representation of the model using alias.
|
|
68
|
+
|
|
69
|
+
This has the following differences from calling pydantic's
|
|
70
|
+
`self.model_dump(by_alias=True)`:
|
|
71
|
+
|
|
72
|
+
* `None` is only added to the output dict for nullable fields that
|
|
73
|
+
were set at model initialization. Other fields with value `None`
|
|
74
|
+
are ignored.
|
|
75
|
+
"""
|
|
76
|
+
excluded_fields: Set[str] = set([
|
|
77
|
+
])
|
|
78
|
+
|
|
79
|
+
_dict = self.model_dump(
|
|
80
|
+
by_alias=True,
|
|
81
|
+
exclude=excluded_fields,
|
|
82
|
+
exclude_none=True,
|
|
83
|
+
)
|
|
84
|
+
return _dict
|
|
85
|
+
|
|
86
|
+
@classmethod
|
|
87
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
88
|
+
"""Create an instance of SuccessMultipleErrorsResponse from a dict"""
|
|
89
|
+
if obj is None:
|
|
90
|
+
return None
|
|
91
|
+
|
|
92
|
+
if not isinstance(obj, dict):
|
|
93
|
+
return cls.model_validate(obj, context={"skip_enum_validation": True})
|
|
94
|
+
|
|
95
|
+
_obj = cls.model_validate({
|
|
96
|
+
"status": obj.get("status"),
|
|
97
|
+
"errors": obj.get("errors")
|
|
98
|
+
}, context={"skip_enum_validation": True})
|
|
99
|
+
return _obj
|
|
100
|
+
|
|
101
|
+
|
|
@@ -0,0 +1,402 @@
|
|
|
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, StrictFloat, StrictInt, StrictStr, ValidationInfo, field_validator
|
|
22
|
+
from typing import Any, ClassVar, Dict, List, Optional, Union
|
|
23
|
+
from typing_extensions import Annotated
|
|
24
|
+
from typing import Optional, Set
|
|
25
|
+
from typing_extensions import Self
|
|
26
|
+
|
|
27
|
+
class Template(BaseModel):
|
|
28
|
+
"""
|
|
29
|
+
Template
|
|
30
|
+
""" # noqa: E501
|
|
31
|
+
add_data_request_submission_id_footers: StrictBool
|
|
32
|
+
allow_additional_properties: StrictBool
|
|
33
|
+
description: Optional[StrictStr]
|
|
34
|
+
document_filename: Optional[StrictStr]
|
|
35
|
+
document_md5: Optional[StrictStr]
|
|
36
|
+
document_parse_error: StrictBool
|
|
37
|
+
document_processed: StrictBool
|
|
38
|
+
document_state: StrictStr
|
|
39
|
+
document_url: Optional[StrictStr]
|
|
40
|
+
editable_submissions: StrictBool
|
|
41
|
+
embed_domains: Optional[StrictStr]
|
|
42
|
+
embed_edit_allow_settings: StrictBool
|
|
43
|
+
embed_edit_allow_versioning: StrictBool
|
|
44
|
+
embed_edit_allow_document_replacement: StrictBool
|
|
45
|
+
encrypt_pdfs_password: Optional[StrictStr]
|
|
46
|
+
encrypt_pdfs: StrictBool
|
|
47
|
+
expiration_interval: StrictStr
|
|
48
|
+
expire_after: StrictInt
|
|
49
|
+
expire_submissions: StrictBool
|
|
50
|
+
external_predefined_fields_template_id: Optional[StrictStr]
|
|
51
|
+
external_predefined_fields_template_name: Optional[StrictStr]
|
|
52
|
+
first_template: StrictBool
|
|
53
|
+
id: Optional[StrictStr]
|
|
54
|
+
locked: StrictBool
|
|
55
|
+
merge_audit_trail_pdf: StrictBool
|
|
56
|
+
name: Optional[StrictStr]
|
|
57
|
+
page_count: StrictInt
|
|
58
|
+
page_dimensions: Optional[List[Annotated[List[Union[StrictFloat, StrictInt]], Field(min_length=2, max_length=2)]]]
|
|
59
|
+
parent_folder_id: Optional[StrictStr]
|
|
60
|
+
path: StrictStr
|
|
61
|
+
permanent_document_url: Optional[StrictStr]
|
|
62
|
+
public_submissions: StrictBool
|
|
63
|
+
public_web_form: StrictBool
|
|
64
|
+
redirect_url: Optional[StrictStr]
|
|
65
|
+
slack_webhook_url: Optional[StrictStr]
|
|
66
|
+
template_type: StrictStr
|
|
67
|
+
updated_at: Optional[StrictStr]
|
|
68
|
+
version_published_at: Optional[StrictStr]
|
|
69
|
+
version: Optional[StrictStr]
|
|
70
|
+
webhook_url: Optional[StrictStr]
|
|
71
|
+
embed_edit_token: Optional[StrictStr] = None
|
|
72
|
+
demo: StrictBool
|
|
73
|
+
latest_version: Optional[StrictStr]
|
|
74
|
+
last_changed_at: Optional[StrictStr]
|
|
75
|
+
last_changed_by_type: Optional[StrictStr]
|
|
76
|
+
last_changed_by_id: Optional[StrictStr]
|
|
77
|
+
last_changed_by_external_name: Optional[StrictStr]
|
|
78
|
+
last_changed_by_external_email: Optional[StrictStr]
|
|
79
|
+
last_changed_by_external_id: Optional[StrictStr]
|
|
80
|
+
defaults: Dict[str, Any]
|
|
81
|
+
field_dependencies: List[Dict[str, Any]]
|
|
82
|
+
field_order: List[List[Union[StrictFloat, StrictInt]]]
|
|
83
|
+
fields: Dict[str, Any]
|
|
84
|
+
footer_html: Optional[StrictStr]
|
|
85
|
+
header_html: Optional[StrictStr]
|
|
86
|
+
html_engine_options: Dict[str, Any]
|
|
87
|
+
html: Optional[StrictStr]
|
|
88
|
+
predefined_fields: List[Dict[str, Any]]
|
|
89
|
+
scss: Optional[StrictStr]
|
|
90
|
+
shared_field_data: Dict[str, Any]
|
|
91
|
+
template_schema_version: StrictInt
|
|
92
|
+
versions: List[Dict[str, Any]]
|
|
93
|
+
__properties: ClassVar[List[str]] = ["add_data_request_submission_id_footers", "allow_additional_properties", "description", "document_filename", "document_md5", "document_parse_error", "document_processed", "document_state", "document_url", "editable_submissions", "embed_domains", "embed_edit_allow_settings", "embed_edit_allow_versioning", "embed_edit_allow_document_replacement", "encrypt_pdfs_password", "encrypt_pdfs", "expiration_interval", "expire_after", "expire_submissions", "external_predefined_fields_template_id", "external_predefined_fields_template_name", "first_template", "id", "locked", "merge_audit_trail_pdf", "name", "page_count", "page_dimensions", "parent_folder_id", "path", "permanent_document_url", "public_submissions", "public_web_form", "redirect_url", "slack_webhook_url", "template_type", "updated_at", "version_published_at", "version", "webhook_url", "embed_edit_token", "demo", "latest_version", "last_changed_at", "last_changed_by_type", "last_changed_by_id", "last_changed_by_external_name", "last_changed_by_external_email", "last_changed_by_external_id", "defaults", "field_dependencies", "field_order", "fields", "footer_html", "header_html", "html_engine_options", "html", "predefined_fields", "scss", "shared_field_data", "template_schema_version", "versions"]
|
|
94
|
+
|
|
95
|
+
@field_validator('document_state')
|
|
96
|
+
def document_state_validate_enum(cls, value, info: ValidationInfo):
|
|
97
|
+
"""Validates the enum"""
|
|
98
|
+
# from_dict accepts enum values this client doesn't know about yet
|
|
99
|
+
if info.context and info.context.get("skip_enum_validation"):
|
|
100
|
+
return value
|
|
101
|
+
|
|
102
|
+
if value not in set(['pending', 'processed', 'password_required', 'malformed_pdf', 'unknown_error']):
|
|
103
|
+
raise ValueError("must be one of enum values ('pending', 'processed', 'password_required', 'malformed_pdf', 'unknown_error')")
|
|
104
|
+
return value
|
|
105
|
+
|
|
106
|
+
@field_validator('template_type')
|
|
107
|
+
def template_type_validate_enum(cls, value, info: ValidationInfo):
|
|
108
|
+
"""Validates the enum"""
|
|
109
|
+
# from_dict accepts enum values this client doesn't know about yet
|
|
110
|
+
if info.context and info.context.get("skip_enum_validation"):
|
|
111
|
+
return value
|
|
112
|
+
|
|
113
|
+
if value not in set(['pdf', 'html']):
|
|
114
|
+
raise ValueError("must be one of enum values ('pdf', 'html')")
|
|
115
|
+
return value
|
|
116
|
+
|
|
117
|
+
@field_validator('last_changed_by_type')
|
|
118
|
+
def last_changed_by_type_validate_enum(cls, value, info: ValidationInfo):
|
|
119
|
+
"""Validates the enum"""
|
|
120
|
+
# from_dict accepts enum values this client doesn't know about yet
|
|
121
|
+
if info.context and info.context.get("skip_enum_validation"):
|
|
122
|
+
return value
|
|
123
|
+
|
|
124
|
+
if value is None:
|
|
125
|
+
return value
|
|
126
|
+
|
|
127
|
+
if value not in set(['user', 'api', 'external_user']):
|
|
128
|
+
raise ValueError("must be one of enum values ('user', 'api', 'external_user')")
|
|
129
|
+
return value
|
|
130
|
+
|
|
131
|
+
model_config = ConfigDict(
|
|
132
|
+
populate_by_name=True,
|
|
133
|
+
validate_assignment=True,
|
|
134
|
+
protected_namespaces=(),
|
|
135
|
+
)
|
|
136
|
+
|
|
137
|
+
|
|
138
|
+
def to_str(self) -> str:
|
|
139
|
+
"""Returns the string representation of the model using alias"""
|
|
140
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
141
|
+
|
|
142
|
+
def to_json(self) -> str:
|
|
143
|
+
"""Returns the JSON representation of the model using alias"""
|
|
144
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
|
145
|
+
return json.dumps(self.to_dict())
|
|
146
|
+
|
|
147
|
+
@classmethod
|
|
148
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
149
|
+
"""Create an instance of Template from a JSON string"""
|
|
150
|
+
return cls.from_dict(json.loads(json_str))
|
|
151
|
+
|
|
152
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
153
|
+
"""Return the dictionary representation of the model using alias.
|
|
154
|
+
|
|
155
|
+
This has the following differences from calling pydantic's
|
|
156
|
+
`self.model_dump(by_alias=True)`:
|
|
157
|
+
|
|
158
|
+
* `None` is only added to the output dict for nullable fields that
|
|
159
|
+
were set at model initialization. Other fields with value `None`
|
|
160
|
+
are ignored.
|
|
161
|
+
"""
|
|
162
|
+
excluded_fields: Set[str] = set([
|
|
163
|
+
])
|
|
164
|
+
|
|
165
|
+
_dict = self.model_dump(
|
|
166
|
+
by_alias=True,
|
|
167
|
+
exclude=excluded_fields,
|
|
168
|
+
exclude_none=True,
|
|
169
|
+
)
|
|
170
|
+
# set to None if description (nullable) is None
|
|
171
|
+
# and model_fields_set contains the field
|
|
172
|
+
if self.description is None and "description" in self.model_fields_set:
|
|
173
|
+
_dict['description'] = None
|
|
174
|
+
|
|
175
|
+
# set to None if document_filename (nullable) is None
|
|
176
|
+
# and model_fields_set contains the field
|
|
177
|
+
if self.document_filename is None and "document_filename" in self.model_fields_set:
|
|
178
|
+
_dict['document_filename'] = None
|
|
179
|
+
|
|
180
|
+
# set to None if document_md5 (nullable) is None
|
|
181
|
+
# and model_fields_set contains the field
|
|
182
|
+
if self.document_md5 is None and "document_md5" in self.model_fields_set:
|
|
183
|
+
_dict['document_md5'] = None
|
|
184
|
+
|
|
185
|
+
# set to None if document_url (nullable) is None
|
|
186
|
+
# and model_fields_set contains the field
|
|
187
|
+
if self.document_url is None and "document_url" in self.model_fields_set:
|
|
188
|
+
_dict['document_url'] = None
|
|
189
|
+
|
|
190
|
+
# set to None if embed_domains (nullable) is None
|
|
191
|
+
# and model_fields_set contains the field
|
|
192
|
+
if self.embed_domains is None and "embed_domains" in self.model_fields_set:
|
|
193
|
+
_dict['embed_domains'] = None
|
|
194
|
+
|
|
195
|
+
# set to None if encrypt_pdfs_password (nullable) is None
|
|
196
|
+
# and model_fields_set contains the field
|
|
197
|
+
if self.encrypt_pdfs_password is None and "encrypt_pdfs_password" in self.model_fields_set:
|
|
198
|
+
_dict['encrypt_pdfs_password'] = None
|
|
199
|
+
|
|
200
|
+
# set to None if external_predefined_fields_template_id (nullable) is None
|
|
201
|
+
# and model_fields_set contains the field
|
|
202
|
+
if self.external_predefined_fields_template_id is None and "external_predefined_fields_template_id" in self.model_fields_set:
|
|
203
|
+
_dict['external_predefined_fields_template_id'] = None
|
|
204
|
+
|
|
205
|
+
# set to None if external_predefined_fields_template_name (nullable) is None
|
|
206
|
+
# and model_fields_set contains the field
|
|
207
|
+
if self.external_predefined_fields_template_name is None and "external_predefined_fields_template_name" in self.model_fields_set:
|
|
208
|
+
_dict['external_predefined_fields_template_name'] = None
|
|
209
|
+
|
|
210
|
+
# set to None if id (nullable) is None
|
|
211
|
+
# and model_fields_set contains the field
|
|
212
|
+
if self.id is None and "id" in self.model_fields_set:
|
|
213
|
+
_dict['id'] = None
|
|
214
|
+
|
|
215
|
+
# set to None if name (nullable) is None
|
|
216
|
+
# and model_fields_set contains the field
|
|
217
|
+
if self.name is None and "name" in self.model_fields_set:
|
|
218
|
+
_dict['name'] = None
|
|
219
|
+
|
|
220
|
+
# set to None if page_dimensions (nullable) is None
|
|
221
|
+
# and model_fields_set contains the field
|
|
222
|
+
if self.page_dimensions is None and "page_dimensions" in self.model_fields_set:
|
|
223
|
+
_dict['page_dimensions'] = None
|
|
224
|
+
|
|
225
|
+
# set to None if parent_folder_id (nullable) is None
|
|
226
|
+
# and model_fields_set contains the field
|
|
227
|
+
if self.parent_folder_id is None and "parent_folder_id" in self.model_fields_set:
|
|
228
|
+
_dict['parent_folder_id'] = None
|
|
229
|
+
|
|
230
|
+
# set to None if permanent_document_url (nullable) is None
|
|
231
|
+
# and model_fields_set contains the field
|
|
232
|
+
if self.permanent_document_url is None and "permanent_document_url" in self.model_fields_set:
|
|
233
|
+
_dict['permanent_document_url'] = None
|
|
234
|
+
|
|
235
|
+
# set to None if redirect_url (nullable) is None
|
|
236
|
+
# and model_fields_set contains the field
|
|
237
|
+
if self.redirect_url is None and "redirect_url" in self.model_fields_set:
|
|
238
|
+
_dict['redirect_url'] = None
|
|
239
|
+
|
|
240
|
+
# set to None if slack_webhook_url (nullable) is None
|
|
241
|
+
# and model_fields_set contains the field
|
|
242
|
+
if self.slack_webhook_url is None and "slack_webhook_url" in self.model_fields_set:
|
|
243
|
+
_dict['slack_webhook_url'] = None
|
|
244
|
+
|
|
245
|
+
# set to None if updated_at (nullable) is None
|
|
246
|
+
# and model_fields_set contains the field
|
|
247
|
+
if self.updated_at is None and "updated_at" in self.model_fields_set:
|
|
248
|
+
_dict['updated_at'] = None
|
|
249
|
+
|
|
250
|
+
# set to None if version_published_at (nullable) is None
|
|
251
|
+
# and model_fields_set contains the field
|
|
252
|
+
if self.version_published_at is None and "version_published_at" in self.model_fields_set:
|
|
253
|
+
_dict['version_published_at'] = None
|
|
254
|
+
|
|
255
|
+
# set to None if version (nullable) is None
|
|
256
|
+
# and model_fields_set contains the field
|
|
257
|
+
if self.version is None and "version" in self.model_fields_set:
|
|
258
|
+
_dict['version'] = None
|
|
259
|
+
|
|
260
|
+
# set to None if webhook_url (nullable) is None
|
|
261
|
+
# and model_fields_set contains the field
|
|
262
|
+
if self.webhook_url is None and "webhook_url" in self.model_fields_set:
|
|
263
|
+
_dict['webhook_url'] = None
|
|
264
|
+
|
|
265
|
+
# set to None if embed_edit_token (nullable) is None
|
|
266
|
+
# and model_fields_set contains the field
|
|
267
|
+
if self.embed_edit_token is None and "embed_edit_token" in self.model_fields_set:
|
|
268
|
+
_dict['embed_edit_token'] = None
|
|
269
|
+
|
|
270
|
+
# set to None if latest_version (nullable) is None
|
|
271
|
+
# and model_fields_set contains the field
|
|
272
|
+
if self.latest_version is None and "latest_version" in self.model_fields_set:
|
|
273
|
+
_dict['latest_version'] = None
|
|
274
|
+
|
|
275
|
+
# set to None if last_changed_at (nullable) is None
|
|
276
|
+
# and model_fields_set contains the field
|
|
277
|
+
if self.last_changed_at is None and "last_changed_at" in self.model_fields_set:
|
|
278
|
+
_dict['last_changed_at'] = None
|
|
279
|
+
|
|
280
|
+
# set to None if last_changed_by_type (nullable) is None
|
|
281
|
+
# and model_fields_set contains the field
|
|
282
|
+
if self.last_changed_by_type is None and "last_changed_by_type" in self.model_fields_set:
|
|
283
|
+
_dict['last_changed_by_type'] = None
|
|
284
|
+
|
|
285
|
+
# set to None if last_changed_by_id (nullable) is None
|
|
286
|
+
# and model_fields_set contains the field
|
|
287
|
+
if self.last_changed_by_id is None and "last_changed_by_id" in self.model_fields_set:
|
|
288
|
+
_dict['last_changed_by_id'] = None
|
|
289
|
+
|
|
290
|
+
# set to None if last_changed_by_external_name (nullable) is None
|
|
291
|
+
# and model_fields_set contains the field
|
|
292
|
+
if self.last_changed_by_external_name is None and "last_changed_by_external_name" in self.model_fields_set:
|
|
293
|
+
_dict['last_changed_by_external_name'] = None
|
|
294
|
+
|
|
295
|
+
# set to None if last_changed_by_external_email (nullable) is None
|
|
296
|
+
# and model_fields_set contains the field
|
|
297
|
+
if self.last_changed_by_external_email is None and "last_changed_by_external_email" in self.model_fields_set:
|
|
298
|
+
_dict['last_changed_by_external_email'] = None
|
|
299
|
+
|
|
300
|
+
# set to None if last_changed_by_external_id (nullable) is None
|
|
301
|
+
# and model_fields_set contains the field
|
|
302
|
+
if self.last_changed_by_external_id is None and "last_changed_by_external_id" in self.model_fields_set:
|
|
303
|
+
_dict['last_changed_by_external_id'] = None
|
|
304
|
+
|
|
305
|
+
# set to None if footer_html (nullable) is None
|
|
306
|
+
# and model_fields_set contains the field
|
|
307
|
+
if self.footer_html is None and "footer_html" in self.model_fields_set:
|
|
308
|
+
_dict['footer_html'] = None
|
|
309
|
+
|
|
310
|
+
# set to None if header_html (nullable) is None
|
|
311
|
+
# and model_fields_set contains the field
|
|
312
|
+
if self.header_html is None and "header_html" in self.model_fields_set:
|
|
313
|
+
_dict['header_html'] = None
|
|
314
|
+
|
|
315
|
+
# set to None if html (nullable) is None
|
|
316
|
+
# and model_fields_set contains the field
|
|
317
|
+
if self.html is None and "html" in self.model_fields_set:
|
|
318
|
+
_dict['html'] = None
|
|
319
|
+
|
|
320
|
+
# set to None if scss (nullable) is None
|
|
321
|
+
# and model_fields_set contains the field
|
|
322
|
+
if self.scss is None and "scss" in self.model_fields_set:
|
|
323
|
+
_dict['scss'] = None
|
|
324
|
+
|
|
325
|
+
return _dict
|
|
326
|
+
|
|
327
|
+
@classmethod
|
|
328
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
329
|
+
"""Create an instance of Template from a dict"""
|
|
330
|
+
if obj is None:
|
|
331
|
+
return None
|
|
332
|
+
|
|
333
|
+
if not isinstance(obj, dict):
|
|
334
|
+
return cls.model_validate(obj, context={"skip_enum_validation": True})
|
|
335
|
+
|
|
336
|
+
_obj = cls.model_validate({
|
|
337
|
+
"add_data_request_submission_id_footers": obj.get("add_data_request_submission_id_footers"),
|
|
338
|
+
"allow_additional_properties": obj.get("allow_additional_properties"),
|
|
339
|
+
"description": obj.get("description"),
|
|
340
|
+
"document_filename": obj.get("document_filename"),
|
|
341
|
+
"document_md5": obj.get("document_md5"),
|
|
342
|
+
"document_parse_error": obj.get("document_parse_error"),
|
|
343
|
+
"document_processed": obj.get("document_processed"),
|
|
344
|
+
"document_state": obj.get("document_state"),
|
|
345
|
+
"document_url": obj.get("document_url"),
|
|
346
|
+
"editable_submissions": obj.get("editable_submissions"),
|
|
347
|
+
"embed_domains": obj.get("embed_domains"),
|
|
348
|
+
"embed_edit_allow_settings": obj.get("embed_edit_allow_settings"),
|
|
349
|
+
"embed_edit_allow_versioning": obj.get("embed_edit_allow_versioning"),
|
|
350
|
+
"embed_edit_allow_document_replacement": obj.get("embed_edit_allow_document_replacement"),
|
|
351
|
+
"encrypt_pdfs_password": obj.get("encrypt_pdfs_password"),
|
|
352
|
+
"encrypt_pdfs": obj.get("encrypt_pdfs"),
|
|
353
|
+
"expiration_interval": obj.get("expiration_interval"),
|
|
354
|
+
"expire_after": obj.get("expire_after"),
|
|
355
|
+
"expire_submissions": obj.get("expire_submissions"),
|
|
356
|
+
"external_predefined_fields_template_id": obj.get("external_predefined_fields_template_id"),
|
|
357
|
+
"external_predefined_fields_template_name": obj.get("external_predefined_fields_template_name"),
|
|
358
|
+
"first_template": obj.get("first_template"),
|
|
359
|
+
"id": obj.get("id"),
|
|
360
|
+
"locked": obj.get("locked"),
|
|
361
|
+
"merge_audit_trail_pdf": obj.get("merge_audit_trail_pdf"),
|
|
362
|
+
"name": obj.get("name"),
|
|
363
|
+
"page_count": obj.get("page_count"),
|
|
364
|
+
"page_dimensions": obj.get("page_dimensions"),
|
|
365
|
+
"parent_folder_id": obj.get("parent_folder_id"),
|
|
366
|
+
"path": obj.get("path"),
|
|
367
|
+
"permanent_document_url": obj.get("permanent_document_url"),
|
|
368
|
+
"public_submissions": obj.get("public_submissions"),
|
|
369
|
+
"public_web_form": obj.get("public_web_form"),
|
|
370
|
+
"redirect_url": obj.get("redirect_url"),
|
|
371
|
+
"slack_webhook_url": obj.get("slack_webhook_url"),
|
|
372
|
+
"template_type": obj.get("template_type"),
|
|
373
|
+
"updated_at": obj.get("updated_at"),
|
|
374
|
+
"version_published_at": obj.get("version_published_at"),
|
|
375
|
+
"version": obj.get("version"),
|
|
376
|
+
"webhook_url": obj.get("webhook_url"),
|
|
377
|
+
"embed_edit_token": obj.get("embed_edit_token"),
|
|
378
|
+
"demo": obj.get("demo"),
|
|
379
|
+
"latest_version": obj.get("latest_version"),
|
|
380
|
+
"last_changed_at": obj.get("last_changed_at"),
|
|
381
|
+
"last_changed_by_type": obj.get("last_changed_by_type"),
|
|
382
|
+
"last_changed_by_id": obj.get("last_changed_by_id"),
|
|
383
|
+
"last_changed_by_external_name": obj.get("last_changed_by_external_name"),
|
|
384
|
+
"last_changed_by_external_email": obj.get("last_changed_by_external_email"),
|
|
385
|
+
"last_changed_by_external_id": obj.get("last_changed_by_external_id"),
|
|
386
|
+
"defaults": obj.get("defaults"),
|
|
387
|
+
"field_dependencies": obj.get("field_dependencies"),
|
|
388
|
+
"field_order": obj.get("field_order"),
|
|
389
|
+
"fields": obj.get("fields"),
|
|
390
|
+
"footer_html": obj.get("footer_html"),
|
|
391
|
+
"header_html": obj.get("header_html"),
|
|
392
|
+
"html_engine_options": obj.get("html_engine_options"),
|
|
393
|
+
"html": obj.get("html"),
|
|
394
|
+
"predefined_fields": obj.get("predefined_fields"),
|
|
395
|
+
"scss": obj.get("scss"),
|
|
396
|
+
"shared_field_data": obj.get("shared_field_data"),
|
|
397
|
+
"template_schema_version": obj.get("template_schema_version"),
|
|
398
|
+
"versions": obj.get("versions")
|
|
399
|
+
}, context={"skip_enum_validation": True})
|
|
400
|
+
return _obj
|
|
401
|
+
|
|
402
|
+
|