| 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
Condition100%3/3
defined $self->location_constraint and $self->location_constraint ne "us-east-1"
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"
| |||||||||||||||||||||||||||||
| 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 | ||||||||||||||||||||||||||||