/* tslint:disable */ /* eslint-disable */ /** * MailSlurp API * MailSlurp is an API for sending and receiving emails from dynamically allocated email addresses. It\'s designed for developers and QA teams to test applications, process inbound emails, send templated notifications, attachments, and more. ## Resources - [Homepage](https://www.mailslurp.com) - Get an [API KEY](https://app.mailslurp.com/sign-up/) - Generated [SDK Clients](https://www.mailslurp.com/docs/) - [Examples](https://github.com/mailslurp/examples) repository * * The version of the OpenAPI document: 6.5.2 * Contact: contact@mailslurp.dev * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ import * as runtime from '../runtime'; import { CountDto, CountDtoFromJSON, CountDtoToJSON, CreateInboxDto, CreateInboxDtoFromJSON, CreateInboxDtoToJSON, CreateInboxRulesetOptions, CreateInboxRulesetOptionsFromJSON, CreateInboxRulesetOptionsToJSON, EmailPreview, EmailPreviewFromJSON, EmailPreviewToJSON, FlushExpiredInboxesResult, FlushExpiredInboxesResultFromJSON, FlushExpiredInboxesResultToJSON, InboxDto, InboxDtoFromJSON, InboxDtoToJSON, InboxExistsDto, InboxExistsDtoFromJSON, InboxExistsDtoToJSON, InboxRulesetDto, InboxRulesetDtoFromJSON, InboxRulesetDtoToJSON, PageEmailPreview, PageEmailPreviewFromJSON, PageEmailPreviewToJSON, PageInboxProjection, PageInboxProjectionFromJSON, PageInboxProjectionToJSON, PageInboxRulesetDto, PageInboxRulesetDtoFromJSON, PageInboxRulesetDtoToJSON, PageOrganizationInboxProjection, PageOrganizationInboxProjectionFromJSON, PageOrganizationInboxProjectionToJSON, PageSentEmailProjection, PageSentEmailProjectionFromJSON, PageSentEmailProjectionToJSON, PageTrackingPixelProjection, PageTrackingPixelProjectionFromJSON, PageTrackingPixelProjectionToJSON, SendEmailOptions, SendEmailOptionsFromJSON, SendEmailOptionsToJSON, SentEmailDto, SentEmailDtoFromJSON, SentEmailDtoToJSON, SetInboxFavouritedOptions, SetInboxFavouritedOptionsFromJSON, SetInboxFavouritedOptionsToJSON, UpdateInboxOptions, UpdateInboxOptionsFromJSON, UpdateInboxOptionsToJSON, } from '../models'; export interface CreateInboxRequest { emailAddress?: string; tags?: Array; name?: string; description?: string; useDomainPool?: boolean; favourite?: boolean; expiresAt?: Date; expiresIn?: number; allowTeamAccess?: boolean; inboxType?: CreateInboxInboxTypeEnum; } export interface CreateInboxRulesetRequest { inboxId: string; createInboxRulesetOptions: CreateInboxRulesetOptions; } export interface CreateInboxWithOptionsRequest { createInboxDto: CreateInboxDto; } export interface DeleteInboxRequest { inboxId: string; } export interface DoesInboxExistRequest { emailAddress: string; } export interface FlushExpiredRequest { before?: Date; } export interface GetAllInboxesRequest { page?: number; size?: number; sort?: GetAllInboxesSortEnum; favourite?: boolean; search?: string; tag?: string; teamAccess?: boolean; since?: Date; before?: Date; } export interface GetEmailsRequest { inboxId: string; size?: number; limit?: number; sort?: GetEmailsSortEnum; retryTimeout?: number; delayTimeout?: number; minCount?: number; unreadOnly?: boolean; before?: Date; since?: Date; } export interface GetInboxRequest { inboxId: string; } export interface GetInboxEmailCountRequest { inboxId: string; } export interface GetInboxEmailsPaginatedRequest { inboxId: string; page?: number; size?: number; sort?: GetInboxEmailsPaginatedSortEnum; since?: Date; before?: Date; } export interface GetInboxSentEmailsRequest { inboxId: string; page?: number; size?: number; sort?: GetInboxSentEmailsSortEnum; searchFilter?: string; since?: Date; before?: Date; } export interface GetInboxesRequest { size?: number; sort?: GetInboxesSortEnum; since?: Date; before?: Date; } export interface GetOrganizationInboxesRequest { page?: number; size?: number; sort?: GetOrganizationInboxesSortEnum; searchFilter?: string; since?: Date; before?: Date; } export interface ListInboxRulesetsRequest { inboxId: string; page?: number; size?: number; sort?: ListInboxRulesetsSortEnum; searchFilter?: string; since?: Date; before?: Date; } export interface ListInboxTrackingPixelsRequest { inboxId: string; page?: number; size?: number; sort?: ListInboxTrackingPixelsSortEnum; searchFilter?: string; since?: Date; before?: Date; } export interface SendEmailRequest { inboxId: string; sendEmailOptions: SendEmailOptions; } export interface SendEmailAndConfirmRequest { inboxId: string; sendEmailOptions: SendEmailOptions; } export interface SendTestEmailRequest { inboxId: string; } export interface SetInboxFavouritedRequest { inboxId: string; setInboxFavouritedOptions: SetInboxFavouritedOptions; } export interface UpdateInboxRequest { inboxId: string; updateInboxOptions: UpdateInboxOptions; } /** * InboxControllerApi - interface * * @export * @interface InboxControllerApiInterface */ export interface InboxControllerApiInterface { /** * Create a new inbox and with a randomized email address to send and receive from. Pass emailAddress parameter if you wish to use a specific email address. Creating an inbox is required before sending or receiving emails. If writing tests it is recommended that you create a new inbox during each test method so that it is unique and empty. * @summary Create an inbox email address. An inbox has a real email address and can send and receive emails. Inboxes can be either `SMTP` or `HTTP` inboxes. * @param {string} [emailAddress] A custom email address to use with the inbox. Defaults to null. When null MailSlurp will assign a random email address to the inbox such as `123@mailslurp.com`. If you use the `useDomainPool` option when the email address is null it will generate an email address with a more varied domain ending such as `123@mailslurp.info` or `123@mailslurp.biz`. When a custom email address is provided the address is split into a domain and the domain is queried against your user. If you have created the domain in the MailSlurp dashboard and verified it you can use any email address that ends with the domain. Note domain types must match the inbox type - so `SMTP` inboxes will only work with `SMTP` type domains. Avoid `SMTP` inboxes if you need to send emails as they can only receive. Send an email to this address and the inbox will receive and store it for you. To retrieve the email use the Inbox and Email Controller endpoints with the inbox ID. * @param {Array} [tags] Tags that inbox has been tagged with. Tags can be added to inboxes to group different inboxes within an account. You can also search for inboxes by tag in the dashboard UI. * @param {string} [name] Optional name of the inbox. Displayed in the dashboard for easier search and used as the sender name when sending emails. * @param {string} [description] Optional description of the inbox for labelling purposes. Is shown in the dashboard and can be used with * @param {boolean} [useDomainPool] Use the MailSlurp domain name pool with this inbox when creating the email address. Defaults to null. If enabled the inbox will be an email address with a domain randomly chosen from a list of the MailSlurp domains. This is useful when the default `@mailslurp.com` email addresses used with inboxes are blocked or considered spam by a provider or receiving service. When domain pool is enabled an email address will be generated ending in `@mailslurp.{world,info,xyz,...}` . This means a TLD is randomly selecting from a list of `.biz`, `.info`, `.xyz` etc to add variance to the generated email addresses. When null or false MailSlurp uses the default behavior of `@mailslurp.com` or custom email address provided by the emailAddress field. Note this feature is only available for `HTTP` inbox types. * @param {boolean} [favourite] Is the inbox a favorite. Marking an inbox as a favorite is typically done in the dashboard for quick access or filtering * @param {Date} [expiresAt] Optional inbox expiration date. If null then this inbox is permanent and the emails in it won\'t be deleted. If an expiration date is provided or is required by your plan the inbox will be closed when the expiration time is reached. Expired inboxes still contain their emails but can no longer send or receive emails. An ExpiredInboxRecord is created when an inbox and the email address and inbox ID are recorded. The expiresAt property is a timestamp string in ISO DateTime Format yyyy-MM-dd\'T\'HH:mm:ss.SSSXXX. * @param {number} [expiresIn] Number of milliseconds that inbox should exist for * @param {boolean} [allowTeamAccess] DEPRECATED (team access is always true). Grant team access to this inbox and the emails that belong to it for team members of your organization. * @param {'HTTP_INBOX' | 'SMTP_INBOX'} [inboxType] HTTP (default) or SMTP inbox type. HTTP inboxes are default and best solution for most cases. SMTP inboxes are more reliable for public inbound email consumption (but do not support sending emails). When using custom domains the domain type must match the inbox type. HTTP inboxes are processed by AWS SES while SMTP inboxes use a custom mail server running at `mx.mailslurp.com`. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof InboxControllerApiInterface */ createInboxRaw(requestParameters: CreateInboxRequest): Promise>; /** * Create a new inbox and with a randomized email address to send and receive from. Pass emailAddress parameter if you wish to use a specific email address. Creating an inbox is required before sending or receiving emails. If writing tests it is recommended that you create a new inbox during each test method so that it is unique and empty. * Create an inbox email address. An inbox has a real email address and can send and receive emails. Inboxes can be either `SMTP` or `HTTP` inboxes. */ createInbox(requestParameters: CreateInboxRequest): Promise; /** * Create a new inbox rule for forwarding, blocking, and allowing emails when sending and receiving * @summary Create an inbox ruleset * @param {string} inboxId inboxId * @param {CreateInboxRulesetOptions} createInboxRulesetOptions * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof InboxControllerApiInterface */ createInboxRulesetRaw(requestParameters: CreateInboxRulesetRequest): Promise>; /** * Create a new inbox rule for forwarding, blocking, and allowing emails when sending and receiving * Create an inbox ruleset */ createInboxRuleset(requestParameters: CreateInboxRulesetRequest): Promise; /** * * @summary Create an inbox with default options. Uses MailSlurp domain pool address and is private. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof InboxControllerApiInterface */ createInboxWithDefaultsRaw(): Promise>; /** * Create an inbox with default options. Uses MailSlurp domain pool address and is private. */ createInboxWithDefaults(): Promise; /** * Additional endpoint that allows inbox creation with request body options. Can be more flexible that other methods for some clients. * @summary Create an inbox with options. Extended options for inbox creation. * @param {CreateInboxDto} createInboxDto * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof InboxControllerApiInterface */ createInboxWithOptionsRaw(requestParameters: CreateInboxWithOptionsRequest): Promise>; /** * Additional endpoint that allows inbox creation with request body options. Can be more flexible that other methods for some clients. * Create an inbox with options. Extended options for inbox creation. */ createInboxWithOptions(requestParameters: CreateInboxWithOptionsRequest): Promise; /** * Permanently delete all inboxes and associated email addresses. This will also delete all emails within the inboxes. Be careful as inboxes cannot be recovered once deleted. Note: deleting inboxes will not impact your usage limits. Monthly inbox creation limits are based on how many inboxes were created in the last 30 days, not how many inboxes you currently have. * @summary Delete all inboxes * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof InboxControllerApiInterface */ deleteAllInboxesRaw(): Promise>; /** * Permanently delete all inboxes and associated email addresses. This will also delete all emails within the inboxes. Be careful as inboxes cannot be recovered once deleted. Note: deleting inboxes will not impact your usage limits. Monthly inbox creation limits are based on how many inboxes were created in the last 30 days, not how many inboxes you currently have. * Delete all inboxes */ deleteAllInboxes(): Promise; /** * Permanently delete an inbox and associated email address as well as all emails within the given inbox. This action cannot be undone. Note: deleting an inbox will not affect your account usage. Monthly inbox usage is based on how many inboxes you create within 30 days, not how many exist at time of request. * @summary Delete inbox * @param {string} inboxId * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof InboxControllerApiInterface */ deleteInboxRaw(requestParameters: DeleteInboxRequest): Promise>; /** * Permanently delete an inbox and associated email address as well as all emails within the given inbox. This action cannot be undone. Note: deleting an inbox will not affect your account usage. Monthly inbox usage is based on how many inboxes you create within 30 days, not how many exist at time of request. * Delete inbox */ deleteInbox(requestParameters: DeleteInboxRequest): Promise; /** * Check if inboxes exist by email address. Useful if you are sending emails to mailslurp addresses * @summary Does inbox exist * @param {string} emailAddress Email address * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof InboxControllerApiInterface */ doesInboxExistRaw(requestParameters: DoesInboxExistRequest): Promise>; /** * Check if inboxes exist by email address. Useful if you are sending emails to mailslurp addresses * Does inbox exist */ doesInboxExist(requestParameters: DoesInboxExistRequest): Promise; /** * Remove any expired inboxes for your account (instead of waiting for scheduled removal on server) * @summary Remove expired inboxes * @param {Date} [before] Optional expired at before flag to flush expired inboxes that have expired before the given time * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof InboxControllerApiInterface */ flushExpiredRaw(requestParameters: FlushExpiredRequest): Promise>; /** * Remove any expired inboxes for your account (instead of waiting for scheduled removal on server) * Remove expired inboxes */ flushExpired(requestParameters: FlushExpiredRequest): Promise; /** * List inboxes in paginated form. The results are available on the `content` property of the returned object. This method allows for page index (zero based), page size (how many results to return), and a sort direction (based on createdAt time). You Can also filter by whether an inbox is favorited or use email address pattern. This method is the recommended way to query inboxes. The alternative `getInboxes` method returns a full list of inboxes but is limited to 100 results. * @summary List All Inboxes Paginated * @param {number} [page] Optional page index in list pagination * @param {number} [size] Optional page size in list pagination * @param {'ASC' | 'DESC'} [sort] Optional createdAt sort direction ASC or DESC * @param {boolean} [favourite] Optionally filter results for favourites only * @param {string} [search] Optionally filter by search words partial matching ID, tags, name, and email address * @param {string} [tag] Optionally filter by tags. Will return inboxes that include given tags * @param {boolean} [teamAccess] DEPRECATED. Optionally filter by team access. * @param {Date} [since] Optional filter by created after given date time * @param {Date} [before] Optional filter by created before given date time * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof InboxControllerApiInterface */ getAllInboxesRaw(requestParameters: GetAllInboxesRequest): Promise>; /** * List inboxes in paginated form. The results are available on the `content` property of the returned object. This method allows for page index (zero based), page size (how many results to return), and a sort direction (based on createdAt time). You Can also filter by whether an inbox is favorited or use email address pattern. This method is the recommended way to query inboxes. The alternative `getInboxes` method returns a full list of inboxes but is limited to 100 results. * List All Inboxes Paginated */ getAllInboxes(requestParameters: GetAllInboxesRequest): Promise; /** * List emails that an inbox has received. Only emails that are sent to the inbox\'s email address will appear in the inbox. It may take several seconds for any email you send to an inbox\'s email address to appear in the inbox. To make this endpoint wait for a minimum number of emails use the `minCount` parameter. The server will retry the inbox database until the `minCount` is satisfied or the `retryTimeout` is reached * @summary Get emails in an Inbox. This method is not idempotent as it allows retries and waits if you want certain conditions to be met before returning. For simple listing and sorting of known emails use the email controller instead. * @param {string} inboxId Id of inbox that emails belongs to * @param {number} [size] Alias for limit. Assessed first before assessing any passed limit. * @param {number} [limit] Limit the result set, ordered by received date time sort direction. Maximum 100. For more listing options see the email controller * @param {'ASC' | 'DESC'} [sort] Sort the results by received date and direction ASC or DESC * @param {number} [retryTimeout] Maximum milliseconds to spend retrying inbox database until minCount emails are returned * @param {number} [delayTimeout] * @param {number} [minCount] Minimum acceptable email count. Will cause request to hang (and retry) until minCount is satisfied or retryTimeout is reached. * @param {boolean} [unreadOnly] * @param {Date} [before] Exclude emails received after this ISO 8601 date time * @param {Date} [since] Exclude emails received before this ISO 8601 date time * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof InboxControllerApiInterface */ getEmailsRaw(requestParameters: GetEmailsRequest): Promise>>; /** * List emails that an inbox has received. Only emails that are sent to the inbox\'s email address will appear in the inbox. It may take several seconds for any email you send to an inbox\'s email address to appear in the inbox. To make this endpoint wait for a minimum number of emails use the `minCount` parameter. The server will retry the inbox database until the `minCount` is satisfied or the `retryTimeout` is reached * Get emails in an Inbox. This method is not idempotent as it allows retries and waits if you want certain conditions to be met before returning. For simple listing and sorting of known emails use the email controller instead. */ getEmails(requestParameters: GetEmailsRequest): Promise>; /** * Returns an inbox\'s properties, including its email address and ID. * @summary Get Inbox. Returns properties of an inbox. * @param {string} inboxId * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof InboxControllerApiInterface */ getInboxRaw(requestParameters: GetInboxRequest): Promise>; /** * Returns an inbox\'s properties, including its email address and ID. * Get Inbox. Returns properties of an inbox. */ getInbox(requestParameters: GetInboxRequest): Promise; /** * * @summary Get total inbox count * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof InboxControllerApiInterface */ getInboxCountRaw(): Promise>; /** * Get total inbox count */ getInboxCount(): Promise; /** * * @summary Get email count in inbox * @param {string} inboxId Id of inbox that emails belongs to * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof InboxControllerApiInterface */ getInboxEmailCountRaw(requestParameters: GetInboxEmailCountRequest): Promise>; /** * Get email count in inbox */ getInboxEmailCount(requestParameters: GetInboxEmailCountRequest): Promise; /** * Get a paginated list of emails in an inbox. Does not hold connections open. * @summary Get inbox emails paginated * @param {string} inboxId Id of inbox that emails belongs to * @param {number} [page] Optional page index in inbox emails list pagination * @param {number} [size] Optional page size in inbox emails list pagination * @param {'ASC' | 'DESC'} [sort] Optional createdAt sort direction ASC or DESC * @param {Date} [since] Optional filter by received after given date time * @param {Date} [before] Optional filter by received before given date time * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof InboxControllerApiInterface */ getInboxEmailsPaginatedRaw(requestParameters: GetInboxEmailsPaginatedRequest): Promise>; /** * Get a paginated list of emails in an inbox. Does not hold connections open. * Get inbox emails paginated */ getInboxEmailsPaginated(requestParameters: GetInboxEmailsPaginatedRequest): Promise; /** * Returns an inbox\'s sent email receipts. Call individual sent email endpoints for more details. Note for privacy reasons the full body of sent emails is never stored. An MD5 hash hex is available for comparison instead. * @summary Get Inbox Sent Emails * @param {string} inboxId * @param {number} [page] Optional page index in inbox sent email list pagination * @param {number} [size] Optional page size in inbox sent email list pagination * @param {'ASC' | 'DESC'} [sort] Optional createdAt sort direction ASC or DESC * @param {string} [searchFilter] Optional sent email search * @param {Date} [since] Optional filter by sent after given date time * @param {Date} [before] Optional filter by sent before given date time * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof InboxControllerApiInterface */ getInboxSentEmailsRaw(requestParameters: GetInboxSentEmailsRequest): Promise>; /** * Returns an inbox\'s sent email receipts. Call individual sent email endpoints for more details. Note for privacy reasons the full body of sent emails is never stored. An MD5 hash hex is available for comparison instead. * Get Inbox Sent Emails */ getInboxSentEmails(requestParameters: GetInboxSentEmailsRequest): Promise; /** * Get all inbox tags * @summary Get inbox tags * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof InboxControllerApiInterface */ getInboxTagsRaw(): Promise>>; /** * Get all inbox tags * Get inbox tags */ getInboxTags(): Promise>; /** * List the inboxes you have created. Note use of the more advanced `getAllEmails` is recommended and allows paginated access using a limit and sort parameter. * @summary List Inboxes and email addresses * @param {number} [size] Optional result size limit. Note an automatic limit of 100 results is applied. See the paginated `getAllEmails` for larger queries. * @param {'ASC' | 'DESC'} [sort] Optional createdAt sort direction ASC or DESC * @param {Date} [since] Optional filter by created after given date time * @param {Date} [before] Optional filter by created before given date time * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof InboxControllerApiInterface */ getInboxesRaw(requestParameters: GetInboxesRequest): Promise>>; /** * List the inboxes you have created. Note use of the more advanced `getAllEmails` is recommended and allows paginated access using a limit and sort parameter. * List Inboxes and email addresses */ getInboxes(requestParameters: GetInboxesRequest): Promise>; /** * List organization inboxes in paginated form. These are inboxes created with `allowTeamAccess` flag enabled. Organization inboxes are `readOnly` for non-admin users. The results are available on the `content` property of the returned object. This method allows for page index (zero based), page size (how many results to return), and a sort direction (based on createdAt time). * @summary List Organization Inboxes Paginated * @param {number} [page] Optional page index in list pagination * @param {number} [size] Optional page size in list pagination * @param {'ASC' | 'DESC'} [sort] Optional createdAt sort direction ASC or DESC * @param {string} [searchFilter] Optional search filter * @param {Date} [since] Optional filter by created after given date time * @param {Date} [before] Optional filter by created before given date time * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof InboxControllerApiInterface */ getOrganizationInboxesRaw(requestParameters: GetOrganizationInboxesRequest): Promise>; /** * List organization inboxes in paginated form. These are inboxes created with `allowTeamAccess` flag enabled. Organization inboxes are `readOnly` for non-admin users. The results are available on the `content` property of the returned object. This method allows for page index (zero based), page size (how many results to return), and a sort direction (based on createdAt time). * List Organization Inboxes Paginated */ getOrganizationInboxes(requestParameters: GetOrganizationInboxesRequest): Promise; /** * List all rulesets attached to an inbox * @summary List inbox rulesets * @param {string} inboxId * @param {number} [page] Optional page index in inbox ruleset list pagination * @param {number} [size] Optional page size in inbox ruleset list pagination * @param {'ASC' | 'DESC'} [sort] Optional createdAt sort direction ASC or DESC * @param {string} [searchFilter] Optional search filter * @param {Date} [since] Optional filter by created after given date time * @param {Date} [before] Optional filter by created before given date time * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof InboxControllerApiInterface */ listInboxRulesetsRaw(requestParameters: ListInboxRulesetsRequest): Promise>; /** * List all rulesets attached to an inbox * List inbox rulesets */ listInboxRulesets(requestParameters: ListInboxRulesetsRequest): Promise; /** * List all tracking pixels sent from an inbox * @summary List inbox tracking pixels * @param {string} inboxId * @param {number} [page] Optional page index in inbox tracking pixel list pagination * @param {number} [size] Optional page size in inbox tracking pixel list pagination * @param {'ASC' | 'DESC'} [sort] Optional createdAt sort direction ASC or DESC * @param {string} [searchFilter] Optional search filter * @param {Date} [since] Optional filter by created after given date time * @param {Date} [before] Optional filter by created before given date time * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof InboxControllerApiInterface */ listInboxTrackingPixelsRaw(requestParameters: ListInboxTrackingPixelsRequest): Promise>; /** * List all tracking pixels sent from an inbox * List inbox tracking pixels */ listInboxTrackingPixels(requestParameters: ListInboxTrackingPixelsRequest): Promise; /** * Send an email from an inbox\'s email address. The request body should contain the `SendEmailOptions` that include recipients, attachments, body etc. See `SendEmailOptions` for all available properties. Note the `inboxId` refers to the inbox\'s id not the inbox\'s email address. See https://www.mailslurp.com/guides/ for more information on how to send emails. This method does not return a sent email entity due to legacy reasons. To send and get a sent email as returned response use the sister method `sendEmailAndConfirm`. * @summary Send Email * @param {string} inboxId ID of the inbox you want to send the email from * @param {SendEmailOptions} sendEmailOptions * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof InboxControllerApiInterface */ sendEmailRaw(requestParameters: SendEmailRequest): Promise>; /** * Send an email from an inbox\'s email address. The request body should contain the `SendEmailOptions` that include recipients, attachments, body etc. See `SendEmailOptions` for all available properties. Note the `inboxId` refers to the inbox\'s id not the inbox\'s email address. See https://www.mailslurp.com/guides/ for more information on how to send emails. This method does not return a sent email entity due to legacy reasons. To send and get a sent email as returned response use the sister method `sendEmailAndConfirm`. * Send Email */ sendEmail(requestParameters: SendEmailRequest): Promise; /** * Sister method for standard `sendEmail` method with the benefit of returning a `SentEmail` entity confirming the successful sending of the email with a link to the sent object created for it. * @summary Send email and return sent confirmation * @param {string} inboxId ID of the inbox you want to send the email from * @param {SendEmailOptions} sendEmailOptions * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof InboxControllerApiInterface */ sendEmailAndConfirmRaw(requestParameters: SendEmailAndConfirmRequest): Promise>; /** * Sister method for standard `sendEmail` method with the benefit of returning a `SentEmail` entity confirming the successful sending of the email with a link to the sent object created for it. * Send email and return sent confirmation */ sendEmailAndConfirm(requestParameters: SendEmailAndConfirmRequest): Promise; /** * Send an inbox a test email to test email receiving is working * @summary Send a test email to inbox * @param {string} inboxId * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof InboxControllerApiInterface */ sendTestEmailRaw(requestParameters: SendTestEmailRequest): Promise>; /** * Send an inbox a test email to test email receiving is working * Send a test email to inbox */ sendTestEmail(requestParameters: SendTestEmailRequest): Promise; /** * Set and return new favourite state for an inbox * @summary Set inbox favourited state * @param {string} inboxId * @param {SetInboxFavouritedOptions} setInboxFavouritedOptions * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof InboxControllerApiInterface */ setInboxFavouritedRaw(requestParameters: SetInboxFavouritedRequest): Promise>; /** * Set and return new favourite state for an inbox * Set inbox favourited state */ setInboxFavourited(requestParameters: SetInboxFavouritedRequest): Promise; /** * Update editable fields on an inbox * @summary Update Inbox. Change name and description. Email address is not editable. * @param {string} inboxId * @param {UpdateInboxOptions} updateInboxOptions * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof InboxControllerApiInterface */ updateInboxRaw(requestParameters: UpdateInboxRequest): Promise>; /** * Update editable fields on an inbox * Update Inbox. Change name and description. Email address is not editable. */ updateInbox(requestParameters: UpdateInboxRequest): Promise; } /** * */ export class InboxControllerApi extends runtime.BaseAPI implements InboxControllerApiInterface { /** * Create a new inbox and with a randomized email address to send and receive from. Pass emailAddress parameter if you wish to use a specific email address. Creating an inbox is required before sending or receiving emails. If writing tests it is recommended that you create a new inbox during each test method so that it is unique and empty. * Create an inbox email address. An inbox has a real email address and can send and receive emails. Inboxes can be either `SMTP` or `HTTP` inboxes. */ async createInboxRaw(requestParameters: CreateInboxRequest): Promise> { const queryParameters: runtime.HTTPQuery = {}; if (requestParameters.emailAddress !== undefined) { queryParameters['emailAddress'] = requestParameters.emailAddress; } if (requestParameters.tags) { queryParameters['tags'] = requestParameters.tags; } if (requestParameters.name !== undefined) { queryParameters['name'] = requestParameters.name; } if (requestParameters.description !== undefined) { queryParameters['description'] = requestParameters.description; } if (requestParameters.useDomainPool !== undefined) { queryParameters['useDomainPool'] = requestParameters.useDomainPool; } if (requestParameters.favourite !== undefined) { queryParameters['favourite'] = requestParameters.favourite; } if (requestParameters.expiresAt !== undefined) { queryParameters['expiresAt'] = (requestParameters.expiresAt as any).toISOString(); } if (requestParameters.expiresIn !== undefined) { queryParameters['expiresIn'] = requestParameters.expiresIn; } if (requestParameters.allowTeamAccess !== undefined) { queryParameters['allowTeamAccess'] = requestParameters.allowTeamAccess; } if (requestParameters.inboxType !== undefined) { queryParameters['inboxType'] = requestParameters.inboxType; } const headerParameters: runtime.HTTPHeaders = {}; if (this.configuration && this.configuration.apiKey) { headerParameters["x-api-key"] = this.configuration.apiKey("x-api-key"); // API_KEY authentication } const response = await this.request({ path: `/inboxes`, method: 'POST', headers: headerParameters, query: queryParameters, }); return new runtime.JSONApiResponse(response, (jsonValue) => InboxDtoFromJSON(jsonValue)); } /** * Create a new inbox and with a randomized email address to send and receive from. Pass emailAddress parameter if you wish to use a specific email address. Creating an inbox is required before sending or receiving emails. If writing tests it is recommended that you create a new inbox during each test method so that it is unique and empty. * Create an inbox email address. An inbox has a real email address and can send and receive emails. Inboxes can be either `SMTP` or `HTTP` inboxes. */ async createInbox(requestParameters: CreateInboxRequest): Promise { const response = await this.createInboxRaw(requestParameters); return await response.value(); } /** * Create a new inbox rule for forwarding, blocking, and allowing emails when sending and receiving * Create an inbox ruleset */ async createInboxRulesetRaw(requestParameters: CreateInboxRulesetRequest): Promise> { if (requestParameters.inboxId === null || requestParameters.inboxId === undefined) { throw new runtime.RequiredError('inboxId','Required parameter requestParameters.inboxId was null or undefined when calling createInboxRuleset.'); } if (requestParameters.createInboxRulesetOptions === null || requestParameters.createInboxRulesetOptions === undefined) { throw new runtime.RequiredError('createInboxRulesetOptions','Required parameter requestParameters.createInboxRulesetOptions was null or undefined when calling createInboxRuleset.'); } const queryParameters: runtime.HTTPQuery = {}; const headerParameters: runtime.HTTPHeaders = {}; headerParameters['Content-Type'] = 'application/json'; if (this.configuration && this.configuration.apiKey) { headerParameters["x-api-key"] = this.configuration.apiKey("x-api-key"); // API_KEY authentication } const response = await this.request({ path: `/inboxes/{inboxId}/rulesets`.replace(`{${"inboxId"}}`, encodeURIComponent(String(requestParameters.inboxId))), method: 'POST', headers: headerParameters, query: queryParameters, body: CreateInboxRulesetOptionsToJSON(requestParameters.createInboxRulesetOptions), }); return new runtime.JSONApiResponse(response, (jsonValue) => InboxRulesetDtoFromJSON(jsonValue)); } /** * Create a new inbox rule for forwarding, blocking, and allowing emails when sending and receiving * Create an inbox ruleset */ async createInboxRuleset(requestParameters: CreateInboxRulesetRequest): Promise { const response = await this.createInboxRulesetRaw(requestParameters); return await response.value(); } /** * Create an inbox with default options. Uses MailSlurp domain pool address and is private. */ async createInboxWithDefaultsRaw(): Promise> { const queryParameters: runtime.HTTPQuery = {}; const headerParameters: runtime.HTTPHeaders = {}; if (this.configuration && this.configuration.apiKey) { headerParameters["x-api-key"] = this.configuration.apiKey("x-api-key"); // API_KEY authentication } const response = await this.request({ path: `/inboxes/withDefaults`, method: 'POST', headers: headerParameters, query: queryParameters, }); return new runtime.JSONApiResponse(response, (jsonValue) => InboxDtoFromJSON(jsonValue)); } /** * Create an inbox with default options. Uses MailSlurp domain pool address and is private. */ async createInboxWithDefaults(): Promise { const response = await this.createInboxWithDefaultsRaw(); return await response.value(); } /** * Additional endpoint that allows inbox creation with request body options. Can be more flexible that other methods for some clients. * Create an inbox with options. Extended options for inbox creation. */ async createInboxWithOptionsRaw(requestParameters: CreateInboxWithOptionsRequest): Promise> { if (requestParameters.createInboxDto === null || requestParameters.createInboxDto === undefined) { throw new runtime.RequiredError('createInboxDto','Required parameter requestParameters.createInboxDto was null or undefined when calling createInboxWithOptions.'); } const queryParameters: runtime.HTTPQuery = {}; const headerParameters: runtime.HTTPHeaders = {}; headerParameters['Content-Type'] = 'application/json'; if (this.configuration && this.configuration.apiKey) { headerParameters["x-api-key"] = this.configuration.apiKey("x-api-key"); // API_KEY authentication } const response = await this.request({ path: `/inboxes/withOptions`, method: 'POST', headers: headerParameters, query: queryParameters, body: CreateInboxDtoToJSON(requestParameters.createInboxDto), }); return new runtime.JSONApiResponse(response, (jsonValue) => InboxDtoFromJSON(jsonValue)); } /** * Additional endpoint that allows inbox creation with request body options. Can be more flexible that other methods for some clients. * Create an inbox with options. Extended options for inbox creation. */ async createInboxWithOptions(requestParameters: CreateInboxWithOptionsRequest): Promise { const response = await this.createInboxWithOptionsRaw(requestParameters); return await response.value(); } /** * Permanently delete all inboxes and associated email addresses. This will also delete all emails within the inboxes. Be careful as inboxes cannot be recovered once deleted. Note: deleting inboxes will not impact your usage limits. Monthly inbox creation limits are based on how many inboxes were created in the last 30 days, not how many inboxes you currently have. * Delete all inboxes */ async deleteAllInboxesRaw(): Promise> { const queryParameters: runtime.HTTPQuery = {}; const headerParameters: runtime.HTTPHeaders = {}; if (this.configuration && this.configuration.apiKey) { headerParameters["x-api-key"] = this.configuration.apiKey("x-api-key"); // API_KEY authentication } const response = await this.request({ path: `/inboxes`, method: 'DELETE', headers: headerParameters, query: queryParameters, }); return new runtime.VoidApiResponse(response); } /** * Permanently delete all inboxes and associated email addresses. This will also delete all emails within the inboxes. Be careful as inboxes cannot be recovered once deleted. Note: deleting inboxes will not impact your usage limits. Monthly inbox creation limits are based on how many inboxes were created in the last 30 days, not how many inboxes you currently have. * Delete all inboxes */ async deleteAllInboxes(): Promise { await this.deleteAllInboxesRaw(); } /** * Permanently delete an inbox and associated email address as well as all emails within the given inbox. This action cannot be undone. Note: deleting an inbox will not affect your account usage. Monthly inbox usage is based on how many inboxes you create within 30 days, not how many exist at time of request. * Delete inbox */ async deleteInboxRaw(requestParameters: DeleteInboxRequest): Promise> { if (requestParameters.inboxId === null || requestParameters.inboxId === undefined) { throw new runtime.RequiredError('inboxId','Required parameter requestParameters.inboxId was null or undefined when calling deleteInbox.'); } const queryParameters: runtime.HTTPQuery = {}; const headerParameters: runtime.HTTPHeaders = {}; if (this.configuration && this.configuration.apiKey) { headerParameters["x-api-key"] = this.configuration.apiKey("x-api-key"); // API_KEY authentication } const response = await this.request({ path: `/inboxes/{inboxId}`.replace(`{${"inboxId"}}`, encodeURIComponent(String(requestParameters.inboxId))), method: 'DELETE', headers: headerParameters, query: queryParameters, }); return new runtime.VoidApiResponse(response); } /** * Permanently delete an inbox and associated email address as well as all emails within the given inbox. This action cannot be undone. Note: deleting an inbox will not affect your account usage. Monthly inbox usage is based on how many inboxes you create within 30 days, not how many exist at time of request. * Delete inbox */ async deleteInbox(requestParameters: DeleteInboxRequest): Promise { await this.deleteInboxRaw(requestParameters); } /** * Check if inboxes exist by email address. Useful if you are sending emails to mailslurp addresses * Does inbox exist */ async doesInboxExistRaw(requestParameters: DoesInboxExistRequest): Promise> { if (requestParameters.emailAddress === null || requestParameters.emailAddress === undefined) { throw new runtime.RequiredError('emailAddress','Required parameter requestParameters.emailAddress was null or undefined when calling doesInboxExist.'); } const queryParameters: runtime.HTTPQuery = {}; if (requestParameters.emailAddress !== undefined) { queryParameters['emailAddress'] = requestParameters.emailAddress; } const headerParameters: runtime.HTTPHeaders = {}; if (this.configuration && this.configuration.apiKey) { headerParameters["x-api-key"] = this.configuration.apiKey("x-api-key"); // API_KEY authentication } const response = await this.request({ path: `/inboxes/exists`, method: 'GET', headers: headerParameters, query: queryParameters, }); return new runtime.JSONApiResponse(response, (jsonValue) => InboxExistsDtoFromJSON(jsonValue)); } /** * Check if inboxes exist by email address. Useful if you are sending emails to mailslurp addresses * Does inbox exist */ async doesInboxExist(requestParameters: DoesInboxExistRequest): Promise { const response = await this.doesInboxExistRaw(requestParameters); return await response.value(); } /** * Remove any expired inboxes for your account (instead of waiting for scheduled removal on server) * Remove expired inboxes */ async flushExpiredRaw(requestParameters: FlushExpiredRequest): Promise> { const queryParameters: runtime.HTTPQuery = {}; if (requestParameters.before !== undefined) { queryParameters['before'] = (requestParameters.before as any).toISOString(); } const headerParameters: runtime.HTTPHeaders = {}; if (this.configuration && this.configuration.apiKey) { headerParameters["x-api-key"] = this.configuration.apiKey("x-api-key"); // API_KEY authentication } const response = await this.request({ path: `/inboxes/expired`, method: 'DELETE', headers: headerParameters, query: queryParameters, }); return new runtime.JSONApiResponse(response, (jsonValue) => FlushExpiredInboxesResultFromJSON(jsonValue)); } /** * Remove any expired inboxes for your account (instead of waiting for scheduled removal on server) * Remove expired inboxes */ async flushExpired(requestParameters: FlushExpiredRequest): Promise { const response = await this.flushExpiredRaw(requestParameters); return await response.value(); } /** * List inboxes in paginated form. The results are available on the `content` property of the returned object. This method allows for page index (zero based), page size (how many results to return), and a sort direction (based on createdAt time). You Can also filter by whether an inbox is favorited or use email address pattern. This method is the recommended way to query inboxes. The alternative `getInboxes` method returns a full list of inboxes but is limited to 100 results. * List All Inboxes Paginated */ async getAllInboxesRaw(requestParameters: GetAllInboxesRequest): Promise> { const queryParameters: runtime.HTTPQuery = {}; if (requestParameters.page !== undefined) { queryParameters['page'] = requestParameters.page; } if (requestParameters.size !== undefined) { queryParameters['size'] = requestParameters.size; } if (requestParameters.sort !== undefined) { queryParameters['sort'] = requestParameters.sort; } if (requestParameters.favourite !== undefined) { queryParameters['favourite'] = requestParameters.favourite; } if (requestParameters.search !== undefined) { queryParameters['search'] = requestParameters.search; } if (requestParameters.tag !== undefined) { queryParameters['tag'] = requestParameters.tag; } if (requestParameters.teamAccess !== undefined) { queryParameters['teamAccess'] = requestParameters.teamAccess; } if (requestParameters.since !== undefined) { queryParameters['since'] = (requestParameters.since as any).toISOString(); } if (requestParameters.before !== undefined) { queryParameters['before'] = (requestParameters.before as any).toISOString(); } const headerParameters: runtime.HTTPHeaders = {}; if (this.configuration && this.configuration.apiKey) { headerParameters["x-api-key"] = this.configuration.apiKey("x-api-key"); // API_KEY authentication } const response = await this.request({ path: `/inboxes/paginated`, method: 'GET', headers: headerParameters, query: queryParameters, }); return new runtime.JSONApiResponse(response, (jsonValue) => PageInboxProjectionFromJSON(jsonValue)); } /** * List inboxes in paginated form. The results are available on the `content` property of the returned object. This method allows for page index (zero based), page size (how many results to return), and a sort direction (based on createdAt time). You Can also filter by whether an inbox is favorited or use email address pattern. This method is the recommended way to query inboxes. The alternative `getInboxes` method returns a full list of inboxes but is limited to 100 results. * List All Inboxes Paginated */ async getAllInboxes(requestParameters: GetAllInboxesRequest): Promise { const response = await this.getAllInboxesRaw(requestParameters); return await response.value(); } /** * List emails that an inbox has received. Only emails that are sent to the inbox\'s email address will appear in the inbox. It may take several seconds for any email you send to an inbox\'s email address to appear in the inbox. To make this endpoint wait for a minimum number of emails use the `minCount` parameter. The server will retry the inbox database until the `minCount` is satisfied or the `retryTimeout` is reached * Get emails in an Inbox. This method is not idempotent as it allows retries and waits if you want certain conditions to be met before returning. For simple listing and sorting of known emails use the email controller instead. */ async getEmailsRaw(requestParameters: GetEmailsRequest): Promise>> { if (requestParameters.inboxId === null || requestParameters.inboxId === undefined) { throw new runtime.RequiredError('inboxId','Required parameter requestParameters.inboxId was null or undefined when calling getEmails.'); } const queryParameters: runtime.HTTPQuery = {}; if (requestParameters.size !== undefined) { queryParameters['size'] = requestParameters.size; } if (requestParameters.limit !== undefined) { queryParameters['limit'] = requestParameters.limit; } if (requestParameters.sort !== undefined) { queryParameters['sort'] = requestParameters.sort; } if (requestParameters.retryTimeout !== undefined) { queryParameters['retryTimeout'] = requestParameters.retryTimeout; } if (requestParameters.delayTimeout !== undefined) { queryParameters['delayTimeout'] = requestParameters.delayTimeout; } if (requestParameters.minCount !== undefined) { queryParameters['minCount'] = requestParameters.minCount; } if (requestParameters.unreadOnly !== undefined) { queryParameters['unreadOnly'] = requestParameters.unreadOnly; } if (requestParameters.before !== undefined) { queryParameters['before'] = (requestParameters.before as any).toISOString(); } if (requestParameters.since !== undefined) { queryParameters['since'] = (requestParameters.since as any).toISOString(); } const headerParameters: runtime.HTTPHeaders = {}; if (this.configuration && this.configuration.apiKey) { headerParameters["x-api-key"] = this.configuration.apiKey("x-api-key"); // API_KEY authentication } const response = await this.request({ path: `/inboxes/{inboxId}/emails`.replace(`{${"inboxId"}}`, encodeURIComponent(String(requestParameters.inboxId))), method: 'GET', headers: headerParameters, query: queryParameters, }); return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(EmailPreviewFromJSON)); } /** * List emails that an inbox has received. Only emails that are sent to the inbox\'s email address will appear in the inbox. It may take several seconds for any email you send to an inbox\'s email address to appear in the inbox. To make this endpoint wait for a minimum number of emails use the `minCount` parameter. The server will retry the inbox database until the `minCount` is satisfied or the `retryTimeout` is reached * Get emails in an Inbox. This method is not idempotent as it allows retries and waits if you want certain conditions to be met before returning. For simple listing and sorting of known emails use the email controller instead. */ async getEmails(requestParameters: GetEmailsRequest): Promise> { const response = await this.getEmailsRaw(requestParameters); return await response.value(); } /** * Returns an inbox\'s properties, including its email address and ID. * Get Inbox. Returns properties of an inbox. */ async getInboxRaw(requestParameters: GetInboxRequest): Promise> { if (requestParameters.inboxId === null || requestParameters.inboxId === undefined) { throw new runtime.RequiredError('inboxId','Required parameter requestParameters.inboxId was null or undefined when calling getInbox.'); } const queryParameters: runtime.HTTPQuery = {}; const headerParameters: runtime.HTTPHeaders = {}; if (this.configuration && this.configuration.apiKey) { headerParameters["x-api-key"] = this.configuration.apiKey("x-api-key"); // API_KEY authentication } const response = await this.request({ path: `/inboxes/{inboxId}`.replace(`{${"inboxId"}}`, encodeURIComponent(String(requestParameters.inboxId))), method: 'GET', headers: headerParameters, query: queryParameters, }); return new runtime.JSONApiResponse(response, (jsonValue) => InboxDtoFromJSON(jsonValue)); } /** * Returns an inbox\'s properties, including its email address and ID. * Get Inbox. Returns properties of an inbox. */ async getInbox(requestParameters: GetInboxRequest): Promise { const response = await this.getInboxRaw(requestParameters); return await response.value(); } /** * Get total inbox count */ async getInboxCountRaw(): Promise> { const queryParameters: runtime.HTTPQuery = {}; const headerParameters: runtime.HTTPHeaders = {}; if (this.configuration && this.configuration.apiKey) { headerParameters["x-api-key"] = this.configuration.apiKey("x-api-key"); // API_KEY authentication } const response = await this.request({ path: `/inboxes/count`, method: 'GET', headers: headerParameters, query: queryParameters, }); return new runtime.JSONApiResponse(response, (jsonValue) => CountDtoFromJSON(jsonValue)); } /** * Get total inbox count */ async getInboxCount(): Promise { const response = await this.getInboxCountRaw(); return await response.value(); } /** * Get email count in inbox */ async getInboxEmailCountRaw(requestParameters: GetInboxEmailCountRequest): Promise> { if (requestParameters.inboxId === null || requestParameters.inboxId === undefined) { throw new runtime.RequiredError('inboxId','Required parameter requestParameters.inboxId was null or undefined when calling getInboxEmailCount.'); } const queryParameters: runtime.HTTPQuery = {}; const headerParameters: runtime.HTTPHeaders = {}; if (this.configuration && this.configuration.apiKey) { headerParameters["x-api-key"] = this.configuration.apiKey("x-api-key"); // API_KEY authentication } const response = await this.request({ path: `/inboxes/{inboxId}/emails/count`.replace(`{${"inboxId"}}`, encodeURIComponent(String(requestParameters.inboxId))), method: 'GET', headers: headerParameters, query: queryParameters, }); return new runtime.JSONApiResponse(response, (jsonValue) => CountDtoFromJSON(jsonValue)); } /** * Get email count in inbox */ async getInboxEmailCount(requestParameters: GetInboxEmailCountRequest): Promise { const response = await this.getInboxEmailCountRaw(requestParameters); return await response.value(); } /** * Get a paginated list of emails in an inbox. Does not hold connections open. * Get inbox emails paginated */ async getInboxEmailsPaginatedRaw(requestParameters: GetInboxEmailsPaginatedRequest): Promise> { if (requestParameters.inboxId === null || requestParameters.inboxId === undefined) { throw new runtime.RequiredError('inboxId','Required parameter requestParameters.inboxId was null or undefined when calling getInboxEmailsPaginated.'); } const queryParameters: runtime.HTTPQuery = {}; if (requestParameters.page !== undefined) { queryParameters['page'] = requestParameters.page; } if (requestParameters.size !== undefined) { queryParameters['size'] = requestParameters.size; } if (requestParameters.sort !== undefined) { queryParameters['sort'] = requestParameters.sort; } if (requestParameters.since !== undefined) { queryParameters['since'] = (requestParameters.since as any).toISOString(); } if (requestParameters.before !== undefined) { queryParameters['before'] = (requestParameters.before as any).toISOString(); } const headerParameters: runtime.HTTPHeaders = {}; if (this.configuration && this.configuration.apiKey) { headerParameters["x-api-key"] = this.configuration.apiKey("x-api-key"); // API_KEY authentication } const response = await this.request({ path: `/inboxes/{inboxId}/emails/paginated`.replace(`{${"inboxId"}}`, encodeURIComponent(String(requestParameters.inboxId))), method: 'GET', headers: headerParameters, query: queryParameters, }); return new runtime.JSONApiResponse(response, (jsonValue) => PageEmailPreviewFromJSON(jsonValue)); } /** * Get a paginated list of emails in an inbox. Does not hold connections open. * Get inbox emails paginated */ async getInboxEmailsPaginated(requestParameters: GetInboxEmailsPaginatedRequest): Promise { const response = await this.getInboxEmailsPaginatedRaw(requestParameters); return await response.value(); } /** * Returns an inbox\'s sent email receipts. Call individual sent email endpoints for more details. Note for privacy reasons the full body of sent emails is never stored. An MD5 hash hex is available for comparison instead. * Get Inbox Sent Emails */ async getInboxSentEmailsRaw(requestParameters: GetInboxSentEmailsRequest): Promise> { if (requestParameters.inboxId === null || requestParameters.inboxId === undefined) { throw new runtime.RequiredError('inboxId','Required parameter requestParameters.inboxId was null or undefined when calling getInboxSentEmails.'); } const queryParameters: runtime.HTTPQuery = {}; if (requestParameters.page !== undefined) { queryParameters['page'] = requestParameters.page; } if (requestParameters.size !== undefined) { queryParameters['size'] = requestParameters.size; } if (requestParameters.sort !== undefined) { queryParameters['sort'] = requestParameters.sort; } if (requestParameters.searchFilter !== undefined) { queryParameters['searchFilter'] = requestParameters.searchFilter; } if (requestParameters.since !== undefined) { queryParameters['since'] = (requestParameters.since as any).toISOString(); } if (requestParameters.before !== undefined) { queryParameters['before'] = (requestParameters.before as any).toISOString(); } const headerParameters: runtime.HTTPHeaders = {}; if (this.configuration && this.configuration.apiKey) { headerParameters["x-api-key"] = this.configuration.apiKey("x-api-key"); // API_KEY authentication } const response = await this.request({ path: `/inboxes/{inboxId}/sent`.replace(`{${"inboxId"}}`, encodeURIComponent(String(requestParameters.inboxId))), method: 'GET', headers: headerParameters, query: queryParameters, }); return new runtime.JSONApiResponse(response, (jsonValue) => PageSentEmailProjectionFromJSON(jsonValue)); } /** * Returns an inbox\'s sent email receipts. Call individual sent email endpoints for more details. Note for privacy reasons the full body of sent emails is never stored. An MD5 hash hex is available for comparison instead. * Get Inbox Sent Emails */ async getInboxSentEmails(requestParameters: GetInboxSentEmailsRequest): Promise { const response = await this.getInboxSentEmailsRaw(requestParameters); return await response.value(); } /** * Get all inbox tags * Get inbox tags */ async getInboxTagsRaw(): Promise>> { const queryParameters: runtime.HTTPQuery = {}; const headerParameters: runtime.HTTPHeaders = {}; if (this.configuration && this.configuration.apiKey) { headerParameters["x-api-key"] = this.configuration.apiKey("x-api-key"); // API_KEY authentication } const response = await this.request({ path: `/inboxes/tags`, method: 'GET', headers: headerParameters, query: queryParameters, }); return new runtime.JSONApiResponse(response); } /** * Get all inbox tags * Get inbox tags */ async getInboxTags(): Promise> { const response = await this.getInboxTagsRaw(); return await response.value(); } /** * List the inboxes you have created. Note use of the more advanced `getAllEmails` is recommended and allows paginated access using a limit and sort parameter. * List Inboxes and email addresses */ async getInboxesRaw(requestParameters: GetInboxesRequest): Promise>> { const queryParameters: runtime.HTTPQuery = {}; if (requestParameters.size !== undefined) { queryParameters['size'] = requestParameters.size; } if (requestParameters.sort !== undefined) { queryParameters['sort'] = requestParameters.sort; } if (requestParameters.since !== undefined) { queryParameters['since'] = (requestParameters.since as any).toISOString(); } if (requestParameters.before !== undefined) { queryParameters['before'] = (requestParameters.before as any).toISOString(); } const headerParameters: runtime.HTTPHeaders = {}; if (this.configuration && this.configuration.apiKey) { headerParameters["x-api-key"] = this.configuration.apiKey("x-api-key"); // API_KEY authentication } const response = await this.request({ path: `/inboxes`, method: 'GET', headers: headerParameters, query: queryParameters, }); return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(InboxDtoFromJSON)); } /** * List the inboxes you have created. Note use of the more advanced `getAllEmails` is recommended and allows paginated access using a limit and sort parameter. * List Inboxes and email addresses */ async getInboxes(requestParameters: GetInboxesRequest): Promise> { const response = await this.getInboxesRaw(requestParameters); return await response.value(); } /** * List organization inboxes in paginated form. These are inboxes created with `allowTeamAccess` flag enabled. Organization inboxes are `readOnly` for non-admin users. The results are available on the `content` property of the returned object. This method allows for page index (zero based), page size (how many results to return), and a sort direction (based on createdAt time). * List Organization Inboxes Paginated */ async getOrganizationInboxesRaw(requestParameters: GetOrganizationInboxesRequest): Promise> { const queryParameters: runtime.HTTPQuery = {}; if (requestParameters.page !== undefined) { queryParameters['page'] = requestParameters.page; } if (requestParameters.size !== undefined) { queryParameters['size'] = requestParameters.size; } if (requestParameters.sort !== undefined) { queryParameters['sort'] = requestParameters.sort; } if (requestParameters.searchFilter !== undefined) { queryParameters['searchFilter'] = requestParameters.searchFilter; } if (requestParameters.since !== undefined) { queryParameters['since'] = (requestParameters.since as any).toISOString(); } if (requestParameters.before !== undefined) { queryParameters['before'] = (requestParameters.before as any).toISOString(); } const headerParameters: runtime.HTTPHeaders = {}; if (this.configuration && this.configuration.apiKey) { headerParameters["x-api-key"] = this.configuration.apiKey("x-api-key"); // API_KEY authentication } const response = await this.request({ path: `/inboxes/organization`, method: 'GET', headers: headerParameters, query: queryParameters, }); return new runtime.JSONApiResponse(response, (jsonValue) => PageOrganizationInboxProjectionFromJSON(jsonValue)); } /** * List organization inboxes in paginated form. These are inboxes created with `allowTeamAccess` flag enabled. Organization inboxes are `readOnly` for non-admin users. The results are available on the `content` property of the returned object. This method allows for page index (zero based), page size (how many results to return), and a sort direction (based on createdAt time). * List Organization Inboxes Paginated */ async getOrganizationInboxes(requestParameters: GetOrganizationInboxesRequest): Promise { const response = await this.getOrganizationInboxesRaw(requestParameters); return await response.value(); } /** * List all rulesets attached to an inbox * List inbox rulesets */ async listInboxRulesetsRaw(requestParameters: ListInboxRulesetsRequest): Promise> { if (requestParameters.inboxId === null || requestParameters.inboxId === undefined) { throw new runtime.RequiredError('inboxId','Required parameter requestParameters.inboxId was null or undefined when calling listInboxRulesets.'); } const queryParameters: runtime.HTTPQuery = {}; if (requestParameters.page !== undefined) { queryParameters['page'] = requestParameters.page; } if (requestParameters.size !== undefined) { queryParameters['size'] = requestParameters.size; } if (requestParameters.sort !== undefined) { queryParameters['sort'] = requestParameters.sort; } if (requestParameters.searchFilter !== undefined) { queryParameters['searchFilter'] = requestParameters.searchFilter; } if (requestParameters.since !== undefined) { queryParameters['since'] = (requestParameters.since as any).toISOString(); } if (requestParameters.before !== undefined) { queryParameters['before'] = (requestParameters.before as any).toISOString(); } const headerParameters: runtime.HTTPHeaders = {}; if (this.configuration && this.configuration.apiKey) { headerParameters["x-api-key"] = this.configuration.apiKey("x-api-key"); // API_KEY authentication } const response = await this.request({ path: `/inboxes/{inboxId}/rulesets`.replace(`{${"inboxId"}}`, encodeURIComponent(String(requestParameters.inboxId))), method: 'GET', headers: headerParameters, query: queryParameters, }); return new runtime.JSONApiResponse(response, (jsonValue) => PageInboxRulesetDtoFromJSON(jsonValue)); } /** * List all rulesets attached to an inbox * List inbox rulesets */ async listInboxRulesets(requestParameters: ListInboxRulesetsRequest): Promise { const response = await this.listInboxRulesetsRaw(requestParameters); return await response.value(); } /** * List all tracking pixels sent from an inbox * List inbox tracking pixels */ async listInboxTrackingPixelsRaw(requestParameters: ListInboxTrackingPixelsRequest): Promise> { if (requestParameters.inboxId === null || requestParameters.inboxId === undefined) { throw new runtime.RequiredError('inboxId','Required parameter requestParameters.inboxId was null or undefined when calling listInboxTrackingPixels.'); } const queryParameters: runtime.HTTPQuery = {}; if (requestParameters.page !== undefined) { queryParameters['page'] = requestParameters.page; } if (requestParameters.size !== undefined) { queryParameters['size'] = requestParameters.size; } if (requestParameters.sort !== undefined) { queryParameters['sort'] = requestParameters.sort; } if (requestParameters.searchFilter !== undefined) { queryParameters['searchFilter'] = requestParameters.searchFilter; } if (requestParameters.since !== undefined) { queryParameters['since'] = (requestParameters.since as any).toISOString(); } if (requestParameters.before !== undefined) { queryParameters['before'] = (requestParameters.before as any).toISOString(); } const headerParameters: runtime.HTTPHeaders = {}; if (this.configuration && this.configuration.apiKey) { headerParameters["x-api-key"] = this.configuration.apiKey("x-api-key"); // API_KEY authentication } const response = await this.request({ path: `/inboxes/{inboxId}/tracking-pixels`.replace(`{${"inboxId"}}`, encodeURIComponent(String(requestParameters.inboxId))), method: 'GET', headers: headerParameters, query: queryParameters, }); return new runtime.JSONApiResponse(response, (jsonValue) => PageTrackingPixelProjectionFromJSON(jsonValue)); } /** * List all tracking pixels sent from an inbox * List inbox tracking pixels */ async listInboxTrackingPixels(requestParameters: ListInboxTrackingPixelsRequest): Promise { const response = await this.listInboxTrackingPixelsRaw(requestParameters); return await response.value(); } /** * Send an email from an inbox\'s email address. The request body should contain the `SendEmailOptions` that include recipients, attachments, body etc. See `SendEmailOptions` for all available properties. Note the `inboxId` refers to the inbox\'s id not the inbox\'s email address. See https://www.mailslurp.com/guides/ for more information on how to send emails. This method does not return a sent email entity due to legacy reasons. To send and get a sent email as returned response use the sister method `sendEmailAndConfirm`. * Send Email */ async sendEmailRaw(requestParameters: SendEmailRequest): Promise> { if (requestParameters.inboxId === null || requestParameters.inboxId === undefined) { throw new runtime.RequiredError('inboxId','Required parameter requestParameters.inboxId was null or undefined when calling sendEmail.'); } if (requestParameters.sendEmailOptions === null || requestParameters.sendEmailOptions === undefined) { throw new runtime.RequiredError('sendEmailOptions','Required parameter requestParameters.sendEmailOptions was null or undefined when calling sendEmail.'); } const queryParameters: runtime.HTTPQuery = {}; const headerParameters: runtime.HTTPHeaders = {}; headerParameters['Content-Type'] = 'application/json'; if (this.configuration && this.configuration.apiKey) { headerParameters["x-api-key"] = this.configuration.apiKey("x-api-key"); // API_KEY authentication } const response = await this.request({ path: `/inboxes/{inboxId}`.replace(`{${"inboxId"}}`, encodeURIComponent(String(requestParameters.inboxId))), method: 'POST', headers: headerParameters, query: queryParameters, body: SendEmailOptionsToJSON(requestParameters.sendEmailOptions), }); return new runtime.VoidApiResponse(response); } /** * Send an email from an inbox\'s email address. The request body should contain the `SendEmailOptions` that include recipients, attachments, body etc. See `SendEmailOptions` for all available properties. Note the `inboxId` refers to the inbox\'s id not the inbox\'s email address. See https://www.mailslurp.com/guides/ for more information on how to send emails. This method does not return a sent email entity due to legacy reasons. To send and get a sent email as returned response use the sister method `sendEmailAndConfirm`. * Send Email */ async sendEmail(requestParameters: SendEmailRequest): Promise { await this.sendEmailRaw(requestParameters); } /** * Sister method for standard `sendEmail` method with the benefit of returning a `SentEmail` entity confirming the successful sending of the email with a link to the sent object created for it. * Send email and return sent confirmation */ async sendEmailAndConfirmRaw(requestParameters: SendEmailAndConfirmRequest): Promise> { if (requestParameters.inboxId === null || requestParameters.inboxId === undefined) { throw new runtime.RequiredError('inboxId','Required parameter requestParameters.inboxId was null or undefined when calling sendEmailAndConfirm.'); } if (requestParameters.sendEmailOptions === null || requestParameters.sendEmailOptions === undefined) { throw new runtime.RequiredError('sendEmailOptions','Required parameter requestParameters.sendEmailOptions was null or undefined when calling sendEmailAndConfirm.'); } const queryParameters: runtime.HTTPQuery = {}; const headerParameters: runtime.HTTPHeaders = {}; headerParameters['Content-Type'] = 'application/json'; if (this.configuration && this.configuration.apiKey) { headerParameters["x-api-key"] = this.configuration.apiKey("x-api-key"); // API_KEY authentication } const response = await this.request({ path: `/inboxes/{inboxId}/confirm`.replace(`{${"inboxId"}}`, encodeURIComponent(String(requestParameters.inboxId))), method: 'POST', headers: headerParameters, query: queryParameters, body: SendEmailOptionsToJSON(requestParameters.sendEmailOptions), }); return new runtime.JSONApiResponse(response, (jsonValue) => SentEmailDtoFromJSON(jsonValue)); } /** * Sister method for standard `sendEmail` method with the benefit of returning a `SentEmail` entity confirming the successful sending of the email with a link to the sent object created for it. * Send email and return sent confirmation */ async sendEmailAndConfirm(requestParameters: SendEmailAndConfirmRequest): Promise { const response = await this.sendEmailAndConfirmRaw(requestParameters); return await response.value(); } /** * Send an inbox a test email to test email receiving is working * Send a test email to inbox */ async sendTestEmailRaw(requestParameters: SendTestEmailRequest): Promise> { if (requestParameters.inboxId === null || requestParameters.inboxId === undefined) { throw new runtime.RequiredError('inboxId','Required parameter requestParameters.inboxId was null or undefined when calling sendTestEmail.'); } const queryParameters: runtime.HTTPQuery = {}; const headerParameters: runtime.HTTPHeaders = {}; if (this.configuration && this.configuration.apiKey) { headerParameters["x-api-key"] = this.configuration.apiKey("x-api-key"); // API_KEY authentication } const response = await this.request({ path: `/inboxes/{inboxId}/send-test-email`.replace(`{${"inboxId"}}`, encodeURIComponent(String(requestParameters.inboxId))), method: 'POST', headers: headerParameters, query: queryParameters, }); return new runtime.VoidApiResponse(response); } /** * Send an inbox a test email to test email receiving is working * Send a test email to inbox */ async sendTestEmail(requestParameters: SendTestEmailRequest): Promise { await this.sendTestEmailRaw(requestParameters); } /** * Set and return new favourite state for an inbox * Set inbox favourited state */ async setInboxFavouritedRaw(requestParameters: SetInboxFavouritedRequest): Promise> { if (requestParameters.inboxId === null || requestParameters.inboxId === undefined) { throw new runtime.RequiredError('inboxId','Required parameter requestParameters.inboxId was null or undefined when calling setInboxFavourited.'); } if (requestParameters.setInboxFavouritedOptions === null || requestParameters.setInboxFavouritedOptions === undefined) { throw new runtime.RequiredError('setInboxFavouritedOptions','Required parameter requestParameters.setInboxFavouritedOptions was null or undefined when calling setInboxFavourited.'); } const queryParameters: runtime.HTTPQuery = {}; const headerParameters: runtime.HTTPHeaders = {}; headerParameters['Content-Type'] = 'application/json'; if (this.configuration && this.configuration.apiKey) { headerParameters["x-api-key"] = this.configuration.apiKey("x-api-key"); // API_KEY authentication } const response = await this.request({ path: `/inboxes/{inboxId}/favourite`.replace(`{${"inboxId"}}`, encodeURIComponent(String(requestParameters.inboxId))), method: 'PUT', headers: headerParameters, query: queryParameters, body: SetInboxFavouritedOptionsToJSON(requestParameters.setInboxFavouritedOptions), }); return new runtime.JSONApiResponse(response, (jsonValue) => InboxDtoFromJSON(jsonValue)); } /** * Set and return new favourite state for an inbox * Set inbox favourited state */ async setInboxFavourited(requestParameters: SetInboxFavouritedRequest): Promise { const response = await this.setInboxFavouritedRaw(requestParameters); return await response.value(); } /** * Update editable fields on an inbox * Update Inbox. Change name and description. Email address is not editable. */ async updateInboxRaw(requestParameters: UpdateInboxRequest): Promise> { if (requestParameters.inboxId === null || requestParameters.inboxId === undefined) { throw new runtime.RequiredError('inboxId','Required parameter requestParameters.inboxId was null or undefined when calling updateInbox.'); } if (requestParameters.updateInboxOptions === null || requestParameters.updateInboxOptions === undefined) { throw new runtime.RequiredError('updateInboxOptions','Required parameter requestParameters.updateInboxOptions was null or undefined when calling updateInbox.'); } const queryParameters: runtime.HTTPQuery = {}; const headerParameters: runtime.HTTPHeaders = {}; headerParameters['Content-Type'] = 'application/json'; if (this.configuration && this.configuration.apiKey) { headerParameters["x-api-key"] = this.configuration.apiKey("x-api-key"); // API_KEY authentication } const response = await this.request({ path: `/inboxes/{inboxId}`.replace(`{${"inboxId"}}`, encodeURIComponent(String(requestParameters.inboxId))), method: 'PATCH', headers: headerParameters, query: queryParameters, body: UpdateInboxOptionsToJSON(requestParameters.updateInboxOptions), }); return new runtime.JSONApiResponse(response, (jsonValue) => InboxDtoFromJSON(jsonValue)); } /** * Update editable fields on an inbox * Update Inbox. Change name and description. Email address is not editable. */ async updateInbox(requestParameters: UpdateInboxRequest): Promise { const response = await this.updateInboxRaw(requestParameters); return await response.value(); } } /** * @export * @enum {string} */ export enum CreateInboxInboxTypeEnum { HTTPINBOX = 'HTTP_INBOX', SMTPINBOX = 'SMTP_INBOX' } /** * @export * @enum {string} */ export enum GetAllInboxesSortEnum { ASC = 'ASC', DESC = 'DESC' } /** * @export * @enum {string} */ export enum GetEmailsSortEnum { ASC = 'ASC', DESC = 'DESC' } /** * @export * @enum {string} */ export enum GetInboxEmailsPaginatedSortEnum { ASC = 'ASC', DESC = 'DESC' } /** * @export * @enum {string} */ export enum GetInboxSentEmailsSortEnum { ASC = 'ASC', DESC = 'DESC' } /** * @export * @enum {string} */ export enum GetInboxesSortEnum { ASC = 'ASC', DESC = 'DESC' } /** * @export * @enum {string} */ export enum GetOrganizationInboxesSortEnum { ASC = 'ASC', DESC = 'DESC' } /** * @export * @enum {string} */ export enum ListInboxRulesetsSortEnum { ASC = 'ASC', DESC = 'DESC' } /** * @export * @enum {string} */ export enum ListInboxTrackingPixelsSortEnum { ASC = 'ASC', DESC = 'DESC' }