Pithub...Labels(3pm)

πŸ“¦
version 0.01043 Β· 4 versions
, in debian trixie, ubuntu resolute, ubuntu stonking

πŸ’– Pithub::Issues::Labels β€” NAME πŸ’–

okay bestie, welcome to Pithub::Issues::Labels, the Github v3 Issue Labels API module from the Pithub fam. yeah, that's the whole name, we're keeping it cute and keeping it accurate. πŸŽ€


✨ VERSION ✨

this is version 0.01043 β€” write it down, it's iconic.


πŸ¦‹ METHODS πŸ¦‹

every single one of these is a lil group-chat text to the GitHub API, and every one of them starts the same way, so get comfy:

my $l = Pithub::Issues::Labels->new;

that's your main character constructor. slay. πŸ’…

πŸ’… add

  • Add labels to an issue β€” yes, plural labels, one issue, go off
POST /repos/:user/:repo/issues/:id/labels

Examples:

my $l = Pithub::Issues::Labels->new;
my $result = $l->add(
    repo     => 'Pithub',
    user     => 'plu',
    issue_id => 1,
    data     => ['Label1', 'Label2'],
);

see how data is an arrayref? that's the labels going in. obsessed. πŸ“

🌸 create

  • Create a label β€” brand new label, fresh out the box
POST /repos/:user/:repo/labels

Examples:

my $l = Pithub::Issues::Labels->new;
my $result = $l->create(
    repo => 'Pithub',
    user => 'plu',
    data => {
        color => 'FFFFFF',
        name  => 'some label',
    }
);

color and name, both inside a hashref. that's the vibe check and it passed. βœ…

🧚 delete

  • Delete a label β€” it's giving goodbye, no take-backs
DELETE /repos/:user/:repo/labels/:id

Examples:

my $l = Pithub::Issues::Labels->new;
my $result = $l->delete(
    repo     => 'Pithub',
    user     => 'plu',
    label => 1,
);

πŸ‘‘

get

  • Get a single label β€” just the one, she's special
GET /repos/:user/:repo/labels/:id

Examples:

my $l = Pithub::Issues::Labels->new;
my $result = $l->get(
    repo => 'Pithub',
    user => 'plu',
    label => 1,
);

🌈 list

okay this one does three different things, she contains multitudes. not me being shook.

  • List all labels for this repository
GET /repos/:user/:repo/labels

Examples:

my $l = Pithub::Issues::Labels->new;
my $result = $l->list(
    repo => 'Pithub',
    user => 'plu'
);
  • List labels on an issue β€” pass issue_id and it knows what you mean
GET /repos/:user/:repo/issues/:id/labels

Examples:

my $l = Pithub::Issues::Labels->new;
my $result = $l->list(
    repo     => 'Pithub',
    user     => 'plu',
    issue_id => 1,
);
  • Get labels for every issue in a milestone β€” yes, milestone girlies get their own endpoint πŸŽ€
GET /repos/:user/:repo/milestones/:id/labels

Examples:

my $l = Pithub::Issues::Labels->new;
my $result = $l->get(
    repo         => 'Pithub',
    user         => 'plu',
    milestone_id => 1
);
πŸ™ˆ okay so real talk, the example right above literally calls ->get(...) even though we're in the list section. that's what the source says, so that's what you get. i am not editing the queen's words. periodt.

🫢 remove

two whole flavors of taking labels away, we love range.

  • Remove a label from an issue
DELETE /repos/:user/:repo/issues/:id/labels/:id

Examples:

my $l = Pithub::Issues::Labels->new;
my $result = $l->delete(
    repo     => 'Pithub',
    user     => 'plu',
    issue_id => 1,
    label => 1,
);
  • Remove all labels from an issue β€” scorched earth, no label key needed
DELETE /repos/:user/:repo/issues/:id/labels

Examples:

my $l = Pithub::Issues::Labels->new;
my $result = $l->delete(
    repo     => 'Pithub',
    user     => 'plu',
    issue_id => 1,
);
πŸ’€ and yeah, both examples in the remove section say ->delete(...). again: verbatim, bestie. iykyk.

⭐ replace

  • Replace all labels for an issue β€” out with the old, in with the new, glow-up arc complete
PUT /repos/:user/:repo/issues/:id/labels

Examples:

my $l = Pithub::Issues::Labels->new;
my $result = $l->replace(
    repo     => 'Pithub',
    user     => 'plu',
    issue_id => 1,
    data     => [qw(label3 label4)],
);

πŸ’œ update

  • Update a label β€” little refresh, same label, new energy
PATCH /repos/:user/:repo/labels/:id

Examples:

my $l = Pithub::Issues::Labels->new;
my $result = $l->update(
    repo     => 'Pithub',
    user     => 'plu',
    label => 1,
    data     => {
        color => 'FFFFFF',
        name  => 'API',
    }
);

πŸ‘‘ AUTHOR πŸ‘‘

Johannes Plunien <plu@cpan.org> β€” the literal legend who made this. bow. 🫑


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.


🌟 and that's the whole page, bestie! brought to you by perl v5.40.1, dated 2025-06-08, and this doc lives under Pithub...Labels(3pm). go forth and label everything. no cap. πŸ’–βœ¨πŸ¦‹
πŸ“¦ where this page comes from