# 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.GradingPeriod do
  @moduledoc """
  An individual grading period. Grading periods must not have overlapping date ranges and must be listed in chronological order. For example, if the end_date of a grading period is 2024-01-25, then the start_date of the next grading period must be 2024-01-26 or later. Each grading period must have a unique title within a course.

  ## Attributes

  *   `endDate` (*type:* `GoogleApi.Classroom.V1.Model.Date.t`, *default:* `nil`) - Required. End date, in UTC, of the grading period. Inclusive.
  *   `id` (*type:* `String.t`, *default:* `nil`) - Output only. System generated grading period ID. Read-only.
  *   `startDate` (*type:* `GoogleApi.Classroom.V1.Model.Date.t`, *default:* `nil`) - Required. Start date, in UTC, of the grading period. Inclusive.
  *   `title` (*type:* `String.t`, *default:* `nil`) - Required. Title of the grading period. For example, “Semester 1”.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :endDate => GoogleApi.Classroom.V1.Model.Date.t() | nil,
          :id => String.t() | nil,
          :startDate => GoogleApi.Classroom.V1.Model.Date.t() | nil,
          :title => String.t() | nil
        }

  field(:endDate, as: GoogleApi.Classroom.V1.Model.Date)
  field(:id)
  field(:startDate, as: GoogleApi.Classroom.V1.Model.Date)
  field(:title)
end

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

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