View Source Tentacat.Gists (Tentacat v2.5.0)

Summary

Functions

Link to this function

check_if_starred(client, gist_id)

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

Link to this function

edit(client, gist_id, body)

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

Fork a gist.

Example

Tentacat.Gists.fork(client, "fe771b85eeeff878d177b0c0f3840afd")

More info: https://developer.github.com/v3/gists/#fork-a-gist

Link to this function

get_revision(client \\ %Client{}, gist_id, sha)

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

Link to this function

gist_get(client \\ %Client{}, gist_id)

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

Link to this function

list_commits(client \\ %Client{}, gist_id)

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

Link to this function

list_forks(client \\ %Client{}, gist_id, params \\ [])

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

Link to this function

list_mine(client, params \\ [], options \\ [])

View Source

List current user's gists.

Examples

Tentacat.Gists.list_mine(client)

More info at: https://developer.github.com/v3/gists/#list-a-users-gists

Link to this function

list_public(client \\ %Client{}, params \\ [], options \\ [])

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

Link to this function

list_starred(client, params \\ [], options \\ [])

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

Link to this function

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

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