Skip to content

Commit c00c657

Browse files
committed
rename config.IsMarkerShape to config.HasShapeAsMarker
1 parent ec4cbc2 commit c00c657

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

pkg/config/config.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -153,9 +153,9 @@ func (c *Config) GetCustomMapFieldMembers() []string {
153153
return members
154154
}
155155

156-
// IsMarkerShape returns true if a given shape name is a marker shape,
156+
// HasShapeAsMarker returns true if the given shape is setup as marker_shape in config,
157157
// otherwise returns false
158-
func (c *Config) IsMarkerShape(shapeName string) bool {
158+
func (c *Config) HasShapeAsMarker(shapeName string) bool {
159159
for _, markerShape := range c.MarkerShapes {
160160
if markerShape == shapeName {
161161
return true

pkg/generate/code/set_sdk.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1388,7 +1388,7 @@ func varEmptyConstructorK8sType(
13881388

13891389
switch shape.Type {
13901390
case "structure":
1391-
if r.Config().IsMarkerShape(shape.ShapeName) {
1391+
if r.Config().HasShapeAsMarker(shape.ShapeName) {
13921392
// f0 := []byte{}
13931393
out += fmt.Sprintf("%s%s := []byte{}\n", indent, varName)
13941394
} else {

pkg/model/model.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -396,8 +396,8 @@ func (m *Model) IsShapeUsedInCRDs(shapeName string) bool {
396396
return false
397397
}
398398

399-
// IsMarkerShape return true if the supplied shape name is a marker shape
400-
func (m *Model) IsMarkerShape(shapeName string) bool {
399+
// HasShapeAsMarker return true if the supplied shape name is a marker shape
400+
func (m *Model) HasShapeAsMarker(shapeName string) bool {
401401
return slices.Contains(m.cfg.MarkerShapes, shapeName)
402402
}
403403

@@ -478,7 +478,7 @@ func (m *Model) getShapeCleanGoType(shape *awssdkmodel.Shape) string {
478478
return "*metav1.Time"
479479
case "structure":
480480
if len(shape.MemberRefs) == 0 {
481-
if m.cfg.IsMarkerShape(shape.ShapeName) {
481+
if m.cfg.HasShapeAsMarker(shape.ShapeName) {
482482
return "[]byte"
483483
}
484484
panic(fmt.Sprintf("structure %s has no fields, either configure it as a `marker_shape` or manually set the field type", shape.ShapeName))

0 commit comments

Comments
 (0)