Net/Amazon/S3/Operation/Bucket/Acl/Set/Request.pm

filter: Statementstmt 100% 24 / 24 Branchbran 100% 4 / 4 Conditioncond 100% 8 / 8 MC/DCmcdc 100% 5 / 5 Subroutinesub 100% 5 / 5 Podpod 0.0% 0 / 1 totaltotal 97.8% 46 / 47 SCAR 17.9
CC
6
Cov
100%
BUILD
5.0
_request_content
2.0
BEGIN
1.0
CRAP 6.0
« Net/Amazon/S3/Operation/Object/Acl/Set/Request.pm ↑ Summary Net/Amazon/S3/Operation/Bucket/Location/Response.pm »
1 package Net::Amazon::S3::Operation::Bucket::Acl::Set::Request;
2 # ABSTRACT: An internal class to set a bucket's access control
3 99 $Net::Amazon::S3::Operation::Bucket::Acl::Set::Request::VERSION = '0.99';
4 99 ▶use Moose 0.85;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 99 ▶use MooseX::StrictConstructor 0.16;
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 99 ▶use Carp ();
Subroutine BEGIN: called CC=1 SCAR=0.0
8  
9 99 extends 'Net::Amazon::S3::Request::Bucket';
10  
11 99 with 'Net::Amazon::S3::Request::Role::HTTP::Header::ACL';
12  
13 99 has 'acl_xml' => (
14 is => 'ro',
15 isa => 'Maybe[Str]',
16 required => 0,
17 );
18  
19 99 with 'Net::Amazon::S3::Request::Role::Query::Action::Acl';
20 99 with 'Net::Amazon::S3::Request::Role::HTTP::Method::PUT';
21  
22 99 __PACKAGE__->meta->make_immutable;
23  
24 sub _request_content {
25 22 ▶ my ($self) = @_;
Subroutine _request_content: called CC=2 SCAR=6.9
26  
27 22 ▶ return $self->acl_xml || '';
Condition100%2/2
$self->acl_xml || ''
l!l
319
MC/DC100%1/1
$self->acl_xml || ''
$self->acl_xml
Truth table100%2/2
A
A= $self->acl_xml
Aresult
11
00
28 }
29  
30 sub BUILD {
31 24 ▶ my ($self) = @_;
Subroutine BUILD: called CC=5 SCAR=16.1
Pod undocumented
32  
33 24 ▶ unless ($self->acl_xml || $self->acl) {
Branch: 1 branch
BranchTrueFalseTotal
unless ($self->acl_xml or $self->acl) 1 23 24
Condition100%3/3
$self->acl_xml or $self->acl
l!l&&r!l&&!r
4191
MC/DC100%2/2
$self->acl_xml or $self->acl
$self->acl_xml $self->acl
Truth table100%3/3
A or B
A= $self->acl_xmlB= $self->acl
ABresult
1X1
011
000
34 1 Carp::confess "need either acl_xml or acl";
35 }
36  
37 23 ▶ if ($self->acl_xml && $self->acl) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->acl_xml and $self->acl) 1 22 23
Condition100%3/3
$self->acl_xml and $self->acl
!ll&&!rl&&r
1931
MC/DC100%2/2
$self->acl_xml and $self->acl
$self->acl_xml $self->acl
Truth table100%3/3
A and B
A= $self->acl_xmlB= $self->acl
ABresult
0X0
100
111
38 1 Carp::confess "can not provide both acl_xml and acl";
39 }
40 }
41  
42 99 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.99
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
« Net/Amazon/S3/Operation/Object/Acl/Set/Request.pm ↑ Summary Net/Amazon/S3/Operation/Bucket/Location/Response.pm »