| line | stmt | bran | cond | sub | pod | time | code | 
| 1 |  |  |  |  |  |  | # ABSTRACT: Bucket role | 
| 2 |  |  |  |  |  |  | $Net::Amazon::S3::Role::Bucket::VERSION = '0.991'; | 
| 3 |  |  |  |  |  |  | use Moose::Role; | 
| 4 | 99 |  |  | 99 |  | 52062 | use Scalar::Util; | 
|  | 99 |  |  |  |  | 222 |  | 
|  | 99 |  |  |  |  | 788 |  | 
| 5 | 99 |  |  | 99 |  | 430969 | use Safe::Isa (); | 
|  | 99 |  |  |  |  | 217 |  | 
|  | 99 |  |  |  |  | 3589 |  | 
| 6 | 99 |  |  | 99 |  | 551 |  | 
|  | 99 |  |  |  |  | 186 |  | 
|  | 99 |  |  |  |  | 20333 |  | 
| 7 |  |  |  |  |  |  | around BUILDARGS => sub { | 
| 8 |  |  |  |  |  |  | my ($orig, $class, %params) = @_; | 
| 9 |  |  |  |  |  |  |  | 
| 10 |  |  |  |  |  |  | # bucket can be optional in HTTPRequest | 
| 11 |  |  |  |  |  |  | if ($params{bucket}) { | 
| 12 |  |  |  |  |  |  | my $region = $params{region}; | 
| 13 |  |  |  |  |  |  | $region = $params{bucket}->region | 
| 14 |  |  |  |  |  |  | if $params{bucket} | 
| 15 |  |  |  |  |  |  | and Scalar::Util::blessed( $params{bucket} ) | 
| 16 |  |  |  |  |  |  | and ! $params{region} | 
| 17 |  |  |  |  |  |  | and $params{bucket}->has_region | 
| 18 |  |  |  |  |  |  | ; | 
| 19 |  |  |  |  |  |  |  | 
| 20 |  |  |  |  |  |  | $params{bucket} = $params{bucket}->name | 
| 21 |  |  |  |  |  |  | if $params{bucket}->$Safe::Isa::_isa ('Net::Amazon::S3::Client::Bucket'); | 
| 22 |  |  |  |  |  |  |  | 
| 23 |  |  |  |  |  |  | $params{bucket} = Net::Amazon::S3::Bucket->new( | 
| 24 |  |  |  |  |  |  | bucket => $params{bucket}, | 
| 25 |  |  |  |  |  |  | account => $params{s3}, | 
| 26 |  |  |  |  |  |  | (region => $region) x!! $region, | 
| 27 |  |  |  |  |  |  | ) if $params{bucket} and ! ref $params{bucket}; | 
| 28 |  |  |  |  |  |  |  | 
| 29 |  |  |  |  |  |  | delete $params{region}; | 
| 30 |  |  |  |  |  |  | } | 
| 31 |  |  |  |  |  |  |  | 
| 32 |  |  |  |  |  |  | $class->$orig( %params ); | 
| 33 |  |  |  |  |  |  | }; | 
| 34 |  |  |  |  |  |  |  | 
| 35 |  |  |  |  |  |  | has bucket => ( | 
| 36 |  |  |  |  |  |  | is => 'ro', | 
| 37 |  |  |  |  |  |  | isa => 'Net::Amazon::S3::Bucket', | 
| 38 |  |  |  |  |  |  | required => 1, | 
| 39 |  |  |  |  |  |  | ); | 
| 40 |  |  |  |  |  |  |  | 
| 41 |  |  |  |  |  |  | 1; | 
| 42 |  |  |  |  |  |  |  | 
| 43 |  |  |  |  |  |  |  | 
| 44 |  |  |  |  |  |  | =pod | 
| 45 |  |  |  |  |  |  |  | 
| 46 |  |  |  |  |  |  | =encoding UTF-8 | 
| 47 |  |  |  |  |  |  |  | 
| 48 |  |  |  |  |  |  | =head1 NAME | 
| 49 |  |  |  |  |  |  |  | 
| 50 |  |  |  |  |  |  | Net::Amazon::S3::Role::Bucket - Bucket role | 
| 51 |  |  |  |  |  |  |  | 
| 52 |  |  |  |  |  |  | =head1 VERSION | 
| 53 |  |  |  |  |  |  |  | 
| 54 |  |  |  |  |  |  | version 0.991 | 
| 55 |  |  |  |  |  |  |  | 
| 56 |  |  |  |  |  |  | =head1 AUTHOR | 
| 57 |  |  |  |  |  |  |  | 
| 58 |  |  |  |  |  |  | Branislav Zahradník <barney@cpan.org> | 
| 59 |  |  |  |  |  |  |  | 
| 60 |  |  |  |  |  |  | =head1 COPYRIGHT AND LICENSE | 
| 61 |  |  |  |  |  |  |  | 
| 62 |  |  |  |  |  |  | This software is copyright (c) 2022 by Amazon Digital Services, Leon Brocard, Brad Fitzpatrick, Pedro Figueiredo, Rusty Conover, Branislav Zahradník. | 
| 63 |  |  |  |  |  |  |  | 
| 64 |  |  |  |  |  |  | This is free software; you can redistribute it and/or modify it under | 
| 65 |  |  |  |  |  |  | the same terms as the Perl 5 programming language system itself. | 
| 66 |  |  |  |  |  |  |  | 
| 67 |  |  |  |  |  |  | =cut |