# Class: WaitForControllerApi

WaitForControllerApi - object-oriented interface

export

class WaitForControllerApi

extends {BaseAPI}

# Hierarchy

# Constructors

# constructor

+ new WaitForControllerApi(configuration?: Configuration, basePath: string, fetch: FetchAPI): WaitForControllerApi

Inherited from BaseAPI.constructor

Defined in src/generated/api.ts:57

Parameters:

Name Type Default
configuration? Configuration -
basePath string BASE_PATH
fetch FetchAPI portableFetch

Returns: WaitForControllerApi

# Properties

# Protected basePath

basePath: string

Inherited from BaseAPI.basePath

Defined in src/generated/api.ts:61


# Protected configuration

configuration: Configuration

Inherited from BaseAPI.configuration

Defined in src/generated/api.ts:57


# Protected fetch

fetch: FetchAPI

Inherited from BaseAPI.fetch

Defined in src/generated/api.ts:62

# Methods

# waitFor

waitFor(waitForConditions?: WaitForConditions, options?: any): Promise‹EmailPreview[]›

Defined in src/generated/api.ts:11896

Generic waitFor method that will wait until an inbox meets given conditions or return immediately if already met

summary Wait for conditions to be met

throws {RequiredError}

memberof WaitForControllerApi

Parameters:

Name Type
waitForConditions? WaitForConditions
options? any

Returns: Promise‹EmailPreview[]›


# waitForEmailCount

waitForEmailCount(count?: number, inboxId?: string, timeout?: number, unreadOnly?: boolean, options?: any): Promise‹EmailPreview[]›

Defined in src/generated/api.ts:11914

If inbox contains count or more emails at time of request then return count worth of emails. If not wait until the count is reached and return those or return an error if timeout is exceeded.

summary Wait for and return count number of emails

throws {RequiredError}

memberof WaitForControllerApi

Parameters:

Name Type
count? number
inboxId? string
timeout? number
unreadOnly? boolean
options? any

Returns: Promise‹EmailPreview[]›


# waitForLatestEmail

waitForLatestEmail(inboxId?: string, timeout?: number, unreadOnly?: boolean, options?: any): Promise‹Email

Defined in src/generated/api.ts:11940

Will return either the last received email or wait for an email to arrive and return that. If you need to wait for an email for a non-empty inbox see the other receive methods such as waitForNthEmail or waitForEmailCount.

summary Fetch inbox's latest email or if empty wait for an email to arrive

throws {RequiredError}

memberof WaitForControllerApi

Parameters:

Name Type
inboxId? string
timeout? number
unreadOnly? boolean
options? any

Returns: Promise‹Email


# waitForMatchingEmail

waitForMatchingEmail(matchOptions: MatchOptions, count?: number, inboxId?: string, timeout?: number, unreadOnly?: boolean, options?: any): Promise‹EmailPreview[]›

Defined in src/generated/api.ts:11966

Perform a search of emails in an inbox with the given patterns. If results match expected count then return or else retry the search until results are found or timeout is reached. Match options allow simple CONTAINS or EQUALS filtering on SUBJECT, TO, BCC, CC, and FROM. See the MatchOptions object for options.

summary Wait or return list of emails that match simple matching patterns

throws {RequiredError}

memberof WaitForControllerApi

Parameters:

Name Type Description
matchOptions MatchOptions matchOptions
count? number -
inboxId? string -
timeout? number -
unreadOnly? boolean -
options? any -

Returns: Promise‹EmailPreview[]›


# waitForNthEmail

waitForNthEmail(inboxId?: string, index?: number, timeout?: number, unreadOnly?: boolean, options?: any): Promise‹Email

Defined in src/generated/api.ts:11995

If nth email is already present in inbox then return it. If not hold the connection open until timeout expires or the nth email is received and returned.

summary Wait for or fetch the email with a given index in the inbox specified

throws {RequiredError}

memberof WaitForControllerApi

Parameters:

Name Type
inboxId? string
index? number
timeout? number
unreadOnly? boolean
options? any

Returns: Promise‹Email