line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package WebService::AbuseIPDB::Response; |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
#=============================================================================== |
4
|
|
|
|
|
|
|
# FILE: Response.pm |
5
|
|
|
|
|
|
|
# DESCRIPTION: Generic Response Object - See POD for details |
6
|
|
|
|
|
|
|
# AUTHOR: Pete Houston (pete), cpan@openstrike.co.uk |
7
|
|
|
|
|
|
|
# ORGANIZATION: Openstrike |
8
|
|
|
|
|
|
|
# CREATED: 12/08/19 14:38:21 |
9
|
|
|
|
|
|
|
#=============================================================================== |
10
|
|
|
|
|
|
|
|
11
|
9
|
|
|
9
|
|
4927
|
use strict; |
|
9
|
|
|
|
|
22
|
|
|
9
|
|
|
|
|
259
|
|
12
|
9
|
|
|
9
|
|
49
|
use warnings; |
|
9
|
|
|
|
|
22
|
|
|
9
|
|
|
|
|
225
|
|
13
|
|
|
|
|
|
|
|
14
|
9
|
|
|
9
|
|
46
|
use WebService::AbuseIPDB; |
|
9
|
|
|
|
|
18
|
|
|
9
|
|
|
|
|
1345
|
|
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
our $VERSION = $WebService::AbuseIPDB::VERSION; |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
sub new { |
19
|
15
|
|
|
15
|
1
|
981
|
my ($class, $res) = @_; |
20
|
15
|
100
|
|
|
|
68
|
my $self = |
21
|
|
|
|
|
|
|
ref $res |
22
|
|
|
|
|
|
|
? $res |
23
|
|
|
|
|
|
|
: { |
24
|
|
|
|
|
|
|
errors => [ |
25
|
|
|
|
|
|
|
{ status => 500, |
26
|
|
|
|
|
|
|
detail => 'Client could not connect' |
27
|
|
|
|
|
|
|
} |
28
|
|
|
|
|
|
|
] |
29
|
|
|
|
|
|
|
}; |
30
|
15
|
|
|
|
|
36
|
bless ($self, $class); |
31
|
15
|
|
|
|
|
154
|
return $self; |
32
|
|
|
|
|
|
|
} |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
# Accessors |
35
|
|
|
|
|
|
|
|
36
|
14
|
|
|
14
|
1
|
3528
|
sub successful { return not exists shift->{errors} } |
37
|
6
|
|
|
6
|
1
|
48
|
sub errors { return shift->{errors} } |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
1; |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
__END__ |