# 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.CaptionSnippet do
  @moduledoc """
  Basic details about a caption track, such as its language and name.

  ## Attributes

  *   `audioTrackType` (*type:* `String.t`, *default:* `nil`) - The type of audio track associated with the caption track.
  *   `failureReason` (*type:* `String.t`, *default:* `nil`) - The reason that YouTube failed to process the caption track. This property is only present if the state property's value is failed.
  *   `isAutoSynced` (*type:* `boolean()`, *default:* `nil`) - Indicates whether YouTube synchronized the caption track to the audio track in the video. The value will be true if a sync was explicitly requested when the caption track was uploaded. For example, when calling the captions.insert or captions.update methods, you can set the sync parameter to true to instruct YouTube to sync the uploaded track to the video. If the value is false, YouTube uses the time codes in the uploaded caption track to determine when to display captions.
  *   `isCC` (*type:* `boolean()`, *default:* `nil`) - Indicates whether the track contains closed captions for the deaf and hard of hearing. The default value is false.
  *   `isDraft` (*type:* `boolean()`, *default:* `nil`) - Indicates whether the caption track is a draft. If the value is true, then the track is not publicly visible. The default value is false. @mutable youtube.captions.insert youtube.captions.update
  *   `isEasyReader` (*type:* `boolean()`, *default:* `nil`) - Indicates whether caption track is formatted for "easy reader," meaning it is at a third-grade level for language learners. The default value is false.
  *   `isLarge` (*type:* `boolean()`, *default:* `nil`) - Indicates whether the caption track uses large text for the vision-impaired. The default value is false.
  *   `language` (*type:* `String.t`, *default:* `nil`) - The language of the caption track. The property value is a BCP-47 language tag.
  *   `lastUpdated` (*type:* `DateTime.t`, *default:* `nil`) - The date and time when the caption track was last updated.
  *   `name` (*type:* `String.t`, *default:* `nil`) - The name of the caption track. The name is intended to be visible to the user as an option during playback.
  *   `status` (*type:* `String.t`, *default:* `nil`) - The caption track's status.
  *   `trackKind` (*type:* `String.t`, *default:* `nil`) - The caption track's type.
  *   `videoId` (*type:* `String.t`, *default:* `nil`) - The ID that YouTube uses to uniquely identify the video associated with the caption track. @mutable youtube.captions.insert
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :audioTrackType => String.t() | nil,
          :failureReason => String.t() | nil,
          :isAutoSynced => boolean() | nil,
          :isCC => boolean() | nil,
          :isDraft => boolean() | nil,
          :isEasyReader => boolean() | nil,
          :isLarge => boolean() | nil,
          :language => String.t() | nil,
          :lastUpdated => DateTime.t() | nil,
          :name => String.t() | nil,
          :status => String.t() | nil,
          :trackKind => String.t() | nil,
          :videoId => String.t() | nil
        }

  field(:audioTrackType)
  field(:failureReason)
  field(:isAutoSynced)
  field(:isCC)
  field(:isDraft)
  field(:isEasyReader)
  field(:isLarge)
  field(:language)
  field(:lastUpdated, as: DateTime)
  field(:name)
  field(:status)
  field(:trackKind)
  field(:videoId)
end

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

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