@@ -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 )
@@ -1394,17 +1417,22 @@ func setSDKForMap(
1394
1417
if targetShape .ValueRef .Shape .Type == "structure" {
1395
1418
containerFieldName = targetFieldName
1396
1419
}
1397
- out += setSDKForContainer (
1398
- cfg , r ,
1399
- containerFieldName ,
1400
- valVarName ,
1401
- sourceFieldPath ,
1402
- valIterVarName ,
1403
- & targetShape .ValueRef ,
1404
- false ,
1405
- op ,
1406
- indentLevel + 1 ,
1407
- )
1420
+ if targetShape .ValueRef .Shape .IsEnum () {
1421
+ out += fmt .Sprintf ("%s\t %s = string(*%s)\n " , indent , valVarName , valIterVarName )
1422
+ valVarName = fmt .Sprintf ("svcsdktypes.%s(%s)" , targetShape .ValueRef .ShapeName , valVarName )
1423
+ } else {
1424
+ out += setSDKForContainer (
1425
+ cfg , r ,
1426
+ containerFieldName ,
1427
+ valVarName ,
1428
+ sourceFieldPath ,
1429
+ valIterVarName ,
1430
+ & targetShape .ValueRef ,
1431
+ true ,
1432
+ op ,
1433
+ indentLevel + 1 ,
1434
+ )
1435
+ }
1408
1436
1409
1437
dereference := "*"
1410
1438
if ! targetShapeRef .HasDefaultValue () && targetShape .ValueRef .Shape .Type != "structure" {
@@ -1458,6 +1486,9 @@ func varEmptyConstructorSDKType(
1458
1486
if goType == "map[string][]*string" || goType == "map[string][]*int32" || goType == "map[string][]*int64" {
1459
1487
goType = "map[string][]" + strings .TrimPrefix (goType , "map[string][]*" )
1460
1488
}
1489
+ if shape .ValueRef .Shape .IsEnum () {
1490
+ goType = fmt .Sprintf ("map[string]svcsdktypes.%s" , shape .ValueRef .ShapeName )
1491
+ }
1461
1492
out += fmt .Sprintf ("%s%s := %s{}\n " , indent , varName , goType )
1462
1493
1463
1494
default :
@@ -1636,8 +1667,9 @@ func setSDKAdaptiveResourceCollection(
1636
1667
out += fmt .Sprintf ("%s\t %s.%s = aws.ToInt64Slice(%s)\n " , indent , targetVarName , memberName , sourceAdaptedVarName )
1637
1668
1638
1669
}
1639
- } else if shape .Type == "map" &&
1670
+ } else if shape .Type == "map" &&
1640
1671
shape .KeyRef .Shape .Type == "string" &&
1672
+ ! shape .ValueRef .Shape .IsEnum () &&
1641
1673
isPrimitiveType (shape .ValueRef .Shape .Type ) {
1642
1674
mapType := resolveAWSMapValueType (shape .ValueRef .Shape .Type )
1643
1675
out += fmt .Sprintf ("%s\t %s.%s = aws.To%sMap(%s)\n " , indent , targetVarName , memberName , mapType , sourceAdaptedVarName )
@@ -1774,4 +1806,4 @@ func setSDKForUnion(
1774
1806
}
1775
1807
1776
1808
return out
1777
- }
1809
+ }
0 commit comments