line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
2
|
|
|
2
|
|
38353
|
use strict; |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
55
|
|
2
|
2
|
|
|
2
|
|
6
|
use warnings; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
84
|
|
3
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
package Footprintless::Plugin::Atlassian::Confluence::ResponseParser; |
5
|
|
|
|
|
|
|
$Footprintless::Plugin::Atlassian::Confluence::ResponseParser::VERSION = '1.01'; |
6
|
|
|
|
|
|
|
# ABSTRACT: A response parser for the Atlassian Confluence REST API |
7
|
|
|
|
|
|
|
# PODNAME: Footprintless::Plugin::Atlassian::Confluence::ResponseParser |
8
|
|
|
|
|
|
|
|
9
|
2
|
|
|
2
|
|
552
|
use JSON; |
|
2
|
|
|
|
|
7991
|
|
|
2
|
|
|
|
|
9
|
|
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
sub new { |
12
|
3
|
|
|
3
|
1
|
20790
|
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
|
148
|
my ( $self, $http_response ) = @_; |
27
|
4
|
|
|
|
|
12
|
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
|
|
7
|
my ($self) = @_; |
37
|
3
|
|
|
|
|
11
|
return $self; |
38
|
|
|
|
|
|
|
} |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
sub _parse_response { |
41
|
4
|
|
|
4
|
|
6
|
my ( $self, $http_response ) = @_; |
42
|
|
|
|
|
|
|
|
43
|
4
|
|
|
|
|
15
|
my %response = ( |
44
|
|
|
|
|
|
|
code => $http_response->code(), |
45
|
|
|
|
|
|
|
message => $http_response->message(), |
46
|
|
|
|
|
|
|
); |
47
|
|
|
|
|
|
|
|
48
|
4
|
|
|
|
|
83
|
my $content = $http_response->decoded_content(); |
49
|
4
|
100
|
|
|
|
439
|
if ( $http_response->is_success() ) { |
50
|
3
|
|
|
|
|
33
|
$response{success} = 1; |
51
|
3
|
100
|
|
|
|
21
|
$response{content} = $content ? decode_json($content) : ''; |
52
|
|
|
|
|
|
|
} |
53
|
|
|
|
|
|
|
else { |
54
|
1
|
|
|
|
|
7
|
$response{success} = 0; |
55
|
1
|
|
|
|
|
3
|
$response{content} = $http_response->decoded_content(); |
56
|
|
|
|
|
|
|
} |
57
|
|
|
|
|
|
|
|
58
|
4
|
|
|
|
|
90
|
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__ |