Class InputAction.Builder

java.lang.Object
com.vonage.client.voice.ncco.InputAction.Builder
Enclosing class:
InputAction

public static class InputAction.Builder extends Object
Builder for specifying the properties of an InputAction.
  • Method Details

    • dtmf

      Enables DTMF with the default settings.
      Returns:
      This builder to keep building the input action.
      Since:
      8.12.0
    • dtmf

      Enable DTMF input with the provided settings. Note that if you override any of the defaults, you cannot set mode(InputMode) to InputMode.ASYNCHRONOUS.
      Parameters:
      dtmf - The DTMF settings object.
      Returns:
      This builder to keep building the input action.
      Since:
      6.0.0
    • speech

      Automatic Speech Recognition (ASR) settings to enable speech input. Required if dtmf(DtmfSettings) is not provided.
      Parameters:
      speech - The speech settings object.
      Returns:
      This builder to keep building the input action.
      Since:
      6.0.0
    • eventUrl

      Deprecated.
      This will be removed in a future release. Use eventUrl(String) instead.
      Vonage sends the digits pressed by the callee to this URL after timeOut pause inactivity or when # is pressed.
      Parameters:
      eventUrl - The URL wrapped in a singleton collection to send the event metadata to.
      Returns:
      This builder to keep building the input action.
    • eventUrl

      Deprecated.
      This will be removed in a future release. Use eventUrl(String) instead.
      Vonage sends the digits pressed by the callee to this URL after timeOut pause inactivity or when # is pressed.
      Parameters:
      eventUrl - The URL to send the event metadata to.
      Returns:
      This builder to keep building the input action.
    • eventUrl

      public InputAction.Builder eventUrl(String eventUrl)
      Vonage sends the digits pressed by the callee to this URL after timeOut pause inactivity or when # is pressed.
      Parameters:
      eventUrl - The URL to send the event metadata to.
      Returns:
      This builder to keep building the input action.
      Since:
      8.12.0
    • eventMethod

      The HTTP method used to send event information to event_url The default value is POST.
      Parameters:
      eventMethod - The HTTP method to use for the event as an enum.
      Returns:
      This builder to keep building the input action.
    • mode

      How the input should be processed. If not set, the default is InputMode.SYNCHRONOUS. If set to InputMode.ASYNCHRONOUS, use dtmf() instead of dtmf(DtmfSettings).
      Parameters:
      mode - The DTMF processing mode as an enum.
      Returns:
      This builder to keep building the input action.
      Since:
      8.12.0
    • type

      Deprecated.
      Use dtmf(DtmfSettings) and speech(SpeechSettings) instead. The type will be set automatically based on the provided settings.
      Sets the acceptable input types. From v8.12.0 onwards, you should not call this method manually; instead, use dtmf() and / or speech(SpeechSettings). This method will be removed in a future release.
      Parameters:
      type - Acceptable input types as a collection. Valid values are ["dtmf"] for DTMF input only, ["speech"] for ASR only, or ["dtmf", "speech"] for both.
      Returns:
      This builder to keep building the input action.
    • build

      public InputAction build()
      Builds the InputAction.
      Returns:
      A new InputAction object from the stored builder options.