signwell-sdk-python 0.1.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (110) hide show
  1. signwell_sdk/__init__.py +287 -0
  2. signwell_sdk/api/__init__.py +10 -0
  3. signwell_sdk/api/api_application_api.py +481 -0
  4. signwell_sdk/api/bulk_send_api.py +1589 -0
  5. signwell_sdk/api/document_api.py +2425 -0
  6. signwell_sdk/api/me_api.py +246 -0
  7. signwell_sdk/api/regional_api.py +345 -0
  8. signwell_sdk/api/template_api.py +1298 -0
  9. signwell_sdk/api/webhooks_api.py +710 -0
  10. signwell_sdk/api_client.py +747 -0
  11. signwell_sdk/api_response.py +20 -0
  12. signwell_sdk/configuration.py +599 -0
  13. signwell_sdk/embedded.py +385 -0
  14. signwell_sdk/exceptions.py +314 -0
  15. signwell_sdk/models/__init__.py +114 -0
  16. signwell_sdk/models/account_info_response.py +143 -0
  17. signwell_sdk/models/account_info_response_active_users_inner.py +107 -0
  18. signwell_sdk/models/account_info_response_preferences.py +147 -0
  19. signwell_sdk/models/additional_fields_inner_inner.py +274 -0
  20. signwell_sdk/models/additional_fields_inner_inner_value.py +189 -0
  21. signwell_sdk/models/additional_files_inner.py +103 -0
  22. signwell_sdk/models/api_application_response.py +137 -0
  23. signwell_sdk/models/api_application_response_owner.py +107 -0
  24. signwell_sdk/models/api_application_response_preferences.py +135 -0
  25. signwell_sdk/models/attachment_request_info.py +99 -0
  26. signwell_sdk/models/attachment_requests_inner.py +110 -0
  27. signwell_sdk/models/bulk_send_create_response.py +132 -0
  28. signwell_sdk/models/bulk_send_csv_request.py +100 -0
  29. signwell_sdk/models/bulk_send_csv_template_response.py +97 -0
  30. signwell_sdk/models/bulk_send_documents_response.py +167 -0
  31. signwell_sdk/models/bulk_send_list_item.py +141 -0
  32. signwell_sdk/models/bulk_send_list_response.py +138 -0
  33. signwell_sdk/models/bulk_send_response.py +151 -0
  34. signwell_sdk/models/bulk_send_response_templates_inner.py +98 -0
  35. signwell_sdk/models/bulk_send_validate_csv_response.py +129 -0
  36. signwell_sdk/models/checkbox_group_info.py +138 -0
  37. signwell_sdk/models/checkbox_groups_inner.py +136 -0
  38. signwell_sdk/models/checkbox_validation.py +35 -0
  39. signwell_sdk/models/completed_pdf_response.py +177 -0
  40. signwell_sdk/models/completed_pdf_url_response.py +97 -0
  41. signwell_sdk/models/copied_contact_info.py +99 -0
  42. signwell_sdk/models/copied_contacts_inner.py +98 -0
  43. signwell_sdk/models/copied_placeholders_inner.py +111 -0
  44. signwell_sdk/models/create_bulk_send_request.py +155 -0
  45. signwell_sdk/models/create_webhook_request.py +100 -0
  46. signwell_sdk/models/date_format.py +36 -0
  47. signwell_sdk/models/detailed_option.py +105 -0
  48. signwell_sdk/models/document_from_template_request.py +377 -0
  49. signwell_sdk/models/document_from_template_response.py +353 -0
  50. signwell_sdk/models/document_from_template_response_fields_inner_inner.py +270 -0
  51. signwell_sdk/models/document_from_template_response_fields_inner_inner_recipient.py +99 -0
  52. signwell_sdk/models/document_from_template_response_recipients_inner.py +206 -0
  53. signwell_sdk/models/document_list_response.py +138 -0
  54. signwell_sdk/models/document_request.py +350 -0
  55. signwell_sdk/models/document_response.py +357 -0
  56. signwell_sdk/models/document_response_attachment_requests_inner.py +101 -0
  57. signwell_sdk/models/document_response_fields_inner_inner.py +268 -0
  58. signwell_sdk/models/document_response_fields_inner_inner_options_inner.py +101 -0
  59. signwell_sdk/models/document_response_fields_inner_inner_recipient.py +98 -0
  60. signwell_sdk/models/document_response_fields_inner_inner_value.py +195 -0
  61. signwell_sdk/models/document_response_recipients_inner.py +208 -0
  62. signwell_sdk/models/document_template_list_response.py +138 -0
  63. signwell_sdk/models/document_template_request.py +307 -0
  64. signwell_sdk/models/document_template_response.py +323 -0
  65. signwell_sdk/models/document_template_response_copied_placeholders_inner.py +131 -0
  66. signwell_sdk/models/document_template_response_placeholders_inner.py +144 -0
  67. signwell_sdk/models/document_template_update_request.py +208 -0
  68. signwell_sdk/models/dropdown_option.py +153 -0
  69. signwell_sdk/models/error_response.py +107 -0
  70. signwell_sdk/models/error_response_meta.py +101 -0
  71. signwell_sdk/models/field_type.py +46 -0
  72. signwell_sdk/models/fields_inner_inner.py +268 -0
  73. signwell_sdk/models/file_format.py +33 -0
  74. signwell_sdk/models/file_info.py +98 -0
  75. signwell_sdk/models/files_inner.py +103 -0
  76. signwell_sdk/models/label_info.py +98 -0
  77. signwell_sdk/models/label_request.py +97 -0
  78. signwell_sdk/models/label_response.py +98 -0
  79. signwell_sdk/models/me_response.py +130 -0
  80. signwell_sdk/models/me_response_contact.py +147 -0
  81. signwell_sdk/models/me_response_user.py +117 -0
  82. signwell_sdk/models/me_response_user_preferences.py +105 -0
  83. signwell_sdk/models/nom151_certificate_response.py +107 -0
  84. signwell_sdk/models/nom151_certificate_response_nom151.py +125 -0
  85. signwell_sdk/models/nom151_url_response.py +97 -0
  86. signwell_sdk/models/pagination_meta.py +119 -0
  87. signwell_sdk/models/placeholders_inner.py +115 -0
  88. signwell_sdk/models/rate_limit_error_response.py +97 -0
  89. signwell_sdk/models/recipients_inner.py +141 -0
  90. signwell_sdk/models/reminder_recipients_inner.py +100 -0
  91. signwell_sdk/models/send_reminder_request.py +114 -0
  92. signwell_sdk/models/template_attachment_requests_inner.py +110 -0
  93. signwell_sdk/models/template_checkbox_groups_inner.py +136 -0
  94. signwell_sdk/models/template_field_values_inner.py +109 -0
  95. signwell_sdk/models/template_field_values_inner_value.py +189 -0
  96. signwell_sdk/models/template_fields_inner_inner.py +266 -0
  97. signwell_sdk/models/template_recipients_inner.py +146 -0
  98. signwell_sdk/models/text_validation.py +42 -0
  99. signwell_sdk/models/update_document_and_send_request.py +234 -0
  100. signwell_sdk/models/update_recipients_map_inner.py +118 -0
  101. signwell_sdk/models/update_recipients_request.py +111 -0
  102. signwell_sdk/models/validation_error_response.py +99 -0
  103. signwell_sdk/models/webhook_response.py +110 -0
  104. signwell_sdk/py.typed +0 -0
  105. signwell_sdk/rest.py +209 -0
  106. signwell_sdk/webhook.py +214 -0
  107. signwell_sdk_python-0.1.0.dist-info/METADATA +177 -0
  108. signwell_sdk_python-0.1.0.dist-info/RECORD +110 -0
  109. signwell_sdk_python-0.1.0.dist-info/WHEEL +4 -0
  110. signwell_sdk_python-0.1.0.dist-info/licenses/LICENSE +21 -0
@@ -0,0 +1,268 @@
1
+ """
2
+ SignWell Developer API
3
+
4
+ API for creating, managing, and tracking electronic signature workflows.
5
+
6
+ The version of the OpenAPI document: v1
7
+ Contact: support@signwell.com
8
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
9
+
10
+ Do not edit the class manually.
11
+ """ # noqa: E501
12
+
13
+ from __future__ import annotations
14
+ import pprint
15
+ import re # noqa: F401
16
+ import json
17
+
18
+ from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictFloat, StrictInt, StrictStr
19
+ from typing import Any, ClassVar, Dict, List, Optional, Union
20
+ from signwell_sdk.models.additional_fields_inner_inner_value import AdditionalFieldsInnerInnerValue
21
+ from signwell_sdk.models.date_format import DateFormat
22
+ from signwell_sdk.models.dropdown_option import DropdownOption
23
+ from signwell_sdk.models.field_type import FieldType
24
+ from signwell_sdk.models.text_validation import TextValidation
25
+ from pydantic import model_validator
26
+ from typing import Any, Optional, Set, get_args
27
+ from typing_extensions import Self
28
+
29
+
30
+ class FieldsInnerInner(BaseModel):
31
+ """
32
+ FieldsInnerInner
33
+ """ # noqa: E501
34
+
35
+ x: Union[StrictFloat, StrictInt] = Field(
36
+ description="Horizontal value in the coordinates of the field (in pixels). Coordinates are specific to the page where fields are located."
37
+ )
38
+ y: Union[StrictFloat, StrictInt] = Field(
39
+ description="Vertical value in the coordinates of the field (in pixels). Coordinates are specific to the page where fields are located."
40
+ )
41
+ page: StrictInt = Field(
42
+ description="The page number within the file. If the page does not exist within the file then the field won't be created."
43
+ )
44
+ recipient_id: StrictStr = Field(
45
+ description="Unique identifier of the recipient assigned to the field. Recipients assigned to fields will be the only ones that will see and be able to complete those fields."
46
+ )
47
+ type: FieldType
48
+ required: StrictBool | None = Field(
49
+ default=True,
50
+ description="Whether the field must be completed by the recipient. Defaults to `true` except for checkbox type fields.",
51
+ )
52
+ label: StrictStr | None = Field(
53
+ default=None, description="Text and Date fields only: label that is displayed when the field is empty."
54
+ )
55
+ value: AdditionalFieldsInnerInnerValue | None = None
56
+ api_id: StrictStr | None = Field(
57
+ default=None,
58
+ description="Unique identifier of the field. Useful when needing to reference specific field values or update a document and its fields.",
59
+ )
60
+ name: StrictStr | None = Field(
61
+ default=None,
62
+ description="Checkbox fields only. At least 2 checkbox fields in an array of fields must be assigned to the same recipient and grouped with selection requirements.",
63
+ )
64
+ validation: TextValidation | None = None
65
+ fixed_width: StrictBool | None = Field(
66
+ default=False,
67
+ description="Text fields only: whether the field width will stay fixed and text will display in multiple lines, rather than one long line. If set to `false` the field width will automatically grow horizontally to fit text on one line. Defaults to `false`.",
68
+ )
69
+ lock_sign_date: StrictBool | None = Field(
70
+ default=False,
71
+ description="Date fields only: makes fields readonly and automatically populates with the date the recipient signed. Defaults to `false`.",
72
+ )
73
+ date_format: DateFormat | None = None
74
+ height: Union[StrictFloat, StrictInt] | None = Field(
75
+ default=None,
76
+ description="Height of the field (in pixels). Maximum height varies by field type: Signature/Initials (200px), others (74px). When using text tags if the height is greater than the maximum height, the height will be set to the maximum height.",
77
+ )
78
+ width: Union[StrictFloat, StrictInt] | None = Field(
79
+ default=None,
80
+ description="Width of the field (in pixels). For text fields, width will auto-grow unless `fixed_width` is true.",
81
+ )
82
+ options: List[DropdownOption] | None = Field(
83
+ default=None, description="Array of dropdown options (for dropdown/select fields only)"
84
+ )
85
+ default_option: StrictStr | None = Field(
86
+ default=None, description="Default selected option (for dropdown/select fields only)"
87
+ )
88
+ allow_other: StrictBool | None = Field(
89
+ default=False, description='Whether to allow "Other" option with text input (for dropdown/select fields only)'
90
+ )
91
+ additional_properties: Dict[str, Any] = {}
92
+ __properties: ClassVar[List[str]] = [
93
+ "x",
94
+ "y",
95
+ "page",
96
+ "recipient_id",
97
+ "type",
98
+ "required",
99
+ "label",
100
+ "value",
101
+ "api_id",
102
+ "name",
103
+ "validation",
104
+ "fixed_width",
105
+ "lock_sign_date",
106
+ "date_format",
107
+ "height",
108
+ "width",
109
+ "options",
110
+ "default_option",
111
+ "allow_other",
112
+ ]
113
+
114
+ @model_validator(mode="before")
115
+ @classmethod
116
+ def normalize_checkbox_value_input(cls, data: Any) -> Any:
117
+ if not isinstance(data, dict):
118
+ return data
119
+ if cls._field_type_value(data.get("type")) != "checkbox":
120
+ return data
121
+ if data.get("value") is None:
122
+ return data
123
+
124
+ normalized = dict(data)
125
+ normalized["value"] = cls._build_value_model(cls._normalize_checkbox_value(data["value"]))
126
+ return normalized
127
+
128
+ @model_validator(mode="after")
129
+ def normalize_checkbox_value(self) -> Self:
130
+ field_type = getattr(self.type, "value", self.type)
131
+ if field_type == "checkbox" and self.value is not None:
132
+ self.value.actual_instance = self._normalize_checkbox_value(self.value)
133
+ return self
134
+
135
+ @classmethod
136
+ def _build_value_model(cls, value: str) -> Any:
137
+ value_field = cls.model_fields.get("value")
138
+ if value_field is None:
139
+ return value
140
+
141
+ annotation = value_field.annotation
142
+ candidates = get_args(annotation) or (annotation,)
143
+ for candidate in candidates:
144
+ if candidate is type(None):
145
+ continue
146
+ value_model: Any = candidate
147
+ if callable(value_model):
148
+ return value_model(value)
149
+ return value
150
+
151
+ @staticmethod
152
+ def _field_type_value(value: Any) -> Any:
153
+ return getattr(value, "value", value)
154
+
155
+ @staticmethod
156
+ def _normalize_checkbox_value(value: Any) -> str:
157
+ actual_value = getattr(value, "actual_instance", value)
158
+ if isinstance(actual_value, bool):
159
+ return "t" if actual_value else "f"
160
+ if isinstance(actual_value, str):
161
+ normalized = actual_value.strip().lower()
162
+ if normalized in {"true", "t"}:
163
+ return "t"
164
+ if normalized in {"false", "f"}:
165
+ return "f"
166
+ raise ValueError('Checkbox field values must be boolean or one of "true", "false", "t", or "f"')
167
+
168
+ model_config = ConfigDict(
169
+ populate_by_name=True,
170
+ validate_assignment=True,
171
+ protected_namespaces=(),
172
+ )
173
+
174
+ def to_str(self) -> str:
175
+ """Returns the string representation of the model using alias"""
176
+ return pprint.pformat(self.model_dump(by_alias=True))
177
+
178
+ def to_json(self) -> str:
179
+ """Returns the JSON representation of the model using alias"""
180
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
181
+ return json.dumps(self.to_dict())
182
+
183
+ @classmethod
184
+ def from_json(cls, json_str: str) -> Self | None:
185
+ """Create an instance of FieldsInnerInner from a JSON string"""
186
+ return cls.from_dict(json.loads(json_str))
187
+
188
+ def to_dict(self) -> Dict[str, Any]:
189
+ """Return the dictionary representation of the model using alias.
190
+
191
+ This has the following differences from calling pydantic's
192
+ `self.model_dump(by_alias=True)`:
193
+
194
+ * `None` is only added to the output dict for nullable fields that
195
+ were set at model initialization. Other fields with value `None`
196
+ are ignored.
197
+ * Fields in `self.additional_properties` are added to the output dict.
198
+ """
199
+ excluded_fields: Set[str] = set(
200
+ [
201
+ "additional_properties",
202
+ ]
203
+ )
204
+
205
+ _dict = self.model_dump(
206
+ by_alias=True,
207
+ exclude=excluded_fields,
208
+ exclude_none=True,
209
+ )
210
+ # override the default output from pydantic by calling `to_dict()` of value
211
+ if self.value:
212
+ _dict["value"] = self.value.to_dict()
213
+ # override the default output from pydantic by calling `to_dict()` of each item in options (list)
214
+ _items_options: list[Any] = []
215
+ if self.options:
216
+ for _item_options in self.options:
217
+ if _item_options:
218
+ _items_options.append(_item_options.to_dict())
219
+ _dict["options"] = _items_options
220
+ # puts key-value pairs in additional_properties in the top level
221
+ if self.additional_properties is not None:
222
+ for _key, _value in self.additional_properties.items():
223
+ _dict[_key] = _value
224
+
225
+ return _dict
226
+
227
+ @classmethod
228
+ def from_dict(cls, obj: Dict[str, Any] | None) -> Self | None:
229
+ """Create an instance of FieldsInnerInner from a dict"""
230
+ if obj is None:
231
+ return None
232
+
233
+ if not isinstance(obj, dict):
234
+ return cls.model_validate(obj)
235
+
236
+ _obj = cls.model_validate(
237
+ {
238
+ "x": obj.get("x"),
239
+ "y": obj.get("y"),
240
+ "page": obj.get("page"),
241
+ "recipient_id": obj.get("recipient_id"),
242
+ "type": obj.get("type"),
243
+ "required": obj.get("required") if obj.get("required") is not None else True,
244
+ "label": obj.get("label"),
245
+ "value": AdditionalFieldsInnerInnerValue.from_dict(obj["value"])
246
+ if obj.get("value") is not None
247
+ else None,
248
+ "api_id": obj.get("api_id"),
249
+ "name": obj.get("name"),
250
+ "validation": obj.get("validation"),
251
+ "fixed_width": obj.get("fixed_width") if obj.get("fixed_width") is not None else False,
252
+ "lock_sign_date": obj.get("lock_sign_date") if obj.get("lock_sign_date") is not None else False,
253
+ "date_format": obj.get("date_format"),
254
+ "height": obj.get("height"),
255
+ "width": obj.get("width"),
256
+ "options": [DropdownOption.from_dict(_item) for _item in obj["options"]]
257
+ if obj.get("options") is not None
258
+ else None,
259
+ "default_option": obj.get("default_option"),
260
+ "allow_other": obj.get("allow_other") if obj.get("allow_other") is not None else False,
261
+ }
262
+ )
263
+ # store additional fields in additional_properties
264
+ for _key in obj.keys():
265
+ if _key not in cls.__properties:
266
+ _obj.additional_properties[_key] = obj.get(_key)
267
+
268
+ return _obj
@@ -0,0 +1,33 @@
1
+ """
2
+ SignWell Developer API
3
+
4
+ API for creating, managing, and tracking electronic signature workflows.
5
+
6
+ The version of the OpenAPI document: v1
7
+ Contact: support@signwell.com
8
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
9
+
10
+ Do not edit the class manually.
11
+ """ # noqa: E501
12
+
13
+ from __future__ import annotations
14
+ import json
15
+ from enum import Enum
16
+ from typing_extensions import Self
17
+
18
+
19
+ class FileFormat(str, Enum):
20
+ """
21
+ Format of the file to be downloaded. Supported formats are 'pdf' and 'zip'.
22
+ """
23
+
24
+ """
25
+ allowed enum values
26
+ """
27
+ PDF = "pdf"
28
+ ZIP = "zip"
29
+
30
+ @classmethod
31
+ def from_json(cls, json_str: str) -> Self:
32
+ """Create an instance of FileFormat from a JSON string"""
33
+ return cls(json.loads(json_str))
@@ -0,0 +1,98 @@
1
+ """
2
+ SignWell Developer API
3
+
4
+ API for creating, managing, and tracking electronic signature workflows.
5
+
6
+ The version of the OpenAPI document: v1
7
+ Contact: support@signwell.com
8
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
9
+
10
+ Do not edit the class manually.
11
+ """ # noqa: E501
12
+
13
+ from __future__ import annotations
14
+ import pprint
15
+ import re # noqa: F401
16
+ import json
17
+
18
+ from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr
19
+ from typing import Any, ClassVar, Dict, List
20
+ from typing import Any, Optional, Set
21
+ from typing_extensions import Self
22
+
23
+
24
+ class FileInfo(BaseModel):
25
+ """
26
+ File information
27
+ """ # noqa: E501
28
+
29
+ name: StrictStr = Field(description="File name")
30
+ pages_number: StrictInt = Field(description="Number of pages in the file")
31
+ additional_properties: Dict[str, Any] = {}
32
+ __properties: ClassVar[List[str]] = ["name", "pages_number"]
33
+
34
+ model_config = ConfigDict(
35
+ populate_by_name=True,
36
+ validate_assignment=True,
37
+ protected_namespaces=(),
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) -> Self | None:
51
+ """Create an instance of FileInfo 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
+ * Fields in `self.additional_properties` are added to the output dict.
64
+ """
65
+ excluded_fields: Set[str] = set(
66
+ [
67
+ "additional_properties",
68
+ ]
69
+ )
70
+
71
+ _dict = self.model_dump(
72
+ by_alias=True,
73
+ exclude=excluded_fields,
74
+ exclude_none=True,
75
+ )
76
+ # puts key-value pairs in additional_properties in the top level
77
+ if self.additional_properties is not None:
78
+ for _key, _value in self.additional_properties.items():
79
+ _dict[_key] = _value
80
+
81
+ return _dict
82
+
83
+ @classmethod
84
+ def from_dict(cls, obj: Dict[str, Any] | None) -> Self | None:
85
+ """Create an instance of FileInfo from a dict"""
86
+ if obj is None:
87
+ return None
88
+
89
+ if not isinstance(obj, dict):
90
+ return cls.model_validate(obj)
91
+
92
+ _obj = cls.model_validate({"name": obj.get("name"), "pages_number": obj.get("pages_number")})
93
+ # store additional fields in additional_properties
94
+ for _key in obj.keys():
95
+ if _key not in cls.__properties:
96
+ _obj.additional_properties[_key] = obj.get(_key)
97
+
98
+ return _obj
@@ -0,0 +1,103 @@
1
+ """
2
+ SignWell Developer API
3
+
4
+ API for creating, managing, and tracking electronic signature workflows.
5
+
6
+ The version of the OpenAPI document: v1
7
+ Contact: support@signwell.com
8
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
9
+
10
+ Do not edit the class manually.
11
+ """ # noqa: E501
12
+
13
+ from __future__ import annotations
14
+ import pprint
15
+ import re # noqa: F401
16
+ import json
17
+
18
+ from pydantic import BaseModel, ConfigDict, Field, StrictBytes, StrictStr
19
+ from typing import Any, ClassVar, Dict, List, Optional, Union
20
+ from typing import Any, Optional, Set
21
+ from typing_extensions import Self
22
+
23
+
24
+ class FilesInner(BaseModel):
25
+ """
26
+ FilesInner
27
+ """ # noqa: E501
28
+
29
+ name: StrictStr = Field(description="Name of the file that will be uploaded.")
30
+ file_url: StrictStr | None = Field(default=None, description="Publicly available URL of the file to be uploaded.")
31
+ file_base64: Union[StrictBytes, StrictStr] | None = Field(
32
+ default=None, description="A RFC 4648 base64 string of the file to be uploaded."
33
+ )
34
+ additional_properties: Dict[str, Any] = {}
35
+ __properties: ClassVar[List[str]] = ["name", "file_url", "file_base64"]
36
+
37
+ model_config = ConfigDict(
38
+ populate_by_name=True,
39
+ validate_assignment=True,
40
+ protected_namespaces=(),
41
+ )
42
+
43
+ def to_str(self) -> str:
44
+ """Returns the string representation of the model using alias"""
45
+ return pprint.pformat(self.model_dump(by_alias=True))
46
+
47
+ def to_json(self) -> str:
48
+ """Returns the JSON representation of the model using alias"""
49
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
50
+ return json.dumps(self.to_dict())
51
+
52
+ @classmethod
53
+ def from_json(cls, json_str: str) -> Self | None:
54
+ """Create an instance of FilesInner from a JSON string"""
55
+ return cls.from_dict(json.loads(json_str))
56
+
57
+ def to_dict(self) -> Dict[str, Any]:
58
+ """Return the dictionary representation of the model using alias.
59
+
60
+ This has the following differences from calling pydantic's
61
+ `self.model_dump(by_alias=True)`:
62
+
63
+ * `None` is only added to the output dict for nullable fields that
64
+ were set at model initialization. Other fields with value `None`
65
+ are ignored.
66
+ * Fields in `self.additional_properties` are added to the output dict.
67
+ """
68
+ excluded_fields: Set[str] = set(
69
+ [
70
+ "additional_properties",
71
+ ]
72
+ )
73
+
74
+ _dict = self.model_dump(
75
+ by_alias=True,
76
+ exclude=excluded_fields,
77
+ exclude_none=True,
78
+ )
79
+ # puts key-value pairs in additional_properties in the top level
80
+ if self.additional_properties is not None:
81
+ for _key, _value in self.additional_properties.items():
82
+ _dict[_key] = _value
83
+
84
+ return _dict
85
+
86
+ @classmethod
87
+ def from_dict(cls, obj: Dict[str, Any] | None) -> Self | None:
88
+ """Create an instance of FilesInner from a dict"""
89
+ if obj is None:
90
+ return None
91
+
92
+ if not isinstance(obj, dict):
93
+ return cls.model_validate(obj)
94
+
95
+ _obj = cls.model_validate(
96
+ {"name": obj.get("name"), "file_url": obj.get("file_url"), "file_base64": obj.get("file_base64")}
97
+ )
98
+ # store additional fields in additional_properties
99
+ for _key in obj.keys():
100
+ if _key not in cls.__properties:
101
+ _obj.additional_properties[_key] = obj.get(_key)
102
+
103
+ return _obj
@@ -0,0 +1,98 @@
1
+ """
2
+ SignWell Developer API
3
+
4
+ API for creating, managing, and tracking electronic signature workflows.
5
+
6
+ The version of the OpenAPI document: v1
7
+ Contact: support@signwell.com
8
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
9
+
10
+ Do not edit the class manually.
11
+ """ # noqa: E501
12
+
13
+ from __future__ import annotations
14
+ import pprint
15
+ import re # noqa: F401
16
+ import json
17
+
18
+ from pydantic import BaseModel, ConfigDict, Field, StrictStr
19
+ from typing import Any, ClassVar, Dict, List, Optional
20
+ from typing import Any, Optional, Set
21
+ from typing_extensions import Self
22
+
23
+
24
+ class LabelInfo(BaseModel):
25
+ """
26
+ Label information
27
+ """ # noqa: E501
28
+
29
+ id: StrictStr | None = Field(default=None, description="Label ID")
30
+ name: StrictStr | None = Field(default=None, description="Label name")
31
+ additional_properties: Dict[str, Any] = {}
32
+ __properties: ClassVar[List[str]] = ["id", "name"]
33
+
34
+ model_config = ConfigDict(
35
+ populate_by_name=True,
36
+ validate_assignment=True,
37
+ protected_namespaces=(),
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) -> Self | None:
51
+ """Create an instance of LabelInfo 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
+ * Fields in `self.additional_properties` are added to the output dict.
64
+ """
65
+ excluded_fields: Set[str] = set(
66
+ [
67
+ "additional_properties",
68
+ ]
69
+ )
70
+
71
+ _dict = self.model_dump(
72
+ by_alias=True,
73
+ exclude=excluded_fields,
74
+ exclude_none=True,
75
+ )
76
+ # puts key-value pairs in additional_properties in the top level
77
+ if self.additional_properties is not None:
78
+ for _key, _value in self.additional_properties.items():
79
+ _dict[_key] = _value
80
+
81
+ return _dict
82
+
83
+ @classmethod
84
+ def from_dict(cls, obj: Dict[str, Any] | None) -> Self | None:
85
+ """Create an instance of LabelInfo from a dict"""
86
+ if obj is None:
87
+ return None
88
+
89
+ if not isinstance(obj, dict):
90
+ return cls.model_validate(obj)
91
+
92
+ _obj = cls.model_validate({"id": obj.get("id"), "name": obj.get("name")})
93
+ # store additional fields in additional_properties
94
+ for _key in obj.keys():
95
+ if _key not in cls.__properties:
96
+ _obj.additional_properties[_key] = obj.get(_key)
97
+
98
+ return _obj