Current section

Files

Jump to
noizu_github lib api structs code_scanning_alert_instance.ex
Raw

lib/api/structs/code_scanning_alert_instance.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.CodeScanningAlertInstance do
@moduledoc false
defstruct [
:analysis_key,
:category,
:classifications,
:commit_sha,
:environment,
:html_url,
:location,
:message,
:ref,
:state
]
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__{
analysis_key: Map.get(json, :analysis_key),
category: Map.get(json, :category),
classifications: Map.get(json, :classifications),
commit_sha: Map.get(json, :commit_sha),
environment: Map.get(json, :environment),
html_url: Map.get(json, :html_url),
location: Noizu.Github.CodeScanningAlertLocation.from_json(Map.get(json, :location)),
message: Map.get(json, :message),
ref: Map.get(json, :ref),
state: Map.get(json, :state)
}
end
def from_json(other, _headers), do: other
end