Skip to content

Commit 5e38f23

Browse files
authored
chore: remove variables from xml serializeCollection (#1172)
1 parent 553642b commit 5e38f23

File tree

6 files changed

+213
-356
lines changed

6 files changed

+213
-356
lines changed

clients/client-cloudfront/protocols/Aws_restXml.ts

Lines changed: 69 additions & 115 deletions
Original file line numberDiff line numberDiff line change
@@ -9294,12 +9294,10 @@ const serializeAws_restXmlAliasList = (
92949294
input: string[],
92959295
context: __SerdeContext
92969296
): any => {
9297-
const collectedNodes: any = [];
9298-
for (let entry of input) {
9297+
return input.map(entry => {
92999298
const node = new __XmlNode("string").addChildNode(new __XmlText(entry));
9300-
collectedNodes.push(node.withName("CNAME"));
9301-
}
9302-
return collectedNodes;
9299+
return node.withName("CNAME");
9300+
});
93039301
};
93049302

93059303
const serializeAws_restXmlAliases = (
@@ -9357,12 +9355,10 @@ const serializeAws_restXmlAwsAccountNumberList = (
93579355
input: string[],
93589356
context: __SerdeContext
93599357
): any => {
9360-
const collectedNodes: any = [];
9361-
for (let entry of input) {
9358+
return input.map(entry => {
93629359
const node = new __XmlNode("string").addChildNode(new __XmlText(entry));
9363-
collectedNodes.push(node.withName("AwsAccountNumber"));
9364-
}
9365-
return collectedNodes;
9360+
return node.withName("AwsAccountNumber");
9361+
});
93669362
};
93679363

93689364
const serializeAws_restXmlCacheBehavior = (
@@ -9459,12 +9455,10 @@ const serializeAws_restXmlCacheBehaviorList = (
94599455
input: CacheBehavior[],
94609456
context: __SerdeContext
94619457
): any => {
9462-
const collectedNodes: any = [];
9463-
for (let entry of input) {
9458+
return input.map(entry => {
94649459
const node = serializeAws_restXmlCacheBehavior(entry, context);
9465-
collectedNodes.push(node.withName("CacheBehavior"));
9466-
}
9467-
return collectedNodes;
9460+
return node.withName("CacheBehavior");
9461+
});
94689462
};
94699463

94709464
const serializeAws_restXmlCacheBehaviors = (
@@ -9584,12 +9578,10 @@ const serializeAws_restXmlContentTypeProfileList = (
95849578
input: ContentTypeProfile[],
95859579
context: __SerdeContext
95869580
): any => {
9587-
const collectedNodes: any = [];
9588-
for (let entry of input) {
9581+
return input.map(entry => {
95899582
const node = serializeAws_restXmlContentTypeProfile(entry, context);
9590-
collectedNodes.push(node.withName("ContentTypeProfile"));
9591-
}
9592-
return collectedNodes;
9583+
return node.withName("ContentTypeProfile");
9584+
});
95939585
};
95949586

95959587
const serializeAws_restXmlContentTypeProfiles = (
@@ -9621,12 +9613,10 @@ const serializeAws_restXmlCookieNameList = (
96219613
input: string[],
96229614
context: __SerdeContext
96239615
): any => {
9624-
const collectedNodes: any = [];
9625-
for (let entry of input) {
9616+
return input.map(entry => {
96269617
const node = new __XmlNode("string").addChildNode(new __XmlText(entry));
9627-
collectedNodes.push(node.withName("Name"));
9628-
}
9629-
return collectedNodes;
9618+
return node.withName("Name");
9619+
});
96309620
};
96319621

96329622
const serializeAws_restXmlCookieNames = (
@@ -9708,12 +9698,10 @@ const serializeAws_restXmlCustomErrorResponseList = (
97089698
input: CustomErrorResponse[],
97099699
context: __SerdeContext
97109700
): any => {
9711-
const collectedNodes: any = [];
9712-
for (let entry of input) {
9701+
return input.map(entry => {
97139702
const node = serializeAws_restXmlCustomErrorResponse(entry, context);
9714-
collectedNodes.push(node.withName("CustomErrorResponse"));
9715-
}
9716-
return collectedNodes;
9703+
return node.withName("CustomErrorResponse");
9704+
});
97179705
};
97189706

97199707
const serializeAws_restXmlCustomErrorResponses = (
@@ -10087,12 +10075,10 @@ const serializeAws_restXmlEncryptionEntityList = (
1008710075
input: EncryptionEntity[],
1008810076
context: __SerdeContext
1008910077
): any => {
10090-
const collectedNodes: any = [];
10091-
for (let entry of input) {
10078+
return input.map(entry => {
1009210079
const node = serializeAws_restXmlEncryptionEntity(entry, context);
10093-
collectedNodes.push(node.withName("EncryptionEntity"));
10094-
}
10095-
return collectedNodes;
10080+
return node.withName("EncryptionEntity");
10081+
});
1009610082
};
1009710083

1009810084
const serializeAws_restXmlFieldLevelEncryptionConfig = (
@@ -10166,12 +10152,10 @@ const serializeAws_restXmlFieldPatternList = (
1016610152
input: string[],
1016710153
context: __SerdeContext
1016810154
): any => {
10169-
const collectedNodes: any = [];
10170-
for (let entry of input) {
10155+
return input.map(entry => {
1017110156
const node = new __XmlNode("string").addChildNode(new __XmlText(entry));
10172-
collectedNodes.push(node.withName("FieldPattern"));
10173-
}
10174-
return collectedNodes;
10157+
return node.withName("FieldPattern");
10158+
});
1017510159
};
1017610160

1017710161
const serializeAws_restXmlFieldPatterns = (
@@ -10262,12 +10246,10 @@ const serializeAws_restXmlHeaderList = (
1026210246
input: string[],
1026310247
context: __SerdeContext
1026410248
): any => {
10265-
const collectedNodes: any = [];
10266-
for (let entry of input) {
10249+
return input.map(entry => {
1026710250
const node = new __XmlNode("string").addChildNode(new __XmlText(entry));
10268-
collectedNodes.push(node.withName("Name"));
10269-
}
10270-
return collectedNodes;
10251+
return node.withName("Name");
10252+
});
1027110253
};
1027210254

1027310255
const serializeAws_restXmlHeaders = (
@@ -10342,12 +10324,10 @@ const serializeAws_restXmlLambdaFunctionAssociationList = (
1034210324
input: LambdaFunctionAssociation[],
1034310325
context: __SerdeContext
1034410326
): any => {
10345-
const collectedNodes: any = [];
10346-
for (let entry of input) {
10327+
return input.map(entry => {
1034710328
const node = serializeAws_restXmlLambdaFunctionAssociation(entry, context);
10348-
collectedNodes.push(node.withName("LambdaFunctionAssociation"));
10349-
}
10350-
return collectedNodes;
10329+
return node.withName("LambdaFunctionAssociation");
10330+
});
1035110331
};
1035210332

1035310333
const serializeAws_restXmlLambdaFunctionAssociations = (
@@ -10379,12 +10359,10 @@ const serializeAws_restXmlLocationList = (
1037910359
input: string[],
1038010360
context: __SerdeContext
1038110361
): any => {
10382-
const collectedNodes: any = [];
10383-
for (let entry of input) {
10362+
return input.map(entry => {
1038410363
const node = new __XmlNode("string").addChildNode(new __XmlText(entry));
10385-
collectedNodes.push(node.withName("Location"));
10386-
}
10387-
return collectedNodes;
10364+
return node.withName("Location");
10365+
});
1038810366
};
1038910367

1039010368
const serializeAws_restXmlLoggingConfig = (
@@ -10423,12 +10401,10 @@ const serializeAws_restXmlMethodsList = (
1042310401
input: (Method | string)[],
1042410402
context: __SerdeContext
1042510403
): any => {
10426-
const collectedNodes: any = [];
10427-
for (let entry of input) {
10404+
return input.map(entry => {
1042810405
const node = new __XmlNode("Method").addChildNode(new __XmlText(entry));
10429-
collectedNodes.push(node.withName("Method"));
10430-
}
10431-
return collectedNodes;
10406+
return node.withName("Method");
10407+
});
1043210408
};
1043310409

1043410410
const serializeAws_restXmlOrigin = (
@@ -10502,12 +10478,10 @@ const serializeAws_restXmlOriginCustomHeadersList = (
1050210478
input: OriginCustomHeader[],
1050310479
context: __SerdeContext
1050410480
): any => {
10505-
const collectedNodes: any = [];
10506-
for (let entry of input) {
10481+
return input.map(entry => {
1050710482
const node = serializeAws_restXmlOriginCustomHeader(entry, context);
10508-
collectedNodes.push(node.withName("OriginCustomHeader"));
10509-
}
10510-
return collectedNodes;
10483+
return node.withName("OriginCustomHeader");
10484+
});
1051110485
};
1051210486

1051310487
const serializeAws_restXmlOriginGroup = (
@@ -10557,12 +10531,10 @@ const serializeAws_restXmlOriginGroupList = (
1055710531
input: OriginGroup[],
1055810532
context: __SerdeContext
1055910533
): any => {
10560-
const collectedNodes: any = [];
10561-
for (let entry of input) {
10534+
return input.map(entry => {
1056210535
const node = serializeAws_restXmlOriginGroup(entry, context);
10563-
collectedNodes.push(node.withName("OriginGroup"));
10564-
}
10565-
return collectedNodes;
10536+
return node.withName("OriginGroup");
10537+
});
1056610538
};
1056710539

1056810540
const serializeAws_restXmlOriginGroupMember = (
@@ -10583,12 +10555,10 @@ const serializeAws_restXmlOriginGroupMemberList = (
1058310555
input: OriginGroupMember[],
1058410556
context: __SerdeContext
1058510557
): any => {
10586-
const collectedNodes: any = [];
10587-
for (let entry of input) {
10558+
return input.map(entry => {
1058810559
const node = serializeAws_restXmlOriginGroupMember(entry, context);
10589-
collectedNodes.push(node.withName("OriginGroupMember"));
10590-
}
10591-
return collectedNodes;
10560+
return node.withName("OriginGroupMember");
10561+
});
1059210562
};
1059310563

1059410564
const serializeAws_restXmlOriginGroupMembers = (
@@ -10642,12 +10612,10 @@ const serializeAws_restXmlOriginList = (
1064210612
input: Origin[],
1064310613
context: __SerdeContext
1064410614
): any => {
10645-
const collectedNodes: any = [];
10646-
for (let entry of input) {
10615+
return input.map(entry => {
1064710616
const node = serializeAws_restXmlOrigin(entry, context);
10648-
collectedNodes.push(node.withName("Origin"));
10649-
}
10650-
return collectedNodes;
10617+
return node.withName("Origin");
10618+
});
1065110619
};
1065210620

1065310621
const serializeAws_restXmlOriginSslProtocols = (
@@ -10698,12 +10666,10 @@ const serializeAws_restXmlPathList = (
1069810666
input: string[],
1069910667
context: __SerdeContext
1070010668
): any => {
10701-
const collectedNodes: any = [];
10702-
for (let entry of input) {
10669+
return input.map(entry => {
1070310670
const node = new __XmlNode("string").addChildNode(new __XmlText(entry));
10704-
collectedNodes.push(node.withName("Path"));
10705-
}
10706-
return collectedNodes;
10671+
return node.withName("Path");
10672+
});
1070710673
};
1070810674

1070910675
const serializeAws_restXmlPaths = (
@@ -10807,12 +10773,10 @@ const serializeAws_restXmlQueryArgProfileList = (
1080710773
input: QueryArgProfile[],
1080810774
context: __SerdeContext
1080910775
): any => {
10810-
const collectedNodes: any = [];
10811-
for (let entry of input) {
10776+
return input.map(entry => {
1081210777
const node = serializeAws_restXmlQueryArgProfile(entry, context);
10813-
collectedNodes.push(node.withName("QueryArgProfile"));
10814-
}
10815-
return collectedNodes;
10778+
return node.withName("QueryArgProfile");
10779+
});
1081610780
};
1081710781

1081810782
const serializeAws_restXmlQueryArgProfiles = (
@@ -10866,12 +10830,10 @@ const serializeAws_restXmlQueryStringCacheKeysList = (
1086610830
input: string[],
1086710831
context: __SerdeContext
1086810832
): any => {
10869-
const collectedNodes: any = [];
10870-
for (let entry of input) {
10833+
return input.map(entry => {
1087110834
const node = new __XmlNode("string").addChildNode(new __XmlText(entry));
10872-
collectedNodes.push(node.withName("Name"));
10873-
}
10874-
return collectedNodes;
10835+
return node.withName("Name");
10836+
});
1087510837
};
1087610838

1087710839
const serializeAws_restXmlRestrictions = (
@@ -10927,28 +10889,24 @@ const serializeAws_restXmlSslProtocolsList = (
1092710889
input: (SslProtocol | string)[],
1092810890
context: __SerdeContext
1092910891
): any => {
10930-
const collectedNodes: any = [];
10931-
for (let entry of input) {
10892+
return input.map(entry => {
1093210893
const node = new __XmlNode("SslProtocol").addChildNode(
1093310894
new __XmlText(entry)
1093410895
);
10935-
collectedNodes.push(node.withName("SslProtocol"));
10936-
}
10937-
return collectedNodes;
10896+
return node.withName("SslProtocol");
10897+
});
1093810898
};
1093910899

1094010900
const serializeAws_restXmlStatusCodeList = (
1094110901
input: number[],
1094210902
context: __SerdeContext
1094310903
): any => {
10944-
const collectedNodes: any = [];
10945-
for (let entry of input) {
10904+
return input.map(entry => {
1094610905
const node = new __XmlNode("integer").addChildNode(
1094710906
new __XmlText(String(entry))
1094810907
);
10949-
collectedNodes.push(node.withName("StatusCode"));
10950-
}
10951-
return collectedNodes;
10908+
return node.withName("StatusCode");
10909+
});
1095210910
};
1095310911

1095410912
const serializeAws_restXmlStatusCodes = (
@@ -11097,12 +11055,10 @@ const serializeAws_restXmlTagKeyList = (
1109711055
input: string[],
1109811056
context: __SerdeContext
1109911057
): any => {
11100-
const collectedNodes: any = [];
11101-
for (let entry of input) {
11058+
return input.map(entry => {
1110211059
const node = new __XmlNode("TagKey").addChildNode(new __XmlText(entry));
11103-
collectedNodes.push(node.withName("Key"));
11104-
}
11105-
return collectedNodes;
11060+
return node.withName("Key");
11061+
});
1110611062
};
1110711063

1110811064
const serializeAws_restXmlTagKeys = (
@@ -11125,12 +11081,10 @@ const serializeAws_restXmlTagList = (
1112511081
input: Tag[],
1112611082
context: __SerdeContext
1112711083
): any => {
11128-
const collectedNodes: any = [];
11129-
for (let entry of input) {
11084+
return input.map(entry => {
1113011085
const node = serializeAws_restXmlTag(entry, context);
11131-
collectedNodes.push(node.withName("Tag"));
11132-
}
11133-
return collectedNodes;
11086+
return node.withName("Tag");
11087+
});
1113411088
};
1113511089

1113611090
const serializeAws_restXmlTags = (

0 commit comments

Comments
 (0)