Webservice/OVH/Email/Domain/Domain/Task/Account.pm

filter: Statementstmt 20.3% 11 / 54 Branchbran 0.0% 0 / 26 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 27.2% 3 / 11 Podpod 0.0% 0 / 7 totaltotal 14.2% 14 / 98 CC 14 SCAR 26.7
CC
14
Cov
14%
_new_existing
30.0
properties
20.0
name
12.0
CRAP 14.5
« Webservice/OVH/Me/Order/Detail.pm ↑ Summary Webservice/OVH/Email/Domain/Domain/Task/Mailinglist.pm »
1 package Webservice::OVH::Email::Domain::Domain::Task::Account;
2  
3 36 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 36 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 36 ▶use Carp qw{ carp croak };
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 36 our $VERSION = 0.48;
8  
9 0 ▶sub _new_existing {
Subroutine _new_existing: not called CC=5 SCAR=34.0
10  
11 0 my ( $class, %params ) = @_;
12  
13 0 ▶ die "Missing module" unless $params{module};
Branch: 1 branch
BranchTrueFalseTotal
unless $params{"module"} 0 0 0
14 0 ▶ die "Missing wrapper" unless $params{wrapper};
Branch: 1 branch
BranchTrueFalseTotal
unless $params{"wrapper"} 0 0 0
15 0 ▶ die "Missing id" unless $params{id};
Branch: 1 branch
BranchTrueFalseTotal
unless $params{"id"} 0 0 0
16 0 ▶ die "Missing domain" unless $params{domain};
Branch: 1 branch
BranchTrueFalseTotal
unless $params{"domain"} 0 0 0
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 0 ▶sub is_valid {
Subroutine is_valid: not called CC=1 SCAR=6.9
Pod undocumented
30  
31 0 my ($self) = @_;
32  
33 0 $self->properties;
34  
35 0 return $self->{_valid},;
36 }
37  
38 0 ▶sub properties {
Subroutine properties: not called CC=4 SCAR=30.0
Pod undocumented
39  
40 0 my ($self) = @_;
41  
42 0 ▶ croak "Invalid" unless $self->{_valid};
Branch: 1 branch
BranchTrueFalseTotal
unless $self->{"_valid"} 0 0 0
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 ▶ carp $response->error if $response->error;
Branch: 1 branch
BranchTrueFalseTotal
if $response->error 0 0 0
50  
51 0 ▶ if ( !$response->error ) {
Branch: 1 branch
BranchTrueFalseTotal
if (not $response->error) { } 0 0 0
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 0 ▶sub name {
Subroutine name: not called CC=3 SCAR=24.8
Pod undocumented
65  
66 0 my ($self) = @_;
67  
68 0 ▶ $self->properties unless $self->{_properties};
Branch: 1 branch
BranchTrueFalseTotal
unless $self->{"_properties"} 0 0 0
69 0 ▶ return unless $self->{_valid};
Branch: 1 branch
BranchTrueFalseTotal
unless $self->{"_valid"} 0 0 0
70  
71 0 return $self->{_properties}{name};
72 }
73  
74 0 ▶sub id {
Subroutine id: not called CC=1 SCAR=6.9
Pod undocumented
75  
76 0 my ($self) = @_;
77  
78 0 return $self->{_id};
79 }
80  
81 0 ▶sub domain {
Subroutine domain: not called CC=1 SCAR=6.9
Pod undocumented
82  
83 0 my ($self) = @_;
84  
85 0 return $self->{_domain};
86 }
87  
88 0 ▶sub date {
Subroutine date: not called CC=3 SCAR=24.8
Pod undocumented
89  
90 0 my ($self) = @_;
91  
92 0 ▶ $self->properties unless $self->{_properties};
Branch: 1 branch
BranchTrueFalseTotal
unless $self->{"_properties"} 0 0 0
93 0 ▶ return unless $self->{_valid};
Branch: 1 branch
BranchTrueFalseTotal
unless $self->{"_valid"} 0 0 0
94  
95 0 return $self->{_properties}{date};
96 }
97  
98 0 ▶sub action {
Subroutine action: not called CC=3 SCAR=24.8
Pod undocumented
99  
100 0 my ($self) = @_;
101  
102 0 ▶ $self->properties unless $self->{_properties};
Branch: 1 branch
BranchTrueFalseTotal
unless $self->{"_properties"} 0 0 0
103 0 ▶ return unless $self->{_valid};
Branch: 1 branch
BranchTrueFalseTotal
unless $self->{"_valid"} 0 0 0
104  
105 0 return $self->{_properties}{action};
106 }
107  
108 36 1;
« Webservice/OVH/Me/Order/Detail.pm ↑ Summary Webservice/OVH/Email/Domain/Domain/Task/Mailinglist.pm »