agentmail-clone-v1 0.1.0
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.
- package/.env.example +20 -0
- package/.github/workflows/docs-deploy.yml +37 -0
- package/.github/workflows/landing-preview.yml +43 -0
- package/.github/workflows/openapi-lint.yml +31 -0
- package/.github/workflows/sdk-generate-check.yml +66 -0
- package/.github/workflows/sdk-release.yml +62 -0
- package/CHANGELOG.md +10 -0
- package/README.md +208 -0
- package/RELEASING.md +43 -0
- package/docs/api-reference/api-keys.mdx +11 -0
- package/docs/api-reference/domains.mdx +13 -0
- package/docs/api-reference/emails.mdx +26 -0
- package/docs/api-reference/inboxes.mdx +13 -0
- package/docs/api-reference/metrics.mdx +10 -0
- package/docs/authentication.mdx +25 -0
- package/docs/docs.json +35 -0
- package/docs/errors.mdx +34 -0
- package/docs/favicon.svg +5 -0
- package/docs/idempotency.mdx +18 -0
- package/docs/index.mdx +24 -0
- package/docs/quickstart.mdx +134 -0
- package/landing/DEPLOYING.md +33 -0
- package/landing/favicon.svg +5 -0
- package/landing/index.html +129 -0
- package/landing/main.js +45 -0
- package/landing/privacy.html +29 -0
- package/landing/styles.css +356 -0
- package/landing/terms.html +29 -0
- package/netlify.toml +15 -0
- package/openapi/openapi.yaml +1016 -0
- package/package.json +34 -0
- package/render.yaml +48 -0
- package/scripts/generate-sdk-py.sh +16 -0
- package/scripts/generate-sdk-ts.sh +16 -0
- package/scripts/migrate.js +66 -0
- package/scripts/validate-docs.js +56 -0
- package/scripts/validate-landing.js +39 -0
- package/sdks/python/README.md +40 -0
- package/sdks/python/emailagent_sdk/__init__.py +157 -0
- package/sdks/python/generated/.openapi-generator/FILES +101 -0
- package/sdks/python/generated/.openapi-generator/VERSION +1 -0
- package/sdks/python/generated/.openapi-generator-ignore +23 -0
- package/sdks/python/generated/emailagent_sdk_generated/__init__.py +105 -0
- package/sdks/python/generated/emailagent_sdk_generated/api/__init__.py +9 -0
- package/sdks/python/generated/emailagent_sdk_generated/api/api_keys_api.py +1162 -0
- package/sdks/python/generated/emailagent_sdk_generated/api/domains_api.py +1168 -0
- package/sdks/python/generated/emailagent_sdk_generated/api/emails_api.py +1232 -0
- package/sdks/python/generated/emailagent_sdk_generated/api/inboxes_api.py +1191 -0
- package/sdks/python/generated/emailagent_sdk_generated/api/metrics_api.py +285 -0
- package/sdks/python/generated/emailagent_sdk_generated/api_client.py +801 -0
- package/sdks/python/generated/emailagent_sdk_generated/api_response.py +21 -0
- package/sdks/python/generated/emailagent_sdk_generated/configuration.py +586 -0
- package/sdks/python/generated/emailagent_sdk_generated/docs/APIKeysApi.md +334 -0
- package/sdks/python/generated/emailagent_sdk_generated/docs/ApiKeyCreated.md +35 -0
- package/sdks/python/generated/emailagent_sdk_generated/docs/ApiKeyCreatedResponse.md +29 -0
- package/sdks/python/generated/emailagent_sdk_generated/docs/ApiKeyListItem.md +35 -0
- package/sdks/python/generated/emailagent_sdk_generated/docs/ApiKeyListResponse.md +29 -0
- package/sdks/python/generated/emailagent_sdk_generated/docs/CreateApiKeyRequest.md +30 -0
- package/sdks/python/generated/emailagent_sdk_generated/docs/CreateApiKeyRequestScopes.md +29 -0
- package/sdks/python/generated/emailagent_sdk_generated/docs/CreateDomainRequest.md +29 -0
- package/sdks/python/generated/emailagent_sdk_generated/docs/CreateInboxRequest.md +31 -0
- package/sdks/python/generated/emailagent_sdk_generated/docs/Domain.md +37 -0
- package/sdks/python/generated/emailagent_sdk_generated/docs/DomainListResponse.md +29 -0
- package/sdks/python/generated/emailagent_sdk_generated/docs/DomainResponse.md +29 -0
- package/sdks/python/generated/emailagent_sdk_generated/docs/DomainsApi.md +336 -0
- package/sdks/python/generated/emailagent_sdk_generated/docs/Email.md +43 -0
- package/sdks/python/generated/emailagent_sdk_generated/docs/EmailListResponse.md +29 -0
- package/sdks/python/generated/emailagent_sdk_generated/docs/EmailResponse.md +29 -0
- package/sdks/python/generated/emailagent_sdk_generated/docs/EmailsApi.md +353 -0
- package/sdks/python/generated/emailagent_sdk_generated/docs/ErrorResponse.md +29 -0
- package/sdks/python/generated/emailagent_sdk_generated/docs/Inbox.md +38 -0
- package/sdks/python/generated/emailagent_sdk_generated/docs/InboxListResponse.md +29 -0
- package/sdks/python/generated/emailagent_sdk_generated/docs/InboxResponse.md +29 -0
- package/sdks/python/generated/emailagent_sdk_generated/docs/InboxesApi.md +337 -0
- package/sdks/python/generated/emailagent_sdk_generated/docs/MetricsApi.md +83 -0
- package/sdks/python/generated/emailagent_sdk_generated/docs/MetricsData.md +35 -0
- package/sdks/python/generated/emailagent_sdk_generated/docs/MetricsResponse.md +29 -0
- package/sdks/python/generated/emailagent_sdk_generated/docs/OkResponse.md +29 -0
- package/sdks/python/generated/emailagent_sdk_generated/docs/PlanLimits.md +32 -0
- package/sdks/python/generated/emailagent_sdk_generated/docs/SendEmailRequest.md +32 -0
- package/sdks/python/generated/emailagent_sdk_generated/docs/UpdateEmailReadRequest.md +29 -0
- package/sdks/python/generated/emailagent_sdk_generated/docs/UpdateInboxRequest.md +29 -0
- package/sdks/python/generated/emailagent_sdk_generated/exceptions.py +216 -0
- package/sdks/python/generated/emailagent_sdk_generated/models/__init__.py +41 -0
- package/sdks/python/generated/emailagent_sdk_generated/models/api_key_created.py +113 -0
- package/sdks/python/generated/emailagent_sdk_generated/models/api_key_created_response.py +91 -0
- package/sdks/python/generated/emailagent_sdk_generated/models/api_key_list_item.py +123 -0
- package/sdks/python/generated/emailagent_sdk_generated/models/api_key_list_response.py +95 -0
- package/sdks/python/generated/emailagent_sdk_generated/models/create_api_key_request.py +93 -0
- package/sdks/python/generated/emailagent_sdk_generated/models/create_api_key_request_scopes.py +143 -0
- package/sdks/python/generated/emailagent_sdk_generated/models/create_domain_request.py +87 -0
- package/sdks/python/generated/emailagent_sdk_generated/models/create_inbox_request.py +91 -0
- package/sdks/python/generated/emailagent_sdk_generated/models/domain.py +134 -0
- package/sdks/python/generated/emailagent_sdk_generated/models/domain_list_response.py +95 -0
- package/sdks/python/generated/emailagent_sdk_generated/models/domain_response.py +91 -0
- package/sdks/python/generated/emailagent_sdk_generated/models/email.py +175 -0
- package/sdks/python/generated/emailagent_sdk_generated/models/email_list_response.py +95 -0
- package/sdks/python/generated/emailagent_sdk_generated/models/email_response.py +91 -0
- package/sdks/python/generated/emailagent_sdk_generated/models/error_response.py +87 -0
- package/sdks/python/generated/emailagent_sdk_generated/models/inbox.py +136 -0
- package/sdks/python/generated/emailagent_sdk_generated/models/inbox_list_response.py +95 -0
- package/sdks/python/generated/emailagent_sdk_generated/models/inbox_response.py +91 -0
- package/sdks/python/generated/emailagent_sdk_generated/models/metrics_data.py +110 -0
- package/sdks/python/generated/emailagent_sdk_generated/models/metrics_response.py +91 -0
- package/sdks/python/generated/emailagent_sdk_generated/models/ok_response.py +87 -0
- package/sdks/python/generated/emailagent_sdk_generated/models/plan_limits.py +93 -0
- package/sdks/python/generated/emailagent_sdk_generated/models/send_email_request.py +93 -0
- package/sdks/python/generated/emailagent_sdk_generated/models/update_email_read_request.py +87 -0
- package/sdks/python/generated/emailagent_sdk_generated/models/update_inbox_request.py +92 -0
- package/sdks/python/generated/emailagent_sdk_generated/rest.py +258 -0
- package/sdks/python/generated/emailagent_sdk_generated/test/__init__.py +0 -0
- package/sdks/python/generated/emailagent_sdk_generated/test/test_api_key_created.py +68 -0
- package/sdks/python/generated/emailagent_sdk_generated/test/test_api_key_created_response.py +52 -0
- package/sdks/python/generated/emailagent_sdk_generated/test/test_api_key_list_item.py +66 -0
- package/sdks/python/generated/emailagent_sdk_generated/test/test_api_key_list_response.py +56 -0
- package/sdks/python/generated/emailagent_sdk_generated/test/test_api_keys_api.py +59 -0
- package/sdks/python/generated/emailagent_sdk_generated/test/test_create_api_key_request.py +53 -0
- package/sdks/python/generated/emailagent_sdk_generated/test/test_create_api_key_request_scopes.py +50 -0
- package/sdks/python/generated/emailagent_sdk_generated/test/test_create_domain_request.py +52 -0
- package/sdks/python/generated/emailagent_sdk_generated/test/test_create_inbox_request.py +54 -0
- package/sdks/python/generated/emailagent_sdk_generated/test/test_domain.py +70 -0
- package/sdks/python/generated/emailagent_sdk_generated/test/test_domain_list_response.py +56 -0
- package/sdks/python/generated/emailagent_sdk_generated/test/test_domain_response.py +52 -0
- package/sdks/python/generated/emailagent_sdk_generated/test/test_domains_api.py +59 -0
- package/sdks/python/generated/emailagent_sdk_generated/test/test_email.py +79 -0
- package/sdks/python/generated/emailagent_sdk_generated/test/test_email_list_response.py +56 -0
- package/sdks/python/generated/emailagent_sdk_generated/test/test_email_response.py +52 -0
- package/sdks/python/generated/emailagent_sdk_generated/test/test_emails_api.py +59 -0
- package/sdks/python/generated/emailagent_sdk_generated/test/test_error_response.py +52 -0
- package/sdks/python/generated/emailagent_sdk_generated/test/test_inbox.py +68 -0
- package/sdks/python/generated/emailagent_sdk_generated/test/test_inbox_list_response.py +56 -0
- package/sdks/python/generated/emailagent_sdk_generated/test/test_inbox_response.py +52 -0
- package/sdks/python/generated/emailagent_sdk_generated/test/test_inboxes_api.py +59 -0
- package/sdks/python/generated/emailagent_sdk_generated/test/test_metrics_api.py +38 -0
- package/sdks/python/generated/emailagent_sdk_generated/test/test_metrics_data.py +72 -0
- package/sdks/python/generated/emailagent_sdk_generated/test/test_metrics_response.py +74 -0
- package/sdks/python/generated/emailagent_sdk_generated/test/test_ok_response.py +52 -0
- package/sdks/python/generated/emailagent_sdk_generated/test/test_plan_limits.py +58 -0
- package/sdks/python/generated/emailagent_sdk_generated/test/test_send_email_request.py +56 -0
- package/sdks/python/generated/emailagent_sdk_generated/test/test_update_email_read_request.py +52 -0
- package/sdks/python/generated/emailagent_sdk_generated/test/test_update_inbox_request.py +52 -0
- package/sdks/python/generated/emailagent_sdk_generated_README.md +140 -0
- package/sdks/python/openapitools.json +7 -0
- package/sdks/python/pyproject.toml +19 -0
- package/sdks/typescript/README.md +41 -0
- package/sdks/typescript/generated/.openapi-generator/FILES +41 -0
- package/sdks/typescript/generated/.openapi-generator/VERSION +1 -0
- package/sdks/typescript/generated/.openapi-generator-ignore +23 -0
- package/sdks/typescript/generated/package.json +21 -0
- package/sdks/typescript/generated/src/apis/APIKeysApi.ts +314 -0
- package/sdks/typescript/generated/src/apis/DomainsApi.ts +314 -0
- package/sdks/typescript/generated/src/apis/EmailsApi.ts +350 -0
- package/sdks/typescript/generated/src/apis/InboxesApi.ts +329 -0
- package/sdks/typescript/generated/src/apis/MetricsApi.ts +93 -0
- package/sdks/typescript/generated/src/apis/index.ts +7 -0
- package/sdks/typescript/generated/src/index.ts +5 -0
- package/sdks/typescript/generated/src/models/ApiKeyCreated.ts +123 -0
- package/sdks/typescript/generated/src/models/ApiKeyCreatedResponse.ts +74 -0
- package/sdks/typescript/generated/src/models/ApiKeyListItem.ts +121 -0
- package/sdks/typescript/generated/src/models/ApiKeyListResponse.ts +74 -0
- package/sdks/typescript/generated/src/models/CreateApiKeyRequest.ts +82 -0
- package/sdks/typescript/generated/src/models/CreateApiKeyRequestScopes.ts +45 -0
- package/sdks/typescript/generated/src/models/CreateDomainRequest.ts +66 -0
- package/sdks/typescript/generated/src/models/CreateInboxRequest.ts +82 -0
- package/sdks/typescript/generated/src/models/Domain.ts +152 -0
- package/sdks/typescript/generated/src/models/DomainListResponse.ts +74 -0
- package/sdks/typescript/generated/src/models/DomainResponse.ts +74 -0
- package/sdks/typescript/generated/src/models/Email.ts +222 -0
- package/sdks/typescript/generated/src/models/EmailListResponse.ts +74 -0
- package/sdks/typescript/generated/src/models/EmailResponse.ts +74 -0
- package/sdks/typescript/generated/src/models/ErrorResponse.ts +66 -0
- package/sdks/typescript/generated/src/models/Inbox.ts +159 -0
- package/sdks/typescript/generated/src/models/InboxListResponse.ts +74 -0
- package/sdks/typescript/generated/src/models/InboxResponse.ts +74 -0
- package/sdks/typescript/generated/src/models/MetricsData.ts +139 -0
- package/sdks/typescript/generated/src/models/MetricsResponse.ts +74 -0
- package/sdks/typescript/generated/src/models/OkResponse.ts +66 -0
- package/sdks/typescript/generated/src/models/PlanLimits.ts +93 -0
- package/sdks/typescript/generated/src/models/SendEmailRequest.ts +91 -0
- package/sdks/typescript/generated/src/models/UpdateEmailReadRequest.ts +66 -0
- package/sdks/typescript/generated/src/models/UpdateInboxRequest.ts +66 -0
- package/sdks/typescript/generated/src/models/index.ts +27 -0
- package/sdks/typescript/generated/src/runtime.ts +432 -0
- package/sdks/typescript/generated/tsconfig.esm.json +7 -0
- package/sdks/typescript/generated/tsconfig.json +16 -0
- package/sdks/typescript/openapitools.json +8 -0
- package/sdks/typescript/package.json +27 -0
- package/sdks/typescript/src/index.ts +138 -0
- package/sdks/typescript/tsconfig.json +14 -0
- package/sql/001_init.sql +143 -0
- package/sql/002_local_auth.sql +38 -0
- package/sql/003_domain_routes.sql +2 -0
- package/sql/004_reliability_primitives.sql +75 -0
- package/sql/005_auth_email_flows.sql +22 -0
- package/src/config.js +30 -0
- package/src/db.js +25 -0
- package/src/lib/api-auth.js +55 -0
- package/src/lib/auth.js +71 -0
- package/src/lib/csrf.js +46 -0
- package/src/lib/dodo.js +67 -0
- package/src/lib/email-templates.js +67 -0
- package/src/lib/idempotency.js +85 -0
- package/src/lib/mailgun.js +188 -0
- package/src/lib/plan.js +24 -0
- package/src/lib/rate-limit.js +43 -0
- package/src/lib/security.js +62 -0
- package/src/lib/session.js +21 -0
- package/src/lib/store.js +638 -0
- package/src/lib/transactional-mailer.js +54 -0
- package/src/lib/validation.js +30 -0
- package/src/routes/api.js +485 -0
- package/src/routes/app.js +699 -0
- package/src/routes/auth.js +404 -0
- package/src/routes/webhooks.js +257 -0
- package/src/server.js +79 -0
- package/src/views/pages/admin.ejs +58 -0
- package/src/views/pages/api-keys.ejs +56 -0
- package/src/views/pages/billing.ejs +71 -0
- package/src/views/pages/domains.ejs +106 -0
- package/src/views/pages/inboxes.ejs +127 -0
- package/src/views/pages/login.ejs +57 -0
- package/src/views/pages/metrics.ejs +34 -0
- package/src/views/pages/reset-password.ejs +19 -0
- package/src/views/partials/bottom.ejs +3 -0
- package/src/views/partials/csrf-field.ejs +3 -0
- package/src/views/partials/flash.ejs +3 -0
- package/src/views/partials/top.ejs +130 -0
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
"""
|
|
4
|
+
EmailAgent API
|
|
5
|
+
|
|
6
|
+
API for creating agent inboxes, sending emails, managing custom domains, managing API keys, and reading usage metrics. Authentication uses API keys via `Authorization: Bearer <api_key>`. For mutating endpoints, send an optional `Idempotency-Key` header. - Replaying the same key with the same payload returns the original response. - Reusing a key with a different payload returns `409`.
|
|
7
|
+
|
|
8
|
+
The version of the OpenAPI document: 1.0.0
|
|
9
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
|
10
|
+
|
|
11
|
+
Do not edit the class manually.
|
|
12
|
+
""" # noqa: E501
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
from __future__ import annotations
|
|
16
|
+
import pprint
|
|
17
|
+
import re # noqa: F401
|
|
18
|
+
import json
|
|
19
|
+
|
|
20
|
+
from pydantic import BaseModel, ConfigDict
|
|
21
|
+
from typing import Any, ClassVar, Dict, List
|
|
22
|
+
from emailagent_sdk_generated.models.inbox import Inbox
|
|
23
|
+
from typing import Optional, Set
|
|
24
|
+
from typing_extensions import Self
|
|
25
|
+
|
|
26
|
+
class InboxListResponse(BaseModel):
|
|
27
|
+
"""
|
|
28
|
+
InboxListResponse
|
|
29
|
+
""" # noqa: E501
|
|
30
|
+
data: List[Inbox]
|
|
31
|
+
__properties: ClassVar[List[str]] = ["data"]
|
|
32
|
+
|
|
33
|
+
model_config = ConfigDict(
|
|
34
|
+
populate_by_name=True,
|
|
35
|
+
validate_assignment=True,
|
|
36
|
+
protected_namespaces=(),
|
|
37
|
+
)
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
def to_str(self) -> str:
|
|
41
|
+
"""Returns the string representation of the model using alias"""
|
|
42
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
43
|
+
|
|
44
|
+
def to_json(self) -> str:
|
|
45
|
+
"""Returns the JSON representation of the model using alias"""
|
|
46
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
|
47
|
+
return json.dumps(self.to_dict())
|
|
48
|
+
|
|
49
|
+
@classmethod
|
|
50
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
51
|
+
"""Create an instance of InboxListResponse from a JSON string"""
|
|
52
|
+
return cls.from_dict(json.loads(json_str))
|
|
53
|
+
|
|
54
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
55
|
+
"""Return the dictionary representation of the model using alias.
|
|
56
|
+
|
|
57
|
+
This has the following differences from calling pydantic's
|
|
58
|
+
`self.model_dump(by_alias=True)`:
|
|
59
|
+
|
|
60
|
+
* `None` is only added to the output dict for nullable fields that
|
|
61
|
+
were set at model initialization. Other fields with value `None`
|
|
62
|
+
are ignored.
|
|
63
|
+
"""
|
|
64
|
+
excluded_fields: Set[str] = set([
|
|
65
|
+
])
|
|
66
|
+
|
|
67
|
+
_dict = self.model_dump(
|
|
68
|
+
by_alias=True,
|
|
69
|
+
exclude=excluded_fields,
|
|
70
|
+
exclude_none=True,
|
|
71
|
+
)
|
|
72
|
+
# override the default output from pydantic by calling `to_dict()` of each item in data (list)
|
|
73
|
+
_items = []
|
|
74
|
+
if self.data:
|
|
75
|
+
for _item_data in self.data:
|
|
76
|
+
if _item_data:
|
|
77
|
+
_items.append(_item_data.to_dict())
|
|
78
|
+
_dict['data'] = _items
|
|
79
|
+
return _dict
|
|
80
|
+
|
|
81
|
+
@classmethod
|
|
82
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
83
|
+
"""Create an instance of InboxListResponse from a dict"""
|
|
84
|
+
if obj is None:
|
|
85
|
+
return None
|
|
86
|
+
|
|
87
|
+
if not isinstance(obj, dict):
|
|
88
|
+
return cls.model_validate(obj)
|
|
89
|
+
|
|
90
|
+
_obj = cls.model_validate({
|
|
91
|
+
"data": [Inbox.from_dict(_item) for _item in obj["data"]] if obj.get("data") is not None else None
|
|
92
|
+
})
|
|
93
|
+
return _obj
|
|
94
|
+
|
|
95
|
+
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
"""
|
|
4
|
+
EmailAgent API
|
|
5
|
+
|
|
6
|
+
API for creating agent inboxes, sending emails, managing custom domains, managing API keys, and reading usage metrics. Authentication uses API keys via `Authorization: Bearer <api_key>`. For mutating endpoints, send an optional `Idempotency-Key` header. - Replaying the same key with the same payload returns the original response. - Reusing a key with a different payload returns `409`.
|
|
7
|
+
|
|
8
|
+
The version of the OpenAPI document: 1.0.0
|
|
9
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
|
10
|
+
|
|
11
|
+
Do not edit the class manually.
|
|
12
|
+
""" # noqa: E501
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
from __future__ import annotations
|
|
16
|
+
import pprint
|
|
17
|
+
import re # noqa: F401
|
|
18
|
+
import json
|
|
19
|
+
|
|
20
|
+
from pydantic import BaseModel, ConfigDict
|
|
21
|
+
from typing import Any, ClassVar, Dict, List
|
|
22
|
+
from emailagent_sdk_generated.models.inbox import Inbox
|
|
23
|
+
from typing import Optional, Set
|
|
24
|
+
from typing_extensions import Self
|
|
25
|
+
|
|
26
|
+
class InboxResponse(BaseModel):
|
|
27
|
+
"""
|
|
28
|
+
InboxResponse
|
|
29
|
+
""" # noqa: E501
|
|
30
|
+
data: Inbox
|
|
31
|
+
__properties: ClassVar[List[str]] = ["data"]
|
|
32
|
+
|
|
33
|
+
model_config = ConfigDict(
|
|
34
|
+
populate_by_name=True,
|
|
35
|
+
validate_assignment=True,
|
|
36
|
+
protected_namespaces=(),
|
|
37
|
+
)
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
def to_str(self) -> str:
|
|
41
|
+
"""Returns the string representation of the model using alias"""
|
|
42
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
43
|
+
|
|
44
|
+
def to_json(self) -> str:
|
|
45
|
+
"""Returns the JSON representation of the model using alias"""
|
|
46
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
|
47
|
+
return json.dumps(self.to_dict())
|
|
48
|
+
|
|
49
|
+
@classmethod
|
|
50
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
51
|
+
"""Create an instance of InboxResponse from a JSON string"""
|
|
52
|
+
return cls.from_dict(json.loads(json_str))
|
|
53
|
+
|
|
54
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
55
|
+
"""Return the dictionary representation of the model using alias.
|
|
56
|
+
|
|
57
|
+
This has the following differences from calling pydantic's
|
|
58
|
+
`self.model_dump(by_alias=True)`:
|
|
59
|
+
|
|
60
|
+
* `None` is only added to the output dict for nullable fields that
|
|
61
|
+
were set at model initialization. Other fields with value `None`
|
|
62
|
+
are ignored.
|
|
63
|
+
"""
|
|
64
|
+
excluded_fields: Set[str] = set([
|
|
65
|
+
])
|
|
66
|
+
|
|
67
|
+
_dict = self.model_dump(
|
|
68
|
+
by_alias=True,
|
|
69
|
+
exclude=excluded_fields,
|
|
70
|
+
exclude_none=True,
|
|
71
|
+
)
|
|
72
|
+
# override the default output from pydantic by calling `to_dict()` of data
|
|
73
|
+
if self.data:
|
|
74
|
+
_dict['data'] = self.data.to_dict()
|
|
75
|
+
return _dict
|
|
76
|
+
|
|
77
|
+
@classmethod
|
|
78
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
79
|
+
"""Create an instance of InboxResponse from a dict"""
|
|
80
|
+
if obj is None:
|
|
81
|
+
return None
|
|
82
|
+
|
|
83
|
+
if not isinstance(obj, dict):
|
|
84
|
+
return cls.model_validate(obj)
|
|
85
|
+
|
|
86
|
+
_obj = cls.model_validate({
|
|
87
|
+
"data": Inbox.from_dict(obj["data"]) if obj.get("data") is not None else None
|
|
88
|
+
})
|
|
89
|
+
return _obj
|
|
90
|
+
|
|
91
|
+
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
"""
|
|
4
|
+
EmailAgent API
|
|
5
|
+
|
|
6
|
+
API for creating agent inboxes, sending emails, managing custom domains, managing API keys, and reading usage metrics. Authentication uses API keys via `Authorization: Bearer <api_key>`. For mutating endpoints, send an optional `Idempotency-Key` header. - Replaying the same key with the same payload returns the original response. - Reusing a key with a different payload returns `409`.
|
|
7
|
+
|
|
8
|
+
The version of the OpenAPI document: 1.0.0
|
|
9
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
|
10
|
+
|
|
11
|
+
Do not edit the class manually.
|
|
12
|
+
""" # noqa: E501
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
from __future__ import annotations
|
|
16
|
+
import pprint
|
|
17
|
+
import re # noqa: F401
|
|
18
|
+
import json
|
|
19
|
+
|
|
20
|
+
from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr, field_validator
|
|
21
|
+
from typing import Any, ClassVar, Dict, List
|
|
22
|
+
from emailagent_sdk_generated.models.plan_limits import PlanLimits
|
|
23
|
+
from typing import Optional, Set
|
|
24
|
+
from typing_extensions import Self
|
|
25
|
+
|
|
26
|
+
class MetricsData(BaseModel):
|
|
27
|
+
"""
|
|
28
|
+
MetricsData
|
|
29
|
+
""" # noqa: E501
|
|
30
|
+
sent_count: StrictInt = Field(alias="sentCount")
|
|
31
|
+
inbound_count: StrictInt = Field(alias="inboundCount")
|
|
32
|
+
inbox_count: StrictInt = Field(alias="inboxCount")
|
|
33
|
+
custom_domain_count: StrictInt = Field(alias="customDomainCount")
|
|
34
|
+
api_key_count: StrictInt = Field(alias="apiKeyCount")
|
|
35
|
+
plan: StrictStr
|
|
36
|
+
limits: PlanLimits
|
|
37
|
+
__properties: ClassVar[List[str]] = ["sentCount", "inboundCount", "inboxCount", "customDomainCount", "apiKeyCount", "plan", "limits"]
|
|
38
|
+
|
|
39
|
+
@field_validator('plan')
|
|
40
|
+
def plan_validate_enum(cls, value):
|
|
41
|
+
"""Validates the enum"""
|
|
42
|
+
if value not in set(['free', 'paid']):
|
|
43
|
+
raise ValueError("must be one of enum values ('free', 'paid')")
|
|
44
|
+
return value
|
|
45
|
+
|
|
46
|
+
model_config = ConfigDict(
|
|
47
|
+
populate_by_name=True,
|
|
48
|
+
validate_assignment=True,
|
|
49
|
+
protected_namespaces=(),
|
|
50
|
+
)
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
def to_str(self) -> str:
|
|
54
|
+
"""Returns the string representation of the model using alias"""
|
|
55
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
56
|
+
|
|
57
|
+
def to_json(self) -> str:
|
|
58
|
+
"""Returns the JSON representation of the model using alias"""
|
|
59
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
|
60
|
+
return json.dumps(self.to_dict())
|
|
61
|
+
|
|
62
|
+
@classmethod
|
|
63
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
64
|
+
"""Create an instance of MetricsData from a JSON string"""
|
|
65
|
+
return cls.from_dict(json.loads(json_str))
|
|
66
|
+
|
|
67
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
68
|
+
"""Return the dictionary representation of the model using alias.
|
|
69
|
+
|
|
70
|
+
This has the following differences from calling pydantic's
|
|
71
|
+
`self.model_dump(by_alias=True)`:
|
|
72
|
+
|
|
73
|
+
* `None` is only added to the output dict for nullable fields that
|
|
74
|
+
were set at model initialization. Other fields with value `None`
|
|
75
|
+
are ignored.
|
|
76
|
+
"""
|
|
77
|
+
excluded_fields: Set[str] = set([
|
|
78
|
+
])
|
|
79
|
+
|
|
80
|
+
_dict = self.model_dump(
|
|
81
|
+
by_alias=True,
|
|
82
|
+
exclude=excluded_fields,
|
|
83
|
+
exclude_none=True,
|
|
84
|
+
)
|
|
85
|
+
# override the default output from pydantic by calling `to_dict()` of limits
|
|
86
|
+
if self.limits:
|
|
87
|
+
_dict['limits'] = self.limits.to_dict()
|
|
88
|
+
return _dict
|
|
89
|
+
|
|
90
|
+
@classmethod
|
|
91
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
92
|
+
"""Create an instance of MetricsData from a dict"""
|
|
93
|
+
if obj is None:
|
|
94
|
+
return None
|
|
95
|
+
|
|
96
|
+
if not isinstance(obj, dict):
|
|
97
|
+
return cls.model_validate(obj)
|
|
98
|
+
|
|
99
|
+
_obj = cls.model_validate({
|
|
100
|
+
"sentCount": obj.get("sentCount"),
|
|
101
|
+
"inboundCount": obj.get("inboundCount"),
|
|
102
|
+
"inboxCount": obj.get("inboxCount"),
|
|
103
|
+
"customDomainCount": obj.get("customDomainCount"),
|
|
104
|
+
"apiKeyCount": obj.get("apiKeyCount"),
|
|
105
|
+
"plan": obj.get("plan"),
|
|
106
|
+
"limits": PlanLimits.from_dict(obj["limits"]) if obj.get("limits") is not None else None
|
|
107
|
+
})
|
|
108
|
+
return _obj
|
|
109
|
+
|
|
110
|
+
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
"""
|
|
4
|
+
EmailAgent API
|
|
5
|
+
|
|
6
|
+
API for creating agent inboxes, sending emails, managing custom domains, managing API keys, and reading usage metrics. Authentication uses API keys via `Authorization: Bearer <api_key>`. For mutating endpoints, send an optional `Idempotency-Key` header. - Replaying the same key with the same payload returns the original response. - Reusing a key with a different payload returns `409`.
|
|
7
|
+
|
|
8
|
+
The version of the OpenAPI document: 1.0.0
|
|
9
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
|
10
|
+
|
|
11
|
+
Do not edit the class manually.
|
|
12
|
+
""" # noqa: E501
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
from __future__ import annotations
|
|
16
|
+
import pprint
|
|
17
|
+
import re # noqa: F401
|
|
18
|
+
import json
|
|
19
|
+
|
|
20
|
+
from pydantic import BaseModel, ConfigDict
|
|
21
|
+
from typing import Any, ClassVar, Dict, List
|
|
22
|
+
from emailagent_sdk_generated.models.metrics_data import MetricsData
|
|
23
|
+
from typing import Optional, Set
|
|
24
|
+
from typing_extensions import Self
|
|
25
|
+
|
|
26
|
+
class MetricsResponse(BaseModel):
|
|
27
|
+
"""
|
|
28
|
+
MetricsResponse
|
|
29
|
+
""" # noqa: E501
|
|
30
|
+
data: MetricsData
|
|
31
|
+
__properties: ClassVar[List[str]] = ["data"]
|
|
32
|
+
|
|
33
|
+
model_config = ConfigDict(
|
|
34
|
+
populate_by_name=True,
|
|
35
|
+
validate_assignment=True,
|
|
36
|
+
protected_namespaces=(),
|
|
37
|
+
)
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
def to_str(self) -> str:
|
|
41
|
+
"""Returns the string representation of the model using alias"""
|
|
42
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
43
|
+
|
|
44
|
+
def to_json(self) -> str:
|
|
45
|
+
"""Returns the JSON representation of the model using alias"""
|
|
46
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
|
47
|
+
return json.dumps(self.to_dict())
|
|
48
|
+
|
|
49
|
+
@classmethod
|
|
50
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
51
|
+
"""Create an instance of MetricsResponse from a JSON string"""
|
|
52
|
+
return cls.from_dict(json.loads(json_str))
|
|
53
|
+
|
|
54
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
55
|
+
"""Return the dictionary representation of the model using alias.
|
|
56
|
+
|
|
57
|
+
This has the following differences from calling pydantic's
|
|
58
|
+
`self.model_dump(by_alias=True)`:
|
|
59
|
+
|
|
60
|
+
* `None` is only added to the output dict for nullable fields that
|
|
61
|
+
were set at model initialization. Other fields with value `None`
|
|
62
|
+
are ignored.
|
|
63
|
+
"""
|
|
64
|
+
excluded_fields: Set[str] = set([
|
|
65
|
+
])
|
|
66
|
+
|
|
67
|
+
_dict = self.model_dump(
|
|
68
|
+
by_alias=True,
|
|
69
|
+
exclude=excluded_fields,
|
|
70
|
+
exclude_none=True,
|
|
71
|
+
)
|
|
72
|
+
# override the default output from pydantic by calling `to_dict()` of data
|
|
73
|
+
if self.data:
|
|
74
|
+
_dict['data'] = self.data.to_dict()
|
|
75
|
+
return _dict
|
|
76
|
+
|
|
77
|
+
@classmethod
|
|
78
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
79
|
+
"""Create an instance of MetricsResponse from a dict"""
|
|
80
|
+
if obj is None:
|
|
81
|
+
return None
|
|
82
|
+
|
|
83
|
+
if not isinstance(obj, dict):
|
|
84
|
+
return cls.model_validate(obj)
|
|
85
|
+
|
|
86
|
+
_obj = cls.model_validate({
|
|
87
|
+
"data": MetricsData.from_dict(obj["data"]) if obj.get("data") is not None else None
|
|
88
|
+
})
|
|
89
|
+
return _obj
|
|
90
|
+
|
|
91
|
+
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
"""
|
|
4
|
+
EmailAgent API
|
|
5
|
+
|
|
6
|
+
API for creating agent inboxes, sending emails, managing custom domains, managing API keys, and reading usage metrics. Authentication uses API keys via `Authorization: Bearer <api_key>`. For mutating endpoints, send an optional `Idempotency-Key` header. - Replaying the same key with the same payload returns the original response. - Reusing a key with a different payload returns `409`.
|
|
7
|
+
|
|
8
|
+
The version of the OpenAPI document: 1.0.0
|
|
9
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
|
10
|
+
|
|
11
|
+
Do not edit the class manually.
|
|
12
|
+
""" # noqa: E501
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
from __future__ import annotations
|
|
16
|
+
import pprint
|
|
17
|
+
import re # noqa: F401
|
|
18
|
+
import json
|
|
19
|
+
|
|
20
|
+
from pydantic import BaseModel, ConfigDict, StrictBool
|
|
21
|
+
from typing import Any, ClassVar, Dict, List
|
|
22
|
+
from typing import Optional, Set
|
|
23
|
+
from typing_extensions import Self
|
|
24
|
+
|
|
25
|
+
class OkResponse(BaseModel):
|
|
26
|
+
"""
|
|
27
|
+
OkResponse
|
|
28
|
+
""" # noqa: E501
|
|
29
|
+
ok: StrictBool
|
|
30
|
+
__properties: ClassVar[List[str]] = ["ok"]
|
|
31
|
+
|
|
32
|
+
model_config = ConfigDict(
|
|
33
|
+
populate_by_name=True,
|
|
34
|
+
validate_assignment=True,
|
|
35
|
+
protected_namespaces=(),
|
|
36
|
+
)
|
|
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) -> Optional[Self]:
|
|
50
|
+
"""Create an instance of OkResponse 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
|
+
"""
|
|
63
|
+
excluded_fields: Set[str] = set([
|
|
64
|
+
])
|
|
65
|
+
|
|
66
|
+
_dict = self.model_dump(
|
|
67
|
+
by_alias=True,
|
|
68
|
+
exclude=excluded_fields,
|
|
69
|
+
exclude_none=True,
|
|
70
|
+
)
|
|
71
|
+
return _dict
|
|
72
|
+
|
|
73
|
+
@classmethod
|
|
74
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
75
|
+
"""Create an instance of OkResponse from a dict"""
|
|
76
|
+
if obj is None:
|
|
77
|
+
return None
|
|
78
|
+
|
|
79
|
+
if not isinstance(obj, dict):
|
|
80
|
+
return cls.model_validate(obj)
|
|
81
|
+
|
|
82
|
+
_obj = cls.model_validate({
|
|
83
|
+
"ok": obj.get("ok")
|
|
84
|
+
})
|
|
85
|
+
return _obj
|
|
86
|
+
|
|
87
|
+
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
"""
|
|
4
|
+
EmailAgent API
|
|
5
|
+
|
|
6
|
+
API for creating agent inboxes, sending emails, managing custom domains, managing API keys, and reading usage metrics. Authentication uses API keys via `Authorization: Bearer <api_key>`. For mutating endpoints, send an optional `Idempotency-Key` header. - Replaying the same key with the same payload returns the original response. - Reusing a key with a different payload returns `409`.
|
|
7
|
+
|
|
8
|
+
The version of the OpenAPI document: 1.0.0
|
|
9
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
|
10
|
+
|
|
11
|
+
Do not edit the class manually.
|
|
12
|
+
""" # noqa: E501
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
from __future__ import annotations
|
|
16
|
+
import pprint
|
|
17
|
+
import re # noqa: F401
|
|
18
|
+
import json
|
|
19
|
+
|
|
20
|
+
from pydantic import BaseModel, ConfigDict, Field, StrictInt
|
|
21
|
+
from typing import Any, ClassVar, Dict, List
|
|
22
|
+
from typing import Optional, Set
|
|
23
|
+
from typing_extensions import Self
|
|
24
|
+
|
|
25
|
+
class PlanLimits(BaseModel):
|
|
26
|
+
"""
|
|
27
|
+
PlanLimits
|
|
28
|
+
""" # noqa: E501
|
|
29
|
+
max_inboxes: StrictInt = Field(alias="maxInboxes")
|
|
30
|
+
max_custom_domains: StrictInt = Field(alias="maxCustomDomains")
|
|
31
|
+
max_api_keys: StrictInt = Field(alias="maxApiKeys")
|
|
32
|
+
monthly_emails: StrictInt = Field(alias="monthlyEmails")
|
|
33
|
+
__properties: ClassVar[List[str]] = ["maxInboxes", "maxCustomDomains", "maxApiKeys", "monthlyEmails"]
|
|
34
|
+
|
|
35
|
+
model_config = ConfigDict(
|
|
36
|
+
populate_by_name=True,
|
|
37
|
+
validate_assignment=True,
|
|
38
|
+
protected_namespaces=(),
|
|
39
|
+
)
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
def to_str(self) -> str:
|
|
43
|
+
"""Returns the string representation of the model using alias"""
|
|
44
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
45
|
+
|
|
46
|
+
def to_json(self) -> str:
|
|
47
|
+
"""Returns the JSON representation of the model using alias"""
|
|
48
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
|
49
|
+
return json.dumps(self.to_dict())
|
|
50
|
+
|
|
51
|
+
@classmethod
|
|
52
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
53
|
+
"""Create an instance of PlanLimits from a JSON string"""
|
|
54
|
+
return cls.from_dict(json.loads(json_str))
|
|
55
|
+
|
|
56
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
57
|
+
"""Return the dictionary representation of the model using alias.
|
|
58
|
+
|
|
59
|
+
This has the following differences from calling pydantic's
|
|
60
|
+
`self.model_dump(by_alias=True)`:
|
|
61
|
+
|
|
62
|
+
* `None` is only added to the output dict for nullable fields that
|
|
63
|
+
were set at model initialization. Other fields with value `None`
|
|
64
|
+
are ignored.
|
|
65
|
+
"""
|
|
66
|
+
excluded_fields: Set[str] = set([
|
|
67
|
+
])
|
|
68
|
+
|
|
69
|
+
_dict = self.model_dump(
|
|
70
|
+
by_alias=True,
|
|
71
|
+
exclude=excluded_fields,
|
|
72
|
+
exclude_none=True,
|
|
73
|
+
)
|
|
74
|
+
return _dict
|
|
75
|
+
|
|
76
|
+
@classmethod
|
|
77
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
78
|
+
"""Create an instance of PlanLimits from a dict"""
|
|
79
|
+
if obj is None:
|
|
80
|
+
return None
|
|
81
|
+
|
|
82
|
+
if not isinstance(obj, dict):
|
|
83
|
+
return cls.model_validate(obj)
|
|
84
|
+
|
|
85
|
+
_obj = cls.model_validate({
|
|
86
|
+
"maxInboxes": obj.get("maxInboxes"),
|
|
87
|
+
"maxCustomDomains": obj.get("maxCustomDomains"),
|
|
88
|
+
"maxApiKeys": obj.get("maxApiKeys"),
|
|
89
|
+
"monthlyEmails": obj.get("monthlyEmails")
|
|
90
|
+
})
|
|
91
|
+
return _obj
|
|
92
|
+
|
|
93
|
+
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
"""
|
|
4
|
+
EmailAgent API
|
|
5
|
+
|
|
6
|
+
API for creating agent inboxes, sending emails, managing custom domains, managing API keys, and reading usage metrics. Authentication uses API keys via `Authorization: Bearer <api_key>`. For mutating endpoints, send an optional `Idempotency-Key` header. - Replaying the same key with the same payload returns the original response. - Reusing a key with a different payload returns `409`.
|
|
7
|
+
|
|
8
|
+
The version of the OpenAPI document: 1.0.0
|
|
9
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
|
10
|
+
|
|
11
|
+
Do not edit the class manually.
|
|
12
|
+
""" # noqa: E501
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
from __future__ import annotations
|
|
16
|
+
import pprint
|
|
17
|
+
import re # noqa: F401
|
|
18
|
+
import json
|
|
19
|
+
|
|
20
|
+
from pydantic import BaseModel, ConfigDict, Field, StrictStr
|
|
21
|
+
from typing import Any, ClassVar, Dict, List, Optional
|
|
22
|
+
from typing import Optional, Set
|
|
23
|
+
from typing_extensions import Self
|
|
24
|
+
|
|
25
|
+
class SendEmailRequest(BaseModel):
|
|
26
|
+
"""
|
|
27
|
+
SendEmailRequest
|
|
28
|
+
""" # noqa: E501
|
|
29
|
+
inbox_id: StrictStr = Field(alias="inboxId")
|
|
30
|
+
to: StrictStr = Field(description="Comma-separated recipient emails")
|
|
31
|
+
subject: Optional[StrictStr] = None
|
|
32
|
+
text: Optional[StrictStr] = None
|
|
33
|
+
__properties: ClassVar[List[str]] = ["inboxId", "to", "subject", "text"]
|
|
34
|
+
|
|
35
|
+
model_config = ConfigDict(
|
|
36
|
+
populate_by_name=True,
|
|
37
|
+
validate_assignment=True,
|
|
38
|
+
protected_namespaces=(),
|
|
39
|
+
)
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
def to_str(self) -> str:
|
|
43
|
+
"""Returns the string representation of the model using alias"""
|
|
44
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
45
|
+
|
|
46
|
+
def to_json(self) -> str:
|
|
47
|
+
"""Returns the JSON representation of the model using alias"""
|
|
48
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
|
49
|
+
return json.dumps(self.to_dict())
|
|
50
|
+
|
|
51
|
+
@classmethod
|
|
52
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
53
|
+
"""Create an instance of SendEmailRequest from a JSON string"""
|
|
54
|
+
return cls.from_dict(json.loads(json_str))
|
|
55
|
+
|
|
56
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
57
|
+
"""Return the dictionary representation of the model using alias.
|
|
58
|
+
|
|
59
|
+
This has the following differences from calling pydantic's
|
|
60
|
+
`self.model_dump(by_alias=True)`:
|
|
61
|
+
|
|
62
|
+
* `None` is only added to the output dict for nullable fields that
|
|
63
|
+
were set at model initialization. Other fields with value `None`
|
|
64
|
+
are ignored.
|
|
65
|
+
"""
|
|
66
|
+
excluded_fields: Set[str] = set([
|
|
67
|
+
])
|
|
68
|
+
|
|
69
|
+
_dict = self.model_dump(
|
|
70
|
+
by_alias=True,
|
|
71
|
+
exclude=excluded_fields,
|
|
72
|
+
exclude_none=True,
|
|
73
|
+
)
|
|
74
|
+
return _dict
|
|
75
|
+
|
|
76
|
+
@classmethod
|
|
77
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
78
|
+
"""Create an instance of SendEmailRequest from a dict"""
|
|
79
|
+
if obj is None:
|
|
80
|
+
return None
|
|
81
|
+
|
|
82
|
+
if not isinstance(obj, dict):
|
|
83
|
+
return cls.model_validate(obj)
|
|
84
|
+
|
|
85
|
+
_obj = cls.model_validate({
|
|
86
|
+
"inboxId": obj.get("inboxId"),
|
|
87
|
+
"to": obj.get("to"),
|
|
88
|
+
"subject": obj.get("subject"),
|
|
89
|
+
"text": obj.get("text")
|
|
90
|
+
})
|
|
91
|
+
return _obj
|
|
92
|
+
|
|
93
|
+
|