Current section
Files
Jump to
Current section
Files
lib/api/structs/installation.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.Installation do
@moduledoc false
defstruct [
:access_tokens_url,
:account,
:app_id,
:app_slug,
:client_id,
:contact_email,
:created_at,
:events,
:has_multiple_single_files,
:html_url,
:id,
:permissions,
:repositories_url,
:repository_selection,
:single_file_name,
:single_file_paths,
:suspended_at,
:suspended_by,
:target_id,
:target_type,
: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__{
access_tokens_url: Map.get(json, :access_tokens_url),
account: Map.get(json, :account),
app_id: Map.get(json, :app_id),
app_slug: Map.get(json, :app_slug),
client_id: Map.get(json, :client_id),
contact_email: Map.get(json, :contact_email),
created_at: Map.get(json, :created_at),
events: Map.get(json, :events),
has_multiple_single_files: Map.get(json, :has_multiple_single_files),
html_url: Map.get(json, :html_url),
id: Map.get(json, :id),
permissions: Noizu.Github.AppPermissions.from_json(Map.get(json, :permissions)),
repositories_url: Map.get(json, :repositories_url),
repository_selection: Map.get(json, :repository_selection),
single_file_name: Map.get(json, :single_file_name),
single_file_paths: Map.get(json, :single_file_paths),
suspended_at: Map.get(json, :suspended_at),
suspended_by: Noizu.Github.NullableSimpleUser.from_json(Map.get(json, :suspended_by)),
target_id: Map.get(json, :target_id),
target_type: Map.get(json, :target_type),
updated_at: Map.get(json, :updated_at)
}
end
def from_json(other, _headers), do: other
end