|
| 1 | + |
| 2 | +package com.bandwidth.voice.bxml.verbs; |
| 3 | + |
| 4 | +import lombok.Builder; |
| 5 | + |
| 6 | +import java.net.URI; |
| 7 | +import javax.xml.bind.annotation.XmlAttribute; |
| 8 | +import javax.xml.bind.annotation.XmlType; |
| 9 | + |
| 10 | +/** |
| 11 | + * The StartRecording verb allows a segment of a call to be recorded while other verbs are executing. |
| 12 | + *<br/> |
| 13 | + * All audio on both sides of the call will be recorded until the call ends or the <StopRecording> verb is used or the <PauseRecording> verb is used. |
| 14 | + */ |
| 15 | +@Builder |
| 16 | +@XmlType(name = StartRecording.TYPE_NAME) |
| 17 | +public class StartRecording implements Verb { |
| 18 | + public static final String TYPE_NAME = "StartRecording"; |
| 19 | + |
| 20 | + /** |
| 21 | + * <i>(optional)</i> URL to send the Record Complete event to once it has ended. Accepts BXML. |
| 22 | + */ |
| 23 | + @XmlAttribute |
| 24 | + private URI recordingAvailableUrl; |
| 25 | + |
| 26 | + /** |
| 27 | + * <i>(optional)</i> The HTTP method to use for the request to recordingAvailableUrl. GET or POST. Default Value is POST. |
| 28 | + */ |
| 29 | + @XmlAttribute |
| 30 | + private Method recordingAvailableMethod; |
| 31 | + |
| 32 | + /** |
| 33 | + * <i>(optional)</i> A custom string that will be sent with this and all future callbacks unless overwritten by a future tag attribute or cleared. |
| 34 | + * <br/> |
| 35 | + * May be cleared by setting tag="" |
| 36 | + * <br/> |
| 37 | + * Max length 256 characters. |
| 38 | + */ |
| 39 | + @XmlAttribute |
| 40 | + private String tag; |
| 41 | + |
| 42 | + /** |
| 43 | + * <i>(optional)</i> The username to send in the HTTP request to recordCompleteUrl or recordingAvailableUrl. If specified, the URLs must be TLS-encrypted (i.e., https). |
| 44 | + */ |
| 45 | + @XmlAttribute |
| 46 | + protected String username; |
| 47 | + |
| 48 | + /** |
| 49 | + * <i>(optional)</i> The password to send in the HTTP request to recordCompleteUrl or recordingAvailableUrl. If specified, the URLs must be TLS-encrypted (i.e., https). |
| 50 | + */ |
| 51 | + @XmlAttribute |
| 52 | + protected String password; |
| 53 | + |
| 54 | + /** |
| 55 | + * <i>(optional)</i> A boolean value indicating whether or not the recording file should separate each side of the call into its own audio channel. Default value is false. true results in two channels. |
| 56 | + */ |
| 57 | + @XmlAttribute |
| 58 | + protected boolean multiChannel; |
| 59 | + |
| 60 | + /** |
| 61 | + * <i>(optional)</i> The audio format that the recording will be saved as: mp3 or wav. Default value is wav. |
| 62 | + */ |
| 63 | + @XmlAttribute |
| 64 | + protected String fileFormat; |
| 65 | + |
| 66 | + public static class StartRecordingBuilder { |
| 67 | + |
| 68 | + /** |
| 69 | + * <b>(required)</b> URL to send the Recording Available event to once it has been processed. Does not accept BXML. |
| 70 | + */ |
| 71 | + public StartRecordingBuilder recordingAvailableUrl(URI uri ){ |
| 72 | + this.recordingAvailableUrl = uri; |
| 73 | + return this; |
| 74 | + } |
| 75 | + |
| 76 | + /** |
| 77 | + * <b>(required)</b> URL to send the Recording Available event to once it has been processed. Does not accept BXML. |
| 78 | + */ |
| 79 | + public StartRecordingBuilder recordingAvailableUrl(String uri){ |
| 80 | + return recordingAvailableUrl(URI.create(uri)); |
| 81 | + } |
| 82 | + |
| 83 | + /** |
| 84 | + * <i>(optional)</i> The HTTP method to use for the request to recordingAvailableUrl. GET or POST. Default Value is POST. |
| 85 | + */ |
| 86 | + public StartRecordingBuilder recordingAvailableMethod(Method method){ |
| 87 | + this.recordingAvailableMethod = method; |
| 88 | + return this; |
| 89 | + } |
| 90 | + |
| 91 | + /** |
| 92 | + * <i>(optional)</i> The HTTP method to use for the request to recordingAvailableUrl. GET or POST. Default Value is POST. Converts String to Method using Method.fromValue(method) |
| 93 | + */ |
| 94 | + public StartRecordingBuilder recordingAvailableMethod(String method){ |
| 95 | + return recordingAvailableMethod(Method.fromValue(method)); |
| 96 | + } |
| 97 | + } |
| 98 | + |
| 99 | +} |
0 commit comments