Amazon-S3
view release on metacpan or search on metacpan
lib/Amazon/S3/BucketV2.pm view on Meta::CPAN
);
}
########################################################################
sub create_methods {
########################################################################
my (%args) = @_;
my ( $type, $method, $method_def ) = @args{qw( type method method_def)};
no strict 'refs'; ## no critic
foreach my $p ( pairs @{$method_def} ) {
my ( $sub_name, $api ) = @{$p};
my $api_method = $method;
if ( ref($api) && reftype($api) eq 'CODE' ) {
my $api_params = $api->();
( $api_method, $api ) = @{$api_params}{qw(method api)};
}
my $anon = sub {
my ( $self, %args ) = @_;
my ( $key, $body, $uri_params, $headers ) = @args{qw(key body uri_param headers)};
$uri_params //= {};
return $self->send_request(
method => $api_method,
api => $api,
headers => $headers,
$key ? ( key => $key ) : (),
$body ? ( data => $body ) : (),
%{$uri_params},
);
};
$sub_name = sprintf 'Amazon::S3::BucketV2::%s', to_camel_case($sub_name);
*{$sub_name} = $anon;
}
return;
}
1;
__END__
=pod
=head1 NAME
Amazon::S3::BucketV2 - Interface to additional Amazon S3 bucket operations
=head1 SYNOPSIS
use Amazon::S3;
my $s3 = Amazon::S3->new(
{ credentials => $credentials,
region => 'us-east-1',
}
);
my $bucket = $s3->bucketv2(
{ bucket => 'example-bucket',
}
);
my $result = $bucket->GetBucketVersioning();
$bucket->DeleteObject(
key => 'obsolete.txt',
);
$bucket->DeleteObjects(
body => {
Delete => {
Object => [
{ Key => 'one.txt' },
{ Key => 'two.txt' },
],
},
},
);
=head1 DESCRIPTION
C<Amazon::S3::BucketV2> provides access to S3 API operations that are
not exposed as dedicated methods by L<Amazon::S3::Bucket>.
These additional methods are available only on
C<Amazon::S3::BucketV2> objects. Applications that need this API
surface should construct the bucket with L<Amazon::S3/bucketv2> rather
than L<Amazon::S3/bucket>.
Its method names and request structure are intended to closely follow
the corresponding operations documented by Amazon S3, making it easier
to move from the AWS API documentation to this interface.
C<Amazon::S3::BucketV2> is a subclass of L<Amazon::S3::Bucket>.
All methods documented by L<Amazon::S3::Bucket> remain available.
Instances are normally created with L<Amazon::S3/bucketv2>.
The methods provided by this class are thin wrappers around S3 REST
operations. They construct the request path, serialize an optional
request body as XML, send the request through the associated
L<Amazon::S3> object, and return the decoded response.
This document is primarily a method reference. The AWS S3 API
documentation linked from each method remains the authoritative
reference for operation-specific headers, query parameters, request
bodies, and service behavior.
=head1 GENERATED METHOD CALLING CONVENTION
The S3 operation methods documented below are generated by
C<Amazon::S3::BucketV2> and are called using their CamelCase names.
( run in 0.972 second using v1.01-cache-2.11-cpan-3f962061493 )