Current section

Files

Jump to
noizu_github lib api structs authorization.ex
Raw

lib/api/structs/authorization.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.Authorization do
@moduledoc false
defstruct [
:app,
:created_at,
:expires_at,
:fingerprint,
:hashed_token,
:id,
:installation,
:note,
:note_url,
:scopes,
:token,
:token_last_eight,
:updated_at,
:url,
:user
]
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__{
app: Map.get(json, :app),
created_at: Map.get(json, :created_at),
expires_at: Map.get(json, :expires_at),
fingerprint: Map.get(json, :fingerprint),
hashed_token: Map.get(json, :hashed_token),
id: Map.get(json, :id),
installation:
Noizu.Github.NullableScopedInstallation.from_json(Map.get(json, :installation)),
note: Map.get(json, :note),
note_url: Map.get(json, :note_url),
scopes: Map.get(json, :scopes),
token: Map.get(json, :token),
token_last_eight: Map.get(json, :token_last_eight),
updated_at: Map.get(json, :updated_at),
url: Map.get(json, :url),
user: Noizu.Github.NullableSimpleUser.from_json(Map.get(json, :user))
}
end
def from_json(other, _headers), do: other
end