com.bandwidth.voice.models.MachineDetectionConfiguration 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
/*
* BandwidthLib
*
* This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ).
*/
package com.bandwidth.voice.models;
import com.bandwidth.internal.OptionalNullable;
import com.fasterxml.jackson.annotation.JsonGetter;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonSetter;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
/**
* This is a model class for MachineDetectionConfiguration type.
*/
public class MachineDetectionConfiguration {
@JsonInclude(JsonInclude.Include.NON_NULL)
private ModeEnum mode;
@JsonInclude(JsonInclude.Include.NON_NULL)
private Double detectionTimeout;
@JsonInclude(JsonInclude.Include.NON_NULL)
private Double silenceTimeout;
@JsonInclude(JsonInclude.Include.NON_NULL)
private Double speechThreshold;
@JsonInclude(JsonInclude.Include.NON_NULL)
private Double speechEndThreshold;
@JsonInclude(JsonInclude.Include.NON_NULL)
private Boolean delayResult;
@JsonInclude(JsonInclude.Include.NON_NULL)
private OptionalNullable callbackUrl;
@JsonInclude(JsonInclude.Include.NON_NULL)
private OptionalNullable callbackMethod;
@JsonInclude(JsonInclude.Include.NON_NULL)
private OptionalNullable fallbackUrl;
@JsonInclude(JsonInclude.Include.NON_NULL)
private OptionalNullable fallbackMethod;
@JsonInclude(JsonInclude.Include.NON_NULL)
private OptionalNullable username;
@JsonInclude(JsonInclude.Include.NON_NULL)
private OptionalNullable password;
@JsonInclude(JsonInclude.Include.NON_NULL)
private OptionalNullable fallbackUsername;
@JsonInclude(JsonInclude.Include.NON_NULL)
private OptionalNullable fallbackPassword;
/**
* Default constructor.
*/
public MachineDetectionConfiguration() {
}
/**
* Initialization constructor.
* @param mode ModeEnum value for mode.
* @param detectionTimeout Double value for detectionTimeout.
* @param silenceTimeout Double value for silenceTimeout.
* @param speechThreshold Double value for speechThreshold.
* @param speechEndThreshold Double value for speechEndThreshold.
* @param delayResult Boolean value for delayResult.
* @param callbackUrl String value for callbackUrl.
* @param callbackMethod CallbackMethodEnum value for callbackMethod.
* @param fallbackUrl String value for fallbackUrl.
* @param fallbackMethod FallbackMethodEnum value for fallbackMethod.
* @param username String value for username.
* @param password String value for password.
* @param fallbackUsername String value for fallbackUsername.
* @param fallbackPassword String value for fallbackPassword.
*/
public MachineDetectionConfiguration(
ModeEnum mode,
Double detectionTimeout,
Double silenceTimeout,
Double speechThreshold,
Double speechEndThreshold,
Boolean delayResult,
String callbackUrl,
CallbackMethodEnum callbackMethod,
String fallbackUrl,
FallbackMethodEnum fallbackMethod,
String username,
String password,
String fallbackUsername,
String fallbackPassword) {
this.mode = mode;
this.detectionTimeout = detectionTimeout;
this.silenceTimeout = silenceTimeout;
this.speechThreshold = speechThreshold;
this.speechEndThreshold = speechEndThreshold;
this.delayResult = delayResult;
this.callbackUrl = OptionalNullable.of(callbackUrl);
this.callbackMethod = OptionalNullable.of(callbackMethod);
this.fallbackUrl = OptionalNullable.of(fallbackUrl);
this.fallbackMethod = OptionalNullable.of(fallbackMethod);
this.username = OptionalNullable.of(username);
this.password = OptionalNullable.of(password);
this.fallbackUsername = OptionalNullable.of(fallbackUsername);
this.fallbackPassword = OptionalNullable.of(fallbackPassword);
}
/**
* Internal initialization constructor.
*/
protected MachineDetectionConfiguration(ModeEnum mode, Double detectionTimeout, Double silenceTimeout,
Double speechThreshold, Double speechEndThreshold, Boolean delayResult,
OptionalNullable callbackUrl,
OptionalNullable callbackMethod,
OptionalNullable fallbackUrl,
OptionalNullable fallbackMethod, OptionalNullable username,
OptionalNullable password, OptionalNullable fallbackUsername,
OptionalNullable fallbackPassword) {
this.mode = mode;
this.detectionTimeout = detectionTimeout;
this.silenceTimeout = silenceTimeout;
this.speechThreshold = speechThreshold;
this.speechEndThreshold = speechEndThreshold;
this.delayResult = delayResult;
this.callbackUrl = callbackUrl;
this.callbackMethod = callbackMethod;
this.fallbackUrl = fallbackUrl;
this.fallbackMethod = fallbackMethod;
this.username = username;
this.password = password;
this.fallbackUsername = fallbackUsername;
this.fallbackPassword = fallbackPassword;
}
/**
* Getter for Mode.
* The machine detection mode. If set to 'async', the detection result will be sent in a
* 'machineDetectionComplete' callback. If set to 'sync', the 'answer' callback will wait for
* the machine detection to complete and will include its result. Default is 'async'.
* @return Returns the ModeEnum
*/
@JsonGetter("mode")
public ModeEnum getMode() {
return mode;
}
/**
* Setter for Mode.
* The machine detection mode. If set to 'async', the detection result will be sent in a
* 'machineDetectionComplete' callback. If set to 'sync', the 'answer' callback will wait for
* the machine detection to complete and will include its result. Default is 'async'.
* @param mode Value for ModeEnum
*/
@JsonSetter("mode")
public void setMode(ModeEnum mode) {
this.mode = mode;
}
/**
* Getter for DetectionTimeout.
* Total amount of time (in seconds) before giving up.
* @return Returns the Double
*/
@JsonGetter("detectionTimeout")
public Double getDetectionTimeout() {
return detectionTimeout;
}
/**
* Setter for DetectionTimeout.
* Total amount of time (in seconds) before giving up.
* @param detectionTimeout Value for Double
*/
@JsonSetter("detectionTimeout")
public void setDetectionTimeout(Double detectionTimeout) {
this.detectionTimeout = detectionTimeout;
}
/**
* Getter for SilenceTimeout.
* If no speech is detected in this period, a callback with a 'silence' result is sent. Default
* is 10 seconds.
* @return Returns the Double
*/
@JsonGetter("silenceTimeout")
public Double getSilenceTimeout() {
return silenceTimeout;
}
/**
* Setter for SilenceTimeout.
* If no speech is detected in this period, a callback with a 'silence' result is sent. Default
* is 10 seconds.
* @param silenceTimeout Value for Double
*/
@JsonSetter("silenceTimeout")
public void setSilenceTimeout(Double silenceTimeout) {
this.silenceTimeout = silenceTimeout;
}
/**
* Getter for SpeechThreshold.
* When speech has ended and a result couldn't be determined based on the audio content itself,
* this value is used to determine if the speaker is a machine based on the speech duration. If
* the length of the speech detected is greater than or equal to this threshold, the result will
* be 'answering-machine'. If the length of speech detected is below this threshold, the result
* will be 'human'. Default is 10 seconds.
* @return Returns the Double
*/
@JsonGetter("speechThreshold")
public Double getSpeechThreshold() {
return speechThreshold;
}
/**
* Setter for SpeechThreshold.
* When speech has ended and a result couldn't be determined based on the audio content itself,
* this value is used to determine if the speaker is a machine based on the speech duration. If
* the length of the speech detected is greater than or equal to this threshold, the result will
* be 'answering-machine'. If the length of speech detected is below this threshold, the result
* will be 'human'. Default is 10 seconds.
* @param speechThreshold Value for Double
*/
@JsonSetter("speechThreshold")
public void setSpeechThreshold(Double speechThreshold) {
this.speechThreshold = speechThreshold;
}
/**
* Getter for SpeechEndThreshold.
* Amount of silence (in seconds) before assuming the callee has finished speaking.
* @return Returns the Double
*/
@JsonGetter("speechEndThreshold")
public Double getSpeechEndThreshold() {
return speechEndThreshold;
}
/**
* Setter for SpeechEndThreshold.
* Amount of silence (in seconds) before assuming the callee has finished speaking.
* @param speechEndThreshold Value for Double
*/
@JsonSetter("speechEndThreshold")
public void setSpeechEndThreshold(Double speechEndThreshold) {
this.speechEndThreshold = speechEndThreshold;
}
/**
* Getter for DelayResult.
* If set to 'true' and if an answering machine is detected, the 'answering-machine' callback
* will be delayed until the machine is done speaking or until the 'detectionTimeout' is
* exceeded. If false, the 'answering-machine' result is sent immediately. Default is 'false'.
* @return Returns the Boolean
*/
@JsonGetter("delayResult")
public Boolean getDelayResult() {
return delayResult;
}
/**
* Setter for DelayResult.
* If set to 'true' and if an answering machine is detected, the 'answering-machine' callback
* will be delayed until the machine is done speaking or until the 'detectionTimeout' is
* exceeded. If false, the 'answering-machine' result is sent immediately. Default is 'false'.
* @param delayResult Value for Boolean
*/
@JsonSetter("delayResult")
public void setDelayResult(Boolean delayResult) {
this.delayResult = delayResult;
}
/**
* Internal Getter for CallbackUrl.
* The URL to send the 'machineDetectionComplete' callback when the detection is completed. Only
* for 'async' mode.
* @return Returns the Internal String
*/
@JsonGetter("callbackUrl")
@JsonSerialize(using = OptionalNullable.Serializer.class)
protected OptionalNullable internalGetCallbackUrl() {
return this.callbackUrl;
}
/**
* Getter for CallbackUrl.
* The URL to send the 'machineDetectionComplete' callback when the detection is completed. Only
* for 'async' mode.
* @return Returns the String
*/
public String getCallbackUrl() {
return OptionalNullable.getFrom(callbackUrl);
}
/**
* Setter for CallbackUrl.
* The URL to send the 'machineDetectionComplete' callback when the detection is completed. Only
* for 'async' mode.
* @param callbackUrl Value for String
*/
@JsonSetter("callbackUrl")
public void setCallbackUrl(String callbackUrl) {
this.callbackUrl = OptionalNullable.of(callbackUrl);
}
/**
* UnSetter for CallbackUrl.
* The URL to send the 'machineDetectionComplete' callback when the detection is completed. Only
* for 'async' mode.
*/
public void unsetCallbackUrl() {
callbackUrl = null;
}
/**
* Internal Getter for CallbackMethod.
* @return Returns the Internal CallbackMethodEnum
*/
@JsonGetter("callbackMethod")
@JsonSerialize(using = OptionalNullable.Serializer.class)
protected OptionalNullable internalGetCallbackMethod() {
return this.callbackMethod;
}
/**
* Getter for CallbackMethod.
* @return Returns the CallbackMethodEnum
*/
public CallbackMethodEnum getCallbackMethod() {
return OptionalNullable.getFrom(callbackMethod);
}
/**
* Setter for CallbackMethod.
* @param callbackMethod Value for CallbackMethodEnum
*/
@JsonSetter("callbackMethod")
public void setCallbackMethod(CallbackMethodEnum callbackMethod) {
this.callbackMethod = OptionalNullable.of(callbackMethod);
}
/**
* UnSetter for CallbackMethod.
*/
public void unsetCallbackMethod() {
callbackMethod = null;
}
/**
* Internal Getter for FallbackUrl.
* @return Returns the Internal String
*/
@JsonGetter("fallbackUrl")
@JsonSerialize(using = OptionalNullable.Serializer.class)
protected OptionalNullable internalGetFallbackUrl() {
return this.fallbackUrl;
}
/**
* Getter for FallbackUrl.
* @return Returns the String
*/
public String getFallbackUrl() {
return OptionalNullable.getFrom(fallbackUrl);
}
/**
* Setter for FallbackUrl.
* @param fallbackUrl Value for String
*/
@JsonSetter("fallbackUrl")
public void setFallbackUrl(String fallbackUrl) {
this.fallbackUrl = OptionalNullable.of(fallbackUrl);
}
/**
* UnSetter for FallbackUrl.
*/
public void unsetFallbackUrl() {
fallbackUrl = null;
}
/**
* Internal Getter for FallbackMethod.
* @return Returns the Internal FallbackMethodEnum
*/
@JsonGetter("fallbackMethod")
@JsonSerialize(using = OptionalNullable.Serializer.class)
protected OptionalNullable internalGetFallbackMethod() {
return this.fallbackMethod;
}
/**
* Getter for FallbackMethod.
* @return Returns the FallbackMethodEnum
*/
public FallbackMethodEnum getFallbackMethod() {
return OptionalNullable.getFrom(fallbackMethod);
}
/**
* Setter for FallbackMethod.
* @param fallbackMethod Value for FallbackMethodEnum
*/
@JsonSetter("fallbackMethod")
public void setFallbackMethod(FallbackMethodEnum fallbackMethod) {
this.fallbackMethod = OptionalNullable.of(fallbackMethod);
}
/**
* UnSetter for FallbackMethod.
*/
public void unsetFallbackMethod() {
fallbackMethod = null;
}
/**
* Internal Getter for Username.
* @return Returns the Internal String
*/
@JsonGetter("username")
@JsonSerialize(using = OptionalNullable.Serializer.class)
protected OptionalNullable internalGetUsername() {
return this.username;
}
/**
* Getter for Username.
* @return Returns the String
*/
public String getUsername() {
return OptionalNullable.getFrom(username);
}
/**
* Setter for Username.
* @param username Value for String
*/
@JsonSetter("username")
public void setUsername(String username) {
this.username = OptionalNullable.of(username);
}
/**
* UnSetter for Username.
*/
public void unsetUsername() {
username = null;
}
/**
* Internal Getter for Password.
* @return Returns the Internal String
*/
@JsonGetter("password")
@JsonSerialize(using = OptionalNullable.Serializer.class)
protected OptionalNullable internalGetPassword() {
return this.password;
}
/**
* Getter for Password.
* @return Returns the String
*/
public String getPassword() {
return OptionalNullable.getFrom(password);
}
/**
* Setter for Password.
* @param password Value for String
*/
@JsonSetter("password")
public void setPassword(String password) {
this.password = OptionalNullable.of(password);
}
/**
* UnSetter for Password.
*/
public void unsetPassword() {
password = null;
}
/**
* Internal Getter for FallbackUsername.
* @return Returns the Internal String
*/
@JsonGetter("fallbackUsername")
@JsonSerialize(using = OptionalNullable.Serializer.class)
protected OptionalNullable internalGetFallbackUsername() {
return this.fallbackUsername;
}
/**
* Getter for FallbackUsername.
* @return Returns the String
*/
public String getFallbackUsername() {
return OptionalNullable.getFrom(fallbackUsername);
}
/**
* Setter for FallbackUsername.
* @param fallbackUsername Value for String
*/
@JsonSetter("fallbackUsername")
public void setFallbackUsername(String fallbackUsername) {
this.fallbackUsername = OptionalNullable.of(fallbackUsername);
}
/**
* UnSetter for FallbackUsername.
*/
public void unsetFallbackUsername() {
fallbackUsername = null;
}
/**
* Internal Getter for FallbackPassword.
* @return Returns the Internal String
*/
@JsonGetter("fallbackPassword")
@JsonSerialize(using = OptionalNullable.Serializer.class)
protected OptionalNullable internalGetFallbackPassword() {
return this.fallbackPassword;
}
/**
* Getter for FallbackPassword.
* @return Returns the String
*/
public String getFallbackPassword() {
return OptionalNullable.getFrom(fallbackPassword);
}
/**
* Setter for FallbackPassword.
* @param fallbackPassword Value for String
*/
@JsonSetter("fallbackPassword")
public void setFallbackPassword(String fallbackPassword) {
this.fallbackPassword = OptionalNullable.of(fallbackPassword);
}
/**
* UnSetter for FallbackPassword.
*/
public void unsetFallbackPassword() {
fallbackPassword = null;
}
/**
* Converts this MachineDetectionConfiguration into string format.
* @return String representation of this class
*/
@Override
public String toString() {
return "MachineDetectionConfiguration [" + "mode=" + mode + ", detectionTimeout="
+ detectionTimeout + ", silenceTimeout=" + silenceTimeout + ", speechThreshold="
+ speechThreshold + ", speechEndThreshold=" + speechEndThreshold + ", delayResult="
+ delayResult + ", callbackUrl=" + callbackUrl + ", callbackMethod="
+ callbackMethod + ", fallbackUrl=" + fallbackUrl + ", fallbackMethod="
+ fallbackMethod + ", username=" + username + ", password=" + password
+ ", fallbackUsername=" + fallbackUsername + ", fallbackPassword="
+ fallbackPassword + "]";
}
/**
* Builds a new {@link MachineDetectionConfiguration.Builder} object.
* Creates the instance with the state of the current model.
* @return a new {@link MachineDetectionConfiguration.Builder} object
*/
public Builder toBuilder() {
Builder builder = new Builder()
.mode(getMode())
.detectionTimeout(getDetectionTimeout())
.silenceTimeout(getSilenceTimeout())
.speechThreshold(getSpeechThreshold())
.speechEndThreshold(getSpeechEndThreshold())
.delayResult(getDelayResult());
builder.callbackUrl = internalGetCallbackUrl();
builder.callbackMethod = internalGetCallbackMethod();
builder.fallbackUrl = internalGetFallbackUrl();
builder.fallbackMethod = internalGetFallbackMethod();
builder.username = internalGetUsername();
builder.password = internalGetPassword();
builder.fallbackUsername = internalGetFallbackUsername();
builder.fallbackPassword = internalGetFallbackPassword();
return builder;
}
/**
* Class to build instances of {@link MachineDetectionConfiguration}.
*/
public static class Builder {
private ModeEnum mode;
private Double detectionTimeout;
private Double silenceTimeout;
private Double speechThreshold;
private Double speechEndThreshold;
private Boolean delayResult;
private OptionalNullable callbackUrl;
private OptionalNullable callbackMethod;
private OptionalNullable fallbackUrl;
private OptionalNullable fallbackMethod;
private OptionalNullable username;
private OptionalNullable password;
private OptionalNullable fallbackUsername;
private OptionalNullable fallbackPassword;
/**
* Setter for mode.
* @param mode ModeEnum value for mode.
* @return Builder
*/
public Builder mode(ModeEnum mode) {
this.mode = mode;
return this;
}
/**
* Setter for detectionTimeout.
* @param detectionTimeout Double value for detectionTimeout.
* @return Builder
*/
public Builder detectionTimeout(Double detectionTimeout) {
this.detectionTimeout = detectionTimeout;
return this;
}
/**
* Setter for silenceTimeout.
* @param silenceTimeout Double value for silenceTimeout.
* @return Builder
*/
public Builder silenceTimeout(Double silenceTimeout) {
this.silenceTimeout = silenceTimeout;
return this;
}
/**
* Setter for speechThreshold.
* @param speechThreshold Double value for speechThreshold.
* @return Builder
*/
public Builder speechThreshold(Double speechThreshold) {
this.speechThreshold = speechThreshold;
return this;
}
/**
* Setter for speechEndThreshold.
* @param speechEndThreshold Double value for speechEndThreshold.
* @return Builder
*/
public Builder speechEndThreshold(Double speechEndThreshold) {
this.speechEndThreshold = speechEndThreshold;
return this;
}
/**
* Setter for delayResult.
* @param delayResult Boolean value for delayResult.
* @return Builder
*/
public Builder delayResult(Boolean delayResult) {
this.delayResult = delayResult;
return this;
}
/**
* Setter for callbackUrl.
* @param callbackUrl String value for callbackUrl.
* @return Builder
*/
public Builder callbackUrl(String callbackUrl) {
this.callbackUrl = OptionalNullable.of(callbackUrl);
return this;
}
/**
* UnSetter for callbackUrl.
* @return Builder
*/
public Builder unsetCallbackUrl() {
callbackUrl = null;
return this;
}
/**
* Setter for callbackMethod.
* @param callbackMethod CallbackMethodEnum value for callbackMethod.
* @return Builder
*/
public Builder callbackMethod(CallbackMethodEnum callbackMethod) {
this.callbackMethod = OptionalNullable.of(callbackMethod);
return this;
}
/**
* UnSetter for callbackMethod.
* @return Builder
*/
public Builder unsetCallbackMethod() {
callbackMethod = null;
return this;
}
/**
* Setter for fallbackUrl.
* @param fallbackUrl String value for fallbackUrl.
* @return Builder
*/
public Builder fallbackUrl(String fallbackUrl) {
this.fallbackUrl = OptionalNullable.of(fallbackUrl);
return this;
}
/**
* UnSetter for fallbackUrl.
* @return Builder
*/
public Builder unsetFallbackUrl() {
fallbackUrl = null;
return this;
}
/**
* Setter for fallbackMethod.
* @param fallbackMethod FallbackMethodEnum value for fallbackMethod.
* @return Builder
*/
public Builder fallbackMethod(FallbackMethodEnum fallbackMethod) {
this.fallbackMethod = OptionalNullable.of(fallbackMethod);
return this;
}
/**
* UnSetter for fallbackMethod.
* @return Builder
*/
public Builder unsetFallbackMethod() {
fallbackMethod = null;
return this;
}
/**
* Setter for username.
* @param username String value for username.
* @return Builder
*/
public Builder username(String username) {
this.username = OptionalNullable.of(username);
return this;
}
/**
* UnSetter for username.
* @return Builder
*/
public Builder unsetUsername() {
username = null;
return this;
}
/**
* Setter for password.
* @param password String value for password.
* @return Builder
*/
public Builder password(String password) {
this.password = OptionalNullable.of(password);
return this;
}
/**
* UnSetter for password.
* @return Builder
*/
public Builder unsetPassword() {
password = null;
return this;
}
/**
* Setter for fallbackUsername.
* @param fallbackUsername String value for fallbackUsername.
* @return Builder
*/
public Builder fallbackUsername(String fallbackUsername) {
this.fallbackUsername = OptionalNullable.of(fallbackUsername);
return this;
}
/**
* UnSetter for fallbackUsername.
* @return Builder
*/
public Builder unsetFallbackUsername() {
fallbackUsername = null;
return this;
}
/**
* Setter for fallbackPassword.
* @param fallbackPassword String value for fallbackPassword.
* @return Builder
*/
public Builder fallbackPassword(String fallbackPassword) {
this.fallbackPassword = OptionalNullable.of(fallbackPassword);
return this;
}
/**
* UnSetter for fallbackPassword.
* @return Builder
*/
public Builder unsetFallbackPassword() {
fallbackPassword = null;
return this;
}
/**
* Builds a new {@link MachineDetectionConfiguration} object using the set fields.
* @return {@link MachineDetectionConfiguration}
*/
public MachineDetectionConfiguration build() {
return new MachineDetectionConfiguration(mode, detectionTimeout, silenceTimeout,
speechThreshold, speechEndThreshold, delayResult, callbackUrl, callbackMethod,
fallbackUrl, fallbackMethod, username, password, fallbackUsername,
fallbackPassword);
}
}
}