# 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.VideoContentDetails do
  @moduledoc """
  Details about the content of a YouTube Video.

  ## Attributes

  *   `caption` (*type:* `String.t`, *default:* `nil`) - The value of captions indicates whether the video has captions or not.
  *   `contentRating` (*type:* `GoogleApi.YouTube.V3.Model.ContentRating.t`, *default:* `nil`) - Specifies the ratings that the video received under various rating schemes.
  *   `countryRestriction` (*type:* `GoogleApi.YouTube.V3.Model.AccessPolicy.t`, *default:* `nil`) - The countryRestriction object contains information about the countries where a video is (or is not) viewable.
  *   `definition` (*type:* `String.t`, *default:* `nil`) - The value of definition indicates whether the video is available in high definition or only in standard definition.
  *   `dimension` (*type:* `String.t`, *default:* `nil`) - The value of dimension indicates whether the video is available in 3D or in 2D.
  *   `duration` (*type:* `String.t`, *default:* `nil`) - The length of the video. The tag value is an ISO 8601 duration in the format PT#M#S, in which the letters PT indicate that the value specifies a period of time, and the letters M and S refer to length in minutes and seconds, respectively. The # characters preceding the M and S letters are both integers that specify the number of minutes (or seconds) of the video. For example, a value of PT15M51S indicates that the video is 15 minutes and 51 seconds long.
  *   `hasCustomThumbnail` (*type:* `boolean()`, *default:* `nil`) - Indicates whether the video uploader has provided a custom thumbnail image for the video. This property is only visible to the video uploader.
  *   `licensedContent` (*type:* `boolean()`, *default:* `nil`) - The value of is_license_content indicates whether the video is licensed content.
  *   `projection` (*type:* `String.t`, *default:* `nil`) - Specifies the projection format of the video.
  *   `regionRestriction` (*type:* `GoogleApi.YouTube.V3.Model.VideoContentDetailsRegionRestriction.t`, *default:* `nil`) - The regionRestriction object contains information about the countries where a video is (or is not) viewable. The object will contain either the contentDetails.regionRestriction.allowed property or the contentDetails.regionRestriction.blocked property.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :caption => String.t() | nil,
          :contentRating => GoogleApi.YouTube.V3.Model.ContentRating.t() | nil,
          :countryRestriction => GoogleApi.YouTube.V3.Model.AccessPolicy.t() | nil,
          :definition => String.t() | nil,
          :dimension => String.t() | nil,
          :duration => String.t() | nil,
          :hasCustomThumbnail => boolean() | nil,
          :licensedContent => boolean() | nil,
          :projection => String.t() | nil,
          :regionRestriction =>
            GoogleApi.YouTube.V3.Model.VideoContentDetailsRegionRestriction.t() | nil
        }

  field(:caption)
  field(:contentRating, as: GoogleApi.YouTube.V3.Model.ContentRating)
  field(:countryRestriction, as: GoogleApi.YouTube.V3.Model.AccessPolicy)
  field(:definition)
  field(:dimension)
  field(:duration)
  field(:hasCustomThumbnail)
  field(:licensedContent)
  field(:projection)
  field(:regionRestriction, as: GoogleApi.YouTube.V3.Model.VideoContentDetailsRegionRestriction)
end

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

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