Pithub::Gists::Comments(3pm)

Pithub::Gists::Comments3pm

Github v3 gist comments api

Version

version 0.01043

Methods

create

•

Create a comment

    POST /gists/:gist_id/comments

Parameters:

•

gist_id: mandatory string

•

data: mandatory hashref, having following keys:

•

body: mandatory string

Examples:

    my $c = Pithub::Gists::Comments->new;
    my $result = $c->create(
        gist_id => 'c0ff33',
        data    => { body => 'Just commenting for the sake of commenting' },
    );

Response: Status: 201 Created

    {
        "id": 1,
        "url": "https://api.github.com/gists/c0ff33/comments/1",
        "body": "Just commenting for the sake of commenting",
        "user": {
            "login": "octocat",
            "id": 1,
            "gravatar_url": "https://github.com/images/error/octocat_happy.gif",
            "url": "https://api.github.com/users/octocat"
        },
        "created_at": "2011-04-18T23:23:56Z"
    }

delete

•

Delete a comment

    DELETE /gists/:gist_id/comments/:id

Parameters:

•

gist_id: mandatory string

•

comment_id: mandatory integer

Examples:

    my $c = Pithub::Gists::Comments->new;
    my $result = $c->delete(
        gist_id    => 'c0ff33',
        comment_id => 1
    );

Response: Status: 204 No Content

get

•

Get a single comment

    GET /gists/:gist_id/comments/:id

Parameters:

•

gist_id: mandatory string

•

comment_id: mandatory integer

Examples:

    my $c = Pithub::Gists::Comments->new;
    my $result = $c->get(
        gist_id    => 'c0ff33',
        comment_id => 1
    );

Response: Status: 200 OK

    {
        "id": 1,
        "url": "https://api.github.com/gists/c0ff33/comments/1",
        "body": "Just commenting for the sake of commenting",
        "user": {
            "login": "octocat",
            "id": 1,
            "gravatar_url": "https://github.com/images/error/octocat_happy.gif",
            "url": "https://api.github.com/users/octocat"
        },
        "created_at": "2011-04-18T23:23:56Z"
    }

list

•

List comments on a gist

    GET /gists/:gist_id/comments

Parameters:

•

gist_id: mandatory string

Examples:

    my $c = Pithub::Gists::Comments->new;
    my $result = $c->list( gist_id => 1 );

Response: Status: 200 OK

    [
        {
            "id": 1,
            "url": "https://api.github.com/gists/c0ff33/comments/1",
            "body": "Just commenting for the sake of commenting",
            "user": {
                "login": "octocat",
                "id": 1,
                "gravatar_url": "https://github.com/images/error/octocat_happy.gif",
                "url": "https://api.github.com/users/octocat"
            },
            "created_at": "2011-04-18T23:23:56Z"
        }
    ]

update

•

Edit a comment

    PATCH /gists/:gist_id/comments/:id

Parameters:

•

gist_id: mandatory string

•

comment_id: mandatory integer

•

data: mandatory hashref, having following keys:

•

body: mandatory string

Examples:

    my $c = Pithub::Gists::Comments->new;
    my $result = $c->update(
        gist_id    => 'c0ff33',
        comment_id => 1,
        data       => { body => 'some comment' }
    );

Response: Status: 200 OK

    {
        "id": 1,
        "url": "https://api.github.com/gists/c0ff33/comments/1",
        "body": "Just commenting for the sake of commenting",
        "user": {
            "login": "octocat",
            "id": 1,
            "gravatar_url": "https://github.com/images/error/octocat_happy.gif",
            "url": "https://api.github.com/users/octocat"
        },
        "created_at": "2011-04-18T23:23:56Z"
    }

Releases

6 releases since Debian 8 (Jessie); the text changed 5 times.

  1. 8
  2. 9
  3. 10
  4. 11
  5. 12
  6. 13

Author

Johannes Plunien <[email protected]>

From libpithub-perl 0.01043-1 in Debian 13 (Trixie). Parsed by carta from the page's man source.