File Coverage

blib/lib/Net/Amazon/S3/Operation/Bucket/Create/Request.pm
Criterion Covered Total %
statement 10 10 100.0
branch 2 2 100.0
condition 3 3 100.0
subroutine 3 3 100.0
pod 1 1 100.0
total 19 19 100.0


line stmt bran cond sub pod time code
1             # ABSTRACT: An internal class to create a bucket
2             $Net::Amazon::S3::Operation::Bucket::Create::Request::VERSION = '0.991';
3             use Moose 0.85;
4 99     99   624 extends 'Net::Amazon::S3::Request::Bucket';
  99         2074  
  99         574  
5              
6             with 'Net::Amazon::S3::Request::Role::HTTP::Header::ACL';
7             with 'Net::Amazon::S3::Request::Role::HTTP::Method::PUT';
8             with 'Net::Amazon::S3::Request::Role::XML::Content';
9              
10             has location_constraint => (
11             is => 'ro',
12             isa => 'MaybeLocationConstraint',
13             coerce => 1,
14             required => 0,
15             );
16              
17             __PACKAGE__->meta->make_immutable;
18              
19             my ($self) = @_;
20              
21 39     39   88 my $content = '';
22             if (defined $self->location_constraint && $self->location_constraint ne 'us-east-1') {
23 39         75 $content = $self->_build_xml (
24 39 100 100     1221 CreateBucketConfiguration => [
25 7         208 { LocationConstraint => $self->location_constraint },
26             ]
27             );
28             }
29              
30             return $content;
31             }
32 39         1387  
33             my $self = shift;
34              
35             return $self->_build_http_request (
36 69     69 1 117 region => 'us-east-1',
37             );
38 69         255 }
39              
40             1;
41              
42              
43             =pod
44              
45             =encoding UTF-8
46              
47             =head1 NAME
48              
49             Net::Amazon::S3::Operation::Bucket::Create::Request - An internal class to create a bucket
50              
51             =head1 VERSION
52              
53             version 0.991
54              
55             =head1 SYNOPSIS
56              
57             my $http_request = Net::Amazon::S3::Operation::Bucket::Create::Request->new(
58             s3 => $s3,
59             bucket => $bucket,
60             acl_short => $acl_short,
61             location_constraint => $location_constraint,
62             )->http_request;
63              
64             =head1 DESCRIPTION
65              
66             This module creates a bucket.
67              
68             Implements operation L<< CreateBucket|https://docs.aws.amazon.com/AmazonS3/latest/API/API_CreateBucket.html >>
69              
70             =for test_synopsis no strict 'vars'
71              
72             =head1 METHODS
73              
74             =head2 http_request
75              
76             This method returns a HTTP::Request object.
77              
78             =head1 AUTHOR
79              
80             Branislav Zahradník <barney@cpan.org>
81              
82             =head1 COPYRIGHT AND LICENSE
83              
84             This software is copyright (c) 2022 by Amazon Digital Services, Leon Brocard, Brad Fitzpatrick, Pedro Figueiredo, Rusty Conover, Branislav Zahradník.
85              
86             This is free software; you can redistribute it and/or modify it under
87             the same terms as the Perl 5 programming language system itself.
88              
89             =cut