Current section

Files

Jump to
noizu_github lib api structs collection integration.ex
Raw

lib/api/structs/collection/integration.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.Collection.Integration do
@moduledoc false
defstruct [:items, :complete, :total, :links]
def from_json(json, headers \\ [])
def from_json(list, headers) when is_list(list) do
%__MODULE__{
items: Enum.map(list, &Noizu.Github.Integration.from_json(&1)),
complete: true,
total: length(list),
links: Noizu.Github.extract_links(headers)
}
end
def from_json(%{items: items} = env, headers) when is_list(items) do
%__MODULE__{
items: Enum.map(items, &Noizu.Github.Integration.from_json(&1)),
complete: !Map.get(env, :incomplete_results, false),
total: Map.get(env, :total_count, length(items)),
links: Noizu.Github.extract_links(headers)
}
end
def from_json(other, headers) do
%__MODULE__{items: other, links: Noizu.Github.extract_links(headers)}
end
end