@@ -1289,6 +1289,28 @@ func setSDKForSlice(
1289
1289
if targetShape .MemberRef .Shape .RealType == "union" {
1290
1290
targetShape .MemberRef .Shape .Type = "union"
1291
1291
}
1292
+ if targetShape .MemberRef .Shape .Type == "list" &&
1293
+ targetShape .MemberRef .Shape .MemberRef .Shape .Type == "string" &&
1294
+ ! targetShape .MemberRef .Shape .MemberRef .Shape .IsEnum () {
1295
+ out += fmt .Sprintf ("%s\t %s := aws.ToStringSlice(%s)\n " , indent , elemVarName , iterVarName )
1296
+ out += fmt .Sprintf ("%s\t %s = append(%s, %s)\n " , indent , targetVarName , targetVarName , elemVarName )
1297
+ out += fmt .Sprintf ("%s}\n " , indent )
1298
+ return out
1299
+ } else if targetShape .MemberRef .Shape .Type == "map" &&
1300
+ ! targetShape .MemberRef .Shape .ValueRef .Shape .IsEnum () &&
1301
+ targetShape .MemberRef .Shape .KeyRef .Shape .Type == "string" {
1302
+ if targetShape .MemberRef .Shape .ValueRef .Shape .Type == "string" {
1303
+ out += fmt .Sprintf ("%s\t %s := aws.ToStringMap(%s)\n " , indent , elemVarName , iterVarName )
1304
+ out += fmt .Sprintf ("%s\t %s = append(%s, %s)\n " , indent , targetVarName , targetVarName , elemVarName )
1305
+ out += fmt .Sprintf ("%s}\n " , indent )
1306
+ return out
1307
+ } else if targetShape .ValueRef .Shape .ValueRef .Shape .Type == "boolean" {
1308
+ out += fmt .Sprintf ("%s\t %s := aws.ToBoolMap(%s)\n " , indent , elemVarName , iterVarName )
1309
+ out += fmt .Sprintf ("%s\t %s = append(%s, %s)\n " , indent , targetVarName , targetVarName , elemVarName )
1310
+ out += fmt .Sprintf ("%s}\n " , indent )
1311
+ return out
1312
+ }
1313
+ }
1292
1314
// f0elem := string{}
1293
1315
out += varEmptyConstructorSDKType (
1294
1316
cfg , r ,
@@ -1368,7 +1390,8 @@ func setSDKForMap(
1368
1390
out += fmt .Sprintf ("%s}\n " , indent )
1369
1391
return out
1370
1392
} else if targetShape .ValueRef .Shape .Type == "map" &&
1371
- targetShape .ValueRef .Shape .KeyRef .Shape .Type == "string" {
1393
+ targetShape .ValueRef .Shape .KeyRef .Shape .Type == "string" &&
1394
+ ! targetShape .ValueRef .Shape .ValueRef .Shape .IsEnum () {
1372
1395
if targetShape .ValueRef .Shape .ValueRef .Shape .Type == "string" {
1373
1396
out += fmt .Sprintf ("%s\t %s[%s] = aws.ToStringMap(%s)\n " , indent , targetVarName , keyVarName , valIterVarName )
1374
1397
out += fmt .Sprintf ("%s}\n " , indent )
@@ -1458,9 +1481,15 @@ func varEmptyConstructorSDKType(
1458
1481
if goType == "map[string][]*string" || goType == "map[string][]*int32" || goType == "map[string][]*int64" {
1459
1482
goType = "map[string][]" + strings .TrimPrefix (goType , "map[string][]*" )
1460
1483
}
1484
+ if shape .ValueRef .Shape .IsEnum () {
1485
+ goType = fmt .Sprintf ("map[string]svcsdktypes.%s" , shape .ValueRef .ShapeName )
1486
+ }
1461
1487
out += fmt .Sprintf ("%s%s := %s{}\n " , indent , varName , goType )
1462
1488
1463
1489
default :
1490
+ if shape .IsEnum () {
1491
+ goType = fmt .Sprintf ("svcsdktypes.%s" , shape .ShapeName )
1492
+ }
1464
1493
// var f0 string
1465
1494
out += fmt .Sprintf ("%svar %s %s\n " , indent , varName , goType )
1466
1495
}
@@ -1636,8 +1665,9 @@ func setSDKAdaptiveResourceCollection(
1636
1665
out += fmt .Sprintf ("%s\t %s.%s = aws.ToInt64Slice(%s)\n " , indent , targetVarName , memberName , sourceAdaptedVarName )
1637
1666
1638
1667
}
1639
- } else if shape .Type == "map" &&
1668
+ } else if shape .Type == "map" &&
1640
1669
shape .KeyRef .Shape .Type == "string" &&
1670
+ ! shape .ValueRef .Shape .IsEnum () &&
1641
1671
isPrimitiveType (shape .ValueRef .Shape .Type ) {
1642
1672
mapType := resolveAWSMapValueType (shape .ValueRef .Shape .Type )
1643
1673
out += fmt .Sprintf ("%s\t %s.%s = aws.To%sMap(%s)\n " , indent , targetVarName , memberName , mapType , sourceAdaptedVarName )
@@ -1774,4 +1804,4 @@ func setSDKForUnion(
1774
1804
}
1775
1805
1776
1806
return out
1777
- }
1807
+ }
0 commit comments