Current section
Files
Jump to
Current section
Files
lib/api/structs/deployment_status.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.DeploymentStatus do
@moduledoc false
defstruct [
:created_at,
:creator,
:deployment_url,
:description,
:environment,
:environment_url,
:id,
:log_url,
:node_id,
:performed_via_github_app,
:repository_url,
:state,
:target_url,
: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__{
created_at: Map.get(json, :created_at),
creator: Noizu.Github.NullableSimpleUser.from_json(Map.get(json, :creator)),
deployment_url: Map.get(json, :deployment_url),
description: Map.get(json, :description),
environment: Map.get(json, :environment),
environment_url: Map.get(json, :environment_url),
id: Map.get(json, :id),
log_url: Map.get(json, :log_url),
node_id: Map.get(json, :node_id),
performed_via_github_app:
Noizu.Github.NullableIntegration.from_json(Map.get(json, :performed_via_github_app)),
repository_url: Map.get(json, :repository_url),
state: Map.get(json, :state),
target_url: Map.get(json, :target_url),
updated_at: Map.get(json, :updated_at),
url: Map.get(json, :url)
}
end
def from_json(other, _headers), do: other
end