View Source Tentacat.Gists (Tentacat v2.4.0)
Summary
Functions
Check if a gist is starred.
Create a new gist for the authenticated user.
Deleting a gist requires admin access.
Edit a gist.
Fork a gist.
Get a specific revision of a gist.
Get a single gist.
List gist commits.
List current user's gists.
List all public gists.
List starred gists.
List users gists.
Star a gist.
Unstar a gist.
Functions
@spec check_if_starred(Tentacat.Client.t(), binary()) :: Tentacat.response()
Check if a gist is starred.
Example
Tentacat.Gists.check_if_starred(client, "")
More info: https://developer.github.com/v3/gists/#check-if-a-gist-is-starred
@spec create(Tentacat.Client.t(), map()) :: Tentacat.response()
Create a new gist for the authenticated user.
Gist body example:
%{
"files" => %{
"hello.rb" => %{"content" => "puts 'Hello World'"},
"hello.py" => %{"content" => "print 'Hello World'"}
},
"description" => "Hello World Examples",
"public" => false
}
Example
Tentacat.Gists.create(client, body)
More info at: https://developer.github.com/v3/gists/#create-a-gist
@spec delete(Tentacat.Client.t(), binary()) :: Tentacat.response()
Deleting a gist requires admin access.
If OAuth is used, the gist scope is required.
Example
Tentacat.Gists.delete(client, "fe771b85eeeff878d177b0c0f3840afd")
More info at: https://developer.github.com/v3/gists/#delete-a-gist
@spec edit(Tentacat.Client.t(), binary(), map()) :: Tentacat.response()
Edit a gist.
Gist body example:
%{
"description" => "Hello World Examples",
"files" => %{
"hello_world_ruby.txt" => %{
"content" => "Run `ruby hello.rb` or `python hello.py` to print Hello World",
"filename" => "hello.md"
},
"hello_world_python.txt" => nil,
"new_file.txt" => %{
"content" => "This is a new placeholder file."
}
}
}
Example
Tentacat.Gists.edit(client, "fe771b85eeeff878d177b0c0f3840afd", body)
More info at: https://developer.github.com/v3/gists/#edit-a-gist
@spec fork(Tentacat.Client.t(), binary()) :: Tentacat.response()
Fork a gist.
Example
Tentacat.Gists.fork(client, "fe771b85eeeff878d177b0c0f3840afd")
More info: https://developer.github.com/v3/gists/#fork-a-gist
@spec get_revision(Tentacat.Client.t(), binary(), binary()) :: Tentacat.response()
Get a specific revision of a gist.
Example
Tentacat.Gists.get_revision("fe771b85eeeff878d177b0c0f3840afd", "0ba06a873509677ab40b8ed5575f249a55c6fc41")
Tentacat.Gists.get_revision(client, "fe771b85eeeff878d177b0c0f3840afd", "0ba06a873509677ab40b8ed5575f249a55c6fc41")
More info at: https://developer.github.com/v3/gists/#get-a-specific-revision-of-a-gist
@spec gist_get(Tentacat.Client.t(), binary()) :: Tentacat.response()
Get a single gist.
Example
Tentacat.Gists.gist_get("fe771b85eeeff878d177b0c0f3840afd")
Tentacat.Gists.gist_get(client, "fe771b85eeeff878d177b0c0f3840afd")
More info at: https://developer.github.com/v3/gists/#get-a-single-gist
@spec list_commits(Tentacat.Client.t(), binary()) :: Tentacat.response()
List gist commits.
Example
Tentacat.Gists.list_commits("fe771b85eeeff878d177b0c0f3840afd")
Tentacat.Gists.list_commits(client, "fe771b85eeeff878d177b0c0f3840afd")
More info at: https://developer.github.com/v3/gists/#list-gist-commits
@spec list_forks(Tentacat.Client.t(), binary(), Keyword.t()) :: Tentacat.response()
List forks.
Example
Tentacat.Gists.list_forks("fe771b85eeeff878d177b0c0f3840afd")
Tentacat.Gists.list_forks(client, "fe771b85eeeff878d177b0c0f3840afd")
More info at: https://developer.github.com/v3/gists/#list-gist-forks
List current user's gists.
Examples
Tentacat.Gists.list_mine(client)
More info at: https://developer.github.com/v3/gists/#list-a-users-gists
@spec list_public(Tentacat.Client.t(), Keyword.t(), Keyword.t()) :: Tentacat.response()
List all public gists.
Example
Tentacat.Gists.list_public
Tentacat.Gists.list_public(client)
More info at: https://developer.github.com/v3/gists/#list-all-public-gists
@spec list_starred(Tentacat.Client.t(), Keyword.t(), Keyword.t()) :: Tentacat.response()
List starred gists.
Example
Tentacat.Gists.list_starred(client)
More info at: https://developer.github.com/v3/gists/#list-starred-gists
list_users(client \\ %Client{}, owner, params \\ [], options \\ [])
View Source@spec list_users(Tentacat.Client.t(), binary(), Keyword.t(), Keyword.t()) :: Tentacat.response()
List users gists.
Example
Tentacat.Gists.list_users(client, "steve")
Tentacat.Gists.list_users("steve")
More info at: https://developer.github.com/v3/gists/#list-a-users-gists
@spec star(Tentacat.Client.t(), binary()) :: Tentacat.response()
Star a gist.
Example
Tentacat.Gists.star(client, "fe771b85eeeff878d177b0c0f3840afd")
More info: https://developer.github.com/v3/gists/#star-a-gist
@spec unstar(Tentacat.Client.t(), binary()) :: Tentacat.response()
Unstar a gist.
Example
Tentacat.Gists.unstar(client, "fe771b85eeeff878d177b0c0f3840afd")
More info: https://developer.github.com/v3/gists/#unstar-a-gist