NAME

Pithub::Issues::Labels

VERSION

version 0.01000

METHODS

add

  • Add labels to an issue

    POST /repos/:user/:repo/issues/:id/labels

Examples:

$result = $p->issues->labels->add(
    repo     => 'Pithub',
    user     => 'plu',
    issue_id => 1,
    data     => ['Label1', 'Label2'],
);

create

  • Create a label

    POST /repos/:user/:repo/labels

Examples:

$result = $p->issues->labels->create(
    repo => 'Pithub',
    user => 'plu',
    data => {
        color => 'FFFFFF',
        name  => 'some label',
    }
);

delete

  • Delete a label

    DELETE /repos/:user/:repo/labels/:id

Examples:

$result = $p->issues->labels->delete(
    repo     => 'Pithub',
    user     => 'plu',
    label_id => 1,
);

get

  • Get a single label

    GET /repos/:user/:repo/labels/:id

Examples:

$result = $p->issues->labels->get(
    repo => 'Pithub',
    user => 'plu',
    label_id => 1,
);

list

  • List all labels for this repository

    GET /repos/:user/:repo/labels

    Examples:

    $result = $p->issues->labels->list(
        repo => 'Pithub',
        user => 'plu'
    );
  • List labels on an issue

    GET /repos/:user/:repo/issues/:id/labels

    Examples:

    $result = $p->issues->labels->list(
        repo     => 'Pithub',
        user     => 'plu',
        issue_id => 1,
    );
  • Get labels for every issue in a milestone

    GET /repos/:user/:repo/milestones/:id/labels

    Examples:

    $result = $p->issues->labels->get(
        repo         => 'Pithub',
        user         => 'plu',
        milestone_id => 1
    );

remove

  • Remove a label from an issue

    DELETE /repos/:user/:repo/issues/:id/labels/:id

    Examples:

    $result = $p->issues->labels->delete(
        repo     => 'Pithub',
        user     => 'plu',
        issue_id => 1,
        label_id => 1,
    );
  • Remove all labels from an issue

    DELETE /repos/:user/:repo/issues/:id/labels

    Examples:

    $result = $p->issues->labels->delete(
        repo     => 'Pithub',
        user     => 'plu',
        issue_id => 1,
    );

replace

  • Replace all labels for an issue

    PUT /repos/:user/:repo/issues/:id/labels

Examples:

$result = $p->issues->labels->replace(
    repo     => 'Pithub',
    user     => 'plu',
    issue_id => 1,
    data     => [qw(label3 label4)],
);

update

  • Update a label

    PATCH /repos/:user/:repo/labels/:id

Examples:

$result = $p->issues->labels->update(
    repo     => 'Pithub',
    user     => 'plu',
    label_id => 1,
    data     => {
        color => 'FFFFFF',
        name  => 'API',
    }
);