| 1 | package EWS::DistributionList::Role::Reader; | ||||||||||||||||||||||||||||||||||||||||||
| 2 | BEGIN { | ||||||||||||||||||||||||||||||||||||||||||
| 3 | 1 | ▶ | $EWS::DistributionList::Role::Reader::VERSION = '1.143070'; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 4 | } | ||||||||||||||||||||||||||||||||||||||||||
| 5 | 1 | ▶ | use Moose::Role; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 6 | |||||||||||||||||||||||||||||||||||||||||||
| 7 | 1 | ▶ | use EWS::DistributionList::ResultSet; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 8 | 1 | ▶ | use Carp; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 9 | |||||||||||||||||||||||||||||||||||||||||||
| 10 | sub _list_messages { | ||||||||||||||||||||||||||||||||||||||||||
| 11 | 0 | ▶ | my ( $self, $kind, $response ) = @_; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_list_messages: not called CC=1 SCAR=6.9
| |||||||||||||||||||||||||||||||||||||||||||
| 12 | 0 | return @{ $response->{"${kind}Result"}->{ResponseMessages}->{cho_CreateItemResponseMessage} }; | |||||||||||||||||||||||||||||||||||||||||
| 13 | } | ||||||||||||||||||||||||||||||||||||||||||
| 14 | |||||||||||||||||||||||||||||||||||||||||||
| 15 | sub _check_for_errors { | ||||||||||||||||||||||||||||||||||||||||||
| 16 | 0 | ▶ | my ( $self, $kind, $response ) = @_; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_check_for_errors: not called CC=4 SCAR=30.0
| |||||||||||||||||||||||||||||||||||||||||||
| 17 | |||||||||||||||||||||||||||||||||||||||||||
| 18 | 0 | foreach my $msg ( $self->_list_messages( $kind, $response ) ) { | |||||||||||||||||||||||||||||||||||||||||
| 19 | 0 | ▶ | my $code = $msg->{"${kind}ResponseMessage"}->{ResponseCode} || ''; | ||||||||||||||||||||||||||||||||||||||||
|
Condition0%0/2
$$msg{"${kind}ResponseMessage"}{'ResponseCode'} || ''
MC/DC0%0/1
$$msg{"${kind}ResponseMessage"}{'ResponseCode'} || ''
$$msg{"${kind}ResponseMessage"}{'ResponseCode'}
Truth table0%0/2
A
A= $$msg{"${kind}ResponseMessage"}{'ResponseCode'}
| |||||||||||||||||||||||||||||||||||||||||||
| 20 | 0 | ▶ | croak "Fault returned from Exchange Server: $code\n" | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 21 | if $code ne 'NoError'; | ||||||||||||||||||||||||||||||||||||||||||
| 22 | } | ||||||||||||||||||||||||||||||||||||||||||
| 23 | 0 | return; | |||||||||||||||||||||||||||||||||||||||||
| 24 | } | ||||||||||||||||||||||||||||||||||||||||||
| 25 | |||||||||||||||||||||||||||||||||||||||||||
| 26 | sub _list_dlitems { | ||||||||||||||||||||||||||||||||||||||||||
| 27 | 0 | ▶ | my ( $self, $kind, $response ) = @_; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_list_dlitems: not called CC=2 SCAR=17.9
| |||||||||||||||||||||||||||||||||||||||||||
| 28 | |||||||||||||||||||||||||||||||||||||||||||
| 29 | 0 | ▶ | return map { @{ $_->{DLExpansion}->{Mailbox} || [] } } | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 30 | 0 | map { $_->{"${kind}ResponseMessage"} } $self->_list_messages( $kind, $response ); | |||||||||||||||||||||||||||||||||||||||||
| 31 | } | ||||||||||||||||||||||||||||||||||||||||||
| 32 | |||||||||||||||||||||||||||||||||||||||||||
| 33 | sub _get_dls { | ||||||||||||||||||||||||||||||||||||||||||
| 34 | 0 | ▶ | my ( $self, $opts ) = @_; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_get_dls: not called CC=2 SCAR=17.9
| |||||||||||||||||||||||||||||||||||||||||||
| 35 | |||||||||||||||||||||||||||||||||||||||||||
| 36 | return $self->client->ExpandDL->( | ||||||||||||||||||||||||||||||||||||||||||
| 37 | ( exists $opts->{impersonate} | ||||||||||||||||||||||||||||||||||||||||||
| 38 | ? ( Impersonation => { ConnectingSID => { PrimarySmtpAddress => $opts->{impersonate}, } }, ) | ||||||||||||||||||||||||||||||||||||||||||
| 39 | : () | ||||||||||||||||||||||||||||||||||||||||||
| 40 | ), | ||||||||||||||||||||||||||||||||||||||||||
| 41 | RequestVersion => { Version => $self->client->server_version, }, | ||||||||||||||||||||||||||||||||||||||||||
| 42 | Mailbox => { EmailAddress => $opts->{distribution_email}, }, | ||||||||||||||||||||||||||||||||||||||||||
| 43 | 0 | ▶ | ); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 44 | } | ||||||||||||||||||||||||||||||||||||||||||
| 45 | |||||||||||||||||||||||||||||||||||||||||||
| 46 | # find primarysmtp if passed an account id. | ||||||||||||||||||||||||||||||||||||||||||
| 47 | # then find dls in the account. | ||||||||||||||||||||||||||||||||||||||||||
| 48 | sub retrieve { | ||||||||||||||||||||||||||||||||||||||||||
| 49 | 0 | ▶ | my ( $self, $opts ) = @_; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
retrieve: not called CC=4 SCAR=30.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||
| 50 | |||||||||||||||||||||||||||||||||||||||||||
| 51 | 0 | my $get_response = $self->_get_dls($opts); | |||||||||||||||||||||||||||||||||||||||||
| 52 | |||||||||||||||||||||||||||||||||||||||||||
| 53 | 0 | ▶ | if ( exists $get_response->{'ResponseCode'} | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/6
exists $get_response->{"ResponseCode"} and defined $get_response->{"ResponseCode"} and $get_response->{"ResponseCode"} eq "ErrorNonPrimarySmtpAddress"
exists $get_response->{"ResponseCode"} and defined $get_response->{"ResponseCode"}
MC/DC0%0/3
exists $get_response->{"ResponseCode"} and defined $get_response->{"ResponseCode"} and $get_response->{"ResponseCode"} eq "ErrorNonPrimarySmtpAddress"
exists $get_response->{"ResponseCode"}
defined $get_response->{"ResponseCode"}
$get_response->{"ResponseCode"} eq "ErrorNonPrimarySmtpAddress"
Truth table0%0/4
A and B and C
A= exists $get_response->{"ResponseCode"}B= defined $get_response->{"ResponseCode"}C= $get_response->{"ResponseCode"} eq "ErrorNonPrimarySmtpAddress"
| |||||||||||||||||||||||||||||||||||||||||||
| 54 | and defined $get_response->{'ResponseCode'} | ||||||||||||||||||||||||||||||||||||||||||
| 55 | and $get_response->{'ResponseCode'} eq 'ErrorNonPrimarySmtpAddress' ) | ||||||||||||||||||||||||||||||||||||||||||
| 56 | { | ||||||||||||||||||||||||||||||||||||||||||
| 57 | |||||||||||||||||||||||||||||||||||||||||||
| 58 | 0 | $self->retrieve( { %{$opts}, distribution_email => $get_response->{DLExpansion}->{Mailbox} } ); | |||||||||||||||||||||||||||||||||||||||||
| 59 | } | ||||||||||||||||||||||||||||||||||||||||||
| 60 | |||||||||||||||||||||||||||||||||||||||||||
| 61 | 0 | $self->_check_for_errors( 'ExpandDL', $get_response ); | |||||||||||||||||||||||||||||||||||||||||
| 62 | |||||||||||||||||||||||||||||||||||||||||||
| 63 | 0 | return EWS::DistributionList::ResultSet->new( | |||||||||||||||||||||||||||||||||||||||||
| 64 | { mailboxes => [ $self->_list_dlitems( 'ExpandDL', $get_response ) ] } ); | ||||||||||||||||||||||||||||||||||||||||||
| 65 | } | ||||||||||||||||||||||||||||||||||||||||||
| 66 | |||||||||||||||||||||||||||||||||||||||||||
| 67 | sub expand { | ||||||||||||||||||||||||||||||||||||||||||
| 68 | 0 | ▶ | return shift->retrieve( { distribution_email => shift } ); | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
expand: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||
| 69 | } | ||||||||||||||||||||||||||||||||||||||||||
| 70 | |||||||||||||||||||||||||||||||||||||||||||
| 71 | 1 | ▶ | no Moose::Role; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 72 | 1 | 1; | |||||||||||||||||||||||||||||||||||||||||