# 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.ContactCenterInsights.V1.Model.GoogleCloudContactcenterinsightsV1ConversationTranscriptTranscriptSegment do
  @moduledoc """
  A segment of a full transcript.

  ## Attributes

  *   `channelTag` (*type:* `integer()`, *default:* `nil`) - For conversations derived from multi-channel audio, this is the channel number corresponding to the audio from that channel. For audioChannelCount = N, its output values can range from '1' to 'N'. A channel tag of 0 indicates that the audio is mono.
  *   `confidence` (*type:* `number()`, *default:* `nil`) - A confidence estimate between 0.0 and 1.0 of the fidelity of this segment. A default value of 0.0 indicates that the value is unset.
  *   `dialogflowSegmentMetadata` (*type:* `GoogleApi.ContactCenterInsights.V1.Model.GoogleCloudContactcenterinsightsV1ConversationTranscriptTranscriptSegmentDialogflowSegmentMetadata.t`, *default:* `nil`) - CCAI metadata relating to the current transcript segment.
  *   `languageCode` (*type:* `String.t`, *default:* `nil`) - The language code of this segment as a [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag. Example: "en-US".
  *   `messageTime` (*type:* `DateTime.t`, *default:* `nil`) - The time that the message occurred, if provided.
  *   `segmentParticipant` (*type:* `GoogleApi.ContactCenterInsights.V1.Model.GoogleCloudContactcenterinsightsV1ConversationParticipant.t`, *default:* `nil`) - The participant of this segment.
  *   `sentiment` (*type:* `GoogleApi.ContactCenterInsights.V1.Model.GoogleCloudContactcenterinsightsV1SentimentData.t`, *default:* `nil`) - The sentiment for this transcript segment.
  *   `text` (*type:* `String.t`, *default:* `nil`) - The text of this segment.
  *   `words` (*type:* `list(GoogleApi.ContactCenterInsights.V1.Model.GoogleCloudContactcenterinsightsV1ConversationTranscriptTranscriptSegmentWordInfo.t)`, *default:* `nil`) - A list of the word-specific information for each word in the segment.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :channelTag => integer() | nil,
          :confidence => number() | nil,
          :dialogflowSegmentMetadata =>
            GoogleApi.ContactCenterInsights.V1.Model.GoogleCloudContactcenterinsightsV1ConversationTranscriptTranscriptSegmentDialogflowSegmentMetadata.t()
            | nil,
          :languageCode => String.t() | nil,
          :messageTime => DateTime.t() | nil,
          :segmentParticipant =>
            GoogleApi.ContactCenterInsights.V1.Model.GoogleCloudContactcenterinsightsV1ConversationParticipant.t()
            | nil,
          :sentiment =>
            GoogleApi.ContactCenterInsights.V1.Model.GoogleCloudContactcenterinsightsV1SentimentData.t()
            | nil,
          :text => String.t() | nil,
          :words =>
            list(
              GoogleApi.ContactCenterInsights.V1.Model.GoogleCloudContactcenterinsightsV1ConversationTranscriptTranscriptSegmentWordInfo.t()
            )
            | nil
        }

  field(:channelTag)
  field(:confidence)

  field(:dialogflowSegmentMetadata,
    as:
      GoogleApi.ContactCenterInsights.V1.Model.GoogleCloudContactcenterinsightsV1ConversationTranscriptTranscriptSegmentDialogflowSegmentMetadata
  )

  field(:languageCode)
  field(:messageTime, as: DateTime)

  field(:segmentParticipant,
    as:
      GoogleApi.ContactCenterInsights.V1.Model.GoogleCloudContactcenterinsightsV1ConversationParticipant
  )

  field(:sentiment,
    as: GoogleApi.ContactCenterInsights.V1.Model.GoogleCloudContactcenterinsightsV1SentimentData
  )

  field(:text)

  field(:words,
    as:
      GoogleApi.ContactCenterInsights.V1.Model.GoogleCloudContactcenterinsightsV1ConversationTranscriptTranscriptSegmentWordInfo,
    type: :list
  )
end

defimpl Poison.Decoder,
  for:
    GoogleApi.ContactCenterInsights.V1.Model.GoogleCloudContactcenterinsightsV1ConversationTranscriptTranscriptSegment do
  def decode(value, options) do
    GoogleApi.ContactCenterInsights.V1.Model.GoogleCloudContactcenterinsightsV1ConversationTranscriptTranscriptSegment.decode(
      value,
      options
    )
  end
end

defimpl Poison.Encoder,
  for:
    GoogleApi.ContactCenterInsights.V1.Model.GoogleCloudContactcenterinsightsV1ConversationTranscriptTranscriptSegment do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
