MailboxOrg/API/Mail.pm

filter: Statementstmt 100% 21 / 21 Branchbran 50.0% 2 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 5 / 5 Podpod 100% 2 / 2 totaltotal 93.7% 30 / 32 CC 3 SCAR 4.6
CC
3
Cov
92%
find
2.0
list
2.0
BEGIN
1.0
CRAP 1.6
« MailboxOrg/API/Utils.pm ↑ Summary MailboxOrg/API/Passwordreset.pm »
1 package WWW::MailboxOrg::API::Mail;
2  
3 # ABSTRACT: Mail operations API
4  
5 5 ▶use Moo;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 5 with 'WWW::MailboxOrg::Role::API';
7 5 ▶use Params::ValidationCompiler qw( validation_for );
Subroutine BEGIN: called CC=1 SCAR=0.0
8 5 ▶use Types::Standard qw( Str ArrayRef HashRef Bool Int );
Subroutine BEGIN: called CC=1 SCAR=0.0
9  
10 5 has client => (
11 is => 'ro',
12 required => 1,
13 weak_ref => 1,
14 );
15  
16 5 my %validators = (
17 find => validation_for( params => { query => { type => Str, optional => 0 } } ),
18 list => validation_for(
19 params => {
20 account => { type => Str, optional => 1 },
21 folder => { type => Str, optional => 1 },
22 order_by => { type => Str, optional => 1 },
23 page => { type => Int, optional => 1 },
24 per_page => { type => Int, optional => 1 },
25 result_mode => { type => Str, optional => 1 },
26 unseen_only => { type => Bool, optional => 1 },
27 },
28 ),
29 );
30  
31  
32 2 ▶sub find {
Subroutine find: called CC=2 SCAR=7.0
Pod documented
33 2 my ( $self, %params ) = @_;
34 2 my $v = $validators{'find'};
35 2 ▶ %params = $v->(%params) if $v;
Branch: 1 branch
BranchTrueFalseTotal
if $v 2 0 2
36 1 return $self->_rpc( 'mail.find', \%params );
37 }
38  
39  
40 1 ▶sub list {
Subroutine list: called CC=2 SCAR=7.0
Pod documented
41 1 my ( $self, %params ) = @_;
42 1 my $v = $validators{'list'};
43 1 ▶ %params = $v->(%params) if $v;
Branch: 1 branch
BranchTrueFalseTotal
if $v 1 0 1
44 1 return $self->_rpc( 'mail.list', \%params );
45 }
46  
47 5 1;
48  
49 __END__
« MailboxOrg/API/Utils.pm ↑ Summary MailboxOrg/API/Passwordreset.pm »