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,136 @@
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, StrictInt, StrictStr
19
+ from typing import Any, ClassVar, Dict, List, Optional
20
+ from signwell_sdk.models.checkbox_validation import CheckboxValidation
21
+ from typing import Any, Optional, Set
22
+ from typing_extensions import Self
23
+
24
+
25
+ class CheckboxGroupsInner(BaseModel):
26
+ """
27
+ CheckboxGroupsInner
28
+ """ # noqa: E501
29
+
30
+ group_name: StrictStr = Field(description="A unique identifier for the checkbox group.")
31
+ recipient_id: StrictStr = Field(description="The recipient ID associated with the checkbox group.")
32
+ checkbox_ids: List[StrictStr]
33
+ validation: CheckboxValidation | None = None
34
+ required: StrictBool | None = Field(
35
+ default=False, description="Whether the group must be completed by the recipient. Defaults to false."
36
+ )
37
+ min_value: StrictInt | None = Field(
38
+ default=None,
39
+ description="The minimum number of checkboxes that must be checked in the group. (Only for validation: minimum and range)",
40
+ )
41
+ max_value: StrictInt | None = Field(
42
+ default=None,
43
+ description="The maximum number of checkboxes that can be checked in the group. (Only for validation: maximum and range)",
44
+ )
45
+ exact_value: StrictInt | None = Field(
46
+ default=None,
47
+ description="The exact number of checkboxes that must be checked in the group. (Only for validation: exact)",
48
+ )
49
+ additional_properties: Dict[str, Any] = {}
50
+ __properties: ClassVar[List[str]] = [
51
+ "group_name",
52
+ "recipient_id",
53
+ "checkbox_ids",
54
+ "validation",
55
+ "required",
56
+ "min_value",
57
+ "max_value",
58
+ "exact_value",
59
+ ]
60
+
61
+ model_config = ConfigDict(
62
+ populate_by_name=True,
63
+ validate_assignment=True,
64
+ protected_namespaces=(),
65
+ )
66
+
67
+ def to_str(self) -> str:
68
+ """Returns the string representation of the model using alias"""
69
+ return pprint.pformat(self.model_dump(by_alias=True))
70
+
71
+ def to_json(self) -> str:
72
+ """Returns the JSON representation of the model using alias"""
73
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
74
+ return json.dumps(self.to_dict())
75
+
76
+ @classmethod
77
+ def from_json(cls, json_str: str) -> Self | None:
78
+ """Create an instance of CheckboxGroupsInner from a JSON string"""
79
+ return cls.from_dict(json.loads(json_str))
80
+
81
+ def to_dict(self) -> Dict[str, Any]:
82
+ """Return the dictionary representation of the model using alias.
83
+
84
+ This has the following differences from calling pydantic's
85
+ `self.model_dump(by_alias=True)`:
86
+
87
+ * `None` is only added to the output dict for nullable fields that
88
+ were set at model initialization. Other fields with value `None`
89
+ are ignored.
90
+ * Fields in `self.additional_properties` are added to the output dict.
91
+ """
92
+ excluded_fields: Set[str] = set(
93
+ [
94
+ "additional_properties",
95
+ ]
96
+ )
97
+
98
+ _dict = self.model_dump(
99
+ by_alias=True,
100
+ exclude=excluded_fields,
101
+ exclude_none=True,
102
+ )
103
+ # puts key-value pairs in additional_properties in the top level
104
+ if self.additional_properties is not None:
105
+ for _key, _value in self.additional_properties.items():
106
+ _dict[_key] = _value
107
+
108
+ return _dict
109
+
110
+ @classmethod
111
+ def from_dict(cls, obj: Dict[str, Any] | None) -> Self | None:
112
+ """Create an instance of CheckboxGroupsInner from a dict"""
113
+ if obj is None:
114
+ return None
115
+
116
+ if not isinstance(obj, dict):
117
+ return cls.model_validate(obj)
118
+
119
+ _obj = cls.model_validate(
120
+ {
121
+ "group_name": obj.get("group_name"),
122
+ "recipient_id": obj.get("recipient_id"),
123
+ "checkbox_ids": obj.get("checkbox_ids"),
124
+ "validation": obj.get("validation"),
125
+ "required": obj.get("required") if obj.get("required") is not None else False,
126
+ "min_value": obj.get("min_value"),
127
+ "max_value": obj.get("max_value"),
128
+ "exact_value": obj.get("exact_value"),
129
+ }
130
+ )
131
+ # store additional fields in additional_properties
132
+ for _key in obj.keys():
133
+ if _key not in cls.__properties:
134
+ _obj.additional_properties[_key] = obj.get(_key)
135
+
136
+ return _obj
@@ -0,0 +1,35 @@
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 CheckboxValidation(str, Enum):
20
+ """
21
+ Validation rule for checkbox groups
22
+ """
23
+
24
+ """
25
+ allowed enum values
26
+ """
27
+ MINIMUM = "minimum"
28
+ MAXIMUM = "maximum"
29
+ RANGE = "range"
30
+ EXACT = "exact"
31
+
32
+ @classmethod
33
+ def from_json(cls, json_str: str) -> Self:
34
+ """Create an instance of CheckboxValidation from a JSON string"""
35
+ return cls(json.loads(json_str))
@@ -0,0 +1,177 @@
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
+ import pprint
16
+ from pydantic import BaseModel, ConfigDict, Field, StrictBytes, StrictStr, ValidationError, field_validator
17
+ from typing import Any, List, Optional, Tuple, Union
18
+ from signwell_sdk.models.completed_pdf_url_response import CompletedPdfUrlResponse
19
+ from pydantic import StrictStr, Field
20
+ from typing import Union, List, Set, Optional, Dict, cast
21
+ from typing_extensions import Literal, Self
22
+
23
+ COMPLETEDPDFRESPONSE_ONE_OF_SCHEMAS = ["CompletedPdfUrlResponse", "bytearray"]
24
+
25
+
26
+ class CompletedPdfResponse(BaseModel):
27
+ """
28
+ CompletedPdfResponse
29
+ """
30
+
31
+ # data type: CompletedPdfUrlResponse
32
+ oneof_schema_1_validator: CompletedPdfUrlResponse | None = None
33
+ # data type: bytearray
34
+ oneof_schema_2_validator: Union[StrictBytes, StrictStr, Tuple[StrictStr, StrictBytes]] | None = Field(
35
+ default=None, description="Raw PDF binary data (default response when url_only=false)"
36
+ )
37
+ # data type: bytearray
38
+ oneof_schema_3_validator: Union[StrictBytes, StrictStr, Tuple[StrictStr, StrictBytes]] | None = Field(
39
+ default=None, description="ZIP file containing the completed PDF (returned when file_format=zip)"
40
+ )
41
+ actual_instance: Union[CompletedPdfUrlResponse, bytearray] | None = None
42
+ one_of_schemas: Set[str] = {"CompletedPdfUrlResponse", "bytearray"}
43
+
44
+ model_config = ConfigDict(
45
+ validate_assignment=True,
46
+ arbitrary_types_allowed=True,
47
+ protected_namespaces=(),
48
+ )
49
+
50
+ def __init__(self, *args, **kwargs) -> None:
51
+ if args:
52
+ if len(args) > 1:
53
+ raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`")
54
+ if kwargs:
55
+ raise ValueError("If a position argument is used, keyword arguments cannot be used.")
56
+ super().__init__(actual_instance=args[0])
57
+ else:
58
+ super().__init__(**kwargs)
59
+
60
+ @field_validator("actual_instance")
61
+ def actual_instance_must_validate_oneof(cls, v):
62
+ instance = CompletedPdfResponse.model_construct()
63
+ error_messages = []
64
+ match = 0
65
+ # validate data type: CompletedPdfUrlResponse
66
+ if not isinstance(v, CompletedPdfUrlResponse):
67
+ error_messages.append(f"Error! Input type `{type(v)}` is not `CompletedPdfUrlResponse`")
68
+ else:
69
+ match += 1
70
+ # validate data type: bytearray
71
+ try:
72
+ instance.oneof_schema_2_validator = v
73
+ match += 1
74
+ except (ValidationError, ValueError) as e:
75
+ error_messages.append(str(e))
76
+ # validate data type: bytearray
77
+ try:
78
+ instance.oneof_schema_3_validator = v
79
+ match += 1
80
+ except (ValidationError, ValueError) as e:
81
+ error_messages.append(str(e))
82
+ if match > 1:
83
+ # more than 1 match
84
+ raise ValueError(
85
+ "Multiple matches found when setting `actual_instance` in CompletedPdfResponse with oneOf schemas: CompletedPdfUrlResponse, bytearray. Details: "
86
+ + ", ".join(error_messages)
87
+ )
88
+ elif match == 0:
89
+ # no match
90
+ raise ValueError(
91
+ "No match found when setting `actual_instance` in CompletedPdfResponse with oneOf schemas: CompletedPdfUrlResponse, bytearray. Details: "
92
+ + ", ".join(error_messages)
93
+ )
94
+ else:
95
+ return v
96
+
97
+ @classmethod
98
+ def from_dict(cls, obj: Union[str, Dict[str, Any]]) -> Self:
99
+ return cls.from_json(json.dumps(obj))
100
+
101
+ @classmethod
102
+ def from_json(cls, json_str: str) -> Self:
103
+ """Returns the object represented by the json string"""
104
+ instance = cls.model_construct()
105
+ error_messages = []
106
+ match = 0
107
+
108
+ # deserialize data into CompletedPdfUrlResponse
109
+ try:
110
+ instance.actual_instance = CompletedPdfUrlResponse.from_json(json_str)
111
+ match += 1
112
+ except (ValidationError, ValueError) as e:
113
+ error_messages.append(str(e))
114
+ # deserialize data into bytearray
115
+ try:
116
+ # validation
117
+ instance.oneof_schema_2_validator = json.loads(json_str)
118
+ # assign value to actual_instance
119
+ instance.actual_instance = cast(
120
+ Union[CompletedPdfUrlResponse, bytearray],
121
+ instance.oneof_schema_2_validator,
122
+ )
123
+ match += 1
124
+ except (ValidationError, ValueError) as e:
125
+ error_messages.append(str(e))
126
+ # deserialize data into bytearray
127
+ try:
128
+ # validation
129
+ instance.oneof_schema_3_validator = json.loads(json_str)
130
+ # assign value to actual_instance
131
+ instance.actual_instance = cast(
132
+ Union[CompletedPdfUrlResponse, bytearray],
133
+ instance.oneof_schema_3_validator,
134
+ )
135
+ match += 1
136
+ except (ValidationError, ValueError) as e:
137
+ error_messages.append(str(e))
138
+
139
+ if match > 1:
140
+ # more than 1 match
141
+ raise ValueError(
142
+ "Multiple matches found when deserializing the JSON string into CompletedPdfResponse with oneOf schemas: CompletedPdfUrlResponse, bytearray. Details: "
143
+ + ", ".join(error_messages)
144
+ )
145
+ elif match == 0:
146
+ # no match
147
+ raise ValueError(
148
+ "No match found when deserializing the JSON string into CompletedPdfResponse with oneOf schemas: CompletedPdfUrlResponse, bytearray. Details: "
149
+ + ", ".join(error_messages)
150
+ )
151
+ else:
152
+ return instance
153
+
154
+ def to_json(self) -> str:
155
+ """Returns the JSON representation of the actual instance"""
156
+ if self.actual_instance is None:
157
+ return "null"
158
+
159
+ if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json):
160
+ return self.actual_instance.to_json()
161
+ else:
162
+ return json.dumps(self.actual_instance)
163
+
164
+ def to_dict(self) -> Union[Dict[str, Any], CompletedPdfUrlResponse, bytearray] | None:
165
+ """Returns the dict representation of the actual instance"""
166
+ if self.actual_instance is None:
167
+ return None
168
+
169
+ if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict):
170
+ return self.actual_instance.to_dict()
171
+ else:
172
+ # primitive type
173
+ return self.actual_instance
174
+
175
+ def to_str(self) -> str:
176
+ """Returns the string representation of the actual instance"""
177
+ return pprint.pformat(self.model_dump())
@@ -0,0 +1,97 @@
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
20
+ from typing import Any, Optional, Set
21
+ from typing_extensions import Self
22
+
23
+
24
+ class CompletedPdfUrlResponse(BaseModel):
25
+ """
26
+ JSON response containing the URL to the completed PDF file (returned when url_only=true)
27
+ """ # noqa: E501
28
+
29
+ file_url: StrictStr = Field(description="URL to download the completed document")
30
+ additional_properties: Dict[str, Any] = {}
31
+ __properties: ClassVar[List[str]] = ["file_url"]
32
+
33
+ model_config = ConfigDict(
34
+ populate_by_name=True,
35
+ validate_assignment=True,
36
+ protected_namespaces=(),
37
+ )
38
+
39
+ def to_str(self) -> str:
40
+ """Returns the string representation of the model using alias"""
41
+ return pprint.pformat(self.model_dump(by_alias=True))
42
+
43
+ def to_json(self) -> str:
44
+ """Returns the JSON representation of the model using alias"""
45
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
46
+ return json.dumps(self.to_dict())
47
+
48
+ @classmethod
49
+ def from_json(cls, json_str: str) -> Self | None:
50
+ """Create an instance of CompletedPdfUrlResponse from a JSON string"""
51
+ return cls.from_dict(json.loads(json_str))
52
+
53
+ def to_dict(self) -> Dict[str, Any]:
54
+ """Return the dictionary representation of the model using alias.
55
+
56
+ This has the following differences from calling pydantic's
57
+ `self.model_dump(by_alias=True)`:
58
+
59
+ * `None` is only added to the output dict for nullable fields that
60
+ were set at model initialization. Other fields with value `None`
61
+ are ignored.
62
+ * Fields in `self.additional_properties` are added to the output dict.
63
+ """
64
+ excluded_fields: Set[str] = set(
65
+ [
66
+ "additional_properties",
67
+ ]
68
+ )
69
+
70
+ _dict = self.model_dump(
71
+ by_alias=True,
72
+ exclude=excluded_fields,
73
+ exclude_none=True,
74
+ )
75
+ # puts key-value pairs in additional_properties in the top level
76
+ if self.additional_properties is not None:
77
+ for _key, _value in self.additional_properties.items():
78
+ _dict[_key] = _value
79
+
80
+ return _dict
81
+
82
+ @classmethod
83
+ def from_dict(cls, obj: Dict[str, Any] | None) -> Self | None:
84
+ """Create an instance of CompletedPdfUrlResponse from a dict"""
85
+ if obj is None:
86
+ return None
87
+
88
+ if not isinstance(obj, dict):
89
+ return cls.model_validate(obj)
90
+
91
+ _obj = cls.model_validate({"file_url": obj.get("file_url")})
92
+ # store additional fields in additional_properties
93
+ for _key in obj.keys():
94
+ if _key not in cls.__properties:
95
+ _obj.additional_properties[_key] = obj.get(_key)
96
+
97
+ return _obj
@@ -0,0 +1,99 @@
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 CopiedContactInfo(BaseModel):
25
+ """
26
+ Copied contact information
27
+ """ # noqa: E501
28
+
29
+ id: StrictStr | None = Field(default=None, description="Contact ID")
30
+ name: StrictStr | None = Field(default=None, description="Contact name")
31
+ email: StrictStr = Field(description="Contact email")
32
+ additional_properties: Dict[str, Any] = {}
33
+ __properties: ClassVar[List[str]] = ["id", "name", "email"]
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 CopiedContactInfo 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 CopiedContactInfo 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({"id": obj.get("id"), "name": obj.get("name"), "email": obj.get("email")})
94
+ # store additional fields in additional_properties
95
+ for _key in obj.keys():
96
+ if _key not in cls.__properties:
97
+ _obj.additional_properties[_key] = obj.get(_key)
98
+
99
+ 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 CopiedContactsInner(BaseModel):
25
+ """
26
+ CopiedContactsInner
27
+ """ # noqa: E501
28
+
29
+ name: StrictStr | None = Field(default=None, description="Name of the copied contact.")
30
+ email: StrictStr = Field(description="Email for the copied contact.")
31
+ additional_properties: Dict[str, Any] = {}
32
+ __properties: ClassVar[List[str]] = ["name", "email"]
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 CopiedContactsInner 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 CopiedContactsInner 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"), "email": obj.get("email")})
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