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