Current section
Files
Jump to
Current section
Files
lib/api/structs/workflow_run.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.WorkflowRun do
@moduledoc false
defstruct [
:actor,
:artifacts_url,
:cancel_url,
:check_suite_id,
:check_suite_node_id,
:check_suite_url,
:conclusion,
:created_at,
:display_title,
:event,
:head_branch,
:head_commit,
:head_repository,
:head_repository_id,
:head_sha,
:html_url,
:id,
:jobs_url,
:logs_url,
:name,
:node_id,
:path,
:previous_attempt_url,
:pull_requests,
:referenced_workflows,
:repository,
:rerun_url,
:run_attempt,
:run_number,
:run_started_at,
:status,
:triggering_actor,
:updated_at,
:url,
:workflow_id,
:workflow_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__{
actor: Noizu.Github.SimpleUser.from_json(Map.get(json, :actor)),
artifacts_url: Map.get(json, :artifacts_url),
cancel_url: Map.get(json, :cancel_url),
check_suite_id: Map.get(json, :check_suite_id),
check_suite_node_id: Map.get(json, :check_suite_node_id),
check_suite_url: Map.get(json, :check_suite_url),
conclusion: Map.get(json, :conclusion),
created_at: Map.get(json, :created_at),
display_title: Map.get(json, :display_title),
event: Map.get(json, :event),
head_branch: Map.get(json, :head_branch),
head_commit: Noizu.Github.NullableSimpleCommit.from_json(Map.get(json, :head_commit)),
head_repository: Noizu.Github.MinimalRepository.from_json(Map.get(json, :head_repository)),
head_repository_id: Map.get(json, :head_repository_id),
head_sha: Map.get(json, :head_sha),
html_url: Map.get(json, :html_url),
id: Map.get(json, :id),
jobs_url: Map.get(json, :jobs_url),
logs_url: Map.get(json, :logs_url),
name: Map.get(json, :name),
node_id: Map.get(json, :node_id),
path: Map.get(json, :path),
previous_attempt_url: Map.get(json, :previous_attempt_url),
pull_requests:
Enum.map(
Map.get(json, :pull_requests) || [],
&Noizu.Github.PullRequestMinimal.from_json(&1)
),
referenced_workflows:
Enum.map(
Map.get(json, :referenced_workflows) || [],
&Noizu.Github.ReferencedWorkflow.from_json(&1)
),
repository: Noizu.Github.MinimalRepository.from_json(Map.get(json, :repository)),
rerun_url: Map.get(json, :rerun_url),
run_attempt: Map.get(json, :run_attempt),
run_number: Map.get(json, :run_number),
run_started_at: Map.get(json, :run_started_at),
status: Map.get(json, :status),
triggering_actor: Noizu.Github.SimpleUser.from_json(Map.get(json, :triggering_actor)),
updated_at: Map.get(json, :updated_at),
url: Map.get(json, :url),
workflow_id: Map.get(json, :workflow_id),
workflow_url: Map.get(json, :workflow_url)
}
end
def from_json(other, _headers), do: other
end