File Coverage

blib/lib/Pithub/PullRequests/Reviewers.pm
Criterion Covered Total %
statement 19 19 100.0
branch 8 8 100.0
condition n/a
subroutine 5 5 100.0
pod 3 3 100.0
total 35 35 100.0


line stmt bran cond sub pod time code
1             package Pithub::PullRequests::Reviewers;
2             our $AUTHORITY = 'cpan:PLU';
3             our $VERSION = '0.01039';
4             # ABSTRACT: Github v3 Pull Request Review Requests API
5              
6 16     16   104 use Moo;
  16         32  
  16         86  
7 16     16   4334 use Carp qw( croak );
  16         42  
  16         4958  
8             extends 'Pithub::Base';
9              
10              
11             sub delete {
12 3     3 1 2490 my ( $self, %args ) = @_;
13 3 100       24 croak 'Missing key in parameters: pull_request_id' unless $args{pull_request_id};
14 2         13 $self->_validate_user_repo_args( \%args );
15             return $self->request(
16             method => 'DELETE',
17 2         18 path => sprintf( '/repos/%s/%s/pulls/%s/requested_reviewers', delete $args{user}, delete $args{repo}, delete $args{pull_request_id} ),
18             %args,
19             );
20             }
21              
22              
23             sub list {
24 2     2 1 1262 my ( $self, %args ) = @_;
25 2 100       22 croak 'Missing key in parameters: pull_request_id' unless $args{pull_request_id};
26 1         7 $self->_validate_user_repo_args( \%args );
27             return $self->request(
28             method => 'GET',
29 1         10 path => sprintf( '/repos/%s/%s/pulls/%s/requested_reviewers', delete $args{user}, delete $args{repo}, delete $args{pull_request_id} ),
30             %args,
31             );
32             }
33              
34              
35             sub update {
36 5     5 1 3789 my ( $self, %args ) = @_;
37 5 100       30 croak 'Missing key in parameters: pull_request_id' unless $args{pull_request_id};
38 4 100       26 croak 'Missing key in parameters: data (hashref)' unless ref $args{data} eq 'HASH';
39 2         9 $self->_validate_user_repo_args( \%args );
40             return $self->request(
41             method => 'POST',
42 2         18 path => sprintf( '/repos/%s/%s/pulls/%s/requested_reviewers', delete $args{user}, delete $args{repo}, delete $args{pull_request_id} ),
43             %args,
44             );
45             }
46              
47             1;
48              
49             __END__