@@ -214,45 +214,33 @@ public function setWebIdentityToken(?string $value): self
214214 return $ this ;
215215 }
216216
217- public function validate (): void
218- {
219- if (null === $ this ->RoleArn ) {
220- throw new InvalidArgument (sprintf ('Missing parameter "RoleArn" when validating the "%s". The value cannot be null. ' , __CLASS__ ));
221- }
222-
223- if (null === $ this ->RoleSessionName ) {
224- throw new InvalidArgument (sprintf ('Missing parameter "RoleSessionName" when validating the "%s". The value cannot be null. ' , __CLASS__ ));
225- }
226-
227- if (null === $ this ->WebIdentityToken ) {
228- throw new InvalidArgument (sprintf ('Missing parameter "WebIdentityToken" when validating the "%s". The value cannot be null. ' , __CLASS__ ));
229- }
230-
231- foreach ($ this ->PolicyArns as $ item ) {
232- $ item ->validate ();
233- }
234- }
235-
236217 /**
237218 * @internal
238219 */
239220 private function requestBody (): array
240221 {
241222 $ payload = [];
242- $ payload ['RoleArn ' ] = $ this ->RoleArn ;
243- $ payload ['RoleSessionName ' ] = $ this ->RoleSessionName ;
244- $ payload ['WebIdentityToken ' ] = $ this ->WebIdentityToken ;
223+ if (null === $ v = $ this ->RoleArn ) {
224+ throw new InvalidArgument (sprintf ('Missing parameter "RoleArn" for "%s". The value cannot be null. ' , __CLASS__ ));
225+ }
226+ $ payload ['RoleArn ' ] = $ v ;
227+ if (null === $ v = $ this ->RoleSessionName ) {
228+ throw new InvalidArgument (sprintf ('Missing parameter "RoleSessionName" for "%s". The value cannot be null. ' , __CLASS__ ));
229+ }
230+ $ payload ['RoleSessionName ' ] = $ v ;
231+ if (null === $ v = $ this ->WebIdentityToken ) {
232+ throw new InvalidArgument (sprintf ('Missing parameter "WebIdentityToken" for "%s". The value cannot be null. ' , __CLASS__ ));
233+ }
234+ $ payload ['WebIdentityToken ' ] = $ v ;
245235 if (null !== $ v = $ this ->ProviderId ) {
246236 $ payload ['ProviderId ' ] = $ v ;
247237 }
248238
249239 $ index = 0 ;
250240 foreach ($ this ->PolicyArns as $ mapValue ) {
251241 ++$ index ;
252- if (null !== $ v = $ mapValue ) {
253- foreach ($ v ->requestBody () as $ bodyKey => $ bodyValue ) {
254- $ payload ["PolicyArns.member. {$ index }. $ bodyKey " ] = $ bodyValue ;
255- }
242+ foreach ($ mapValue ->requestBody () as $ bodyKey => $ bodyValue ) {
243+ $ payload ["PolicyArns.member. {$ index }. $ bodyKey " ] = $ bodyValue ;
256244 }
257245 }
258246
0 commit comments