Net/Amazon/S3/Operation/Bucket/Create/Request.pm

filter: Statementstmt 100% 18 / 18 Branchbran 100% 2 / 2 Conditioncond 100% 3 / 3 MC/DCmcdc 100% 2 / 2 Subroutinesub 100% 3 / 3 Podpod 100% 1 / 1 totaltotal 100% 29 / 29 SCAR 11.0
CC
3
Cov
100%
_request_content
3.0
BEGIN
1.0
http_request
1.0
CRAP 3.0
« Net/Amazon/S3/X.pm ↑ Summary Net/Amazon/S3/Operation/Buckets/List/Response.pm »
1 package Net::Amazon::S3::Operation::Bucket::Create::Request;
2 # ABSTRACT: An internal class to create a bucket
3 99 $Net::Amazon::S3::Operation::Bucket::Create::Request::VERSION = '0.99';
4 99 ▶use Moose 0.85;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 99 extends 'Net::Amazon::S3::Request::Bucket';
6  
7 99 with 'Net::Amazon::S3::Request::Role::HTTP::Header::ACL';
8 99 with 'Net::Amazon::S3::Request::Role::HTTP::Method::PUT';
9 99 with 'Net::Amazon::S3::Request::Role::XML::Content';
10  
11 99 has location_constraint => (
12 is => 'ro',
13 isa => 'MaybeLocationConstraint',
14 coerce => 1,
15 required => 0,
16 );
17  
18 99 __PACKAGE__->meta->make_immutable;
19  
20 sub _request_content {
21 39 ▶ my ($self) = @_;
Subroutine _request_content: called CC=3 SCAR=11.0
22  
23 39 my $content = '';
24 39 ▶ if (defined $self->location_constraint && $self->location_constraint ne 'us-east-1') {
Branch: 1 branch
BranchTrueFalseTotal
if (defined $self->location_constraint and $self->location_constraint ne "us-east-1") 7 32 39
Condition100%3/3
defined $self->location_constraint and $self->location_constraint ne "us-east-1"
!ll&&!rl&&r
3117
MC/DC100%2/2
defined $self->location_constraint and $self->location_constraint ne "us-east-1"
defined $self->location_constraint $self->location_constraint ne "us-east-1"
Truth table100%3/3
A and B
A= defined $self->location_constraintB= $self->location_constraint ne "us-east-1"
ABresult
0X0
100
111
25 7 $content = $self->_build_xml (
26 CreateBucketConfiguration => [
27 { LocationConstraint => $self->location_constraint },
28 ]
29 );
30 }
31  
32 39 return $content;
33 }
34  
35 sub http_request {
36 69 ▶ my $self = shift;
Subroutine http_request: called CC=1 SCAR=0.0
Pod documented
37  
38 69 return $self->_build_http_request (
39 region => 'us-east-1',
40 );
41 }
42  
43 99 1;
44  
45 __END__
46  
47 =pod
48  
49 =encoding UTF-8
50  
51 =head1 NAME
52  
53 Net::Amazon::S3::Operation::Bucket::Create::Request - An internal class to create a bucket
54  
55 =head1 VERSION
56  
57 version 0.99
58  
59 =head1 SYNOPSIS
60  
61 my $http_request = Net::Amazon::S3::Operation::Bucket::Create::Request->new(
62 s3 => $s3,
63 bucket => $bucket,
64 acl_short => $acl_short,
65 location_constraint => $location_constraint,
66 )->http_request;
67  
68 =head1 DESCRIPTION
69  
70 This module creates a bucket.
71  
72 Implements operation L<< CreateBucket|https://docs.aws.amazon.com/AmazonS3/latest/API/API_CreateBucket.html >>
73  
74 =for test_synopsis no strict 'vars'
75  
76 =head1 METHODS
77  
78 =head2 http_request
79  
80 This method returns a HTTP::Request object.
81  
82 =head1 AUTHOR
83  
84 Branislav Zahradník <barney@cpan.org>
85  
86 =head1 COPYRIGHT AND LICENSE
87  
88 This software is copyright (c) 2021 by Amazon Digital Services, Leon Brocard, Brad Fitzpatrick, Pedro Figueiredo, Rusty Conover, Branislav Zahradník.
89  
90 This is free software; you can redistribute it and/or modify it under
91 the same terms as the Perl 5 programming language system itself.
92  
93 =cut
« Net/Amazon/S3/X.pm ↑ Summary Net/Amazon/S3/Operation/Buckets/List/Response.pm »