/** * Copyright © 2025 Anonyome Labs, Inc. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 */ import { Pagination } from './common'; import { ScheduledDraftMessageState } from '../typings'; /** * Input for `SudoEmailClient.createDraftEmailMessage`. * * The email address in the `From` field of the RFC6854 data must match either the `maskAddress` of the Email Mask associated with the * `emailMaskId` property, if provided, otherwise the `emailAddress` of the Email Address associated with the `senderEmailAddressId` property. * * @interface CreateDraftEmailMessageInput * @property {ArrayBuffer} rfc822Data Email message data formatted under the RFC 6854. * @property {string} senderEmailAddressId The identifier of the email address used to send the email. * @property {string} emailMaskId Optional identifier of the email mask associated with the draft email message. */ export interface CreateDraftEmailMessageInput { rfc822Data: ArrayBuffer; senderEmailAddressId: string; emailMaskId?: string; } /** * Input for `SudoEmailClient.updateDraftEmailMessage`. * * The email address in the `From` field of the RFC6854 data must match either the `maskAddress` of the Email Mask associated with the * `emailMaskId` property, if provided, otherwise the `emailAddress` of the Email Address associated with the `senderEmailAddressId` property. * * @interface UpdateDraftEmailMessageInput * @property {string} id The identifier of the draft email message to update. * @property {ArrayBuffer} rfc822Data Email message data formatted under the RFC 6854. This will completely replace the existing data. * @property {string} senderEmailAddressId The identifier of the email address used to send the email. * @property {string} emailMaskId Optional identifier of the email mask associated with the draft email message. */ export interface UpdateDraftEmailMessageInput { id: string; rfc822Data: ArrayBuffer; senderEmailAddressId: string; emailMaskId?: string; } /** * Input for `SudoEmailClient.deleteDraftEmailMessages`. * * @interface DeleteDraftEmailMessagesInput * @property {string[]} ids A list of one or more identifiers of the draft email messages to be deleted. * @property {string} emailAddressId The identifier of the email address associated with the draft email messages. * @property {string} emailMaskId The identifier of the email mask associated with the draft email messages, if any. In order to * delete a draft email message that is associated with an email mask, the `emailMaskId` must be provided and match the email mask * associated with the draft email message. If the draft email message is not associated with an email mask, this property should be omitted. */ export interface DeleteDraftEmailMessagesInput { ids: string[]; emailAddressId: string; emailMaskId?: string; } /** * Input for `SudoEmailClient.getDraftEmailMessage`. * * @interface GetDraftEmailMessageInput * @property {string} id The identifier of the draft email message to be retrieved. * @property {string} emailAddressId The identifier of the email address associated with the draft email message. * @property {string} emailMaskId The identifier of the email mask associated with the draft email message, if any. */ export interface GetDraftEmailMessageInput { id: string; emailAddressId: string; emailMaskId?: string; } /** * Input for `SudoEmailClient.listDraftEmailMessageMetadataForEmailAddressId`. * * @interface ListDraftEmailMessageMetadataForEmailAddressIdInput * @property {string} emailAddressId The identifier of the email address associated with the draft email messages. * @property {number} limit Number of items to return. Will be defaulted to 10 if omitted. * @property {string} nextToken A token generated by a previous call to this method for pagination. */ export interface ListDraftEmailMessageMetadataForEmailAddressIdInput extends Pagination { emailAddressId: string; } /** * Input for `SudoEmailClient.listDraftEmailMessagesForEmailAddressId`. * * @interface ListDraftEmailMessagesForEmailAddressIdInput * @property {string} emailAddressId The identifier of the email address associated with the draft email messages. * @property {number} limit Number of items to return. Will be defaulted to 10 if omitted. * @property {string} nextToken A token generated by a previous call to this method for pagination. */ export interface ListDraftEmailMessagesForEmailAddressIdInput extends Pagination { emailAddressId: string; } /** * Input for `SudoEmailClient.scheduleSendDraftMessage`. * * @interface ScheduleSendDraftMessageInput * @property {string} id The identifier of the draft message to schedule send. * @property {string} emailAddressId The identifier of the email address to send the message from. * @property {string} emailMaskId The identifier of the email mask to send the message from. * @property {Date} sendAt The timestamp of when to send the message. Must be in the future. */ export interface ScheduleSendDraftMessageInput { id: string; emailAddressId: string; emailMaskId?: string; sendAt: Date; } /** * Input for `SudoEmailClient.cancelScheduledDraftMessage` method. * * @interface CancelScheduledDraftMessageInput * @property {string} id The identifier of the draft message to cancel * @property {string} emailAddressId The identifier of the email address that owns the message. * @property {string} emailMaskId The identifier of the email mask associated with the message. */ export interface CancelScheduledDraftMessageInput { id: string; emailAddressId: string; emailMaskId?: string; } /** * @property {ScheduledDraftMessageState} equal Return only results that match the given state. */ export interface EqualStateFilter { equal: ScheduledDraftMessageState; oneOf?: never; notEqual?: never; notOneOf?: never; } /** * @property {ScheduledDraftMessageState[]} oneOf Return only results that match one of the given states. */ export interface OneOfStateFilter { oneOf: ScheduledDraftMessageState[]; equal?: never; notEqual?: never; notOneOf?: never; } /** * @property {ScheduledDraftMessageState} notEqual Return only results that do not match the given state. */ export interface NotEqualStateFilter { notEqual: ScheduledDraftMessageState; equal?: never; oneOf?: never; notOneOf?: never; } /** * @property {ScheduledDraftMessageState[]} notOneOf Return only results that do not match any of the given states. */ export interface NotOneOfStateFilter { notOneOf: ScheduledDraftMessageState[]; equal?: never; oneOf?: never; notEqual?: never; } /** * @interface ScheduledDraftMessageFilterInput * @property {EqualStateFilter | OneOfStateFilter | NotEqualStateFilter | NotOneOfStateFilter} state Used to filter results based on `state` property */ export interface ScheduledDraftMessageFilterInput { state?: EqualStateFilter | OneOfStateFilter | NotEqualStateFilter | NotOneOfStateFilter; } /** * Input for `SudoEmailClient.listScheduledDraftMessagesForEmailAddressId` method. * * @interface ListScheduledDraftMessagesForEmailAddressIdInput * @property {string} emailAddressId The identifier of the email address to list for. * @property {ScheduledDraftMessageFilterInput} filter Properties used to filter the results. */ export interface ListScheduledDraftMessagesForEmailAddressIdInput extends Pagination { emailAddressId: string; filter?: ScheduledDraftMessageFilterInput; }