Current section

Files

Jump to
noizu_github lib api structs check_run_with_simple_check_suite.ex
Raw

lib/api/structs/check_run_with_simple_check_suite.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.CheckRunWithSimpleCheckSuite do
@moduledoc false
defstruct [
:app,
:check_suite,
:completed_at,
:conclusion,
:deployment,
:details_url,
:external_id,
:head_sha,
:html_url,
:id,
:name,
:node_id,
:output,
:pull_requests,
:started_at,
:status,
: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__{
app: Noizu.Github.Integration.from_json(Map.get(json, :app)),
check_suite: Noizu.Github.SimpleCheckSuite.from_json(Map.get(json, :check_suite)),
completed_at: Map.get(json, :completed_at),
conclusion: Map.get(json, :conclusion),
deployment: Noizu.Github.DeploymentSimple.from_json(Map.get(json, :deployment)),
details_url: Map.get(json, :details_url),
external_id: Map.get(json, :external_id),
head_sha: Map.get(json, :head_sha),
html_url: Map.get(json, :html_url),
id: Map.get(json, :id),
name: Map.get(json, :name),
node_id: Map.get(json, :node_id),
output: Map.get(json, :output),
pull_requests:
Enum.map(
Map.get(json, :pull_requests) || [],
&Noizu.Github.PullRequestMinimal.from_json(&1)
),
started_at: Map.get(json, :started_at),
status: Map.get(json, :status),
url: Map.get(json, :url)
}
end
def from_json(other, _headers), do: other
end