Net/Amazon/S3/Operation/Bucket/Location/Response.pm

filter: Statementstmt 50.0% 6 / 12 Branchbran 0.0% 0 / 2 Conditioncond 0.0% 0 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 33.3% 1 / 3 Podpod 0.0% 0 / 1 totaltotal 30.4% 7 / 23 SCAR 16.9
CC
3
Cov
35%
_parse_data
12.0
location
2.0
BEGIN
1.0
CRAP 5.4
« Net/Amazon/S3/Operation/Bucket/Acl/Set/Request.pm ↑ Summary Net/Amazon/S3/Operation/Objects/List/Response.pm »
1 package Net::Amazon::S3::Operation::Bucket::Location::Response;
2 # ABSTRACT: An internal class to handle bucket location response
3 99 $Net::Amazon::S3::Operation::Bucket::Location::Response::VERSION = '0.99';
4 99 ▶use Moose;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 99 extends 'Net::Amazon::S3::Response';
7  
8 sub location {
9 0 ▶ $_[0]->_data->{location};
Subroutine location: not called CC=1 SCAR=6.9
Pod undocumented
10 }
11  
12 sub _parse_data {
13 0 ▶ my ($self) = @_;
Subroutine _parse_data: not called CC=3 SCAR=24.8
14  
15 0 my $xpc = $self->xpath_context;
16  
17 0 my $data = {
18 location => scalar $xpc->findvalue ("//s3:LocationConstraint"),
19 };
20  
21 # S3 documentation: https://docs.aws.amazon.com/AmazonS3/latest/API/RESTBucketGETlocation.html
22 # When the bucket's region is US East (N. Virginia),
23 # Amazon S3 returns an empty string for the bucket's region
24 $data->{location} = 'us-east-1'
25 0 ▶ if defined $data->{location} && $data->{location} eq '';
Branch: 1 branch
BranchTrueFalseTotal
if defined $data->{"location"} and $data->{"location"} eq "" 0 0 0
Condition0%0/3
defined $data->{"location"} and $data->{"location"} eq ""
!ll&&!rl&&r
000
MC/DC0%0/2
defined $data->{"location"} and $data->{"location"} eq ""
defined $data->{"location"} $data->{"location"} eq ""
Truth table0%0/3
A and B
A= defined $data->{"location"}B= $data->{"location"} eq ""
ABresult
0X0
100
111
26  
27 0 return $data;
28 }
29  
30 99 1;
31  
32 __END__
33  
34 =pod
35  
36 =encoding UTF-8
37  
38 =head1 NAME
39  
40 Net::Amazon::S3::Operation::Bucket::Location::Response - An internal class to handle bucket location response
41  
42 =head1 VERSION
43  
44 version 0.99
45  
46 =head1 DESCRIPTION
47  
48 Implements operation L<< GetBucketLocation|https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketLocation.html >>
49  
50 =head1 AUTHOR
51  
52 Branislav Zahradník <barney@cpan.org>
53  
54 =head1 COPYRIGHT AND LICENSE
55  
56 This software is copyright (c) 2021 by Amazon Digital Services, Leon Brocard, Brad Fitzpatrick, Pedro Figueiredo, Rusty Conover, Branislav Zahradník.
57  
58 This is free software; you can redistribute it and/or modify it under
59 the same terms as the Perl 5 programming language system itself.
60  
61 =cut
« Net/Amazon/S3/Operation/Bucket/Acl/Set/Request.pm ↑ Summary Net/Amazon/S3/Operation/Objects/List/Response.pm »