Current section

Files

Jump to
noizu_github lib api structs user_search_result_item.ex
Raw

lib/api/structs/user_search_result_item.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.UserSearchResultItem do
@moduledoc false
defstruct [
:avatar_url,
:bio,
:blog,
:company,
:created_at,
:email,
:events_url,
:followers,
:followers_url,
:following,
:following_url,
:gists_url,
:gravatar_id,
:hireable,
:html_url,
:id,
:location,
:login,
:name,
:node_id,
:organizations_url,
:public_gists,
:public_repos,
:received_events_url,
:repos_url,
:score,
:site_admin,
:starred_url,
:subscriptions_url,
:suspended_at,
:text_matches,
:type,
:updated_at,
:url,
:user_view_type
]
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__{
avatar_url: Map.get(json, :avatar_url),
bio: Map.get(json, :bio),
blog: Map.get(json, :blog),
company: Map.get(json, :company),
created_at: Map.get(json, :created_at),
email: Map.get(json, :email),
events_url: Map.get(json, :events_url),
followers: Map.get(json, :followers),
followers_url: Map.get(json, :followers_url),
following: Map.get(json, :following),
following_url: Map.get(json, :following_url),
gists_url: Map.get(json, :gists_url),
gravatar_id: Map.get(json, :gravatar_id),
hireable: Map.get(json, :hireable),
html_url: Map.get(json, :html_url),
id: Map.get(json, :id),
location: Map.get(json, :location),
login: Map.get(json, :login),
name: Map.get(json, :name),
node_id: Map.get(json, :node_id),
organizations_url: Map.get(json, :organizations_url),
public_gists: Map.get(json, :public_gists),
public_repos: Map.get(json, :public_repos),
received_events_url: Map.get(json, :received_events_url),
repos_url: Map.get(json, :repos_url),
score: Map.get(json, :score),
site_admin: Map.get(json, :site_admin),
starred_url: Map.get(json, :starred_url),
subscriptions_url: Map.get(json, :subscriptions_url),
suspended_at: Map.get(json, :suspended_at),
text_matches: Map.get(json, :text_matches),
type: Map.get(json, :type),
updated_at: Map.get(json, :updated_at),
url: Map.get(json, :url),
user_view_type: Map.get(json, :user_view_type)
}
end
def from_json(other, _headers), do: other
end