line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Curio::Role::GitLab::API::v4; |
2
|
|
|
|
|
|
|
our $VERSION = '0.05'; |
3
|
|
|
|
|
|
|
|
4
|
2
|
|
|
2
|
|
356418
|
use GitLab::API::v4; |
|
2
|
|
|
|
|
450797
|
|
|
2
|
|
|
|
|
64
|
|
5
|
2
|
|
|
2
|
|
16
|
use Scalar::Util qw( blessed ); |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
115
|
|
6
|
2
|
|
|
2
|
|
10
|
use Types::Standard qw( InstanceOf HashRef ); |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
17
|
|
7
|
|
|
|
|
|
|
|
8
|
2
|
|
|
2
|
|
1553
|
use Moo::Role; |
|
2
|
|
|
|
|
6981
|
|
|
2
|
|
|
|
|
14
|
|
9
|
2
|
|
|
2
|
|
618
|
use strictures 2; |
|
2
|
|
|
|
|
14
|
|
|
2
|
|
|
|
|
76
|
|
10
|
2
|
|
|
2
|
|
352
|
use namespace::clean; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
13
|
|
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
with 'Curio::Role'; |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
after initialize => sub{ |
15
|
|
|
|
|
|
|
my ($class) = @_; |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
my $factory = $class->factory(); |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
$factory->does_caching( 1 ); |
20
|
|
|
|
|
|
|
$factory->resource_method_name( 'api' ); |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
return; |
23
|
|
|
|
|
|
|
}; |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
has _custom_api => ( |
26
|
|
|
|
|
|
|
is => 'ro', |
27
|
|
|
|
|
|
|
isa => InstanceOf[ 'GitLab::API::v4' ] | HashRef, |
28
|
|
|
|
|
|
|
required => 1, |
29
|
|
|
|
|
|
|
init_arg => 'api', |
30
|
|
|
|
|
|
|
clearer => '_clear_custom_api', |
31
|
|
|
|
|
|
|
); |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
has api => ( |
34
|
|
|
|
|
|
|
is => 'lazy', |
35
|
|
|
|
|
|
|
init_arg => undef, |
36
|
|
|
|
|
|
|
); |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
sub _build_api { |
39
|
2
|
|
|
2
|
|
8776
|
my ($self) = @_; |
40
|
|
|
|
|
|
|
|
41
|
2
|
|
|
|
|
4
|
my $api = $self->_custom_api(); |
42
|
2
|
|
|
|
|
27
|
$self->_clear_custom_api(); |
43
|
2
|
50
|
|
|
|
13
|
return $api if blessed $api; |
44
|
|
|
|
|
|
|
|
45
|
2
|
50
|
|
|
|
11
|
my $args = $api ? { %$api } : {}; |
46
|
|
|
|
|
|
|
|
47
|
2
|
50
|
|
|
|
9
|
if ($self->can('access_token')) { |
48
|
0
|
|
|
|
|
0
|
my $token = $self->access_token(); |
49
|
0
|
0
|
|
|
|
0
|
$args->{access_token} = $token if defined $token; |
50
|
|
|
|
|
|
|
} |
51
|
|
|
|
|
|
|
|
52
|
2
|
50
|
|
|
|
7
|
if ($self->can('private_token')) { |
53
|
2
|
|
|
|
|
17
|
my $token = $self->private_token(); |
54
|
2
|
100
|
|
|
|
1483
|
$args->{private_token} = $token if defined $token; |
55
|
|
|
|
|
|
|
} |
56
|
|
|
|
|
|
|
|
57
|
2
|
|
|
|
|
20
|
return GitLab::API::v4->new( $args ); |
58
|
|
|
|
|
|
|
} |
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
1; |
61
|
|
|
|
|
|
|
__END__ |