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