Net/Amazon/S3/Operation/Objects/Delete/Request.pm

filter: Statementstmt 100% 21 / 21 Branchbran 100% 2 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 4 / 4 Podpod 0.0% 0 / 1 totaltotal 96.4% 27 / 28 SCAR 6.9
CC
2
Cov
100%
BUILD
2.0
BEGIN
1.0
BEGIN
1.0
CRAP 2.0
« Net/Amazon/S3/Operation/Object/Fetch/Request.pm ↑ Summary Net/Amazon/S3/Operation/Object/Upload/Complete/Request.pm »
1 package Net::Amazon::S3::Operation::Objects::Delete::Request;
2 # ABSTRACT: An internal class to delete multiple objects from a bucket
3 99 $Net::Amazon::S3::Operation::Objects::Delete::Request::VERSION = '0.991';
4 99 ▶use Moose 0.85;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 99 ▶use Carp qw/croak/;
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 99 extends 'Net::Amazon::S3::Request::Bucket';
8  
9 99 has 'keys' => ( is => 'ro', isa => 'ArrayRef', required => 1 );
10  
11 99 with 'Net::Amazon::S3::Request::Role::HTTP::Header::Content_md5';
12 99 with 'Net::Amazon::S3::Request::Role::HTTP::Method::POST';
13 99 with 'Net::Amazon::S3::Request::Role::Query::Action::Delete';
14 99 with 'Net::Amazon::S3::Request::Role::XML::Content';
15  
16 99 __PACKAGE__->meta->make_immutable;
17  
18 sub _request_content {
19 10 ▶ my ($self) = @_;
Subroutine _request_content: called CC=1 SCAR=0.0
20  
21 return $self->_build_xml (Delete => [
22 { Quiet => 'true' },
23 10 map +{ Object => [ { Key => $_ } ] }, @{ $self->keys }
24 ]);
25 }
26  
27 sub BUILD {
28 11 ▶ my ($self) = @_;
Subroutine BUILD: called CC=2 SCAR=6.9
Pod undocumented
29  
30 croak "The maximum number of keys is 1000"
31 11 ▶ if (scalar(@{$self->keys}) > 1000);
Branch: 1 branch
BranchTrueFalseTotal
if scalar @{$self->keys;} > 1000 1 10 11
32 }
33  
34 99 1;
35  
36 __END__
37  
38 =pod
39  
40 =encoding UTF-8
41  
42 =head1 NAME
43  
44 Net::Amazon::S3::Operation::Objects::Delete::Request - An internal class to delete multiple objects from a bucket
45  
46 =head1 VERSION
47  
48 version 0.991
49  
50 =head1 SYNOPSIS
51  
52 my $http_request = Net::Amazon::S3::Operation::Objects::Delete::Request->new (
53 s3 => $s3,
54 bucket => $bucket,
55 keys => [$key1, $key2],
56 );
57  
58 =head1 DESCRIPTION
59  
60 This module deletes multiple objects from a bucket.
61  
62 Implements operation L<< DeleteObjects|https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteObjects.html >>
63  
64 =for test_synopsis no strict 'vars'
65  
66 =head1 METHODS
67  
68 =head2 http_request
69  
70 This method returns a HTTP::Request object.
71  
72 =head1 AUTHOR
73  
74 Branislav Zahradník <barney@cpan.org>
75  
76 =head1 COPYRIGHT AND LICENSE
77  
78 This software is copyright (c) 2022 by Amazon Digital Services, Leon Brocard, Brad Fitzpatrick, Pedro Figueiredo, Rusty Conover, Branislav Zahradník.
79  
80 This is free software; you can redistribute it and/or modify it under
81 the same terms as the Perl 5 programming language system itself.
82  
83 =cut
« Net/Amazon/S3/Operation/Object/Fetch/Request.pm ↑ Summary Net/Amazon/S3/Operation/Object/Upload/Complete/Request.pm »