line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Curio::Role::GitLab::API::v4; |
2
|
|
|
|
|
|
|
our $VERSION = '0.03'; |
3
|
|
|
|
|
|
|
|
4
|
2
|
|
|
2
|
|
446708
|
use GitLab::API::v4; |
|
2
|
|
|
|
|
568593
|
|
|
2
|
|
|
|
|
84
|
|
5
|
2
|
|
|
2
|
|
18
|
use Scalar::Util qw( blessed ); |
|
2
|
|
|
|
|
6
|
|
|
2
|
|
|
|
|
146
|
|
6
|
2
|
|
|
2
|
|
13
|
use Types::Standard qw( InstanceOf HashRef ); |
|
2
|
|
|
|
|
6
|
|
|
2
|
|
|
|
|
20
|
|
7
|
|
|
|
|
|
|
|
8
|
2
|
|
|
2
|
|
2082
|
use Moo::Role; |
|
2
|
|
|
|
|
8700
|
|
|
2
|
|
|
|
|
16
|
|
9
|
2
|
|
|
2
|
|
822
|
use strictures 2; |
|
2
|
|
|
|
|
32
|
|
|
2
|
|
|
|
|
108
|
|
10
|
2
|
|
|
2
|
|
442
|
use namespace::clean; |
|
2
|
|
|
|
|
6
|
|
|
2
|
|
|
|
|
15
|
|
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
|
|
11718
|
my ($self) = @_; |
40
|
|
|
|
|
|
|
|
41
|
2
|
|
|
|
|
6
|
my $api = $self->_custom_api(); |
42
|
2
|
|
|
|
|
37
|
$self->_clear_custom_api(); |
43
|
2
|
50
|
|
|
|
17
|
return $api if blessed $api; |
44
|
|
|
|
|
|
|
|
45
|
2
|
50
|
|
|
|
16
|
my $args = $api ? { %$api } : {}; |
46
|
|
|
|
|
|
|
|
47
|
2
|
50
|
|
|
|
13
|
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
|
|
|
|
9
|
if ($self->can('private_token')) { |
53
|
2
|
|
|
|
|
23
|
my $token = $self->private_token(); |
54
|
2
|
100
|
|
|
|
1986
|
$args->{private_token} = $token if defined $token; |
55
|
|
|
|
|
|
|
} |
56
|
|
|
|
|
|
|
|
57
|
2
|
|
|
|
|
26
|
return GitLab::API::v4->new( $args ); |
58
|
|
|
|
|
|
|
} |
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
1; |
61
|
|
|
|
|
|
|
__END__ |