001package com.plivo.api.xml; 002 003import java.util.ArrayList; 004import java.util.Arrays; 005import java.util.List; 006import javax.xml.bind.annotation.XmlAttribute; 007import javax.xml.bind.annotation.XmlElements; 008import javax.xml.bind.annotation.XmlRootElement; 009 010@XmlRootElement(name = "Dial") 011public class Dial extends PlivoXml implements ResponseNestable { 012 013 @XmlAttribute 014 private String action; 015 016 @XmlAttribute 017 private String method; 018 019 @XmlAttribute 020 private Boolean hangupOnStar; 021 022 @XmlAttribute 023 private Integer timeLimit; 024 025 @XmlAttribute 026 private Integer timeout; 027 028 @XmlAttribute 029 private String callerId; 030 031 @XmlAttribute 032 private String callerName; 033 034 @XmlAttribute 035 private String confirmSound; 036 037 @XmlAttribute 038 private String confirmTimeout; 039 040 @XmlAttribute 041 private String confirmKey; 042 043 @XmlAttribute 044 private String dialMusic; 045 046 @XmlAttribute 047 private String callbackUrl; 048 049 @XmlAttribute 050 private String callbackMethod; 051 052 @XmlAttribute 053 private Boolean redirect; 054 055 @XmlAttribute 056 private String digitsMatch; 057 058 @XmlAttribute 059 private String digitsMatchBLeg; 060 061 @XmlAttribute 062 private String sipHeaders; 063 064 public String action() { 065 return this.action; 066 } 067 068 public String method() { 069 return this.method; 070 } 071 072 public Boolean hangupOnStar() { 073 return this.hangupOnStar; 074 } 075 076 public Integer timeLimit() { 077 return this.timeLimit; 078 } 079 080 public Integer timeout() { 081 return this.timeout; 082 } 083 084 public String callerId() { 085 return this.callerId; 086 } 087 088 public String callerName() { 089 return this.callerName; 090 } 091 092 public String confirmSound() { 093 return this.confirmSound; 094 } 095 096 public String confirmTimeout() { 097 return this.confirmTimeout; 098 } 099 100 public String confirmKey() { 101 return this.confirmKey; 102 } 103 104 public String dialMusic() { 105 return this.dialMusic; 106 } 107 108 public String callbackUrl() { 109 return this.callbackUrl; 110 } 111 112 public String callbackMethod() { 113 return this.callbackMethod; 114 } 115 116 public Boolean redirect() { 117 return this.redirect; 118 } 119 120 public String digitsMatch() { 121 return this.digitsMatch; 122 } 123 124 public String digitsMatchBLeg() { 125 return this.digitsMatchBLeg; 126 } 127 128 public String sipHeaders() { 129 return this.sipHeaders; 130 } 131 132 public List<DialNestable> children() { 133 return this.children; 134 } 135 136 public Dial action(final String action) { 137 this.action = action; 138 return this; 139 } 140 141 public Dial method(final String method) { 142 this.method = method; 143 return this; 144 } 145 146 public Dial hangupOnStar(final Boolean hangupOnStar) { 147 this.hangupOnStar = hangupOnStar; 148 return this; 149 } 150 151 public Dial timeLimit(final Integer timeLimit) { 152 this.timeLimit = timeLimit; 153 return this; 154 } 155 156 public Dial timeout(final Integer timeout) { 157 this.timeout = timeout; 158 return this; 159 } 160 161 public Dial callerId(final String callerId) { 162 this.callerId = callerId; 163 return this; 164 } 165 166 public Dial callerName(final String callerName) { 167 this.callerName = callerName; 168 return this; 169 } 170 171 public Dial confirmSound(final String confirmSound) { 172 this.confirmSound = confirmSound; 173 return this; 174 } 175 176 public Dial confirmTimeout(final String confirmTimeout) { 177 this.confirmTimeout = confirmTimeout; 178 return this; 179 } 180 181 public Dial confirmKey(final String confirmKey) { 182 this.confirmKey = confirmKey; 183 return this; 184 } 185 186 public Dial dialMusic(final String dialMusic) { 187 this.dialMusic = dialMusic; 188 return this; 189 } 190 191 public Dial callbackUrl(final String callbackUrl) { 192 this.callbackUrl = callbackUrl; 193 return this; 194 } 195 196 public Dial callbackMethod(final String callbackMethod) { 197 this.callbackMethod = callbackMethod; 198 return this; 199 } 200 201 public Dial redirect(final Boolean redirect) { 202 this.redirect = redirect; 203 return this; 204 } 205 206 public Dial digitsMatch(final String digitsMatch) { 207 this.digitsMatch = digitsMatch; 208 return this; 209 } 210 211 public Dial digitsMatchBLeg(final String digitsMatchBLeg) { 212 this.digitsMatchBLeg = digitsMatchBLeg; 213 return this; 214 } 215 216 public Dial sipHeaders(final String sipHeaders) { 217 this.sipHeaders = sipHeaders; 218 return this; 219 } 220 221 public Dial children(final List<DialNestable> children) { 222 this.children = children; 223 return this; 224 } 225 226 227 @XmlElements({ 228 @javax.xml.bind.annotation.XmlElement(name = "Number", type = Number.class), 229 @javax.xml.bind.annotation.XmlElement(name = "User", type = User.class) 230 }) 231 private List<DialNestable> children = new ArrayList<>(); 232 233 public Dial children(DialNestable... nestables) { 234 children.addAll(Arrays.asList(nestables)); 235 return this; 236 } 237}