line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Webservice::OVH::Email::Domain::Domain::Task::Account; |
2
|
|
|
|
|
|
|
|
3
|
36
|
|
|
36
|
|
252
|
use strict; |
|
36
|
|
|
|
|
83
|
|
|
36
|
|
|
|
|
1099
|
|
4
|
36
|
|
|
36
|
|
181
|
use warnings; |
|
36
|
|
|
|
|
82
|
|
|
36
|
|
|
|
|
959
|
|
5
|
36
|
|
|
36
|
|
179
|
use Carp qw{ carp croak }; |
|
36
|
|
|
|
|
130
|
|
|
36
|
|
|
|
|
23686
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
our $VERSION = 0.46; |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
sub _new_existing { |
10
|
|
|
|
|
|
|
|
11
|
0
|
|
|
0
|
|
|
my ( $class, %params ) = @_; |
12
|
|
|
|
|
|
|
|
13
|
0
|
0
|
|
|
|
|
die "Missing module" unless $params{module}; |
14
|
0
|
0
|
|
|
|
|
die "Missing wrapper" unless $params{wrapper}; |
15
|
0
|
0
|
|
|
|
|
die "Missing id" unless $params{id}; |
16
|
0
|
0
|
|
|
|
|
die "Missing domain" unless $params{domain}; |
17
|
|
|
|
|
|
|
|
18
|
0
|
|
|
|
|
|
my $module = $params{module}; |
19
|
0
|
|
|
|
|
|
my $api_wrapper = $params{wrapper}; |
20
|
0
|
|
|
|
|
|
my $id = $params{id}; |
21
|
0
|
|
|
|
|
|
my $domain = $params{domain}; |
22
|
0
|
|
|
|
|
|
my $domain_name = $domain->name; |
23
|
|
|
|
|
|
|
|
24
|
0
|
|
|
|
|
|
my $self = bless { _module => $module, _valid => 1, _wrapper => $api_wrapper, _id => $id, _properties => undef, _domain => $domain }, $class; |
25
|
|
|
|
|
|
|
|
26
|
0
|
|
|
|
|
|
return $self; |
27
|
|
|
|
|
|
|
} |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
sub is_valid { |
30
|
|
|
|
|
|
|
|
31
|
0
|
|
|
0
|
0
|
|
my ($self) = @_; |
32
|
|
|
|
|
|
|
|
33
|
0
|
|
|
|
|
|
$self->properties; |
34
|
|
|
|
|
|
|
|
35
|
0
|
|
|
|
|
|
return $self->{_valid},; |
36
|
|
|
|
|
|
|
} |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
sub properties { |
39
|
|
|
|
|
|
|
|
40
|
0
|
|
|
0
|
0
|
|
my ($self) = @_; |
41
|
|
|
|
|
|
|
|
42
|
0
|
0
|
|
|
|
|
croak "Invalid" unless $self->{_valid}; |
43
|
|
|
|
|
|
|
|
44
|
0
|
|
|
|
|
|
my $domain_name = $self->{_domain}->name; |
45
|
0
|
|
|
|
|
|
my $id = $self->{_id}; |
46
|
0
|
|
|
|
|
|
my $api_wrapper = $self->{_wrapper}; |
47
|
|
|
|
|
|
|
|
48
|
0
|
|
|
|
|
|
my $response = $api_wrapper->rawCall( method => 'get', path => "/email/domain/$domain_name/task/account/$id", noSignature => 0 ); |
49
|
0
|
0
|
|
|
|
|
carp $response->error if $response->error; |
50
|
|
|
|
|
|
|
|
51
|
0
|
0
|
|
|
|
|
if ( !$response->error ) { |
52
|
|
|
|
|
|
|
|
53
|
0
|
|
|
|
|
|
my $porperties = $response->content; |
54
|
0
|
|
|
|
|
|
$self->{_properties} = $porperties; |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
} else { |
57
|
|
|
|
|
|
|
|
58
|
0
|
|
|
|
|
|
$self->{_properties} = undef; |
59
|
0
|
|
|
|
|
|
$self->{_valid} = 0; |
60
|
|
|
|
|
|
|
} |
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
} |
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
sub name { |
65
|
|
|
|
|
|
|
|
66
|
0
|
|
|
0
|
0
|
|
my ($self) = @_; |
67
|
|
|
|
|
|
|
|
68
|
0
|
0
|
|
|
|
|
$self->properties unless $self->{_properties}; |
69
|
0
|
0
|
|
|
|
|
return unless $self->{_valid}; |
70
|
|
|
|
|
|
|
|
71
|
0
|
|
|
|
|
|
return $self->{_properties}{name}; |
72
|
|
|
|
|
|
|
} |
73
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
sub id { |
75
|
|
|
|
|
|
|
|
76
|
0
|
|
|
0
|
0
|
|
my ($self) = @_; |
77
|
|
|
|
|
|
|
|
78
|
0
|
|
|
|
|
|
return $self->{_id}; |
79
|
|
|
|
|
|
|
} |
80
|
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
sub domain { |
82
|
|
|
|
|
|
|
|
83
|
0
|
|
|
0
|
0
|
|
my ($self) = @_; |
84
|
|
|
|
|
|
|
|
85
|
0
|
|
|
|
|
|
return $self->{_domain}; |
86
|
|
|
|
|
|
|
} |
87
|
|
|
|
|
|
|
|
88
|
|
|
|
|
|
|
sub date { |
89
|
|
|
|
|
|
|
|
90
|
0
|
|
|
0
|
0
|
|
my ($self) = @_; |
91
|
|
|
|
|
|
|
|
92
|
0
|
0
|
|
|
|
|
$self->properties unless $self->{_properties}; |
93
|
0
|
0
|
|
|
|
|
return unless $self->{_valid}; |
94
|
|
|
|
|
|
|
|
95
|
0
|
|
|
|
|
|
return $self->{_properties}{date}; |
96
|
|
|
|
|
|
|
} |
97
|
|
|
|
|
|
|
|
98
|
|
|
|
|
|
|
sub action { |
99
|
|
|
|
|
|
|
|
100
|
0
|
|
|
0
|
0
|
|
my ($self) = @_; |
101
|
|
|
|
|
|
|
|
102
|
0
|
0
|
|
|
|
|
$self->properties unless $self->{_properties}; |
103
|
0
|
0
|
|
|
|
|
return unless $self->{_valid}; |
104
|
|
|
|
|
|
|
|
105
|
0
|
|
|
|
|
|
return $self->{_properties}{action}; |
106
|
|
|
|
|
|
|
} |
107
|
|
|
|
|
|
|
|
108
|
|
|
|
|
|
|
1; |