lib/schemas/commit/comment.ex

defmodule GitHub.Commit.Comment do
  @moduledoc """
  Provides struct and type for CommitComment
  """
  use GitHub.Encoder

  @type t :: %__MODULE__{
          __info__: map,
          author_association: String.t(),
          body: String.t(),
          commit_id: String.t(),
          created_at: String.t(),
          html_url: String.t(),
          id: integer,
          line: integer | nil,
          node_id: String.t(),
          path: String.t() | nil,
          position: integer | nil,
          reactions: GitHub.Reaction.Rollup.t() | nil,
          updated_at: String.t(),
          url: String.t(),
          user: GitHub.User.simple() | nil
        }

  defstruct [
    :__info__,
    :author_association,
    :body,
    :commit_id,
    :created_at,
    :html_url,
    :id,
    :line,
    :node_id,
    :path,
    :position,
    :reactions,
    :updated_at,
    :url,
    :user
  ]

  @doc false
  @spec __fields__(atom) :: keyword
  def __fields__(type \\ :t)

  def __fields__(:t) do
    [
      author_association: :string,
      body: :string,
      commit_id: :string,
      created_at: :string,
      html_url: :string,
      id: :integer,
      line: {:nullable, :integer},
      node_id: :string,
      path: {:nullable, :string},
      position: {:nullable, :integer},
      reactions: {GitHub.Reaction.Rollup, :t},
      updated_at: :string,
      url: :string,
      user: {:nullable, {GitHub.User, :simple}}
    ]
  end
end