# 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.CourseWork do
  @moduledoc """
  Course work created by a teacher for students of the course.

  ## Attributes

  *   `alternateLink` (*type:* `String.t`, *default:* `nil`) - Absolute link to this course work in the Classroom web UI. This is only populated if `state` is `PUBLISHED`. Read-only.
  *   `assigneeMode` (*type:* `String.t`, *default:* `nil`) - Assignee mode of the coursework. If unspecified, the default value is `ALL_STUDENTS`.
  *   `assignment` (*type:* `GoogleApi.Classroom.V1.Model.Assignment.t`, *default:* `nil`) - Assignment details. This is populated only when `work_type` is `ASSIGNMENT`. Read-only.
  *   `associatedWithDeveloper` (*type:* `boolean()`, *default:* `nil`) - Whether this course work item is associated with the Developer Console project making the request. See CreateCourseWork for more details. Read-only.
  *   `courseId` (*type:* `String.t`, *default:* `nil`) - Identifier of the course. Read-only.
  *   `creationTime` (*type:* `DateTime.t`, *default:* `nil`) - Timestamp when this course work was created. Read-only.
  *   `creatorUserId` (*type:* `String.t`, *default:* `nil`) - Identifier for the user that created the coursework. Read-only.
  *   `description` (*type:* `String.t`, *default:* `nil`) - Optional description of this course work. If set, the description must be a valid UTF-8 string containing no more than 30,000 characters.
  *   `dueDate` (*type:* `GoogleApi.Classroom.V1.Model.Date.t`, *default:* `nil`) - Optional date, in UTC, that submissions for this course work are due. This must be specified if `due_time` is specified.
  *   `dueTime` (*type:* `GoogleApi.Classroom.V1.Model.TimeOfDay.t`, *default:* `nil`) - Optional time of day, in UTC, that submissions for this course work are due. This must be specified if `due_date` is specified.
  *   `gradeCategory` (*type:* `GoogleApi.Classroom.V1.Model.GradeCategory.t`, *default:* `nil`) - The category that this coursework's grade contributes to. Present only when a category has been chosen for the coursework. May be used in calculating the overall grade. Read-only.
  *   `gradingPeriodId` (*type:* `String.t`, *default:* `nil`) - Identifier of the grading period associated with the coursework. * At creation, if unspecified, the grading period ID will be set based on the `dueDate` (or `scheduledTime` if no `dueDate` is set). * To indicate no association to any grading period, set this field to an empty string (""). * If specified, it must match an existing grading period ID in the course.
  *   `id` (*type:* `String.t`, *default:* `nil`) - Classroom-assigned identifier of this course work, unique per course. Read-only.
  *   `individualStudentsOptions` (*type:* `GoogleApi.Classroom.V1.Model.IndividualStudentsOptions.t`, *default:* `nil`) - Identifiers of students with access to the coursework. This field is set only if `assigneeMode` is `INDIVIDUAL_STUDENTS`. If the `assigneeMode` is `INDIVIDUAL_STUDENTS`, then only students specified in this field are assigned the coursework.
  *   `materials` (*type:* `list(GoogleApi.Classroom.V1.Model.Material.t)`, *default:* `nil`) - Additional materials. CourseWork must have no more than 20 material items.
  *   `maxPoints` (*type:* `float()`, *default:* `nil`) - Maximum grade for this course work. If zero or unspecified, this assignment is considered ungraded. This must be a non-negative integer value.
  *   `multipleChoiceQuestion` (*type:* `GoogleApi.Classroom.V1.Model.MultipleChoiceQuestion.t`, *default:* `nil`) - Multiple choice question details. For read operations, this field is populated only when `work_type` is `MULTIPLE_CHOICE_QUESTION`. For write operations, this field must be specified when creating course work with a `work_type` of `MULTIPLE_CHOICE_QUESTION`, and it must not be set otherwise.
  *   `scheduledTime` (*type:* `DateTime.t`, *default:* `nil`) - Optional timestamp when this course work is scheduled to be published.
  *   `state` (*type:* `String.t`, *default:* `nil`) - Status of this course work. If unspecified, the default state is `DRAFT`.
  *   `submissionModificationMode` (*type:* `String.t`, *default:* `nil`) - Setting to determine when students are allowed to modify submissions. If unspecified, the default value is `MODIFIABLE_UNTIL_TURNED_IN`.
  *   `title` (*type:* `String.t`, *default:* `nil`) - Title of this course work. The title must be a valid UTF-8 string containing between 1 and 3000 characters.
  *   `topicId` (*type:* `String.t`, *default:* `nil`) - Identifier for the topic that this coursework is associated with. Must match an existing topic in the course.
  *   `updateTime` (*type:* `DateTime.t`, *default:* `nil`) - Timestamp of the most recent change to this course work. Read-only.
  *   `workType` (*type:* `String.t`, *default:* `nil`) - Type of this course work. The type is set when the course work is created and cannot be changed.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :alternateLink => String.t() | nil,
          :assigneeMode => String.t() | nil,
          :assignment => GoogleApi.Classroom.V1.Model.Assignment.t() | nil,
          :associatedWithDeveloper => boolean() | nil,
          :courseId => String.t() | nil,
          :creationTime => DateTime.t() | nil,
          :creatorUserId => String.t() | nil,
          :description => String.t() | nil,
          :dueDate => GoogleApi.Classroom.V1.Model.Date.t() | nil,
          :dueTime => GoogleApi.Classroom.V1.Model.TimeOfDay.t() | nil,
          :gradeCategory => GoogleApi.Classroom.V1.Model.GradeCategory.t() | nil,
          :gradingPeriodId => String.t() | nil,
          :id => String.t() | nil,
          :individualStudentsOptions =>
            GoogleApi.Classroom.V1.Model.IndividualStudentsOptions.t() | nil,
          :materials => list(GoogleApi.Classroom.V1.Model.Material.t()) | nil,
          :maxPoints => float() | nil,
          :multipleChoiceQuestion =>
            GoogleApi.Classroom.V1.Model.MultipleChoiceQuestion.t() | nil,
          :scheduledTime => DateTime.t() | nil,
          :state => String.t() | nil,
          :submissionModificationMode => String.t() | nil,
          :title => String.t() | nil,
          :topicId => String.t() | nil,
          :updateTime => DateTime.t() | nil,
          :workType => String.t() | nil
        }

  field(:alternateLink)
  field(:assigneeMode)
  field(:assignment, as: GoogleApi.Classroom.V1.Model.Assignment)
  field(:associatedWithDeveloper)
  field(:courseId)
  field(:creationTime, as: DateTime)
  field(:creatorUserId)
  field(:description)
  field(:dueDate, as: GoogleApi.Classroom.V1.Model.Date)
  field(:dueTime, as: GoogleApi.Classroom.V1.Model.TimeOfDay)
  field(:gradeCategory, as: GoogleApi.Classroom.V1.Model.GradeCategory)
  field(:gradingPeriodId)
  field(:id)
  field(:individualStudentsOptions, as: GoogleApi.Classroom.V1.Model.IndividualStudentsOptions)
  field(:materials, as: GoogleApi.Classroom.V1.Model.Material, type: :list)
  field(:maxPoints)
  field(:multipleChoiceQuestion, as: GoogleApi.Classroom.V1.Model.MultipleChoiceQuestion)
  field(:scheduledTime, as: DateTime)
  field(:state)
  field(:submissionModificationMode)
  field(:title)
  field(:topicId)
  field(:updateTime, as: DateTime)
  field(:workType)
end

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

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