Net/Amazon/S3/Operation/Object/Upload/Complete/Request.pm

filter: Statementstmt 100% 22 / 22 Branchbran 100% 2 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 4 / 4 Podpod 0.0% 0 / 1 totaltotal 96.5% 28 / 29 CC 2 SCAR 3.4
CC
2
Cov
100%
BUILD
2.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.4
« Net/Amazon/S3/Operation/Objects/Delete/Request.pm ↑ Summary Net/Amazon/S3/Request/Role/HTTP/Header/ACL.pm »
1 package Net::Amazon::S3::Operation::Object::Upload::Complete::Request;
2 # ABSTRACT: An internal class to complete a multipart upload
3 99 $Net::Amazon::S3::Operation::Object::Upload::Complete::Request::VERSION = '0.992';
4 99 ▶use Moose 0.85;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 99 ▶use Carp qw/croak/;
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 99 extends 'Net::Amazon::S3::Request::Object';
8  
9 99 with 'Net::Amazon::S3::Request::Role::HTTP::Method::POST';
10 99 with 'Net::Amazon::S3::Request::Role::Query::Param::Upload_id';
11 99 with 'Net::Amazon::S3::Request::Role::XML::Content';
12  
13 99 has 'etags' => ( is => 'ro', isa => 'ArrayRef', required => 1 );
14 99 has 'part_numbers' => ( is => 'ro', isa => 'ArrayRef', required => 1 );
15  
16 99 __PACKAGE__->meta->make_immutable;
17  
18 2 ▶sub _request_content {
Subroutine _request_content: called CC=1 SCAR=0.0
19 2 my ($self) = @_;
20  
21 return $self->_build_xml (CompleteMultipartUpload => [
22 map +{ Part => [
23 { PartNumber => $self->part_numbers->[$_] },
24 { ETag => $self->etags->[$_] },
25 2 ]}, 0 .. (@{$self->part_numbers} - 1)
26 ]);
27 }
28  
29 3 ▶sub BUILD {
Subroutine BUILD: called CC=2 SCAR=6.9
Pod undocumented
30 3 my ($self) = @_;
31  
32 croak "must have an equally sized list of etags and part numbers"
33 3 ▶ unless scalar(@{$self->part_numbers}) == scalar(@{$self->etags});
Branch: 1 branch
BranchTrueFalseTotal
unless scalar @{$self->part_numbers;} == scalar @{$self->etags;} 1 2 3
34 }
35  
36 99 1;
37  
38 __END__
« Net/Amazon/S3/Operation/Objects/Delete/Request.pm ↑ Summary Net/Amazon/S3/Request/Role/HTTP/Header/ACL.pm »