File Coverage

blib/lib/Net/Amazon/S3/Operation/Object/Acl/Set/Request.pm
Criterion Covered Total %
statement 13 13 100.0
branch 4 4 100.0
condition 8 8 100.0
subroutine 4 4 100.0
pod 0 1 0.0
total 29 30 96.6


line stmt bran cond sub pod time code
1             # ABSTRACT: An internal class to set an object's access control
2             $Net::Amazon::S3::Operation::Object::Acl::Set::Request::VERSION = '0.991';
3             use Moose 0.85;
4 99     99   620 use MooseX::StrictConstructor 0.16;
  99         1955  
  99         627  
5 99     99   528897  
  99         1577  
  99         643  
6             extends 'Net::Amazon::S3::Request::Object';
7              
8             has 'acl_xml' => ( is => 'ro', isa => 'Maybe[Str]', required => 0 );
9              
10             with 'Net::Amazon::S3::Request::Role::Query::Action::Acl';
11             with 'Net::Amazon::S3::Request::Role::HTTP::Header::ACL';
12             with 'Net::Amazon::S3::Request::Role::HTTP::Method::PUT';
13              
14             __PACKAGE__->meta->make_immutable;
15              
16             my ($self) = @_;
17              
18 23     23   54 return $self->acl_xml || '';
19             }
20 23   100     668  
21             my ($self) = @_;
22              
23             unless ( $self->acl_xml || $self->acl ) {
24 25     25 0 17346 confess "need either acl_xml or acl";
25             }
26 25 100 100     870  
27 1         192 if ( $self->acl_xml && $self->acl ) {
28             confess "can not provide both acl_xml and acl";
29             }
30 24 100 100     677 }
31 1         219  
32             1;
33              
34              
35             =pod
36              
37             =encoding UTF-8
38              
39             =head1 NAME
40              
41             Net::Amazon::S3::Operation::Object::Acl::Set::Request - An internal class to set an object's access control
42              
43             =head1 VERSION
44              
45             version 0.991
46              
47             =head1 SYNOPSIS
48              
49             my $request = Net::Amazon::S3::Operation::Object::Acl::Set::Request->new (
50             s3 => $s3,
51             bucket => $bucket,
52             key => $key,
53             acl_short => $acl_short,
54             acl_xml => $acl_xml,
55             );
56              
57             =head1 DESCRIPTION
58              
59             Implements operation L<< PutObjectAcl|https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutObjectAcl.html >>.
60              
61             This module sets an object's access control.
62              
63             =for test_synopsis no strict 'vars'
64              
65             =head1 METHODS
66              
67             =head2 http_request
68              
69             This method returns a HTTP::Request object.
70              
71             =head1 AUTHOR
72              
73             Branislav Zahradník <barney@cpan.org>
74              
75             =head1 COPYRIGHT AND LICENSE
76              
77             This software is copyright (c) 2022 by Amazon Digital Services, Leon Brocard, Brad Fitzpatrick, Pedro Figueiredo, Rusty Conover, Branislav Zahradník.
78              
79             This is free software; you can redistribute it and/or modify it under
80             the same terms as the Perl 5 programming language system itself.
81              
82             =cut