@@ -1374,7 +1374,7 @@ func setSDKForMap(
1374
1374
out += fmt .Sprintf ("%s}\n " , indent )
1375
1375
return out
1376
1376
} else if targetShape .ValueRef .Shape .ValueRef .Shape .Type == "boolean" {
1377
- out += fmt .Sprintf ("%s\t %s[%s] = aws.ToBoolgMap (%s)\n " , indent , targetVarName , keyVarName , valIterVarName )
1377
+ out += fmt .Sprintf ("%s\t %s[%s] = aws.ToBoolMap (%s)\n " , indent , targetVarName , keyVarName , valIterVarName )
1378
1378
out += fmt .Sprintf ("%s}\n " , indent )
1379
1379
return out
1380
1380
}
@@ -1636,15 +1636,40 @@ func setSDKAdaptiveResourceCollection(
1636
1636
out += fmt .Sprintf ("%s\t %s.%s = aws.ToInt64Slice(%s)\n " , indent , targetVarName , memberName , sourceAdaptedVarName )
1637
1637
1638
1638
}
1639
- } else if shape .Type == "map" &&
1639
+ } else if shape .Type == "map" &&
1640
1640
shape .KeyRef .Shape .Type == "string" &&
1641
- shape .ValueRef .Shape .Type == "string" {
1642
- out += fmt .Sprintf ("%s\t %s.%s = aws.ToStringMap(%s)\n " , indent , targetVarName , memberName , sourceAdaptedVarName )
1641
+ isPrimitiveType (shape .ValueRef .Shape .Type ) {
1642
+ mapType := resolveAWSMapValueType (shape .ValueRef .Shape .Type )
1643
+ out += fmt .Sprintf ("%s\t %s.%s = aws.To%sMap(%s)\n " , indent , targetVarName , memberName , mapType , sourceAdaptedVarName )
1643
1644
}
1644
-
1645
1645
return out
1646
1646
}
1647
1647
1648
+ func isPrimitiveType (valueType string ) bool {
1649
+ switch valueType {
1650
+ case "string" , "boolean" , "integer" , "long" , "float" , "double" :
1651
+ return true
1652
+ default :
1653
+ return false
1654
+ }
1655
+ }
1656
+
1657
+ func resolveAWSMapValueType (valueType string ) string {
1658
+ switch valueType {
1659
+ case "string" :
1660
+ return "String"
1661
+ case "boolean" :
1662
+ return "Bool"
1663
+ case "integer" , "long" :
1664
+ return "Int64"
1665
+ case "float" , "double" :
1666
+ return "Float64"
1667
+ default :
1668
+ // For any other type, return String as a safe fallback
1669
+ return "String"
1670
+ }
1671
+ }
1672
+
1648
1673
func setSDKForUnion (
1649
1674
cfg * ackgenconfig.Config ,
1650
1675
r * model.CRD ,
@@ -1749,4 +1774,4 @@ func setSDKForUnion(
1749
1774
}
1750
1775
1751
1776
return out
1752
- }
1777
+ }
0 commit comments