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,138 @@
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, StrictInt
19
+ from typing import Any, ClassVar, Dict, List, Optional
20
+ from signwell_sdk.models.bulk_send_list_item import BulkSendListItem
21
+ from typing import Any, Optional, Set
22
+ from typing_extensions import Self
23
+
24
+
25
+ class BulkSendListResponse(BaseModel):
26
+ """
27
+ List of bulk sends with pagination
28
+ """ # noqa: E501
29
+
30
+ bulk_sends: List[BulkSendListItem]
31
+ current_page: StrictInt
32
+ next_page: StrictInt | None = None
33
+ previous_page: StrictInt | None = None
34
+ total_count: StrictInt
35
+ total_pages: StrictInt
36
+ additional_properties: Dict[str, Any] = {}
37
+ __properties: ClassVar[List[str]] = [
38
+ "bulk_sends",
39
+ "current_page",
40
+ "next_page",
41
+ "previous_page",
42
+ "total_count",
43
+ "total_pages",
44
+ ]
45
+
46
+ model_config = ConfigDict(
47
+ populate_by_name=True,
48
+ validate_assignment=True,
49
+ protected_namespaces=(),
50
+ )
51
+
52
+ def to_str(self) -> str:
53
+ """Returns the string representation of the model using alias"""
54
+ return pprint.pformat(self.model_dump(by_alias=True))
55
+
56
+ def to_json(self) -> str:
57
+ """Returns the JSON representation of the model using alias"""
58
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
59
+ return json.dumps(self.to_dict())
60
+
61
+ @classmethod
62
+ def from_json(cls, json_str: str) -> Self | None:
63
+ """Create an instance of BulkSendListResponse from a JSON string"""
64
+ return cls.from_dict(json.loads(json_str))
65
+
66
+ def to_dict(self) -> Dict[str, Any]:
67
+ """Return the dictionary representation of the model using alias.
68
+
69
+ This has the following differences from calling pydantic's
70
+ `self.model_dump(by_alias=True)`:
71
+
72
+ * `None` is only added to the output dict for nullable fields that
73
+ were set at model initialization. Other fields with value `None`
74
+ are ignored.
75
+ * Fields in `self.additional_properties` are added to the output dict.
76
+ """
77
+ excluded_fields: Set[str] = set(
78
+ [
79
+ "additional_properties",
80
+ ]
81
+ )
82
+
83
+ _dict = self.model_dump(
84
+ by_alias=True,
85
+ exclude=excluded_fields,
86
+ exclude_none=True,
87
+ )
88
+ # override the default output from pydantic by calling `to_dict()` of each item in bulk_sends (list)
89
+ _items_bulk_sends: list[Any] = []
90
+ if self.bulk_sends:
91
+ for _item_bulk_sends in self.bulk_sends:
92
+ if _item_bulk_sends:
93
+ _items_bulk_sends.append(_item_bulk_sends.to_dict())
94
+ _dict["bulk_sends"] = _items_bulk_sends
95
+ # puts key-value pairs in additional_properties in the top level
96
+ if self.additional_properties is not None:
97
+ for _key, _value in self.additional_properties.items():
98
+ _dict[_key] = _value
99
+
100
+ # set to None if next_page (nullable) is None
101
+ # and model_fields_set contains the field
102
+ if self.next_page is None and "next_page" in self.model_fields_set:
103
+ _dict["next_page"] = None
104
+
105
+ # set to None if previous_page (nullable) is None
106
+ # and model_fields_set contains the field
107
+ if self.previous_page is None and "previous_page" in self.model_fields_set:
108
+ _dict["previous_page"] = None
109
+
110
+ return _dict
111
+
112
+ @classmethod
113
+ def from_dict(cls, obj: Dict[str, Any] | None) -> Self | None:
114
+ """Create an instance of BulkSendListResponse from a dict"""
115
+ if obj is None:
116
+ return None
117
+
118
+ if not isinstance(obj, dict):
119
+ return cls.model_validate(obj)
120
+
121
+ _obj = cls.model_validate(
122
+ {
123
+ "bulk_sends": [BulkSendListItem.from_dict(_item) for _item in obj["bulk_sends"]]
124
+ if obj.get("bulk_sends") is not None
125
+ else None,
126
+ "current_page": obj.get("current_page"),
127
+ "next_page": obj.get("next_page"),
128
+ "previous_page": obj.get("previous_page"),
129
+ "total_count": obj.get("total_count"),
130
+ "total_pages": obj.get("total_pages"),
131
+ }
132
+ )
133
+ # store additional fields in additional_properties
134
+ for _key in obj.keys():
135
+ if _key not in cls.__properties:
136
+ _obj.additional_properties[_key] = obj.get(_key)
137
+
138
+ return _obj
@@ -0,0 +1,151 @@
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, StrictInt, StrictStr
20
+ from typing import Any, ClassVar, Dict, List, Optional
21
+ from signwell_sdk.models.bulk_send_response_templates_inner import BulkSendResponseTemplatesInner
22
+ from typing import Any, Optional, Set
23
+ from typing_extensions import Self
24
+
25
+
26
+ class BulkSendResponse(BaseModel):
27
+ """
28
+ Bulk send details
29
+ """ # noqa: E501
30
+
31
+ id: StrictStr
32
+ name: StrictStr | None = None
33
+ api_application_id: StrictStr | None = None
34
+ documents_count: StrictInt
35
+ documents_completed: StrictInt | None = None
36
+ documents_not_completed: StrictInt | None = None
37
+ created_at: datetime
38
+ user_id: StrictStr | None = None
39
+ status: StrictStr
40
+ templates: List[BulkSendResponseTemplatesInner] | None = None
41
+ additional_properties: Dict[str, Any] = {}
42
+ __properties: ClassVar[List[str]] = [
43
+ "id",
44
+ "name",
45
+ "api_application_id",
46
+ "documents_count",
47
+ "documents_completed",
48
+ "documents_not_completed",
49
+ "created_at",
50
+ "user_id",
51
+ "status",
52
+ "templates",
53
+ ]
54
+
55
+ model_config = ConfigDict(
56
+ populate_by_name=True,
57
+ validate_assignment=True,
58
+ protected_namespaces=(),
59
+ )
60
+
61
+ def to_str(self) -> str:
62
+ """Returns the string representation of the model using alias"""
63
+ return pprint.pformat(self.model_dump(by_alias=True))
64
+
65
+ def to_json(self) -> str:
66
+ """Returns the JSON representation of the model using alias"""
67
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
68
+ return json.dumps(self.to_dict())
69
+
70
+ @classmethod
71
+ def from_json(cls, json_str: str) -> Self | None:
72
+ """Create an instance of BulkSendResponse from a JSON string"""
73
+ return cls.from_dict(json.loads(json_str))
74
+
75
+ def to_dict(self) -> Dict[str, Any]:
76
+ """Return the dictionary representation of the model using alias.
77
+
78
+ This has the following differences from calling pydantic's
79
+ `self.model_dump(by_alias=True)`:
80
+
81
+ * `None` is only added to the output dict for nullable fields that
82
+ were set at model initialization. Other fields with value `None`
83
+ are ignored.
84
+ * Fields in `self.additional_properties` are added to the output dict.
85
+ """
86
+ excluded_fields: Set[str] = set(
87
+ [
88
+ "additional_properties",
89
+ ]
90
+ )
91
+
92
+ _dict = self.model_dump(
93
+ by_alias=True,
94
+ exclude=excluded_fields,
95
+ exclude_none=True,
96
+ )
97
+ # override the default output from pydantic by calling `to_dict()` of each item in templates (list)
98
+ _items_templates: list[Any] = []
99
+ if self.templates:
100
+ for _item_templates in self.templates:
101
+ if _item_templates:
102
+ _items_templates.append(_item_templates.to_dict())
103
+ _dict["templates"] = _items_templates
104
+ # puts key-value pairs in additional_properties in the top level
105
+ if self.additional_properties is not None:
106
+ for _key, _value in self.additional_properties.items():
107
+ _dict[_key] = _value
108
+
109
+ # set to None if api_application_id (nullable) is None
110
+ # and model_fields_set contains the field
111
+ if self.api_application_id is None and "api_application_id" in self.model_fields_set:
112
+ _dict["api_application_id"] = None
113
+
114
+ # set to None if user_id (nullable) is None
115
+ # and model_fields_set contains the field
116
+ if self.user_id is None and "user_id" in self.model_fields_set:
117
+ _dict["user_id"] = None
118
+
119
+ return _dict
120
+
121
+ @classmethod
122
+ def from_dict(cls, obj: Dict[str, Any] | None) -> Self | None:
123
+ """Create an instance of BulkSendResponse from a dict"""
124
+ if obj is None:
125
+ return None
126
+
127
+ if not isinstance(obj, dict):
128
+ return cls.model_validate(obj)
129
+
130
+ _obj = cls.model_validate(
131
+ {
132
+ "id": obj.get("id"),
133
+ "name": obj.get("name"),
134
+ "api_application_id": obj.get("api_application_id"),
135
+ "documents_count": obj.get("documents_count"),
136
+ "documents_completed": obj.get("documents_completed"),
137
+ "documents_not_completed": obj.get("documents_not_completed"),
138
+ "created_at": obj.get("created_at"),
139
+ "user_id": obj.get("user_id"),
140
+ "status": obj.get("status"),
141
+ "templates": [BulkSendResponseTemplatesInner.from_dict(_item) for _item in obj["templates"]]
142
+ if obj.get("templates") is not None
143
+ else None,
144
+ }
145
+ )
146
+ # store additional fields in additional_properties
147
+ for _key in obj.keys():
148
+ if _key not in cls.__properties:
149
+ _obj.additional_properties[_key] = obj.get(_key)
150
+
151
+ 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, 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 BulkSendResponseTemplatesInner(BaseModel):
25
+ """
26
+ BulkSendResponseTemplatesInner
27
+ """ # noqa: E501
28
+
29
+ id: StrictStr
30
+ name: StrictStr
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 BulkSendResponseTemplatesInner 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 BulkSendResponseTemplatesInner 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
@@ -0,0 +1,129 @@
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, 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 BulkSendValidateCsvResponse(BaseModel):
25
+ """
26
+ Validated bulk send CSV response with defaults applied
27
+ """ # noqa: E501
28
+
29
+ bulk_send_csv: StrictStr = Field(description="Base64-encoded CSV content")
30
+ template_ids: List[StrictStr]
31
+ skip_row_errors: StrictBool | None = None
32
+ api_application_id: StrictStr | None = None
33
+ name: StrictStr | None = None
34
+ subject: StrictStr | None = None
35
+ message: StrictStr | None = None
36
+ apply_signing_order: StrictBool | None = None
37
+ additional_properties: Dict[str, Any] = {}
38
+ __properties: ClassVar[List[str]] = [
39
+ "bulk_send_csv",
40
+ "template_ids",
41
+ "skip_row_errors",
42
+ "api_application_id",
43
+ "name",
44
+ "subject",
45
+ "message",
46
+ "apply_signing_order",
47
+ ]
48
+
49
+ model_config = ConfigDict(
50
+ populate_by_name=True,
51
+ validate_assignment=True,
52
+ protected_namespaces=(),
53
+ )
54
+
55
+ def to_str(self) -> str:
56
+ """Returns the string representation of the model using alias"""
57
+ return pprint.pformat(self.model_dump(by_alias=True))
58
+
59
+ def to_json(self) -> str:
60
+ """Returns the JSON representation of the model using alias"""
61
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
62
+ return json.dumps(self.to_dict())
63
+
64
+ @classmethod
65
+ def from_json(cls, json_str: str) -> Self | None:
66
+ """Create an instance of BulkSendValidateCsvResponse from a JSON string"""
67
+ return cls.from_dict(json.loads(json_str))
68
+
69
+ def to_dict(self) -> Dict[str, Any]:
70
+ """Return the dictionary representation of the model using alias.
71
+
72
+ This has the following differences from calling pydantic's
73
+ `self.model_dump(by_alias=True)`:
74
+
75
+ * `None` is only added to the output dict for nullable fields that
76
+ were set at model initialization. Other fields with value `None`
77
+ are ignored.
78
+ * Fields in `self.additional_properties` are added to the output dict.
79
+ """
80
+ excluded_fields: Set[str] = set(
81
+ [
82
+ "additional_properties",
83
+ ]
84
+ )
85
+
86
+ _dict = self.model_dump(
87
+ by_alias=True,
88
+ exclude=excluded_fields,
89
+ exclude_none=True,
90
+ )
91
+ # puts key-value pairs in additional_properties in the top level
92
+ if self.additional_properties is not None:
93
+ for _key, _value in self.additional_properties.items():
94
+ _dict[_key] = _value
95
+
96
+ # set to None if api_application_id (nullable) is None
97
+ # and model_fields_set contains the field
98
+ if self.api_application_id is None and "api_application_id" in self.model_fields_set:
99
+ _dict["api_application_id"] = None
100
+
101
+ return _dict
102
+
103
+ @classmethod
104
+ def from_dict(cls, obj: Dict[str, Any] | None) -> Self | None:
105
+ """Create an instance of BulkSendValidateCsvResponse from a dict"""
106
+ if obj is None:
107
+ return None
108
+
109
+ if not isinstance(obj, dict):
110
+ return cls.model_validate(obj)
111
+
112
+ _obj = cls.model_validate(
113
+ {
114
+ "bulk_send_csv": obj.get("bulk_send_csv"),
115
+ "template_ids": obj.get("template_ids"),
116
+ "skip_row_errors": obj.get("skip_row_errors"),
117
+ "api_application_id": obj.get("api_application_id"),
118
+ "name": obj.get("name"),
119
+ "subject": obj.get("subject"),
120
+ "message": obj.get("message"),
121
+ "apply_signing_order": obj.get("apply_signing_order"),
122
+ }
123
+ )
124
+ # store additional fields in additional_properties
125
+ for _key in obj.keys():
126
+ if _key not in cls.__properties:
127
+ _obj.additional_properties[_key] = obj.get(_key)
128
+
129
+ return _obj
@@ -0,0 +1,138 @@
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 CheckboxGroupInfo(BaseModel):
26
+ """
27
+ Checkbox group configuration
28
+ """ # noqa: E501
29
+
30
+ id: StrictStr = Field(description="Checkbox group ID")
31
+ group_name: StrictStr | None = Field(default=None, description="Name of the checkbox group")
32
+ recipient_id: StrictStr | None = Field(default=None, description="Recipient ID associated with the group")
33
+ checkbox_ids: List[StrictStr] = Field(description="IDs of checkboxes in this group")
34
+ validation: CheckboxValidation | None = None
35
+ required: StrictBool = Field(description="Whether at least one checkbox must be checked")
36
+ min_value: StrictInt | None = Field(default=None, description="Minimum number of checkboxes to check")
37
+ max_value: StrictInt | None = Field(default=None, description="Maximum number of checkboxes to check")
38
+ exact_value: StrictInt | None = Field(default=None, description="Exact number of checkboxes that must be checked")
39
+ additional_properties: Dict[str, Any] = {}
40
+ __properties: ClassVar[List[str]] = [
41
+ "id",
42
+ "group_name",
43
+ "recipient_id",
44
+ "checkbox_ids",
45
+ "validation",
46
+ "required",
47
+ "min_value",
48
+ "max_value",
49
+ "exact_value",
50
+ ]
51
+
52
+ model_config = ConfigDict(
53
+ populate_by_name=True,
54
+ validate_assignment=True,
55
+ protected_namespaces=(),
56
+ )
57
+
58
+ def to_str(self) -> str:
59
+ """Returns the string representation of the model using alias"""
60
+ return pprint.pformat(self.model_dump(by_alias=True))
61
+
62
+ def to_json(self) -> str:
63
+ """Returns the JSON representation of the model using alias"""
64
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
65
+ return json.dumps(self.to_dict())
66
+
67
+ @classmethod
68
+ def from_json(cls, json_str: str) -> Self | None:
69
+ """Create an instance of CheckboxGroupInfo from a JSON string"""
70
+ return cls.from_dict(json.loads(json_str))
71
+
72
+ def to_dict(self) -> Dict[str, Any]:
73
+ """Return the dictionary representation of the model using alias.
74
+
75
+ This has the following differences from calling pydantic's
76
+ `self.model_dump(by_alias=True)`:
77
+
78
+ * `None` is only added to the output dict for nullable fields that
79
+ were set at model initialization. Other fields with value `None`
80
+ are ignored.
81
+ * Fields in `self.additional_properties` are added to the output dict.
82
+ """
83
+ excluded_fields: Set[str] = set(
84
+ [
85
+ "additional_properties",
86
+ ]
87
+ )
88
+
89
+ _dict = self.model_dump(
90
+ by_alias=True,
91
+ exclude=excluded_fields,
92
+ exclude_none=True,
93
+ )
94
+ # puts key-value pairs in additional_properties in the top level
95
+ if self.additional_properties is not None:
96
+ for _key, _value in self.additional_properties.items():
97
+ _dict[_key] = _value
98
+
99
+ # set to None if group_name (nullable) is None
100
+ # and model_fields_set contains the field
101
+ if self.group_name is None and "group_name" in self.model_fields_set:
102
+ _dict["group_name"] = None
103
+
104
+ # set to None if recipient_id (nullable) is None
105
+ # and model_fields_set contains the field
106
+ if self.recipient_id is None and "recipient_id" in self.model_fields_set:
107
+ _dict["recipient_id"] = None
108
+
109
+ return _dict
110
+
111
+ @classmethod
112
+ def from_dict(cls, obj: Dict[str, Any] | None) -> Self | None:
113
+ """Create an instance of CheckboxGroupInfo from a dict"""
114
+ if obj is None:
115
+ return None
116
+
117
+ if not isinstance(obj, dict):
118
+ return cls.model_validate(obj)
119
+
120
+ _obj = cls.model_validate(
121
+ {
122
+ "id": obj.get("id"),
123
+ "group_name": obj.get("group_name"),
124
+ "recipient_id": obj.get("recipient_id"),
125
+ "checkbox_ids": obj.get("checkbox_ids"),
126
+ "validation": obj.get("validation"),
127
+ "required": obj.get("required"),
128
+ "min_value": obj.get("min_value"),
129
+ "max_value": obj.get("max_value"),
130
+ "exact_value": obj.get("exact_value"),
131
+ }
132
+ )
133
+ # store additional fields in additional_properties
134
+ for _key in obj.keys():
135
+ if _key not in cls.__properties:
136
+ _obj.additional_properties[_key] = obj.get(_key)
137
+
138
+ return _obj