« Net/Amazon/S3/Operation/Objects/Delete/Request.pm
↑ Summary
Net/Amazon/S3/Operation/Object/Upload/Part/Request.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.991'; | |||||||||
| 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 | sub _request_content { | ||||||||||
| 19 | 2 | ▶ | my ($self) = @_; | ||||||||
|
Subroutine
_request_content: called CC=1 SCAR=0.0
| |||||||||||
| 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 | sub BUILD { | ||||||||||
| 30 | 3 | ▶ | my ($self) = @_; | ||||||||
|
Subroutine
BUILD: called CC=2 SCAR=6.9
Pod
undocumented
| |||||||||||
| 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
| |||||||||||
| 34 | } | ||||||||||
| 35 | |||||||||||
| 36 | 99 | 1; | |||||||||
| 37 | |||||||||||
| 38 | __END__ | ||||||||||
| 39 | |||||||||||
| 40 | =pod | ||||||||||
| 41 | |||||||||||
| 42 | =encoding UTF-8 | ||||||||||
| 43 | |||||||||||
| 44 | =head1 NAME | ||||||||||
| 45 | |||||||||||
| 46 | Net::Amazon::S3::Operation::Object::Upload::Complete::Request - An internal class to complete a multipart upload | ||||||||||
| 47 | |||||||||||
| 48 | =head1 VERSION | ||||||||||
| 49 | |||||||||||
| 50 | version 0.991 | ||||||||||
| 51 | |||||||||||
| 52 | =head1 SYNOPSIS | ||||||||||
| 53 | |||||||||||
| 54 | my $request = Net::Amazon::S3::Operation::Object::Upload::Complete::Request->new ( | ||||||||||
| 55 | s3 => $s3, | ||||||||||
| 56 | bucket => $bucket, | ||||||||||
| 57 | etags => \@etags, | ||||||||||
| 58 | part_numbers => \@part_numbers, | ||||||||||
| 59 | ); | ||||||||||
| 60 | |||||||||||
| 61 | =head1 DESCRIPTION | ||||||||||
| 62 | |||||||||||
| 63 | This module completes a multipart upload. | ||||||||||
| 64 | |||||||||||
| 65 | Implements operation L<< CompleteMultipartUpload|https://docs.aws.amazon.com/AmazonS3/latest/API/API_CompleteMultipartUpload.html >> | ||||||||||
| 66 | |||||||||||
| 67 | =for test_synopsis no strict 'vars' | ||||||||||
| 68 | |||||||||||
| 69 | =head1 METHODS | ||||||||||
| 70 | |||||||||||
| 71 | =head2 http_request | ||||||||||
| 72 | |||||||||||
| 73 | This method returns a HTTP::Request object. | ||||||||||
| 74 | |||||||||||
| 75 | =head1 AUTHOR | ||||||||||
| 76 | |||||||||||
| 77 | Branislav Zahradník <barney@cpan.org> | ||||||||||
| 78 | |||||||||||
| 79 | =head1 COPYRIGHT AND LICENSE | ||||||||||
| 80 | |||||||||||
| 81 | This software is copyright (c) 2022 by Amazon Digital Services, Leon Brocard, Brad Fitzpatrick, Pedro Figueiredo, Rusty Conover, Branislav Zahradník. | ||||||||||
| 82 | |||||||||||
| 83 | This is free software; you can redistribute it and/or modify it under | ||||||||||
| 84 | the same terms as the Perl 5 programming language system itself. | ||||||||||
| 85 | |||||||||||
| 86 | =cut | ||||||||||