@@ -17,6 +17,7 @@ import (
17
17
"errors"
18
18
"fmt"
19
19
"path/filepath"
20
+ "strings"
20
21
21
22
"github.com/go-git/go-git/v5"
22
23
@@ -111,7 +112,7 @@ func (h *Helper) API(serviceModelName string) (*model.SDKAPI, error) {
111
112
sdkapi := model .NewSDKAPI (api , h .APIGroupSuffix )
112
113
113
114
h .InjectCustomShapes (sdkapi )
114
-
115
+
115
116
return sdkapi , nil
116
117
}
117
118
return nil , ErrServiceNotFound
@@ -129,3 +130,25 @@ func (h *Helper) ModelAndDocsPath(serviceModelName string) string {
129
130
)
130
131
return modelPath
131
132
}
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