Current section
Files
Jump to
Current section
Files
lib/api/structs/hook_delivery_item.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.HookDeliveryItem do
@moduledoc false
defstruct [
:action,
:delivered_at,
:duration,
:event,
:guid,
:id,
:installation_id,
:redelivery,
:repository_id,
:status,
:status_code,
:throttled_at
]
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),
status: Map.get(json, :status),
status_code: Map.get(json, :status_code),
throttled_at: Map.get(json, :throttled_at)
}
end
def from_json(other, _headers), do: other
end