# 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.YouTube.V3.Model.LiveChatMessageSnippet do
  @moduledoc """
  Next ID: 34

  ## Attributes

  *   `authorChannelId` (*type:* `String.t`, *default:* `nil`) - The ID of the user that authored this message, this field is not always filled. textMessageEvent - the user that wrote the message fanFundingEvent - the user that funded the broadcast newSponsorEvent - the user that just became a sponsor memberMilestoneChatEvent - the member that sent the message membershipGiftingEvent - the user that made the purchase giftMembershipReceivedEvent - the user that received the gift membership messageDeletedEvent - the moderator that took the action messageRetractedEvent - the author that retracted their message userBannedEvent - the moderator that took the action superChatEvent - the user that made the purchase superStickerEvent - the user that made the purchase pollEvent - the user that created the poll
  *   `displayMessage` (*type:* `String.t`, *default:* `nil`) - Contains a string that can be displayed to the user. If this field is not present the message is silent, at the moment only messages of type TOMBSTONE and CHAT_ENDED_EVENT are silent.
  *   `fanFundingEventDetails` (*type:* `GoogleApi.YouTube.V3.Model.LiveChatFanFundingEventDetails.t`, *default:* `nil`) - Details about the funding event, this is only set if the type is 'fanFundingEvent'.
  *   `giftMembershipReceivedDetails` (*type:* `GoogleApi.YouTube.V3.Model.LiveChatGiftMembershipReceivedDetails.t`, *default:* `nil`) - Details about the Gift Membership Received event, this is only set if the type is 'giftMembershipReceivedEvent'.
  *   `hasDisplayContent` (*type:* `boolean()`, *default:* `nil`) - Whether the message has display content that should be displayed to users.
  *   `liveChatId` (*type:* `String.t`, *default:* `nil`) - 
  *   `memberMilestoneChatDetails` (*type:* `GoogleApi.YouTube.V3.Model.LiveChatMemberMilestoneChatDetails.t`, *default:* `nil`) - Details about the Member Milestone Chat event, this is only set if the type is 'memberMilestoneChatEvent'.
  *   `membershipGiftingDetails` (*type:* `GoogleApi.YouTube.V3.Model.LiveChatMembershipGiftingDetails.t`, *default:* `nil`) - Details about the Membership Gifting event, this is only set if the type is 'membershipGiftingEvent'.
  *   `messageDeletedDetails` (*type:* `GoogleApi.YouTube.V3.Model.LiveChatMessageDeletedDetails.t`, *default:* `nil`) - 
  *   `messageRetractedDetails` (*type:* `GoogleApi.YouTube.V3.Model.LiveChatMessageRetractedDetails.t`, *default:* `nil`) - 
  *   `newSponsorDetails` (*type:* `GoogleApi.YouTube.V3.Model.LiveChatNewSponsorDetails.t`, *default:* `nil`) - Details about the New Member Announcement event, this is only set if the type is 'newSponsorEvent'. Please note that "member" is the new term for "sponsor".
  *   `pollDetails` (*type:* `GoogleApi.YouTube.V3.Model.LiveChatPollDetails.t`, *default:* `nil`) - Details about the poll event, this is only set if the type is 'pollEvent'.
  *   `publishedAt` (*type:* `DateTime.t`, *default:* `nil`) - The date and time when the message was orignally published.
  *   `superChatDetails` (*type:* `GoogleApi.YouTube.V3.Model.LiveChatSuperChatDetails.t`, *default:* `nil`) - Details about the Super Chat event, this is only set if the type is 'superChatEvent'.
  *   `superStickerDetails` (*type:* `GoogleApi.YouTube.V3.Model.LiveChatSuperStickerDetails.t`, *default:* `nil`) - Details about the Super Sticker event, this is only set if the type is 'superStickerEvent'.
  *   `textMessageDetails` (*type:* `GoogleApi.YouTube.V3.Model.LiveChatTextMessageDetails.t`, *default:* `nil`) - Details about the text message, this is only set if the type is 'textMessageEvent'.
  *   `type` (*type:* `String.t`, *default:* `nil`) - The type of message, this will always be present, it determines the contents of the message as well as which fields will be present.
  *   `userBannedDetails` (*type:* `GoogleApi.YouTube.V3.Model.LiveChatUserBannedMessageDetails.t`, *default:* `nil`) - 
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :authorChannelId => String.t() | nil,
          :displayMessage => String.t() | nil,
          :fanFundingEventDetails =>
            GoogleApi.YouTube.V3.Model.LiveChatFanFundingEventDetails.t() | nil,
          :giftMembershipReceivedDetails =>
            GoogleApi.YouTube.V3.Model.LiveChatGiftMembershipReceivedDetails.t() | nil,
          :hasDisplayContent => boolean() | nil,
          :liveChatId => String.t() | nil,
          :memberMilestoneChatDetails =>
            GoogleApi.YouTube.V3.Model.LiveChatMemberMilestoneChatDetails.t() | nil,
          :membershipGiftingDetails =>
            GoogleApi.YouTube.V3.Model.LiveChatMembershipGiftingDetails.t() | nil,
          :messageDeletedDetails =>
            GoogleApi.YouTube.V3.Model.LiveChatMessageDeletedDetails.t() | nil,
          :messageRetractedDetails =>
            GoogleApi.YouTube.V3.Model.LiveChatMessageRetractedDetails.t() | nil,
          :newSponsorDetails => GoogleApi.YouTube.V3.Model.LiveChatNewSponsorDetails.t() | nil,
          :pollDetails => GoogleApi.YouTube.V3.Model.LiveChatPollDetails.t() | nil,
          :publishedAt => DateTime.t() | nil,
          :superChatDetails => GoogleApi.YouTube.V3.Model.LiveChatSuperChatDetails.t() | nil,
          :superStickerDetails =>
            GoogleApi.YouTube.V3.Model.LiveChatSuperStickerDetails.t() | nil,
          :textMessageDetails => GoogleApi.YouTube.V3.Model.LiveChatTextMessageDetails.t() | nil,
          :type => String.t() | nil,
          :userBannedDetails =>
            GoogleApi.YouTube.V3.Model.LiveChatUserBannedMessageDetails.t() | nil
        }

  field(:authorChannelId)
  field(:displayMessage)
  field(:fanFundingEventDetails, as: GoogleApi.YouTube.V3.Model.LiveChatFanFundingEventDetails)

  field(:giftMembershipReceivedDetails,
    as: GoogleApi.YouTube.V3.Model.LiveChatGiftMembershipReceivedDetails
  )

  field(:hasDisplayContent)
  field(:liveChatId)

  field(:memberMilestoneChatDetails,
    as: GoogleApi.YouTube.V3.Model.LiveChatMemberMilestoneChatDetails
  )

  field(:membershipGiftingDetails, as: GoogleApi.YouTube.V3.Model.LiveChatMembershipGiftingDetails)

  field(:messageDeletedDetails, as: GoogleApi.YouTube.V3.Model.LiveChatMessageDeletedDetails)
  field(:messageRetractedDetails, as: GoogleApi.YouTube.V3.Model.LiveChatMessageRetractedDetails)
  field(:newSponsorDetails, as: GoogleApi.YouTube.V3.Model.LiveChatNewSponsorDetails)
  field(:pollDetails, as: GoogleApi.YouTube.V3.Model.LiveChatPollDetails)
  field(:publishedAt, as: DateTime)
  field(:superChatDetails, as: GoogleApi.YouTube.V3.Model.LiveChatSuperChatDetails)
  field(:superStickerDetails, as: GoogleApi.YouTube.V3.Model.LiveChatSuperStickerDetails)
  field(:textMessageDetails, as: GoogleApi.YouTube.V3.Model.LiveChatTextMessageDetails)
  field(:type)
  field(:userBannedDetails, as: GoogleApi.YouTube.V3.Model.LiveChatUserBannedMessageDetails)
end

defimpl Poison.Decoder, for: GoogleApi.YouTube.V3.Model.LiveChatMessageSnippet do
  def decode(value, options) do
    GoogleApi.YouTube.V3.Model.LiveChatMessageSnippet.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.YouTube.V3.Model.LiveChatMessageSnippet do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
