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