Current section

Files

Jump to
noizu_github lib api structs code_scanning_alert.ex
Raw

lib/api/structs/code_scanning_alert.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.CodeScanningAlert do
@moduledoc false
defstruct [
:assignees,
:created_at,
:dismissal_approved_by,
:dismissed_at,
:dismissed_by,
:dismissed_comment,
:dismissed_reason,
:fixed_at,
:html_url,
:instances_url,
:most_recent_instance,
:number,
:rule,
:state,
:tool,
:updated_at,
:url
]
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__{
assignees:
Enum.map(Map.get(json, :assignees) || [], &Noizu.Github.SimpleUser.from_json(&1)),
created_at: Map.get(json, :created_at),
dismissal_approved_by:
Noizu.Github.NullableSimpleUser.from_json(Map.get(json, :dismissal_approved_by)),
dismissed_at: Map.get(json, :dismissed_at),
dismissed_by: Noizu.Github.NullableSimpleUser.from_json(Map.get(json, :dismissed_by)),
dismissed_comment: Map.get(json, :dismissed_comment),
dismissed_reason: Map.get(json, :dismissed_reason),
fixed_at: Map.get(json, :fixed_at),
html_url: Map.get(json, :html_url),
instances_url: Map.get(json, :instances_url),
most_recent_instance:
Noizu.Github.CodeScanningAlertInstance.from_json(Map.get(json, :most_recent_instance)),
number: Map.get(json, :number),
rule: Noizu.Github.CodeScanningAlertRule.from_json(Map.get(json, :rule)),
state: Map.get(json, :state),
tool: Noizu.Github.CodeScanningAnalysisTool.from_json(Map.get(json, :tool)),
updated_at: Map.get(json, :updated_at),
url: Map.get(json, :url)
}
end
def from_json(other, _headers), do: other
end