NAME

Pithub::Users::Keys

VERSION

version 0.01000

METHODS

create

  • Create a public key

    POST /user/keys

Examples:

$p = Pithub->new( token => 'b3c62c6' );
$result = $p->users->keys->create(
    data => {
        title => 'plu@localhost',
        key   => 'ssh-rsa AAA...',
    }
);

$k = Pithub::Users::Keys->new( token => 'b3c62c6' );
$result = $k->create(
    data => {
        title => 'plu@localhost',
        key   => 'ssh-rsa AAA...',
    }
);

delete

  • Delete a public key

    DELETE /user/keys/:id

Examples:

$p = Pithub->new( token => 'b3c62c6' );
$result = $p->users->keys->delete( key_id => 123 );

$k = Pithub::Users::Keys->new( token => 'b3c62c6' );
$result = $k->delete( key_id => 123 );

get

  • Get a single public key

    GET /user/keys/:id

Examples:

$p = Pithub->new( token => 'b3c62c6' );
$result = $p->users->keys->get( key_id => 123 );

$k = Pithub::Users::Keys->new( token => 'b3c62c6' );
$result = $k->get( key_id => 123 );

list

  • List public keys for a user

    GET /user/keys

Examples:

$p = Pithub->new( token => 'b3c62c6' );
$result = $p->users->keys->list;

$k = Pithub::Users::Keys->new( token => 'b3c62c6' );
$result = $k->list;

update

  • Update a public key

    PATCH /user/keys/:id

Examples:

$p = Pithub->new( token => 'b3c62c6' );
$result = $p->users->keys->update(
    key_id => 123,
    data => {
        title => 'plu@localhost',
        key   => 'ssh-rsa AAA...',
    }
);

$k = Pithub::Users::Keys->new( token => 'b3c62c6' );
$result = $k->update(
    key_id => 123,
    data => {
        title => 'plu@localhost',
        key   => 'ssh-rsa AAA...',
    }
);