Current section

Files

Jump to
noizu_github lib api structs check_suite.ex
Raw

lib/api/structs/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.CheckSuite do
@moduledoc false
defstruct [
:after,
:app,
:before,
:check_runs_url,
:conclusion,
:created_at,
:head_branch,
:head_commit,
:head_sha,
:id,
:latest_check_runs_count,
:node_id,
:pull_requests,
:repository,
:rerequestable,
:runs_rerequestable,
:status,
: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__{
after: Map.get(json, :after),
app: Noizu.Github.NullableIntegration.from_json(Map.get(json, :app)),
before: Map.get(json, :before),
check_runs_url: Map.get(json, :check_runs_url),
conclusion: Map.get(json, :conclusion),
created_at: Map.get(json, :created_at),
head_branch: Map.get(json, :head_branch),
head_commit: Noizu.Github.SimpleCommit.from_json(Map.get(json, :head_commit)),
head_sha: Map.get(json, :head_sha),
id: Map.get(json, :id),
latest_check_runs_count: Map.get(json, :latest_check_runs_count),
node_id: Map.get(json, :node_id),
pull_requests:
Enum.map(
Map.get(json, :pull_requests) || [],
&Noizu.Github.PullRequestMinimal.from_json(&1)
),
repository: Noizu.Github.MinimalRepository.from_json(Map.get(json, :repository)),
rerequestable: Map.get(json, :rerequestable),
runs_rerequestable: Map.get(json, :runs_rerequestable),
status: Map.get(json, :status),
updated_at: Map.get(json, :updated_at),
url: Map.get(json, :url)
}
end
def from_json(other, _headers), do: other
end