Current section

Files

Jump to
noizu_github lib api structs projects_v2_item_with_content.ex
Raw

lib/api/structs/projects_v2_item_with_content.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.ProjectsV2ItemWithContent do
@moduledoc false
defstruct [
:archived_at,
:content,
:content_type,
:created_at,
:creator,
:fields,
:id,
:item_url,
:node_id,
:project_url,
:updated_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__{
archived_at: Map.get(json, :archived_at),
content: Map.get(json, :content),
content_type: Map.get(json, :content_type),
created_at: Map.get(json, :created_at),
creator: Noizu.Github.SimpleUser.from_json(Map.get(json, :creator)),
fields: Map.get(json, :fields),
id: Map.get(json, :id),
item_url: Map.get(json, :item_url),
node_id: Map.get(json, :node_id),
project_url: Map.get(json, :project_url),
updated_at: Map.get(json, :updated_at)
}
end
def from_json(other, _headers), do: other
end