File Coverage

blib/lib/AWS/CloudFront/CustomOrigin.pm
Criterion Covered Total %
statement 6 6 100.0
branch n/a
condition n/a
subroutine 2 2 100.0
pod n/a
total 8 8 100.0


line stmt bran cond sub pod time code
1              
2             package S3::CloudFront::CustomOrigin;
3              
4 1     1   4 use VSO;
  1         3  
  1         6  
5 1     1   1167 use Data::Validate::Domain 'is_domain';
  1         7123  
  1         310  
6              
7              
8             has 'DNSName' => (
9             is => 'ro',
10             isa => 'Str',
11             required => 1,
12             where => sub {
13             is_domain($_, { do_allow_underscore => 1 })
14             }
15             );
16              
17              
18             has 'HTTPPort' => (
19             is => 'ro',
20             isa => 'Int',
21             required => 0,
22             default => sub { 80 },
23             where => sub {
24             $_ == 80 ||
25             $_ == 443 ||
26             (
27             $_ >= 1024 &&
28             $_ <= 65535
29             )
30             }
31             );
32              
33             has 'HTTPSPort' => (
34             is => 'ro',
35             isa => 'Int',
36             required => 0,
37             default => sub { 443 },
38             where => sub {
39             $_ == 80 ||
40             $_ == 443 ||
41             (
42             $_ >= 1024 &&
43             $_ <= 65535
44             )
45             }
46             );
47              
48             has 'OriginProtocolPolicy' => (
49             is => 'ro',
50             isa => 'Str',
51             required => 0,
52             where => sub {
53             $_ =~ m{^(http-only|match-viewer)$}
54             }
55             );
56              
57             1;# return true:
58