Repository Public
1"""GENERATED FILE - do not edit. Source: docs/OPENAPI.yaml (sha256 b4adc147be840cf61e47385d3c2fae21279e7dbb8f2026551fd3e9477ab60e6c).23Regenerate with `python3 scripts/generate_types.py` in packages/sdk-python; a test fails when this file is stale.4Functional TypedDict syntax is used because the API has a field named `from`.5"""6from __future__ import annotations78import sys9from typing import Any, Dict, List, Literal, TypedDict, Union1011if sys.version_info >= (3, 11):12 from typing import NotRequired13else: # Python 3.10: a transparent stand-in (type checkers use the branch above)14 class NotRequired: # type: ignore[no-redef]15 def __class_getitem__(cls, item: Any) -> Any:16 return item1718OPENAPI_SHA256 = "b4adc147be840cf61e47385d3c2fae21279e7dbb8f2026551fd3e9477ab60e6c"19OPENAPI_VERSION = "1.0.0"2021OperationScopes = Dict[str, List[str]]2223EmailAddress = TypedDict("EmailAddress", {24 "email": str,25 "name": Union[str, None],26})2728RecipientObject = TypedDict("RecipientObject", {29 "email": str,30 "name": NotRequired[str],31})3233AttachmentRef = TypedDict("AttachmentRef", {34 "file_id": str,35 "filename": NotRequired[str],36 "inline": NotRequired[bool],37 "cid": NotRequired[str],38})3940FolderRef = TypedDict("FolderRef", {41 "id": str,42 "role": Union[str, None],43 "name": str,44})4546Attachment = TypedDict("Attachment", {47 "id": str,48 "name": Union[str, None],49 "type": str,50 "size": float,51 "cid": Union[str, None],52 "disposition": Union[str, None],53 "inline": bool,54})5556MessageAuth = TypedDict("MessageAuth", {57 "spf": Union[str, None],58 "dkim": Union[str, None],59 "dmarc": Union[str, None],60 "raw": Union[str, None],61})6263MessageHeader = TypedDict("MessageHeader", {64 "name": str,65 "value": str,66})6768MessageSummary = TypedDict("MessageSummary", {69 "id": str,70 "thread_id": str,71 "mailbox": str,72 "delivered_to": List[str],73 "folders": List[FolderRef],74 "from": List[EmailAddress],75 "to": List[EmailAddress],76 "cc": List[EmailAddress],77 "subject": str,78 "preview": str,79 "received_at": str,80 "sent_at": Union[str, None],81 "size": float,82 "unread": bool,83 "starred": bool,84 "draft": bool,85 "answered": bool,86 "forwarded": bool,87 "has_attachment": bool,88 "labels": List[str],89 "pinned": bool,90 "snoozed": bool,91 "followup": bool,92})9394Message = TypedDict("Message", {95 "id": str,96 "thread_id": str,97 "mailbox": str,98 "delivered_to": List[str],99 "folders": List[FolderRef],100 "from": List[EmailAddress],101 "to": List[EmailAddress],102 "cc": List[EmailAddress],103 "subject": str,104 "preview": str,105 "received_at": str,106 "sent_at": Union[str, None],107 "size": float,108 "unread": bool,109 "starred": bool,110 "draft": bool,111 "answered": bool,112 "forwarded": bool,113 "has_attachment": bool,114 "labels": List[str],115 "pinned": bool,116 "snoozed": bool,117 "followup": bool,118 "bcc": List[EmailAddress],119 "reply_to": List[EmailAddress],120 "message_id": Union[str, None],121 "in_reply_to": List[str],122 "references": List[str],123 "headers": List[MessageHeader],124 "text": Union[str, None],125 "html": Union[str, None],126 "truncated": bool,127 "attachments": List[Attachment],128 "auth": MessageAuth,129})130131MessagePage = TypedDict("MessagePage", {132 "data": List[MessageSummary],133 "next_cursor": Union[str, None],134 "has_more": bool,135})136137MessageUpdateParams = TypedDict("MessageUpdateParams", {138 "unread": NotRequired[bool],139 "starred": NotRequired[bool],140 "add_labels": NotRequired[List[str]],141 "remove_labels": NotRequired[List[str]],142})143144Thread = TypedDict("Thread", {145 "id": str,146 "mailbox": str,147 "messages": List[MessageSummary],148})149150ThreadSummary = TypedDict("ThreadSummary", {151 "id": str,152 "mailbox": str,153 "latest": MessageSummary,154})155156ThreadPage = TypedDict("ThreadPage", {157 "data": List[ThreadSummary],158 "next_cursor": Union[str, None],159 "has_more": bool,160})161162Changes = TypedDict("Changes", {163 "mailbox": str,164 "state": str,165 "created": List[str],166 "updated": List[str],167 "destroyed": List[str],168 "has_more": bool,169})170171Folder = TypedDict("Folder", {172 "id": str,173 "mailbox": str,174 "name": str,175 "role": Union[str, None],176 "parent_id": Union[str, None],177 "total": Union[float, None],178 "unread": Union[float, None],179})180181OutboundRecipient = TypedDict("OutboundRecipient", {182 "address": str,183 "status": str,184 "smtp_reply": Union[str, None],185})186187OutboundMessage = TypedDict("OutboundMessage", {188 "id": str,189 "status": Literal["queued", "scheduled", "pending_approval", "sent", "delivered", "deferred", "bounced", "failed", "cancelled", "draft"],190 "from": str,191 "message_id": Union[str, None],192 "recipients": List[OutboundRecipient],193 "external": bool,194 "send_at": Union[str, None],195 "attempts": float,196 "last_error": Union[str, None],197 "submitted_at": Union[str, None],198 "final_at": Union[str, None],199 "created_at": str,200 "updated_at": str,201 "approval_id": NotRequired[str],202 "thread_id": NotRequired[Union[str, None]],203 "undo_until": NotRequired[Union[str, None]],204})205206OutboundPage = TypedDict("OutboundPage", {207 "data": List[OutboundMessage],208 "next_cursor": Union[str, None],209 "has_more": bool,210})211212SendParams = TypedDict("SendParams", {213 "from": str,214 "to": NotRequired[List[Union[str, RecipientObject]]],215 "cc": NotRequired[List[Union[str, RecipientObject]]],216 "bcc": NotRequired[List[Union[str, RecipientObject]]],217 "subject": NotRequired[str],218 "text": NotRequired[str],219 "html": NotRequired[str],220 "attachments": NotRequired[List[AttachmentRef]],221 "reply_to_message_id": NotRequired[str],222 "in_reply_to": NotRequired[str],223 "references": NotRequired[List[str]],224 "headers": NotRequired[Dict[str, str]],225 "priority": NotRequired[Literal["high", "normal", "low"]],226 "send_at": NotRequired[str],227 "draft": NotRequired[bool],228 "template_id": NotRequired[str],229 "variables": NotRequired[Dict[str, str]],230 "undo_seconds": NotRequired[int],231 "remind_at": NotRequired[str],232 "remind_if_no_reply": NotRequired[bool],233 "confirm_sensitive": NotRequired[bool],234})235236ReplyParams = TypedDict("ReplyParams", {237 "from": NotRequired[str],238 "reply_all": NotRequired[bool],239 "text": NotRequired[str],240 "html": NotRequired[str],241 "cc": NotRequired[List[Union[str, RecipientObject]]],242 "bcc": NotRequired[List[Union[str, RecipientObject]]],243 "attachments": NotRequired[List[AttachmentRef]],244 "headers": NotRequired[Dict[str, str]],245 "send_at": NotRequired[str],246 "draft": NotRequired[bool],247 "undo_seconds": NotRequired[int],248 "remind_at": NotRequired[str],249 "remind_if_no_reply": NotRequired[bool],250 "confirm_sensitive": NotRequired[bool],251})252253ForwardParams = TypedDict("ForwardParams", {254 "from": NotRequired[str],255 "to": List[Union[str, RecipientObject]],256 "cc": NotRequired[List[Union[str, RecipientObject]]],257 "bcc": NotRequired[List[Union[str, RecipientObject]]],258 "text": NotRequired[str],259 "include_attachments": NotRequired[bool],260 "send_at": NotRequired[str],261 "draft": NotRequired[bool],262 "undo_seconds": NotRequired[int],263 "remind_at": NotRequired[str],264 "remind_if_no_reply": NotRequired[bool],265 "confirm_sensitive": NotRequired[bool],266})267268BatchResultItem = TypedDict("BatchResultItem", {269 "index": float,270 "ok": bool,271 "status": float,272 "message": NotRequired[OutboundMessage],273 "error": NotRequired[Dict[str, Any]],274})275276BatchResult = TypedDict("BatchResult", {277 "results": List[BatchResultItem],278})279280DraftCreateParams = TypedDict("DraftCreateParams", {281 "from": str,282 "to": NotRequired[List[Union[str, RecipientObject]]],283 "cc": NotRequired[List[Union[str, RecipientObject]]],284 "bcc": NotRequired[List[Union[str, RecipientObject]]],285 "subject": NotRequired[str],286 "text": NotRequired[str],287 "html": NotRequired[str],288 "attachments": NotRequired[List[AttachmentRef]],289 "reply_to_message_id": NotRequired[str],290 "in_reply_to": NotRequired[str],291 "references": NotRequired[List[str]],292 "headers": NotRequired[Dict[str, str]],293 "priority": NotRequired[Literal["high", "normal", "low"]],294})295296DraftUpdateParams = TypedDict("DraftUpdateParams", {297 "from": NotRequired[str],298 "to": NotRequired[List[Union[str, RecipientObject]]],299 "cc": NotRequired[List[Union[str, RecipientObject]]],300 "bcc": NotRequired[List[Union[str, RecipientObject]]],301 "subject": NotRequired[str],302 "text": NotRequired[str],303 "html": NotRequired[str],304 "attachments": NotRequired[List[AttachmentRef]],305 "reply_to_message_id": NotRequired[str],306 "in_reply_to": NotRequired[str],307 "references": NotRequired[List[str]],308 "headers": NotRequired[Dict[str, str]],309 "priority": NotRequired[Literal["high", "normal", "low"]],310})311312UploadedFile = TypedDict("UploadedFile", {313 "id": str,314 "name": str,315 "type": str,316 "size": float,317 "mailbox": str,318 "expires_at": str,319})320321Address = TypedDict("Address", {322 "id": str,323 "address": str,324 "kind": Literal["mailbox", "alias", "shared", "notification", "send_only", "receive_only", "temporary"],325 "mailbox": Union[str, None],326 "mailbox_id": str,327 "display_name": str,328 "signature_text": str,329 "signature_html": str,330 "avatar": Union[str, None],331 "can_send": bool,332 "can_receive": bool,333 "status": Literal["active", "suspended"],334 "suspended_reason": Union[str, None],335 "expired": bool,336 "expires_at": Union[str, None],337 "retention_days": Union[float, None],338 "retention_trash_days": Union[float, None],339 "retention_junk_days": Union[float, None],340 "quota_bytes": Union[float, None],341 "reply_policy": Literal["reject", "accept", "discard"],342 "protected": bool,343 "extra_destinations": List[str],344 "inbound": Literal["accept", "reject", "discard"],345 "created_at": str,346 "updated_at": str,347})348349AddressCreateParams = TypedDict("AddressCreateParams", {350 "display_name": NotRequired[str],351 "signature_text": NotRequired[str],352 "signature_html": NotRequired[str],353 "avatar": NotRequired[Union[str, None]],354 "can_send": NotRequired[bool],355 "can_receive": NotRequired[bool],356 "status": NotRequired[Literal["active", "suspended"]],357 "expires_at": NotRequired[Union[str, None]],358 "retention_days": NotRequired[Union[int, None]],359 "retention_trash_days": NotRequired[Union[int, None]],360 "retention_junk_days": NotRequired[Union[int, None]],361 "quota_bytes": NotRequired[Union[int, None]],362 "reply_policy": NotRequired[Literal["reject", "accept", "discard"]],363 "extra_destinations": NotRequired[List[str]],364 "kind": NotRequired[Literal["mailbox", "alias", "shared", "notification", "send_only", "receive_only", "temporary"]],365 "protected": NotRequired[bool],366 "address": str,367 "mailbox": NotRequired[str],368 "user_id": NotRequired[str],369})370371AddressUpdateParams = TypedDict("AddressUpdateParams", {372 "display_name": NotRequired[str],373 "signature_text": NotRequired[str],374 "signature_html": NotRequired[str],375 "avatar": NotRequired[Union[str, None]],376 "can_send": NotRequired[bool],377 "can_receive": NotRequired[bool],378 "status": NotRequired[Literal["active", "suspended"]],379 "expires_at": NotRequired[Union[str, None]],380 "retention_days": NotRequired[Union[int, None]],381 "retention_trash_days": NotRequired[Union[int, None]],382 "retention_junk_days": NotRequired[Union[int, None]],383 "quota_bytes": NotRequired[Union[int, None]],384 "reply_policy": NotRequired[Literal["reject", "accept", "discard"]],385 "extra_destinations": NotRequired[List[str]],386 "kind": NotRequired[Literal["mailbox", "alias", "shared", "notification", "send_only", "receive_only", "temporary"]],387 "protected": NotRequired[bool],388})389390Automation = TypedDict("Automation", {391 "managed": bool,392 "active": bool,393 "rules": List[Any],394 "vacation": Any,395 "forward": Union[Dict[str, Any], None],396 "raw_sieve": NotRequired[str],397})398399AutomationUpdateParams = TypedDict("AutomationUpdateParams", {400 "rules": NotRequired[List[Dict[str, Any]]],401 "vacation": NotRequired[Dict[str, Any]],402 "forward": NotRequired[Union[Dict[str, Any], None]],403 "raw_sieve": NotRequired[str],404})405406Webhook = TypedDict("Webhook", {407 "id": str,408 "name": str,409 "url": str,410 "events": List[str],411 "address_ids": List[str],412 "include_content": bool,413 "active": bool,414 "owner": Literal["key", "admin"],415 "key_id": Union[str, None],416 "created_at": str,417 "updated_at": str,418 "secret": NotRequired[str],419})420421WebhookCreateParams = TypedDict("WebhookCreateParams", {422 "name": str,423 "url": str,424 "events": List[Literal["message.received", "message.sent", "message.delivered", "message.deferred", "message.bounced", "message.failed", "message.read", "message.deleted", "draft.created", "address.created", "address.suspended", "rule.matched"]],425 "address_ids": NotRequired[List[str]],426 "include_content": NotRequired[bool],427 "active": NotRequired[bool],428})429430WebhookUpdateParams = TypedDict("WebhookUpdateParams", {431 "name": NotRequired[str],432 "url": NotRequired[str],433 "events": NotRequired[List[Literal["message.received", "message.sent", "message.delivered", "message.deferred", "message.bounced", "message.failed", "message.read", "message.deleted", "draft.created", "address.created", "address.suspended", "rule.matched"]]],434 "address_ids": NotRequired[List[str]],435 "include_content": NotRequired[bool],436 "active": NotRequired[bool],437 "rotate_secret": NotRequired[bool],438})439440WebhookDelivery = TypedDict("WebhookDelivery", {441 "id": str,442 "webhook_id": str,443 "event_id": str,444 "event_type": str,445 "status": Literal["pending", "retrying", "delivered", "failed"],446 "attempt": float,447 "next_attempt_at": Union[str, None],448 "last_status": Union[float, None],449 "last_error": Union[str, None],450 "delivered_at": Union[str, None],451 "created_at": str,452})453454WebhookDeliveryPage = TypedDict("WebhookDeliveryPage", {455 "data": List[WebhookDelivery],456 "next_cursor": Union[str, None],457 "has_more": bool,458})459460WebhookTestResult = TypedDict("WebhookTestResult", {461 "delivery": WebhookDelivery,462 "http_status": Union[float, None],463 "error": Union[str, None],464})465466Event = TypedDict("Event", {467 "id": str,468 "type": str,469 "occurred_at": str,470 "address": Union[str, None],471 "mailbox": Union[str, None],472 "data": Dict[str, Any],473})474475EventPage = TypedDict("EventPage", {476 "data": List[Event],477 "next_cursor": Union[str, None],478 "has_more": bool,479})480481TemplateVariable = TypedDict("TemplateVariable", {482 "name": str,483 "description": str,484 "example": str,485 "required": bool,486})487488TemplateSummary = TypedDict("TemplateSummary", {489 "id": str,490 "name": str,491 "category": str,492 "subject": str,493 "preheader": str,494 "variables": List[TemplateVariable],495 "source": Literal["manual", "ai"],496 "version": float,497 "size_bytes": float,498 "created_at": str,499 "updated_at": str,500})501502Template = TypedDict("Template", {503 "id": str,504 "name": str,505 "category": str,506 "subject": str,507 "preheader": str,508 "variables": List[TemplateVariable],509 "source": Literal["manual", "ai"],510 "version": float,511 "size_bytes": float,512 "created_at": str,513 "updated_at": str,514 "html": str,515 "text": str,516})517518RenderedTemplate = TypedDict("RenderedTemplate", {519 "subject": str,520 "preheader": str,521 "html": str,522 "text": str,523 "missing": List[str],524})525526MeAddress = TypedDict("MeAddress", {527 "id": str,528 "address": str,529 "kind": str,530 "mailbox": str,531 "status": str,532 "can_send": bool,533 "can_receive": bool,534 "read": Literal["full", "restricted", "none"],535})536537MeLimits = TypedDict("MeLimits", {538 "rate_per_minute": Union[float, None],539 "daily_send_limit": Union[float, None],540 "external_send_policy": str,541 "allowed_recipient_domains": List[str],542})543544MeUsage = TypedDict("MeUsage", {545 "sent": float,546 "requests": float,547})548549Me = TypedDict("Me", {550 "type": Literal["key", "user"],551 "id": str,552 "name": str,553 "explorer": bool,554 "scopes": List[str],555 "all_addresses": bool,556 "addresses": List[MeAddress],557 "limits": MeLimits,558 "usage_today": MeUsage,559 "version": str,560})561562Health = TypedDict("Health", {563 "ok": bool,564 "version": str,565 "database": Literal["ok", "down"],566 "mail_server": Literal["reachable", "unreachable"],567 "workers": Literal["on", "off"],568})569570OPERATION_SCOPES: OperationScopes = {571 "getAddresses": ["mail.addresses.read"],572 "postAddresses": ["mail.addresses.manage", "mail.aliases.manage"],573 "deleteAddressesId": ["mail.addresses.manage", "mail.aliases.manage"],574 "getAddressesId": ["mail.addresses.read"],575 "patchAddressesId": ["mail.addresses.manage", "mail.aliases.manage"],576 "getAddressesIdAutomation": ["mail.addresses.read"],577 "putAddressesIdAutomation": ["mail.addresses.manage"],578 "getAliases": ["mail.addresses.read"],579 "postAliases": ["mail.aliases.manage", "mail.addresses.manage"],580 "deleteAliasesId": ["mail.aliases.manage", "mail.addresses.manage"],581 "patchAliasesId": ["mail.aliases.manage", "mail.addresses.manage"],582 "getDrafts": ["mail.drafts"],583 "postDrafts": ["mail.drafts"],584 "deleteDraftsId": ["mail.drafts"],585 "getDraftsId": ["mail.drafts"],586 "patchDraftsId": ["mail.drafts"],587 "postDraftsIdSend": ["mail.send"],588 "getEvents": ["mail.read", "mail.webhooks.manage", "mail.send"],589 "postFiles": ["mail.attachments.write"],590 "getFolders": ["mail.read"],591 "postFolders": ["mail.modify"],592 "getHealth": [],593 "getMe": [],594 "getMessages": ["mail.read", "mail.search"],595 "deleteMessagesId": ["mail.modify", "mail.delete"],596 "getMessagesId": ["mail.read"],597 "patchMessagesId": ["mail.modify"],598 "getMessagesIdAttachments": ["mail.attachments.read"],599 "getMessagesIdAttachmentsAttachment_id": ["mail.attachments.read"],600 "postMessagesIdForward": ["mail.send"],601 "postMessagesIdMove": ["mail.modify"],602 "postMessagesIdReply": ["mail.send"],603 "getMessagesChanges": ["mail.read"],604 "getMessagesOutbound": ["mail.send", "mail.read"],605 "getMessagesOutboundId": ["mail.send", "mail.read"],606 "getMessagesScheduled": ["mail.send"],607 "deleteMessagesScheduledId": ["mail.send"],608 "postMessagesSend": ["mail.send", "mail.drafts"],609 "postMessagesSendBatch": ["mail.send"],610 "getOpenapi.json": [],611 "getOpenapi.yaml": [],612 "getTemplates": ["mail.send", "mail.drafts"],613 "getTemplatesId": ["mail.send", "mail.drafts"],614 "postTemplatesIdRender": ["mail.send", "mail.drafts"],615 "getThreads": ["mail.read"],616 "getThreadsId": ["mail.read"],617 "postWebhookDeliveriesIdReplay": ["mail.webhooks.manage"],618 "getWebhooks": ["mail.webhooks.manage"],619 "postWebhooks": ["mail.webhooks.manage"],620 "deleteWebhooksId": ["mail.webhooks.manage"],621 "getWebhooksId": ["mail.webhooks.manage"],622 "patchWebhooksId": ["mail.webhooks.manage"],623 "getWebhooksIdDeliveries": ["mail.webhooks.manage"],624 "postWebhooksIdTest": ["mail.webhooks.manage"],625}626627__all__ = ["Address", "AddressCreateParams", "AddressUpdateParams", "Attachment", "AttachmentRef", "Automation", "AutomationUpdateParams", "BatchResult", "BatchResultItem", "Changes", "DraftCreateParams", "DraftUpdateParams", "EmailAddress", "Event", "EventPage", "Folder", "FolderRef", "ForwardParams", "Health", "Me", "MeAddress", "MeLimits", "MeUsage", "Message", "MessageAuth", "MessageHeader", "MessagePage", "MessageSummary", "MessageUpdateParams", "OPENAPI_SHA256", "OPENAPI_VERSION", "OPERATION_SCOPES", "OutboundMessage", "OutboundPage", "OutboundRecipient", "RecipientObject", "RenderedTemplate", "ReplyParams", "SendParams", "Template", "TemplateSummary", "TemplateVariable", "Thread", "ThreadPage", "ThreadSummary", "UploadedFile", "Webhook", "WebhookCreateParams", "WebhookDelivery", "WebhookDeliveryPage", "WebhookTestResult", "WebhookUpdateParams"]628