File Coverage

blib/lib/Net/Amazon/S3/Operation/Object/Fetch/Request.pm
Criterion Covered Total %
statement 10 10 100.0
branch 1 2 50.0
condition n/a
subroutine 3 3 100.0
pod 1 1 100.0
total 15 16 93.7


line stmt bran cond sub pod time code
1             # ABSTRACT: An internal class to get an object
2             $Net::Amazon::S3::Operation::Object::Fetch::Request::VERSION = '0.991';
3             use Moose 0.85;
4 99     99   637 use MooseX::StrictConstructor 0.16;
  99         2014  
  99         647  
5 99     99   530659  
  99         1642  
  99         659  
6             extends 'Net::Amazon::S3::Request::Object';
7              
8             with 'Net::Amazon::S3::Request::Role::HTTP::Method';
9              
10             has 'range'
11             => is => 'ro'
12             => isa => 'Str'
13             ;
14              
15             override _request_headers => sub {
16             my ($self) = @_;
17              
18             return (
19             super,
20             (Range => $self->range) x defined $self->range,
21             );
22             };
23              
24             __PACKAGE__->meta->make_immutable;
25              
26             my ( $self, $expires, $query_form ) = @_;
27              
28 8     8 1 97 my $uri = URI->new( $self->_request_path );
29             $uri->query_form( %$query_form ) if $query_form;
30 8         40  
31 8 50       7649 return $self->_build_signed_request(
32             path => $uri->as_string,
33 8         39 )->query_string_authentication_uri($expires);
34             }
35              
36             1;
37              
38              
39             =pod
40              
41             =encoding UTF-8
42              
43             =head1 NAME
44              
45             Net::Amazon::S3::Operation::Object::Fetch::Request - An internal class to get an object
46              
47             =head1 VERSION
48              
49             version 0.991
50              
51             =head1 SYNOPSIS
52              
53             my $http_request = Net::Amazon::S3::Operation::Object::Fetch::Request->new (
54             s3 => $s3,
55             bucket => $bucket,
56             key => $key,
57             method => 'GET',
58             );
59              
60             =head1 DESCRIPTION
61              
62             Implements operation L<< GetObject|https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetObject.html >>.
63              
64             This module gets an object.
65              
66             =for test_synopsis no strict 'vars'
67              
68             =head1 METHODS
69              
70             =head2 http_request
71              
72             This method returns a HTTP::Request object.
73              
74             =head2 query_string_authentication_uri
75              
76             This method returns query string authentication URI.
77              
78             =head1 AUTHOR
79              
80             Branislav ZahradnĂ­k <barney@cpan.org>
81              
82             =head1 COPYRIGHT AND LICENSE
83              
84             This software is copyright (c) 2022 by Amazon Digital Services, Leon Brocard, Brad Fitzpatrick, Pedro Figueiredo, Rusty Conover, Branislav ZahradnĂ­k.
85              
86             This is free software; you can redistribute it and/or modify it under
87             the same terms as the Perl 5 programming language system itself.
88              
89             =cut