line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Curio::Role::GitLab::API::v4; |
2
|
|
|
|
|
|
|
our $VERSION = '0.04'; |
3
|
|
|
|
|
|
|
|
4
|
2
|
|
|
2
|
|
373581
|
use GitLab::API::v4; |
|
2
|
|
|
|
|
483933
|
|
|
2
|
|
|
|
|
64
|
|
5
|
2
|
|
|
2
|
|
17
|
use Scalar::Util qw( blessed ); |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
120
|
|
6
|
2
|
|
|
2
|
|
12
|
use Types::Standard qw( InstanceOf HashRef ); |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
19
|
|
7
|
|
|
|
|
|
|
|
8
|
2
|
|
|
2
|
|
1593
|
use Moo::Role; |
|
2
|
|
|
|
|
7085
|
|
|
2
|
|
|
|
|
13
|
|
9
|
2
|
|
|
2
|
|
691
|
use strictures 2; |
|
2
|
|
|
|
|
16
|
|
|
2
|
|
|
|
|
75
|
|
10
|
2
|
|
|
2
|
|
353
|
use namespace::clean; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
16
|
|
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
|
|
10925
|
my ($self) = @_; |
40
|
|
|
|
|
|
|
|
41
|
2
|
|
|
|
|
7
|
my $api = $self->_custom_api(); |
42
|
2
|
|
|
|
|
29
|
$self->_clear_custom_api(); |
43
|
2
|
50
|
|
|
|
16
|
return $api if blessed $api; |
44
|
|
|
|
|
|
|
|
45
|
2
|
50
|
|
|
|
12
|
my $args = $api ? { %$api } : {}; |
46
|
|
|
|
|
|
|
|
47
|
2
|
50
|
|
|
|
12
|
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
|
|
|
|
|
20
|
my $token = $self->private_token(); |
54
|
2
|
100
|
|
|
|
1741
|
$args->{private_token} = $token if defined $token; |
55
|
|
|
|
|
|
|
} |
56
|
|
|
|
|
|
|
|
57
|
2
|
|
|
|
|
22
|
return GitLab::API::v4->new( $args ); |
58
|
|
|
|
|
|
|
} |
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
1; |
61
|
|
|
|
|
|
|
__END__ |