# 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.Rubric do
  @moduledoc """
  The rubric of the course work. A rubric is a scoring guide used to evaluate student work and give feedback. For further details, see [Rubrics structure and known limitations](/classroom/rubrics/limitations).

  ## Attributes

  *   `courseId` (*type:* `String.t`, *default:* `nil`) - Identifier of the course. Read-only.
  *   `courseWorkId` (*type:* `String.t`, *default:* `nil`) - Identifier for the course work this corresponds to. Read-only.
  *   `creationTime` (*type:* `DateTime.t`, *default:* `nil`) - Output only. Timestamp when this rubric was created. Read-only.
  *   `criteria` (*type:* `list(GoogleApi.Classroom.V1.Model.Criterion.t)`, *default:* `nil`) - List of criteria. Each criterion is a dimension on which performance is rated.
  *   `id` (*type:* `String.t`, *default:* `nil`) - Classroom-assigned identifier for the rubric. This is unique among rubrics for the relevant course work. Read-only.
  *   `sourceSpreadsheetId` (*type:* `String.t`, *default:* `nil`) - Input only. Immutable. Google Sheets ID of the spreadsheet. This spreadsheet must contain formatted rubric settings. See [Create or reuse a rubric for an assignment](https://support.google.com/edu/classroom/answer/9335069). Use of this field requires the `https://www.googleapis.com/auth/spreadsheets.readonly` or `https://www.googleapis.com/auth/spreadsheets` scope.
  *   `updateTime` (*type:* `DateTime.t`, *default:* `nil`) - Output only. Timestamp of the most recent change to this rubric. Read-only.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :courseId => String.t() | nil,
          :courseWorkId => String.t() | nil,
          :creationTime => DateTime.t() | nil,
          :criteria => list(GoogleApi.Classroom.V1.Model.Criterion.t()) | nil,
          :id => String.t() | nil,
          :sourceSpreadsheetId => String.t() | nil,
          :updateTime => DateTime.t() | nil
        }

  field(:courseId)
  field(:courseWorkId)
  field(:creationTime, as: DateTime)
  field(:criteria, as: GoogleApi.Classroom.V1.Model.Criterion, type: :list)
  field(:id)
  field(:sourceSpreadsheetId)
  field(:updateTime, as: DateTime)
end

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

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