File Coverage

blib/lib/Net/Amazon/S3/Operation/Buckets/List/Response.pm
Criterion Covered Total %
statement 14 14 100.0
branch n/a
condition n/a
subroutine 5 5 100.0
pod 0 3 0.0
total 19 22 86.3


line stmt bran cond sub pod time code
1             # ABSTRACT: An internal class to process list all buckets response
2             $Net::Amazon::S3::Operation::Buckets::List::Response::VERSION = '0.991';
3             use Moose;
4 99     99   657  
  99         227  
  99         630  
5             extends 'Net::Amazon::S3::Response';
6              
7             $_[0]->_data->{owner_id};
8             }
9 4     4 0 131  
10             $_[0]->_data->{owner_displayname};
11             }
12              
13 4     4 0 89 @{ $_[0]->_data->{buckets} };
14             }
15              
16             my ($self) = @_;
17 4     4 0 8  
  4         87  
18             my $xpc = $self->xpath_context;
19              
20             my $data = {
21 4     4   73 owner_id => $xpc->findvalue ("/s3:ListAllMyBucketsResult/s3:Owner/s3:ID"),
22             owner_displayname => $xpc->findvalue ("/s3:ListAllMyBucketsResult/s3:Owner/s3:DisplayName"),
23 4         93 buckets => [],
24             };
25 4         15  
26             foreach my $node ($xpc->findnodes ("/s3:ListAllMyBucketsResult/s3:Buckets/s3:Bucket")) {
27             push @{ $data->{buckets} }, {
28             name => $xpc->findvalue ("./s3:Name", $node),
29             creation_date => $xpc->findvalue ("./s3:CreationDate", $node),
30             };
31 4         502 }
32 8         640  
  8         30  
33             return $data;
34             }
35              
36             1;
37              
38 4         422  
39             =pod
40              
41             =encoding UTF-8
42              
43             =head1 NAME
44              
45             Net::Amazon::S3::Operation::Buckets::List::Response - An internal class to process list all buckets response
46              
47             =head1 VERSION
48              
49             version 0.991
50              
51             =head1 DESCRIPTION
52              
53             Implements S3 operation L<< ListBuckets|https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListBuckets.html >>
54              
55             =head1 AUTHOR
56              
57             Branislav Zahradník <barney@cpan.org>
58              
59             =head1 COPYRIGHT AND LICENSE
60              
61             This software is copyright (c) 2022 by Amazon Digital Services, Leon Brocard, Brad Fitzpatrick, Pedro Figueiredo, Rusty Conover, Branislav Zahradník.
62              
63             This is free software; you can redistribute it and/or modify it under
64             the same terms as the Perl 5 programming language system itself.
65              
66             =cut