@@ -17,6 +17,7 @@ import (
1717 "errors"
1818 "fmt"
1919 "path/filepath"
20+ "strings"
2021
2122 "github.com/go-git/go-git/v5"
2223
@@ -111,7 +112,7 @@ func (h *Helper) API(serviceModelName string) (*model.SDKAPI, error) {
111112 sdkapi := model .NewSDKAPI (api , h .APIGroupSuffix )
112113
113114 h .InjectCustomShapes (sdkapi )
114-
115+
115116 return sdkapi , nil
116117 }
117118 return nil , ErrServiceNotFound
@@ -129,3 +130,25 @@ func (h *Helper) ModelAndDocsPath(serviceModelName string) string {
129130 )
130131 return modelPath
131132}
133+
134+ // GetOriginalAPIShapeSet returns a map set (keys with empty struct values) of all original shape names
135+ // from the AWS service API model. This provides efficient lookups to check if a shape name exists.
136+ func (h * Helper ) GetOriginalAPIShapeSet (serviceNameOrID string ) (map [string ]struct {}, error ) {
137+ modelPath := h .ModelAndDocsPath (serviceNameOrID )
138+ apis , err := apiv2 .LoadAPI (modelPath )
139+ if err != nil {
140+ return nil , err
141+ }
142+
143+ for _ , api := range apis {
144+ _ = api .ServicePackageDoc ()
145+ shapeSet := make (map [string ]struct {}, len (api .Shapes ))
146+ for shapeName := range api .Shapes {
147+ shapeSet [shapeName ] = struct {}{}
148+ shapeSet [strings .ToLower (shapeName )] = struct {}{}
149+ }
150+ return shapeSet , nil
151+ }
152+
153+ return nil , ErrServiceNotFound
154+ }
0 commit comments