File: GetObject.pm

package info (click to toggle)
libnet-amazon-s3-perl 0.56-1
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 288 kB
  • sloc: perl: 2,264; makefile: 7
file content (62 lines) | stat: -rw-r--r-- 1,380 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
package Net::Amazon::S3::Request::GetObject;
use Moose 0.85;
use MooseX::StrictConstructor 0.16;
extends 'Net::Amazon::S3::Request';

has 'bucket' => ( is => 'ro', isa => 'BucketName', required => 1 );
has 'key'    => ( is => 'ro', isa => 'Str',        required => 1 );
has 'method' => ( is => 'ro', isa => 'HTTPMethod', required => 1 );

__PACKAGE__->meta->make_immutable;

sub http_request {
    my $self = shift;

    return Net::Amazon::S3::HTTPRequest->new(
        s3     => $self->s3,
        method => $self->method,
        path   => $self->_uri( $self->key ),
    )->http_request;
}

sub query_string_authentication_uri {
    my ( $self, $expires ) = @_;

    return Net::Amazon::S3::HTTPRequest->new(
        s3     => $self->s3,
        method => $self->method,
        path   => $self->_uri( $self->key ),
    )->query_string_authentication_uri($expires);
}

1;

__END__

=head1 NAME

Net::Amazon::S3::Request::GetObject - An internal class to get an object

=head1 SYNOPSIS

  my $http_request = Net::Amazon::S3::Request::GetObject->new(
    s3     => $s3,
    bucket => $bucket,
    key    => $key,
    method => 'GET',
  )->http_request;

=head1 DESCRIPTION

This module gets an object.

=head1 METHODS

=head2 http_request

This method returns a HTTP::Request object.

=head2 query_string_authentication_uri

This method returns query string authentication URI.