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,357 @@
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 datetime import datetime
19
+ from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictInt, StrictStr
20
+ from typing import Any, ClassVar, Dict, List, Optional
21
+ from signwell_sdk.models.checkbox_group_info import CheckboxGroupInfo
22
+ from signwell_sdk.models.copied_contact_info import CopiedContactInfo
23
+ from signwell_sdk.models.document_response_attachment_requests_inner import DocumentResponseAttachmentRequestsInner
24
+ from signwell_sdk.models.document_response_fields_inner_inner import DocumentResponseFieldsInnerInner
25
+ from signwell_sdk.models.document_response_recipients_inner import DocumentResponseRecipientsInner
26
+ from signwell_sdk.models.file_info import FileInfo
27
+ from signwell_sdk.models.label_info import LabelInfo
28
+ from typing import Any, Optional, Set
29
+ from typing_extensions import Self
30
+
31
+
32
+ class DocumentResponse(BaseModel):
33
+ """
34
+ DocumentResponse
35
+ """ # noqa: E501
36
+
37
+ test_mode: StrictBool
38
+ id: StrictStr
39
+ api_application_id: StrictStr | None = None
40
+ requester_email_address: StrictStr | None = None
41
+ custom_requester_name: StrictStr | None = None
42
+ custom_requester_email: StrictStr | None = None
43
+ name: StrictStr | None = None
44
+ subject: StrictStr | None = None
45
+ message: StrictStr | None = None
46
+ metadata: Dict[str, StrictStr] | None = None
47
+ created_at: datetime | None = None
48
+ updated_at: datetime | None = None
49
+ recipients: List[DocumentResponseRecipientsInner] | None = None
50
+ status: StrictStr | None = Field(
51
+ default=None,
52
+ description="Possible values: Draft, Created, Sending, Sent, Pending, Viewed, Completed, Manually completed, Declined, Canceled, Bounced, Blocked, Error, Expired",
53
+ )
54
+ reminders: StrictBool | None = None
55
+ archived: StrictBool | None = None
56
+ embedded_signing: StrictBool | None = None
57
+ embedded_edit_url: StrictStr | None = None
58
+ embedded_preview_url: StrictStr | None = None
59
+ apply_signing_order: StrictBool | None = None
60
+ redirect_url: StrictStr | None = None
61
+ decline_redirect_url: StrictStr | None = None
62
+ language: StrictStr | None = None
63
+ expires_in: StrictInt | None = None
64
+ decline_message: StrictStr | None = None
65
+ error_message: StrictStr | None = None
66
+ template_id: StrictStr | None = None
67
+ template_ids: List[StrictStr] | None = None
68
+ embedded_signing_notifications: StrictBool | None = None
69
+ attachment_requests: List[DocumentResponseAttachmentRequestsInner] | None = None
70
+ files: List[FileInfo] | None = None
71
+ copied_contacts: List[CopiedContactInfo] | None = None
72
+ fields: List[List[DocumentResponseFieldsInnerInner]] | None = None
73
+ allow_decline: StrictBool | None = None
74
+ allow_reassign: StrictBool | None = None
75
+ labels: List[LabelInfo] | None = None
76
+ checkbox_groups: List[CheckboxGroupInfo] | None = None
77
+ additional_properties: Dict[str, Any] = {}
78
+ __properties: ClassVar[List[str]] = [
79
+ "test_mode",
80
+ "id",
81
+ "api_application_id",
82
+ "requester_email_address",
83
+ "custom_requester_name",
84
+ "custom_requester_email",
85
+ "name",
86
+ "subject",
87
+ "message",
88
+ "metadata",
89
+ "created_at",
90
+ "updated_at",
91
+ "recipients",
92
+ "status",
93
+ "reminders",
94
+ "archived",
95
+ "embedded_signing",
96
+ "embedded_edit_url",
97
+ "embedded_preview_url",
98
+ "apply_signing_order",
99
+ "redirect_url",
100
+ "decline_redirect_url",
101
+ "language",
102
+ "expires_in",
103
+ "decline_message",
104
+ "error_message",
105
+ "template_id",
106
+ "template_ids",
107
+ "embedded_signing_notifications",
108
+ "attachment_requests",
109
+ "files",
110
+ "copied_contacts",
111
+ "fields",
112
+ "allow_decline",
113
+ "allow_reassign",
114
+ "labels",
115
+ "checkbox_groups",
116
+ ]
117
+
118
+ model_config = ConfigDict(
119
+ populate_by_name=True,
120
+ validate_assignment=True,
121
+ protected_namespaces=(),
122
+ )
123
+
124
+ def to_str(self) -> str:
125
+ """Returns the string representation of the model using alias"""
126
+ return pprint.pformat(self.model_dump(by_alias=True))
127
+
128
+ def to_json(self) -> str:
129
+ """Returns the JSON representation of the model using alias"""
130
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
131
+ return json.dumps(self.to_dict())
132
+
133
+ @classmethod
134
+ def from_json(cls, json_str: str) -> Self | None:
135
+ """Create an instance of DocumentResponse from a JSON string"""
136
+ return cls.from_dict(json.loads(json_str))
137
+
138
+ def to_dict(self) -> Dict[str, Any]:
139
+ """Return the dictionary representation of the model using alias.
140
+
141
+ This has the following differences from calling pydantic's
142
+ `self.model_dump(by_alias=True)`:
143
+
144
+ * `None` is only added to the output dict for nullable fields that
145
+ were set at model initialization. Other fields with value `None`
146
+ are ignored.
147
+ * Fields in `self.additional_properties` are added to the output dict.
148
+ """
149
+ excluded_fields: Set[str] = set(
150
+ [
151
+ "additional_properties",
152
+ ]
153
+ )
154
+
155
+ _dict = self.model_dump(
156
+ by_alias=True,
157
+ exclude=excluded_fields,
158
+ exclude_none=True,
159
+ )
160
+ # override the default output from pydantic by calling `to_dict()` of each item in recipients (list)
161
+ _items_recipients: list[Any] = []
162
+ if self.recipients:
163
+ for _item_recipients in self.recipients:
164
+ if _item_recipients:
165
+ _items_recipients.append(_item_recipients.to_dict())
166
+ _dict["recipients"] = _items_recipients
167
+ # override the default output from pydantic by calling `to_dict()` of each item in attachment_requests (list)
168
+ _items_attachment_requests: list[Any] = []
169
+ if self.attachment_requests:
170
+ for _item_attachment_requests in self.attachment_requests:
171
+ if _item_attachment_requests:
172
+ _items_attachment_requests.append(_item_attachment_requests.to_dict())
173
+ _dict["attachment_requests"] = _items_attachment_requests
174
+ # override the default output from pydantic by calling `to_dict()` of each item in files (list)
175
+ _items_files: list[Any] = []
176
+ if self.files:
177
+ for _item_files in self.files:
178
+ if _item_files:
179
+ _items_files.append(_item_files.to_dict())
180
+ _dict["files"] = _items_files
181
+ # override the default output from pydantic by calling `to_dict()` of each item in copied_contacts (list)
182
+ _items_copied_contacts: list[Any] = []
183
+ if self.copied_contacts:
184
+ for _item_copied_contacts in self.copied_contacts:
185
+ if _item_copied_contacts:
186
+ _items_copied_contacts.append(_item_copied_contacts.to_dict())
187
+ _dict["copied_contacts"] = _items_copied_contacts
188
+ # override the default output from pydantic by calling `to_dict()` of each item in fields (list of list)
189
+ _items_fields: list[Any] = []
190
+ if self.fields:
191
+ for _item_fields in self.fields:
192
+ if _item_fields:
193
+ _items_fields.append(
194
+ [_inner_item.to_dict() for _inner_item in _item_fields if _inner_item is not None]
195
+ )
196
+ _dict["fields"] = _items_fields
197
+ # override the default output from pydantic by calling `to_dict()` of each item in labels (list)
198
+ _items_labels: list[Any] = []
199
+ if self.labels:
200
+ for _item_labels in self.labels:
201
+ if _item_labels:
202
+ _items_labels.append(_item_labels.to_dict())
203
+ _dict["labels"] = _items_labels
204
+ # override the default output from pydantic by calling `to_dict()` of each item in checkbox_groups (list)
205
+ _items_checkbox_groups: list[Any] = []
206
+ if self.checkbox_groups:
207
+ for _item_checkbox_groups in self.checkbox_groups:
208
+ if _item_checkbox_groups:
209
+ _items_checkbox_groups.append(_item_checkbox_groups.to_dict())
210
+ _dict["checkbox_groups"] = _items_checkbox_groups
211
+ # puts key-value pairs in additional_properties in the top level
212
+ if self.additional_properties is not None:
213
+ for _key, _value in self.additional_properties.items():
214
+ _dict[_key] = _value
215
+
216
+ # set to None if api_application_id (nullable) is None
217
+ # and model_fields_set contains the field
218
+ if self.api_application_id is None and "api_application_id" in self.model_fields_set:
219
+ _dict["api_application_id"] = None
220
+
221
+ # set to None if custom_requester_name (nullable) is None
222
+ # and model_fields_set contains the field
223
+ if self.custom_requester_name is None and "custom_requester_name" in self.model_fields_set:
224
+ _dict["custom_requester_name"] = None
225
+
226
+ # set to None if custom_requester_email (nullable) is None
227
+ # and model_fields_set contains the field
228
+ if self.custom_requester_email is None and "custom_requester_email" in self.model_fields_set:
229
+ _dict["custom_requester_email"] = None
230
+
231
+ # set to None if metadata (nullable) is None
232
+ # and model_fields_set contains the field
233
+ if self.metadata is None and "metadata" in self.model_fields_set:
234
+ _dict["metadata"] = None
235
+
236
+ # set to None if embedded_edit_url (nullable) is None
237
+ # and model_fields_set contains the field
238
+ if self.embedded_edit_url is None and "embedded_edit_url" in self.model_fields_set:
239
+ _dict["embedded_edit_url"] = None
240
+
241
+ # set to None if embedded_preview_url (nullable) is None
242
+ # and model_fields_set contains the field
243
+ if self.embedded_preview_url is None and "embedded_preview_url" in self.model_fields_set:
244
+ _dict["embedded_preview_url"] = None
245
+
246
+ # set to None if redirect_url (nullable) is None
247
+ # and model_fields_set contains the field
248
+ if self.redirect_url is None and "redirect_url" in self.model_fields_set:
249
+ _dict["redirect_url"] = None
250
+
251
+ # set to None if decline_redirect_url (nullable) is None
252
+ # and model_fields_set contains the field
253
+ if self.decline_redirect_url is None and "decline_redirect_url" in self.model_fields_set:
254
+ _dict["decline_redirect_url"] = None
255
+
256
+ # set to None if decline_message (nullable) is None
257
+ # and model_fields_set contains the field
258
+ if self.decline_message is None and "decline_message" in self.model_fields_set:
259
+ _dict["decline_message"] = None
260
+
261
+ # set to None if error_message (nullable) is None
262
+ # and model_fields_set contains the field
263
+ if self.error_message is None and "error_message" in self.model_fields_set:
264
+ _dict["error_message"] = None
265
+
266
+ # set to None if template_id (nullable) is None
267
+ # and model_fields_set contains the field
268
+ if self.template_id is None and "template_id" in self.model_fields_set:
269
+ _dict["template_id"] = None
270
+
271
+ # set to None if allow_decline (nullable) is None
272
+ # and model_fields_set contains the field
273
+ if self.allow_decline is None and "allow_decline" in self.model_fields_set:
274
+ _dict["allow_decline"] = None
275
+
276
+ # set to None if allow_reassign (nullable) is None
277
+ # and model_fields_set contains the field
278
+ if self.allow_reassign is None and "allow_reassign" in self.model_fields_set:
279
+ _dict["allow_reassign"] = None
280
+
281
+ return _dict
282
+
283
+ @classmethod
284
+ def from_dict(cls, obj: Dict[str, Any] | None) -> Self | None:
285
+ """Create an instance of DocumentResponse from a dict"""
286
+ if obj is None:
287
+ return None
288
+
289
+ if not isinstance(obj, dict):
290
+ return cls.model_validate(obj)
291
+
292
+ _obj = cls.model_validate(
293
+ {
294
+ "test_mode": obj.get("test_mode"),
295
+ "id": obj.get("id"),
296
+ "api_application_id": obj.get("api_application_id"),
297
+ "requester_email_address": obj.get("requester_email_address"),
298
+ "custom_requester_name": obj.get("custom_requester_name"),
299
+ "custom_requester_email": obj.get("custom_requester_email"),
300
+ "name": obj.get("name"),
301
+ "subject": obj.get("subject"),
302
+ "message": obj.get("message"),
303
+ "metadata": obj.get("metadata"),
304
+ "created_at": obj.get("created_at"),
305
+ "updated_at": obj.get("updated_at"),
306
+ "recipients": [DocumentResponseRecipientsInner.from_dict(_item) for _item in obj["recipients"]]
307
+ if obj.get("recipients") is not None
308
+ else None,
309
+ "status": obj.get("status"),
310
+ "reminders": obj.get("reminders"),
311
+ "archived": obj.get("archived"),
312
+ "embedded_signing": obj.get("embedded_signing"),
313
+ "embedded_edit_url": obj.get("embedded_edit_url"),
314
+ "embedded_preview_url": obj.get("embedded_preview_url"),
315
+ "apply_signing_order": obj.get("apply_signing_order"),
316
+ "redirect_url": obj.get("redirect_url"),
317
+ "decline_redirect_url": obj.get("decline_redirect_url"),
318
+ "language": obj.get("language"),
319
+ "expires_in": obj.get("expires_in"),
320
+ "decline_message": obj.get("decline_message"),
321
+ "error_message": obj.get("error_message"),
322
+ "template_id": obj.get("template_id"),
323
+ "template_ids": obj.get("template_ids"),
324
+ "embedded_signing_notifications": obj.get("embedded_signing_notifications"),
325
+ "attachment_requests": [
326
+ DocumentResponseAttachmentRequestsInner.from_dict(_item) for _item in obj["attachment_requests"]
327
+ ]
328
+ if obj.get("attachment_requests") is not None
329
+ else None,
330
+ "files": [FileInfo.from_dict(_item) for _item in obj["files"]]
331
+ if obj.get("files") is not None
332
+ else None,
333
+ "copied_contacts": [CopiedContactInfo.from_dict(_item) for _item in obj["copied_contacts"]]
334
+ if obj.get("copied_contacts") is not None
335
+ else None,
336
+ "fields": [
337
+ [DocumentResponseFieldsInnerInner.from_dict(_inner_item) for _inner_item in _item]
338
+ for _item in obj["fields"]
339
+ ]
340
+ if obj.get("fields") is not None
341
+ else None,
342
+ "allow_decline": obj.get("allow_decline"),
343
+ "allow_reassign": obj.get("allow_reassign"),
344
+ "labels": [LabelInfo.from_dict(_item) for _item in obj["labels"]]
345
+ if obj.get("labels") is not None
346
+ else None,
347
+ "checkbox_groups": [CheckboxGroupInfo.from_dict(_item) for _item in obj["checkbox_groups"]]
348
+ if obj.get("checkbox_groups") is not None
349
+ else None,
350
+ }
351
+ )
352
+ # store additional fields in additional_properties
353
+ for _key in obj.keys():
354
+ if _key not in cls.__properties:
355
+ _obj.additional_properties[_key] = obj.get(_key)
356
+
357
+ return _obj
@@ -0,0 +1,101 @@
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, StrictBool, 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 DocumentResponseAttachmentRequestsInner(BaseModel):
25
+ """
26
+ DocumentResponseAttachmentRequestsInner
27
+ """ # noqa: E501
28
+
29
+ name: StrictStr
30
+ recipient_id: StrictStr
31
+ required: StrictBool | None = None
32
+ additional_properties: Dict[str, Any] = {}
33
+ __properties: ClassVar[List[str]] = ["name", "recipient_id", "required"]
34
+
35
+ model_config = ConfigDict(
36
+ populate_by_name=True,
37
+ validate_assignment=True,
38
+ protected_namespaces=(),
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) -> Self | None:
52
+ """Create an instance of DocumentResponseAttachmentRequestsInner 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
+ * Fields in `self.additional_properties` are added to the output dict.
65
+ """
66
+ excluded_fields: Set[str] = set(
67
+ [
68
+ "additional_properties",
69
+ ]
70
+ )
71
+
72
+ _dict = self.model_dump(
73
+ by_alias=True,
74
+ exclude=excluded_fields,
75
+ exclude_none=True,
76
+ )
77
+ # puts key-value pairs in additional_properties in the top level
78
+ if self.additional_properties is not None:
79
+ for _key, _value in self.additional_properties.items():
80
+ _dict[_key] = _value
81
+
82
+ return _dict
83
+
84
+ @classmethod
85
+ def from_dict(cls, obj: Dict[str, Any] | None) -> Self | None:
86
+ """Create an instance of DocumentResponseAttachmentRequestsInner from a dict"""
87
+ if obj is None:
88
+ return None
89
+
90
+ if not isinstance(obj, dict):
91
+ return cls.model_validate(obj)
92
+
93
+ _obj = cls.model_validate(
94
+ {"name": obj.get("name"), "recipient_id": obj.get("recipient_id"), "required": obj.get("required")}
95
+ )
96
+ # store additional fields in additional_properties
97
+ for _key in obj.keys():
98
+ if _key not in cls.__properties:
99
+ _obj.additional_properties[_key] = obj.get(_key)
100
+
101
+ return _obj