defmodule GitHub.User.SearchResultItem do
@moduledoc """
Provides struct and type for a User.SearchResultItem
"""
use GitHub.Encoder
@type t :: %__MODULE__{
__info__: map,
avatar_url: String.t(),
bio: String.t() | nil,
blog: String.t() | nil,
company: String.t() | nil,
created_at: DateTime.t() | nil,
email: String.t() | nil,
events_url: String.t(),
followers: integer | nil,
followers_url: String.t(),
following: integer | nil,
following_url: String.t(),
gists_url: String.t(),
gravatar_id: String.t() | nil,
hireable: boolean | nil,
html_url: String.t(),
id: integer,
location: String.t() | nil,
login: String.t(),
name: String.t() | nil,
node_id: String.t(),
organizations_url: String.t(),
public_gists: integer | nil,
public_repos: integer | nil,
received_events_url: String.t(),
repos_url: String.t(),
score: number,
site_admin: boolean,
starred_url: String.t(),
subscriptions_url: String.t(),
suspended_at: DateTime.t() | nil,
text_matches: [GitHub.SearchResultTextMatches.t()] | nil,
type: String.t(),
updated_at: DateTime.t() | nil,
url: String.t()
}
defstruct [
:__info__,
: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
]
@doc false
@spec __fields__(atom) :: keyword
def __fields__(type \\ :t)
def __fields__(:t) do
[
avatar_url: {:string, :uri},
bio: {:union, [{:string, :generic}, :null]},
blog: {:union, [{:string, :generic}, :null]},
company: {:union, [{:string, :generic}, :null]},
created_at: {:string, :date_time},
email: {:union, [{:string, :email}, :null]},
events_url: {:string, :generic},
followers: :integer,
followers_url: {:string, :uri},
following: :integer,
following_url: {:string, :generic},
gists_url: {:string, :generic},
gravatar_id: {:union, [{:string, :generic}, :null]},
hireable: {:union, [:boolean, :null]},
html_url: {:string, :uri},
id: :integer,
location: {:union, [{:string, :generic}, :null]},
login: {:string, :generic},
name: {:union, [{:string, :generic}, :null]},
node_id: {:string, :generic},
organizations_url: {:string, :uri},
public_gists: :integer,
public_repos: :integer,
received_events_url: {:string, :uri},
repos_url: {:string, :uri},
score: :number,
site_admin: :boolean,
starred_url: {:string, :generic},
subscriptions_url: {:string, :uri},
suspended_at: {:union, [{:string, :date_time}, :null]},
text_matches: [{GitHub.SearchResultTextMatches, :t}],
type: {:string, :generic},
updated_at: {:string, :date_time},
url: {:string, :uri}
]
end
end