Class MachineDetectionConfiguration


  • @Generated(value="org.openapitools.codegen.languages.JavaClientCodegen",
               date="2023-08-29T14:24:34.966664-04:00[America/New_York]")
    public class MachineDetectionConfiguration
    extends Object
    The machine detection request used to perform <a href='/docs/voice/guides/machineDetection'>machine detection</a> on the call.
    • Constructor Detail

      • MachineDetectionConfiguration

        public MachineDetectionConfiguration()
    • Method Detail

      • getDetectionTimeout

        @Nullable
        public Double getDetectionTimeout()
        The timeout used for the whole operation, in seconds. If no result is determined in this period, a callback with a `timeout` result is sent.
        Returns:
        detectionTimeout
      • setDetectionTimeout

        public void setDetectionTimeout​(Double detectionTimeout)
      • getSilenceTimeout

        @Nullable
        public Double getSilenceTimeout()
        If no speech is detected in this period, a callback with a 'silence' result is sent.
        Returns:
        silenceTimeout
      • setSilenceTimeout

        public void setSilenceTimeout​(Double silenceTimeout)
      • getSpeechThreshold

        @Nullable
        public Double getSpeechThreshold()
        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'.
        Returns:
        speechThreshold
      • setSpeechThreshold

        public void setSpeechThreshold​(Double speechThreshold)
      • getSpeechEndThreshold

        @Nullable
        public Double getSpeechEndThreshold()
        Amount of silence (in seconds) before assuming the callee has finished speaking.
        Returns:
        speechEndThreshold
      • setSpeechEndThreshold

        public void setSpeechEndThreshold​(Double speechEndThreshold)
      • getMachineSpeechEndThreshold

        @Nullable
        public Double getMachineSpeechEndThreshold()
        When an answering machine is detected, the amount of silence (in seconds) before assuming the message has finished playing. If not provided it will default to the speechEndThreshold value.
        Returns:
        machineSpeechEndThreshold
      • setMachineSpeechEndThreshold

        public void setMachineSpeechEndThreshold​(Double machineSpeechEndThreshold)
      • getDelayResult

        @Nullable
        public Boolean getDelayResult()
        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 an end of message tone is detected, or until the 'detectionTimeout' is exceeded. If false, the 'answering-machine' result is sent immediately.
        Returns:
        delayResult
      • setDelayResult

        public void setDelayResult​(Boolean delayResult)
      • getCallbackUrl

        @Nullable
        public URI getCallbackUrl()
        The URL to send the 'machineDetectionComplete' webhook when the detection is completed. Only for 'async' mode.
        Returns:
        callbackUrl
      • setCallbackUrl

        public void setCallbackUrl​(URI callbackUrl)
      • getCallbackMethod

        @Nullable
        public CallbackMethodEnum getCallbackMethod()
        Get callbackMethod
        Returns:
        callbackMethod
      • setCallbackMethod

        public void setCallbackMethod​(CallbackMethodEnum callbackMethod)
      • getUsername

        @Nullable
        public String getUsername()
        Basic auth username.
        Returns:
        username
      • setUsername

        public void setUsername​(String username)
      • getPassword

        @Nullable
        public String getPassword()
        Basic auth password.
        Returns:
        password
      • setPassword

        public void setPassword​(String password)
      • getFallbackUrl

        @Nullable
        public URI getFallbackUrl()
        A fallback URL which, if provided, will be used to retry the machine detection complete webhook delivery in case `callbackUrl` fails to respond
        Returns:
        fallbackUrl
      • setFallbackUrl

        public void setFallbackUrl​(URI fallbackUrl)
      • getFallbackMethod

        @Nullable
        public CallbackMethodEnum getFallbackMethod()
        Get fallbackMethod
        Returns:
        fallbackMethod
      • setFallbackMethod

        public void setFallbackMethod​(CallbackMethodEnum fallbackMethod)
      • getFallbackUsername

        @Nullable
        public String getFallbackUsername()
        Basic auth username.
        Returns:
        fallbackUsername
      • setFallbackUsername

        public void setFallbackUsername​(String fallbackUsername)
      • getFallbackPassword

        @Nullable
        public String getFallbackPassword()
        Basic auth password.
        Returns:
        fallbackPassword
      • setFallbackPassword

        public void setFallbackPassword​(String fallbackPassword)
      • putAdditionalProperty

        public MachineDetectionConfiguration putAdditionalProperty​(String key,
                                                                   Object value)
        Set the additional (undeclared) property with the specified name and value. If the property does not already exist, create it otherwise replace it.
        Parameters:
        key - name of the property
        value - value of the property
        Returns:
        the MachineDetectionConfiguration instance itself
      • getAdditionalProperties

        public Map<String,​Object> getAdditionalProperties()
        Return the additional (undeclared) property.
        Returns:
        a map of objects
      • getAdditionalProperty

        public Object getAdditionalProperty​(String key)
        Return the additional (undeclared) property with the specified name.
        Parameters:
        key - name of the property
        Returns:
        an object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object
      • validateJsonElement

        public static void validateJsonElement​(com.google.gson.JsonElement jsonElement)
                                        throws IOException
        Validates the JSON Element and throws an exception if issues found
        Parameters:
        jsonElement - JSON Element
        Throws:
        IOException - if the JSON Element is invalid with respect to MachineDetectionConfiguration
      • fromJson

        public static MachineDetectionConfiguration fromJson​(String jsonString)
                                                      throws IOException
        Create an instance of MachineDetectionConfiguration given an JSON string
        Parameters:
        jsonString - JSON string
        Returns:
        An instance of MachineDetectionConfiguration
        Throws:
        IOException - if the JSON string is invalid with respect to MachineDetectionConfiguration
      • toJson

        public String toJson()
        Convert an instance of MachineDetectionConfiguration to an JSON string
        Returns:
        JSON string