| 1 | |||||||||||
| 2 | package AWS::S3::Request::ListBucket; | ||||||||||
| 3 | |||||||||||
| 4 | 4 | ▶ | use Moose; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 5 | |||||||||||
| 6 | 4 | with 'AWS::S3::Roles::Request'; | |||||||||
| 7 | 4 | with 'AWS::S3::Roles::Bucket'; | |||||||||
| 8 | |||||||||||
| 9 | 4 | has 'bucket' => ( | |||||||||
| 10 | is => 'ro', | ||||||||||
| 11 | isa => 'AWS::S3::BucketName', | ||||||||||
| 12 | required => 1, | ||||||||||
| 13 | ); | ||||||||||
| 14 | |||||||||||
| 15 | 4 | has 'max_keys' => ( | |||||||||
| 16 | is => 'ro', | ||||||||||
| 17 | isa => 'Int', | ||||||||||
| 18 | required => 1, | ||||||||||
| 19 | ); | ||||||||||
| 20 | |||||||||||
| 21 | 4 | has 'marker' => ( | |||||||||
| 22 | is => 'ro', | ||||||||||
| 23 | isa => 'Str', | ||||||||||
| 24 | required => 0, | ||||||||||
| 25 | ); | ||||||||||
| 26 | |||||||||||
| 27 | 4 | has 'prefix' => ( | |||||||||
| 28 | is => 'ro', | ||||||||||
| 29 | isa => 'Str', | ||||||||||
| 30 | required => 0, | ||||||||||
| 31 | ); | ||||||||||
| 32 | |||||||||||
| 33 | 4 | has 'delimiter' => ( | |||||||||
| 34 | is => 'ro', | ||||||||||
| 35 | isa => 'Str', | ||||||||||
| 36 | required => 0, | ||||||||||
| 37 | ); | ||||||||||
| 38 | |||||||||||
| 39 | 4 | has '+_expect_nothing' => ( default => 0 ); | |||||||||
| 40 | |||||||||||
| 41 | 9 | ▶ | sub request { | ||||||||
|
Subroutine
request: called CC=5 SCAR=16.1
Pod
undocumented
| |||||||||||
| 42 | 9 | my $s = shift; | |||||||||
| 43 | |||||||||||
| 44 | # all caller supplied values must be escaped, otherwise they can inject | ||||||||||
| 45 | # additional query parameters (e.g. a prefix of "a&max-keys=1") | ||||||||||
| 46 | 9 | my @params = (); | |||||||||
| 47 | 9 | push @params, 'max-keys=' . $s->max_keys; | |||||||||
| 48 | 9 | ▶ | push @params, 'marker=' . $s->_uri_escape( $s->marker ) if $s->marker; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 49 | 9 | ▶ | push @params, 'prefix=' . $s->_uri_escape( $s->prefix ) if $s->prefix; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 50 | 9 | ▶ | push @params, 'delimiter=' . $s->_uri_escape( $s->delimiter ) if $s->delimiter; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 51 | |||||||||||
| 52 | 9 | my $uri = $s->bucket_uri; | |||||||||
| 53 | |||||||||||
| 54 | 9 | ▶ | $s->_send_request( | ||||||||
|
Branch: 1 branch
| |||||||||||
| 55 | GET => URI->new( $uri . '/' . ( @params ? '?' . join( '&', @params ) : '' ) ) => { | ||||||||||
| 56 | Date => $s->_http_date, | ||||||||||
| 57 | } | ||||||||||
| 58 | ); | ||||||||||
| 59 | } # end request() | ||||||||||
| 60 | |||||||||||
| 61 | 4 | __PACKAGE__->meta->make_immutable; | |||||||||