# 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.GradeHistory do
  @moduledoc """
  The history of each grade on this submission.

  ## Attributes

  *   `actorUserId` (*type:* `String.t`, *default:* `nil`) - The teacher who made the grade change.
  *   `gradeChangeType` (*type:* `String.t`, *default:* `nil`) - The type of grade change at this time in the submission grade history.
  *   `gradeTimestamp` (*type:* `DateTime.t`, *default:* `nil`) - When the grade of the submission was changed.
  *   `maxPoints` (*type:* `float()`, *default:* `nil`) - The denominator of the grade at this time in the submission grade history.
  *   `pointsEarned` (*type:* `float()`, *default:* `nil`) - The numerator of the grade at this time in the submission grade history.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :actorUserId => String.t() | nil,
          :gradeChangeType => String.t() | nil,
          :gradeTimestamp => DateTime.t() | nil,
          :maxPoints => float() | nil,
          :pointsEarned => float() | nil
        }

  field(:actorUserId)
  field(:gradeChangeType)
  field(:gradeTimestamp, as: DateTime)
  field(:maxPoints)
  field(:pointsEarned)
end

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

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