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,1232 @@
|
|
|
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
|
+
import warnings
|
|
15
|
+
from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt
|
|
16
|
+
from typing import Any, Dict, List, Optional, Tuple, Union
|
|
17
|
+
from typing_extensions import Annotated
|
|
18
|
+
|
|
19
|
+
from pydantic import Field, StrictStr
|
|
20
|
+
from typing import Optional
|
|
21
|
+
from typing_extensions import Annotated
|
|
22
|
+
from emailagent_sdk_generated.models.email_list_response import EmailListResponse
|
|
23
|
+
from emailagent_sdk_generated.models.email_response import EmailResponse
|
|
24
|
+
from emailagent_sdk_generated.models.ok_response import OkResponse
|
|
25
|
+
from emailagent_sdk_generated.models.send_email_request import SendEmailRequest
|
|
26
|
+
from emailagent_sdk_generated.models.update_email_read_request import UpdateEmailReadRequest
|
|
27
|
+
|
|
28
|
+
from emailagent_sdk_generated.api_client import ApiClient, RequestSerialized
|
|
29
|
+
from emailagent_sdk_generated.api_response import ApiResponse
|
|
30
|
+
from emailagent_sdk_generated.rest import RESTResponseType
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
class EmailsApi:
|
|
34
|
+
"""NOTE: This class is auto generated by OpenAPI Generator
|
|
35
|
+
Ref: https://openapi-generator.tech
|
|
36
|
+
|
|
37
|
+
Do not edit the class manually.
|
|
38
|
+
"""
|
|
39
|
+
|
|
40
|
+
def __init__(self, api_client=None) -> None:
|
|
41
|
+
if api_client is None:
|
|
42
|
+
api_client = ApiClient.get_default()
|
|
43
|
+
self.api_client = api_client
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
@validate_call
|
|
47
|
+
def delete_email(
|
|
48
|
+
self,
|
|
49
|
+
id: StrictStr,
|
|
50
|
+
idempotency_key: Annotated[Optional[Annotated[str, Field(min_length=1, strict=True, max_length=255)]], Field(description="Optional key for safe retries of mutating operations.")] = None,
|
|
51
|
+
_request_timeout: Union[
|
|
52
|
+
None,
|
|
53
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
54
|
+
Tuple[
|
|
55
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
56
|
+
Annotated[StrictFloat, Field(gt=0)]
|
|
57
|
+
]
|
|
58
|
+
] = None,
|
|
59
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
60
|
+
_content_type: Optional[StrictStr] = None,
|
|
61
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
62
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
63
|
+
) -> OkResponse:
|
|
64
|
+
"""Delete email
|
|
65
|
+
|
|
66
|
+
Soft-deletes an email record. Requires `emails:write` scope.
|
|
67
|
+
|
|
68
|
+
:param id: (required)
|
|
69
|
+
:type id: str
|
|
70
|
+
:param idempotency_key: Optional key for safe retries of mutating operations.
|
|
71
|
+
:type idempotency_key: str
|
|
72
|
+
:param _request_timeout: timeout setting for this request. If one
|
|
73
|
+
number provided, it will be total request
|
|
74
|
+
timeout. It can also be a pair (tuple) of
|
|
75
|
+
(connection, read) timeouts.
|
|
76
|
+
:type _request_timeout: int, tuple(int, int), optional
|
|
77
|
+
:param _request_auth: set to override the auth_settings for an a single
|
|
78
|
+
request; this effectively ignores the
|
|
79
|
+
authentication in the spec for a single request.
|
|
80
|
+
:type _request_auth: dict, optional
|
|
81
|
+
:param _content_type: force content-type for the request.
|
|
82
|
+
:type _content_type: str, Optional
|
|
83
|
+
:param _headers: set to override the headers for a single
|
|
84
|
+
request; this effectively ignores the headers
|
|
85
|
+
in the spec for a single request.
|
|
86
|
+
:type _headers: dict, optional
|
|
87
|
+
:param _host_index: set to override the host_index for a single
|
|
88
|
+
request; this effectively ignores the host_index
|
|
89
|
+
in the spec for a single request.
|
|
90
|
+
:type _host_index: int, optional
|
|
91
|
+
:return: Returns the result object.
|
|
92
|
+
""" # noqa: E501
|
|
93
|
+
|
|
94
|
+
_param = self._delete_email_serialize(
|
|
95
|
+
id=id,
|
|
96
|
+
idempotency_key=idempotency_key,
|
|
97
|
+
_request_auth=_request_auth,
|
|
98
|
+
_content_type=_content_type,
|
|
99
|
+
_headers=_headers,
|
|
100
|
+
_host_index=_host_index
|
|
101
|
+
)
|
|
102
|
+
|
|
103
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
|
104
|
+
'200': "OkResponse",
|
|
105
|
+
'401': "ErrorResponse",
|
|
106
|
+
'403': "ErrorResponse",
|
|
107
|
+
'404': "ErrorResponse",
|
|
108
|
+
'409': "ErrorResponse",
|
|
109
|
+
}
|
|
110
|
+
response_data = self.api_client.call_api(
|
|
111
|
+
*_param,
|
|
112
|
+
_request_timeout=_request_timeout
|
|
113
|
+
)
|
|
114
|
+
response_data.read()
|
|
115
|
+
return self.api_client.response_deserialize(
|
|
116
|
+
response_data=response_data,
|
|
117
|
+
response_types_map=_response_types_map,
|
|
118
|
+
).data
|
|
119
|
+
|
|
120
|
+
|
|
121
|
+
@validate_call
|
|
122
|
+
def delete_email_with_http_info(
|
|
123
|
+
self,
|
|
124
|
+
id: StrictStr,
|
|
125
|
+
idempotency_key: Annotated[Optional[Annotated[str, Field(min_length=1, strict=True, max_length=255)]], Field(description="Optional key for safe retries of mutating operations.")] = None,
|
|
126
|
+
_request_timeout: Union[
|
|
127
|
+
None,
|
|
128
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
129
|
+
Tuple[
|
|
130
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
131
|
+
Annotated[StrictFloat, Field(gt=0)]
|
|
132
|
+
]
|
|
133
|
+
] = None,
|
|
134
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
135
|
+
_content_type: Optional[StrictStr] = None,
|
|
136
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
137
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
138
|
+
) -> ApiResponse[OkResponse]:
|
|
139
|
+
"""Delete email
|
|
140
|
+
|
|
141
|
+
Soft-deletes an email record. Requires `emails:write` scope.
|
|
142
|
+
|
|
143
|
+
:param id: (required)
|
|
144
|
+
:type id: str
|
|
145
|
+
:param idempotency_key: Optional key for safe retries of mutating operations.
|
|
146
|
+
:type idempotency_key: str
|
|
147
|
+
:param _request_timeout: timeout setting for this request. If one
|
|
148
|
+
number provided, it will be total request
|
|
149
|
+
timeout. It can also be a pair (tuple) of
|
|
150
|
+
(connection, read) timeouts.
|
|
151
|
+
:type _request_timeout: int, tuple(int, int), optional
|
|
152
|
+
:param _request_auth: set to override the auth_settings for an a single
|
|
153
|
+
request; this effectively ignores the
|
|
154
|
+
authentication in the spec for a single request.
|
|
155
|
+
:type _request_auth: dict, optional
|
|
156
|
+
:param _content_type: force content-type for the request.
|
|
157
|
+
:type _content_type: str, Optional
|
|
158
|
+
:param _headers: set to override the headers for a single
|
|
159
|
+
request; this effectively ignores the headers
|
|
160
|
+
in the spec for a single request.
|
|
161
|
+
:type _headers: dict, optional
|
|
162
|
+
:param _host_index: set to override the host_index for a single
|
|
163
|
+
request; this effectively ignores the host_index
|
|
164
|
+
in the spec for a single request.
|
|
165
|
+
:type _host_index: int, optional
|
|
166
|
+
:return: Returns the result object.
|
|
167
|
+
""" # noqa: E501
|
|
168
|
+
|
|
169
|
+
_param = self._delete_email_serialize(
|
|
170
|
+
id=id,
|
|
171
|
+
idempotency_key=idempotency_key,
|
|
172
|
+
_request_auth=_request_auth,
|
|
173
|
+
_content_type=_content_type,
|
|
174
|
+
_headers=_headers,
|
|
175
|
+
_host_index=_host_index
|
|
176
|
+
)
|
|
177
|
+
|
|
178
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
|
179
|
+
'200': "OkResponse",
|
|
180
|
+
'401': "ErrorResponse",
|
|
181
|
+
'403': "ErrorResponse",
|
|
182
|
+
'404': "ErrorResponse",
|
|
183
|
+
'409': "ErrorResponse",
|
|
184
|
+
}
|
|
185
|
+
response_data = self.api_client.call_api(
|
|
186
|
+
*_param,
|
|
187
|
+
_request_timeout=_request_timeout
|
|
188
|
+
)
|
|
189
|
+
response_data.read()
|
|
190
|
+
return self.api_client.response_deserialize(
|
|
191
|
+
response_data=response_data,
|
|
192
|
+
response_types_map=_response_types_map,
|
|
193
|
+
)
|
|
194
|
+
|
|
195
|
+
|
|
196
|
+
@validate_call
|
|
197
|
+
def delete_email_without_preload_content(
|
|
198
|
+
self,
|
|
199
|
+
id: StrictStr,
|
|
200
|
+
idempotency_key: Annotated[Optional[Annotated[str, Field(min_length=1, strict=True, max_length=255)]], Field(description="Optional key for safe retries of mutating operations.")] = None,
|
|
201
|
+
_request_timeout: Union[
|
|
202
|
+
None,
|
|
203
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
204
|
+
Tuple[
|
|
205
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
206
|
+
Annotated[StrictFloat, Field(gt=0)]
|
|
207
|
+
]
|
|
208
|
+
] = None,
|
|
209
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
210
|
+
_content_type: Optional[StrictStr] = None,
|
|
211
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
212
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
213
|
+
) -> RESTResponseType:
|
|
214
|
+
"""Delete email
|
|
215
|
+
|
|
216
|
+
Soft-deletes an email record. Requires `emails:write` scope.
|
|
217
|
+
|
|
218
|
+
:param id: (required)
|
|
219
|
+
:type id: str
|
|
220
|
+
:param idempotency_key: Optional key for safe retries of mutating operations.
|
|
221
|
+
:type idempotency_key: str
|
|
222
|
+
:param _request_timeout: timeout setting for this request. If one
|
|
223
|
+
number provided, it will be total request
|
|
224
|
+
timeout. It can also be a pair (tuple) of
|
|
225
|
+
(connection, read) timeouts.
|
|
226
|
+
:type _request_timeout: int, tuple(int, int), optional
|
|
227
|
+
:param _request_auth: set to override the auth_settings for an a single
|
|
228
|
+
request; this effectively ignores the
|
|
229
|
+
authentication in the spec for a single request.
|
|
230
|
+
:type _request_auth: dict, optional
|
|
231
|
+
:param _content_type: force content-type for the request.
|
|
232
|
+
:type _content_type: str, Optional
|
|
233
|
+
:param _headers: set to override the headers for a single
|
|
234
|
+
request; this effectively ignores the headers
|
|
235
|
+
in the spec for a single request.
|
|
236
|
+
:type _headers: dict, optional
|
|
237
|
+
:param _host_index: set to override the host_index for a single
|
|
238
|
+
request; this effectively ignores the host_index
|
|
239
|
+
in the spec for a single request.
|
|
240
|
+
:type _host_index: int, optional
|
|
241
|
+
:return: Returns the result object.
|
|
242
|
+
""" # noqa: E501
|
|
243
|
+
|
|
244
|
+
_param = self._delete_email_serialize(
|
|
245
|
+
id=id,
|
|
246
|
+
idempotency_key=idempotency_key,
|
|
247
|
+
_request_auth=_request_auth,
|
|
248
|
+
_content_type=_content_type,
|
|
249
|
+
_headers=_headers,
|
|
250
|
+
_host_index=_host_index
|
|
251
|
+
)
|
|
252
|
+
|
|
253
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
|
254
|
+
'200': "OkResponse",
|
|
255
|
+
'401': "ErrorResponse",
|
|
256
|
+
'403': "ErrorResponse",
|
|
257
|
+
'404': "ErrorResponse",
|
|
258
|
+
'409': "ErrorResponse",
|
|
259
|
+
}
|
|
260
|
+
response_data = self.api_client.call_api(
|
|
261
|
+
*_param,
|
|
262
|
+
_request_timeout=_request_timeout
|
|
263
|
+
)
|
|
264
|
+
return response_data.response
|
|
265
|
+
|
|
266
|
+
|
|
267
|
+
def _delete_email_serialize(
|
|
268
|
+
self,
|
|
269
|
+
id,
|
|
270
|
+
idempotency_key,
|
|
271
|
+
_request_auth,
|
|
272
|
+
_content_type,
|
|
273
|
+
_headers,
|
|
274
|
+
_host_index,
|
|
275
|
+
) -> RequestSerialized:
|
|
276
|
+
|
|
277
|
+
_host = None
|
|
278
|
+
|
|
279
|
+
_collection_formats: Dict[str, str] = {
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
_path_params: Dict[str, str] = {}
|
|
283
|
+
_query_params: List[Tuple[str, str]] = []
|
|
284
|
+
_header_params: Dict[str, Optional[str]] = _headers or {}
|
|
285
|
+
_form_params: List[Tuple[str, str]] = []
|
|
286
|
+
_files: Dict[
|
|
287
|
+
str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
|
|
288
|
+
] = {}
|
|
289
|
+
_body_params: Optional[bytes] = None
|
|
290
|
+
|
|
291
|
+
# process the path parameters
|
|
292
|
+
if id is not None:
|
|
293
|
+
_path_params['id'] = id
|
|
294
|
+
# process the query parameters
|
|
295
|
+
# process the header parameters
|
|
296
|
+
if idempotency_key is not None:
|
|
297
|
+
_header_params['Idempotency-Key'] = idempotency_key
|
|
298
|
+
# process the form parameters
|
|
299
|
+
# process the body parameter
|
|
300
|
+
|
|
301
|
+
|
|
302
|
+
# set the HTTP header `Accept`
|
|
303
|
+
if 'Accept' not in _header_params:
|
|
304
|
+
_header_params['Accept'] = self.api_client.select_header_accept(
|
|
305
|
+
[
|
|
306
|
+
'application/json'
|
|
307
|
+
]
|
|
308
|
+
)
|
|
309
|
+
|
|
310
|
+
|
|
311
|
+
# authentication setting
|
|
312
|
+
_auth_settings: List[str] = [
|
|
313
|
+
'bearerAuth'
|
|
314
|
+
]
|
|
315
|
+
|
|
316
|
+
return self.api_client.param_serialize(
|
|
317
|
+
method='DELETE',
|
|
318
|
+
resource_path='/api/v1/emails/{id}',
|
|
319
|
+
path_params=_path_params,
|
|
320
|
+
query_params=_query_params,
|
|
321
|
+
header_params=_header_params,
|
|
322
|
+
body=_body_params,
|
|
323
|
+
post_params=_form_params,
|
|
324
|
+
files=_files,
|
|
325
|
+
auth_settings=_auth_settings,
|
|
326
|
+
collection_formats=_collection_formats,
|
|
327
|
+
_host=_host,
|
|
328
|
+
_request_auth=_request_auth
|
|
329
|
+
)
|
|
330
|
+
|
|
331
|
+
|
|
332
|
+
|
|
333
|
+
|
|
334
|
+
@validate_call
|
|
335
|
+
def list_emails(
|
|
336
|
+
self,
|
|
337
|
+
inbox_id: Annotated[Optional[StrictStr], Field(description="Optional inbox filter.")] = None,
|
|
338
|
+
_request_timeout: Union[
|
|
339
|
+
None,
|
|
340
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
341
|
+
Tuple[
|
|
342
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
343
|
+
Annotated[StrictFloat, Field(gt=0)]
|
|
344
|
+
]
|
|
345
|
+
] = None,
|
|
346
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
347
|
+
_content_type: Optional[StrictStr] = None,
|
|
348
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
349
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
350
|
+
) -> EmailListResponse:
|
|
351
|
+
"""List emails
|
|
352
|
+
|
|
353
|
+
Returns inbound and outbound email records. Requires `emails:read` scope.
|
|
354
|
+
|
|
355
|
+
:param inbox_id: Optional inbox filter.
|
|
356
|
+
:type inbox_id: str
|
|
357
|
+
:param _request_timeout: timeout setting for this request. If one
|
|
358
|
+
number provided, it will be total request
|
|
359
|
+
timeout. It can also be a pair (tuple) of
|
|
360
|
+
(connection, read) timeouts.
|
|
361
|
+
:type _request_timeout: int, tuple(int, int), optional
|
|
362
|
+
:param _request_auth: set to override the auth_settings for an a single
|
|
363
|
+
request; this effectively ignores the
|
|
364
|
+
authentication in the spec for a single request.
|
|
365
|
+
:type _request_auth: dict, optional
|
|
366
|
+
:param _content_type: force content-type for the request.
|
|
367
|
+
:type _content_type: str, Optional
|
|
368
|
+
:param _headers: set to override the headers for a single
|
|
369
|
+
request; this effectively ignores the headers
|
|
370
|
+
in the spec for a single request.
|
|
371
|
+
:type _headers: dict, optional
|
|
372
|
+
:param _host_index: set to override the host_index for a single
|
|
373
|
+
request; this effectively ignores the host_index
|
|
374
|
+
in the spec for a single request.
|
|
375
|
+
:type _host_index: int, optional
|
|
376
|
+
:return: Returns the result object.
|
|
377
|
+
""" # noqa: E501
|
|
378
|
+
|
|
379
|
+
_param = self._list_emails_serialize(
|
|
380
|
+
inbox_id=inbox_id,
|
|
381
|
+
_request_auth=_request_auth,
|
|
382
|
+
_content_type=_content_type,
|
|
383
|
+
_headers=_headers,
|
|
384
|
+
_host_index=_host_index
|
|
385
|
+
)
|
|
386
|
+
|
|
387
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
|
388
|
+
'200': "EmailListResponse",
|
|
389
|
+
'400': "ErrorResponse",
|
|
390
|
+
'401': "ErrorResponse",
|
|
391
|
+
'403': "ErrorResponse",
|
|
392
|
+
}
|
|
393
|
+
response_data = self.api_client.call_api(
|
|
394
|
+
*_param,
|
|
395
|
+
_request_timeout=_request_timeout
|
|
396
|
+
)
|
|
397
|
+
response_data.read()
|
|
398
|
+
return self.api_client.response_deserialize(
|
|
399
|
+
response_data=response_data,
|
|
400
|
+
response_types_map=_response_types_map,
|
|
401
|
+
).data
|
|
402
|
+
|
|
403
|
+
|
|
404
|
+
@validate_call
|
|
405
|
+
def list_emails_with_http_info(
|
|
406
|
+
self,
|
|
407
|
+
inbox_id: Annotated[Optional[StrictStr], Field(description="Optional inbox filter.")] = None,
|
|
408
|
+
_request_timeout: Union[
|
|
409
|
+
None,
|
|
410
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
411
|
+
Tuple[
|
|
412
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
413
|
+
Annotated[StrictFloat, Field(gt=0)]
|
|
414
|
+
]
|
|
415
|
+
] = None,
|
|
416
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
417
|
+
_content_type: Optional[StrictStr] = None,
|
|
418
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
419
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
420
|
+
) -> ApiResponse[EmailListResponse]:
|
|
421
|
+
"""List emails
|
|
422
|
+
|
|
423
|
+
Returns inbound and outbound email records. Requires `emails:read` scope.
|
|
424
|
+
|
|
425
|
+
:param inbox_id: Optional inbox filter.
|
|
426
|
+
:type inbox_id: str
|
|
427
|
+
:param _request_timeout: timeout setting for this request. If one
|
|
428
|
+
number provided, it will be total request
|
|
429
|
+
timeout. It can also be a pair (tuple) of
|
|
430
|
+
(connection, read) timeouts.
|
|
431
|
+
:type _request_timeout: int, tuple(int, int), optional
|
|
432
|
+
:param _request_auth: set to override the auth_settings for an a single
|
|
433
|
+
request; this effectively ignores the
|
|
434
|
+
authentication in the spec for a single request.
|
|
435
|
+
:type _request_auth: dict, optional
|
|
436
|
+
:param _content_type: force content-type for the request.
|
|
437
|
+
:type _content_type: str, Optional
|
|
438
|
+
:param _headers: set to override the headers for a single
|
|
439
|
+
request; this effectively ignores the headers
|
|
440
|
+
in the spec for a single request.
|
|
441
|
+
:type _headers: dict, optional
|
|
442
|
+
:param _host_index: set to override the host_index for a single
|
|
443
|
+
request; this effectively ignores the host_index
|
|
444
|
+
in the spec for a single request.
|
|
445
|
+
:type _host_index: int, optional
|
|
446
|
+
:return: Returns the result object.
|
|
447
|
+
""" # noqa: E501
|
|
448
|
+
|
|
449
|
+
_param = self._list_emails_serialize(
|
|
450
|
+
inbox_id=inbox_id,
|
|
451
|
+
_request_auth=_request_auth,
|
|
452
|
+
_content_type=_content_type,
|
|
453
|
+
_headers=_headers,
|
|
454
|
+
_host_index=_host_index
|
|
455
|
+
)
|
|
456
|
+
|
|
457
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
|
458
|
+
'200': "EmailListResponse",
|
|
459
|
+
'400': "ErrorResponse",
|
|
460
|
+
'401': "ErrorResponse",
|
|
461
|
+
'403': "ErrorResponse",
|
|
462
|
+
}
|
|
463
|
+
response_data = self.api_client.call_api(
|
|
464
|
+
*_param,
|
|
465
|
+
_request_timeout=_request_timeout
|
|
466
|
+
)
|
|
467
|
+
response_data.read()
|
|
468
|
+
return self.api_client.response_deserialize(
|
|
469
|
+
response_data=response_data,
|
|
470
|
+
response_types_map=_response_types_map,
|
|
471
|
+
)
|
|
472
|
+
|
|
473
|
+
|
|
474
|
+
@validate_call
|
|
475
|
+
def list_emails_without_preload_content(
|
|
476
|
+
self,
|
|
477
|
+
inbox_id: Annotated[Optional[StrictStr], Field(description="Optional inbox filter.")] = None,
|
|
478
|
+
_request_timeout: Union[
|
|
479
|
+
None,
|
|
480
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
481
|
+
Tuple[
|
|
482
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
483
|
+
Annotated[StrictFloat, Field(gt=0)]
|
|
484
|
+
]
|
|
485
|
+
] = None,
|
|
486
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
487
|
+
_content_type: Optional[StrictStr] = None,
|
|
488
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
489
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
490
|
+
) -> RESTResponseType:
|
|
491
|
+
"""List emails
|
|
492
|
+
|
|
493
|
+
Returns inbound and outbound email records. Requires `emails:read` scope.
|
|
494
|
+
|
|
495
|
+
:param inbox_id: Optional inbox filter.
|
|
496
|
+
:type inbox_id: str
|
|
497
|
+
:param _request_timeout: timeout setting for this request. If one
|
|
498
|
+
number provided, it will be total request
|
|
499
|
+
timeout. It can also be a pair (tuple) of
|
|
500
|
+
(connection, read) timeouts.
|
|
501
|
+
:type _request_timeout: int, tuple(int, int), optional
|
|
502
|
+
:param _request_auth: set to override the auth_settings for an a single
|
|
503
|
+
request; this effectively ignores the
|
|
504
|
+
authentication in the spec for a single request.
|
|
505
|
+
:type _request_auth: dict, optional
|
|
506
|
+
:param _content_type: force content-type for the request.
|
|
507
|
+
:type _content_type: str, Optional
|
|
508
|
+
:param _headers: set to override the headers for a single
|
|
509
|
+
request; this effectively ignores the headers
|
|
510
|
+
in the spec for a single request.
|
|
511
|
+
:type _headers: dict, optional
|
|
512
|
+
:param _host_index: set to override the host_index for a single
|
|
513
|
+
request; this effectively ignores the host_index
|
|
514
|
+
in the spec for a single request.
|
|
515
|
+
:type _host_index: int, optional
|
|
516
|
+
:return: Returns the result object.
|
|
517
|
+
""" # noqa: E501
|
|
518
|
+
|
|
519
|
+
_param = self._list_emails_serialize(
|
|
520
|
+
inbox_id=inbox_id,
|
|
521
|
+
_request_auth=_request_auth,
|
|
522
|
+
_content_type=_content_type,
|
|
523
|
+
_headers=_headers,
|
|
524
|
+
_host_index=_host_index
|
|
525
|
+
)
|
|
526
|
+
|
|
527
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
|
528
|
+
'200': "EmailListResponse",
|
|
529
|
+
'400': "ErrorResponse",
|
|
530
|
+
'401': "ErrorResponse",
|
|
531
|
+
'403': "ErrorResponse",
|
|
532
|
+
}
|
|
533
|
+
response_data = self.api_client.call_api(
|
|
534
|
+
*_param,
|
|
535
|
+
_request_timeout=_request_timeout
|
|
536
|
+
)
|
|
537
|
+
return response_data.response
|
|
538
|
+
|
|
539
|
+
|
|
540
|
+
def _list_emails_serialize(
|
|
541
|
+
self,
|
|
542
|
+
inbox_id,
|
|
543
|
+
_request_auth,
|
|
544
|
+
_content_type,
|
|
545
|
+
_headers,
|
|
546
|
+
_host_index,
|
|
547
|
+
) -> RequestSerialized:
|
|
548
|
+
|
|
549
|
+
_host = None
|
|
550
|
+
|
|
551
|
+
_collection_formats: Dict[str, str] = {
|
|
552
|
+
}
|
|
553
|
+
|
|
554
|
+
_path_params: Dict[str, str] = {}
|
|
555
|
+
_query_params: List[Tuple[str, str]] = []
|
|
556
|
+
_header_params: Dict[str, Optional[str]] = _headers or {}
|
|
557
|
+
_form_params: List[Tuple[str, str]] = []
|
|
558
|
+
_files: Dict[
|
|
559
|
+
str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
|
|
560
|
+
] = {}
|
|
561
|
+
_body_params: Optional[bytes] = None
|
|
562
|
+
|
|
563
|
+
# process the path parameters
|
|
564
|
+
# process the query parameters
|
|
565
|
+
if inbox_id is not None:
|
|
566
|
+
|
|
567
|
+
_query_params.append(('inboxId', inbox_id))
|
|
568
|
+
|
|
569
|
+
# process the header parameters
|
|
570
|
+
# process the form parameters
|
|
571
|
+
# process the body parameter
|
|
572
|
+
|
|
573
|
+
|
|
574
|
+
# set the HTTP header `Accept`
|
|
575
|
+
if 'Accept' not in _header_params:
|
|
576
|
+
_header_params['Accept'] = self.api_client.select_header_accept(
|
|
577
|
+
[
|
|
578
|
+
'application/json'
|
|
579
|
+
]
|
|
580
|
+
)
|
|
581
|
+
|
|
582
|
+
|
|
583
|
+
# authentication setting
|
|
584
|
+
_auth_settings: List[str] = [
|
|
585
|
+
'bearerAuth'
|
|
586
|
+
]
|
|
587
|
+
|
|
588
|
+
return self.api_client.param_serialize(
|
|
589
|
+
method='GET',
|
|
590
|
+
resource_path='/api/v1/emails',
|
|
591
|
+
path_params=_path_params,
|
|
592
|
+
query_params=_query_params,
|
|
593
|
+
header_params=_header_params,
|
|
594
|
+
body=_body_params,
|
|
595
|
+
post_params=_form_params,
|
|
596
|
+
files=_files,
|
|
597
|
+
auth_settings=_auth_settings,
|
|
598
|
+
collection_formats=_collection_formats,
|
|
599
|
+
_host=_host,
|
|
600
|
+
_request_auth=_request_auth
|
|
601
|
+
)
|
|
602
|
+
|
|
603
|
+
|
|
604
|
+
|
|
605
|
+
|
|
606
|
+
@validate_call
|
|
607
|
+
def send_email(
|
|
608
|
+
self,
|
|
609
|
+
send_email_request: SendEmailRequest,
|
|
610
|
+
idempotency_key: Annotated[Optional[Annotated[str, Field(min_length=1, strict=True, max_length=255)]], Field(description="Optional key for safe retries of mutating operations.")] = None,
|
|
611
|
+
_request_timeout: Union[
|
|
612
|
+
None,
|
|
613
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
614
|
+
Tuple[
|
|
615
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
616
|
+
Annotated[StrictFloat, Field(gt=0)]
|
|
617
|
+
]
|
|
618
|
+
] = None,
|
|
619
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
620
|
+
_content_type: Optional[StrictStr] = None,
|
|
621
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
622
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
623
|
+
) -> EmailResponse:
|
|
624
|
+
"""Send outbound email from an inbox
|
|
625
|
+
|
|
626
|
+
Requires `emails:send` scope.
|
|
627
|
+
|
|
628
|
+
:param send_email_request: (required)
|
|
629
|
+
:type send_email_request: SendEmailRequest
|
|
630
|
+
:param idempotency_key: Optional key for safe retries of mutating operations.
|
|
631
|
+
:type idempotency_key: str
|
|
632
|
+
:param _request_timeout: timeout setting for this request. If one
|
|
633
|
+
number provided, it will be total request
|
|
634
|
+
timeout. It can also be a pair (tuple) of
|
|
635
|
+
(connection, read) timeouts.
|
|
636
|
+
:type _request_timeout: int, tuple(int, int), optional
|
|
637
|
+
:param _request_auth: set to override the auth_settings for an a single
|
|
638
|
+
request; this effectively ignores the
|
|
639
|
+
authentication in the spec for a single request.
|
|
640
|
+
:type _request_auth: dict, optional
|
|
641
|
+
:param _content_type: force content-type for the request.
|
|
642
|
+
:type _content_type: str, Optional
|
|
643
|
+
:param _headers: set to override the headers for a single
|
|
644
|
+
request; this effectively ignores the headers
|
|
645
|
+
in the spec for a single request.
|
|
646
|
+
:type _headers: dict, optional
|
|
647
|
+
:param _host_index: set to override the host_index for a single
|
|
648
|
+
request; this effectively ignores the host_index
|
|
649
|
+
in the spec for a single request.
|
|
650
|
+
:type _host_index: int, optional
|
|
651
|
+
:return: Returns the result object.
|
|
652
|
+
""" # noqa: E501
|
|
653
|
+
|
|
654
|
+
_param = self._send_email_serialize(
|
|
655
|
+
send_email_request=send_email_request,
|
|
656
|
+
idempotency_key=idempotency_key,
|
|
657
|
+
_request_auth=_request_auth,
|
|
658
|
+
_content_type=_content_type,
|
|
659
|
+
_headers=_headers,
|
|
660
|
+
_host_index=_host_index
|
|
661
|
+
)
|
|
662
|
+
|
|
663
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
|
664
|
+
'201': "EmailResponse",
|
|
665
|
+
'400': "ErrorResponse",
|
|
666
|
+
'401': "ErrorResponse",
|
|
667
|
+
'403': "ErrorResponse",
|
|
668
|
+
'409': "ErrorResponse",
|
|
669
|
+
'422': "ErrorResponse",
|
|
670
|
+
'429': "ErrorResponse",
|
|
671
|
+
'500': "ErrorResponse",
|
|
672
|
+
}
|
|
673
|
+
response_data = self.api_client.call_api(
|
|
674
|
+
*_param,
|
|
675
|
+
_request_timeout=_request_timeout
|
|
676
|
+
)
|
|
677
|
+
response_data.read()
|
|
678
|
+
return self.api_client.response_deserialize(
|
|
679
|
+
response_data=response_data,
|
|
680
|
+
response_types_map=_response_types_map,
|
|
681
|
+
).data
|
|
682
|
+
|
|
683
|
+
|
|
684
|
+
@validate_call
|
|
685
|
+
def send_email_with_http_info(
|
|
686
|
+
self,
|
|
687
|
+
send_email_request: SendEmailRequest,
|
|
688
|
+
idempotency_key: Annotated[Optional[Annotated[str, Field(min_length=1, strict=True, max_length=255)]], Field(description="Optional key for safe retries of mutating operations.")] = None,
|
|
689
|
+
_request_timeout: Union[
|
|
690
|
+
None,
|
|
691
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
692
|
+
Tuple[
|
|
693
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
694
|
+
Annotated[StrictFloat, Field(gt=0)]
|
|
695
|
+
]
|
|
696
|
+
] = None,
|
|
697
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
698
|
+
_content_type: Optional[StrictStr] = None,
|
|
699
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
700
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
701
|
+
) -> ApiResponse[EmailResponse]:
|
|
702
|
+
"""Send outbound email from an inbox
|
|
703
|
+
|
|
704
|
+
Requires `emails:send` scope.
|
|
705
|
+
|
|
706
|
+
:param send_email_request: (required)
|
|
707
|
+
:type send_email_request: SendEmailRequest
|
|
708
|
+
:param idempotency_key: Optional key for safe retries of mutating operations.
|
|
709
|
+
:type idempotency_key: str
|
|
710
|
+
:param _request_timeout: timeout setting for this request. If one
|
|
711
|
+
number provided, it will be total request
|
|
712
|
+
timeout. It can also be a pair (tuple) of
|
|
713
|
+
(connection, read) timeouts.
|
|
714
|
+
:type _request_timeout: int, tuple(int, int), optional
|
|
715
|
+
:param _request_auth: set to override the auth_settings for an a single
|
|
716
|
+
request; this effectively ignores the
|
|
717
|
+
authentication in the spec for a single request.
|
|
718
|
+
:type _request_auth: dict, optional
|
|
719
|
+
:param _content_type: force content-type for the request.
|
|
720
|
+
:type _content_type: str, Optional
|
|
721
|
+
:param _headers: set to override the headers for a single
|
|
722
|
+
request; this effectively ignores the headers
|
|
723
|
+
in the spec for a single request.
|
|
724
|
+
:type _headers: dict, optional
|
|
725
|
+
:param _host_index: set to override the host_index for a single
|
|
726
|
+
request; this effectively ignores the host_index
|
|
727
|
+
in the spec for a single request.
|
|
728
|
+
:type _host_index: int, optional
|
|
729
|
+
:return: Returns the result object.
|
|
730
|
+
""" # noqa: E501
|
|
731
|
+
|
|
732
|
+
_param = self._send_email_serialize(
|
|
733
|
+
send_email_request=send_email_request,
|
|
734
|
+
idempotency_key=idempotency_key,
|
|
735
|
+
_request_auth=_request_auth,
|
|
736
|
+
_content_type=_content_type,
|
|
737
|
+
_headers=_headers,
|
|
738
|
+
_host_index=_host_index
|
|
739
|
+
)
|
|
740
|
+
|
|
741
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
|
742
|
+
'201': "EmailResponse",
|
|
743
|
+
'400': "ErrorResponse",
|
|
744
|
+
'401': "ErrorResponse",
|
|
745
|
+
'403': "ErrorResponse",
|
|
746
|
+
'409': "ErrorResponse",
|
|
747
|
+
'422': "ErrorResponse",
|
|
748
|
+
'429': "ErrorResponse",
|
|
749
|
+
'500': "ErrorResponse",
|
|
750
|
+
}
|
|
751
|
+
response_data = self.api_client.call_api(
|
|
752
|
+
*_param,
|
|
753
|
+
_request_timeout=_request_timeout
|
|
754
|
+
)
|
|
755
|
+
response_data.read()
|
|
756
|
+
return self.api_client.response_deserialize(
|
|
757
|
+
response_data=response_data,
|
|
758
|
+
response_types_map=_response_types_map,
|
|
759
|
+
)
|
|
760
|
+
|
|
761
|
+
|
|
762
|
+
@validate_call
|
|
763
|
+
def send_email_without_preload_content(
|
|
764
|
+
self,
|
|
765
|
+
send_email_request: SendEmailRequest,
|
|
766
|
+
idempotency_key: Annotated[Optional[Annotated[str, Field(min_length=1, strict=True, max_length=255)]], Field(description="Optional key for safe retries of mutating operations.")] = None,
|
|
767
|
+
_request_timeout: Union[
|
|
768
|
+
None,
|
|
769
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
770
|
+
Tuple[
|
|
771
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
772
|
+
Annotated[StrictFloat, Field(gt=0)]
|
|
773
|
+
]
|
|
774
|
+
] = None,
|
|
775
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
776
|
+
_content_type: Optional[StrictStr] = None,
|
|
777
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
778
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
779
|
+
) -> RESTResponseType:
|
|
780
|
+
"""Send outbound email from an inbox
|
|
781
|
+
|
|
782
|
+
Requires `emails:send` scope.
|
|
783
|
+
|
|
784
|
+
:param send_email_request: (required)
|
|
785
|
+
:type send_email_request: SendEmailRequest
|
|
786
|
+
:param idempotency_key: Optional key for safe retries of mutating operations.
|
|
787
|
+
:type idempotency_key: str
|
|
788
|
+
:param _request_timeout: timeout setting for this request. If one
|
|
789
|
+
number provided, it will be total request
|
|
790
|
+
timeout. It can also be a pair (tuple) of
|
|
791
|
+
(connection, read) timeouts.
|
|
792
|
+
:type _request_timeout: int, tuple(int, int), optional
|
|
793
|
+
:param _request_auth: set to override the auth_settings for an a single
|
|
794
|
+
request; this effectively ignores the
|
|
795
|
+
authentication in the spec for a single request.
|
|
796
|
+
:type _request_auth: dict, optional
|
|
797
|
+
:param _content_type: force content-type for the request.
|
|
798
|
+
:type _content_type: str, Optional
|
|
799
|
+
:param _headers: set to override the headers for a single
|
|
800
|
+
request; this effectively ignores the headers
|
|
801
|
+
in the spec for a single request.
|
|
802
|
+
:type _headers: dict, optional
|
|
803
|
+
:param _host_index: set to override the host_index for a single
|
|
804
|
+
request; this effectively ignores the host_index
|
|
805
|
+
in the spec for a single request.
|
|
806
|
+
:type _host_index: int, optional
|
|
807
|
+
:return: Returns the result object.
|
|
808
|
+
""" # noqa: E501
|
|
809
|
+
|
|
810
|
+
_param = self._send_email_serialize(
|
|
811
|
+
send_email_request=send_email_request,
|
|
812
|
+
idempotency_key=idempotency_key,
|
|
813
|
+
_request_auth=_request_auth,
|
|
814
|
+
_content_type=_content_type,
|
|
815
|
+
_headers=_headers,
|
|
816
|
+
_host_index=_host_index
|
|
817
|
+
)
|
|
818
|
+
|
|
819
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
|
820
|
+
'201': "EmailResponse",
|
|
821
|
+
'400': "ErrorResponse",
|
|
822
|
+
'401': "ErrorResponse",
|
|
823
|
+
'403': "ErrorResponse",
|
|
824
|
+
'409': "ErrorResponse",
|
|
825
|
+
'422': "ErrorResponse",
|
|
826
|
+
'429': "ErrorResponse",
|
|
827
|
+
'500': "ErrorResponse",
|
|
828
|
+
}
|
|
829
|
+
response_data = self.api_client.call_api(
|
|
830
|
+
*_param,
|
|
831
|
+
_request_timeout=_request_timeout
|
|
832
|
+
)
|
|
833
|
+
return response_data.response
|
|
834
|
+
|
|
835
|
+
|
|
836
|
+
def _send_email_serialize(
|
|
837
|
+
self,
|
|
838
|
+
send_email_request,
|
|
839
|
+
idempotency_key,
|
|
840
|
+
_request_auth,
|
|
841
|
+
_content_type,
|
|
842
|
+
_headers,
|
|
843
|
+
_host_index,
|
|
844
|
+
) -> RequestSerialized:
|
|
845
|
+
|
|
846
|
+
_host = None
|
|
847
|
+
|
|
848
|
+
_collection_formats: Dict[str, str] = {
|
|
849
|
+
}
|
|
850
|
+
|
|
851
|
+
_path_params: Dict[str, str] = {}
|
|
852
|
+
_query_params: List[Tuple[str, str]] = []
|
|
853
|
+
_header_params: Dict[str, Optional[str]] = _headers or {}
|
|
854
|
+
_form_params: List[Tuple[str, str]] = []
|
|
855
|
+
_files: Dict[
|
|
856
|
+
str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
|
|
857
|
+
] = {}
|
|
858
|
+
_body_params: Optional[bytes] = None
|
|
859
|
+
|
|
860
|
+
# process the path parameters
|
|
861
|
+
# process the query parameters
|
|
862
|
+
# process the header parameters
|
|
863
|
+
if idempotency_key is not None:
|
|
864
|
+
_header_params['Idempotency-Key'] = idempotency_key
|
|
865
|
+
# process the form parameters
|
|
866
|
+
# process the body parameter
|
|
867
|
+
if send_email_request is not None:
|
|
868
|
+
_body_params = send_email_request
|
|
869
|
+
|
|
870
|
+
|
|
871
|
+
# set the HTTP header `Accept`
|
|
872
|
+
if 'Accept' not in _header_params:
|
|
873
|
+
_header_params['Accept'] = self.api_client.select_header_accept(
|
|
874
|
+
[
|
|
875
|
+
'application/json'
|
|
876
|
+
]
|
|
877
|
+
)
|
|
878
|
+
|
|
879
|
+
# set the HTTP header `Content-Type`
|
|
880
|
+
if _content_type:
|
|
881
|
+
_header_params['Content-Type'] = _content_type
|
|
882
|
+
else:
|
|
883
|
+
_default_content_type = (
|
|
884
|
+
self.api_client.select_header_content_type(
|
|
885
|
+
[
|
|
886
|
+
'application/json'
|
|
887
|
+
]
|
|
888
|
+
)
|
|
889
|
+
)
|
|
890
|
+
if _default_content_type is not None:
|
|
891
|
+
_header_params['Content-Type'] = _default_content_type
|
|
892
|
+
|
|
893
|
+
# authentication setting
|
|
894
|
+
_auth_settings: List[str] = [
|
|
895
|
+
'bearerAuth'
|
|
896
|
+
]
|
|
897
|
+
|
|
898
|
+
return self.api_client.param_serialize(
|
|
899
|
+
method='POST',
|
|
900
|
+
resource_path='/api/v1/emails/send',
|
|
901
|
+
path_params=_path_params,
|
|
902
|
+
query_params=_query_params,
|
|
903
|
+
header_params=_header_params,
|
|
904
|
+
body=_body_params,
|
|
905
|
+
post_params=_form_params,
|
|
906
|
+
files=_files,
|
|
907
|
+
auth_settings=_auth_settings,
|
|
908
|
+
collection_formats=_collection_formats,
|
|
909
|
+
_host=_host,
|
|
910
|
+
_request_auth=_request_auth
|
|
911
|
+
)
|
|
912
|
+
|
|
913
|
+
|
|
914
|
+
|
|
915
|
+
|
|
916
|
+
@validate_call
|
|
917
|
+
def update_email_read(
|
|
918
|
+
self,
|
|
919
|
+
id: StrictStr,
|
|
920
|
+
update_email_read_request: UpdateEmailReadRequest,
|
|
921
|
+
idempotency_key: Annotated[Optional[Annotated[str, Field(min_length=1, strict=True, max_length=255)]], Field(description="Optional key for safe retries of mutating operations.")] = None,
|
|
922
|
+
_request_timeout: Union[
|
|
923
|
+
None,
|
|
924
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
925
|
+
Tuple[
|
|
926
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
927
|
+
Annotated[StrictFloat, Field(gt=0)]
|
|
928
|
+
]
|
|
929
|
+
] = None,
|
|
930
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
931
|
+
_content_type: Optional[StrictStr] = None,
|
|
932
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
933
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
934
|
+
) -> EmailResponse:
|
|
935
|
+
"""Update email read state
|
|
936
|
+
|
|
937
|
+
Marks an email as read/unread. Requires `emails:write` scope.
|
|
938
|
+
|
|
939
|
+
:param id: (required)
|
|
940
|
+
:type id: str
|
|
941
|
+
:param update_email_read_request: (required)
|
|
942
|
+
:type update_email_read_request: UpdateEmailReadRequest
|
|
943
|
+
:param idempotency_key: Optional key for safe retries of mutating operations.
|
|
944
|
+
:type idempotency_key: str
|
|
945
|
+
:param _request_timeout: timeout setting for this request. If one
|
|
946
|
+
number provided, it will be total request
|
|
947
|
+
timeout. It can also be a pair (tuple) of
|
|
948
|
+
(connection, read) timeouts.
|
|
949
|
+
:type _request_timeout: int, tuple(int, int), optional
|
|
950
|
+
:param _request_auth: set to override the auth_settings for an a single
|
|
951
|
+
request; this effectively ignores the
|
|
952
|
+
authentication in the spec for a single request.
|
|
953
|
+
:type _request_auth: dict, optional
|
|
954
|
+
:param _content_type: force content-type for the request.
|
|
955
|
+
:type _content_type: str, Optional
|
|
956
|
+
:param _headers: set to override the headers for a single
|
|
957
|
+
request; this effectively ignores the headers
|
|
958
|
+
in the spec for a single request.
|
|
959
|
+
:type _headers: dict, optional
|
|
960
|
+
:param _host_index: set to override the host_index for a single
|
|
961
|
+
request; this effectively ignores the host_index
|
|
962
|
+
in the spec for a single request.
|
|
963
|
+
:type _host_index: int, optional
|
|
964
|
+
:return: Returns the result object.
|
|
965
|
+
""" # noqa: E501
|
|
966
|
+
|
|
967
|
+
_param = self._update_email_read_serialize(
|
|
968
|
+
id=id,
|
|
969
|
+
update_email_read_request=update_email_read_request,
|
|
970
|
+
idempotency_key=idempotency_key,
|
|
971
|
+
_request_auth=_request_auth,
|
|
972
|
+
_content_type=_content_type,
|
|
973
|
+
_headers=_headers,
|
|
974
|
+
_host_index=_host_index
|
|
975
|
+
)
|
|
976
|
+
|
|
977
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
|
978
|
+
'200': "EmailResponse",
|
|
979
|
+
'400': "ErrorResponse",
|
|
980
|
+
'401': "ErrorResponse",
|
|
981
|
+
'403': "ErrorResponse",
|
|
982
|
+
'404': "ErrorResponse",
|
|
983
|
+
'409': "ErrorResponse",
|
|
984
|
+
}
|
|
985
|
+
response_data = self.api_client.call_api(
|
|
986
|
+
*_param,
|
|
987
|
+
_request_timeout=_request_timeout
|
|
988
|
+
)
|
|
989
|
+
response_data.read()
|
|
990
|
+
return self.api_client.response_deserialize(
|
|
991
|
+
response_data=response_data,
|
|
992
|
+
response_types_map=_response_types_map,
|
|
993
|
+
).data
|
|
994
|
+
|
|
995
|
+
|
|
996
|
+
@validate_call
|
|
997
|
+
def update_email_read_with_http_info(
|
|
998
|
+
self,
|
|
999
|
+
id: StrictStr,
|
|
1000
|
+
update_email_read_request: UpdateEmailReadRequest,
|
|
1001
|
+
idempotency_key: Annotated[Optional[Annotated[str, Field(min_length=1, strict=True, max_length=255)]], Field(description="Optional key for safe retries of mutating operations.")] = None,
|
|
1002
|
+
_request_timeout: Union[
|
|
1003
|
+
None,
|
|
1004
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
1005
|
+
Tuple[
|
|
1006
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
1007
|
+
Annotated[StrictFloat, Field(gt=0)]
|
|
1008
|
+
]
|
|
1009
|
+
] = None,
|
|
1010
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
1011
|
+
_content_type: Optional[StrictStr] = None,
|
|
1012
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
1013
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
1014
|
+
) -> ApiResponse[EmailResponse]:
|
|
1015
|
+
"""Update email read state
|
|
1016
|
+
|
|
1017
|
+
Marks an email as read/unread. Requires `emails:write` scope.
|
|
1018
|
+
|
|
1019
|
+
:param id: (required)
|
|
1020
|
+
:type id: str
|
|
1021
|
+
:param update_email_read_request: (required)
|
|
1022
|
+
:type update_email_read_request: UpdateEmailReadRequest
|
|
1023
|
+
:param idempotency_key: Optional key for safe retries of mutating operations.
|
|
1024
|
+
:type idempotency_key: str
|
|
1025
|
+
:param _request_timeout: timeout setting for this request. If one
|
|
1026
|
+
number provided, it will be total request
|
|
1027
|
+
timeout. It can also be a pair (tuple) of
|
|
1028
|
+
(connection, read) timeouts.
|
|
1029
|
+
:type _request_timeout: int, tuple(int, int), optional
|
|
1030
|
+
:param _request_auth: set to override the auth_settings for an a single
|
|
1031
|
+
request; this effectively ignores the
|
|
1032
|
+
authentication in the spec for a single request.
|
|
1033
|
+
:type _request_auth: dict, optional
|
|
1034
|
+
:param _content_type: force content-type for the request.
|
|
1035
|
+
:type _content_type: str, Optional
|
|
1036
|
+
:param _headers: set to override the headers for a single
|
|
1037
|
+
request; this effectively ignores the headers
|
|
1038
|
+
in the spec for a single request.
|
|
1039
|
+
:type _headers: dict, optional
|
|
1040
|
+
:param _host_index: set to override the host_index for a single
|
|
1041
|
+
request; this effectively ignores the host_index
|
|
1042
|
+
in the spec for a single request.
|
|
1043
|
+
:type _host_index: int, optional
|
|
1044
|
+
:return: Returns the result object.
|
|
1045
|
+
""" # noqa: E501
|
|
1046
|
+
|
|
1047
|
+
_param = self._update_email_read_serialize(
|
|
1048
|
+
id=id,
|
|
1049
|
+
update_email_read_request=update_email_read_request,
|
|
1050
|
+
idempotency_key=idempotency_key,
|
|
1051
|
+
_request_auth=_request_auth,
|
|
1052
|
+
_content_type=_content_type,
|
|
1053
|
+
_headers=_headers,
|
|
1054
|
+
_host_index=_host_index
|
|
1055
|
+
)
|
|
1056
|
+
|
|
1057
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
|
1058
|
+
'200': "EmailResponse",
|
|
1059
|
+
'400': "ErrorResponse",
|
|
1060
|
+
'401': "ErrorResponse",
|
|
1061
|
+
'403': "ErrorResponse",
|
|
1062
|
+
'404': "ErrorResponse",
|
|
1063
|
+
'409': "ErrorResponse",
|
|
1064
|
+
}
|
|
1065
|
+
response_data = self.api_client.call_api(
|
|
1066
|
+
*_param,
|
|
1067
|
+
_request_timeout=_request_timeout
|
|
1068
|
+
)
|
|
1069
|
+
response_data.read()
|
|
1070
|
+
return self.api_client.response_deserialize(
|
|
1071
|
+
response_data=response_data,
|
|
1072
|
+
response_types_map=_response_types_map,
|
|
1073
|
+
)
|
|
1074
|
+
|
|
1075
|
+
|
|
1076
|
+
@validate_call
|
|
1077
|
+
def update_email_read_without_preload_content(
|
|
1078
|
+
self,
|
|
1079
|
+
id: StrictStr,
|
|
1080
|
+
update_email_read_request: UpdateEmailReadRequest,
|
|
1081
|
+
idempotency_key: Annotated[Optional[Annotated[str, Field(min_length=1, strict=True, max_length=255)]], Field(description="Optional key for safe retries of mutating operations.")] = None,
|
|
1082
|
+
_request_timeout: Union[
|
|
1083
|
+
None,
|
|
1084
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
1085
|
+
Tuple[
|
|
1086
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
1087
|
+
Annotated[StrictFloat, Field(gt=0)]
|
|
1088
|
+
]
|
|
1089
|
+
] = None,
|
|
1090
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
1091
|
+
_content_type: Optional[StrictStr] = None,
|
|
1092
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
1093
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
1094
|
+
) -> RESTResponseType:
|
|
1095
|
+
"""Update email read state
|
|
1096
|
+
|
|
1097
|
+
Marks an email as read/unread. Requires `emails:write` scope.
|
|
1098
|
+
|
|
1099
|
+
:param id: (required)
|
|
1100
|
+
:type id: str
|
|
1101
|
+
:param update_email_read_request: (required)
|
|
1102
|
+
:type update_email_read_request: UpdateEmailReadRequest
|
|
1103
|
+
:param idempotency_key: Optional key for safe retries of mutating operations.
|
|
1104
|
+
:type idempotency_key: str
|
|
1105
|
+
:param _request_timeout: timeout setting for this request. If one
|
|
1106
|
+
number provided, it will be total request
|
|
1107
|
+
timeout. It can also be a pair (tuple) of
|
|
1108
|
+
(connection, read) timeouts.
|
|
1109
|
+
:type _request_timeout: int, tuple(int, int), optional
|
|
1110
|
+
:param _request_auth: set to override the auth_settings for an a single
|
|
1111
|
+
request; this effectively ignores the
|
|
1112
|
+
authentication in the spec for a single request.
|
|
1113
|
+
:type _request_auth: dict, optional
|
|
1114
|
+
:param _content_type: force content-type for the request.
|
|
1115
|
+
:type _content_type: str, Optional
|
|
1116
|
+
:param _headers: set to override the headers for a single
|
|
1117
|
+
request; this effectively ignores the headers
|
|
1118
|
+
in the spec for a single request.
|
|
1119
|
+
:type _headers: dict, optional
|
|
1120
|
+
:param _host_index: set to override the host_index for a single
|
|
1121
|
+
request; this effectively ignores the host_index
|
|
1122
|
+
in the spec for a single request.
|
|
1123
|
+
:type _host_index: int, optional
|
|
1124
|
+
:return: Returns the result object.
|
|
1125
|
+
""" # noqa: E501
|
|
1126
|
+
|
|
1127
|
+
_param = self._update_email_read_serialize(
|
|
1128
|
+
id=id,
|
|
1129
|
+
update_email_read_request=update_email_read_request,
|
|
1130
|
+
idempotency_key=idempotency_key,
|
|
1131
|
+
_request_auth=_request_auth,
|
|
1132
|
+
_content_type=_content_type,
|
|
1133
|
+
_headers=_headers,
|
|
1134
|
+
_host_index=_host_index
|
|
1135
|
+
)
|
|
1136
|
+
|
|
1137
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
|
1138
|
+
'200': "EmailResponse",
|
|
1139
|
+
'400': "ErrorResponse",
|
|
1140
|
+
'401': "ErrorResponse",
|
|
1141
|
+
'403': "ErrorResponse",
|
|
1142
|
+
'404': "ErrorResponse",
|
|
1143
|
+
'409': "ErrorResponse",
|
|
1144
|
+
}
|
|
1145
|
+
response_data = self.api_client.call_api(
|
|
1146
|
+
*_param,
|
|
1147
|
+
_request_timeout=_request_timeout
|
|
1148
|
+
)
|
|
1149
|
+
return response_data.response
|
|
1150
|
+
|
|
1151
|
+
|
|
1152
|
+
def _update_email_read_serialize(
|
|
1153
|
+
self,
|
|
1154
|
+
id,
|
|
1155
|
+
update_email_read_request,
|
|
1156
|
+
idempotency_key,
|
|
1157
|
+
_request_auth,
|
|
1158
|
+
_content_type,
|
|
1159
|
+
_headers,
|
|
1160
|
+
_host_index,
|
|
1161
|
+
) -> RequestSerialized:
|
|
1162
|
+
|
|
1163
|
+
_host = None
|
|
1164
|
+
|
|
1165
|
+
_collection_formats: Dict[str, str] = {
|
|
1166
|
+
}
|
|
1167
|
+
|
|
1168
|
+
_path_params: Dict[str, str] = {}
|
|
1169
|
+
_query_params: List[Tuple[str, str]] = []
|
|
1170
|
+
_header_params: Dict[str, Optional[str]] = _headers or {}
|
|
1171
|
+
_form_params: List[Tuple[str, str]] = []
|
|
1172
|
+
_files: Dict[
|
|
1173
|
+
str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
|
|
1174
|
+
] = {}
|
|
1175
|
+
_body_params: Optional[bytes] = None
|
|
1176
|
+
|
|
1177
|
+
# process the path parameters
|
|
1178
|
+
if id is not None:
|
|
1179
|
+
_path_params['id'] = id
|
|
1180
|
+
# process the query parameters
|
|
1181
|
+
# process the header parameters
|
|
1182
|
+
if idempotency_key is not None:
|
|
1183
|
+
_header_params['Idempotency-Key'] = idempotency_key
|
|
1184
|
+
# process the form parameters
|
|
1185
|
+
# process the body parameter
|
|
1186
|
+
if update_email_read_request is not None:
|
|
1187
|
+
_body_params = update_email_read_request
|
|
1188
|
+
|
|
1189
|
+
|
|
1190
|
+
# set the HTTP header `Accept`
|
|
1191
|
+
if 'Accept' not in _header_params:
|
|
1192
|
+
_header_params['Accept'] = self.api_client.select_header_accept(
|
|
1193
|
+
[
|
|
1194
|
+
'application/json'
|
|
1195
|
+
]
|
|
1196
|
+
)
|
|
1197
|
+
|
|
1198
|
+
# set the HTTP header `Content-Type`
|
|
1199
|
+
if _content_type:
|
|
1200
|
+
_header_params['Content-Type'] = _content_type
|
|
1201
|
+
else:
|
|
1202
|
+
_default_content_type = (
|
|
1203
|
+
self.api_client.select_header_content_type(
|
|
1204
|
+
[
|
|
1205
|
+
'application/json'
|
|
1206
|
+
]
|
|
1207
|
+
)
|
|
1208
|
+
)
|
|
1209
|
+
if _default_content_type is not None:
|
|
1210
|
+
_header_params['Content-Type'] = _default_content_type
|
|
1211
|
+
|
|
1212
|
+
# authentication setting
|
|
1213
|
+
_auth_settings: List[str] = [
|
|
1214
|
+
'bearerAuth'
|
|
1215
|
+
]
|
|
1216
|
+
|
|
1217
|
+
return self.api_client.param_serialize(
|
|
1218
|
+
method='PATCH',
|
|
1219
|
+
resource_path='/api/v1/emails/{id}/read',
|
|
1220
|
+
path_params=_path_params,
|
|
1221
|
+
query_params=_query_params,
|
|
1222
|
+
header_params=_header_params,
|
|
1223
|
+
body=_body_params,
|
|
1224
|
+
post_params=_form_params,
|
|
1225
|
+
files=_files,
|
|
1226
|
+
auth_settings=_auth_settings,
|
|
1227
|
+
collection_formats=_collection_formats,
|
|
1228
|
+
_host=_host,
|
|
1229
|
+
_request_auth=_request_auth
|
|
1230
|
+
)
|
|
1231
|
+
|
|
1232
|
+
|