1package Pithub::Issues::Assignees;
2our $AUTHORITY = 'cpan:PLU';
3our $VERSION = '0.01036';
4# ABSTRACT: Github v3 Issue Assignees API
5
6use Moo;
7use Carp qw( croak );
8extends 'Pithub::Base';
9
10
11sub check {
12    my ( $self, %args ) = @_;
13    croak 'Missing key in parameters: assignee' unless $args{assignee};
14    $self->_validate_user_repo_args( \%args );
15    return $self->request(
16        method => 'GET',
17        path   => sprintf( '/repos/%s/%s/assignees/%s', delete $args{user}, delete $args{repo}, delete $args{assignee} ),
18        %args,
19    );
20}
21
22
23sub list {
24    my ( $self, %args ) = @_;
25    $self->_validate_user_repo_args( \%args );
26    return $self->request(
27        method => 'GET',
28        path   => sprintf( '/repos/%s/%s/assignees', delete $args{user}, delete $args{repo} ),
29        %args,
30    );
31}
32
331;
34
35__END__
36
37=pod
38
39=encoding UTF-8
40
41=head1 NAME
42
43Pithub::Issues::Assignees - Github v3 Issue Assignees API
44
45=head1 VERSION
46
47version 0.01036
48
49=head1 METHODS
50
51=head2 check
52
53=over
54
55=item *
56
57You may also check to see if a particular user is an assignee for a repository.
58
59    GET /repos/:user/:repo/assignees/:assignee
60
61If the given assignee login belongs to an assignee for the repository, a 204
62header with no content is returned.
63
64Examples:
65
66    my $c      = Pithub::Issues::Assignees->new;
67    my $result = $c->check(
68        repo     => 'Pithub',
69        user     => 'plu',
70        assignee => 'plu',
71    );
72    if ( $result->success ) {
73        print "plu is an assignee for the repo plu/Pithub.git";
74    }
75
76=back
77
78=head2 list
79
80=over
81
82=item *
83
84This call lists all the available assignees (owner + collaborators)
85to which issues may be assigned.
86
87    GET /repos/:user/:repo/assignees
88
89Examples:
90
91    my $c      = Pithub::Issues::Assignees->new;
92    my $result = $c->list(
93        repo => 'Pithub',
94        user => 'plu',
95    );
96
97=back
98
99=head1 AUTHOR
100
101Johannes Plunien <plu@cpan.org>
102
103=head1 COPYRIGHT AND LICENSE
104
105This software is copyright (c) 2011-2019 by Johannes Plunien.
106
107This is free software; you can redistribute it and/or modify it under
108the same terms as the Perl 5 programming language system itself.
109
110=cut
111