Current section
Files
Jump to
Current section
Files
lib/api/structs/projects_v2_view.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.ProjectsV2View do
@moduledoc false
defstruct [
:created_at,
:creator,
:filter,
:group_by,
:html_url,
:id,
:layout,
:name,
:node_id,
:number,
:project_url,
:sort_by,
:updated_at,
:vertical_group_by,
:visible_fields
]
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__{
created_at: Map.get(json, :created_at),
creator: Noizu.Github.SimpleUser.from_json(Map.get(json, :creator)),
filter: Map.get(json, :filter),
group_by: Map.get(json, :group_by),
html_url: Map.get(json, :html_url),
id: Map.get(json, :id),
layout: Map.get(json, :layout),
name: Map.get(json, :name),
node_id: Map.get(json, :node_id),
number: Map.get(json, :number),
project_url: Map.get(json, :project_url),
sort_by: Map.get(json, :sort_by),
updated_at: Map.get(json, :updated_at),
vertical_group_by: Map.get(json, :vertical_group_by),
visible_fields: Map.get(json, :visible_fields)
}
end
def from_json(other, _headers), do: other
end