func goType(s *Shape, withPkgName bool) string {
	switch s.Type {
	case "structure":
		if withPkgName {
			return fmt.Sprintf("*%s.%s", s.API.PackageName(), s.ShapeName)
		}
		return "*" + s.ShapeName
	case "map":
		return "map[string]" + s.ValueRef.GoType()
	case "list":
		return "[]" + s.MemberRef.GoType()
	case "boolean":
		return "*bool"
	case "string", "character":
		return "*string"
	case "blob":
		return "[]byte"
	case "integer", "long":
		return "*int64"
	case "float", "double":
		return "*float64"
	case "timestamp":
		s.API.imports["time"] = true
		return "*time.Time"
	default:
		panic("Unsupported shape type: " + s.Type)
	}
}
Returns a string version of the Shape's type.
If withPkgName is true, the package name will be added as a prefix
package api
import (
	"fmt"
	"sort"
	"strings"
	"github.com/ks3sdklib/aws-sdk-go/internal/util"
)
type ShapeRef struct {
	API           *API   `json:"-"`
	Shape         *Shape `json:"-"`
	Documentation string
	ShapeName     string `json:"shape"`
	Location      string
	LocationName  string
	QueryName     string
	Flattened     bool
	Streaming     bool
	XMLAttribute  bool
	XMLNamespace  XMLInfo
	Payload       string
}
type XMLInfo struct {
	Prefix string
	URI    string
}
type Shape struct {
	API           *API `json:"-"`
	ShapeName     string
	Documentation string
	MemberRefs    map[string]*ShapeRef `json:"members"`
	MemberRef     ShapeRef             `json:"member"`
	KeyRef        ShapeRef             `json:"key"`
	ValueRef      ShapeRef             `json:"value"`
	Required      []string
	Payload       string
	Type          string
	Exception     bool
	Enum          []string
	Flattened     bool
	Streaming     bool
	Location      string
	LocationName  string
	XMLNamespace  XMLInfo
	refs []*ShapeRef  
}
func (s *Shape) Rename(newName string) {
	for _, r := range s.refs {
		r.ShapeName = newName
	}
	delete(s.API.Shapes, s.ShapeName)
	s.API.Shapes[newName] = s
	s.ShapeName = newName
}
func (s *Shape) MemberNames() []string {
	i, names := 0, make([]string, len(s.MemberRefs))
	for n := range s.MemberRefs {
		names[i] = n
		i++
	}
	sort.Strings(names)
	return names
}
func (s *Shape) GoTypeWithPkgName() string {
	return goType(s, true)
}
func (s *Shape) GoType() string {
	return goType(s, false)
}
func (ref *ShapeRef) GoType() string {
	if ref.Shape == nil {
		panic(fmt.Errorf("missing shape definition on reference for %#v", ref))
	}
	return ref.Shape.GoType()
}
func (ref *ShapeRef) GoTypeWithPkgName() string {
	if ref.Shape == nil {
		panic(fmt.Errorf("missing shape definition on reference for %#v", ref))
	}
	return ref.Shape.GoTypeWithPkgName()
}