# 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.GoogleCloudDialogflowV2beta1ResponseMessage do
  @moduledoc """
  Response messages from an automated agent.

  ## Attributes

  *   `endInteraction` (*type:* `GoogleApi.Dialogflow.V2.Model.GoogleCloudDialogflowV2beta1ResponseMessageEndInteraction.t`, *default:* `nil`) - A signal that indicates the interaction with the Dialogflow agent has ended.
  *   `liveAgentHandoff` (*type:* `GoogleApi.Dialogflow.V2.Model.GoogleCloudDialogflowV2beta1ResponseMessageLiveAgentHandoff.t`, *default:* `nil`) - Hands off conversation to a live agent.
  *   `mixedAudio` (*type:* `GoogleApi.Dialogflow.V2.Model.GoogleCloudDialogflowV2beta1ResponseMessageMixedAudio.t`, *default:* `nil`) - An audio response message composed of both the synthesized Dialogflow agent responses and the audios hosted in places known to the client.
  *   `payload` (*type:* `map()`, *default:* `nil`) - Returns a response containing a custom, platform-specific payload.
  *   `telephonyTransferCall` (*type:* `GoogleApi.Dialogflow.V2.Model.GoogleCloudDialogflowV2beta1ResponseMessageTelephonyTransferCall.t`, *default:* `nil`) - A signal that the client should transfer the phone call connected to this agent to a third-party endpoint.
  *   `text` (*type:* `GoogleApi.Dialogflow.V2.Model.GoogleCloudDialogflowV2beta1ResponseMessageText.t`, *default:* `nil`) - Returns a text response.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :endInteraction =>
            GoogleApi.Dialogflow.V2.Model.GoogleCloudDialogflowV2beta1ResponseMessageEndInteraction.t()
            | nil,
          :liveAgentHandoff =>
            GoogleApi.Dialogflow.V2.Model.GoogleCloudDialogflowV2beta1ResponseMessageLiveAgentHandoff.t()
            | nil,
          :mixedAudio =>
            GoogleApi.Dialogflow.V2.Model.GoogleCloudDialogflowV2beta1ResponseMessageMixedAudio.t()
            | nil,
          :payload => map() | nil,
          :telephonyTransferCall =>
            GoogleApi.Dialogflow.V2.Model.GoogleCloudDialogflowV2beta1ResponseMessageTelephonyTransferCall.t()
            | nil,
          :text =>
            GoogleApi.Dialogflow.V2.Model.GoogleCloudDialogflowV2beta1ResponseMessageText.t()
            | nil
        }

  field(:endInteraction,
    as: GoogleApi.Dialogflow.V2.Model.GoogleCloudDialogflowV2beta1ResponseMessageEndInteraction
  )

  field(:liveAgentHandoff,
    as: GoogleApi.Dialogflow.V2.Model.GoogleCloudDialogflowV2beta1ResponseMessageLiveAgentHandoff
  )

  field(:mixedAudio,
    as: GoogleApi.Dialogflow.V2.Model.GoogleCloudDialogflowV2beta1ResponseMessageMixedAudio
  )

  field(:payload, type: :map)

  field(:telephonyTransferCall,
    as:
      GoogleApi.Dialogflow.V2.Model.GoogleCloudDialogflowV2beta1ResponseMessageTelephonyTransferCall
  )

  field(:text, as: GoogleApi.Dialogflow.V2.Model.GoogleCloudDialogflowV2beta1ResponseMessageText)
end

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

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