| 1 | package Webservice::OVH::Email::Domain::Domain::Task; | ||||||||||||||||||||||||||||
| 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 | 36 | ▶ | use Webservice::OVH::Email::Domain::Domain::Task::Account; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 10 | 36 | ▶ | use Webservice::OVH::Email::Domain::Domain::Task::Mailinglist; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 11 | 36 | ▶ | use Webservice::OVH::Email::Domain::Domain::Task::Redirection; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 12 | |||||||||||||||||||||||||||||
| 13 | 0 | ▶ | sub _new { | ||||||||||||||||||||||||||
|
Subroutine
_new: not called CC=4 SCAR=30.0
| |||||||||||||||||||||||||||||
| 14 | |||||||||||||||||||||||||||||
| 15 | 0 | my ( $class, %params ) = @_; | |||||||||||||||||||||||||||
| 16 | |||||||||||||||||||||||||||||
| 17 | 0 | ▶ | die "Missing module" unless $params{module}; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 18 | 0 | ▶ | die "Missing wrapper" unless $params{wrapper}; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 19 | 0 | ▶ | die "Missing domain" unless $params{domain}; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 20 | |||||||||||||||||||||||||||||
| 21 | 0 | my $module = $params{module}; | |||||||||||||||||||||||||||
| 22 | 0 | my $api_wrapper = $params{wrapper}; | |||||||||||||||||||||||||||
| 23 | 0 | my $domain = $params{domain}; | |||||||||||||||||||||||||||
| 24 | |||||||||||||||||||||||||||||
| 25 | 0 | my $self = bless { | |||||||||||||||||||||||||||
| 26 | _module => $module, | ||||||||||||||||||||||||||||
| 27 | _wrapper => $api_wrapper, | ||||||||||||||||||||||||||||
| 28 | _tasks_account => {}, | ||||||||||||||||||||||||||||
| 29 | _tasks_mailinglist => {}, | ||||||||||||||||||||||||||||
| 30 | _tasks_redirection => {}, | ||||||||||||||||||||||||||||
| 31 | _domain => $domain, | ||||||||||||||||||||||||||||
| 32 | }, $class; | ||||||||||||||||||||||||||||
| 33 | |||||||||||||||||||||||||||||
| 34 | 0 | return $self; | |||||||||||||||||||||||||||
| 35 | } | ||||||||||||||||||||||||||||
| 36 | |||||||||||||||||||||||||||||
| 37 | 0 | ▶ | sub domain { | ||||||||||||||||||||||||||
|
Subroutine
domain: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||||||||||
| 38 | |||||||||||||||||||||||||||||
| 39 | 0 | my ($self) = @_; | |||||||||||||||||||||||||||
| 40 | |||||||||||||||||||||||||||||
| 41 | 0 | return $self->{_domain}; | |||||||||||||||||||||||||||
| 42 | } | ||||||||||||||||||||||||||||
| 43 | |||||||||||||||||||||||||||||
| 44 | 0 | ▶ | sub mailinglist_tasks { | ||||||||||||||||||||||||||
|
Subroutine
mailinglist_tasks: not called CC=4 SCAR=30.0
Pod
undocumented
| |||||||||||||||||||||||||||||
| 45 | |||||||||||||||||||||||||||||
| 46 | 0 | my ($self) = @_; | |||||||||||||||||||||||||||
| 47 | 0 | my $api = $self->{_wrapper}; | |||||||||||||||||||||||||||
| 48 | 0 | my $domain_name = $self->domain->name; | |||||||||||||||||||||||||||
| 49 | |||||||||||||||||||||||||||||
| 50 | 0 | my $response = $api->rawCall( method => 'get', path => "/email/domain/$domain_name/task/mailinglist", noSignature => 0 ); | |||||||||||||||||||||||||||
| 51 | 0 | ▶ | croak $response->error if $response->error; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 52 | |||||||||||||||||||||||||||||
| 53 | 0 | my $ids = $response->content; | |||||||||||||||||||||||||||
| 54 | 0 | my $objects = []; | |||||||||||||||||||||||||||
| 55 | |||||||||||||||||||||||||||||
| 56 | 0 | foreach my $id (@$ids) { | |||||||||||||||||||||||||||
| 57 | |||||||||||||||||||||||||||||
| 58 | 0 | ▶ | my $object = $self->{_tasks_mailinglist}{$id} = $self->{_tasks_mailinglist}{$id} || Webservice::OVH::Email::Domain::Domain::Task::Mailinglist->_new_existing( wrapper => $api, domain => $self->domain, id => $id, module => $self->{_module} ); | ||||||||||||||||||||||||||
|
Condition0%0/3
$self->{'_tasks_mailinglist'}{$id} || 'Webservice::OVH::Email::Domain::Domain::Task::Mailinglist'->_new_existing('wrapper', $api, 'domain', $self->domain, 'id', $id, 'module', $self->{'_module'})
MC/DC0%0/2
$self->{'_tasks_mailinglist'}{$id} || 'Webservice::OVH::Email::Domain::Domain::Task::Mailinglist'->_new_existing('wrapper', $api, 'domain', $self->domain, 'id', $id, 'module', $self->{'_module'})
$self->{'_tasks_mailinglist'}{$id}
'Webservice::OVH::Email::Domain::Domain::Task::Mailinglist'->_new_existing('wrapper', $api, 'domain', $self->domain, 'id', $id, 'module', $self->{'_module'})
Truth table0%0/3
A || B
A= $self->{'_tasks_mailinglist'}{$id}B= 'Webservice::OVH::Email::Domain::Domain::Task::Mailinglist'->_new_existing('wrapper', $api, 'domain', $self->domain, 'id', $id, 'module', $self->{'_module'})
| |||||||||||||||||||||||||||||
| 59 | 0 | push @$objects, $object; | |||||||||||||||||||||||||||
| 60 | } | ||||||||||||||||||||||||||||
| 61 | |||||||||||||||||||||||||||||
| 62 | 0 | return $objects; | |||||||||||||||||||||||||||
| 63 | } | ||||||||||||||||||||||||||||
| 64 | |||||||||||||||||||||||||||||
| 65 | 0 | ▶ | sub mailinglist_task_by_id { | ||||||||||||||||||||||||||
|
Subroutine
mailinglist_task_by_id: not called CC=5 SCAR=34.0
Pod
undocumented
| |||||||||||||||||||||||||||||
| 66 | |||||||||||||||||||||||||||||
| 67 | 0 | my ( $self, $id ) = @_; | |||||||||||||||||||||||||||
| 68 | |||||||||||||||||||||||||||||
| 69 | 0 | ▶ | croak "Missing id" unless $id; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 70 | |||||||||||||||||||||||||||||
| 71 | 0 | my $api = $self->{_wrapper}; | |||||||||||||||||||||||||||
| 72 | 0 | ▶ | my $from_object_array = $self->{_tasks_mailinglist}{$id} if $self->{_tasks_mailinglist}{$id} && $self->{_tasks_mailinglist}{$id}->is_valid; | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
$self->{"_tasks_mailinglist"}{$id} and $self->{"_tasks_mailinglist"}{$id}->is_valid
MC/DC0%0/2
$self->{"_tasks_mailinglist"}{$id} and $self->{"_tasks_mailinglist"}{$id}->is_valid
$self->{"_tasks_mailinglist"}{$id}
$self->{"_tasks_mailinglist"}{$id}->is_valid
Truth table0%0/3
A and B
A= $self->{"_tasks_mailinglist"}{$id}B= $self->{"_tasks_mailinglist"}{$id}->is_valid
| |||||||||||||||||||||||||||||
| 73 | 0 | ▶ | my $account = $self->{_tasks_mailinglist}{$id} = $from_object_array || Webservice::OVH::Email::Domain::Domain::Task::Mailinglist->_new_existing( wrapper => $api, domain => $self->domain, id => $id, module => $self->{_module} ); | ||||||||||||||||||||||||||
|
Condition0%0/3
$from_object_array || 'Webservice::OVH::Email::Domain::Domain::Task::Mailinglist'->_new_existing('wrapper', $api, 'domain', $self->domain, 'id', $id, 'module', $self->{'_module'})
MC/DC0%0/2
$from_object_array || 'Webservice::OVH::Email::Domain::Domain::Task::Mailinglist'->_new_existing('wrapper', $api, 'domain', $self->domain, 'id', $id, 'module', $self->{'_module'})
$from_object_array
'Webservice::OVH::Email::Domain::Domain::Task::Mailinglist'->_new_existing('wrapper', $api, 'domain', $self->domain, 'id', $id, 'module', $self->{'_module'})
Truth table0%0/3
A || B
A= $from_object_arrayB= 'Webservice::OVH::Email::Domain::Domain::Task::Mailinglist'->_new_existing('wrapper', $api, 'domain', $self->domain, 'id', $id, 'module', $self->{'_module'})
| |||||||||||||||||||||||||||||
| 74 | |||||||||||||||||||||||||||||
| 75 | 0 | return $account; | |||||||||||||||||||||||||||
| 76 | } | ||||||||||||||||||||||||||||
| 77 | |||||||||||||||||||||||||||||
| 78 | 0 | ▶ | sub mailinglist_tasks_by_name { | ||||||||||||||||||||||||||
|
Subroutine
mailinglist_tasks_by_name: not called CC=6 SCAR=37.4
Pod
undocumented
| |||||||||||||||||||||||||||||
| 79 | |||||||||||||||||||||||||||||
| 80 | 0 | my ( $self, $mailinglist_name ) = @_; | |||||||||||||||||||||||||||
| 81 | |||||||||||||||||||||||||||||
| 82 | 0 | ▶ | croak "Missing mailinglist_name" unless $mailinglist_name; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 83 | |||||||||||||||||||||||||||||
| 84 | 0 | my $domain_name = $self->domain->name; | |||||||||||||||||||||||||||
| 85 | 0 | my $api = $self->{_wrapper}; | |||||||||||||||||||||||||||
| 86 | |||||||||||||||||||||||||||||
| 87 | 0 | my $response = $api->rawCall( method => 'get', path => sprintf( "/email/domain/$domain_name/task/mailinglist?account=%s", $mailinglist_name ), noSignature => 0 ); | |||||||||||||||||||||||||||
| 88 | 0 | ▶ | croak $response->error if $response->error; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 89 | |||||||||||||||||||||||||||||
| 90 | 0 | my $ids = $response->content; | |||||||||||||||||||||||||||
| 91 | 0 | my $objects = []; | |||||||||||||||||||||||||||
| 92 | |||||||||||||||||||||||||||||
| 93 | 0 | foreach my $id (@$ids) { | |||||||||||||||||||||||||||
| 94 | |||||||||||||||||||||||||||||
| 95 | 0 | ▶ | my $object = $self->{_tasks_mailinglist}{$id} = $self->{_tasks_mailinglist}{$id} || Webservice::OVH::Email::Domain::Domain::Task::Mailinglist->_new_existing( wrapper => $api, domain => $self->domain, id => $id, module => $self->{_module} ); | ||||||||||||||||||||||||||
|
Condition0%0/3
$self->{'_tasks_mailinglist'}{$id} || 'Webservice::OVH::Email::Domain::Domain::Task::Mailinglist'->_new_existing('wrapper', $api, 'domain', $self->domain, 'id', $id, 'module', $self->{'_module'})
MC/DC0%0/2
$self->{'_tasks_mailinglist'}{$id} || 'Webservice::OVH::Email::Domain::Domain::Task::Mailinglist'->_new_existing('wrapper', $api, 'domain', $self->domain, 'id', $id, 'module', $self->{'_module'})
$self->{'_tasks_mailinglist'}{$id}
'Webservice::OVH::Email::Domain::Domain::Task::Mailinglist'->_new_existing('wrapper', $api, 'domain', $self->domain, 'id', $id, 'module', $self->{'_module'})
Truth table0%0/3
A || B
A= $self->{'_tasks_mailinglist'}{$id}B= 'Webservice::OVH::Email::Domain::Domain::Task::Mailinglist'->_new_existing('wrapper', $api, 'domain', $self->domain, 'id', $id, 'module', $self->{'_module'})
| |||||||||||||||||||||||||||||
| 96 | 0 | push @$objects, $object; | |||||||||||||||||||||||||||
| 97 | } | ||||||||||||||||||||||||||||
| 98 | |||||||||||||||||||||||||||||
| 99 | 0 | ▶ | return unless scalar @$objects; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 100 | |||||||||||||||||||||||||||||
| 101 | 0 | return $objects; | |||||||||||||||||||||||||||
| 102 | } | ||||||||||||||||||||||||||||
| 103 | |||||||||||||||||||||||||||||
| 104 | 0 | ▶ | sub account_tasks { | ||||||||||||||||||||||||||
|
Subroutine
account_tasks: not called CC=4 SCAR=30.0
Pod
undocumented
| |||||||||||||||||||||||||||||
| 105 | |||||||||||||||||||||||||||||
| 106 | 0 | my ($self) = @_; | |||||||||||||||||||||||||||
| 107 | |||||||||||||||||||||||||||||
| 108 | 0 | my $api = $self->{_wrapper}; | |||||||||||||||||||||||||||
| 109 | 0 | my $domain_name = $self->domain->name; | |||||||||||||||||||||||||||
| 110 | |||||||||||||||||||||||||||||
| 111 | 0 | my $response = $api->rawCall( method => 'get', path => "/email/domain/$domain_name/task/account", noSignature => 0 ); | |||||||||||||||||||||||||||
| 112 | 0 | ▶ | croak $response->error if $response->error; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 113 | |||||||||||||||||||||||||||||
| 114 | 0 | my $ids = $response->content; | |||||||||||||||||||||||||||
| 115 | 0 | my $objects = []; | |||||||||||||||||||||||||||
| 116 | |||||||||||||||||||||||||||||
| 117 | 0 | foreach my $id (@$ids) { | |||||||||||||||||||||||||||
| 118 | |||||||||||||||||||||||||||||
| 119 | 0 | ▶ | my $object = $self->{_tasks_account}{$id} = $self->{_tasks_account}{$id} || Webservice::OVH::Email::Domain::Domain::Task::Account->_new_existing( wrapper => $api, domain => $self->domain, id => $id, module => $self->{_module} ); | ||||||||||||||||||||||||||
|
Condition0%0/3
$self->{'_tasks_account'}{$id} || 'Webservice::OVH::Email::Domain::Domain::Task::Account'->_new_existing('wrapper', $api, 'domain', $self->domain, 'id', $id, 'module', $self->{'_module'})
MC/DC0%0/2
$self->{'_tasks_account'}{$id} || 'Webservice::OVH::Email::Domain::Domain::Task::Account'->_new_existing('wrapper', $api, 'domain', $self->domain, 'id', $id, 'module', $self->{'_module'})
$self->{'_tasks_account'}{$id}
'Webservice::OVH::Email::Domain::Domain::Task::Account'->_new_existing('wrapper', $api, 'domain', $self->domain, 'id', $id, 'module', $self->{'_module'})
Truth table0%0/3
A || B
A= $self->{'_tasks_account'}{$id}B= 'Webservice::OVH::Email::Domain::Domain::Task::Account'->_new_existing('wrapper', $api, 'domain', $self->domain, 'id', $id, 'module', $self->{'_module'})
| |||||||||||||||||||||||||||||
| 120 | 0 | push @$objects, $object; | |||||||||||||||||||||||||||
| 121 | } | ||||||||||||||||||||||||||||
| 122 | |||||||||||||||||||||||||||||
| 123 | 0 | return $objects; | |||||||||||||||||||||||||||
| 124 | } | ||||||||||||||||||||||||||||
| 125 | |||||||||||||||||||||||||||||
| 126 | 0 | ▶ | sub account_task_by_id { | ||||||||||||||||||||||||||
|
Subroutine
account_task_by_id: not called CC=4 SCAR=30.0
Pod
undocumented
| |||||||||||||||||||||||||||||
| 127 | |||||||||||||||||||||||||||||
| 128 | 0 | my ( $self, $id ) = @_; | |||||||||||||||||||||||||||
| 129 | |||||||||||||||||||||||||||||
| 130 | 0 | ▶ | croak "Missing id" unless $id; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 131 | |||||||||||||||||||||||||||||
| 132 | 0 | my $api = $self->{_wrapper}; | |||||||||||||||||||||||||||
| 133 | 0 | ▶ | my $from_object_array = $self->{_tasks_account}{$id} if $self->{_tasks_account}{$id}; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 134 | 0 | ▶ | my $account = $self->{_tasks_account}{$id} = $from_object_array || Webservice::OVH::Email::Domain::Domain::Task::Account->_new_existing( wrapper => $api, domain => $self->domain, id => $id, module => $self->{_module} ); | ||||||||||||||||||||||||||
|
Condition0%0/3
$from_object_array || 'Webservice::OVH::Email::Domain::Domain::Task::Account'->_new_existing('wrapper', $api, 'domain', $self->domain, 'id', $id, 'module', $self->{'_module'})
MC/DC0%0/2
$from_object_array || 'Webservice::OVH::Email::Domain::Domain::Task::Account'->_new_existing('wrapper', $api, 'domain', $self->domain, 'id', $id, 'module', $self->{'_module'})
$from_object_array
'Webservice::OVH::Email::Domain::Domain::Task::Account'->_new_existing('wrapper', $api, 'domain', $self->domain, 'id', $id, 'module', $self->{'_module'})
Truth table0%0/3
A || B
A= $from_object_arrayB= 'Webservice::OVH::Email::Domain::Domain::Task::Account'->_new_existing('wrapper', $api, 'domain', $self->domain, 'id', $id, 'module', $self->{'_module'})
| |||||||||||||||||||||||||||||
| 135 | |||||||||||||||||||||||||||||
| 136 | 0 | return $account; | |||||||||||||||||||||||||||
| 137 | } | ||||||||||||||||||||||||||||
| 138 | |||||||||||||||||||||||||||||
| 139 | 0 | ▶ | sub account_tasks_by_name { | ||||||||||||||||||||||||||
|
Subroutine
account_tasks_by_name: not called CC=6 SCAR=37.4
Pod
undocumented
| |||||||||||||||||||||||||||||
| 140 | |||||||||||||||||||||||||||||
| 141 | 0 | my ( $self, $account_name ) = @_; | |||||||||||||||||||||||||||
| 142 | |||||||||||||||||||||||||||||
| 143 | 0 | ▶ | croak "Missing mailinglist_name" unless $account_name; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 144 | |||||||||||||||||||||||||||||
| 145 | 0 | my $domain_name = $self->domain->name; | |||||||||||||||||||||||||||
| 146 | 0 | my $api = $self->{_wrapper}; | |||||||||||||||||||||||||||
| 147 | |||||||||||||||||||||||||||||
| 148 | 0 | my $response = $api->rawCall( method => 'get', path => sprintf( "/email/domain/$domain_name/task/account?name=%s", $account_name ), noSignature => 0 ); | |||||||||||||||||||||||||||
| 149 | 0 | ▶ | croak $response->error if $response->error; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 150 | |||||||||||||||||||||||||||||
| 151 | 0 | my $ids = $response->content; | |||||||||||||||||||||||||||
| 152 | 0 | my $objects = []; | |||||||||||||||||||||||||||
| 153 | |||||||||||||||||||||||||||||
| 154 | 0 | foreach my $id (@$ids) { | |||||||||||||||||||||||||||
| 155 | |||||||||||||||||||||||||||||
| 156 | 0 | ▶ | my $object = $self->{_tasks_account}{$id} = $self->{_tasks_account}{$id} || Webservice::OVH::Email::Domain::Domain::Task::Account->_new_existing( wrapper => $api, domain => $self->domain, id => $id, module => $self->{_module} ); | ||||||||||||||||||||||||||
|
Condition0%0/3
$self->{'_tasks_account'}{$id} || 'Webservice::OVH::Email::Domain::Domain::Task::Account'->_new_existing('wrapper', $api, 'domain', $self->domain, 'id', $id, 'module', $self->{'_module'})
MC/DC0%0/2
$self->{'_tasks_account'}{$id} || 'Webservice::OVH::Email::Domain::Domain::Task::Account'->_new_existing('wrapper', $api, 'domain', $self->domain, 'id', $id, 'module', $self->{'_module'})
$self->{'_tasks_account'}{$id}
'Webservice::OVH::Email::Domain::Domain::Task::Account'->_new_existing('wrapper', $api, 'domain', $self->domain, 'id', $id, 'module', $self->{'_module'})
Truth table0%0/3
A || B
A= $self->{'_tasks_account'}{$id}B= 'Webservice::OVH::Email::Domain::Domain::Task::Account'->_new_existing('wrapper', $api, 'domain', $self->domain, 'id', $id, 'module', $self->{'_module'})
| |||||||||||||||||||||||||||||
| 157 | 0 | push @$objects, $object; | |||||||||||||||||||||||||||
| 158 | } | ||||||||||||||||||||||||||||
| 159 | |||||||||||||||||||||||||||||
| 160 | 0 | ▶ | return unless scalar @$objects; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 161 | |||||||||||||||||||||||||||||
| 162 | 0 | return $objects; | |||||||||||||||||||||||||||
| 163 | } | ||||||||||||||||||||||||||||
| 164 | |||||||||||||||||||||||||||||
| 165 | 0 | ▶ | sub redirection_tasks { | ||||||||||||||||||||||||||
|
Subroutine
redirection_tasks: not called CC=4 SCAR=30.0
Pod
undocumented
| |||||||||||||||||||||||||||||
| 166 | |||||||||||||||||||||||||||||
| 167 | 0 | my ($self) = @_; | |||||||||||||||||||||||||||
| 168 | |||||||||||||||||||||||||||||
| 169 | 0 | my $api = $self->{_wrapper}; | |||||||||||||||||||||||||||
| 170 | 0 | my $domain_name = $self->domain->name; | |||||||||||||||||||||||||||
| 171 | |||||||||||||||||||||||||||||
| 172 | 0 | my $response = $api->rawCall( method => 'get', path => "/email/domain/$domain_name/task/redirection", noSignature => 0 ); | |||||||||||||||||||||||||||
| 173 | 0 | ▶ | croak $response->error if $response->error; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 174 | |||||||||||||||||||||||||||||
| 175 | 0 | my $ids = $response->content; | |||||||||||||||||||||||||||
| 176 | 0 | my $objects = []; | |||||||||||||||||||||||||||
| 177 | |||||||||||||||||||||||||||||
| 178 | 0 | foreach my $id (@$ids) { | |||||||||||||||||||||||||||
| 179 | |||||||||||||||||||||||||||||
| 180 | 0 | ▶ | my $object = $self->{_tasks_redirection}{$id} = $self->{_tasks_redirection}{$id} || Webservice::OVH::Email::Domain::Domain::Task::Redirection->_new_existing( wrapper => $api, domain => $self->domain, id => $id, module => $self->{_module} ); | ||||||||||||||||||||||||||
|
Condition0%0/3
$self->{'_tasks_redirection'}{$id} || 'Webservice::OVH::Email::Domain::Domain::Task::Redirection'->_new_existing('wrapper', $api, 'domain', $self->domain, 'id', $id, 'module', $self->{'_module'})
MC/DC0%0/2
$self->{'_tasks_redirection'}{$id} || 'Webservice::OVH::Email::Domain::Domain::Task::Redirection'->_new_existing('wrapper', $api, 'domain', $self->domain, 'id', $id, 'module', $self->{'_module'})
$self->{'_tasks_redirection'}{$id}
'Webservice::OVH::Email::Domain::Domain::Task::Redirection'->_new_existing('wrapper', $api, 'domain', $self->domain, 'id', $id, 'module', $self->{'_module'})
Truth table0%0/3
A || B
A= $self->{'_tasks_redirection'}{$id}B= 'Webservice::OVH::Email::Domain::Domain::Task::Redirection'->_new_existing('wrapper', $api, 'domain', $self->domain, 'id', $id, 'module', $self->{'_module'})
| |||||||||||||||||||||||||||||
| 181 | 0 | push @$objects, $object; | |||||||||||||||||||||||||||
| 182 | } | ||||||||||||||||||||||||||||
| 183 | |||||||||||||||||||||||||||||
| 184 | 0 | return $objects; | |||||||||||||||||||||||||||
| 185 | } | ||||||||||||||||||||||||||||
| 186 | |||||||||||||||||||||||||||||
| 187 | 0 | ▶ | sub redirection_task_by_id { | ||||||||||||||||||||||||||
|
Subroutine
redirection_task_by_id: not called CC=5 SCAR=34.0
Pod
undocumented
| |||||||||||||||||||||||||||||
| 188 | |||||||||||||||||||||||||||||
| 189 | 0 | my ( $self, $id ) = @_; | |||||||||||||||||||||||||||
| 190 | |||||||||||||||||||||||||||||
| 191 | 0 | ▶ | croak "Missing id" unless $id; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 192 | |||||||||||||||||||||||||||||
| 193 | 0 | my $api = $self->{_wrapper}; | |||||||||||||||||||||||||||
| 194 | 0 | ▶ | my $from_object_array = $self->{_tasks_redirection}{$id} if $self->{_tasks_redirection}{$id} && $self->{_tasks_redirection}{$id}->is_valid; | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
$self->{"_tasks_redirection"}{$id} and $self->{"_tasks_redirection"}{$id}->is_valid
MC/DC0%0/2
$self->{"_tasks_redirection"}{$id} and $self->{"_tasks_redirection"}{$id}->is_valid
$self->{"_tasks_redirection"}{$id}
$self->{"_tasks_redirection"}{$id}->is_valid
Truth table0%0/3
A and B
A= $self->{"_tasks_redirection"}{$id}B= $self->{"_tasks_redirection"}{$id}->is_valid
| |||||||||||||||||||||||||||||
| 195 | 0 | ▶ | my $account = $self->{_tasks_redirection}{$id} = $from_object_array || Webservice::OVH::Email::Domain::Domain::Task::Redirection->_new_existing( wrapper => $api, domain => $self->domain, id => $id, module => $self->{_module} ); | ||||||||||||||||||||||||||
|
Condition0%0/3
$from_object_array || 'Webservice::OVH::Email::Domain::Domain::Task::Redirection'->_new_existing('wrapper', $api, 'domain', $self->domain, 'id', $id, 'module', $self->{'_module'})
MC/DC0%0/2
$from_object_array || 'Webservice::OVH::Email::Domain::Domain::Task::Redirection'->_new_existing('wrapper', $api, 'domain', $self->domain, 'id', $id, 'module', $self->{'_module'})
$from_object_array
'Webservice::OVH::Email::Domain::Domain::Task::Redirection'->_new_existing('wrapper', $api, 'domain', $self->domain, 'id', $id, 'module', $self->{'_module'})
Truth table0%0/3
A || B
A= $from_object_arrayB= 'Webservice::OVH::Email::Domain::Domain::Task::Redirection'->_new_existing('wrapper', $api, 'domain', $self->domain, 'id', $id, 'module', $self->{'_module'})
| |||||||||||||||||||||||||||||
| 196 | |||||||||||||||||||||||||||||
| 197 | 0 | return $account; | |||||||||||||||||||||||||||
| 198 | } | ||||||||||||||||||||||||||||
| 199 | |||||||||||||||||||||||||||||
| 200 | 0 | ▶ | sub redirection_tasks_by_name { | ||||||||||||||||||||||||||
|
Subroutine
redirection_tasks_by_name: not called CC=6 SCAR=37.4
Pod
undocumented
| |||||||||||||||||||||||||||||
| 201 | |||||||||||||||||||||||||||||
| 202 | 0 | my ( $self, $redirection_id ) = @_; | |||||||||||||||||||||||||||
| 203 | |||||||||||||||||||||||||||||
| 204 | 0 | ▶ | croak "Missing mailinglist_name" unless $redirection_id; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 205 | |||||||||||||||||||||||||||||
| 206 | 0 | my $domain_name = $self->domain->name; | |||||||||||||||||||||||||||
| 207 | 0 | my $api = $self->{_wrapper}; | |||||||||||||||||||||||||||
| 208 | |||||||||||||||||||||||||||||
| 209 | 0 | my $response = $api->rawCall( method => 'get', path => sprintf( "/email/domain/$domain_name/task/redirection?account=%s", $redirection_id ), noSignature => 0 ); | |||||||||||||||||||||||||||
| 210 | 0 | ▶ | croak $response->error if $response->error; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 211 | |||||||||||||||||||||||||||||
| 212 | 0 | my $ids = $response->content; | |||||||||||||||||||||||||||
| 213 | 0 | my $objects = []; | |||||||||||||||||||||||||||
| 214 | |||||||||||||||||||||||||||||
| 215 | 0 | foreach my $id (@$ids) { | |||||||||||||||||||||||||||
| 216 | |||||||||||||||||||||||||||||
| 217 | 0 | ▶ | my $object = $self->{_tasks_redirection}{$id} = $self->{_tasks_redirection}{$id} || Webservice::OVH::Email::Domain::Domain::Task::Redirection->_new_existing( wrapper => $api, domain => $self->domain, id => $id, module => $self->{_module} ); | ||||||||||||||||||||||||||
|
Condition0%0/3
$self->{'_tasks_redirection'}{$id} || 'Webservice::OVH::Email::Domain::Domain::Task::Redirection'->_new_existing('wrapper', $api, 'domain', $self->domain, 'id', $id, 'module', $self->{'_module'})
MC/DC0%0/2
$self->{'_tasks_redirection'}{$id} || 'Webservice::OVH::Email::Domain::Domain::Task::Redirection'->_new_existing('wrapper', $api, 'domain', $self->domain, 'id', $id, 'module', $self->{'_module'})
$self->{'_tasks_redirection'}{$id}
'Webservice::OVH::Email::Domain::Domain::Task::Redirection'->_new_existing('wrapper', $api, 'domain', $self->domain, 'id', $id, 'module', $self->{'_module'})
Truth table0%0/3
A || B
A= $self->{'_tasks_redirection'}{$id}B= 'Webservice::OVH::Email::Domain::Domain::Task::Redirection'->_new_existing('wrapper', $api, 'domain', $self->domain, 'id', $id, 'module', $self->{'_module'})
| |||||||||||||||||||||||||||||
| 218 | 0 | push @$objects, $object; | |||||||||||||||||||||||||||
| 219 | } | ||||||||||||||||||||||||||||
| 220 | |||||||||||||||||||||||||||||
| 221 | 0 | ▶ | return unless scalar @$objects; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 222 | |||||||||||||||||||||||||||||
| 223 | 0 | return $objects; | |||||||||||||||||||||||||||
| 224 | } | ||||||||||||||||||||||||||||
| 225 | |||||||||||||||||||||||||||||
| 226 | 36 | 1; | |||||||||||||||||||||||||||