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.XmlElement; 008import javax.xml.bind.annotation.XmlElements; 009import javax.xml.bind.annotation.XmlRootElement; 010 011@XmlRootElement(name = "GetDigits") 012public class GetDigits extends PlivoXml implements ResponseNestable { 013 014 @XmlAttribute 015 private String action; 016 017 @XmlAttribute 018 private String method; 019 020 @XmlAttribute 021 private Integer timeout; 022 023 @XmlAttribute 024 private Integer digitTimeout; 025 026 @XmlAttribute 027 private String finishOnKey; 028 029 @XmlAttribute 030 private Integer numDigits; 031 032 @XmlAttribute 033 private Integer retries; 034 035 @XmlAttribute 036 private Boolean redirect; 037 038 @XmlAttribute 039 private String validDigits; 040 041 @XmlAttribute 042 private Boolean playBeep; 043 044 @XmlAttribute 045 private String invalidDigitsSound; 046 047 @XmlAttribute 048 private Boolean log; 049 050 @XmlElements({ 051 @XmlElement(name = "Speak", type = Speak.class), 052 @XmlElement(name = "Play", type = Play.class) 053 }) 054 private List<GetDigitsNestable> children = new ArrayList<>(); 055 056 public String action() { 057 return this.action; 058 } 059 060 public String method() { 061 return this.method; 062 } 063 064 public Integer timeout() { 065 return this.timeout; 066 } 067 068 public Integer digitTimeout() { 069 return this.digitTimeout; 070 } 071 072 public String finishOnKey() { 073 return this.finishOnKey; 074 } 075 076 public Integer numDigits() { 077 return this.numDigits; 078 } 079 080 public Integer retries() { 081 return this.retries; 082 } 083 084 public Boolean redirect() { 085 return this.redirect; 086 } 087 088 public String validDigits() { 089 return this.validDigits; 090 } 091 092 public Boolean playBeep() { 093 return this.playBeep; 094 } 095 096 public String invalidDigitsSound() { 097 return this.invalidDigitsSound; 098 } 099 100 public Boolean log() { 101 return this.log; 102 } 103 104 public List<GetDigitsNestable> children() { 105 return this.children; 106 } 107 108 public GetDigits action(final String action) { 109 this.action = action; 110 return this; 111 } 112 113 public GetDigits method(final String method) { 114 this.method = method; 115 return this; 116 } 117 118 public GetDigits timeout(final Integer timeout) { 119 this.timeout = timeout; 120 return this; 121 } 122 123 public GetDigits digitTimeout(final Integer digitTimeout) { 124 this.digitTimeout = digitTimeout; 125 return this; 126 } 127 128 public GetDigits finishOnKey(final String finishOnKey) { 129 this.finishOnKey = finishOnKey; 130 return this; 131 } 132 133 public GetDigits numDigits(final Integer numDigits) { 134 this.numDigits = numDigits; 135 return this; 136 } 137 138 public GetDigits retries(final Integer retries) { 139 this.retries = retries; 140 return this; 141 } 142 143 public GetDigits redirect(final Boolean redirect) { 144 this.redirect = redirect; 145 return this; 146 } 147 148 public GetDigits validDigits(final String validDigits) { 149 this.validDigits = validDigits; 150 return this; 151 } 152 153 public GetDigits playBeep(final Boolean playBeep) { 154 this.playBeep = playBeep; 155 return this; 156 } 157 158 public GetDigits invalidDigitsSound(final String invalidDigitsSound) { 159 this.invalidDigitsSound = invalidDigitsSound; 160 return this; 161 } 162 163 public GetDigits log(final Boolean log) { 164 this.log = log; 165 return this; 166 } 167 168 public GetDigits children(GetDigitsNestable... children) { 169 this.children.addAll(Arrays.asList(children)); 170 return this; 171 } 172}