Current section
Files
Jump to
Current section
Files
lib/api/structs/nullable_issue.ex
# Generated by `mix github.gen` from docs/github-api/api.github.com.json.
# Do not edit by hand; re-run the task instead.
defmodule Noizu.Github.NullableIssue do
@moduledoc false
defstruct [
:active_lock_reason,
:assignee,
:assignees,
:author_association,
:body,
:body_html,
:body_text,
:closed_at,
:closed_by,
:comments,
:comments_url,
:created_at,
:draft,
:events_url,
:html_url,
:id,
:issue_dependencies_summary,
:issue_field_values,
:labels,
:labels_url,
:locked,
:milestone,
:node_id,
:number,
:parent_issue_url,
:performed_via_github_app,
:pinned_comment,
:pull_request,
:reactions,
:repository,
:repository_url,
:state,
:state_reason,
:sub_issues_summary,
:timeline_url,
:title,
:type,
:updated_at,
:url,
:user
]
def from_json(json, headers \\ [])
def from_json(nil, _headers), do: nil
def from_json(list, headers) when is_list(list) do
Enum.map(list, &from_json(&1, headers))
end
def from_json(json, _headers) when is_map(json) do
%__MODULE__{
active_lock_reason: Map.get(json, :active_lock_reason),
assignee: Noizu.Github.NullableSimpleUser.from_json(Map.get(json, :assignee)),
assignees:
Enum.map(Map.get(json, :assignees) || [], &Noizu.Github.SimpleUser.from_json(&1)),
author_association: Map.get(json, :author_association),
body: Map.get(json, :body),
body_html: Map.get(json, :body_html),
body_text: Map.get(json, :body_text),
closed_at: Map.get(json, :closed_at),
closed_by: Noizu.Github.NullableSimpleUser.from_json(Map.get(json, :closed_by)),
comments: Map.get(json, :comments),
comments_url: Map.get(json, :comments_url),
created_at: Map.get(json, :created_at),
draft: Map.get(json, :draft),
events_url: Map.get(json, :events_url),
html_url: Map.get(json, :html_url),
id: Map.get(json, :id),
issue_dependencies_summary:
Noizu.Github.IssueDependenciesSummary.from_json(
Map.get(json, :issue_dependencies_summary)
),
issue_field_values:
Enum.map(
Map.get(json, :issue_field_values) || [],
&Noizu.Github.IssueFieldValue.from_json(&1)
),
labels: Map.get(json, :labels),
labels_url: Map.get(json, :labels_url),
locked: Map.get(json, :locked),
milestone: Noizu.Github.NullableMilestone.from_json(Map.get(json, :milestone)),
node_id: Map.get(json, :node_id),
number: Map.get(json, :number),
parent_issue_url: Map.get(json, :parent_issue_url),
performed_via_github_app:
Noizu.Github.NullableIntegration.from_json(Map.get(json, :performed_via_github_app)),
pinned_comment: Noizu.Github.NullableIssueComment.from_json(Map.get(json, :pinned_comment)),
pull_request: Map.get(json, :pull_request),
reactions: Noizu.Github.ReactionRollup.from_json(Map.get(json, :reactions)),
repository: Noizu.Github.Repository.from_json(Map.get(json, :repository)),
repository_url: Map.get(json, :repository_url),
state: Map.get(json, :state),
state_reason: Map.get(json, :state_reason),
sub_issues_summary:
Noizu.Github.SubIssuesSummary.from_json(Map.get(json, :sub_issues_summary)),
timeline_url: Map.get(json, :timeline_url),
title: Map.get(json, :title),
type: Noizu.Github.IssueType.from_json(Map.get(json, :type)),
updated_at: Map.get(json, :updated_at),
url: Map.get(json, :url),
user: Noizu.Github.NullableSimpleUser.from_json(Map.get(json, :user))
}
end
def from_json(other, _headers), do: other
end