| 1 | |||||||||||||||
| 2 | package AWS::S3::Request::SetBucketAccessControl; | ||||||||||||||
| 3 | |||||||||||||||
| 4 | 3 | ▶ | use Moose; | ||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||
| 5 | |||||||||||||||
| 6 | 3 | with 'AWS::S3::Roles::Request'; | |||||||||||||
| 7 | |||||||||||||||
| 8 | 3 | has 'bucket' => ( | |||||||||||||
| 9 | is => 'ro', | ||||||||||||||
| 10 | isa => 'AWS::S3::BucketName', | ||||||||||||||
| 11 | required => 1, | ||||||||||||||
| 12 | ); | ||||||||||||||
| 13 | |||||||||||||||
| 14 | 3 | has 'acl_short' => ( | |||||||||||||
| 15 | is => 'ro', | ||||||||||||||
| 16 | isa => 'Str', | ||||||||||||||
| 17 | required => 0, | ||||||||||||||
| 18 | ); | ||||||||||||||
| 19 | |||||||||||||||
| 20 | 3 | has 'acl_xml' => ( | |||||||||||||
| 21 | is => 'ro', | ||||||||||||||
| 22 | isa => 'Str', | ||||||||||||||
| 23 | required => 0, | ||||||||||||||
| 24 | ); | ||||||||||||||
| 25 | |||||||||||||||
| 26 | 3 | has '+_expect_nothing' => ( default => 1 ); | |||||||||||||
| 27 | |||||||||||||||
| 28 | 5 | ▶ | sub request { | ||||||||||||
|
Subroutine
request: called CC=3 SCAR=11.0
Pod
undocumented
| |||||||||||||||
| 29 | 5 | my $s = shift; | |||||||||||||
| 30 | |||||||||||||||
| 31 | 5 | my $uri = URI->new( $s->protocol . '://' . $s->bucket . '.' . $s->endpoint . '/?acl' ); | |||||||||||||
| 32 | |||||||||||||||
| 33 | 5 | ▶ | if ( $s->acl_short ) { | ||||||||||||
|
Branch: 2 branches
| |||||||||||||||
| 34 | 4 | return $s->_send_request( | |||||||||||||
| 35 | PUT => $uri => { | ||||||||||||||
| 36 | Date => $s->_http_date, | ||||||||||||||
| 37 | 'x-amz-acl' => $s->acl_short | ||||||||||||||
| 38 | }, | ||||||||||||||
| 39 | $s->acl_xml | ||||||||||||||
| 40 | ); | ||||||||||||||
| 41 | } elsif ( $s->acl_xml ) { | ||||||||||||||
| 42 | 1 | return $s->_send_request( | |||||||||||||
| 43 | PUT => $uri => { | ||||||||||||||
| 44 | Date => $s->_http_date, | ||||||||||||||
| 45 | }, | ||||||||||||||
| 46 | $s->acl_xml | ||||||||||||||
| 47 | ); | ||||||||||||||
| 48 | } # end if() | ||||||||||||||
| 49 | } # end request() | ||||||||||||||
| 50 | |||||||||||||||
| 51 | 3 | __PACKAGE__->meta->make_immutable; | |||||||||||||