All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.twilio.twiml.VoiceResponse Maven / Gradle / Ivy

There is a newer version: 10.1.5
Show newest version
/**
 * This code was generated by
 * \ / _    _  _|   _  _
 *  | (_)\/(_)(_|\/| |(/_  v1.0.0
 *       /       /
 */

package com.twilio.twiml;

import com.twilio.twiml.voice.Connect;
import com.twilio.twiml.voice.Dial;
import com.twilio.twiml.voice.Echo;
import com.twilio.twiml.voice.Enqueue;
import com.twilio.twiml.voice.Gather;
import com.twilio.twiml.voice.Hangup;
import com.twilio.twiml.voice.Leave;
import com.twilio.twiml.voice.Pause;
import com.twilio.twiml.voice.Pay;
import com.twilio.twiml.voice.Play;
import com.twilio.twiml.voice.Prompt;
import com.twilio.twiml.voice.Queue;
import com.twilio.twiml.voice.Record;
import com.twilio.twiml.voice.Redirect;
import com.twilio.twiml.voice.Refer;
import com.twilio.twiml.voice.Reject;
import com.twilio.twiml.voice.Say;
import com.twilio.twiml.voice.Sms;
import com.twilio.twiml.voice.Start;
import com.twilio.twiml.voice.Stop;

/**
 * TwiML wrapper for {@code }
 */
public class VoiceResponse extends TwiML {
    /**
     * For XML Serialization/Deserialization
     */
    private VoiceResponse() {
        this(new Builder());
    }

    /**
     * Create a new {@code } element
     */
    private VoiceResponse(Builder b) {
        super("Response", b);
    }

    /**
     * Create a new {@code } element
     */
    public static class Builder extends TwiML.Builder {
        /**
         * Add a child {@code } element
         */
        public Builder connect(Connect connect) {
            this.children.add(connect);
            return this;
        }

        /**
         * Add a child {@code } element
         */
        public Builder dial(Dial dial) {
            this.children.add(dial);
            return this;
        }

        /**
         * Add a child {@code } element
         */
        public Builder echo(Echo echo) {
            this.children.add(echo);
            return this;
        }

        /**
         * Add a child {@code } element
         */
        public Builder enqueue(Enqueue enqueue) {
            this.children.add(enqueue);
            return this;
        }

        /**
         * Add a child {@code } element
         */
        public Builder gather(Gather gather) {
            this.children.add(gather);
            return this;
        }

        /**
         * Add a child {@code } element
         */
        public Builder hangup(Hangup hangup) {
            this.children.add(hangup);
            return this;
        }

        /**
         * Add a child {@code } element
         */
        public Builder leave(Leave leave) {
            this.children.add(leave);
            return this;
        }

        /**
         * Add a child {@code } element
         */
        public Builder pause(Pause pause) {
            this.children.add(pause);
            return this;
        }

        /**
         * Add a child {@code } element
         */
        public Builder play(Play play) {
            this.children.add(play);
            return this;
        }

        /**
         * Add a child {@code } element
         */
        public Builder queue(Queue queue) {
            this.children.add(queue);
            return this;
        }

        /**
         * Add a child {@code } element
         */
        public Builder record(Record record) {
            this.children.add(record);
            return this;
        }

        /**
         * Add a child {@code } element
         */
        public Builder redirect(Redirect redirect) {
            this.children.add(redirect);
            return this;
        }

        /**
         * Add a child {@code } element
         */
        public Builder reject(Reject reject) {
            this.children.add(reject);
            return this;
        }

        /**
         * Add a child {@code } element
         */
        public Builder say(Say say) {
            this.children.add(say);
            return this;
        }

        /**
         * Add a child {@code } element
         */
        public Builder sms(Sms sms) {
            this.children.add(sms);
            return this;
        }

        /**
         * Add a child {@code } element
         */
        public Builder pay(Pay pay) {
            this.children.add(pay);
            return this;
        }

        /**
         * Add a child {@code } element
         */
        public Builder prompt(Prompt prompt) {
            this.children.add(prompt);
            return this;
        }

        /**
         * Add a child {@code } element
         */
        public Builder start(Start start) {
            this.children.add(start);
            return this;
        }

        /**
         * Add a child {@code } element
         */
        public Builder stop(Stop stop) {
            this.children.add(stop);
            return this;
        }

        /**
         * Add a child {@code } element
         */
        public Builder refer(Refer refer) {
            this.children.add(refer);
            return this;
        }

        /**
         * Create and return resulting {@code } element
         */
        public VoiceResponse build() {
            return new VoiceResponse(this);
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy