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.99';
4 99     99   802 use Moose;
  99         278  
  99         839  
5              
6             extends 'Net::Amazon::S3::Response';
7              
8             sub owner_id {
9 4     4 0 130 $_[0]->_data->{owner_id};
10             }
11              
12             sub owner_displayname {
13 4     4 0 116 $_[0]->_data->{owner_displayname};
14             }
15              
16             sub buckets {
17 4     4 0 9 @{ $_[0]->_data->{buckets} };
  4         107  
18             }
19              
20             sub _parse_data {
21 4     4   80 my ($self) = @_;
22              
23 4         129 my $xpc = $self->xpath_context;
24              
25 4         17 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         576 foreach my $node ($xpc->findnodes ("/s3:ListAllMyBucketsResult/s3:Buckets/s3:Bucket")) {
32 8         804 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         532 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.99
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