
com.twilio.twiml.fax.Receive Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of twilio Show documentation
Show all versions of twilio Show documentation
Twilio Java Helper Library
/**
* This code was generated by
* \ / _ _ _| _ _
* | (_)\/(_)(_|\/| |(/_ v1.0.0
* / /
*/
package com.twilio.twiml.fax;
import com.twilio.converter.Promoter;
import com.twilio.http.HttpMethod;
import com.twilio.twiml.TwiML;
import java.net.URI;
import java.util.HashMap;
import java.util.Map;
/**
* TwiML wrapper for {@code }
*/
public class Receive extends TwiML {
private final URI action;
private final HttpMethod method;
/**
* For XML Serialization/Deserialization
*/
private Receive() {
this(new Builder());
}
/**
* Create a new {@code } element
*/
private Receive(Builder b) {
super("Receive", b);
this.action = b.action;
this.method = b.method;
}
/**
* Attributes to set on the generated XML element
*
* @return A Map of attribute keys to values
*/
protected Map getElementAttributes() {
// Preserve order of attributes
Map attrs = new HashMap<>();
if (this.getAction() != null) {
attrs.put("action", this.getAction().toString());
}
if (this.getMethod() != null) {
attrs.put("method", this.getMethod().toString());
}
return attrs;
}
/**
* Receive action URL
*
* @return Receive action URL
*/
public URI getAction() {
return action;
}
/**
* Receive action URL method
*
* @return Receive action URL method
*/
public HttpMethod getMethod() {
return method;
}
/**
* Create a new {@code } element
*/
public static class Builder extends TwiML.Builder {
private URI action;
private HttpMethod method;
/**
* Receive action URL
*/
public Builder action(URI action) {
this.action = action;
return this;
}
/**
* Receive action URL
*/
public Builder action(String action) {
this.action = Promoter.uriFromString(action);
return this;
}
/**
* Receive action URL method
*/
public Builder method(HttpMethod method) {
this.method = method;
return this;
}
/**
* Create and return resulting {@code } element
*/
public Receive build() {
return new Receive(this);
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy