# 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.PlusDomains.V1.Model.Media do
  @moduledoc """


  ## Attributes

  *   `author` (*type:* `GoogleApi.PlusDomains.V1.Model.MediaAuthor.t`, *default:* `nil`) - The person who uploaded this media.
  *   `displayName` (*type:* `String.t`, *default:* `nil`) - The display name for this media.
  *   `etag` (*type:* `String.t`, *default:* `nil`) - ETag of this response for caching purposes.
  *   `exif` (*type:* `GoogleApi.PlusDomains.V1.Model.MediaExif.t`, *default:* `nil`) - Exif information of the media item.
  *   `height` (*type:* `integer()`, *default:* `nil`) - The height in pixels of the original image.
  *   `id` (*type:* `String.t`, *default:* `nil`) - ID of this media, which is generated by the API.
  *   `kind` (*type:* `String.t`, *default:* `plus#media`) - The type of resource.
  *   `mediaCreatedTime` (*type:* `DateTime.t`, *default:* `nil`) - The time at which this media was originally created in UTC. Formatted as an RFC 3339 timestamp that matches this example: 2010-11-25T14:30:27.655Z
  *   `mediaUrl` (*type:* `String.t`, *default:* `nil`) - The URL of this photo or video's still image.
  *   `published` (*type:* `DateTime.t`, *default:* `nil`) - The time at which this media was uploaded. Formatted as an RFC 3339 timestamp.
  *   `sizeBytes` (*type:* `String.t`, *default:* `nil`) - The size in bytes of this video.
  *   `streams` (*type:* `list(GoogleApi.PlusDomains.V1.Model.Videostream.t)`, *default:* `nil`) - The list of video streams for this video. There might be several different streams available for a single video, either Flash or MPEG, of various sizes
  *   `summary` (*type:* `String.t`, *default:* `nil`) - A description, or caption, for this media.
  *   `updated` (*type:* `DateTime.t`, *default:* `nil`) - The time at which this media was last updated. This includes changes to media metadata. Formatted as an RFC 3339 timestamp.
  *   `url` (*type:* `String.t`, *default:* `nil`) - The URL for the page that hosts this media.
  *   `videoDuration` (*type:* `String.t`, *default:* `nil`) - The duration in milliseconds of this video.
  *   `videoStatus` (*type:* `String.t`, *default:* `nil`) - The encoding status of this video. Possible values are:  
      - "UPLOADING" - Not all the video bytes have been received. 
      - "PENDING" - Video not yet processed. 
      - "FAILED" - Video processing failed. 
      - "READY" - A single video stream is playable. 
      - "FINAL" - All video streams are playable.
  *   `width` (*type:* `integer()`, *default:* `nil`) - The width in pixels of the original image.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :author => GoogleApi.PlusDomains.V1.Model.MediaAuthor.t(),
          :displayName => String.t(),
          :etag => String.t(),
          :exif => GoogleApi.PlusDomains.V1.Model.MediaExif.t(),
          :height => integer(),
          :id => String.t(),
          :kind => String.t(),
          :mediaCreatedTime => DateTime.t(),
          :mediaUrl => String.t(),
          :published => DateTime.t(),
          :sizeBytes => String.t(),
          :streams => list(GoogleApi.PlusDomains.V1.Model.Videostream.t()),
          :summary => String.t(),
          :updated => DateTime.t(),
          :url => String.t(),
          :videoDuration => String.t(),
          :videoStatus => String.t(),
          :width => integer()
        }

  field(:author, as: GoogleApi.PlusDomains.V1.Model.MediaAuthor)
  field(:displayName)
  field(:etag)
  field(:exif, as: GoogleApi.PlusDomains.V1.Model.MediaExif)
  field(:height)
  field(:id)
  field(:kind)
  field(:mediaCreatedTime, as: DateTime)
  field(:mediaUrl)
  field(:published, as: DateTime)
  field(:sizeBytes)
  field(:streams, as: GoogleApi.PlusDomains.V1.Model.Videostream, type: :list)
  field(:summary)
  field(:updated, as: DateTime)
  field(:url)
  field(:videoDuration)
  field(:videoStatus)
  field(:width)
end

defimpl Poison.Decoder, for: GoogleApi.PlusDomains.V1.Model.Media do
  def decode(value, options) do
    GoogleApi.PlusDomains.V1.Model.Media.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.PlusDomains.V1.Model.Media do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
