Current section
Files
Jump to
Current section
Files
lib/api/structs/organization_programmatic_access_grant_request.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.OrganizationProgrammaticAccessGrantRequest do
@moduledoc false
defstruct [
:created_at,
:id,
:owner,
:permissions,
:reason,
:repositories_url,
:repository_selection,
:token_expired,
:token_expires_at,
:token_id,
:token_last_used_at,
:token_name
]
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__{
created_at: Map.get(json, :created_at),
id: Map.get(json, :id),
owner: Noizu.Github.SimpleUser.from_json(Map.get(json, :owner)),
permissions: Map.get(json, :permissions),
reason: Map.get(json, :reason),
repositories_url: Map.get(json, :repositories_url),
repository_selection: Map.get(json, :repository_selection),
token_expired: Map.get(json, :token_expired),
token_expires_at: Map.get(json, :token_expires_at),
token_id: Map.get(json, :token_id),
token_last_used_at: Map.get(json, :token_last_used_at),
token_name: Map.get(json, :token_name)
}
end
def from_json(other, _headers), do: other
end