# 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.AddOnContext do
  @moduledoc """
  Attachment-relevant metadata for Classroom add-ons in the context of a specific post.

  ## Attributes

  *   `courseId` (*type:* `String.t`, *default:* `nil`) - Immutable. Identifier of the course.
  *   `itemId` (*type:* `String.t`, *default:* `nil`) - Immutable. Identifier of the `Announcement`, `CourseWork`, or `CourseWorkMaterial` under which the attachment is attached.
  *   `postId` (*type:* `String.t`, *default:* `nil`) - Immutable. Deprecated, use `item_id` instead.
  *   `studentContext` (*type:* `GoogleApi.Classroom.V1.Model.StudentContext.t`, *default:* `nil`) - Add-on context corresponding to the requesting user's role as a student. Its presence implies that the requesting user is a student in the course.
  *   `supportsStudentWork` (*type:* `boolean()`, *default:* `nil`) - Optional. Whether the post allows the teacher to see student work and passback grades.
  *   `teacherContext` (*type:* `GoogleApi.Classroom.V1.Model.TeacherContext.t`, *default:* `nil`) - Add-on context corresponding to the requesting user's role as a teacher. Its presence implies that the requesting user is a teacher in the course.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :courseId => String.t() | nil,
          :itemId => String.t() | nil,
          :postId => String.t() | nil,
          :studentContext => GoogleApi.Classroom.V1.Model.StudentContext.t() | nil,
          :supportsStudentWork => boolean() | nil,
          :teacherContext => GoogleApi.Classroom.V1.Model.TeacherContext.t() | nil
        }

  field(:courseId)
  field(:itemId)
  field(:postId)
  field(:studentContext, as: GoogleApi.Classroom.V1.Model.StudentContext)
  field(:supportsStudentWork)
  field(:teacherContext, as: GoogleApi.Classroom.V1.Model.TeacherContext)
end

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

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