| line | stmt | bran | cond | sub | pod | time | code | 
| 1 |  |  |  |  |  |  | package JMAP::Validation::Generators::SetError; | 
| 2 |  |  |  |  |  |  |  | 
| 3 | 2 |  |  | 2 |  | 685 | use strict; | 
|  | 2 |  |  |  |  | 2 |  | 
|  | 2 |  |  |  |  | 43 |  | 
| 4 | 2 |  |  | 2 |  | 6 | use warnings; | 
|  | 2 |  |  |  |  | 2 |  | 
|  | 2 |  |  |  |  | 36 |  | 
| 5 |  |  |  |  |  |  |  | 
| 6 | 2 |  |  | 2 |  | 556 | use JMAP::Validation::Generators::String; | 
|  | 2 |  |  |  |  | 2 |  | 
|  | 2 |  |  |  |  | 40 |  | 
| 7 | 2 |  |  | 2 |  | 8 | use JSON::Typist; | 
|  | 2 |  |  |  |  | 1 |  | 
|  | 2 |  |  |  |  | 209 |  | 
| 8 |  |  |  |  |  |  |  | 
| 9 |  |  |  |  |  |  | my %types = ( | 
| 10 |  |  |  |  |  |  | invalidArguments => { | 
| 11 |  |  |  |  |  |  | description => JMAP::Validation::Generators::String->generate(), | 
| 12 |  |  |  |  |  |  | }, | 
| 13 |  |  |  |  |  |  | invalidProperties => { | 
| 14 |  |  |  |  |  |  | properties  => [], | 
| 15 |  |  |  |  |  |  | description => JMAP::Validation::Generators::String->generate(), | 
| 16 |  |  |  |  |  |  | }, | 
| 17 |  |  |  |  |  |  | ( | 
| 18 |  |  |  |  |  |  | map { $_ => undef } | 
| 19 |  |  |  |  |  |  | qw{ | 
| 20 |  |  |  |  |  |  | accountReadOnly | 
| 21 |  |  |  |  |  |  | fromAccountNoMail | 
| 22 |  |  |  |  |  |  | fromAccountNotFound | 
| 23 |  |  |  |  |  |  | invalidMailboxes | 
| 24 |  |  |  |  |  |  | maxQuotaReached | 
| 25 |  |  |  |  |  |  | notFound | 
| 26 |  |  |  |  |  |  | stateMismatch | 
| 27 |  |  |  |  |  |  | toAccountNoMail | 
| 28 |  |  |  |  |  |  | toAccountNotFound | 
| 29 |  |  |  |  |  |  | } | 
| 30 |  |  |  |  |  |  | ), | 
| 31 |  |  |  |  |  |  | ); | 
| 32 |  |  |  |  |  |  |  | 
| 33 |  |  |  |  |  |  | sub generate { | 
| 34 | 8 |  |  | 8 | 0 | 297 | my (@types) = @_; | 
| 35 |  |  |  |  |  |  |  | 
| 36 | 8 |  |  |  |  | 6 | my @SetErrors; | 
| 37 |  |  |  |  |  |  |  | 
| 38 | 8 | 50 |  |  |  | 18 | foreach my $type (@types ? @types : (keys %types)) { | 
| 39 |  |  |  |  |  |  | push @SetErrors, { | 
| 40 |  |  |  |  |  |  | type => JSON::Typist::String->new($type), | 
| 41 | 8 | 100 |  |  |  | 15 | ($types{$type} ? (%{$types{$type}}) : ()), | 
|  | 4 |  |  |  |  | 28 |  | 
| 42 |  |  |  |  |  |  | }; | 
| 43 |  |  |  |  |  |  | } | 
| 44 |  |  |  |  |  |  |  | 
| 45 | 8 |  |  |  |  | 41 | return \@SetErrors; | 
| 46 |  |  |  |  |  |  | } | 
| 47 |  |  |  |  |  |  |  | 
| 48 |  |  |  |  |  |  | 1; |