Current section
Files
Jump to
Current section
Files
lib/api/structs/collection/issue_comment.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.IssueComment 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.IssueComment.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.IssueComment.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