lib/auto/share/dist/Amazon-SQS-Client/AddPermission.pm untested

filter: Statementstmt 0.0% 0 / 47 Branchbran 0.0% 0 / 12 Conditioncond 0.0% 0 / 6 MC/DCmcdc 0.0% 0 / 3 Subroutinesub 0.0% 0 / 7 Podpod 0.0% 0 / 1 totaltotal 0.0% 0 / 76 CC 7 SCAR 34.4
CC
7
Cov
0%
sample
56.0
BEGIN
2.0
BEGIN
2.0
CRAP 31.1
1 package AddPermission;
2  
3 use strict;
4 use warnings;
5 use English qw(-no_match_vars);
6 use Amazon::SQS::Model::AddPermissionRequest;
7 use Data::Dumper;
8  
9 use parent qw(Amazon::SQS::Sample);
10  
11 ########################################################################
12 sub sample {
13 ########################################################################
14 my ( $self, $label, $actions, $account_ids, $queue_url ) = @_;
15  
16 if ( !$actions ) {
17 warn "actions is a required argument\n";
18 $self->help();
19 }
20  
21 if ( !$account_ids ) {
22 warn "acccount-ids is a required argument\n";
23 $self->help();
24 }
25  
26 if ( !$label ) {
27 warn "label is a required argument\n";
28 $self->help();
29 }
30  
31 $actions = [ split /\s*,\s*/xsm, $actions ];
32 $account_ids = [ split /\s*,\s*/xsm, $account_ids ];
33  
34 my $service = $self->get_service;
35  
36 my $config = $self->get_config;
37 $queue_url //= $config && $config->get_queue_url;
38  
39 if ( !$queue_url ) {
40 $self->help();
41 }
42  
43 my $request = Amazon::SQS::Model::AddPermissionRequest->new(
44 { QueueUrl => $queue_url,
45 Label => $label,
46 ActionName => $actions,
47 AWSAccountId => $account_ids,
48 }
49 );
50  
51 my $response = eval { $service->addPermission($request); };
52  
53 if ( $response->isSetResponseMetadata() ) {
54 my $responseMetadata = $response->getResponseMetadata();
55 if ( $responseMetadata->isSetRequestId() ) {
56 my $requestId = $responseMetadata->getRequestId();
57  
58 }
59 }
60  
61 return;
62 }
63  
64 1;
65  
66 ## no critic
67  
68 __END__