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

filter: Statementstmt 0.0% 0 / 47 Branchbran 0.0% 0 / 10 Conditioncond 0.0% 0 / 8 MC/DCmcdc 0.0% 0 / 4 Subroutinesub 0.0% 0 / 7 Podpod 0.0% 0 / 1 totaltotal 0.0% 0 / 77 CC 6 SCAR 30.9
CC
6
Cov
0%
sample
42.0
BEGIN
2.0
BEGIN
2.0
CRAP 22.0
1 package GetQueueAttributes;
2  
3 use strict;
4 use warnings;
5  
6 use English qw(-no_match_vars);
7 use Amazon::SQS::Model::GetQueueAttributesRequest;
8 use Data::Dumper;
9  
10 use parent qw(Amazon::SQS::Sample);
11  
12 ########################################################################
13 sub sample {
14 ########################################################################
15 my ( $self, $attributes, $queue_url ) = @_;
16  
17 $attributes //= 'All';
18  
19 $attributes = [ split /\s*,\s*/xsm, $attributes ];
20  
21 my $service = $self->get_service;
22  
23 my $config = $self->get_config;
24 $queue_url //= $config && $config->get_queue_url;
25  
26 if ( !$queue_url ) {
27 $self->help();
28 }
29  
30 my $request = Amazon::SQS::Model::GetQueueAttributesRequest->new(
31 { QueueUrl => $queue_url,
32 AttributeName => $attributes,
33 }
34 );
35  
36 my $response = $service->getQueueAttributes($request);
37  
38 if ( $response->isSetResponseMetadata() ) {
39 my $responseMetadata = $response->getResponseMetadata();
40  
41 if ( $responseMetadata->isSetRequestId() ) {
42 my $requestId = $responseMetadata->getRequestId();
43 }
44 }
45  
46 if ( $response->isSetGetQueueAttributesResult() ) {
47  
48 my $getQueueAttributesResult = $response->getGetQueueAttributesResult();
49 my $attributeList = $getQueueAttributesResult->getAttribute();
50  
51 my %attributes;
52  
53 foreach ( @{$attributeList} ) {
54 if ( $_->isSetName() ) {
55 $attributes{ $_->getName } = $_->getValue;
56 }
57 }
58  
59 print {*STDERR} Dumper( [ attributes => \%attributes ] );
60 }
61  
62 return;
63 }
64  
65 1;
66  
67 ## no critic
68  
69 __END__