The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Pithub::Gists::Comments - Github v3 Gist Comments API

VERSION

version 0.01006

METHODS

create

  • Create a comment

        POST /gists/:gist_id/comments

    Parameters:

    • gist_id: mandatory integer

    • data: mandatory hashref, having following keys:

      • body: mandatory string

    Examples:

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

    Response: Status: 201 Created

        {
            "id": 1,
            "url": "https://api.github.com/gists/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/comments/:id

    Parameters:

    • comment_id: mandatory integer

    Examples:

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

    Response: Status: 204 No Content

get

  • Get a single comment

        GET /gists/comments/:id

    Parameters:

    • comment_id: mandatory integer

    Examples:

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

    Response: Status: 200 OK

        {
            "id": 1,
            "url": "https://api.github.com/gists/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 integer

    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/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/comments/:id

    Parameters:

    • comment_id: mandatory integer

    • data: mandatory hashref, having following keys:

      • body: mandatory string

    Examples:

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

    Response: Status: 200 OK

        {
            "id": 1,
            "url": "https://api.github.com/gists/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"
        }

AUTHOR

Johannes Plunien <plu@cpan.org>

COPYRIGHT AND LICENSE

This software is copyright (c) 2011 by Johannes Plunien.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.