| 1 | |||||||||||
| 2 | package AWS::S3::Request::ListBucket; | ||||||||||
| 3 | |||||||||||
| 4 | 1 | ▶ | use Moose; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 5 | 1 | ▶ | use AWS::S3::Signer; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 6 | 1 | ▶ | use URI::Escape qw/ uri_escape /; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 7 | |||||||||||
| 8 | 1 | with 'AWS::S3::Roles::Request'; | |||||||||
| 9 | 1 | with 'AWS::S3::Roles::Bucket'; | |||||||||
| 10 | |||||||||||
| 11 | 1 | has 'bucket' => ( | |||||||||
| 12 | is => 'ro', | ||||||||||
| 13 | isa => 'Str', | ||||||||||
| 14 | required => 1, | ||||||||||
| 15 | ); | ||||||||||
| 16 | |||||||||||
| 17 | 1 | has 'max_keys' => ( | |||||||||
| 18 | is => 'ro', | ||||||||||
| 19 | isa => 'Int', | ||||||||||
| 20 | required => 1, | ||||||||||
| 21 | ); | ||||||||||
| 22 | |||||||||||
| 23 | 1 | has 'marker' => ( | |||||||||
| 24 | is => 'ro', | ||||||||||
| 25 | isa => 'Str', | ||||||||||
| 26 | required => 0, | ||||||||||
| 27 | ); | ||||||||||
| 28 | |||||||||||
| 29 | 1 | has 'prefix' => ( | |||||||||
| 30 | is => 'ro', | ||||||||||
| 31 | isa => 'Str', | ||||||||||
| 32 | required => 0, | ||||||||||
| 33 | ); | ||||||||||
| 34 | |||||||||||
| 35 | 1 | has 'delimiter' => ( | |||||||||
| 36 | is => 'ro', | ||||||||||
| 37 | isa => 'Str', | ||||||||||
| 38 | required => 0, | ||||||||||
| 39 | ); | ||||||||||
| 40 | |||||||||||
| 41 | 1 | has '+_expect_nothing' => ( default => 0 ); | |||||||||
| 42 | |||||||||||
| 43 | 5 | ▶ | sub request { | ||||||||
|
Subroutine
request: called CC=5 SCAR=16.2
Pod
undocumented
| |||||||||||
| 44 | 5 | my $s = shift; | |||||||||
| 45 | |||||||||||
| 46 | 5 | my @params = (); | |||||||||
| 47 | 5 | push @params, 'max-keys=' . $s->max_keys; | |||||||||
| 48 | 5 | ▶ | push @params, 'marker=' . uri_escape( $s->marker ) if $s->marker; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 49 | 5 | ▶ | push @params, 'prefix=' . $s->prefix if $s->prefix; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 50 | 5 | ▶ | push @params, 'delimiter=' . $s->delimiter if $s->delimiter; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 51 | |||||||||||
| 52 | 5 | my $uri = $s->bucket_uri; | |||||||||
| 53 | |||||||||||
| 54 | 5 | ▶ | my $signer = AWS::S3::Signer->new( | ||||||||
|
Branch: 1 branch
| |||||||||||
| 55 | s3 => $s->s3, | ||||||||||
| 56 | method => 'GET', | ||||||||||
| 57 | uri => $uri . '/' . ( @params ? '?' . join( '&', @params ) : '' ), | ||||||||||
| 58 | ); | ||||||||||
| 59 | 5 | $s->_send_request( | |||||||||
| 60 | $signer->method => $signer->uri => { | ||||||||||
| 61 | Authorization => $signer->auth_header, | ||||||||||
| 62 | Date => $signer->date, | ||||||||||
| 63 | } | ||||||||||
| 64 | ); | ||||||||||
| 65 | } # end request() | ||||||||||
| 66 | |||||||||||
| 67 | 1 | __PACKAGE__->meta->make_immutable; | |||||||||