View Source GitHub.Gists (GitHub REST API Client v0.1.1)

Provides API endpoints related to gists

Link to this section Summary

Link to this section Functions

Link to this function

check_is_starred(gist_id, opts \\ [])

View Source
@spec check_is_starred(
  String.t(),
  keyword()
) :: :ok | {:error, GitHub.Error.t()}

Check if a gist is starred

resources

Resources

Link to this function

create(body, opts \\ [])

View Source
@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

Link to this function

create_comment(gist_id, body, opts \\ [])

View Source
@spec create_comment(String.t(), map(), keyword()) ::
  {:ok, GitHub.Gist.Comment.t()} | {:error, GitHub.Error.t()}

Create a gist comment

resources

Resources

Link to this function

delete(gist_id, opts \\ [])

View Source
@spec delete(
  String.t(),
  keyword()
) :: :ok | {:error, GitHub.Error.t()}

Delete a gist

resources

Resources

Link to this function

delete_comment(gist_id, comment_id, opts \\ [])

View Source
@spec delete_comment(String.t(), integer(), keyword()) ::
  :ok | {:error, GitHub.Error.t()}

Delete a gist comment

resources

Resources

Link to this function

fork(gist_id, opts \\ [])

View Source
@spec fork(
  String.t(),
  keyword()
) :: {:ok, GitHub.BaseGist.t()} | {:error, GitHub.Error.t()}

Fork a gist

resources

Resources

Link to this function

get(gist_id, opts \\ [])

View Source
@spec get(
  String.t(),
  keyword()
) :: {:ok, GitHub.Gist.simple()} | {:error, GitHub.Error.t()}

Get a gist

resources

Resources

Link to this function

get_comment(gist_id, comment_id, opts \\ [])

View Source
@spec get_comment(String.t(), integer(), keyword()) ::
  {:ok, GitHub.Gist.Comment.t()} | {:error, GitHub.Error.t()}

Get a gist comment

resources

Resources

Link to this function

get_revision(gist_id, sha, opts \\ [])

View Source
@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

Link to this function

list_comments(gist_id, opts \\ [])

View Source
@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

Link to this function

list_commits(gist_id, opts \\ [])

View Source
@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

Link to this function

list_for_user(username, opts \\ [])

View Source
@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

Link to this function

list_forks(gist_id, opts \\ [])

View Source
@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

Link to this function

list_starred(opts \\ [])

View Source
@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

Link to this function

star(gist_id, opts \\ [])

View Source
@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

Link to this function

unstar(gist_id, opts \\ [])

View Source
@spec unstar(
  String.t(),
  keyword()
) :: :ok | {:error, GitHub.Error.t()}

Unstar a gist

resources

Resources

Link to this function

update(gist_id, body, opts \\ [])

View Source
@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

Link to this function

update_comment(gist_id, comment_id, body, opts \\ [])

View Source
@spec update_comment(String.t(), integer(), map(), keyword()) ::
  {:ok, GitHub.Gist.Comment.t()} | {:error, GitHub.Error.t()}

Update a gist comment

resources

Resources