JGithubPackageGists

Extends \JGithubPackage

GitHub API Gists class for the Joomla Platform.

deprecated
documentation

https://developer.github.com/v3/gists

since

1.7.3

deprecated

4.0 Use the joomla/github package via Composer instead

property-read

GitHub API object for gist comments.

package

Joomla.Platform

Methods

__construct

Constructor.

__construct(\Joomla\Registry\Registry $options = null, \JGithubHttp $client = null) 
inherited
since

1.7.3

Arguments

$options

\Joomla\Registry\RegistryGitHub options object.

$client

\JGithubHttpThe HTTP client object.

__get

Magic method to lazily create API objects

__get(string $name) : \JGithubPackage
inherited
since

3.3

throws

\RuntimeException

Arguments

$name

stringName of property to retrieve

Response

\JGithubPackageGitHub API package object.

buildFileData

Method to fetch a data array for transmitting to the GitHub API for a list of files based on an input array of file paths or filename and content pairs.

buildFileData(array $files) : array
throws

\InvalidArgumentException

since

1.7.3

Arguments

$files

arrayThe list of file paths or filenames and content.

Response

array

create

Method to create a gist.

create(mixed $files, boolean $public = false, string $description = null) : object
throws

\DomainException

since

1.7.3

Arguments

$files

mixedEither an array of file paths or a single file path as a string.

$public

booleanTrue if the gist should be public.

$description

stringThe optional description of the gist.

Response

object

createComment

Method to create a comment on a gist.

createComment(integer $gistId, string $body) : object
deprecated
deprecated

use gists->comments->create()

since

1.7.3

Arguments

$gistId

integerThe gist number.

$body

stringThe comment body text.

Response

object

delete

Method to delete a gist.

delete(integer $gistId) : void
throws

\DomainException

since

1.7.3

Arguments

$gistId

integerThe gist number.

deleteComment

Method to delete a comment on a gist.

deleteComment(integer $commentId) : void
deprecated
deprecated

use gists->comments->delete()

since

1.7.3

Arguments

$commentId

integerThe id of the comment to delete.

edit

Method to update a gist.

edit(integer $gistId, mixed $files = null, boolean $public = null, string $description = null) : object
throws

\DomainException

since

1.7.3

Arguments

$gistId

integerThe gist number.

$files

mixedEither an array of file paths or a single file path as a string.

$public

booleanTrue if the gist should be public.

$description

stringThe description of the gist.

Response

object

editComment

Method to update a comment on a gist.

editComment(integer $commentId, string $body) : object
deprecated
deprecated

use gists->comments->edit()

since

1.7.3

Arguments

$commentId

integerThe id of the comment to update.

$body

stringThe new body text for the comment.

Response

object

fetchUrl

Method to build and return a full request URL for the request. This method will add appropriate pagination details if necessary and also prepend the API url to have a complete URL for the request.

fetchUrl(string $path, integer $page, integer $limit) : string
inherited
since

1.7.3

Arguments

$path

stringURL to inflect

$page

integerPage to request

$limit

integerNumber of results to return per page

Response

stringThe request URL.

fork

Method to fork a gist.

fork(integer $gistId) : object
throws

\DomainException

since

1.7.3

Arguments

$gistId

integerThe gist number.

Response

object

get

Method to get a single gist.

get(integer $gistId) : object
throws

\DomainException

since

1.7.3

Arguments

$gistId

integerThe gist number.

Response

object

getComment

Method to get a specific comment on a gist.

getComment(integer $commentId) : object
deprecated
deprecated

use gists->comments->get()

since

1.7.3

Arguments

$commentId

integerThe comment id to get.

Response

object

getComments

Method to get the list of comments on a gist.

getComments(integer $gistId, integer $page, integer $limit) : array
deprecated
deprecated

use gists->comments->getList()

since

1.7.3

Arguments

$gistId

integerThe gist number.

$page

integerThe page number from which to get items.

$limit

integerThe number of items on a page.

Response

array

getList

Method to list gists. If a user is authenticated it will return the user's gists, otherwise it will return all public gists.

getList(integer $page, integer $limit) : array
throws

\DomainException

since

1.7.3

Arguments

$page

integerThe page number from which to get items.

$limit

integerThe number of items on a page.

Response

array

getListByUser

Method to get a list of gists belonging to a given user.

getListByUser(string $user, integer $page, integer $limit) : array
throws

\DomainException

since

1.7.3

Arguments

$user

stringThe name of the GitHub user from which to list gists.

$page

integerThe page number from which to get items.

$limit

integerThe number of items on a page.

Response

array

getListPublic

Method to get a list of all public gists.

getListPublic(integer $page, integer $limit) : array
throws

\DomainException

since

1.7.3

Arguments

$page

integerThe page number from which to get items.

$limit

integerThe number of items on a page.

Response

array

getListStarred

Method to get a list of the authenticated users' starred gists.

getListStarred(integer $page, integer $limit) : array
throws

\DomainException

since

1.7.3

Arguments

$page

integerThe page number from which to get items.

$limit

integerThe number of items on a page.

Response

array

isStarred

Method to check if a gist has been starred.

isStarred(integer $gistId) : boolean
throws

\DomainException

since

1.7.3

Arguments

$gistId

integerThe gist number.

Response

booleanTrue if the gist is starred.

processResponse

Process the response and decode it.

processResponse(\JHttpResponse $response, integer $expectedCode = 200, boolean $decode = true) : mixed
inherited
throws

\DomainException

since

3.3.0

Arguments

$response

\JHttpResponseThe response.

$expectedCode

integerThe expected "good" code.

$decode

booleanIf the should be response be JSON decoded.

Response

mixed

star

Method to star a gist.

star(integer $gistId) : void
throws

\DomainException

since

1.7.3

Arguments

$gistId

integerThe gist number.

unstar

Method to star a gist.

unstar(integer $gistId) : void
throws

\DomainException

since

1.7.3

Arguments

$gistId

integerThe gist number.

Properties

name

inherited
since

3.3

Type(s)

string

packages

inherited
since

3.3

Type(s)

array

options

Options for the GitHub object.

inherited
since

1.7.3

Type(s)

\Joomla\Registry\Registry

client

The HTTP client object to use in sending HTTP requests.

inherited
since

1.7.3

Type(s)

\JGithubHttp

comments

GitHub API object for gist comments.

Type(s)

\JGithubPackageGistsComments