File Coverage

blib/lib/Net/Amazon/S3/Operation/Object/Upload/Part/Request.pm
Criterion Covered Total %
statement 8 8 100.0
branch 1 2 50.0
condition n/a
subroutine 3 3 100.0
pod 1 1 100.0
total 13 14 92.8


line stmt bran cond sub pod time code
1             # ABSTRACT: An internal class to put part of a multipart upload
2             $Net::Amazon::S3::Operation::Object::Upload::Part::Request::VERSION = '0.991';
3             use Moose 0.85;
4 99     99   643 use MooseX::StrictConstructor 0.16;
  99         2101  
  99         598  
5 99     99   523718 extends 'Net::Amazon::S3::Request::Object';
  99         1622  
  99         638  
6              
7             with 'Net::Amazon::S3::Request::Role::Query::Param::Upload_id';
8             with 'Net::Amazon::S3::Request::Role::Query::Param::Part_number';
9             with 'Net::Amazon::S3::Request::Role::HTTP::Header::Copy_source';
10             with 'Net::Amazon::S3::Request::Role::HTTP::Method::PUT';
11              
12             has 'value' => ( is => 'ro', isa => 'Str|CodeRef|ScalarRef', required => 0 );
13             has 'headers' =>
14             ( is => 'ro', isa => 'HashRef', required => 0, default => sub { {} } );
15              
16             __PACKAGE__->meta->make_immutable;
17              
18             my ($self) = @_;
19              
20             return %{ $self->headers };
21             }
22              
23             my $self = shift;
24              
25             return $self->_build_http_request(
26 3     3 1 5 content => scalar( defined( $self->value ) ? $self->value : '' ),
27             );
28 3 50       107 }
29              
30             1;
31              
32              
33             =pod
34              
35             =encoding UTF-8
36              
37             =head1 NAME
38              
39             Net::Amazon::S3::Operation::Object::Upload::Part::Request - An internal class to put part of a multipart upload
40              
41             =head1 VERSION
42              
43             version 0.991
44              
45             =head1 SYNOPSIS
46              
47             my $request = Net::Amazon::S3::Operation::Object::Upload::Part::Request->new (
48             s3 => $s3,
49             bucket => $bucket,
50             key => $key,
51             value => $value,
52             acl_short => $acl_short,
53             headers => $conf,
54             part_number => $part_number,
55             upload_id => $upload_id
56             );
57              
58             =head1 DESCRIPTION
59              
60             This module puts an object.
61              
62             Implements an operation L<< UploadPart|https://docs.aws.amazon.com/AmazonS3/latest/API/API_UploadPart.html >>
63              
64             =for test_synopsis no strict 'vars'
65              
66             =head1 METHODS
67              
68             =head2 http_request
69              
70             This method returns a HTTP::Request object.
71              
72             =head1 AUTHOR
73              
74             Branislav Zahradník <barney@cpan.org>
75              
76             =head1 COPYRIGHT AND LICENSE
77              
78             This software is copyright (c) 2022 by Amazon Digital Services, Leon Brocard, Brad Fitzpatrick, Pedro Figueiredo, Rusty Conover, Branislav Zahradník.
79              
80             This is free software; you can redistribute it and/or modify it under
81             the same terms as the Perl 5 programming language system itself.
82              
83             =cut