func()

in generate/property.go [222:270]


func (p Property) GoType(typename string, basename string, name string) string {

	if p.ItemType == "Tag" {
		return "[]tags.Tag"
	}

	if p.Type == "Map" && p.ItemType == "List" && p.PrimitiveItemType == "String" {
		// WORKAROUND: On 2021-04-24, AWS::SSM::Association published a property
		// called 'Parameters' which has Type: Map, and ItemType: List, with no PrimitiveItemType.
		// This workaround assumes that it should be a map, containing a list of strings.
		// See also line 158.
		return "map[string][]string"
	}

	if p.IsPolymorphic() {

		generatePolymorphicProperty(typename, basename+"_"+name, p)
		return basename + "_" + name

	}

	if p.IsMap() {

		if p.convertTypeToGo() != "" {
			return "map[string]" + p.convertTypeToGo()
		}

		return "map[string]" + basename + "_" + p.ItemType

	}

	if p.IsList() {

		if p.convertTypeToGo() != "" {
			return "[]" + p.convertTypeToGo()
		}

		return "[]" + basename + "_" + p.ItemType

	}

	if p.IsCustomType() {
		return basename + "_" + p.Type
	}

	// Must be a primitive value
	return convertTypeToGo(p.PrimitiveType)

}