File Coverage

blib/lib/Net/Amazon/S3/ACL/Canned.pm
Criterion Covered Total %
statement 25 25 100.0
branch n/a
condition n/a
subroutine 14 14 100.0
pod 7 9 77.7
total 46 48 95.8


line stmt bran cond sub pod time code
1             package Net::Amazon::S3::ACL::Canned;
2             # Abstract: Representation of canned ACL
3             $Net::Amazon::S3::ACL::Canned::VERSION = '0.98';
4 97     97   159806 use Moose 0.85;
  97         9882634  
  97         803  
5 97     97   684866 use MooseX::StrictConstructor 0.16;
  97         649103  
  97         735  
6 97     97   471129 use Moose::Util::TypeConstraints;
  97         262  
  97         1009  
7              
8 97     97   230097 use Net::Amazon::S3::Constraint::ACL::Canned;
  97         284  
  97         3333  
9              
10 97     97   1223 use Net::Amazon::S3::Constants;
  97         224  
  97         40646  
11              
12             class_type 'Net::Amazon::S3::ACL::Canned';
13              
14             coerce 'Net::Amazon::S3::ACL::Canned'
15             => from 'Net::Amazon::S3::Constraint::ACL::Canned'
16             => via { Net::Amazon::S3::ACL::Canned->new ($_) }
17             ;
18              
19             around BUILDARGS => sub {
20             my ($orig, $class) = (shift, shift);
21              
22             return +{ canned_acl => $_[0] }
23             if @_ == 1 && ! ref $_[0];
24              
25             return $class->$orig (@_);
26             };
27              
28             has canned_acl => (
29             is => 'ro',
30             isa => 'Net::Amazon::S3::Constraint::ACL::Canned',
31             required => 1,
32             );
33              
34             sub build_headers {
35 110     110 0 4725 my ($self) = @_;
36              
37 110         3645 return +(Net::Amazon::S3::Constants->HEADER_CANNED_ACL => $self->canned_acl);
38             }
39              
40 16     16 1 28600 sub PRIVATE { __PACKAGE__->new ('private') }
41 2     2 1 3161 sub PUBLIC_READ { __PACKAGE__->new ('public-read') }
42 2     2 1 3159 sub PUBLIC_READ_WRITE { __PACKAGE__->new ('public-read-write') }
43 2     2 1 16281 sub AWS_EXEC_READ { __PACKAGE__->new ('aws-exec-read') }
44 2     2 1 8794 sub AUTHENTICATED_READ { __PACKAGE__->new ('authenticated-read') }
45 2     2 1 3213 sub BUCKET_OWNER_READ { __PACKAGE__->new ('bucket-owner-read') }
46 2     2 1 3246 sub BUCKET_OWNER_FULL_CONTROL { __PACKAGE__->new ('bucket-owner-full-control') }
47 2     2 0 3158 sub LOG_DELIVERY_WRITE { __PACKAGE__->new ('log-delivery-write') }
48              
49             1;
50              
51             __END__
52              
53             =pod
54              
55             =encoding UTF-8
56              
57             =head1 NAME
58              
59             Net::Amazon::S3::ACL::Canned
60              
61             =head1 VERSION
62              
63             version 0.98
64              
65             =head1 SYNOPSIS
66              
67             my $acl = Net::Amazon::S3::ACL::Canned->PRIVATE;
68             my $acl = Net::Amazon::S3::ACL::Canned->PUBLIC_READ;
69              
70             =head1 DESCRIPTION
71              
72             Class representes predefined Amazon S3 canned ACL.
73              
74             =head1 FACTORY BUILDERS
75              
76             =head2 PRIVATE
77              
78             =head2 PUBLIC_READ
79              
80             =head2 PUBLIC_READ_WRITE
81              
82             =head2 AWS_EXEC_READ
83              
84             =head2 AUTHENTICATED_READ
85              
86             =head2 BUCKET_OWNER_READ
87              
88             =head2 BUCKET_OWNER_FULL_CONTROL
89              
90             =head2 LOG_DELIVER_WRITE
91              
92             =head1 AUTHOR
93              
94             Branislav Zahradník <barney@cpan.org>
95              
96             =head1 COPYRIGHT AND LICENSE
97              
98             This module is part of L<Net::Amazon::S3>.
99              
100             =head1 AUTHOR
101              
102             Branislav Zahradník <barney@cpan.org>
103              
104             =head1 COPYRIGHT AND LICENSE
105              
106             This software is copyright (c) 2021 by Amazon Digital Services, Leon Brocard, Brad Fitzpatrick, Pedro Figueiredo, Rusty Conover, Branislav Zahradník.
107              
108             This is free software; you can redistribute it and/or modify it under
109             the same terms as the Perl 5 programming language system itself.
110              
111             =cut