line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
2
|
|
|
2
|
|
77847
|
use strict; |
|
2
|
|
|
|
|
12
|
|
|
2
|
|
|
|
|
48
|
|
2
|
2
|
|
|
2
|
|
8
|
use warnings; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
83
|
|
3
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
package Footprintless::Plugin::Atlassian::Confluence::ResponseParser; |
5
|
|
|
|
|
|
|
$Footprintless::Plugin::Atlassian::Confluence::ResponseParser::VERSION = '1.03'; |
6
|
|
|
|
|
|
|
# ABSTRACT: A response parser for the Atlassian Confluence REST API |
7
|
|
|
|
|
|
|
# PODNAME: Footprintless::Plugin::Atlassian::Confluence::ResponseParser |
8
|
|
|
|
|
|
|
|
9
|
2
|
|
|
2
|
|
493
|
use JSON; |
|
2
|
|
|
|
|
7759
|
|
|
2
|
|
|
|
|
9
|
|
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
sub new { |
12
|
3
|
|
|
3
|
1
|
18165
|
return bless( {}, shift )->_init(@_); |
13
|
|
|
|
|
|
|
} |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
sub create_content { |
16
|
0
|
|
|
0
|
0
|
0
|
my ( $self, $http_response ) = @_; |
17
|
0
|
|
|
|
|
0
|
return $self->_parse_response($http_response); |
18
|
|
|
|
|
|
|
} |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
sub delete_content { |
21
|
0
|
|
|
0
|
0
|
0
|
my ( $self, $http_response ) = @_; |
22
|
0
|
|
|
|
|
0
|
return $self->_parse_response($http_response); |
23
|
|
|
|
|
|
|
} |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
sub get_content { |
26
|
4
|
|
|
4
|
0
|
185
|
my ( $self, $http_response ) = @_; |
27
|
4
|
|
|
|
|
23
|
return $self->_parse_response($http_response); |
28
|
|
|
|
|
|
|
} |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
sub get_content_children { |
31
|
0
|
|
|
0
|
0
|
0
|
my ( $self, $http_response ) = @_; |
32
|
0
|
|
|
|
|
0
|
return $self->_parse_response($http_response); |
33
|
|
|
|
|
|
|
} |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
sub _init { |
36
|
3
|
|
|
3
|
|
13
|
my ($self) = @_; |
37
|
3
|
|
|
|
|
11
|
return $self; |
38
|
|
|
|
|
|
|
} |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
sub _parse_response { |
41
|
4
|
|
|
4
|
|
10
|
my ( $self, $http_response ) = @_; |
42
|
|
|
|
|
|
|
|
43
|
4
|
|
|
|
|
11
|
my %response = ( |
44
|
|
|
|
|
|
|
code => $http_response->code(), |
45
|
|
|
|
|
|
|
message => $http_response->message(), |
46
|
|
|
|
|
|
|
); |
47
|
|
|
|
|
|
|
|
48
|
4
|
|
|
|
|
102
|
my $content = $http_response->decoded_content(); |
49
|
4
|
100
|
|
|
|
584
|
if ( $http_response->is_success() ) { |
50
|
3
|
|
|
|
|
36
|
$response{success} = 1; |
51
|
3
|
100
|
|
|
|
25
|
$response{content} = $content ? decode_json($content) : ''; |
52
|
|
|
|
|
|
|
} |
53
|
|
|
|
|
|
|
else { |
54
|
1
|
|
|
|
|
17
|
$response{success} = 0; |
55
|
1
|
|
|
|
|
4
|
$response{content} = $http_response->decoded_content(); |
56
|
|
|
|
|
|
|
} |
57
|
|
|
|
|
|
|
|
58
|
4
|
|
|
|
|
143
|
return \%response; |
59
|
|
|
|
|
|
|
} |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
sub update_content { |
62
|
0
|
|
|
0
|
0
|
|
my ( $self, $http_response ) = @_; |
63
|
0
|
|
|
|
|
|
return $self->_parse_response($http_response); |
64
|
|
|
|
|
|
|
} |
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
1; |
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
__END__ |