Current section

Files

Jump to
noizu_github lib api structs activity.ex
Raw

lib/api/structs/activity.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.Activity do
@moduledoc false
defstruct [
:activity_type,
:actor,
:after,
:before,
:id,
:node_id,
:ref,
:timestamp
]
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__{
activity_type: Map.get(json, :activity_type),
actor: Noizu.Github.NullableSimpleUser.from_json(Map.get(json, :actor)),
after: Map.get(json, :after),
before: Map.get(json, :before),
id: Map.get(json, :id),
node_id: Map.get(json, :node_id),
ref: Map.get(json, :ref),
timestamp: Map.get(json, :timestamp)
}
end
def from_json(other, _headers), do: other
end