DraftResource

Provides operations for managing email drafts: list, create, get, update, delete, send, and retrieve attachments.

Functions

Link copied to clipboard
suspend fun create(block: CreateDraftBuilder.() -> Unit): Draft

Creates a new email draft.

Link copied to clipboard
suspend fun delete(draftId: String)

Deletes a draft by ID.

Link copied to clipboard
suspend fun get(draftId: String): Draft

Retrieves a draft by ID.

Link copied to clipboard
suspend fun getAttachment(draftId: String, attachmentId: String): AttachmentData

Retrieves a draft attachment's binary data by draft and attachment IDs.

Link copied to clipboard
suspend fun list(block: ListDraftsBuilder.() -> Unit = {}): DraftList

Lists drafts with optional pagination and filtering.

Link copied to clipboard
suspend fun send(draftId: String, block: SendDraftBuilder.() -> Unit = {}): SendMessageResponse

Sends a draft as an email message.

Link copied to clipboard
suspend fun update(draftId: String, block: UpdateDraftBuilder.() -> Unit): Draft

Updates an existing draft by ID.