All files / node-sdk/models/bxml/verbs Transfer.ts

100% Statements 8/8
50% Branches 1/2
100% Functions 3/3
100% Lines 6/6

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 5010x                                                         10x                 3x             10x 3x   10x  
import { NestableVerb } from '../NestableVerb';
import { PhoneNumber } from './PhoneNumber';
import { SipUri } from './SipUri';
 
type NumberEntities = Array<PhoneNumber | SipUri>;
 
export interface TransferAttributes {
    transferCallerId?: string;
    transferCallerDisplayName?: string;
    callTimeout?: number;
    transferCompleteUrl?: string;
    transferCompleteMethod?: string;
    transferCompleteFallbackUrl?: string;
    transferCompleteFallbackMethod?: string;
    username?: string;
    password?: string;
    fallbackUsername?: string;
    fallbackPassword?: string;
    tag?: string;
    diversionTreatment?: string;
    diversionReason?: string;
}
 
/**
 * @export
 * @class Transfer
 * @extends {NestableVerb}
 * Represents a Transfer verb
 */
export class Transfer extends NestableVerb {
    attributes: TransferAttributes;
 
    /**
     * Creates an instance of Transfer
     * @param {TransferAttributes} attributes The attributes to add to the element
     * @param {PhoneNumber | SipUri | NumberEntities} transferTo The number entities to transfer to
     */
    constructor(attributes?: TransferAttributes, transferTo?: PhoneNumber | SipUri | NumberEntities) {
        super('Transfer', undefined, attributes, transferTo);
    }
 
    /**
     * Add a number entity or entities to the transfer
     * @param {PhoneNumber | SipUri | NumberEntities} recipients The number entity or entities to add
     */
    addTransferRecipients(recipients: PhoneNumber | SipUri | NumberEntities): void {
        this.nestedVerbs = this.nestedVerbs.concat(recipients);
    }
}