File Coverage

blib/lib/Net/Amazon/S3/Operation/Bucket/Acl/Set/Request.pm
Criterion Covered Total %
statement 16 16 100.0
branch 4 4 100.0
condition 8 8 100.0
subroutine 5 5 100.0
pod 0 1 0.0
total 33 34 97.0


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