# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.Dialogflow.V2.Model.GoogleCloudDialogflowCxV3beta1AdvancedSettingsDtmfSettings do
  @moduledoc """
  Define behaviors for DTMF (dual tone multi frequency).

  ## Attributes

  *   `enabled` (*type:* `boolean()`, *default:* `nil`) - If true, incoming audio is processed for DTMF (dual tone multi frequency) events. For example, if the caller presses a button on their telephone keypad and DTMF processing is enabled, Dialogflow will detect the event (e.g. a "3" was pressed) in the incoming audio and pass the event to the bot to drive business logic (e.g. when 3 is pressed, return the account balance).
  *   `endpointingTimeoutDuration` (*type:* `String.t`, *default:* `nil`) - Endpoint timeout setting for matching dtmf input to regex.
  *   `finishDigit` (*type:* `String.t`, *default:* `nil`) - The digit that terminates a DTMF digit sequence.
  *   `interdigitTimeoutDuration` (*type:* `String.t`, *default:* `nil`) - Interdigit timeout setting for matching dtmf input to regex.
  *   `maxDigits` (*type:* `integer()`, *default:* `nil`) - Max length of DTMF digits.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :enabled => boolean() | nil,
          :endpointingTimeoutDuration => String.t() | nil,
          :finishDigit => String.t() | nil,
          :interdigitTimeoutDuration => String.t() | nil,
          :maxDigits => integer() | nil
        }

  field(:enabled)
  field(:endpointingTimeoutDuration)
  field(:finishDigit)
  field(:interdigitTimeoutDuration)
  field(:maxDigits)
end

defimpl Poison.Decoder,
  for: GoogleApi.Dialogflow.V2.Model.GoogleCloudDialogflowCxV3beta1AdvancedSettingsDtmfSettings do
  def decode(value, options) do
    GoogleApi.Dialogflow.V2.Model.GoogleCloudDialogflowCxV3beta1AdvancedSettingsDtmfSettings.decode(
      value,
      options
    )
  end
end

defimpl Poison.Encoder,
  for: GoogleApi.Dialogflow.V2.Model.GoogleCloudDialogflowCxV3beta1AdvancedSettingsDtmfSettings do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
