com.bandwidth.voice.bxml.verbs.Record Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of bandwidth-sdk Show documentation
Show all versions of bandwidth-sdk Show documentation
The official client SDK for Bandwidth's Voice, Messaging, MFA, and WebRTC APIs
package com.bandwidth.voice.bxml.verbs;
import lombok.Builder;
import java.net.URI;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlType;
/**
* The Record verb is used to Record the current XML execution to another URL.
*/
@Builder
@XmlType(name = Record.TYPE_NAME)
public class Record implements Verb {
public static final String TYPE_NAME = "Record";
/**
* (optional) A boolean value. If true, the recording will be submitted for transcription upon completion. Defaults to false.
*/
@XmlAttribute
private boolean transcribe;
/**
* (optional) Length of silence after which to end the recording (in seconds).
* Max is equivalent to the maximum maxDuration value. Default value is 0, which
* means no timeout.
*/
@XmlAttribute
private Integer silenceTimeout;
/**
* (optional) URL to send the transcriptionAvailable event to.
*/
@XmlAttribute
private URI transcriptionAvailableUrl;
/**
* (optional) The HTTP method to use for the request to transcriptionAvailableUrl. GET or POST. Default Value is POST.
*/
@XmlAttribute
private Method transcriptionAvailableMethod;
/**
* (optional) URL to send the Record Complete event to once it has ended. Accepts BXML.
*/
@XmlAttribute
private URI recordCompleteUrl;
/**
* (optional) The HTTP method to use for the request to recordCompleteUrl. GET or POST. Default Value is POST.
*/
@XmlAttribute
private Method recordCompleteMethod;
/**
* (optional) URL to send the Record Complete event to once it has ended. Accepts BXML.
*/
@XmlAttribute
private URI recordingAvailableUrl;
/**
* (optional) The HTTP method to use for the request to recordingAvailableUrl. GET or POST. Default Value is POST.
*/
@XmlAttribute
private Method recordingAvailableMethod;
/**
* (optional) A custom string that will be sent with this and all future callbacks unless overwritten by a future tag attribute or cleared.
*
* May be cleared by setting tag=""
*
* Max length 256 characters.
*/
@XmlAttribute
private String tag;
/**
* (optional) The username to send in the HTTP request to recordCompleteUrl or recordingAvailableUrl. If specified, the URLs must be TLS-encrypted (i.e., https).
*/
@XmlAttribute
protected String username;
/**
* (optional) The password to send in the HTTP request to recordCompleteUrl or recordingAvailableUrl. If specified, the URLs must be TLS-encrypted (i.e., https).
*/
@XmlAttribute
protected String password;
/**
* (optional) When pressed, this digit will terminate the recording. Default value is “#”.
*/
@XmlAttribute
protected String terminatingDigits;
/**
* (optional) Maximum length of recording (in seconds). Max 10800 (3 hours). Default value is 60.
*/
@XmlAttribute
protected Integer maxDuration;
/**
* (optional) The audio format that the recording will be saved as: mp3 or wav. Default value is wav.
*/
@XmlAttribute
protected String fileFormat;
@XmlAttribute
protected String fallbackUsername;
@XmlAttribute
protected String fallbackPassword;
@XmlAttribute
protected URI recordCompleteFallbackUrl;
@XmlAttribute
protected Method recordCompleteFallbackMethod;
public static class RecordBuilder {
/**
* (required) URL to send the transcriptionAvailable event to.
*/
public RecordBuilder transcriptionAvailableUrl(URI uri ){
this.transcriptionAvailableUrl = uri;
return this;
}
/**
* (required) URL to send the transcriptionAvailable event to.
*/
public RecordBuilder transcriptionAvailableUrl(String uri){
return transcriptionAvailableUrl(URI.create(uri));
}
public RecordBuilder recordCompleteFallbackUrl(URI uri ){
this.recordCompleteFallbackUrl = uri;
return this;
}
public RecordBuilder recordCompleteFallbackUrl(String uri){
return recordCompleteFallbackUrl(URI.create(uri));
}
/**
* (optional) The HTTP method to use for the request to transcriptionAvailableUrl. GET or POST. Default Value is POST.
*/
public RecordBuilder transcriptionAvailableMethod(Method method){
this.transcriptionAvailableMethod = method;
return this;
}
/**
* (optional) The HTTP method to use for the request to transcriptionAvailableUrl. GET or POST. Default Value is POST. Converts String to Method using Method.fromValue(method)
*/
public RecordBuilder transcriptionAvailableMethod(String method){
return transcriptionAvailableMethod(Method.fromValue(method));
}
public RecordBuilder recordCompleteFallbackMethod(Method method){
this.recordCompleteFallbackMethod = method;
return this;
}
public RecordBuilder recordCompleteFallbackMethod(String method){
return recordCompleteFallbackMethod(Method.fromValue(method));
}
/**
* (required) URL to send the Record Complete event to once it has ended. Accepts BXML.
*/
public RecordBuilder recordCompleteUrl(URI uri ){
this.recordCompleteUrl = uri;
return this;
}
/**
* (required) URL to request new BXML from. A Record event will be sent to this endpoint. Converts to URI using URI.create(url)
*/
public RecordBuilder recordCompleteUrl(String uri){
return recordCompleteUrl(URI.create(uri));
}
/**
* (optional) The HTTP method to use for the request to recordCompleteUrl. GET or POST. Default Value is POST.
*/
public RecordBuilder recordCompleteMethod(Method method){
this.recordCompleteMethod = method;
return this;
}
/**
* (optional) The HTTP method to use for the request to recordCompleteUrl. GET or POST. Default Value is POST. Converts String to Method using Method.fromValue(method)
*/
public RecordBuilder recordCompleteMethod(String method){
return recordCompleteMethod(Method.fromValue(method));
}
/**
* (required) URL to send the Recording Available event to once it has been processed. Does not accept BXML.
*/
public RecordBuilder recordingAvailableUrl(URI uri ){
this.recordingAvailableUrl = uri;
return this;
}
/**
* (required) URL to send the Recording Available event to once it has been processed. Does not accept BXML.
*/
public RecordBuilder recordingAvailableUrl(String uri){
return recordingAvailableUrl(URI.create(uri));
}
/**
* (optional) The HTTP method to use for the request to recordingAvailableUrl. GET or POST. Default Value is POST.
*/
public RecordBuilder recordingAvailableMethod(Method method){
this.recordingAvailableMethod = method;
return this;
}
/**
* (optional) 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)
*/
public RecordBuilder recordingAvailableMethod(String method){
return recordingAvailableMethod(Method.fromValue(method));
}
}
}