« lib/auto/share/dist/Amazon-SQS-Client/SendMessage.pm
↑ Summary
lib/auto/share/dist/Amazon-SQS-Client/AddPermission.pm »
| 1 | package Amazon::SQS::Credentials; | ||||||||||||||||||||||||||||||||
| 2 | |||||||||||||||||||||||||||||||||
| 3 | 3 | ▶ | use strict; | ||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||
| 4 | 3 | ▶ | use warnings; | ||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||
| 5 | |||||||||||||||||||||||||||||||||
| 6 | # faux Credentials class - just provides getters | ||||||||||||||||||||||||||||||||
| 7 | |||||||||||||||||||||||||||||||||
| 8 | 3 | __PACKAGE__->follow_best_practice(); | |||||||||||||||||||||||||||||||
| 9 | 3 | __PACKAGE__->mk_accessors(qw(aws_access_key_id aws_secret_access_key token loglevel)); | |||||||||||||||||||||||||||||||
| 10 | |||||||||||||||||||||||||||||||||
| 11 | 3 | ▶ | use parent qw(Class::Accessor::Fast); | ||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||
| 12 | |||||||||||||||||||||||||||||||||
| 13 | 3 | our $VERSION = '2.0.7'; | |||||||||||||||||||||||||||||||
| 14 | |||||||||||||||||||||||||||||||||
| 15 | ######################################################################## | ||||||||||||||||||||||||||||||||
| 16 | 0 | ▶ | sub new { | ||||||||||||||||||||||||||||||
|
Subroutine
new: not called CC=6 SCAR=37.4
| |||||||||||||||||||||||||||||||||
| 17 | ######################################################################## | ||||||||||||||||||||||||||||||||
| 18 | 0 | my ( $class, @args ) = @_; | |||||||||||||||||||||||||||||||
| 19 | |||||||||||||||||||||||||||||||||
| 20 | 0 | my $client_options; | |||||||||||||||||||||||||||||||
| 21 | |||||||||||||||||||||||||||||||||
| 22 | 0 | ▶ | if ( @args > 2 ) { | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 23 | 0 | ▶ | if ( ref $args[2] ) { | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 24 | 0 | $client_options = $args[2]; | |||||||||||||||||||||||||||||||
| 25 | } | ||||||||||||||||||||||||||||||||
| 26 | else { | ||||||||||||||||||||||||||||||||
| 27 | 0 | ▶ | $client_options = $args[3] // {}; | ||||||||||||||||||||||||||||||
|
Condition0%0/2
$args[3] // {}
MC/DC0%0/1
$args[3] // {}
$args[3]
Truth table0%0/2
A
A= $args[3]
| |||||||||||||||||||||||||||||||||
| 28 | 0 | $client_options->{SecurityToken} = $args[2]; | |||||||||||||||||||||||||||||||
| 29 | } | ||||||||||||||||||||||||||||||||
| 30 | } | ||||||||||||||||||||||||||||||||
| 31 | |||||||||||||||||||||||||||||||||
| 32 | return $class->SUPER::new( | ||||||||||||||||||||||||||||||||
| 33 | { aws_access_key_id => $args[0], | ||||||||||||||||||||||||||||||||
| 34 | aws_secret_access_key => $args[1], | ||||||||||||||||||||||||||||||||
| 35 | $client_options->{SecurityToken} ? ( token => $client_options->{SecurityToken} ) : (), | ||||||||||||||||||||||||||||||||
| 36 | 0 | ▶ | $client_options->{loglevel} ? ( loglevel => $client_options->{loglevel} ) : (), | ||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||
| 37 | } | ||||||||||||||||||||||||||||||||
| 38 | ); | ||||||||||||||||||||||||||||||||
| 39 | } | ||||||||||||||||||||||||||||||||
| 40 | |||||||||||||||||||||||||||||||||
| 41 | ################################################################################ | ||||||||||||||||||||||||||||||||
| 42 | # Copyright 2008 Amazon Technologies, Inc. | ||||||||||||||||||||||||||||||||
| 43 | # Licensed under the Apache License, Version 2.0 (the "License"); | ||||||||||||||||||||||||||||||||
| 44 | # | ||||||||||||||||||||||||||||||||
| 45 | # You may not use this file except in compliance with the License. | ||||||||||||||||||||||||||||||||
| 46 | # You may obtain a copy of the License at: http://aws.amazon.com/apache2.0 | ||||||||||||||||||||||||||||||||
| 47 | # This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR | ||||||||||||||||||||||||||||||||
| 48 | # CONDITIONS OF ANY KIND, either express or implied. See the License for the | ||||||||||||||||||||||||||||||||
| 49 | # specific language governing permissions and limitations under the License. | ||||||||||||||||||||||||||||||||
| 50 | # | ||||||||||||||||||||||||||||||||
| 51 | # Copyright 2024 Robert C. Lauer | ||||||||||||||||||||||||||||||||
| 52 | # | ||||||||||||||||||||||||||||||||
| 53 | # Note: The software contained in this distribution has been modified from the | ||||||||||||||||||||||||||||||||
| 54 | # original. You may freely use and distribute this software under the | ||||||||||||||||||||||||||||||||
| 55 | # terms of the original license. | ||||||||||||||||||||||||||||||||
| 56 | |||||||||||||||||||||||||||||||||
| 57 | package Amazon::SQS::Client; | ||||||||||||||||||||||||||||||||
| 58 | |||||||||||||||||||||||||||||||||
| 59 | 3 | ▶ | use strict; | ||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||
| 60 | 3 | ▶ | use warnings; | ||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||
| 61 | |||||||||||||||||||||||||||||||||
| 62 | 3 | ▶ | use Amazon::Credentials; | ||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||
| 63 | 3 | ▶ | use Amazon::SQS::Constants qw(:all); | ||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||
| 64 | 3 | ▶ | use Amazon::SQS::Exception; | ||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||
| 65 | 3 | ▶ | use Carp qw(croak); | ||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||
| 66 | 3 | ▶ | use Data::Dumper; | ||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||
| 67 | 3 | ▶ | use Digest::SHA qw (hmac_sha1_base64 hmac_sha256_base64); | ||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||
| 68 | 3 | ▶ | use English qw(-no_match_vars); | ||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||
| 69 | 3 | ▶ | use LWP::UserAgent; | ||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||
| 70 | 3 | ▶ | use Scalar::Util qw(reftype); | ||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||
| 71 | 3 | ▶ | use Time::HiRes qw(usleep); | ||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||
| 72 | 3 | ▶ | use URI::Escape; | ||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||
| 73 | 3 | ▶ | use URI; | ||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||
| 74 | 3 | ▶ | use XML::Simple; | ||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||
| 75 | |||||||||||||||||||||||||||||||||
| 76 | 3 | __PACKAGE__->follow_best_practice(); | |||||||||||||||||||||||||||||||
| 77 | 3 | __PACKAGE__->mk_accessors( | |||||||||||||||||||||||||||||||
| 78 | qw( | ||||||||||||||||||||||||||||||||
| 79 | ServiceURL | ||||||||||||||||||||||||||||||||
| 80 | UserAgent | ||||||||||||||||||||||||||||||||
| 81 | SignatureVersion | ||||||||||||||||||||||||||||||||
| 82 | SignatureMethod | ||||||||||||||||||||||||||||||||
| 83 | MaxErrorRetry | ||||||||||||||||||||||||||||||||
| 84 | ServiceVersion | ||||||||||||||||||||||||||||||||
| 85 | SecurityToken | ||||||||||||||||||||||||||||||||
| 86 | Region | ||||||||||||||||||||||||||||||||
| 87 | v4_signer | ||||||||||||||||||||||||||||||||
| 88 | credentials | ||||||||||||||||||||||||||||||||
| 89 | last_request | ||||||||||||||||||||||||||||||||
| 90 | last_response | ||||||||||||||||||||||||||||||||
| 91 | ) | ||||||||||||||||||||||||||||||||
| 92 | ); | ||||||||||||||||||||||||||||||||
| 93 | |||||||||||||||||||||||||||||||||
| 94 | 3 | ▶ | use parent qw(Class::Accessor::Fast); | ||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||
| 95 | |||||||||||||||||||||||||||||||||
| 96 | 3 | our $VERSION = '@PACKAGE_VERSION'; | |||||||||||||||||||||||||||||||
| 97 | |||||||||||||||||||||||||||||||||
| 98 | ######################################################################## | ||||||||||||||||||||||||||||||||
| 99 | 1 | ▶ | sub new { | ||||||||||||||||||||||||||||||
|
Subroutine
new: called CC=7 SCAR=26.7
Pod
documented
| |||||||||||||||||||||||||||||||||
| 100 | ######################################################################## | ||||||||||||||||||||||||||||||||
| 101 | 1 | my ( $class, @args ) = @_; | |||||||||||||||||||||||||||||||
| 102 | |||||||||||||||||||||||||||||||||
| 103 | 1 | my $options; | |||||||||||||||||||||||||||||||
| 104 | |||||||||||||||||||||||||||||||||
| 105 | 1 | ▶ | if ( ref $args[0] ) { | ||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||
| 106 | 0 | $options = $args[0]; | |||||||||||||||||||||||||||||||
| 107 | } | ||||||||||||||||||||||||||||||||
| 108 | ▶ | elsif ( $args[0] && $args[1] ) { | |||||||||||||||||||||||||||||||
|
Condition33%1/3
$args[0] and $args[1]
MC/DC0%0/2
$args[0] and $args[1]
$args[0]
$args[1]
Truth table33%1/3
A and B
A= $args[0]B= $args[1]
| |||||||||||||||||||||||||||||||||
| 109 | 0 | my $credentials = Amazon::SQS::Credentials->new(@args); | |||||||||||||||||||||||||||||||
| 110 | |||||||||||||||||||||||||||||||||
| 111 | 0 | $options = { credentials => $credentials }; | |||||||||||||||||||||||||||||||
| 112 | |||||||||||||||||||||||||||||||||
| 113 | 0 | ▶ | if ( ref $args[2] ) { | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 114 | 0 | $options = { %{$options}, %{ $args[2] } }; | |||||||||||||||||||||||||||||||
| 115 | } | ||||||||||||||||||||||||||||||||
| 116 | } | ||||||||||||||||||||||||||||||||
| 117 | else { | ||||||||||||||||||||||||||||||||
| 118 | 1 | ▶ | $options = ref $args[2] ? $args[2] : {}; | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 119 | 1 | ▶ | $options->{credentials} //= Amazon::Credentials->new(); | ||||||||||||||||||||||||||||||
|
Condition33%1/3
$options->{"credentials"} //= "Amazon::Credentials"->new
MC/DC0%0/2
$options->{"credentials"} //= "Amazon::Credentials"->new
$options->{"credentials"}
"Amazon::Credentials"->new
Truth table33%1/3
A //= B
A= $options->{"credentials"}B= "Amazon::Credentials"->new
| |||||||||||||||||||||||||||||||||
| 120 | } | ||||||||||||||||||||||||||||||||
| 121 | |||||||||||||||||||||||||||||||||
| 122 | 1 | set_defaults($options); | |||||||||||||||||||||||||||||||
| 123 | |||||||||||||||||||||||||||||||||
| 124 | 1 | my $self = $class->SUPER::new($options); | |||||||||||||||||||||||||||||||
| 125 | |||||||||||||||||||||||||||||||||
| 126 | 1 | $self->init_v4_signer; | |||||||||||||||||||||||||||||||
| 127 | |||||||||||||||||||||||||||||||||
| 128 | 1 | return $self; | |||||||||||||||||||||||||||||||
| 129 | } | ||||||||||||||||||||||||||||||||
| 130 | |||||||||||||||||||||||||||||||||
| 131 | ######################################################################## | ||||||||||||||||||||||||||||||||
| 132 | 1 | ▶ | sub set_defaults { | ||||||||||||||||||||||||||||||
|
Subroutine
set_defaults: called CC=9 SCAR=26.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||
| 133 | ######################################################################## | ||||||||||||||||||||||||||||||||
| 134 | 1 | my ($options) = @_; | |||||||||||||||||||||||||||||||
| 135 | |||||||||||||||||||||||||||||||||
| 136 | 1 | ▶ | $options->{SignatureVersion} //= 2; | ||||||||||||||||||||||||||||||
|
Condition50%1/2
$options->{"SignatureVersion"} //= 2
MC/DC0%0/1
$options->{"SignatureVersion"} //= 2
$options->{"SignatureVersion"}
Truth table50%1/2
A
A= $options->{"SignatureVersion"}
| |||||||||||||||||||||||||||||||||
| 137 | 1 | ▶ | $options->{SignatureMethod} //= 'HmacSHA256'; | ||||||||||||||||||||||||||||||
|
Condition50%1/2
$options->{"SignatureMethod"} //= "HmacSHA256"
MC/DC0%0/1
$options->{"SignatureMethod"} //= "HmacSHA256"
$options->{"SignatureMethod"}
Truth table50%1/2
A
A= $options->{"SignatureMethod"}
| |||||||||||||||||||||||||||||||||
| 138 | 1 | ▶ | $options->{MaxErrorRetry} //= 3; | ||||||||||||||||||||||||||||||
|
Condition50%1/2
$options->{"MaxErrorRetry"} //= 3
MC/DC0%0/1
$options->{"MaxErrorRetry"} //= 3
$options->{"MaxErrorRetry"}
Truth table50%1/2
A
A= $options->{"MaxErrorRetry"}
| |||||||||||||||||||||||||||||||||
| 139 | 1 | ▶ | $options->{ServiceVersion} //= '2012-11-05'; | ||||||||||||||||||||||||||||||
|
Condition50%1/2
$options->{"ServiceVersion"} //= "2012-11-05"
MC/DC0%0/1
$options->{"ServiceVersion"} //= "2012-11-05"
$options->{"ServiceVersion"}
Truth table50%1/2
A
A= $options->{"ServiceVersion"}
| |||||||||||||||||||||||||||||||||
| 140 | |||||||||||||||||||||||||||||||||
| 141 | 1 | ▶ | if ( $options->{Region} && !$options->{ServiceURL} ) { | ||||||||||||||||||||||||||||||
|
Branch: 2 branches
Condition33%1/3
$options->{"Region"} and not $options->{"ServiceURL"}
MC/DC0%0/2
$options->{"Region"} and not $options->{"ServiceURL"}
$options->{"Region"}
not $options->{"ServiceURL"}
Truth table33%1/3
A and not(B)
A= $options->{"Region"}B= not $options->{"ServiceURL"}
| |||||||||||||||||||||||||||||||||
| 142 | 0 | $options->{ServiceURL} = sprintf 'https://sqs.%s.amazonaws.com', $options->{Region}; | |||||||||||||||||||||||||||||||
| 143 | } | ||||||||||||||||||||||||||||||||
| 144 | elsif ( !$options->{ServiceURL} ) { | ||||||||||||||||||||||||||||||||
| 145 | 0 | $options->{ServiceURL} = 'https://queue.amazonaws.com'; | |||||||||||||||||||||||||||||||
| 146 | } | ||||||||||||||||||||||||||||||||
| 147 | |||||||||||||||||||||||||||||||||
| 148 | 1 | ▶ | if ( !$options->{UserAgent} ) { | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 149 | 1 | require LWP::UserAgent; | |||||||||||||||||||||||||||||||
| 150 | 1 | $options->{UserAgent} = LWP::UserAgent->new; | |||||||||||||||||||||||||||||||
| 151 | } | ||||||||||||||||||||||||||||||||
| 152 | |||||||||||||||||||||||||||||||||
| 153 | 1 | return $options; | |||||||||||||||||||||||||||||||
| 154 | } | ||||||||||||||||||||||||||||||||
| 155 | |||||||||||||||||||||||||||||||||
| 156 | ######################################################################## | ||||||||||||||||||||||||||||||||
| 157 | 1 | ▶ | sub init_v4_signer { | ||||||||||||||||||||||||||||||
|
Subroutine
init_v4_signer: called CC=3 SCAR=19.6
Pod
undocumented
| |||||||||||||||||||||||||||||||||
| 158 | ######################################################################## | ||||||||||||||||||||||||||||||||
| 159 | 1 | my ($self) = @_; | |||||||||||||||||||||||||||||||
| 160 | |||||||||||||||||||||||||||||||||
| 161 | return | ||||||||||||||||||||||||||||||||
| 162 | 1 | ▶ | if $self->get_SignatureVersion ne '4'; | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 163 | |||||||||||||||||||||||||||||||||
| 164 | 0 | my $credentials = $self->get_credentials; | |||||||||||||||||||||||||||||||
| 165 | |||||||||||||||||||||||||||||||||
| 166 | 0 | my $aws_access_key_id = $credentials->get_aws_access_key_id; | |||||||||||||||||||||||||||||||
| 167 | 0 | my $aws_secret_access_key = $credentials->get_aws_secret_access_key; | |||||||||||||||||||||||||||||||
| 168 | 0 | my $token = $credentials->get_token; | |||||||||||||||||||||||||||||||
| 169 | |||||||||||||||||||||||||||||||||
| 170 | 0 | require AWS::Signature4; | |||||||||||||||||||||||||||||||
| 171 | |||||||||||||||||||||||||||||||||
| 172 | 0 | ▶ | $self->set_v4_signer( | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 173 | AWS::Signature4->new( | ||||||||||||||||||||||||||||||||
| 174 | '-access_key' => $aws_access_key_id, | ||||||||||||||||||||||||||||||||
| 175 | '-secret_key' => $aws_secret_access_key, | ||||||||||||||||||||||||||||||||
| 176 | $token | ||||||||||||||||||||||||||||||||
| 177 | ? ( '-security_token' => $token ) | ||||||||||||||||||||||||||||||||
| 178 | : () | ||||||||||||||||||||||||||||||||
| 179 | |||||||||||||||||||||||||||||||||
| 180 | ) | ||||||||||||||||||||||||||||||||
| 181 | ); | ||||||||||||||||||||||||||||||||
| 182 | |||||||||||||||||||||||||||||||||
| 183 | 0 | return; | |||||||||||||||||||||||||||||||
| 184 | } | ||||||||||||||||||||||||||||||||
| 185 | |||||||||||||||||||||||||||||||||
| 186 | # setter/getters for resetting credentials | ||||||||||||||||||||||||||||||||
| 187 | ######################################################################## | ||||||||||||||||||||||||||||||||
| 188 | 0 | ▶ | sub aws_access_key_id { | ||||||||||||||||||||||||||||||
|
Subroutine
aws_access_key_id: not called CC=2 SCAR=17.9
Pod
undocumented
| |||||||||||||||||||||||||||||||||
| 189 | ######################################################################## | ||||||||||||||||||||||||||||||||
| 190 | 0 | my ( $self, @args ) = @_; | |||||||||||||||||||||||||||||||
| 191 | |||||||||||||||||||||||||||||||||
| 192 | 0 | ▶ | if (@args) { | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 193 | 0 | $self->get_credentials->set_aws_access_key_id( $args[0] ); | |||||||||||||||||||||||||||||||
| 194 | } | ||||||||||||||||||||||||||||||||
| 195 | |||||||||||||||||||||||||||||||||
| 196 | 0 | return $self->get_credentials->get_aws_access_key_id(); | |||||||||||||||||||||||||||||||
| 197 | } | ||||||||||||||||||||||||||||||||
| 198 | |||||||||||||||||||||||||||||||||
| 199 | ######################################################################## | ||||||||||||||||||||||||||||||||
| 200 | 0 | ▶ | sub aws_secret_access_key { | ||||||||||||||||||||||||||||||
|
Subroutine
aws_secret_access_key: not called CC=2 SCAR=17.9
Pod
undocumented
| |||||||||||||||||||||||||||||||||
| 201 | ######################################################################## | ||||||||||||||||||||||||||||||||
| 202 | 0 | my ( $self, @args ) = @_; | |||||||||||||||||||||||||||||||
| 203 | |||||||||||||||||||||||||||||||||
| 204 | 0 | ▶ | if (@args) { | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 205 | 0 | $self->get_credentials->set_aws_secret_access_key( $args[0] ); | |||||||||||||||||||||||||||||||
| 206 | } | ||||||||||||||||||||||||||||||||
| 207 | |||||||||||||||||||||||||||||||||
| 208 | 0 | return $self->get_credentials->get_aws_secret_access_key(); | |||||||||||||||||||||||||||||||
| 209 | } | ||||||||||||||||||||||||||||||||
| 210 | |||||||||||||||||||||||||||||||||
| 211 | ######################################################################## | ||||||||||||||||||||||||||||||||
| 212 | 0 | ▶ | sub token { | ||||||||||||||||||||||||||||||
|
Subroutine
token: not called CC=2 SCAR=17.9
Pod
documented
| |||||||||||||||||||||||||||||||||
| 213 | ######################################################################## | ||||||||||||||||||||||||||||||||
| 214 | 0 | my ( $self, @args ) = @_; | |||||||||||||||||||||||||||||||
| 215 | |||||||||||||||||||||||||||||||||
| 216 | 0 | ▶ | if (@args) { | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 217 | 0 | $self->get_credentials->set_token( $args[0] ); | |||||||||||||||||||||||||||||||
| 218 | } | ||||||||||||||||||||||||||||||||
| 219 | |||||||||||||||||||||||||||||||||
| 220 | 0 | return $self->get_credentials->get_token(); | |||||||||||||||||||||||||||||||
| 221 | } | ||||||||||||||||||||||||||||||||
| 222 | |||||||||||||||||||||||||||||||||
| 223 | ######################################################################## | ||||||||||||||||||||||||||||||||
| 224 | 0 | ▶ | sub createQueue { | ||||||||||||||||||||||||||||||
|
Subroutine
createQueue: not called CC=2 SCAR=17.9
Pod
documented
| |||||||||||||||||||||||||||||||||
| 225 | ######################################################################## | ||||||||||||||||||||||||||||||||
| 226 | 0 | my ( $self, $request ) = @_; | |||||||||||||||||||||||||||||||
| 227 | |||||||||||||||||||||||||||||||||
| 228 | 0 | ▶ | if ( ref $request ne 'Amazon::SQS::Model::CreateQueueRequest' ) { | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 229 | 0 | require Amazon::SQS::Model::CreateQueueRequest; | |||||||||||||||||||||||||||||||
| 230 | 0 | $request = Amazon::SQS::Model::CreateQueueRequest->new($request); | |||||||||||||||||||||||||||||||
| 231 | } | ||||||||||||||||||||||||||||||||
| 232 | |||||||||||||||||||||||||||||||||
| 233 | 0 | require Amazon::SQS::Model::CreateQueueResponse; | |||||||||||||||||||||||||||||||
| 234 | |||||||||||||||||||||||||||||||||
| 235 | 0 | return Amazon::SQS::Model::CreateQueueResponse->fromXML( | |||||||||||||||||||||||||||||||
| 236 | $self->_invoke( $self->_convertCreateQueue($request) ) ); | ||||||||||||||||||||||||||||||||
| 237 | } | ||||||||||||||||||||||||||||||||
| 238 | |||||||||||||||||||||||||||||||||
| 239 | ######################################################################## | ||||||||||||||||||||||||||||||||
| 240 | 0 | ▶ | sub listQueues { | ||||||||||||||||||||||||||||||
|
Subroutine
listQueues: not called CC=2 SCAR=17.9
Pod
documented
| |||||||||||||||||||||||||||||||||
| 241 | ######################################################################## | ||||||||||||||||||||||||||||||||
| 242 | 0 | my ( $self, $request ) = @_; | |||||||||||||||||||||||||||||||
| 243 | |||||||||||||||||||||||||||||||||
| 244 | 0 | ▶ | if ( not ref $request eq 'Amazon::SQS::Model::ListQueuesRequest' ) { | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 245 | 0 | require Amazon::SQS::Model::ListQueuesRequest; | |||||||||||||||||||||||||||||||
| 246 | 0 | $request = Amazon::SQS::Model::ListQueuesRequest->new($request); | |||||||||||||||||||||||||||||||
| 247 | } | ||||||||||||||||||||||||||||||||
| 248 | |||||||||||||||||||||||||||||||||
| 249 | 0 | require Amazon::SQS::Model::ListQueuesResponse; | |||||||||||||||||||||||||||||||
| 250 | |||||||||||||||||||||||||||||||||
| 251 | 0 | return Amazon::SQS::Model::ListQueuesResponse->fromXML( | |||||||||||||||||||||||||||||||
| 252 | $self->_invoke( $self->_convertListQueues($request) ) ); | ||||||||||||||||||||||||||||||||
| 253 | } | ||||||||||||||||||||||||||||||||
| 254 | |||||||||||||||||||||||||||||||||
| 255 | ######################################################################## | ||||||||||||||||||||||||||||||||
| 256 | 0 | ▶ | sub listDeadLetterSourceQueues { | ||||||||||||||||||||||||||||||
|
Subroutine
listDeadLetterSourceQueues: not called CC=2 SCAR=17.9
Pod
undocumented
| |||||||||||||||||||||||||||||||||
| 257 | ######################################################################## | ||||||||||||||||||||||||||||||||
| 258 | 0 | my ( $self, $request ) = @_; | |||||||||||||||||||||||||||||||
| 259 | |||||||||||||||||||||||||||||||||
| 260 | 0 | ▶ | if ( not ref $request eq 'Amazon::SQS::Model::ListDeadLetterSourceQueuesRequest' ) { | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 261 | 0 | require Amazon::SQS::Model::ListDeadLetterSourceQueuesRequest; | |||||||||||||||||||||||||||||||
| 262 | 0 | $request = Amazon::SQS::Model::ListDeadLetterSourceQueuesRequest->new($request); | |||||||||||||||||||||||||||||||
| 263 | } | ||||||||||||||||||||||||||||||||
| 264 | |||||||||||||||||||||||||||||||||
| 265 | 0 | require Amazon::SQS::Model::ListDeadLetterSourceQueuesResponse; | |||||||||||||||||||||||||||||||
| 266 | |||||||||||||||||||||||||||||||||
| 267 | 0 | return Amazon::SQS::Model::ListDeadLetterSourceQueuesResponse->fromXML( | |||||||||||||||||||||||||||||||
| 268 | $self->_invoke( $self->_convertListDeadLetterSourceQueues($request) ) ); | ||||||||||||||||||||||||||||||||
| 269 | } | ||||||||||||||||||||||||||||||||
| 270 | |||||||||||||||||||||||||||||||||
| 271 | ######################################################################## | ||||||||||||||||||||||||||||||||
| 272 | 0 | ▶ | sub addPermission { | ||||||||||||||||||||||||||||||
|
Subroutine
addPermission: not called CC=2 SCAR=17.9
Pod
documented
| |||||||||||||||||||||||||||||||||
| 273 | ######################################################################## | ||||||||||||||||||||||||||||||||
| 274 | 0 | my ( $self, $request ) = @_; | |||||||||||||||||||||||||||||||
| 275 | |||||||||||||||||||||||||||||||||
| 276 | 0 | ▶ | if ( not ref $request eq 'Amazon::SQS::Model::AddPermissionRequest' ) { | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 277 | 0 | require Amazon::SQS::Model::AddPermissionRequest; | |||||||||||||||||||||||||||||||
| 278 | 0 | $request = Amazon::SQS::Model::AddPermissionRequest->new($request); | |||||||||||||||||||||||||||||||
| 279 | } | ||||||||||||||||||||||||||||||||
| 280 | 0 | require Amazon::SQS::Model::AddPermissionResponse; | |||||||||||||||||||||||||||||||
| 281 | 0 | return Amazon::SQS::Model::AddPermissionResponse->fromXML( | |||||||||||||||||||||||||||||||
| 282 | $self->_invoke( $self->_convertAddPermission($request) ) ); | ||||||||||||||||||||||||||||||||
| 283 | } | ||||||||||||||||||||||||||||||||
| 284 | |||||||||||||||||||||||||||||||||
| 285 | ######################################################################## | ||||||||||||||||||||||||||||||||
| 286 | 0 | ▶ | sub changeMessageVisibility { | ||||||||||||||||||||||||||||||
|
Subroutine
changeMessageVisibility: not called CC=2 SCAR=17.9
Pod
documented
| |||||||||||||||||||||||||||||||||
| 287 | ######################################################################## | ||||||||||||||||||||||||||||||||
| 288 | 0 | my ( $self, $request ) = @_; | |||||||||||||||||||||||||||||||
| 289 | |||||||||||||||||||||||||||||||||
| 290 | 0 | ▶ | if ( not ref $request eq 'Amazon::SQS::Model::ChangeMessageVisibilityRequest' ) { | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 291 | 0 | require Amazon::SQS::Model::ChangeMessageVisibilityRequest; | |||||||||||||||||||||||||||||||
| 292 | 0 | $request = Amazon::SQS::Model::ChangeMessageVisibilityRequest->new($request); | |||||||||||||||||||||||||||||||
| 293 | } | ||||||||||||||||||||||||||||||||
| 294 | |||||||||||||||||||||||||||||||||
| 295 | 0 | require Amazon::SQS::Model::ChangeMessageVisibilityResponse; | |||||||||||||||||||||||||||||||
| 296 | |||||||||||||||||||||||||||||||||
| 297 | 0 | return Amazon::SQS::Model::ChangeMessageVisibilityResponse->fromXML( | |||||||||||||||||||||||||||||||
| 298 | $self->_invoke( $self->_convertChangeMessageVisibility($request) ) ); | ||||||||||||||||||||||||||||||||
| 299 | } | ||||||||||||||||||||||||||||||||
| 300 | |||||||||||||||||||||||||||||||||
| 301 | ######################################################################## | ||||||||||||||||||||||||||||||||
| 302 | 0 | ▶ | sub changeMessageVisibilityBatch { | ||||||||||||||||||||||||||||||
|
Subroutine
changeMessageVisibilityBatch: not called CC=2 SCAR=17.9
Pod
undocumented
| |||||||||||||||||||||||||||||||||
| 303 | ######################################################################## | ||||||||||||||||||||||||||||||||
| 304 | 0 | my ( $self, $request ) = @_; | |||||||||||||||||||||||||||||||
| 305 | |||||||||||||||||||||||||||||||||
| 306 | 0 | ▶ | if ( not ref $request eq 'Amazon::SQS::Model::ChangeMessageVisibilityBatchRequest' ) { | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 307 | 0 | require Amazon::SQS::Model::ChangeMessageVisibilityBatchRequest; | |||||||||||||||||||||||||||||||
| 308 | 0 | $request = Amazon::SQS::Model::ChangeMessageVisibilityBatchRequest->new($request); | |||||||||||||||||||||||||||||||
| 309 | } | ||||||||||||||||||||||||||||||||
| 310 | |||||||||||||||||||||||||||||||||
| 311 | 0 | require Amazon::SQS::Model::ChangeMessageVisibilityBatchResponse; | |||||||||||||||||||||||||||||||
| 312 | |||||||||||||||||||||||||||||||||
| 313 | 0 | return Amazon::SQS::Model::ChangeMessageVisibilityBatchResponse->fromXML( | |||||||||||||||||||||||||||||||
| 314 | $self->_invoke( $self->_convertChangeMessageVisibilityBatch($request) ) ); | ||||||||||||||||||||||||||||||||
| 315 | } | ||||||||||||||||||||||||||||||||
| 316 | |||||||||||||||||||||||||||||||||
| 317 | ######################################################################## | ||||||||||||||||||||||||||||||||
| 318 | 0 | ▶ | sub deleteMessage { | ||||||||||||||||||||||||||||||
|
Subroutine
deleteMessage: not called CC=2 SCAR=17.9
Pod
documented
| |||||||||||||||||||||||||||||||||
| 319 | ######################################################################## | ||||||||||||||||||||||||||||||||
| 320 | 0 | my ( $self, $request ) = @_; | |||||||||||||||||||||||||||||||
| 321 | |||||||||||||||||||||||||||||||||
| 322 | 0 | ▶ | if ( not ref $request eq 'Amazon::SQS::Model::DeleteMessageRequest' ) { | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 323 | 0 | require Amazon::SQS::Model::DeleteMessageRequest; | |||||||||||||||||||||||||||||||
| 324 | 0 | $request = Amazon::SQS::Model::DeleteMessageRequest->new($request); | |||||||||||||||||||||||||||||||
| 325 | } | ||||||||||||||||||||||||||||||||
| 326 | |||||||||||||||||||||||||||||||||
| 327 | 0 | require Amazon::SQS::Model::DeleteMessageResponse; | |||||||||||||||||||||||||||||||
| 328 | |||||||||||||||||||||||||||||||||
| 329 | 0 | return Amazon::SQS::Model::DeleteMessageResponse->fromXML( | |||||||||||||||||||||||||||||||
| 330 | $self->_invoke( $self->_convertDeleteMessage($request) ) ); | ||||||||||||||||||||||||||||||||
| 331 | } | ||||||||||||||||||||||||||||||||
| 332 | |||||||||||||||||||||||||||||||||
| 333 | ######################################################################## | ||||||||||||||||||||||||||||||||
| 334 | 0 | ▶ | sub deleteMessageBatch { | ||||||||||||||||||||||||||||||
|
Subroutine
deleteMessageBatch: not called CC=2 SCAR=17.9
Pod
undocumented
| |||||||||||||||||||||||||||||||||
| 335 | ######################################################################## | ||||||||||||||||||||||||||||||||
| 336 | 0 | my ( $self, $request ) = @_; | |||||||||||||||||||||||||||||||
| 337 | |||||||||||||||||||||||||||||||||
| 338 | 0 | ▶ | if ( not ref $request eq 'Amazon::SQS::Model::DeleteMessageBatchRequest' ) { | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 339 | 0 | require Amazon::SQS::Model::DeleteMessageBatchRequest; | |||||||||||||||||||||||||||||||
| 340 | 0 | $request = Amazon::SQS::Model::DeleteMessageBatchRequest->new($request); | |||||||||||||||||||||||||||||||
| 341 | } | ||||||||||||||||||||||||||||||||
| 342 | |||||||||||||||||||||||||||||||||
| 343 | 0 | require Amazon::SQS::Model::DeleteMessageBatchResponse; | |||||||||||||||||||||||||||||||
| 344 | |||||||||||||||||||||||||||||||||
| 345 | 0 | return Amazon::SQS::Model::DeleteMessageBatchResponse->fromXML( | |||||||||||||||||||||||||||||||
| 346 | $self->_invoke( $self->_convertDeleteMessageBatch($request) ) ); | ||||||||||||||||||||||||||||||||
| 347 | } | ||||||||||||||||||||||||||||||||
| 348 | |||||||||||||||||||||||||||||||||
| 349 | ######################################################################## | ||||||||||||||||||||||||||||||||
| 350 | 0 | ▶ | sub deleteQueue { | ||||||||||||||||||||||||||||||
|
Subroutine
deleteQueue: not called CC=2 SCAR=17.9
Pod
documented
| |||||||||||||||||||||||||||||||||
| 351 | ######################################################################## | ||||||||||||||||||||||||||||||||
| 352 | 0 | my ( $self, $request ) = @_; | |||||||||||||||||||||||||||||||
| 353 | |||||||||||||||||||||||||||||||||
| 354 | 0 | ▶ | if ( not ref $request eq 'Amazon::SQS::Model::DeleteQueueRequest' ) { | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 355 | 0 | require Amazon::SQS::Model::DeleteQueueRequest; | |||||||||||||||||||||||||||||||
| 356 | 0 | $request = Amazon::SQS::Model::DeleteQueueRequest->new($request); | |||||||||||||||||||||||||||||||
| 357 | } | ||||||||||||||||||||||||||||||||
| 358 | |||||||||||||||||||||||||||||||||
| 359 | 0 | require Amazon::SQS::Model::DeleteQueueResponse; | |||||||||||||||||||||||||||||||
| 360 | |||||||||||||||||||||||||||||||||
| 361 | 0 | return Amazon::SQS::Model::DeleteQueueResponse->fromXML( | |||||||||||||||||||||||||||||||
| 362 | $self->_invoke( $self->_convertDeleteQueue($request) ) ); | ||||||||||||||||||||||||||||||||
| 363 | } | ||||||||||||||||||||||||||||||||
| 364 | |||||||||||||||||||||||||||||||||
| 365 | ######################################################################## | ||||||||||||||||||||||||||||||||
| 366 | 0 | ▶ | sub getQueueAttributes { | ||||||||||||||||||||||||||||||
|
Subroutine
getQueueAttributes: not called CC=2 SCAR=17.9
Pod
documented
| |||||||||||||||||||||||||||||||||
| 367 | ######################################################################## | ||||||||||||||||||||||||||||||||
| 368 | 0 | my ( $self, $request ) = @_; | |||||||||||||||||||||||||||||||
| 369 | |||||||||||||||||||||||||||||||||
| 370 | 0 | ▶ | if ( not ref $request eq 'Amazon::SQS::Model::GetQueueAttributesRequest' ) { | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 371 | 0 | require Amazon::SQS::Model::GetQueueAttributesRequest; | |||||||||||||||||||||||||||||||
| 372 | |||||||||||||||||||||||||||||||||
| 373 | 0 | $request = Amazon::SQS::Model::GetQueueAttributesRequest->new($request); | |||||||||||||||||||||||||||||||
| 374 | } | ||||||||||||||||||||||||||||||||
| 375 | |||||||||||||||||||||||||||||||||
| 376 | 0 | require Amazon::SQS::Model::GetQueueAttributesResponse; | |||||||||||||||||||||||||||||||
| 377 | |||||||||||||||||||||||||||||||||
| 378 | 0 | return Amazon::SQS::Model::GetQueueAttributesResponse->fromXML( | |||||||||||||||||||||||||||||||
| 379 | $self->_invoke( $self->_convertGetQueueAttributes($request) ) ); | ||||||||||||||||||||||||||||||||
| 380 | } | ||||||||||||||||||||||||||||||||
| 381 | |||||||||||||||||||||||||||||||||
| 382 | ######################################################################## | ||||||||||||||||||||||||||||||||
| 383 | 0 | ▶ | sub removePermission { | ||||||||||||||||||||||||||||||
|
Subroutine
removePermission: not called CC=2 SCAR=17.9
Pod
undocumented
| |||||||||||||||||||||||||||||||||
| 384 | ######################################################################## | ||||||||||||||||||||||||||||||||
| 385 | 0 | my ( $self, $request ) = @_; | |||||||||||||||||||||||||||||||
| 386 | |||||||||||||||||||||||||||||||||
| 387 | 0 | ▶ | if ( not ref $request eq 'Amazon::SQS::Model::RemovePermissionRequest' ) { | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 388 | 0 | require Amazon::SQS::Model::RemovePermissionRequest; | |||||||||||||||||||||||||||||||
| 389 | 0 | $request = Amazon::SQS::Model::RemovePermissionRequest->new($request); | |||||||||||||||||||||||||||||||
| 390 | } | ||||||||||||||||||||||||||||||||
| 391 | |||||||||||||||||||||||||||||||||
| 392 | 0 | require Amazon::SQS::Model::RemovePermissionResponse; | |||||||||||||||||||||||||||||||
| 393 | |||||||||||||||||||||||||||||||||
| 394 | 0 | return Amazon::SQS::Model::RemovePermissionResponse->fromXML( | |||||||||||||||||||||||||||||||
| 395 | $self->_invoke( $self->_convertRemovePermission($request) ) ); | ||||||||||||||||||||||||||||||||
| 396 | } | ||||||||||||||||||||||||||||||||
| 397 | |||||||||||||||||||||||||||||||||
| 398 | ######################################################################## | ||||||||||||||||||||||||||||||||
| 399 | 0 | ▶ | sub receiveMessage { | ||||||||||||||||||||||||||||||
|
Subroutine
receiveMessage: not called CC=2 SCAR=17.9
Pod
documented
| |||||||||||||||||||||||||||||||||
| 400 | ######################################################################## | ||||||||||||||||||||||||||||||||
| 401 | 0 | my ( $self, $request ) = @_; | |||||||||||||||||||||||||||||||
| 402 | |||||||||||||||||||||||||||||||||
| 403 | 0 | ▶ | if ( not ref $request eq 'Amazon::SQS::Model::ReceiveMessageRequest' ) { | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 404 | 0 | require Amazon::SQS::Model::ReceiveMessageRequest; | |||||||||||||||||||||||||||||||
| 405 | 0 | $request = Amazon::SQS::Model::ReceiveMessageRequest->new($request); | |||||||||||||||||||||||||||||||
| 406 | } | ||||||||||||||||||||||||||||||||
| 407 | |||||||||||||||||||||||||||||||||
| 408 | 0 | require Amazon::SQS::Model::ReceiveMessageResponse; | |||||||||||||||||||||||||||||||
| 409 | |||||||||||||||||||||||||||||||||
| 410 | 0 | return Amazon::SQS::Model::ReceiveMessageResponse->fromXML( | |||||||||||||||||||||||||||||||
| 411 | $self->_invoke( $self->_convertReceiveMessage($request) ) ); | ||||||||||||||||||||||||||||||||
| 412 | } | ||||||||||||||||||||||||||||||||
| 413 | |||||||||||||||||||||||||||||||||
| 414 | ######################################################################## | ||||||||||||||||||||||||||||||||
| 415 | 0 | ▶ | sub sendMessage { | ||||||||||||||||||||||||||||||
|
Subroutine
sendMessage: not called CC=2 SCAR=17.9
Pod
documented
| |||||||||||||||||||||||||||||||||
| 416 | ######################################################################## | ||||||||||||||||||||||||||||||||
| 417 | 0 | my ( $self, $request ) = @_; | |||||||||||||||||||||||||||||||
| 418 | |||||||||||||||||||||||||||||||||
| 419 | 0 | ▶ | if ( not ref $request eq 'Amazon::SQS::Model::SendMessageRequest' ) { | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 420 | 0 | require Amazon::SQS::Model::SendMessageRequest; | |||||||||||||||||||||||||||||||
| 421 | 0 | $request = Amazon::SQS::Model::SendMessageRequest->new($request); | |||||||||||||||||||||||||||||||
| 422 | } | ||||||||||||||||||||||||||||||||
| 423 | |||||||||||||||||||||||||||||||||
| 424 | 0 | require Amazon::SQS::Model::SendMessageResponse; | |||||||||||||||||||||||||||||||
| 425 | |||||||||||||||||||||||||||||||||
| 426 | 0 | return Amazon::SQS::Model::SendMessageResponse->fromXML( | |||||||||||||||||||||||||||||||
| 427 | $self->_invoke( $self->_convertSendMessage($request) ) ); | ||||||||||||||||||||||||||||||||
| 428 | } | ||||||||||||||||||||||||||||||||
| 429 | |||||||||||||||||||||||||||||||||
| 430 | ######################################################################## | ||||||||||||||||||||||||||||||||
| 431 | 0 | ▶ | sub setQueueAttributes { | ||||||||||||||||||||||||||||||
|
Subroutine
setQueueAttributes: not called CC=2 SCAR=17.9
Pod
documented
| |||||||||||||||||||||||||||||||||
| 432 | ######################################################################## | ||||||||||||||||||||||||||||||||
| 433 | 0 | my ( $self, $request ) = @_; | |||||||||||||||||||||||||||||||
| 434 | |||||||||||||||||||||||||||||||||
| 435 | 0 | ▶ | if ( not ref $request eq 'Amazon::SQS::Model::SetQueueAttributesRequest' ) { | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 436 | 0 | require Amazon::SQS::Model::SetQueueAttributesRequest; | |||||||||||||||||||||||||||||||
| 437 | 0 | $request = Amazon::SQS::Model::SetQueueAttributesRequest->new($request); | |||||||||||||||||||||||||||||||
| 438 | } | ||||||||||||||||||||||||||||||||
| 439 | |||||||||||||||||||||||||||||||||
| 440 | 0 | require Amazon::SQS::Model::SetQueueAttributesResponse; | |||||||||||||||||||||||||||||||
| 441 | 0 | return Amazon::SQS::Model::SetQueueAttributesResponse->fromXML( | |||||||||||||||||||||||||||||||
| 442 | $self->_invoke( $self->_convertSetQueueAttributes($request) ) ); | ||||||||||||||||||||||||||||||||
| 443 | } | ||||||||||||||||||||||||||||||||
| 444 | |||||||||||||||||||||||||||||||||
| 445 | # | ||||||||||||||||||||||||||||||||
| 446 | # Invoke request and return response | ||||||||||||||||||||||||||||||||
| 447 | # | ||||||||||||||||||||||||||||||||
| 448 | ######################################################################## | ||||||||||||||||||||||||||||||||
| 449 | 0 | ▶ | sub _invoke { | ||||||||||||||||||||||||||||||
|
Subroutine
_invoke: not called CC=12 SCAR=50.5
| |||||||||||||||||||||||||||||||||
| 450 | ######################################################################## | ||||||||||||||||||||||||||||||||
| 451 | 0 | my ( $self, $parameters ) = @_; | |||||||||||||||||||||||||||||||
| 452 | |||||||||||||||||||||||||||||||||
| 453 | 0 | my $actionName = $parameters->{Action}; | |||||||||||||||||||||||||||||||
| 454 | |||||||||||||||||||||||||||||||||
| 455 | 0 | my $statusCode = $HTTP_OK; | |||||||||||||||||||||||||||||||
| 456 | |||||||||||||||||||||||||||||||||
| 457 | 0 | ▶ | my $queueUrl = defined $parameters->{QueueUrl} ? $parameters->{QueueUrl} : $self->get_ServiceURL; | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 458 | |||||||||||||||||||||||||||||||||
| 459 | 0 | ▶ | if ( defined $parameters->{QueueUrl} ) { | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 460 | 0 | delete $parameters->{QueueUrl}; | |||||||||||||||||||||||||||||||
| 461 | } | ||||||||||||||||||||||||||||||||
| 462 | |||||||||||||||||||||||||||||||||
| 463 | # Add required request parameters # | ||||||||||||||||||||||||||||||||
| 464 | 0 | $parameters = $self->_addRequiredParameters( $parameters, $queueUrl ); | |||||||||||||||||||||||||||||||
| 465 | 0 | my $retries = 0; | |||||||||||||||||||||||||||||||
| 466 | 0 | my $shouldRetry = $TRUE; | |||||||||||||||||||||||||||||||
| 467 | |||||||||||||||||||||||||||||||||
| 468 | 0 | my $response; | |||||||||||||||||||||||||||||||
| 469 | |||||||||||||||||||||||||||||||||
| 470 | 0 | eval { | |||||||||||||||||||||||||||||||
| 471 | 0 | ▶ | do { | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 472 | # Submit the request and read response body # | ||||||||||||||||||||||||||||||||
| 473 | 0 | eval { | |||||||||||||||||||||||||||||||
| 474 | 0 | $response = $self->_httpPost( $queueUrl, $parameters ); | |||||||||||||||||||||||||||||||
| 475 | |||||||||||||||||||||||||||||||||
| 476 | 0 | ▶ | if ( $response->is_success ) { | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 477 | 0 | $shouldRetry = $FALSE; | |||||||||||||||||||||||||||||||
| 478 | } | ||||||||||||||||||||||||||||||||
| 479 | else { | ||||||||||||||||||||||||||||||||
| 480 | 0 | ▶ | if ( $response->code == $HTTP_INTERNAL_SERVER_ERROR || $response->code == $HTTP_GATEWAY_TIMEOUT ) { | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
$response->code == $Amazon::SQS::Client::HTTP_INTERNAL_SERVER_ERROR or $response->code == $Amazon::SQS::Client::HTTP_GATEWAY_TIMEOUT
MC/DC0%0/2
$response->code == $Amazon::SQS::Client::HTTP_INTERNAL_SERVER_ERROR or $response->code == $Amazon::SQS::Client::HTTP_GATEWAY_TIMEOUT
$response->code == $Amazon::SQS::Client::HTTP_INTERNAL_SERVER_ERROR
$response->code == $Amazon::SQS::Client::HTTP_GATEWAY_TIMEOUT
Truth table0%0/3
A or B
A= $response->code == $Amazon::SQS::Client::HTTP_INTERNAL_SERVER_ERRORB= $response->code == $Amazon::SQS::Client::HTTP_GATEWAY_TIMEOUT
| |||||||||||||||||||||||||||||||||
| 481 | 0 | $shouldRetry = $TRUE; | |||||||||||||||||||||||||||||||
| 482 | 0 | $self->_pauseOnRetry( ++$retries, $response->code, $response->content ); | |||||||||||||||||||||||||||||||
| 483 | } | ||||||||||||||||||||||||||||||||
| 484 | else { | ||||||||||||||||||||||||||||||||
| 485 | 0 | my $ex = $self->_reportAnyErrors( $response->content, $response->code ); | |||||||||||||||||||||||||||||||
| 486 | |||||||||||||||||||||||||||||||||
| 487 | 0 | ▶ | if ($ex) { | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 488 | 0 | Carp::croak($ex); | |||||||||||||||||||||||||||||||
| 489 | } | ||||||||||||||||||||||||||||||||
| 490 | } | ||||||||||||||||||||||||||||||||
| 491 | } | ||||||||||||||||||||||||||||||||
| 492 | }; | ||||||||||||||||||||||||||||||||
| 493 | |||||||||||||||||||||||||||||||||
| 494 | 0 | my $e = $EVAL_ERROR; | |||||||||||||||||||||||||||||||
| 495 | |||||||||||||||||||||||||||||||||
| 496 | 0 | ▶ | if ($e) { | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 497 | 0 | ▶ | if ( ref $e eq 'Amazon::SQS::Exception' ) { | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 498 | 0 | Carp::croak $e; | |||||||||||||||||||||||||||||||
| 499 | } | ||||||||||||||||||||||||||||||||
| 500 | else { | ||||||||||||||||||||||||||||||||
| 501 | 0 | Carp::croak( Amazon::SQS::Exception->new( { Message => $e } ) ); | |||||||||||||||||||||||||||||||
| 502 | } | ||||||||||||||||||||||||||||||||
| 503 | } | ||||||||||||||||||||||||||||||||
| 504 | } while ($shouldRetry); ## no critic | ||||||||||||||||||||||||||||||||
| 505 | }; | ||||||||||||||||||||||||||||||||
| 506 | |||||||||||||||||||||||||||||||||
| 507 | 0 | my $e = $EVAL_ERROR; | |||||||||||||||||||||||||||||||
| 508 | |||||||||||||||||||||||||||||||||
| 509 | 0 | ▶ | if ($e) { | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 510 | 0 | ▶ | if ( ref $e eq 'Amazon::SQS::Exception' ) { | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 511 | 0 | Carp::croak $e; | |||||||||||||||||||||||||||||||
| 512 | } | ||||||||||||||||||||||||||||||||
| 513 | else { | ||||||||||||||||||||||||||||||||
| 514 | 0 | Carp::croak( Amazon::SQS::Exception->new( { Message => $e } ) ); | |||||||||||||||||||||||||||||||
| 515 | } | ||||||||||||||||||||||||||||||||
| 516 | } | ||||||||||||||||||||||||||||||||
| 517 | |||||||||||||||||||||||||||||||||
| 518 | 0 | return $response->content; | |||||||||||||||||||||||||||||||
| 519 | } | ||||||||||||||||||||||||||||||||
| 520 | |||||||||||||||||||||||||||||||||
| 521 | # | ||||||||||||||||||||||||||||||||
| 522 | # Exponential sleep on failed request | ||||||||||||||||||||||||||||||||
| 523 | # Retries - current retry | ||||||||||||||||||||||||||||||||
| 524 | # throws Amazon::SQS::Exception if maximum number of retries has been reached | ||||||||||||||||||||||||||||||||
| 525 | # | ||||||||||||||||||||||||||||||||
| 526 | ######################################################################## | ||||||||||||||||||||||||||||||||
| 527 | 0 | ▶ | sub _pauseOnRetry { | ||||||||||||||||||||||||||||||
|
Subroutine
_pauseOnRetry: not called CC=2 SCAR=17.9
| |||||||||||||||||||||||||||||||||
| 528 | ######################################################################## | ||||||||||||||||||||||||||||||||
| 529 | 0 | my ( $self, $retries, $status, $error ) = @_; | |||||||||||||||||||||||||||||||
| 530 | |||||||||||||||||||||||||||||||||
| 531 | 0 | ▶ | if ( $retries <= $self->get_MaxErrorRetry ) { | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 532 | 0 | my $delay = ( 4**$retries ) * 100_000; | |||||||||||||||||||||||||||||||
| 533 | 0 | usleep($delay); | |||||||||||||||||||||||||||||||
| 534 | } | ||||||||||||||||||||||||||||||||
| 535 | else { | ||||||||||||||||||||||||||||||||
| 536 | |||||||||||||||||||||||||||||||||
| 537 | 0 | die Amazon::SQS::Exception->new( | |||||||||||||||||||||||||||||||
| 538 | { Message => 'Maximum number of retry attempts reached : ' . ( $retries - 1 ), | ||||||||||||||||||||||||||||||||
| 539 | StatusCode => $status, | ||||||||||||||||||||||||||||||||
| 540 | HTTPError => $error, | ||||||||||||||||||||||||||||||||
| 541 | ErrorCode => $status, | ||||||||||||||||||||||||||||||||
| 542 | } | ||||||||||||||||||||||||||||||||
| 543 | ); | ||||||||||||||||||||||||||||||||
| 544 | } | ||||||||||||||||||||||||||||||||
| 545 | |||||||||||||||||||||||||||||||||
| 546 | 0 | return; | |||||||||||||||||||||||||||||||
| 547 | } | ||||||||||||||||||||||||||||||||
| 548 | |||||||||||||||||||||||||||||||||
| 549 | # | ||||||||||||||||||||||||||||||||
| 550 | # Look for additional error strings in the response and return formatted exception | ||||||||||||||||||||||||||||||||
| 551 | # | ||||||||||||||||||||||||||||||||
| 552 | ######################################################################## | ||||||||||||||||||||||||||||||||
| 553 | 0 | ▶ | sub _reportAnyErrors { | ||||||||||||||||||||||||||||||
|
Subroutine
_reportAnyErrors: not called CC=6 SCAR=37.4
| |||||||||||||||||||||||||||||||||
| 554 | ######################################################################## | ||||||||||||||||||||||||||||||||
| 555 | 0 | my ( $self, $responseBody, $status, $e ) = @_; | |||||||||||||||||||||||||||||||
| 556 | |||||||||||||||||||||||||||||||||
| 557 | 0 | my $ex = eval { | |||||||||||||||||||||||||||||||
| 558 | 0 | my $error = XML::Simple::XMLin($responseBody); | |||||||||||||||||||||||||||||||
| 559 | |||||||||||||||||||||||||||||||||
| 560 | return $responseBody | ||||||||||||||||||||||||||||||||
| 561 | 0 | ▶ | if !ref $error || !$error->{Error}; | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
ref $error and $error->{"Error"}
MC/DC0%0/2
ref $error and $error->{"Error"}
ref $error
$error->{"Error"}
Truth table0%0/3
A and B
A= ref $errorB= $error->{"Error"}
| |||||||||||||||||||||||||||||||||
| 562 | |||||||||||||||||||||||||||||||||
| 563 | #<ErrorResponse xmlns="http://queue.amazonaws.com/doc/2012-11-05/"> | ||||||||||||||||||||||||||||||||
| 564 | # <Error> | ||||||||||||||||||||||||||||||||
| 565 | # <Code>AWS.SimpleQueueService.NonExistentQueue</Code> | ||||||||||||||||||||||||||||||||
| 566 | # <Message>The specified queue does not exist for this wsdl version.</Message> | ||||||||||||||||||||||||||||||||
| 567 | # <Type>Sender</Type> | ||||||||||||||||||||||||||||||||
| 568 | # </Error> | ||||||||||||||||||||||||||||||||
| 569 | # <RequestId>1bae4a91-7804-45a5-94b0-c884ddc2f140</RequestId> | ||||||||||||||||||||||||||||||||
| 570 | #</ErrorResponse> | ||||||||||||||||||||||||||||||||
| 571 | |||||||||||||||||||||||||||||||||
| 572 | 0 | ▶ | if ( $error->{Error} ) { | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 573 | |||||||||||||||||||||||||||||||||
| 574 | 0 | my $requestId = $error->{RequestId}; | |||||||||||||||||||||||||||||||
| 575 | 0 | my $code = $error->{Error}->{Code}; | |||||||||||||||||||||||||||||||
| 576 | 0 | my $message = $error->{Error}->{Message}; | |||||||||||||||||||||||||||||||
| 577 | |||||||||||||||||||||||||||||||||
| 578 | return Amazon::SQS::Exception->new( | ||||||||||||||||||||||||||||||||
| 579 | { Message => $message, | ||||||||||||||||||||||||||||||||
| 580 | StatusCode => $status, | ||||||||||||||||||||||||||||||||
| 581 | ErrorCode => $code, | ||||||||||||||||||||||||||||||||
| 582 | 0 | ▶ | ErrorType => $error->{Error}->{Type} // 'Unknown', | ||||||||||||||||||||||||||||||
|
Condition0%0/2
$error->{"Error"}{"Type"} // "Unknown"
MC/DC0%0/1
$error->{"Error"}{"Type"} // "Unknown"
$error->{"Error"}{"Type"}
Truth table0%0/2
A
A= $error->{"Error"}{"Type"}
| |||||||||||||||||||||||||||||||||
| 583 | RequestId => $requestId, | ||||||||||||||||||||||||||||||||
| 584 | XML => $responseBody | ||||||||||||||||||||||||||||||||
| 585 | } | ||||||||||||||||||||||||||||||||
| 586 | ); | ||||||||||||||||||||||||||||||||
| 587 | } | ||||||||||||||||||||||||||||||||
| 588 | }; | ||||||||||||||||||||||||||||||||
| 589 | |||||||||||||||||||||||||||||||||
| 590 | 0 | ▶ | return $ex | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 591 | if ref $ex; | ||||||||||||||||||||||||||||||||
| 592 | |||||||||||||||||||||||||||||||||
| 593 | 0 | return Amazon::SQS::Exception->new( | |||||||||||||||||||||||||||||||
| 594 | { Message => 'Internal Error', | ||||||||||||||||||||||||||||||||
| 595 | StatusCode => $status, | ||||||||||||||||||||||||||||||||
| 596 | ResponseBody => $responseBody, | ||||||||||||||||||||||||||||||||
| 597 | } | ||||||||||||||||||||||||||||||||
| 598 | ); | ||||||||||||||||||||||||||||||||
| 599 | } | ||||||||||||||||||||||||||||||||
| 600 | |||||||||||||||||||||||||||||||||
| 601 | # | ||||||||||||||||||||||||||||||||
| 602 | # perform http post | ||||||||||||||||||||||||||||||||
| 603 | # | ||||||||||||||||||||||||||||||||
| 604 | ######################################################################## | ||||||||||||||||||||||||||||||||
| 605 | 0 | ▶ | sub _httpPost { | ||||||||||||||||||||||||||||||
|
Subroutine
_httpPost: not called CC=3 SCAR=21.9
| |||||||||||||||||||||||||||||||||
| 606 | ######################################################################## | ||||||||||||||||||||||||||||||||
| 607 | 0 | my ( $self, $queueUrl, $parameters ) = @_; | |||||||||||||||||||||||||||||||
| 608 | |||||||||||||||||||||||||||||||||
| 609 | 0 | my $url = $queueUrl; | |||||||||||||||||||||||||||||||
| 610 | |||||||||||||||||||||||||||||||||
| 611 | 0 | my $ua = $self->get_UserAgent; | |||||||||||||||||||||||||||||||
| 612 | |||||||||||||||||||||||||||||||||
| 613 | 0 | my $request = HTTP::Request->new( POST => $url ); | |||||||||||||||||||||||||||||||
| 614 | 0 | $request->content_type('application/x-www-form-urlencoded; charset=utf-8'); | |||||||||||||||||||||||||||||||
| 615 | |||||||||||||||||||||||||||||||||
| 616 | 0 | my $data = $EMPTY; | |||||||||||||||||||||||||||||||
| 617 | |||||||||||||||||||||||||||||||||
| 618 | 0 | foreach my $parameterName ( keys %{$parameters} ) { | |||||||||||||||||||||||||||||||
| 619 | 3 | ▶ | no warnings 'uninitialized'; ## no critic | ||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||
| 620 | |||||||||||||||||||||||||||||||||
| 621 | 0 | $data .= $parameterName . $EQUALS . $self->_urlencode( $parameters->{$parameterName}, 0 ); | |||||||||||||||||||||||||||||||
| 622 | 0 | $data .= $AMPERSAND; | |||||||||||||||||||||||||||||||
| 623 | } | ||||||||||||||||||||||||||||||||
| 624 | |||||||||||||||||||||||||||||||||
| 625 | 0 | chop $data; | |||||||||||||||||||||||||||||||
| 626 | |||||||||||||||||||||||||||||||||
| 627 | 0 | $request->content($data); | |||||||||||||||||||||||||||||||
| 628 | |||||||||||||||||||||||||||||||||
| 629 | # sign request here if v4 else, it is done in _addRequiredParameters() | ||||||||||||||||||||||||||||||||
| 630 | 0 | ▶ | if ( defined $self->get_v4_signer ) { | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 631 | 0 | $self->get_v4_signer->sign($request); | |||||||||||||||||||||||||||||||
| 632 | } | ||||||||||||||||||||||||||||||||
| 633 | |||||||||||||||||||||||||||||||||
| 634 | 0 | $self->set_last_request($request); | |||||||||||||||||||||||||||||||
| 635 | |||||||||||||||||||||||||||||||||
| 636 | 0 | my $response = $ua->request($request); | |||||||||||||||||||||||||||||||
| 637 | |||||||||||||||||||||||||||||||||
| 638 | 0 | $self->set_last_response($response); | |||||||||||||||||||||||||||||||
| 639 | |||||||||||||||||||||||||||||||||
| 640 | 0 | return $response; | |||||||||||||||||||||||||||||||
| 641 | } | ||||||||||||||||||||||||||||||||
| 642 | |||||||||||||||||||||||||||||||||
| 643 | # | ||||||||||||||||||||||||||||||||
| 644 | # Add authentication related and version parameters | ||||||||||||||||||||||||||||||||
| 645 | # | ||||||||||||||||||||||||||||||||
| 646 | 0 | ▶ | sub _addRequiredParameters { | ||||||||||||||||||||||||||||||
|
Subroutine
_addRequiredParameters: not called CC=4 SCAR=30.0
| |||||||||||||||||||||||||||||||||
| 647 | 0 | my ( $self, $parameters, $queueUrl ) = @_; | |||||||||||||||||||||||||||||||
| 648 | |||||||||||||||||||||||||||||||||
| 649 | 0 | my $credentials = $self->get_credentials; | |||||||||||||||||||||||||||||||
| 650 | 0 | my $token = $credentials->get_token; | |||||||||||||||||||||||||||||||
| 651 | 0 | my $aws_access_key_id = $credentials->get_aws_access_key_id; | |||||||||||||||||||||||||||||||
| 652 | 0 | my $aws_secret_access_key = $credentials->get_aws_secret_access_key; | |||||||||||||||||||||||||||||||
| 653 | |||||||||||||||||||||||||||||||||
| 654 | 0 | $parameters->{AWSAccessKeyId} = $aws_access_key_id; | |||||||||||||||||||||||||||||||
| 655 | 0 | $parameters->{Timestamp} = $self->_getFormattedTimestamp(); | |||||||||||||||||||||||||||||||
| 656 | 0 | $parameters->{Version} = $self->get_ServiceVersion; | |||||||||||||||||||||||||||||||
| 657 | |||||||||||||||||||||||||||||||||
| 658 | # v2 signing | ||||||||||||||||||||||||||||||||
| 659 | 0 | ▶ | if ( !defined $self->{_v4_signer} ) { | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 660 | 0 | ▶ | if ($token) { | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 661 | 0 | $parameters->{SecurityToken} = $token; | |||||||||||||||||||||||||||||||
| 662 | } | ||||||||||||||||||||||||||||||||
| 663 | |||||||||||||||||||||||||||||||||
| 664 | 0 | ▶ | $parameters->{SignatureVersion} = $self->get_SignatureVersion || '1'; | ||||||||||||||||||||||||||||||
|
Condition0%0/2
$self->get_SignatureVersion || '1'
MC/DC0%0/1
$self->get_SignatureVersion || '1'
$self->get_SignatureVersion
Truth table0%0/2
A
A= $self->get_SignatureVersion
| |||||||||||||||||||||||||||||||||
| 665 | 0 | $parameters->{Signature} = $self->_signParameters( $parameters, $queueUrl, $aws_secret_access_key ); | |||||||||||||||||||||||||||||||
| 666 | } | ||||||||||||||||||||||||||||||||
| 667 | |||||||||||||||||||||||||||||||||
| 668 | 0 | return $parameters; | |||||||||||||||||||||||||||||||
| 669 | } | ||||||||||||||||||||||||||||||||
| 670 | |||||||||||||||||||||||||||||||||
| 671 | # | ||||||||||||||||||||||||||||||||
| 672 | # Computes RFC 2104-compliant HMAC signature for request parameters | ||||||||||||||||||||||||||||||||
| 673 | # Implements AWS Signature, as per following spec: | ||||||||||||||||||||||||||||||||
| 674 | # | ||||||||||||||||||||||||||||||||
| 675 | # If Signature Version is 0, it signs concatenated Action and Timestamp | ||||||||||||||||||||||||||||||||
| 676 | # | ||||||||||||||||||||||||||||||||
| 677 | # If Signature Version is 1, it performs the following: | ||||||||||||||||||||||||||||||||
| 678 | # | ||||||||||||||||||||||||||||||||
| 679 | # Sorts all parameters (including SignatureVersion and excluding Signature, | ||||||||||||||||||||||||||||||||
| 680 | # the value of which is being created), ignoring case. | ||||||||||||||||||||||||||||||||
| 681 | # | ||||||||||||||||||||||||||||||||
| 682 | # Iterate over the sorted list and append the parameter name (in original case) | ||||||||||||||||||||||||||||||||
| 683 | # and then its value. It will not URL-encode the parameter values before | ||||||||||||||||||||||||||||||||
| 684 | # constructing this string. There are no separators. | ||||||||||||||||||||||||||||||||
| 685 | # | ||||||||||||||||||||||||||||||||
| 686 | 0 | ▶ | sub _signParameters { | ||||||||||||||||||||||||||||||
|
Subroutine
_signParameters: not called CC=4 SCAR=30.0
| |||||||||||||||||||||||||||||||||
| 687 | 0 | my ( $self, $parameters, $queueUrl, $key ) = @_; | |||||||||||||||||||||||||||||||
| 688 | |||||||||||||||||||||||||||||||||
| 689 | 0 | my $algorithm = 'HmacSHA1'; | |||||||||||||||||||||||||||||||
| 690 | 0 | my $data = $EMPTY; | |||||||||||||||||||||||||||||||
| 691 | |||||||||||||||||||||||||||||||||
| 692 | 0 | my $signatureVersion = $parameters->{SignatureVersion}; | |||||||||||||||||||||||||||||||
| 693 | |||||||||||||||||||||||||||||||||
| 694 | 0 | ▶ | if ( '0' eq $signatureVersion ) { | ||||||||||||||||||||||||||||||
|
Branch: 3 branches
| |||||||||||||||||||||||||||||||||
| 695 | 0 | $data = $self->_calculateStringToSignV0($parameters); | |||||||||||||||||||||||||||||||
| 696 | } | ||||||||||||||||||||||||||||||||
| 697 | elsif ( '1' eq $signatureVersion ) { | ||||||||||||||||||||||||||||||||
| 698 | 0 | $data = $self->_calculateStringToSignV1($parameters); | |||||||||||||||||||||||||||||||
| 699 | } | ||||||||||||||||||||||||||||||||
| 700 | elsif ( '2' eq $signatureVersion ) { | ||||||||||||||||||||||||||||||||
| 701 | 0 | $algorithm = $self->get_SignatureMethod; | |||||||||||||||||||||||||||||||
| 702 | 0 | $parameters->{SignatureMethod} = $algorithm; | |||||||||||||||||||||||||||||||
| 703 | 0 | $data = $self->_calculateStringToSignV2( $parameters, $queueUrl ); | |||||||||||||||||||||||||||||||
| 704 | } | ||||||||||||||||||||||||||||||||
| 705 | else { | ||||||||||||||||||||||||||||||||
| 706 | 0 | Carp::croak('Invalid Signature Version specified'); | |||||||||||||||||||||||||||||||
| 707 | } | ||||||||||||||||||||||||||||||||
| 708 | |||||||||||||||||||||||||||||||||
| 709 | 0 | return $self->_sign( $data, $key, $algorithm ); | |||||||||||||||||||||||||||||||
| 710 | } | ||||||||||||||||||||||||||||||||
| 711 | |||||||||||||||||||||||||||||||||
| 712 | 0 | ▶ | sub _calculateStringToSignV0 { | ||||||||||||||||||||||||||||||
|
Subroutine
_calculateStringToSignV0: not called CC=1 SCAR=6.9
| |||||||||||||||||||||||||||||||||
| 713 | 0 | my ( $self, $parameters ) = @_; | |||||||||||||||||||||||||||||||
| 714 | 0 | return $parameters->{Action} . $parameters->{Timestamp}; | |||||||||||||||||||||||||||||||
| 715 | } | ||||||||||||||||||||||||||||||||
| 716 | |||||||||||||||||||||||||||||||||
| 717 | 0 | ▶ | sub _calculateStringToSignV1 { | ||||||||||||||||||||||||||||||
|
Subroutine
_calculateStringToSignV1: not called CC=2 SCAR=12.2
| |||||||||||||||||||||||||||||||||
| 718 | 0 | my ( $self, $parameters ) = @_; | |||||||||||||||||||||||||||||||
| 719 | 0 | my $data = $EMPTY; | |||||||||||||||||||||||||||||||
| 720 | |||||||||||||||||||||||||||||||||
| 721 | 0 | foreach my $parameterName ( sort { lc($a) cmp lc $b } keys %{$parameters} ) { | |||||||||||||||||||||||||||||||
| 722 | 3 | ▶ | no warnings 'uninitialized'; ## no critic | ||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||
| 723 | |||||||||||||||||||||||||||||||||
| 724 | 0 | $data .= $parameterName . $parameters->{$parameterName}; | |||||||||||||||||||||||||||||||
| 725 | } | ||||||||||||||||||||||||||||||||
| 726 | |||||||||||||||||||||||||||||||||
| 727 | 0 | return $data; | |||||||||||||||||||||||||||||||
| 728 | } | ||||||||||||||||||||||||||||||||
| 729 | |||||||||||||||||||||||||||||||||
| 730 | 0 | ▶ | sub _calculateStringToSignV2 { | ||||||||||||||||||||||||||||||
|
Subroutine
_calculateStringToSignV2: not called CC=3 SCAR=21.9
| |||||||||||||||||||||||||||||||||
| 731 | 0 | my ( $self, $parameters, $queueUrl ) = @_; | |||||||||||||||||||||||||||||||
| 732 | |||||||||||||||||||||||||||||||||
| 733 | 0 | my $endpoint = URI->new($queueUrl); | |||||||||||||||||||||||||||||||
| 734 | 0 | my $data = 'POST'; | |||||||||||||||||||||||||||||||
| 735 | 0 | $data .= "\n"; | |||||||||||||||||||||||||||||||
| 736 | 0 | $data .= $endpoint->host; | |||||||||||||||||||||||||||||||
| 737 | 0 | $data .= "\n"; | |||||||||||||||||||||||||||||||
| 738 | |||||||||||||||||||||||||||||||||
| 739 | 0 | ▶ | my $path = $endpoint->path || $SLASH; | ||||||||||||||||||||||||||||||
|
Condition0%0/3
$endpoint->path || $Amazon::SQS::Client::SLASH
MC/DC0%0/2
$endpoint->path || $Amazon::SQS::Client::SLASH
$endpoint->path
$Amazon::SQS::Client::SLASH
Truth table0%0/3
A || B
A= $endpoint->pathB= $Amazon::SQS::Client::SLASH
| |||||||||||||||||||||||||||||||||
| 740 | 0 | $data .= $self->_urlencode( $path, 1 ); | |||||||||||||||||||||||||||||||
| 741 | 0 | $data .= "\n"; | |||||||||||||||||||||||||||||||
| 742 | |||||||||||||||||||||||||||||||||
| 743 | 0 | my @parameterKeys = keys %{$parameters}; | |||||||||||||||||||||||||||||||
| 744 | |||||||||||||||||||||||||||||||||
| 745 | 0 | foreach my $parameterName ( sort { $a cmp $b } @parameterKeys ) { | |||||||||||||||||||||||||||||||
| 746 | 3 | ▶ | no warnings 'uninitialized'; ## no critic | ||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||
| 747 | 0 | $data .= $parameterName . $EQUALS . $self->_urlencode( $parameters->{$parameterName} ); | |||||||||||||||||||||||||||||||
| 748 | 0 | $data .= $AMPERSAND; | |||||||||||||||||||||||||||||||
| 749 | } | ||||||||||||||||||||||||||||||||
| 750 | |||||||||||||||||||||||||||||||||
| 751 | 0 | chop $data; | |||||||||||||||||||||||||||||||
| 752 | |||||||||||||||||||||||||||||||||
| 753 | 0 | return $data; | |||||||||||||||||||||||||||||||
| 754 | } | ||||||||||||||||||||||||||||||||
| 755 | |||||||||||||||||||||||||||||||||
| 756 | ######################################################################## | ||||||||||||||||||||||||||||||||
| 757 | 0 | ▶ | sub _urlencode { | ||||||||||||||||||||||||||||||
|
Subroutine
_urlencode: not called CC=2 SCAR=12.2
| |||||||||||||||||||||||||||||||||
| 758 | ######################################################################## | ||||||||||||||||||||||||||||||||
| 759 | 0 | my ( $self, $value, $path ) = @_; | |||||||||||||||||||||||||||||||
| 760 | |||||||||||||||||||||||||||||||||
| 761 | 3 | ▶ | use URI::Escape qw(uri_escape_utf8); | ||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||
| 762 | |||||||||||||||||||||||||||||||||
| 763 | 0 | my $escapepattern = '^A-Za-z0-9\-_.~'; | |||||||||||||||||||||||||||||||
| 764 | |||||||||||||||||||||||||||||||||
| 765 | 0 | ▶ | if ($path) { | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 766 | 0 | $escapepattern = $escapepattern . $SLASH; | |||||||||||||||||||||||||||||||
| 767 | } | ||||||||||||||||||||||||||||||||
| 768 | |||||||||||||||||||||||||||||||||
| 769 | 0 | return uri_escape_utf8( $value, $escapepattern ); | |||||||||||||||||||||||||||||||
| 770 | } | ||||||||||||||||||||||||||||||||
| 771 | |||||||||||||||||||||||||||||||||
| 772 | # | ||||||||||||||||||||||||||||||||
| 773 | # Computes RFC 2104-compliant HMAC signature. | ||||||||||||||||||||||||||||||||
| 774 | # | ||||||||||||||||||||||||||||||||
| 775 | 0 | ▶ | sub _sign { | ||||||||||||||||||||||||||||||
|
Subroutine
_sign: not called CC=3 SCAR=24.8
| |||||||||||||||||||||||||||||||||
| 776 | 0 | my ( $self, $data, $key, $algorithm ) = @_; | |||||||||||||||||||||||||||||||
| 777 | |||||||||||||||||||||||||||||||||
| 778 | 0 | my $output = $EMPTY; | |||||||||||||||||||||||||||||||
| 779 | |||||||||||||||||||||||||||||||||
| 780 | 0 | ▶ | if ( 'HmacSHA1' eq $algorithm ) { | ||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||
| 781 | 0 | $output = hmac_sha1_base64( $data, $key ); | |||||||||||||||||||||||||||||||
| 782 | } | ||||||||||||||||||||||||||||||||
| 783 | elsif ( 'HmacSHA256' eq $algorithm ) { | ||||||||||||||||||||||||||||||||
| 784 | 0 | $output = hmac_sha256_base64( $data, $key ); | |||||||||||||||||||||||||||||||
| 785 | } | ||||||||||||||||||||||||||||||||
| 786 | else { | ||||||||||||||||||||||||||||||||
| 787 | 0 | Carp::croak('Non-supported signing method specified'); | |||||||||||||||||||||||||||||||
| 788 | } | ||||||||||||||||||||||||||||||||
| 789 | |||||||||||||||||||||||||||||||||
| 790 | 0 | return $output . $EQUALS; | |||||||||||||||||||||||||||||||
| 791 | } | ||||||||||||||||||||||||||||||||
| 792 | |||||||||||||||||||||||||||||||||
| 793 | # | ||||||||||||||||||||||||||||||||
| 794 | # Formats date as ISO 8601 timestamp | ||||||||||||||||||||||||||||||||
| 795 | # | ||||||||||||||||||||||||||||||||
| 796 | 0 | ▶ | sub _getFormattedTimestamp { | ||||||||||||||||||||||||||||||
|
Subroutine
_getFormattedTimestamp: not called CC=1 SCAR=6.9
| |||||||||||||||||||||||||||||||||
| 797 | 0 | ▶ | return sprintf '%04d-%02d-%02dT%02d:%02d:%02d.000Z', sub { | ||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: not called CC=1 SCAR=6.9
| |||||||||||||||||||||||||||||||||
| 798 | 0 | ( $_[5] + 1900, $_[4] + 1, $_[3], $_[2], $_[1], $_[0] ) | |||||||||||||||||||||||||||||||
| 799 | } | ||||||||||||||||||||||||||||||||
| 800 | 0 | ->( gmtime time ); | |||||||||||||||||||||||||||||||
| 801 | } | ||||||||||||||||||||||||||||||||
| 802 | |||||||||||||||||||||||||||||||||
| 803 | # | ||||||||||||||||||||||||||||||||
| 804 | # Convert CreateQueueRequest to name value pairs | ||||||||||||||||||||||||||||||||
| 805 | # | ||||||||||||||||||||||||||||||||
| 806 | 0 | ▶ | sub _convertCreateQueue() { | ||||||||||||||||||||||||||||||
|
Subroutine
_convertCreateQueue: not called CC=6 SCAR=37.4
| |||||||||||||||||||||||||||||||||
| 807 | 0 | my ( $self, $request ) = @_; | |||||||||||||||||||||||||||||||
| 808 | |||||||||||||||||||||||||||||||||
| 809 | 0 | my $parameters = {}; | |||||||||||||||||||||||||||||||
| 810 | 0 | $parameters->{Action} = 'CreateQueue'; | |||||||||||||||||||||||||||||||
| 811 | |||||||||||||||||||||||||||||||||
| 812 | 0 | ▶ | if ( $request->isSetQueueName() ) { | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 813 | 0 | $parameters->{'QueueName'} = $request->getQueueName(); | |||||||||||||||||||||||||||||||
| 814 | } | ||||||||||||||||||||||||||||||||
| 815 | |||||||||||||||||||||||||||||||||
| 816 | 0 | ▶ | if ( $request->isSetDefaultVisibilityTimeout() ) { | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 817 | 0 | $parameters->{'DefaultVisibilityTimeout'} = $request->getDefaultVisibilityTimeout(); | |||||||||||||||||||||||||||||||
| 818 | } | ||||||||||||||||||||||||||||||||
| 819 | |||||||||||||||||||||||||||||||||
| 820 | 0 | my $attributecreateQueueRequestList = $request->getAttribute(); | |||||||||||||||||||||||||||||||
| 821 | |||||||||||||||||||||||||||||||||
| 822 | 0 | for my $attributecreateQueueRequestIndex ( 0 .. $#{$attributecreateQueueRequestList} ) { | |||||||||||||||||||||||||||||||
| 823 | 0 | my $attributecreateQueueRequest = $attributecreateQueueRequestList->[$attributecreateQueueRequestIndex]; | |||||||||||||||||||||||||||||||
| 824 | 0 | ▶ | if ( $attributecreateQueueRequest->isSetName() ) { | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 825 | 0 | $parameters->{ 'Attribute.' . ( $attributecreateQueueRequestIndex + 1 ) . '.Name' } | |||||||||||||||||||||||||||||||
| 826 | = $attributecreateQueueRequest->getName(); | ||||||||||||||||||||||||||||||||
| 827 | } | ||||||||||||||||||||||||||||||||
| 828 | |||||||||||||||||||||||||||||||||
| 829 | 0 | ▶ | if ( $attributecreateQueueRequest->isSetValue() ) { | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 830 | 0 | $parameters->{ 'Attribute.' . ( $attributecreateQueueRequestIndex + 1 ) . '.Value' } | |||||||||||||||||||||||||||||||
| 831 | = $attributecreateQueueRequest->getValue(); | ||||||||||||||||||||||||||||||||
| 832 | } | ||||||||||||||||||||||||||||||||
| 833 | } | ||||||||||||||||||||||||||||||||
| 834 | |||||||||||||||||||||||||||||||||
| 835 | 0 | return $parameters; | |||||||||||||||||||||||||||||||
| 836 | } | ||||||||||||||||||||||||||||||||
| 837 | |||||||||||||||||||||||||||||||||
| 838 | # | ||||||||||||||||||||||||||||||||
| 839 | # Convert ListQueuesRequest to name value pairs | ||||||||||||||||||||||||||||||||
| 840 | # | ||||||||||||||||||||||||||||||||
| 841 | 0 | ▶ | sub _convertListQueues() { | ||||||||||||||||||||||||||||||
|
Subroutine
_convertListQueues: not called CC=5 SCAR=34.0
| |||||||||||||||||||||||||||||||||
| 842 | 0 | my ( $self, $request ) = @_; | |||||||||||||||||||||||||||||||
| 843 | |||||||||||||||||||||||||||||||||
| 844 | 0 | my $parameters = {}; | |||||||||||||||||||||||||||||||
| 845 | 0 | $parameters->{Action} = 'ListQueues'; | |||||||||||||||||||||||||||||||
| 846 | |||||||||||||||||||||||||||||||||
| 847 | 0 | ▶ | if ( $request->isSetQueueNamePrefix() ) { | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 848 | 0 | $parameters->{'QueueNamePrefix'} = $request->getQueueNamePrefix(); | |||||||||||||||||||||||||||||||
| 849 | } | ||||||||||||||||||||||||||||||||
| 850 | 0 | my $attributelistQueuesRequestList = $request->getAttribute(); | |||||||||||||||||||||||||||||||
| 851 | |||||||||||||||||||||||||||||||||
| 852 | 0 | for my $attributelistQueuesRequestIndex ( 0 .. $#{$attributelistQueuesRequestList} ) { | |||||||||||||||||||||||||||||||
| 853 | 0 | my $attributelistQueuesRequest = $attributelistQueuesRequestList->[$attributelistQueuesRequestIndex]; | |||||||||||||||||||||||||||||||
| 854 | |||||||||||||||||||||||||||||||||
| 855 | 0 | ▶ | if ( $attributelistQueuesRequest->isSetName() ) { | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 856 | 0 | $parameters->{ 'Attribute.' . ( $attributelistQueuesRequestIndex + 1 ) . '.Name' } | |||||||||||||||||||||||||||||||
| 857 | = $attributelistQueuesRequest->getName(); | ||||||||||||||||||||||||||||||||
| 858 | } | ||||||||||||||||||||||||||||||||
| 859 | 0 | ▶ | if ( $attributelistQueuesRequest->isSetValue() ) { | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 860 | 0 | $parameters->{ 'Attribute.' . ( $attributelistQueuesRequestIndex + 1 ) . '.Value' } | |||||||||||||||||||||||||||||||
| 861 | = $attributelistQueuesRequest->getValue(); | ||||||||||||||||||||||||||||||||
| 862 | } | ||||||||||||||||||||||||||||||||
| 863 | |||||||||||||||||||||||||||||||||
| 864 | } | ||||||||||||||||||||||||||||||||
| 865 | |||||||||||||||||||||||||||||||||
| 866 | 0 | return $parameters; | |||||||||||||||||||||||||||||||
| 867 | } | ||||||||||||||||||||||||||||||||
| 868 | |||||||||||||||||||||||||||||||||
| 869 | # | ||||||||||||||||||||||||||||||||
| 870 | # Convert ListDeadLetterSourceQueues to name value pairs | ||||||||||||||||||||||||||||||||
| 871 | # | ||||||||||||||||||||||||||||||||
| 872 | 0 | ▶ | sub _convertListDeadLetterSourceQueues() { | ||||||||||||||||||||||||||||||
|
Subroutine
_convertListDeadLetterSourceQueues: not called CC=2 SCAR=17.9
| |||||||||||||||||||||||||||||||||
| 873 | 0 | my ( $self, $request ) = @_; | |||||||||||||||||||||||||||||||
| 874 | |||||||||||||||||||||||||||||||||
| 875 | 0 | my $parameters = {}; | |||||||||||||||||||||||||||||||
| 876 | 0 | $parameters->{Action} = 'ListDeadLetterSourceQueues'; | |||||||||||||||||||||||||||||||
| 877 | |||||||||||||||||||||||||||||||||
| 878 | 0 | ▶ | if ( $request->isSetQueueUrl() ) { | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 879 | 0 | $parameters->{QueueUrl} = $request->getQueueUrl(); | |||||||||||||||||||||||||||||||
| 880 | } | ||||||||||||||||||||||||||||||||
| 881 | |||||||||||||||||||||||||||||||||
| 882 | 0 | return $parameters; | |||||||||||||||||||||||||||||||
| 883 | } | ||||||||||||||||||||||||||||||||
| 884 | |||||||||||||||||||||||||||||||||
| 885 | # | ||||||||||||||||||||||||||||||||
| 886 | # Convert ChangeMessageVisibilityRequest to name value pairs | ||||||||||||||||||||||||||||||||
| 887 | # | ||||||||||||||||||||||||||||||||
| 888 | 0 | ▶ | sub _convertChangeMessageVisibility() { | ||||||||||||||||||||||||||||||
|
Subroutine
_convertChangeMessageVisibility: not called CC=7 SCAR=40.3
| |||||||||||||||||||||||||||||||||
| 889 | 0 | my ( $self, $request ) = @_; | |||||||||||||||||||||||||||||||
| 890 | |||||||||||||||||||||||||||||||||
| 891 | 0 | my $parameters = {}; | |||||||||||||||||||||||||||||||
| 892 | 0 | $parameters->{Action} = 'ChangeMessageVisibility'; | |||||||||||||||||||||||||||||||
| 893 | |||||||||||||||||||||||||||||||||
| 894 | 0 | ▶ | if ( $request->isSetQueueUrl() ) { | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 895 | 0 | $parameters->{QueueUrl} = $request->getQueueUrl(); | |||||||||||||||||||||||||||||||
| 896 | } | ||||||||||||||||||||||||||||||||
| 897 | |||||||||||||||||||||||||||||||||
| 898 | 0 | ▶ | if ( $request->isSetReceiptHandle() ) { | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 899 | 0 | $parameters->{'ReceiptHandle'} = $request->getReceiptHandle(); | |||||||||||||||||||||||||||||||
| 900 | } | ||||||||||||||||||||||||||||||||
| 901 | |||||||||||||||||||||||||||||||||
| 902 | 0 | ▶ | if ( $request->isSetVisibilityTimeout() ) { | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 903 | 0 | $parameters->{'VisibilityTimeout'} = $request->getVisibilityTimeout(); | |||||||||||||||||||||||||||||||
| 904 | } | ||||||||||||||||||||||||||||||||
| 905 | |||||||||||||||||||||||||||||||||
| 906 | 0 | my $attributechangeMessageVisibilityRequestList = $request->getAttribute(); | |||||||||||||||||||||||||||||||
| 907 | |||||||||||||||||||||||||||||||||
| 908 | 0 | for | |||||||||||||||||||||||||||||||
| 909 | 0 | my $attributechangeMessageVisibilityRequestIndex ( 0 .. $#{$attributechangeMessageVisibilityRequestList} ) { | |||||||||||||||||||||||||||||||
| 910 | 0 | my $attributechangeMessageVisibilityRequest | |||||||||||||||||||||||||||||||
| 911 | = $attributechangeMessageVisibilityRequestList->[$attributechangeMessageVisibilityRequestIndex]; | ||||||||||||||||||||||||||||||||
| 912 | |||||||||||||||||||||||||||||||||
| 913 | 0 | ▶ | if ( $attributechangeMessageVisibilityRequest->isSetName() ) { | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 914 | 0 | $parameters->{ 'Attribute.' . ( $attributechangeMessageVisibilityRequestIndex + 1 ) . '.Name' } | |||||||||||||||||||||||||||||||
| 915 | = $attributechangeMessageVisibilityRequest->getName(); | ||||||||||||||||||||||||||||||||
| 916 | } | ||||||||||||||||||||||||||||||||
| 917 | |||||||||||||||||||||||||||||||||
| 918 | 0 | ▶ | if ( $attributechangeMessageVisibilityRequest->isSetValue() ) { | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 919 | 0 | $parameters->{ 'Attribute.' . ( $attributechangeMessageVisibilityRequestIndex + 1 ) . '.Value' } | |||||||||||||||||||||||||||||||
| 920 | = $attributechangeMessageVisibilityRequest->getValue(); | ||||||||||||||||||||||||||||||||
| 921 | } | ||||||||||||||||||||||||||||||||
| 922 | } | ||||||||||||||||||||||||||||||||
| 923 | |||||||||||||||||||||||||||||||||
| 924 | 0 | return $parameters; | |||||||||||||||||||||||||||||||
| 925 | } | ||||||||||||||||||||||||||||||||
| 926 | |||||||||||||||||||||||||||||||||
| 927 | 0 | ▶ | sub _convertChangeMessageVisibilityBatch() { | ||||||||||||||||||||||||||||||
|
Subroutine
_convertChangeMessageVisibilityBatch: not called CC=7 SCAR=40.3
| |||||||||||||||||||||||||||||||||
| 928 | 0 | my ( $self, $request ) = @_; | |||||||||||||||||||||||||||||||
| 929 | |||||||||||||||||||||||||||||||||
| 930 | 0 | my $parameters = {}; | |||||||||||||||||||||||||||||||
| 931 | 0 | $parameters->{Action} = 'ChangeMessageVisibilityBatch'; | |||||||||||||||||||||||||||||||
| 932 | |||||||||||||||||||||||||||||||||
| 933 | 0 | ▶ | if ( $request->isSetQueueUrl() ) { | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 934 | 0 | $parameters->{QueueUrl} = $request->getQueueUrl(); | |||||||||||||||||||||||||||||||
| 935 | } | ||||||||||||||||||||||||||||||||
| 936 | |||||||||||||||||||||||||||||||||
| 937 | 0 | ▶ | if ( $request->isSetBatchRequest() ) { | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 938 | 0 | my $batchrequestchangeMessageVisibilityRequestList = $request->getBatchRequest(); | |||||||||||||||||||||||||||||||
| 939 | |||||||||||||||||||||||||||||||||
| 940 | 0 | foreach my $batchrequestEntryIndex ( 0 .. $#{$batchrequestchangeMessageVisibilityRequestList} ) { | |||||||||||||||||||||||||||||||
| 941 | 0 | my $batchrequestEntry = $batchrequestchangeMessageVisibilityRequestList->[$batchrequestEntryIndex]; | |||||||||||||||||||||||||||||||
| 942 | |||||||||||||||||||||||||||||||||
| 943 | 0 | ▶ | if ( $batchrequestEntry->isSetId() ) { | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 944 | 0 | $parameters->{ 'ChangeMessageVisibilityBatchRequestEntry.' . ( $batchrequestEntryIndex + 1 ) . '.Id' } | |||||||||||||||||||||||||||||||
| 945 | = $batchrequestEntry->getId(); | ||||||||||||||||||||||||||||||||
| 946 | } | ||||||||||||||||||||||||||||||||
| 947 | |||||||||||||||||||||||||||||||||
| 948 | 0 | ▶ | if ( $batchrequestEntry->isSetReceiptHandle() ) { | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 949 | 0 | $parameters->{ 'ChangeMessageVisibilityBatchRequestEntry.' | |||||||||||||||||||||||||||||||
| 950 | . ( $batchrequestEntryIndex + 1 ) | ||||||||||||||||||||||||||||||||
| 951 | . '.ReceiptHandle' } = $batchrequestEntry->getReceiptHandle(); | ||||||||||||||||||||||||||||||||
| 952 | } | ||||||||||||||||||||||||||||||||
| 953 | |||||||||||||||||||||||||||||||||
| 954 | 0 | ▶ | if ( $batchrequestEntry->isSetVisibilityTimeout() ) { | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 955 | 0 | $parameters->{ 'ChangeMessageVisibilityBatchRequestEntry.' | |||||||||||||||||||||||||||||||
| 956 | . ( $batchrequestEntryIndex + 1 ) | ||||||||||||||||||||||||||||||||
| 957 | . '.VisibilityTimeout' } = $batchrequestEntry->getVisibilityTimeout(); | ||||||||||||||||||||||||||||||||
| 958 | } | ||||||||||||||||||||||||||||||||
| 959 | } | ||||||||||||||||||||||||||||||||
| 960 | } | ||||||||||||||||||||||||||||||||
| 961 | |||||||||||||||||||||||||||||||||
| 962 | 0 | return $parameters; | |||||||||||||||||||||||||||||||
| 963 | } | ||||||||||||||||||||||||||||||||
| 964 | |||||||||||||||||||||||||||||||||
| 965 | # | ||||||||||||||||||||||||||||||||
| 966 | # Convert DeleteMessageRequest to name value pairs | ||||||||||||||||||||||||||||||||
| 967 | # | ||||||||||||||||||||||||||||||||
| 968 | 0 | ▶ | sub _convertDeleteMessage() { | ||||||||||||||||||||||||||||||
|
Subroutine
_convertDeleteMessage: not called CC=6 SCAR=37.4
| |||||||||||||||||||||||||||||||||
| 969 | 0 | my ( $self, $request ) = @_; | |||||||||||||||||||||||||||||||
| 970 | |||||||||||||||||||||||||||||||||
| 971 | 0 | my $parameters = {}; | |||||||||||||||||||||||||||||||
| 972 | 0 | $parameters->{Action} = 'DeleteMessage'; | |||||||||||||||||||||||||||||||
| 973 | 0 | ▶ | if ( $request->isSetQueueUrl() ) { | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 974 | 0 | $parameters->{QueueUrl} = $request->getQueueUrl(); | |||||||||||||||||||||||||||||||
| 975 | } | ||||||||||||||||||||||||||||||||
| 976 | 0 | ▶ | if ( $request->isSetReceiptHandle() ) { | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 977 | 0 | $parameters->{ReceiptHandle} = $request->getReceiptHandle(); | |||||||||||||||||||||||||||||||
| 978 | } | ||||||||||||||||||||||||||||||||
| 979 | 0 | my $attributedeleteMessageRequestList = $request->getAttribute(); | |||||||||||||||||||||||||||||||
| 980 | 0 | for my $attributedeleteMessageRequestIndex ( 0 .. $#{$attributedeleteMessageRequestList} ) { | |||||||||||||||||||||||||||||||
| 981 | 0 | my $attributedeleteMessageRequest | |||||||||||||||||||||||||||||||
| 982 | = $attributedeleteMessageRequestList->[$attributedeleteMessageRequestIndex]; | ||||||||||||||||||||||||||||||||
| 983 | 0 | ▶ | if ( $attributedeleteMessageRequest->isSetName() ) { | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 984 | 0 | $parameters->{ 'Attribute.' . ( $attributedeleteMessageRequestIndex + 1 ) . '.Name' } | |||||||||||||||||||||||||||||||
| 985 | = $attributedeleteMessageRequest->getName(); | ||||||||||||||||||||||||||||||||
| 986 | } | ||||||||||||||||||||||||||||||||
| 987 | |||||||||||||||||||||||||||||||||
| 988 | 0 | ▶ | if ( $attributedeleteMessageRequest->isSetValue() ) { | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 989 | 0 | $parameters->{ 'Attribute.' . ( $attributedeleteMessageRequestIndex + 1 ) . '.Value' } | |||||||||||||||||||||||||||||||
| 990 | = $attributedeleteMessageRequest->getValue(); | ||||||||||||||||||||||||||||||||
| 991 | } | ||||||||||||||||||||||||||||||||
| 992 | |||||||||||||||||||||||||||||||||
| 993 | } | ||||||||||||||||||||||||||||||||
| 994 | |||||||||||||||||||||||||||||||||
| 995 | 0 | return $parameters; | |||||||||||||||||||||||||||||||
| 996 | } | ||||||||||||||||||||||||||||||||
| 997 | |||||||||||||||||||||||||||||||||
| 998 | 0 | ▶ | sub _convertDeleteMessageBatch() { | ||||||||||||||||||||||||||||||
|
Subroutine
_convertDeleteMessageBatch: not called CC=6 SCAR=37.4
| |||||||||||||||||||||||||||||||||
| 999 | 0 | my ( $self, $request ) = @_; | |||||||||||||||||||||||||||||||
| 1000 | |||||||||||||||||||||||||||||||||
| 1001 | 0 | my $parameters = {}; | |||||||||||||||||||||||||||||||
| 1002 | 0 | $parameters->{Action} = 'DeleteMessageBatch'; | |||||||||||||||||||||||||||||||
| 1003 | 0 | ▶ | if ( $request->isSetQueueUrl() ) { | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 1004 | 0 | $parameters->{QueueUrl} = $request->getQueueUrl(); | |||||||||||||||||||||||||||||||
| 1005 | } | ||||||||||||||||||||||||||||||||
| 1006 | |||||||||||||||||||||||||||||||||
| 1007 | 0 | ▶ | if ( $request->isSetDeleteMessageBatchRequestEntry() ) { | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 1008 | 0 | my $batchrequestList = $request->getDeleteMessageBatchRequestEntry(); | |||||||||||||||||||||||||||||||
| 1009 | |||||||||||||||||||||||||||||||||
| 1010 | 0 | foreach my $batchrequestEntryIndex ( 0 .. $#{$batchrequestList} ) { | |||||||||||||||||||||||||||||||
| 1011 | 0 | my $batchrequestEntry = $batchrequestList->[$batchrequestEntryIndex]; | |||||||||||||||||||||||||||||||
| 1012 | |||||||||||||||||||||||||||||||||
| 1013 | 0 | ▶ | if ( $batchrequestEntry->isSetId() ) { | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 1014 | 0 | $parameters->{ 'DeleteMessageBatchRequestEntry.' . ( $batchrequestEntryIndex + 1 ) . '.Id' } | |||||||||||||||||||||||||||||||
| 1015 | = $batchrequestEntry->getId(); | ||||||||||||||||||||||||||||||||
| 1016 | } | ||||||||||||||||||||||||||||||||
| 1017 | |||||||||||||||||||||||||||||||||
| 1018 | 0 | ▶ | if ( $batchrequestEntry->isSetReceiptHandle() ) { | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 1019 | 0 | $parameters->{ 'DeleteMessageBatchRequestEntry.' . ( $batchrequestEntryIndex + 1 ) . '.ReceiptHandle' } | |||||||||||||||||||||||||||||||
| 1020 | = $batchrequestEntry->getReceiptHandle(); | ||||||||||||||||||||||||||||||||
| 1021 | } | ||||||||||||||||||||||||||||||||
| 1022 | } | ||||||||||||||||||||||||||||||||
| 1023 | } | ||||||||||||||||||||||||||||||||
| 1024 | |||||||||||||||||||||||||||||||||
| 1025 | 0 | return $parameters; | |||||||||||||||||||||||||||||||
| 1026 | } | ||||||||||||||||||||||||||||||||
| 1027 | |||||||||||||||||||||||||||||||||
| 1028 | # | ||||||||||||||||||||||||||||||||
| 1029 | # Convert DeleteQueueRequest to name value pairs | ||||||||||||||||||||||||||||||||
| 1030 | # | ||||||||||||||||||||||||||||||||
| 1031 | 0 | ▶ | sub _convertDeleteQueue() { | ||||||||||||||||||||||||||||||
|
Subroutine
_convertDeleteQueue: not called CC=5 SCAR=34.0
| |||||||||||||||||||||||||||||||||
| 1032 | 0 | my ( $self, $request ) = @_; | |||||||||||||||||||||||||||||||
| 1033 | |||||||||||||||||||||||||||||||||
| 1034 | 0 | my $parameters = {}; | |||||||||||||||||||||||||||||||
| 1035 | 0 | $parameters->{Action} = 'DeleteQueue'; | |||||||||||||||||||||||||||||||
| 1036 | |||||||||||||||||||||||||||||||||
| 1037 | 0 | ▶ | if ( $request->isSetQueueUrl() ) { | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 1038 | 0 | $parameters->{QueueUrl} = $request->getQueueUrl(); | |||||||||||||||||||||||||||||||
| 1039 | } | ||||||||||||||||||||||||||||||||
| 1040 | 0 | my $attributedeleteQueueRequestList = $request->getAttribute(); | |||||||||||||||||||||||||||||||
| 1041 | 0 | for my $attributedeleteQueueRequestIndex ( 0 .. $#{$attributedeleteQueueRequestList} ) { | |||||||||||||||||||||||||||||||
| 1042 | 0 | my $attributedeleteQueueRequest = $attributedeleteQueueRequestList->[$attributedeleteQueueRequestIndex]; | |||||||||||||||||||||||||||||||
| 1043 | 0 | ▶ | if ( $attributedeleteQueueRequest->isSetName() ) { | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 1044 | 0 | $parameters->{ 'Attribute.' . ( $attributedeleteQueueRequestIndex + 1 ) . '.Name' } | |||||||||||||||||||||||||||||||
| 1045 | = $attributedeleteQueueRequest->getName(); | ||||||||||||||||||||||||||||||||
| 1046 | } | ||||||||||||||||||||||||||||||||
| 1047 | 0 | ▶ | if ( $attributedeleteQueueRequest->isSetValue() ) { | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 1048 | 0 | $parameters->{ 'Attribute.' . ( $attributedeleteQueueRequestIndex + 1 ) . '.Value' } | |||||||||||||||||||||||||||||||
| 1049 | = $attributedeleteQueueRequest->getValue(); | ||||||||||||||||||||||||||||||||
| 1050 | } | ||||||||||||||||||||||||||||||||
| 1051 | |||||||||||||||||||||||||||||||||
| 1052 | } | ||||||||||||||||||||||||||||||||
| 1053 | |||||||||||||||||||||||||||||||||
| 1054 | 0 | return $parameters; | |||||||||||||||||||||||||||||||
| 1055 | } | ||||||||||||||||||||||||||||||||
| 1056 | |||||||||||||||||||||||||||||||||
| 1057 | # | ||||||||||||||||||||||||||||||||
| 1058 | # Convert GetQueueAttributesRequest to name value pairs | ||||||||||||||||||||||||||||||||
| 1059 | # | ||||||||||||||||||||||||||||||||
| 1060 | 0 | ▶ | sub _convertGetQueueAttributes() { | ||||||||||||||||||||||||||||||
|
Subroutine
_convertGetQueueAttributes: not called CC=3 SCAR=24.8
| |||||||||||||||||||||||||||||||||
| 1061 | 0 | my ( $self, $request ) = @_; | |||||||||||||||||||||||||||||||
| 1062 | |||||||||||||||||||||||||||||||||
| 1063 | 0 | my $parameters = {}; | |||||||||||||||||||||||||||||||
| 1064 | 0 | $parameters->{Action} = 'GetQueueAttributes'; | |||||||||||||||||||||||||||||||
| 1065 | 0 | ▶ | if ( $request->isSetQueueUrl() ) { | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 1066 | 0 | $parameters->{QueueUrl} = $request->getQueueUrl(); | |||||||||||||||||||||||||||||||
| 1067 | } | ||||||||||||||||||||||||||||||||
| 1068 | 0 | my $attributeNamegetQueueAttributesRequestList = $request->getAttributeName(); | |||||||||||||||||||||||||||||||
| 1069 | 0 | for my $attributeNamegetQueueAttributesRequestIndex ( 0 .. $#{$attributeNamegetQueueAttributesRequestList} ) { | |||||||||||||||||||||||||||||||
| 1070 | 0 | my $attributeNamegetQueueAttributesRequest | |||||||||||||||||||||||||||||||
| 1071 | = $attributeNamegetQueueAttributesRequestList->[$attributeNamegetQueueAttributesRequestIndex]; | ||||||||||||||||||||||||||||||||
| 1072 | 0 | $parameters->{ 'AttributeName.' . ( $attributeNamegetQueueAttributesRequestIndex + 1 ) } | |||||||||||||||||||||||||||||||
| 1073 | = $attributeNamegetQueueAttributesRequest; | ||||||||||||||||||||||||||||||||
| 1074 | } | ||||||||||||||||||||||||||||||||
| 1075 | |||||||||||||||||||||||||||||||||
| 1076 | 0 | return $parameters; | |||||||||||||||||||||||||||||||
| 1077 | } | ||||||||||||||||||||||||||||||||
| 1078 | |||||||||||||||||||||||||||||||||
| 1079 | # | ||||||||||||||||||||||||||||||||
| 1080 | # Convert ReceiveMessageRequest to name value pairs | ||||||||||||||||||||||||||||||||
| 1081 | # | ||||||||||||||||||||||||||||||||
| 1082 | 0 | ▶ | sub _convertReceiveMessage() { | ||||||||||||||||||||||||||||||
|
Subroutine
_convertReceiveMessage: not called CC=7 SCAR=40.3
| |||||||||||||||||||||||||||||||||
| 1083 | 0 | my ( $self, $request ) = @_; | |||||||||||||||||||||||||||||||
| 1084 | |||||||||||||||||||||||||||||||||
| 1085 | 0 | my $parameters = {}; | |||||||||||||||||||||||||||||||
| 1086 | 0 | $parameters->{Action} = 'ReceiveMessage'; | |||||||||||||||||||||||||||||||
| 1087 | 0 | ▶ | if ( $request->isSetQueueUrl() ) { | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 1088 | 0 | $parameters->{QueueUrl} = $request->getQueueUrl(); | |||||||||||||||||||||||||||||||
| 1089 | } | ||||||||||||||||||||||||||||||||
| 1090 | 0 | ▶ | if ( $request->isSetMaxNumberOfMessages() ) { | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 1091 | 0 | $parameters->{MaxNumberOfMessages} = $request->getMaxNumberOfMessages(); | |||||||||||||||||||||||||||||||
| 1092 | } | ||||||||||||||||||||||||||||||||
| 1093 | 0 | ▶ | if ( $request->isSetVisibilityTimeout() ) { | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 1094 | 0 | $parameters->{VisibilityTimeout} = $request->getVisibilityTimeout(); | |||||||||||||||||||||||||||||||
| 1095 | } | ||||||||||||||||||||||||||||||||
| 1096 | |||||||||||||||||||||||||||||||||
| 1097 | 0 | ▶ | if ( $request->isSetWaitTimeSeconds() ) { | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 1098 | 0 | $parameters->{WaitTimeSeconds} = $request->getWaitTimeSeconds(); | |||||||||||||||||||||||||||||||
| 1099 | } | ||||||||||||||||||||||||||||||||
| 1100 | |||||||||||||||||||||||||||||||||
| 1101 | 0 | my $attributeNamereceiveMessageRequestList = $request->getAttributeName(); | |||||||||||||||||||||||||||||||
| 1102 | 0 | for my $attributeNamereceiveMessageRequestIndex ( 0 .. $#{$attributeNamereceiveMessageRequestList} ) { | |||||||||||||||||||||||||||||||
| 1103 | 0 | my $attributeNamereceiveMessageRequest | |||||||||||||||||||||||||||||||
| 1104 | = $attributeNamereceiveMessageRequestList->[$attributeNamereceiveMessageRequestIndex]; | ||||||||||||||||||||||||||||||||
| 1105 | 0 | $parameters->{ 'AttributeName.' . ( $attributeNamereceiveMessageRequestIndex + 1 ) } | |||||||||||||||||||||||||||||||
| 1106 | = $attributeNamereceiveMessageRequest; | ||||||||||||||||||||||||||||||||
| 1107 | } | ||||||||||||||||||||||||||||||||
| 1108 | |||||||||||||||||||||||||||||||||
| 1109 | 0 | my $messageAttributeNamereceiveMessageRequestList = $request->getMessageAttributeName(); | |||||||||||||||||||||||||||||||
| 1110 | 0 | for my $messageAttributeNamereceiveMessageRequestIndex ( | |||||||||||||||||||||||||||||||
| 1111 | 0 | 0 .. $#{$messageAttributeNamereceiveMessageRequestList} ) { | |||||||||||||||||||||||||||||||
| 1112 | 0 | my $messageAttributeNamereceiveMessageRequest | |||||||||||||||||||||||||||||||
| 1113 | = $messageAttributeNamereceiveMessageRequestList->[$messageAttributeNamereceiveMessageRequestIndex]; | ||||||||||||||||||||||||||||||||
| 1114 | 0 | $parameters->{ 'MessageAttributeName.' . ( $messageAttributeNamereceiveMessageRequestIndex + 1 ) } | |||||||||||||||||||||||||||||||
| 1115 | = $messageAttributeNamereceiveMessageRequest; | ||||||||||||||||||||||||||||||||
| 1116 | } | ||||||||||||||||||||||||||||||||
| 1117 | |||||||||||||||||||||||||||||||||
| 1118 | 0 | return $parameters; | |||||||||||||||||||||||||||||||
| 1119 | } | ||||||||||||||||||||||||||||||||
| 1120 | |||||||||||||||||||||||||||||||||
| 1121 | # | ||||||||||||||||||||||||||||||||
| 1122 | # Convert SendMessageRequest to name value pairs | ||||||||||||||||||||||||||||||||
| 1123 | # | ||||||||||||||||||||||||||||||||
| 1124 | 0 | ▶ | sub _convertSendMessage() { | ||||||||||||||||||||||||||||||
|
Subroutine
_convertSendMessage: not called CC=11 SCAR=48.8
| |||||||||||||||||||||||||||||||||
| 1125 | 0 | my ( $self, $request ) = @_; | |||||||||||||||||||||||||||||||
| 1126 | |||||||||||||||||||||||||||||||||
| 1127 | 0 | my $parameters = {}; | |||||||||||||||||||||||||||||||
| 1128 | 0 | $parameters->{Action} = 'SendMessage'; | |||||||||||||||||||||||||||||||
| 1129 | 0 | ▶ | if ( $request->isSetQueueUrl() ) { | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 1130 | 0 | $parameters->{QueueUrl} = $request->getQueueUrl(); | |||||||||||||||||||||||||||||||
| 1131 | } | ||||||||||||||||||||||||||||||||
| 1132 | |||||||||||||||||||||||||||||||||
| 1133 | 0 | ▶ | if ( $request->isSetMessageBody() ) { | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 1134 | 0 | $parameters->{MessageBody} = $request->getMessageBody(); | |||||||||||||||||||||||||||||||
| 1135 | } | ||||||||||||||||||||||||||||||||
| 1136 | |||||||||||||||||||||||||||||||||
| 1137 | 0 | ▶ | if ( $request->isSetMessageDuplicationId() ) { | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 1138 | 0 | $parameters->{MessageDuplicationId} = $request->getMessageDuplicationId(); | |||||||||||||||||||||||||||||||
| 1139 | } | ||||||||||||||||||||||||||||||||
| 1140 | |||||||||||||||||||||||||||||||||
| 1141 | 0 | ▶ | if ( $request->isSetMessageGroupId() ) { | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 1142 | 0 | $parameters->{MessageGroupId} = $request->getMessageGroupId(); | |||||||||||||||||||||||||||||||
| 1143 | } | ||||||||||||||||||||||||||||||||
| 1144 | |||||||||||||||||||||||||||||||||
| 1145 | 0 | ▶ | if ( $request->isSetDelaySeconds() ) { | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 1146 | 0 | $parameters->{DelaySeconds} = $request->getDelaySeconds(); | |||||||||||||||||||||||||||||||
| 1147 | } | ||||||||||||||||||||||||||||||||
| 1148 | |||||||||||||||||||||||||||||||||
| 1149 | 0 | my $attributesendMessageRequestList = $request->getMessageAttribute(); | |||||||||||||||||||||||||||||||
| 1150 | 0 | for my $attributesendMessageRequestIndex ( 0 .. $#{$attributesendMessageRequestList} ) { | |||||||||||||||||||||||||||||||
| 1151 | 0 | my $attributesendMessageRequest = $attributesendMessageRequestList->[$attributesendMessageRequestIndex]; | |||||||||||||||||||||||||||||||
| 1152 | |||||||||||||||||||||||||||||||||
| 1153 | 0 | ▶ | if ( $attributesendMessageRequest->isSetName() ) { | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 1154 | 0 | $parameters->{ 'MessageAttribute.' . ( $attributesendMessageRequestIndex + 1 ) . '.Name' } | |||||||||||||||||||||||||||||||
| 1155 | = $attributesendMessageRequest->getName(); | ||||||||||||||||||||||||||||||||
| 1156 | } | ||||||||||||||||||||||||||||||||
| 1157 | |||||||||||||||||||||||||||||||||
| 1158 | 0 | my $value = $attributesendMessageRequest->getValue(); | |||||||||||||||||||||||||||||||
| 1159 | |||||||||||||||||||||||||||||||||
| 1160 | 0 | ▶ | if ( $value->isSetDataType() ) { | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 1161 | 0 | $parameters->{ 'MessageAttribute.' . ( $attributesendMessageRequestIndex + 1 ) . '.Value.DataType' } | |||||||||||||||||||||||||||||||
| 1162 | = $value->getDataType(); | ||||||||||||||||||||||||||||||||
| 1163 | } | ||||||||||||||||||||||||||||||||
| 1164 | |||||||||||||||||||||||||||||||||
| 1165 | 0 | ▶ | if ( $value->isSetStringValue() ) { | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 1166 | 0 | $parameters->{ 'MessageAttribute.' . ( $attributesendMessageRequestIndex + 1 ) . '.Value.StringValue' } | |||||||||||||||||||||||||||||||
| 1167 | = $value->getStringValue(); | ||||||||||||||||||||||||||||||||
| 1168 | } | ||||||||||||||||||||||||||||||||
| 1169 | |||||||||||||||||||||||||||||||||
| 1170 | 0 | ▶ | if ( $value->isSetBinaryValue() ) { | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 1171 | 0 | $parameters->{ 'MessageAttribute.' . ( $attributesendMessageRequestIndex + 1 ) . '.Value.BinaryValue' } | |||||||||||||||||||||||||||||||
| 1172 | = $value->getBinaryValue(); | ||||||||||||||||||||||||||||||||
| 1173 | } | ||||||||||||||||||||||||||||||||
| 1174 | } | ||||||||||||||||||||||||||||||||
| 1175 | |||||||||||||||||||||||||||||||||
| 1176 | 0 | return $parameters; | |||||||||||||||||||||||||||||||
| 1177 | } | ||||||||||||||||||||||||||||||||
| 1178 | |||||||||||||||||||||||||||||||||
| 1179 | # | ||||||||||||||||||||||||||||||||
| 1180 | # Convert SetQueueAttributesRequest to name value pairs | ||||||||||||||||||||||||||||||||
| 1181 | # | ||||||||||||||||||||||||||||||||
| 1182 | 0 | ▶ | sub _convertSetQueueAttributes() { | ||||||||||||||||||||||||||||||
|
Subroutine
_convertSetQueueAttributes: not called CC=5 SCAR=34.0
| |||||||||||||||||||||||||||||||||
| 1183 | 0 | my ( $self, $request ) = @_; | |||||||||||||||||||||||||||||||
| 1184 | |||||||||||||||||||||||||||||||||
| 1185 | 0 | my $parameters = {}; | |||||||||||||||||||||||||||||||
| 1186 | 0 | $parameters->{Action} = 'SetQueueAttributes'; | |||||||||||||||||||||||||||||||
| 1187 | 0 | ▶ | if ( $request->isSetQueueUrl() ) { | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 1188 | 0 | $parameters->{QueueUrl} = $request->getQueueUrl(); | |||||||||||||||||||||||||||||||
| 1189 | } | ||||||||||||||||||||||||||||||||
| 1190 | 0 | my $attributesetQueueAttributesRequestList = $request->getAttribute(); | |||||||||||||||||||||||||||||||
| 1191 | 0 | for my $attributesetQueueAttributesRequestIndex ( 0 .. $#{$attributesetQueueAttributesRequestList} ) { | |||||||||||||||||||||||||||||||
| 1192 | 0 | my $attributesetQueueAttributesRequest | |||||||||||||||||||||||||||||||
| 1193 | = $attributesetQueueAttributesRequestList->[$attributesetQueueAttributesRequestIndex]; | ||||||||||||||||||||||||||||||||
| 1194 | 0 | ▶ | if ( $attributesetQueueAttributesRequest->isSetName() ) { | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 1195 | 0 | $parameters->{ 'Attribute.' . ( $attributesetQueueAttributesRequestIndex + 1 ) . '.Name' } | |||||||||||||||||||||||||||||||
| 1196 | = $attributesetQueueAttributesRequest->getName(); | ||||||||||||||||||||||||||||||||
| 1197 | } | ||||||||||||||||||||||||||||||||
| 1198 | 0 | ▶ | if ( $attributesetQueueAttributesRequest->isSetValue() ) { | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 1199 | 0 | $parameters->{ 'Attribute.' . ( $attributesetQueueAttributesRequestIndex + 1 ) . '.Value' } | |||||||||||||||||||||||||||||||
| 1200 | = $attributesetQueueAttributesRequest->getValue(); | ||||||||||||||||||||||||||||||||
| 1201 | } | ||||||||||||||||||||||||||||||||
| 1202 | |||||||||||||||||||||||||||||||||
| 1203 | } | ||||||||||||||||||||||||||||||||
| 1204 | |||||||||||||||||||||||||||||||||
| 1205 | 0 | return $parameters; | |||||||||||||||||||||||||||||||
| 1206 | } | ||||||||||||||||||||||||||||||||
| 1207 | |||||||||||||||||||||||||||||||||
| 1208 | # | ||||||||||||||||||||||||||||||||
| 1209 | # Convert AddPermissionRequest to name value pairs | ||||||||||||||||||||||||||||||||
| 1210 | # | ||||||||||||||||||||||||||||||||
| 1211 | 0 | ▶ | sub _convertAddPermission() { | ||||||||||||||||||||||||||||||
|
Subroutine
_convertAddPermission: not called CC=5 SCAR=34.0
| |||||||||||||||||||||||||||||||||
| 1212 | 0 | my ( $self, $request ) = @_; | |||||||||||||||||||||||||||||||
| 1213 | |||||||||||||||||||||||||||||||||
| 1214 | 0 | my $parameters = {}; | |||||||||||||||||||||||||||||||
| 1215 | 0 | $parameters->{Action} = 'AddPermission'; | |||||||||||||||||||||||||||||||
| 1216 | |||||||||||||||||||||||||||||||||
| 1217 | 0 | ▶ | if ( $request->isSetQueueUrl() ) { | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 1218 | 0 | $parameters->{QueueUrl} = $request->getQueueUrl(); | |||||||||||||||||||||||||||||||
| 1219 | } | ||||||||||||||||||||||||||||||||
| 1220 | |||||||||||||||||||||||||||||||||
| 1221 | 0 | ▶ | if ( $request->isSetLabel() ) { | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 1222 | 0 | $parameters->{Label} = $request->getLabel(); | |||||||||||||||||||||||||||||||
| 1223 | } | ||||||||||||||||||||||||||||||||
| 1224 | |||||||||||||||||||||||||||||||||
| 1225 | 0 | my $AWSAccountIdaddPermissionRequestList = $request->getAWSAccountId(); | |||||||||||||||||||||||||||||||
| 1226 | |||||||||||||||||||||||||||||||||
| 1227 | 0 | for my $AWSAccountIdaddPermissionRequestIndex ( 0 .. $#{$AWSAccountIdaddPermissionRequestList} ) { | |||||||||||||||||||||||||||||||
| 1228 | 0 | my $AWSAccountIdaddPermissionRequest | |||||||||||||||||||||||||||||||
| 1229 | = $AWSAccountIdaddPermissionRequestList->[$AWSAccountIdaddPermissionRequestIndex]; | ||||||||||||||||||||||||||||||||
| 1230 | 0 | $parameters->{ 'AWSAccountId.' . ( $AWSAccountIdaddPermissionRequestIndex + 1 ) } | |||||||||||||||||||||||||||||||
| 1231 | = $AWSAccountIdaddPermissionRequest; | ||||||||||||||||||||||||||||||||
| 1232 | } | ||||||||||||||||||||||||||||||||
| 1233 | |||||||||||||||||||||||||||||||||
| 1234 | 0 | my $actionNameaddPermissionRequestList = $request->getActionName(); | |||||||||||||||||||||||||||||||
| 1235 | |||||||||||||||||||||||||||||||||
| 1236 | 0 | for my $actionNameaddPermissionRequestIndex ( 0 .. $#{$actionNameaddPermissionRequestList} ) { | |||||||||||||||||||||||||||||||
| 1237 | 0 | my $actionNameaddPermissionRequest | |||||||||||||||||||||||||||||||
| 1238 | = $actionNameaddPermissionRequestList->[$actionNameaddPermissionRequestIndex]; | ||||||||||||||||||||||||||||||||
| 1239 | 0 | $parameters->{ 'ActionName.' . ( $actionNameaddPermissionRequestIndex + 1 ) } | |||||||||||||||||||||||||||||||
| 1240 | = $actionNameaddPermissionRequest; | ||||||||||||||||||||||||||||||||
| 1241 | } | ||||||||||||||||||||||||||||||||
| 1242 | |||||||||||||||||||||||||||||||||
| 1243 | 0 | return $parameters; | |||||||||||||||||||||||||||||||
| 1244 | } | ||||||||||||||||||||||||||||||||
| 1245 | |||||||||||||||||||||||||||||||||
| 1246 | # | ||||||||||||||||||||||||||||||||
| 1247 | # Convert RemovePermissionRequest to name value pairs | ||||||||||||||||||||||||||||||||
| 1248 | # | ||||||||||||||||||||||||||||||||
| 1249 | 0 | ▶ | sub _convertRemovePermission() { | ||||||||||||||||||||||||||||||
|
Subroutine
_convertRemovePermission: not called CC=3 SCAR=24.8
| |||||||||||||||||||||||||||||||||
| 1250 | 0 | my ( $self, $request ) = @_; | |||||||||||||||||||||||||||||||
| 1251 | |||||||||||||||||||||||||||||||||
| 1252 | 0 | my $parameters = {}; | |||||||||||||||||||||||||||||||
| 1253 | 0 | $parameters->{Action} = 'RemovePermission'; | |||||||||||||||||||||||||||||||
| 1254 | 0 | ▶ | if ( $request->isSetQueueUrl() ) { | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 1255 | 0 | $parameters->{QueueUrl} = $request->getQueueUrl(); | |||||||||||||||||||||||||||||||
| 1256 | } | ||||||||||||||||||||||||||||||||
| 1257 | 0 | ▶ | if ( $request->isSetLabel() ) { | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 1258 | 0 | $parameters->{Label} = $request->getLabel(); | |||||||||||||||||||||||||||||||
| 1259 | } | ||||||||||||||||||||||||||||||||
| 1260 | |||||||||||||||||||||||||||||||||
| 1261 | 0 | return $parameters; | |||||||||||||||||||||||||||||||
| 1262 | } | ||||||||||||||||||||||||||||||||
| 1263 | |||||||||||||||||||||||||||||||||
| 1264 | 3 | 1; | |||||||||||||||||||||||||||||||
| 1265 | |||||||||||||||||||||||||||||||||
| 1266 | ## no critic (RequirePodSections) | ||||||||||||||||||||||||||||||||
| 1267 | |||||||||||||||||||||||||||||||||
| 1268 | __END__ | ||||||||||||||||||||||||||||||||