View Source GitHub.Gists (GitHub REST API Client v0.2.2)
Provides API endpoints related to gists
Link to this section Summary
Functions
Check if a gist is starred
Create a gist
Create a gist comment
Delete a gist
Delete a gist comment
Fork a gist
Get a gist
Get a gist comment
Get a gist revision
List gists for the authenticated user
List gist comments
List gist commits
List gists for a user
List gist forks
List public gists
List starred gists
Star a gist
Unstar a gist
Update a gist
Update a gist comment
Link to this section Functions
@spec check_is_starred( String.t(), keyword() ) :: :ok | {:error, GitHub.Error.t()}
Check if a gist is starred
resources
Resources
@spec create( map(), keyword() ) :: {:ok, GitHub.Gist.simple()} | {:error, GitHub.Error.t()}
Create a gist
Allows you to add a new gist with one or more files.
Note: Don't name your files "gistfile" with a numerical suffix. This is the format of the automatic naming scheme that Gist uses internally.
resources
Resources
@spec create_comment(String.t(), map(), keyword()) :: {:ok, GitHub.Gist.Comment.t()} | {:error, GitHub.Error.t()}
Create a gist comment
resources
Resources
@spec delete( String.t(), keyword() ) :: :ok | {:error, GitHub.Error.t()}
Delete a gist
resources
Resources
@spec delete_comment(String.t(), integer(), keyword()) :: :ok | {:error, GitHub.Error.t()}
Delete a gist comment
resources
Resources
@spec fork( String.t(), keyword() ) :: {:ok, GitHub.BaseGist.t()} | {:error, GitHub.Error.t()}
Fork a gist
resources
Resources
@spec get( String.t(), keyword() ) :: {:ok, GitHub.Gist.simple()} | {:error, GitHub.Error.t()}
Get a gist
resources
Resources
@spec get_comment(String.t(), integer(), keyword()) :: {:ok, GitHub.Gist.Comment.t()} | {:error, GitHub.Error.t()}
Get a gist comment
resources
Resources
@spec get_revision(String.t(), String.t(), keyword()) :: {:ok, GitHub.Gist.simple()} | {:error, GitHub.Error.t()}
Get a gist revision
resources
Resources
@spec list(keyword()) :: {:ok, [GitHub.BaseGist.t()]} | {:error, GitHub.Error.t()}
List gists for the authenticated user
Lists the authenticated user's gists or if called anonymously, this endpoint returns all public gists:
options
Options
since
: Only show results that were last updated after the given time. This is a timestamp in ISO 8601 format:YYYY-MM-DDTHH:MM:SSZ
.per_page
: The number of results per page (max 100).page
: Page number of the results to fetch.
resources
Resources
@spec list_comments( String.t(), keyword() ) :: {:ok, [GitHub.Gist.Comment.t()]} | {:error, GitHub.Error.t()}
List gist comments
options
Options
per_page
: The number of results per page (max 100).page
: Page number of the results to fetch.
resources
Resources
@spec list_commits( String.t(), keyword() ) :: {:ok, [GitHub.Gist.Commit.t()]} | {:error, GitHub.Error.t()}
List gist commits
options
Options
per_page
: The number of results per page (max 100).page
: Page number of the results to fetch.
resources
Resources
@spec list_for_user( String.t(), keyword() ) :: {:ok, [GitHub.BaseGist.t()]} | {:error, GitHub.Error.t()}
List gists for a user
Lists public gists for the specified user:
options
Options
since
: Only show results that were last updated after the given time. This is a timestamp in ISO 8601 format:YYYY-MM-DDTHH:MM:SSZ
.per_page
: The number of results per page (max 100).page
: Page number of the results to fetch.
resources
Resources
@spec list_forks( String.t(), keyword() ) :: {:ok, [GitHub.Gist.simple()]} | {:error, GitHub.Error.t()}
List gist forks
options
Options
per_page
: The number of results per page (max 100).page
: Page number of the results to fetch.
resources
Resources
@spec list_public(keyword()) :: {:ok, [GitHub.BaseGist.t()]} | {:error, GitHub.Error.t()}
List public gists
List public gists sorted by most recently updated to least recently updated.
Note: With pagination, you can fetch up to 3000 gists. For example, you can fetch 100 pages with 30 gists per page or 30 pages with 100 gists per page.
options
Options
since
: Only show results that were last updated after the given time. This is a timestamp in ISO 8601 format:YYYY-MM-DDTHH:MM:SSZ
.per_page
: The number of results per page (max 100).page
: Page number of the results to fetch.
resources
Resources
@spec list_starred(keyword()) :: {:ok, [GitHub.BaseGist.t()]} | {:error, GitHub.Error.t()}
List starred gists
List the authenticated user's starred gists:
options
Options
since
: Only show results that were last updated after the given time. This is a timestamp in ISO 8601 format:YYYY-MM-DDTHH:MM:SSZ
.per_page
: The number of results per page (max 100).page
: Page number of the results to fetch.
resources
Resources
@spec star( String.t(), keyword() ) :: :ok | {:error, GitHub.Error.t()}
Star a gist
Note that you'll need to set Content-Length
to zero when calling out to this endpoint. For more information, see "HTTP verbs."
resources
Resources
@spec unstar( String.t(), keyword() ) :: :ok | {:error, GitHub.Error.t()}
Unstar a gist
resources
Resources
@spec update(String.t(), map() | nil, keyword()) :: {:ok, GitHub.Gist.simple()} | {:error, GitHub.Error.t()}
Update a gist
Allows you to update a gist's description and to update, delete, or rename gist files. Files from the previous version of the gist that aren't explicitly changed during an edit are unchanged.
At least one of description
or files
is required.
resources
Resources
@spec update_comment(String.t(), integer(), map(), keyword()) :: {:ok, GitHub.Gist.Comment.t()} | {:error, GitHub.Error.t()}
Update a gist comment