File Coverage

blib/lib/Net/Amazon/S3/Operation/Bucket/Location/Response.pm
Criterion Covered Total %
statement 3 9 33.3
branch 0 2 0.0
condition 0 3 0.0
subroutine 1 3 33.3
pod 0 1 0.0
total 4 18 22.2


line stmt bran cond sub pod time code
1             # ABSTRACT: An internal class to handle bucket location response
2             $Net::Amazon::S3::Operation::Bucket::Location::Response::VERSION = '0.991';
3             use Moose;
4 99     99   631  
  99         3512  
  99         780  
5             extends 'Net::Amazon::S3::Response';
6              
7             $_[0]->_data->{location};
8             }
9 0     0 0    
10             my ($self) = @_;
11              
12             my $xpc = $self->xpath_context;
13 0     0      
14             my $data = {
15 0           location => scalar $xpc->findvalue ("//s3:LocationConstraint"),
16             };
17 0            
18             # S3 documentation: https://docs.aws.amazon.com/AmazonS3/latest/API/RESTBucketGETlocation.html
19             # When the bucket's region is US East (N. Virginia),
20             # Amazon S3 returns an empty string for the bucket's region
21             $data->{location} = 'us-east-1'
22             if defined $data->{location} && $data->{location} eq '';
23              
24             return $data;
25 0 0 0       }
26              
27 0           1;
28              
29              
30             =pod
31              
32             =encoding UTF-8
33              
34             =head1 NAME
35              
36             Net::Amazon::S3::Operation::Bucket::Location::Response - An internal class to handle bucket location response
37              
38             =head1 VERSION
39              
40             version 0.991
41              
42             =head1 DESCRIPTION
43              
44             Implements operation L<< GetBucketLocation|https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketLocation.html >>
45              
46             =head1 AUTHOR
47              
48             Branislav Zahradník <barney@cpan.org>
49              
50             =head1 COPYRIGHT AND LICENSE
51              
52             This software is copyright (c) 2022 by Amazon Digital Services, Leon Brocard, Brad Fitzpatrick, Pedro Figueiredo, Rusty Conover, Branislav Zahradník.
53              
54             This is free software; you can redistribute it and/or modify it under
55             the same terms as the Perl 5 programming language system itself.
56              
57             =cut