# 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.CommentSnippet do
  @moduledoc """
  Basic details about a comment, such as its author and text.

  ## Attributes

  *   `authorChannelId` (*type:* `GoogleApi.YouTube.V3.Model.CommentSnippetAuthorChannelId.t`, *default:* `nil`) - 
  *   `authorChannelUrl` (*type:* `String.t`, *default:* `nil`) - Link to the author's YouTube channel, if any.
  *   `authorDisplayName` (*type:* `String.t`, *default:* `nil`) - The name of the user who posted the comment.
  *   `authorProfileImageUrl` (*type:* `String.t`, *default:* `nil`) - The URL for the avatar of the user who posted the comment.
  *   `canRate` (*type:* `boolean()`, *default:* `nil`) - Whether the current viewer can rate this comment.
  *   `channelId` (*type:* `String.t`, *default:* `nil`) - The id of the corresponding YouTube channel. In case of a channel comment this is the channel the comment refers to. In case of a video or post comment it's the video/post's channel.
  *   `likeCount` (*type:* `integer()`, *default:* `nil`) - The total number of likes this comment has received.
  *   `moderationStatus` (*type:* `String.t`, *default:* `nil`) - The comment's moderation status. Will not be set if the comments were requested through the id filter.
  *   `parentId` (*type:* `String.t`, *default:* `nil`) - The unique id of the top-level comment, only set for replies.
  *   `postId` (*type:* `String.t`, *default:* `nil`) - The ID of the post the comment refers to, if any.
  *   `publishedAt` (*type:* `DateTime.t`, *default:* `nil`) - The date and time when the comment was originally published.
  *   `textDisplay` (*type:* `String.t`, *default:* `nil`) - The comment's text. The format is either plain text or HTML dependent on what has been requested. Even the plain text representation may differ from the text originally posted in that it may replace video links with video titles etc.
  *   `textOriginal` (*type:* `String.t`, *default:* `nil`) - The comment's original raw text as initially posted or last updated. The original text will only be returned if it is accessible to the viewer, which is only guaranteed if the viewer is the comment's author.
  *   `updatedAt` (*type:* `DateTime.t`, *default:* `nil`) - The date and time when the comment was last updated.
  *   `videoId` (*type:* `String.t`, *default:* `nil`) - The ID of the video the comment refers to, if any.
  *   `viewerRating` (*type:* `String.t`, *default:* `nil`) - The rating the viewer has given to this comment. For the time being this will never return RATE_TYPE_DISLIKE and instead return RATE_TYPE_NONE. This may change in the future.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :authorChannelId => GoogleApi.YouTube.V3.Model.CommentSnippetAuthorChannelId.t() | nil,
          :authorChannelUrl => String.t() | nil,
          :authorDisplayName => String.t() | nil,
          :authorProfileImageUrl => String.t() | nil,
          :canRate => boolean() | nil,
          :channelId => String.t() | nil,
          :likeCount => integer() | nil,
          :moderationStatus => String.t() | nil,
          :parentId => String.t() | nil,
          :postId => String.t() | nil,
          :publishedAt => DateTime.t() | nil,
          :textDisplay => String.t() | nil,
          :textOriginal => String.t() | nil,
          :updatedAt => DateTime.t() | nil,
          :videoId => String.t() | nil,
          :viewerRating => String.t() | nil
        }

  field(:authorChannelId, as: GoogleApi.YouTube.V3.Model.CommentSnippetAuthorChannelId)
  field(:authorChannelUrl)
  field(:authorDisplayName)
  field(:authorProfileImageUrl)
  field(:canRate)
  field(:channelId)
  field(:likeCount)
  field(:moderationStatus)
  field(:parentId)
  field(:postId)
  field(:publishedAt, as: DateTime)
  field(:textDisplay)
  field(:textOriginal)
  field(:updatedAt, as: DateTime)
  field(:videoId)
  field(:viewerRating)
end

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

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