# 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.Classroom.V1.Model.AddOnAttachment do
  @moduledoc """
  An add-on attachment on a post.

  ## Attributes

  *   `copyHistory` (*type:* `list(GoogleApi.Classroom.V1.Model.CopyHistory.t)`, *default:* `nil`) - Output only. Identifiers of attachments that were previous copies of this attachment. If the attachment was previously copied by virtue of its parent post being copied, this enumerates the identifiers of attachments that were its previous copies in ascending chronological order of copy.
  *   `courseId` (*type:* `String.t`, *default:* `nil`) - Immutable. Identifier of the course.
  *   `dueDate` (*type:* `GoogleApi.Classroom.V1.Model.Date.t`, *default:* `nil`) - Date, in UTC, that work on this attachment is due. This must be specified if `due_time` is specified.
  *   `dueTime` (*type:* `GoogleApi.Classroom.V1.Model.TimeOfDay.t`, *default:* `nil`) - Time of day, in UTC, that work on this attachment is due. This must be specified if `due_date` is specified.
  *   `id` (*type:* `String.t`, *default:* `nil`) - Immutable. Classroom-assigned identifier for this attachment, unique per post.
  *   `itemId` (*type:* `String.t`, *default:* `nil`) - Immutable. Identifier of the `Announcement`, `CourseWork`, or `CourseWorkMaterial` under which the attachment is attached. Unique per course.
  *   `maxPoints` (*type:* `float()`, *default:* `nil`) - Maximum grade for this attachment. Can only be set if `studentWorkReviewUri` is set. Set to a non-zero value to indicate that the attachment supports grade passback. If set, this must be a non-negative integer value. When set to zero, the attachment will not support grade passback.
  *   `postId` (*type:* `String.t`, *default:* `nil`) - Immutable. Deprecated, use `item_id` instead.
  *   `studentViewUri` (*type:* `GoogleApi.Classroom.V1.Model.EmbedUri.t`, *default:* `nil`) - Required. URI to show the student view of the attachment. The URI will be opened in an iframe with the `courseId`, `itemId`, `itemType`, and `attachmentId` query parameters set.
  *   `studentWorkReviewUri` (*type:* `GoogleApi.Classroom.V1.Model.EmbedUri.t`, *default:* `nil`) - URI for the teacher to see student work on the attachment, if applicable. The URI will be opened in an iframe with the `courseId`, `itemId`, `itemType`, `attachmentId`, and `submissionId` query parameters set. This is the same `submissionId` returned in the [`AddOnContext.studentContext`](//devsite.google.com/classroom/reference/rest/v1/AddOnContext#StudentContext) field when a student views the attachment. If the URI is omitted or removed, `max_points` will also be discarded.
  *   `teacherViewUri` (*type:* `GoogleApi.Classroom.V1.Model.EmbedUri.t`, *default:* `nil`) - Required. URI to show the teacher view of the attachment. The URI will be opened in an iframe with the `courseId`, `itemId`, `itemType`, and `attachmentId` query parameters set.
  *   `title` (*type:* `String.t`, *default:* `nil`) - Required. Title of this attachment. The title must be between 1 and 1000 characters.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :copyHistory => list(GoogleApi.Classroom.V1.Model.CopyHistory.t()) | nil,
          :courseId => String.t() | nil,
          :dueDate => GoogleApi.Classroom.V1.Model.Date.t() | nil,
          :dueTime => GoogleApi.Classroom.V1.Model.TimeOfDay.t() | nil,
          :id => String.t() | nil,
          :itemId => String.t() | nil,
          :maxPoints => float() | nil,
          :postId => String.t() | nil,
          :studentViewUri => GoogleApi.Classroom.V1.Model.EmbedUri.t() | nil,
          :studentWorkReviewUri => GoogleApi.Classroom.V1.Model.EmbedUri.t() | nil,
          :teacherViewUri => GoogleApi.Classroom.V1.Model.EmbedUri.t() | nil,
          :title => String.t() | nil
        }

  field(:copyHistory, as: GoogleApi.Classroom.V1.Model.CopyHistory, type: :list)
  field(:courseId)
  field(:dueDate, as: GoogleApi.Classroom.V1.Model.Date)
  field(:dueTime, as: GoogleApi.Classroom.V1.Model.TimeOfDay)
  field(:id)
  field(:itemId)
  field(:maxPoints)
  field(:postId)
  field(:studentViewUri, as: GoogleApi.Classroom.V1.Model.EmbedUri)
  field(:studentWorkReviewUri, as: GoogleApi.Classroom.V1.Model.EmbedUri)
  field(:teacherViewUri, as: GoogleApi.Classroom.V1.Model.EmbedUri)
  field(:title)
end

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

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