Current section

Files

Jump to
noizu_github lib api structs hook_delivery.ex
Raw

lib/api/structs/hook_delivery.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.HookDelivery do
@moduledoc false
defstruct [
:action,
:delivered_at,
:duration,
:event,
:guid,
:id,
:installation_id,
:redelivery,
:repository_id,
:request,
:response,
:status,
:status_code,
:throttled_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__{
action: Map.get(json, :action),
delivered_at: Map.get(json, :delivered_at),
duration: Map.get(json, :duration),
event: Map.get(json, :event),
guid: Map.get(json, :guid),
id: Map.get(json, :id),
installation_id: Map.get(json, :installation_id),
redelivery: Map.get(json, :redelivery),
repository_id: Map.get(json, :repository_id),
request: Map.get(json, :request),
response: Map.get(json, :response),
status: Map.get(json, :status),
status_code: Map.get(json, :status_code),
throttled_at: Map.get(json, :throttled_at),
url: Map.get(json, :url)
}
end
def from_json(other, _headers), do: other
end