UNPKG

@vonage/voice

Version:

The Voice API lets you create outbound calls, control in-progress calls and get information about historical calls.

41 lines (39 loc) 846 B
// lib/classes/NCCO/Wait.ts var Wait = class { /** * The action type for this NCCO action. */ action = "wait" /* WAIT */; /** * The duration in seconds to pause execution (optional). */ timeout; /** * Creates a new Wait action. * * @param {number} [timeout] - The duration in seconds to pause execution. * Valid values range from `0.1` to `7200`. Defaults to `10`. */ constructor(timeout) { if (timeout !== void 0) { this.timeout = timeout; } } /** * Serializes the Wait action to a Nexmo Call Control Object (NCCO). * * @return {WaitAction} - The serialized Wait action. */ serializeToNCCO() { const data = { action: "wait" /* WAIT */ }; if (this.timeout !== void 0) { data.timeout = this.timeout; } return data; } }; export { Wait };