import { GetAllEmailsInput, GetAllFoldersInput, GetEmailAttachmentByProviderIdInput, GetEmailAttachmentInput, RequestOptions, SendEmailInput, UnipileClient, UpdateEmailByProviderIdInput, UpdateEmailInput } from '../index.js'; import { FolderApiResponse, FolderListApiResponse } from '../mails/folders/folders.types.js'; import { MailDeletedApiResponse } from '../mails/mail.delete.types.js'; import { MailSentApiResponse } from '../mails/mail.send.types.js'; import { MailApiResponse } from '../mails/mail.types.js'; import { MailUpdatedApiResponse } from '../mails/mail.update.types.js'; import { MailListApiResponse } from '../mails/mails-list.types.js'; /** * @note The whole approach of having sub methods on methods is kept as is as to * not break API for existing clients. * * BUT IT SHOULD NOT BE USED/REPRODUCED ELSEWHERE : * - It's hard to discover submethods as they are lost in whatever props * exist on js functions. * - The types were just using 'any' as args and the fix is ugly and complex. * - No other resource in the sdk follows this pattern. */ type EmailMethodCallableByProviderId = { (...args: [...TArgs1, options?: RequestOptions]): Promise; byId(...args: [...TArgs2, options?: RequestOptions]): Promise; byProviderId(...args: [...TArgs3, options?: RequestOptions]): Promise; }; export declare class EmailResource { private client; /** * Get one email, either by its ID or by its provider ID. * @example email.getOne('email_id') * @example email.getOne.byProviderId('email_provider_id', 'account_id') */ getOne: EmailMethodCallableByProviderId; /** * Delete an email, either by its ID or by its provider ID. * @example email.delete('email_id') * @example email.delete.byProviderId('email_provider_id', 'account_id') */ delete: EmailMethodCallableByProviderId; /** * Update an email, either by its ID or by its provider ID. * @example email.update({ email_id: 'email_id', folders: ['folder'] }) * @example email.update.byProviderId({ email_provider_id: 'email_provider_id', account_id: 'account_id', folders: ['folder'] }) */ update: EmailMethodCallableByProviderId; /** * Get one folder, either by its ID or by its provider ID. * @example email.getOneFolder('folder_id') * @example email.getOneFolder.byProviderId('folder_provider_id', 'account_id') */ getOneFolder: EmailMethodCallableByProviderId; /** * Get an attachment, either by the email ID or by the email provider ID. * @example email.getEmailAttachment({ email_id: 'email_id', attachment_id: 'attachment_id' }) * @example email.getEmailAttachment.byProviderId({ email_provider_id: 'email_provider_id', attachment_id: 'attachment_id', account_id: 'account_id' }) */ getEmailAttachment: EmailMethodCallableByProviderId; constructor(client: UnipileClient); getAll(input?: GetAllEmailsInput, options?: RequestOptions): Promise; private _getOne; private _getOneByProviderId; private _delete; private _deleteByProviderId; private _update; private _updateByProviderId; getAllFolders(input?: GetAllFoldersInput, options?: RequestOptions): Promise; private _getOneFolder; private _getOneFolderByProviderId; send(input: SendEmailInput, options?: RequestOptions): Promise; private _getEmailAttachment; private _getEmailAttachmentByProviderId; } export {};