Skip to content

Gist

[Source]

A GitHub gist. Contains the gist's metadata, file listing, and URLs for related resources. Provides convenience methods for updating, deleting, forking, starring, and accessing comments and commit history.

The files field is an array of (filename, GistFile) pairs rather than a map, preserving insertion order. Gists typically have few files, so linear lookup is not a concern.

class val Gist

Constructors

create

[Source]

new val create(
  creds: Credentials val,
  id': String val,
  node_id': String val,
  description': (String val | None val),
  public': Bool val,
  owner': (User val | None val),
  user': (User val | None val),
  files': Array[(String val , GistFile val)] val,
  comments': I64 val,
  comments_enabled': Bool val,
  truncated': Bool val,
  created_at': String val,
  updated_at': String val,
  url': String val,
  html_url': String val,
  forks_url': String val,
  commits_url': String val,
  comments_url': String val,
  git_pull_url': String val,
  git_push_url': String val)
: Gist val^

Parameters

Returns


Public fields

let id: String val

[Source]


let node_id: String val

[Source]


let description: (String val | None val)

[Source]


let public: Bool val

[Source]


let owner: (User val | None val)

[Source]


let user: (User val | None val)

[Source]


let files: Array[(String val , GistFile val)] val

[Source]


let comments: I64 val

[Source]


let comments_enabled: Bool val

[Source]


let truncated: Bool val

[Source]


let created_at: String val

[Source]


let updated_at: String val

[Source]


let url: String val

[Source]


let html_url: String val

[Source]


let forks_url: String val

[Source]


let commits_url: String val

[Source]


let comments_url: String val

[Source]


let git_pull_url: String val

[Source]


let git_push_url: String val

[Source]


Public Functions

update_gist

[Source]

Updates this gist's files and/or description.

fun box update_gist(
  update_files: Array[(String val , (GistFileEdit val | GistFileRename val | GistFileDelete val))] val,
  new_description: (String val | None val) = reference)
: Promise[(Gist val | RequestError val)] tag

Parameters

Returns


delete_gist

[Source]

Deletes this gist.

fun box delete_gist()
: Promise[(Deleted val | RequestError val)] tag

Returns


get_revision

[Source]

Fetches a specific revision of this gist by its commit SHA.

fun box get_revision(
  sha: String val)
: Promise[(Gist val | RequestError val)] tag

Parameters

Returns


fork

[Source]

Forks this gist into the authenticated user's account.

fun box fork()
: Promise[(Gist val | RequestError val)] tag

Returns


get_forks

[Source]

Lists forks of this gist as a paginated list.

fun box get_forks()
: Promise[(PaginatedList[Gist val] val | RequestError val)] tag

Returns


get_commits

[Source]

Lists commits for this gist as a paginated list.

fun box get_commits()
: Promise[(PaginatedList[GistCommit val] val | RequestError val)] tag

Returns


star

[Source]

Stars this gist for the authenticated user.

fun box star()
: Promise[(Deleted val | RequestError val)] tag

Returns


unstar

[Source]

Unstars this gist for the authenticated user.

fun box unstar()
: Promise[(Deleted val | RequestError val)] tag

Returns


is_starred

[Source]

Checks whether this gist is starred by the authenticated user.

fun box is_starred()
: Promise[(Bool val | RequestError val)] tag

Returns


create_comment

[Source]

Creates a new comment on this gist.

fun box create_comment(
  body: String val)
: Promise[(GistComment val | RequestError val)] tag

Parameters

Returns


get_comments

[Source]

Lists comments on this gist as a paginated list.

fun box get_comments()
: Promise[(PaginatedList[GistComment val] val | RequestError val)] tag

Returns