# 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.PlaylistImageSnippet do
  @moduledoc """
  A *playlistImage* resource identifies another resource, such as a image, that is associated with a playlist. In addition, the playlistImage resource contains details about the included resource that pertain specifically to how that resource is used in that playlist. YouTube uses playlists to identify special collections of videos for a channel, such as: - uploaded videos - favorite videos - positively rated (liked) videos - watch history To be more specific, these lists are associated with a channel, which is a collection of a person, group, or company's videos, playlists, and other YouTube information. You can retrieve the playlist IDs for each of these lists from the channel resource for a given channel. You can then use the playlistImages.list method to retrieve image data for any of those playlists. You can also add or remove images from those lists by calling the playlistImages.insert and playlistImages.delete methods.

  ## Attributes

  *   `height` (*type:* `integer()`, *default:* `nil`) - The image height.
  *   `playlistId` (*type:* `String.t`, *default:* `nil`) - The Playlist ID of the playlist this image is associated with.
  *   `type` (*type:* `String.t`, *default:* `nil`) - The image type.
  *   `width` (*type:* `integer()`, *default:* `nil`) - The image width.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :height => integer() | nil,
          :playlistId => String.t() | nil,
          :type => String.t() | nil,
          :width => integer() | nil
        }

  field(:height)
  field(:playlistId)
  field(:type)
  field(:width)
end

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

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