@@ -134,7 +134,7 @@ public function getQueueUrl(): ?string
134134 return $ this ->QueueUrl ;
135135 }
136136
137- public function requestBody (): array
137+ public function requestBody (): string
138138 {
139139 $ payload = ['Action ' => 'SendMessage ' , 'Version ' => '2012-11-05 ' ];
140140 $ indices = new \stdClass ();
@@ -145,64 +145,77 @@ public function requestBody(): array
145145 $ payload ['DelaySeconds ' ] = $ v ;
146146 }
147147
148- (static function ($ input ) use (&$ payload , $ indices ) {
148+ (static function (array $ input ) use (&$ payload , $ indices ) {
149149 $ indices ->k2053d0e = 0 ;
150150 foreach ($ input as $ key => $ value ) {
151151 ++$ indices ->k2053d0e ;
152152 $ payload ["MessageAttribute. {$ indices ->k2053d0e }.Name " ] = $ key ;
153- (static function ($ input ) use (&$ payload , $ indices ) {
154- if (null !== $ v = $ input ->getStringValue ()) {
155- $ payload ["MessageAttribute. {$ indices ->k2053d0e }.Value.StringValue " ] = $ v ;
156- }
157- if (null !== $ v = $ input ->getBinaryValue ()) {
158- $ payload ["MessageAttribute. {$ indices ->k2053d0e }.Value.BinaryValue " ] = base64_encode ($ v );
159- }
160- (static function ($ input ) use (&$ payload , $ indices ) {
153+
154+ if (null !== $ value ) {
155+ (static function (MessageAttributeValue $ input ) use (&$ payload , $ indices ) {
156+ if (null !== $ v = $ input ->getStringValue ()) {
157+ $ payload ["MessageAttribute. {$ indices ->k2053d0e }.Value.StringValue " ] = $ v ;
158+ }
159+
160+ if (null !== $ v = $ input ->getBinaryValue ()) {
161+ $ payload ["MessageAttribute. {$ indices ->k2053d0e }.Value.BinaryValue " ] = base64_encode ($ v );
162+ }
163+
164+ (static function (array $ input ) use (&$ payload , $ indices ) {
161165 $ indices ->k782bfa4 = 0 ;
162166 foreach ($ input as $ value ) {
163167 ++$ indices ->k782bfa4 ;
164168 $ payload ["MessageAttribute. {$ indices ->k2053d0e }.Value.StringListValue. {$ indices ->k782bfa4 }" ] = $ value ;
165169 }
166170 })($ input ->getStringListValues ());
167- (static function ($ input ) use (&$ payload , $ indices ) {
168- $ indices ->kc6c9229 = 0 ;
169- foreach ($ input as $ value ) {
170- ++$ indices ->kc6c9229 ;
171- $ payload ["MessageAttribute. {$ indices ->k2053d0e }.Value.BinaryListValue. {$ indices ->kc6c9229 }" ] = base64_encode ($ value );
172- }
173- })($ input ->getBinaryListValues ());
174- $ payload ["MessageAttribute. {$ indices ->k2053d0e }.Value.DataType " ] = $ input ->getDataType ();
175- })($ value );
171+
172+ (static function (array $ input ) use (&$ payload , $ indices ) {
173+ $ indices ->kc6c9229 = 0 ;
174+ foreach ($ input as $ value ) {
175+ ++$ indices ->kc6c9229 ;
176+ $ payload ["MessageAttribute. {$ indices ->k2053d0e }.Value.BinaryListValue. {$ indices ->kc6c9229 }" ] = base64_encode ($ value );
177+ }
178+ })($ input ->getBinaryListValues ());
179+ $ payload ["MessageAttribute. {$ indices ->k2053d0e }.Value.DataType " ] = $ input ->getDataType ();
180+ })($ value );
181+ }
176182 }
177183 })($ this ->MessageAttributes );
178- (static function ($ input ) use (&$ payload , $ indices ) {
184+
185+ (static function (array $ input ) use (&$ payload , $ indices ) {
179186 $ indices ->k6857220 = 0 ;
180187 foreach ($ input as $ key => $ value ) {
181188 ++$ indices ->k6857220 ;
182189 $ payload ["MessageSystemAttribute. {$ indices ->k6857220 }.Name " ] = $ key ;
183- (static function ($ input ) use (&$ payload , $ indices ) {
184- if (null !== $ v = $ input ->getStringValue ()) {
185- $ payload ["MessageSystemAttribute. {$ indices ->k6857220 }.Value.StringValue " ] = $ v ;
186- }
187- if (null !== $ v = $ input ->getBinaryValue ()) {
188- $ payload ["MessageSystemAttribute. {$ indices ->k6857220 }.Value.BinaryValue " ] = base64_encode ($ v );
189- }
190- (static function ($ input ) use (&$ payload , $ indices ) {
190+
191+ if (null !== $ value ) {
192+ (static function (MessageSystemAttributeValue $ input ) use (&$ payload , $ indices ) {
193+ if (null !== $ v = $ input ->getStringValue ()) {
194+ $ payload ["MessageSystemAttribute. {$ indices ->k6857220 }.Value.StringValue " ] = $ v ;
195+ }
196+
197+ if (null !== $ v = $ input ->getBinaryValue ()) {
198+ $ payload ["MessageSystemAttribute. {$ indices ->k6857220 }.Value.BinaryValue " ] = base64_encode ($ v );
199+ }
200+
201+ (static function (array $ input ) use (&$ payload , $ indices ) {
191202 $ indices ->k2d98e9d = 0 ;
192203 foreach ($ input as $ value ) {
193204 ++$ indices ->k2d98e9d ;
194205 $ payload ["MessageSystemAttribute. {$ indices ->k6857220 }.Value.StringListValue. {$ indices ->k2d98e9d }" ] = $ value ;
195206 }
196207 })($ input ->getStringListValues ());
197- (static function ($ input ) use (&$ payload , $ indices ) {
198- $ indices ->k4dcafc5 = 0 ;
199- foreach ($ input as $ value ) {
200- ++$ indices ->k4dcafc5 ;
201- $ payload ["MessageSystemAttribute. {$ indices ->k6857220 }.Value.BinaryListValue. {$ indices ->k4dcafc5 }" ] = base64_encode ($ value );
202- }
203- })($ input ->getBinaryListValues ());
204- $ payload ["MessageSystemAttribute. {$ indices ->k6857220 }.Value.DataType " ] = $ input ->getDataType ();
205- })($ value );
208+
209+ (static function (array $ input ) use (&$ payload , $ indices ) {
210+ $ indices ->k4dcafc5 = 0 ;
211+ foreach ($ input as $ value ) {
212+ ++$ indices ->k4dcafc5 ;
213+ $ payload ["MessageSystemAttribute. {$ indices ->k6857220 }.Value.BinaryListValue. {$ indices ->k4dcafc5 }" ] = base64_encode ($ value );
214+ }
215+ })($ input ->getBinaryListValues ());
216+ $ payload ["MessageSystemAttribute. {$ indices ->k6857220 }.Value.DataType " ] = $ input ->getDataType ();
217+ })($ value );
218+ }
206219 }
207220 })($ this ->MessageSystemAttributes );
208221
@@ -214,12 +227,12 @@ public function requestBody(): array
214227 $ payload ['MessageGroupId ' ] = $ v ;
215228 }
216229
217- return $ payload ;
230+ return http_build_query ( $ payload, '' , ' & ' , \ PHP_QUERY_RFC1738 ) ;
218231 }
219232
220233 public function requestHeaders (): array
221234 {
222- $ headers = [];
235+ $ headers = [' content-type ' => ' application/x-www-form-urlencoded ' ];
223236
224237 return $ headers ;
225238 }
0 commit comments