line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Monitis::Contacts; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
6
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
37
|
|
4
|
1
|
|
|
1
|
|
4
|
use strict; |
|
1
|
|
|
|
|
4
|
|
|
1
|
|
|
|
|
36
|
|
5
|
|
|
|
|
|
|
require Carp; |
6
|
|
|
|
|
|
|
|
7
|
1
|
|
|
1
|
|
5
|
use base 'Monitis'; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
727
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
sub add { |
10
|
0
|
|
|
0
|
1
|
|
my ($self, @params) = @_; |
11
|
|
|
|
|
|
|
|
12
|
0
|
|
|
|
|
|
my @mandatory = qw/firstName lastName account contactType timezone/; |
13
|
0
|
|
|
|
|
|
my @optional = |
14
|
|
|
|
|
|
|
qw/group sendDailyReport sendWeeklyReport sendMonthlyReport portable country textType/; |
15
|
|
|
|
|
|
|
|
16
|
0
|
|
|
|
|
|
my $params = $self->prepare_params(\@params, \@mandatory, \@optional); |
17
|
|
|
|
|
|
|
|
18
|
0
|
|
|
|
|
|
return $self->api_post('addContact' => $params); |
19
|
|
|
|
|
|
|
} |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
sub edit { |
22
|
0
|
|
|
0
|
1
|
|
my ($self, @params) = @_; |
23
|
|
|
|
|
|
|
|
24
|
0
|
|
|
|
|
|
my @mandatory = qw/contactId/; |
25
|
0
|
|
|
|
|
|
my @optional = |
26
|
|
|
|
|
|
|
qw/firstName lastName account contactType timezone sendDailyReport sendWeeklyReport sendMonthlyReport portable code country textType/; |
27
|
|
|
|
|
|
|
|
28
|
0
|
|
|
|
|
|
my $params = $self->prepare_params(\@params, \@mandatory, \@optional); |
29
|
|
|
|
|
|
|
|
30
|
0
|
|
|
|
|
|
return $self->api_post('editContact' => $params); |
31
|
|
|
|
|
|
|
} |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
sub delete { |
34
|
0
|
|
|
0
|
1
|
|
my ($self, @params) = @_; |
35
|
|
|
|
|
|
|
|
36
|
0
|
|
|
|
|
|
my @mandatory = qw//; |
37
|
0
|
|
|
|
|
|
my @optional = qw/contactId account contactType/; |
38
|
|
|
|
|
|
|
|
39
|
0
|
|
|
|
|
|
my $params = $self->prepare_params(\@params, \@mandatory, \@optional); |
40
|
|
|
|
|
|
|
|
41
|
0
|
0
|
|
|
|
|
unless (@$params) { |
42
|
0
|
|
|
|
|
|
Carp::croak( |
43
|
|
|
|
|
|
|
"One of optional parameters required for deleting contact"); |
44
|
|
|
|
|
|
|
} |
45
|
|
|
|
|
|
|
|
46
|
0
|
|
|
|
|
|
return $self->api_post('deleteContact' => $params); |
47
|
|
|
|
|
|
|
} |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
sub confirm { |
50
|
0
|
|
|
0
|
1
|
|
my ($self, @params) = @_; |
51
|
|
|
|
|
|
|
|
52
|
0
|
|
|
|
|
|
my @mandatory = qw/contactId confirmationKey/; |
53
|
|
|
|
|
|
|
|
54
|
0
|
|
|
|
|
|
my $params = $self->prepare_params(\@params, \@mandatory); |
55
|
|
|
|
|
|
|
|
56
|
0
|
|
|
|
|
|
return $self->api_post('confirmContact' => $params); |
57
|
|
|
|
|
|
|
} |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
sub activate { |
60
|
0
|
|
|
0
|
1
|
|
my ($self, @params) = @_; |
61
|
|
|
|
|
|
|
|
62
|
0
|
|
|
|
|
|
my @mandatory = qw/contactId/; |
63
|
|
|
|
|
|
|
|
64
|
0
|
|
|
|
|
|
my $params = $self->prepare_params(\@params, \@mandatory); |
65
|
|
|
|
|
|
|
|
66
|
0
|
|
|
|
|
|
return $self->api_post('contactActivate' => $params); |
67
|
|
|
|
|
|
|
} |
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
sub deactivate { |
70
|
0
|
|
|
0
|
1
|
|
my ($self, @params) = @_; |
71
|
|
|
|
|
|
|
|
72
|
0
|
|
|
|
|
|
my @mandatory = qw/contactId/; |
73
|
|
|
|
|
|
|
|
74
|
0
|
|
|
|
|
|
my $params = $self->prepare_params(\@params, \@mandatory); |
75
|
|
|
|
|
|
|
|
76
|
0
|
|
|
|
|
|
return $self->api_post('contactDeactivate' => $params); |
77
|
|
|
|
|
|
|
} |
78
|
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
sub get { |
80
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
81
|
|
|
|
|
|
|
|
82
|
0
|
|
|
|
|
|
return $self->api_get('contactsList'); |
83
|
|
|
|
|
|
|
} |
84
|
|
|
|
|
|
|
|
85
|
|
|
|
|
|
|
sub get_groups { |
86
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
87
|
|
|
|
|
|
|
|
88
|
0
|
|
|
|
|
|
return $self->api_get('contactGroupList'); |
89
|
|
|
|
|
|
|
} |
90
|
|
|
|
|
|
|
|
91
|
|
|
|
|
|
|
sub get_recent_alerts { |
92
|
0
|
|
|
0
|
1
|
|
my ($self, @params) = @_; |
93
|
|
|
|
|
|
|
|
94
|
0
|
|
|
|
|
|
my @mandatory; |
95
|
0
|
|
|
|
|
|
my @optional = qw/timezone startDate endDate limit/; |
96
|
|
|
|
|
|
|
|
97
|
0
|
|
|
|
|
|
my $params = $self->prepare_params(\@params, \@mandatory, \@optional); |
98
|
|
|
|
|
|
|
|
99
|
0
|
|
|
|
|
|
return $self->api_get('recentAlerts' => $params); |
100
|
|
|
|
|
|
|
} |
101
|
|
|
|
|
|
|
__END__ |