Current section

Files

Jump to
noizu_github lib api structs license_content.ex
Raw

lib/api/structs/license_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.LicenseContent do
@moduledoc false
defstruct [
:_links,
:content,
:download_url,
:encoding,
:git_url,
:html_url,
:license,
:name,
:path,
:sha,
:size,
:type,
:url
]
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__{
_links: Map.get(json, :_links),
content: Map.get(json, :content),
download_url: Map.get(json, :download_url),
encoding: Map.get(json, :encoding),
git_url: Map.get(json, :git_url),
html_url: Map.get(json, :html_url),
license: Noizu.Github.NullableLicenseSimple.from_json(Map.get(json, :license)),
name: Map.get(json, :name),
path: Map.get(json, :path),
sha: Map.get(json, :sha),
size: Map.get(json, :size),
type: Map.get(json, :type),
url: Map.get(json, :url)
}
end
def from_json(other, _headers), do: other
end