com.plivo.api.xml.Response Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of plivo-java Show documentation
Show all versions of plivo-java Show documentation
A Java SDK to make voice calls & send SMS using Plivo and to generate Plivo XML
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;
}
}