# 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.GoogleCloudDialogflowV2AnalyzeContentResponse do
  @moduledoc """
  The response message for Participants.AnalyzeContent.

  ## Attributes

  *   `automatedAgentReply` (*type:* `GoogleApi.Dialogflow.V2.Model.GoogleCloudDialogflowV2AutomatedAgentReply.t`, *default:* `nil`) - Only set if a Dialogflow automated agent has responded. Note that in AutomatedAgentReply.DetectIntentResponse, Sessions.DetectIntentResponse.output_audio and Sessions.DetectIntentResponse.output_audio_config are always empty, use reply_audio instead.
  *   `dtmfParameters` (*type:* `GoogleApi.Dialogflow.V2.Model.GoogleCloudDialogflowV2DtmfParameters.t`, *default:* `nil`) - Indicates the parameters of DTMF.
  *   `endUserSuggestionResults` (*type:* `list(GoogleApi.Dialogflow.V2.Model.GoogleCloudDialogflowV2SuggestionResult.t)`, *default:* `nil`) - The suggestions for end user. The order is the same as HumanAgentAssistantConfig.SuggestionConfig.feature_configs of HumanAgentAssistantConfig.end_user_suggestion_config. Same as human_agent_suggestion_results, any failure of Agent Assist features will not lead to the overall failure of an AnalyzeContent API call. Instead, the features will fail silently with the error field set in the corresponding SuggestionResult.
  *   `humanAgentSuggestionResults` (*type:* `list(GoogleApi.Dialogflow.V2.Model.GoogleCloudDialogflowV2SuggestionResult.t)`, *default:* `nil`) - The suggestions for most recent human agent. The order is the same as HumanAgentAssistantConfig.SuggestionConfig.feature_configs of HumanAgentAssistantConfig.human_agent_suggestion_config. Note that any failure of Agent Assist features will not lead to the overall failure of an AnalyzeContent API call. Instead, the features will fail silently with the error field set in the corresponding SuggestionResult.
  *   `message` (*type:* `GoogleApi.Dialogflow.V2.Model.GoogleCloudDialogflowV2Message.t`, *default:* `nil`) - Message analyzed by CCAI.
  *   `replyAudio` (*type:* `GoogleApi.Dialogflow.V2.Model.GoogleCloudDialogflowV2OutputAudio.t`, *default:* `nil`) - The audio data bytes encoded as specified in the request. This field is set if: - `reply_audio_config` was specified in the request, or - The automated agent responded with audio to play to the user. In such case, `reply_audio.config` contains settings used to synthesize the speech. In some scenarios, multiple output audio fields may be present in the response structure. In these cases, only the top-most-level audio output has content.
  *   `replyText` (*type:* `String.t`, *default:* `nil`) - The output text content. This field is set if the automated agent responded with text to show to the user.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :automatedAgentReply =>
            GoogleApi.Dialogflow.V2.Model.GoogleCloudDialogflowV2AutomatedAgentReply.t() | nil,
          :dtmfParameters =>
            GoogleApi.Dialogflow.V2.Model.GoogleCloudDialogflowV2DtmfParameters.t() | nil,
          :endUserSuggestionResults =>
            list(GoogleApi.Dialogflow.V2.Model.GoogleCloudDialogflowV2SuggestionResult.t()) | nil,
          :humanAgentSuggestionResults =>
            list(GoogleApi.Dialogflow.V2.Model.GoogleCloudDialogflowV2SuggestionResult.t()) | nil,
          :message => GoogleApi.Dialogflow.V2.Model.GoogleCloudDialogflowV2Message.t() | nil,
          :replyAudio =>
            GoogleApi.Dialogflow.V2.Model.GoogleCloudDialogflowV2OutputAudio.t() | nil,
          :replyText => String.t() | nil
        }

  field(:automatedAgentReply,
    as: GoogleApi.Dialogflow.V2.Model.GoogleCloudDialogflowV2AutomatedAgentReply
  )

  field(:dtmfParameters, as: GoogleApi.Dialogflow.V2.Model.GoogleCloudDialogflowV2DtmfParameters)

  field(:endUserSuggestionResults,
    as: GoogleApi.Dialogflow.V2.Model.GoogleCloudDialogflowV2SuggestionResult,
    type: :list
  )

  field(:humanAgentSuggestionResults,
    as: GoogleApi.Dialogflow.V2.Model.GoogleCloudDialogflowV2SuggestionResult,
    type: :list
  )

  field(:message, as: GoogleApi.Dialogflow.V2.Model.GoogleCloudDialogflowV2Message)
  field(:replyAudio, as: GoogleApi.Dialogflow.V2.Model.GoogleCloudDialogflowV2OutputAudio)
  field(:replyText)
end

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

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