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.
Files changed (72) hide show
  1. docspring/__init__.py +250 -0
  2. docspring/api/__init__.py +20 -0
  3. docspring/api/client.py +13430 -0
  4. docspring/api_client.py +805 -0
  5. docspring/api_response.py +21 -0
  6. docspring/configuration.py +598 -0
  7. docspring/exceptions.py +217 -0
  8. docspring/models/__init__.py +146 -0
  9. docspring/models/add_fields_data.py +88 -0
  10. docspring/models/batch_generate_pdfs201_response.py +111 -0
  11. docspring/models/combine_pdfs_data.py +98 -0
  12. docspring/models/combined_submission.py +173 -0
  13. docspring/models/combined_submission_action.py +156 -0
  14. docspring/models/copy_template_options.py +92 -0
  15. docspring/models/create_combined_submission_response.py +107 -0
  16. docspring/models/create_custom_file_data.py +89 -0
  17. docspring/models/create_custom_file_response.py +107 -0
  18. docspring/models/create_folder_data.py +88 -0
  19. docspring/models/create_html_template.py +88 -0
  20. docspring/models/create_pdf_submission_data.py +112 -0
  21. docspring/models/create_pdf_template.py +88 -0
  22. docspring/models/create_submission_data_request_data.py +187 -0
  23. docspring/models/create_submission_data_request_event_request.py +134 -0
  24. docspring/models/create_submission_data_request_event_response.py +107 -0
  25. docspring/models/create_submission_data_request_response.py +107 -0
  26. docspring/models/create_submission_data_request_token_response.py +107 -0
  27. docspring/models/create_submission_response.py +107 -0
  28. docspring/models/create_webhook_data.py +88 -0
  29. docspring/models/custom_file.py +100 -0
  30. docspring/models/error_or_multiple_errors_response.py +103 -0
  31. docspring/models/error_response.py +101 -0
  32. docspring/models/folder.py +114 -0
  33. docspring/models/json_schema.py +110 -0
  34. docspring/models/list_submissions_response.py +105 -0
  35. docspring/models/move_folder_data.py +93 -0
  36. docspring/models/move_template_data.py +95 -0
  37. docspring/models/multiple_errors_response.py +101 -0
  38. docspring/models/publish_version_data.py +90 -0
  39. docspring/models/rename_folder_data.py +88 -0
  40. docspring/models/restore_version_data.py +88 -0
  41. docspring/models/submission.py +287 -0
  42. docspring/models/submission422_response.py +109 -0
  43. docspring/models/submission_action.py +148 -0
  44. docspring/models/submission_batch.py +123 -0
  45. docspring/models/submission_batch_data.py +106 -0
  46. docspring/models/submission_batch_with_submissions.py +133 -0
  47. docspring/models/submission_data_request.py +253 -0
  48. docspring/models/submission_data_request_event.py +155 -0
  49. docspring/models/submission_data_request_show.py +260 -0
  50. docspring/models/submission_data_request_token.py +109 -0
  51. docspring/models/submission_preview.py +257 -0
  52. docspring/models/success_error_response.py +101 -0
  53. docspring/models/success_multiple_errors_response.py +101 -0
  54. docspring/models/template.py +402 -0
  55. docspring/models/template_add_fields_response.py +103 -0
  56. docspring/models/template_delete_response.py +110 -0
  57. docspring/models/template_model_code_response.py +103 -0
  58. docspring/models/template_preview.py +356 -0
  59. docspring/models/template_publish_version_response.py +103 -0
  60. docspring/models/update_html_template.py +88 -0
  61. docspring/models/update_pdf_template.py +88 -0
  62. docspring/models/update_submission_data_request_data.py +185 -0
  63. docspring/models/update_webhook_data.py +88 -0
  64. docspring/models/upload_presign_response.py +108 -0
  65. docspring/models/webhook.py +185 -0
  66. docspring/py.typed +0 -0
  67. docspring/rest.py +259 -0
  68. docspring-3.1.0.dist-info/METADATA +245 -0
  69. docspring-3.1.0.dist-info/RECORD +72 -0
  70. docspring-3.1.0.dist-info/WHEEL +5 -0
  71. docspring-3.1.0.dist-info/licenses/LICENSE +7 -0
  72. docspring-3.1.0.dist-info/top_level.txt +1 -0
@@ -0,0 +1,103 @@
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 TemplatePublishVersionResponse(BaseModel):
27
+ """
28
+ TemplatePublishVersionResponse
29
+ """ # noqa: E501
30
+ status: StrictStr
31
+ result: Dict[str, Any]
32
+ errors: Optional[List[StrictStr]] = None
33
+ __properties: ClassVar[List[str]] = ["status", "result", "errors"]
34
+
35
+ @field_validator('status')
36
+ def status_validate_enum(cls, value, info: ValidationInfo):
37
+ """Validates the enum"""
38
+ # from_dict accepts enum values this client doesn't know about yet
39
+ if info.context and info.context.get("skip_enum_validation"):
40
+ return value
41
+
42
+ if value not in set(['success', 'error']):
43
+ raise ValueError("must be one of enum values ('success', 'error')")
44
+ return value
45
+
46
+ model_config = ConfigDict(
47
+ populate_by_name=True,
48
+ validate_assignment=True,
49
+ protected_namespaces=(),
50
+ )
51
+
52
+
53
+ def to_str(self) -> str:
54
+ """Returns the string representation of the model using alias"""
55
+ return pprint.pformat(self.model_dump(by_alias=True))
56
+
57
+ def to_json(self) -> str:
58
+ """Returns the JSON representation of the model using alias"""
59
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
60
+ return json.dumps(self.to_dict())
61
+
62
+ @classmethod
63
+ def from_json(cls, json_str: str) -> Optional[Self]:
64
+ """Create an instance of TemplatePublishVersionResponse from a JSON string"""
65
+ return cls.from_dict(json.loads(json_str))
66
+
67
+ def to_dict(self) -> Dict[str, Any]:
68
+ """Return the dictionary representation of the model using alias.
69
+
70
+ This has the following differences from calling pydantic's
71
+ `self.model_dump(by_alias=True)`:
72
+
73
+ * `None` is only added to the output dict for nullable fields that
74
+ were set at model initialization. Other fields with value `None`
75
+ are ignored.
76
+ """
77
+ excluded_fields: Set[str] = set([
78
+ ])
79
+
80
+ _dict = self.model_dump(
81
+ by_alias=True,
82
+ exclude=excluded_fields,
83
+ exclude_none=True,
84
+ )
85
+ return _dict
86
+
87
+ @classmethod
88
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
89
+ """Create an instance of TemplatePublishVersionResponse from a dict"""
90
+ if obj is None:
91
+ return None
92
+
93
+ if not isinstance(obj, dict):
94
+ return cls.model_validate(obj, context={"skip_enum_validation": True})
95
+
96
+ _obj = cls.model_validate({
97
+ "status": obj.get("status"),
98
+ "result": obj.get("result"),
99
+ "errors": obj.get("errors")
100
+ }, context={"skip_enum_validation": True})
101
+ return _obj
102
+
103
+
@@ -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 UpdateHtmlTemplate(BaseModel):
27
+ """
28
+ UpdateHtmlTemplate
29
+ """ # noqa: E501
30
+ template: Dict[str, Any]
31
+ __properties: ClassVar[List[str]] = ["template"]
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 UpdateHtmlTemplate 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 UpdateHtmlTemplate 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
+ "template": obj.get("template")
85
+ }, context={"skip_enum_validation": True})
86
+ return _obj
87
+
88
+
@@ -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 UpdatePdfTemplate(BaseModel):
27
+ """
28
+ UpdatePdfTemplate
29
+ """ # noqa: E501
30
+ template: Dict[str, Any]
31
+ __properties: ClassVar[List[str]] = ["template"]
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 UpdatePdfTemplate 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 UpdatePdfTemplate 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
+ "template": obj.get("template")
85
+ }, context={"skip_enum_validation": True})
86
+ return _obj
87
+
88
+
@@ -0,0 +1,185 @@
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, StrictInt, 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 UpdateSubmissionDataRequestData(BaseModel):
27
+ """
28
+ UpdateSubmissionDataRequestData
29
+ """ # noqa: E501
30
+ auth_phone_number_hash: Optional[StrictStr] = None
31
+ auth_provider: Optional[StrictStr] = None
32
+ auth_second_factor_type: Optional[StrictStr] = None
33
+ auth_session_id_hash: Optional[StrictStr] = None
34
+ auth_session_started_at: Optional[StrictStr] = None
35
+ auth_type: Optional[StrictStr] = None
36
+ auth_user_id_hash: Optional[StrictStr] = None
37
+ auth_username_hash: Optional[StrictStr] = None
38
+ email: Optional[StrictStr] = None
39
+ fields: Optional[List[StrictStr]] = None
40
+ metadata: Optional[Dict[str, Any]] = None
41
+ name: Optional[StrictStr] = None
42
+ order: Optional[StrictInt] = None
43
+ __properties: ClassVar[List[str]] = ["auth_phone_number_hash", "auth_provider", "auth_second_factor_type", "auth_session_id_hash", "auth_session_started_at", "auth_type", "auth_user_id_hash", "auth_username_hash", "email", "fields", "metadata", "name", "order"]
44
+
45
+ @field_validator('auth_second_factor_type')
46
+ def auth_second_factor_type_validate_enum(cls, value, info: ValidationInfo):
47
+ """Validates the enum"""
48
+ # from_dict accepts enum values this client doesn't know about yet
49
+ if info.context and info.context.get("skip_enum_validation"):
50
+ return value
51
+
52
+ if value is None:
53
+ return value
54
+
55
+ if value not in set(['none', 'phone_number', 'totp', 'mobile_push', 'security_key', 'fingerprint', '']):
56
+ raise ValueError("must be one of enum values ('none', 'phone_number', 'totp', 'mobile_push', 'security_key', 'fingerprint', '')")
57
+ return value
58
+
59
+ @field_validator('auth_type')
60
+ def auth_type_validate_enum(cls, value, info: ValidationInfo):
61
+ """Validates the enum"""
62
+ # from_dict accepts enum values this client doesn't know about yet
63
+ if info.context and info.context.get("skip_enum_validation"):
64
+ return value
65
+
66
+ if value is None:
67
+ return value
68
+
69
+ if value not in set(['none', 'password', 'oauth', 'email_link', 'phone_number', 'ldap', 'saml']):
70
+ raise ValueError("must be one of enum values ('none', 'password', 'oauth', 'email_link', 'phone_number', 'ldap', 'saml')")
71
+ return value
72
+
73
+ model_config = ConfigDict(
74
+ populate_by_name=True,
75
+ validate_assignment=True,
76
+ protected_namespaces=(),
77
+ )
78
+
79
+
80
+ def to_str(self) -> str:
81
+ """Returns the string representation of the model using alias"""
82
+ return pprint.pformat(self.model_dump(by_alias=True))
83
+
84
+ def to_json(self) -> str:
85
+ """Returns the JSON representation of the model using alias"""
86
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
87
+ return json.dumps(self.to_dict())
88
+
89
+ @classmethod
90
+ def from_json(cls, json_str: str) -> Optional[Self]:
91
+ """Create an instance of UpdateSubmissionDataRequestData from a JSON string"""
92
+ return cls.from_dict(json.loads(json_str))
93
+
94
+ def to_dict(self) -> Dict[str, Any]:
95
+ """Return the dictionary representation of the model using alias.
96
+
97
+ This has the following differences from calling pydantic's
98
+ `self.model_dump(by_alias=True)`:
99
+
100
+ * `None` is only added to the output dict for nullable fields that
101
+ were set at model initialization. Other fields with value `None`
102
+ are ignored.
103
+ """
104
+ excluded_fields: Set[str] = set([
105
+ ])
106
+
107
+ _dict = self.model_dump(
108
+ by_alias=True,
109
+ exclude=excluded_fields,
110
+ exclude_none=True,
111
+ )
112
+ # set to None if auth_phone_number_hash (nullable) is None
113
+ # and model_fields_set contains the field
114
+ if self.auth_phone_number_hash is None and "auth_phone_number_hash" in self.model_fields_set:
115
+ _dict['auth_phone_number_hash'] = None
116
+
117
+ # set to None if auth_provider (nullable) is None
118
+ # and model_fields_set contains the field
119
+ if self.auth_provider is None and "auth_provider" in self.model_fields_set:
120
+ _dict['auth_provider'] = None
121
+
122
+ # set to None if auth_second_factor_type (nullable) is None
123
+ # and model_fields_set contains the field
124
+ if self.auth_second_factor_type is None and "auth_second_factor_type" in self.model_fields_set:
125
+ _dict['auth_second_factor_type'] = None
126
+
127
+ # set to None if auth_session_id_hash (nullable) is None
128
+ # and model_fields_set contains the field
129
+ if self.auth_session_id_hash is None and "auth_session_id_hash" in self.model_fields_set:
130
+ _dict['auth_session_id_hash'] = None
131
+
132
+ # set to None if auth_session_started_at (nullable) is None
133
+ # and model_fields_set contains the field
134
+ if self.auth_session_started_at is None and "auth_session_started_at" in self.model_fields_set:
135
+ _dict['auth_session_started_at'] = None
136
+
137
+ # set to None if auth_user_id_hash (nullable) is None
138
+ # and model_fields_set contains the field
139
+ if self.auth_user_id_hash is None and "auth_user_id_hash" in self.model_fields_set:
140
+ _dict['auth_user_id_hash'] = None
141
+
142
+ # set to None if auth_username_hash (nullable) is None
143
+ # and model_fields_set contains the field
144
+ if self.auth_username_hash is None and "auth_username_hash" in self.model_fields_set:
145
+ _dict['auth_username_hash'] = None
146
+
147
+ # set to None if email (nullable) is None
148
+ # and model_fields_set contains the field
149
+ if self.email is None and "email" in self.model_fields_set:
150
+ _dict['email'] = None
151
+
152
+ # set to None if name (nullable) is None
153
+ # and model_fields_set contains the field
154
+ if self.name is None and "name" in self.model_fields_set:
155
+ _dict['name'] = None
156
+
157
+ return _dict
158
+
159
+ @classmethod
160
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
161
+ """Create an instance of UpdateSubmissionDataRequestData from a dict"""
162
+ if obj is None:
163
+ return None
164
+
165
+ if not isinstance(obj, dict):
166
+ return cls.model_validate(obj, context={"skip_enum_validation": True})
167
+
168
+ _obj = cls.model_validate({
169
+ "auth_phone_number_hash": obj.get("auth_phone_number_hash"),
170
+ "auth_provider": obj.get("auth_provider"),
171
+ "auth_second_factor_type": obj.get("auth_second_factor_type"),
172
+ "auth_session_id_hash": obj.get("auth_session_id_hash"),
173
+ "auth_session_started_at": obj.get("auth_session_started_at"),
174
+ "auth_type": obj.get("auth_type"),
175
+ "auth_user_id_hash": obj.get("auth_user_id_hash"),
176
+ "auth_username_hash": obj.get("auth_username_hash"),
177
+ "email": obj.get("email"),
178
+ "fields": obj.get("fields"),
179
+ "metadata": obj.get("metadata"),
180
+ "name": obj.get("name"),
181
+ "order": obj.get("order")
182
+ }, context={"skip_enum_validation": True})
183
+ return _obj
184
+
185
+
@@ -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 UpdateWebhookData(BaseModel):
27
+ """
28
+ UpdateWebhookData
29
+ """ # noqa: E501
30
+ webhook: Dict[str, Any]
31
+ __properties: ClassVar[List[str]] = ["webhook"]
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 UpdateWebhookData 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 UpdateWebhookData 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
+ "webhook": obj.get("webhook")
85
+ }, context={"skip_enum_validation": True})
86
+ return _obj
87
+
88
+
@@ -0,0 +1,108 @@
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 UploadPresignResponse(BaseModel):
27
+ """
28
+ UploadPresignResponse
29
+ """ # noqa: E501
30
+ fields: Dict[str, Any]
31
+ headers: Dict[str, Any]
32
+ url: StrictStr
33
+ method: Optional[StrictStr] = None
34
+ __properties: ClassVar[List[str]] = ["fields", "headers", "url", "method"]
35
+
36
+ @field_validator('method')
37
+ def method_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 is None:
44
+ return value
45
+
46
+ if value not in set(['post']):
47
+ raise ValueError("must be one of enum values ('post')")
48
+ return value
49
+
50
+ model_config = ConfigDict(
51
+ populate_by_name=True,
52
+ validate_assignment=True,
53
+ protected_namespaces=(),
54
+ )
55
+
56
+
57
+ def to_str(self) -> str:
58
+ """Returns the string representation of the model using alias"""
59
+ return pprint.pformat(self.model_dump(by_alias=True))
60
+
61
+ def to_json(self) -> str:
62
+ """Returns the JSON representation of the model using alias"""
63
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
64
+ return json.dumps(self.to_dict())
65
+
66
+ @classmethod
67
+ def from_json(cls, json_str: str) -> Optional[Self]:
68
+ """Create an instance of UploadPresignResponse from a JSON string"""
69
+ return cls.from_dict(json.loads(json_str))
70
+
71
+ def to_dict(self) -> Dict[str, Any]:
72
+ """Return the dictionary representation of the model using alias.
73
+
74
+ This has the following differences from calling pydantic's
75
+ `self.model_dump(by_alias=True)`:
76
+
77
+ * `None` is only added to the output dict for nullable fields that
78
+ were set at model initialization. Other fields with value `None`
79
+ are ignored.
80
+ """
81
+ excluded_fields: Set[str] = set([
82
+ ])
83
+
84
+ _dict = self.model_dump(
85
+ by_alias=True,
86
+ exclude=excluded_fields,
87
+ exclude_none=True,
88
+ )
89
+ return _dict
90
+
91
+ @classmethod
92
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
93
+ """Create an instance of UploadPresignResponse 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
+ "fields": obj.get("fields"),
102
+ "headers": obj.get("headers"),
103
+ "url": obj.get("url"),
104
+ "method": obj.get("method")
105
+ }, context={"skip_enum_validation": True})
106
+ return _obj
107
+
108
+