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

com.plivo.api.xml.Response Maven / Gradle / Ivy

Go to download

A Java SDK to make voice calls & send SMS using Plivo and to generate Plivo XML

There is a newer version: 5.44.3
Show newest version
package com.plivo.api.xml;

import com.plivo.api.exceptions.PlivoValidationException;
import com.plivo.api.validators.Validate;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlElements;
import javax.xml.bind.annotation.XmlRootElement;

@XmlRootElement(name = "Response")
public class Response extends PlivoXml {

    @XmlElements({
            @XmlElement(name = "Wait", type = Wait.class),
            @XmlElement(name = "Dial", type = Dial.class),
            @XmlElement(name = "Conference", type = Conference.class),
            @XmlElement(name = "MultiPartyCall", type = MultiPartyCall.class),
            @XmlElement(name = "Message", type = Message.class),
            @XmlElement(name = "Play", type = Play.class),
            @XmlElement(name = "Speak", type = Speak.class),
            @XmlElement(name = "DTMF", type = Dtmf.class),
            @XmlElement(name = "PreAnswer", type = PreAnswer.class),
            @XmlElement(name = "Hangup", type = Hangup.class),
            @XmlElement(name = "Redirect", type = Redirect.class),
            @XmlElement(name = "GetDigits", type = GetDigits.class),
            @XmlElement(name = "GetInput", type = GetInput.class),
            @XmlElement(name = "Record", type = Record.class),
            @XmlElement(name = "Stream", type = Stream.class),
    })
    private List children = new ArrayList<>();

    public Response children(ResponseNestable... nestable) throws PlivoValidationException {
    for(ResponseNestable n: nestable){
      Validate.check(n);
    }
        children.addAll(Arrays.asList(nestable));
        return this;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy