Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions pkg/config/operation.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ func (c *Config) OperationIsIgnored(operation *awssdkmodel.Operation) bool {
if operation == nil {
return true
}
return util.InStrings(operation.Name, c.Ignore.Operations)
return util.InStrings(operation.ExportedName, c.Ignore.Operations)
}

// UnmarshalJSON parses input for a either a string or
Expand Down Expand Up @@ -88,7 +88,7 @@ func (c *Config) GetOutputWrapperFieldPath(
if c == nil {
return nil
}
opConfig, found := c.Operations[op.Name]
opConfig, found := c.Operations[op.ExportedName]
if !found {
return nil
}
Expand All @@ -111,7 +111,7 @@ func (c *Config) GetSetOutputCustomMethodName(
if c == nil {
return nil
}
opConfig, found := c.Operations[op.Name]
opConfig, found := c.Operations[op.ExportedName]
if !found {
return nil
}
Expand All @@ -132,7 +132,7 @@ func (c *Config) GetCustomImplementation(
return ""
}

operationConfig, found := c.Operations[op.Name]
operationConfig, found := c.Operations[op.ExportedName]
if !found {
return ""
}
Expand All @@ -150,7 +150,7 @@ func (c *Config) GetCustomCheckRequiredFieldsMissingMethod(
return ""
}

operationConfig, found := c.Operations[op.Name]
operationConfig, found := c.Operations[op.ExportedName]
if !found {
return ""
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/config/resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -672,7 +672,7 @@ func (c *Config) GetAllRenames(
opRenameConfigs := resourceConfig.Renames.Operations
for opName, opRenameConfigs := range opRenameConfigs {
for _, op := range operations {
if opName != op.Name {
if opName != op.ExportedName {
continue
}
for old, new := range opRenameConfigs.InputFields {
Expand Down
8 changes: 4 additions & 4 deletions pkg/generate/code/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ func FindIdentifiersInShape(
}

// Handles field renames
opType, _ := model.GetOpTypeAndResourceNameFromOpID(op.Name, r.Config())
opType, _ := model.GetOpTypeAndResourceNameFromOpID(op.ExportedName, r.Config())
renames := r.GetAllRenames(opType)
for _, memberName := range shape.MemberNames() {
lookupName := memberName
Expand Down Expand Up @@ -115,7 +115,7 @@ func FindPluralizedIdentifiersInShape(
// renames, if applicable
siRenamed := r.Config().GetResourceFieldName(
r.Names.Original,
op.Name,
op.ExportedName,
pluralize.Singular(si),
)
if strings.EqualFold(
Expand Down Expand Up @@ -188,14 +188,14 @@ func FindPrimaryIdentifierFieldNames(
}

if crField == "" {
if inSpec, inStat := r.HasMember(shapeField, op.Name); !inSpec && !inStat {
if inSpec, inStat := r.HasMember(shapeField, op.ExportedName); !inSpec && !inStat {
panic("Could not find corresponding spec or status field " +
"for primary identifier " + shapeField)
}
// Fetch field name from config to apply renames, if applicable
crField = cfg.GetResourceFieldName(
r.Names.Original,
op.Name,
op.ExportedName,
shapeField,
)
}
Expand Down
12 changes: 6 additions & 6 deletions pkg/generate/code/set_resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -210,10 +210,10 @@ func SetResource(
// Handles field renames, if applicable
fieldName := cfg.GetResourceFieldName(
r.Names.Original,
op.Name,
op.ExportedName,
memberName,
)
inSpec, inStatus := r.HasMember(fieldName, op.Name)
inSpec, inStatus := r.HasMember(fieldName, op.ExportedName)
if inSpec {
targetAdaptedVarName += cfg.PrefixConfig.SpecField
f = r.SpecFields[fieldName]
Expand Down Expand Up @@ -499,7 +499,7 @@ func setResourceReadMany(
matchFieldNames := r.ListOpMatchFieldNames()

for _, mfName := range matchFieldNames {
if inSpec, inStat := r.HasMember(mfName, op.Name); !inSpec && !inStat {
if inSpec, inStat := r.HasMember(mfName, op.ExportedName); !inSpec && !inStat {
msg := fmt.Sprintf(
"Match field name %s is not in %s Spec or Status fields",
mfName, r.Names.Camel,
Expand Down Expand Up @@ -569,10 +569,10 @@ func setResourceReadMany(
// Handles field renames, if applicable
fieldName := cfg.GetResourceFieldName(
r.Names.Original,
op.Name,
op.ExportedName,
memberName,
)
inSpec, inStatus := r.HasMember(fieldName, op.Name)
inSpec, inStatus := r.HasMember(fieldName, op.ExportedName)
if inSpec {
targetAdaptedVarName += cfg.PrefixConfig.SpecField
f = r.SpecFields[fieldName]
Expand Down Expand Up @@ -1045,7 +1045,7 @@ func SetResourceIdentifiers(
// Handles field renames, if applicable
fieldName := cfg.GetResourceFieldName(
r.Names.Original,
op.Name,
op.ExportedName,
memberName,
)

Expand Down
10 changes: 5 additions & 5 deletions pkg/generate/code/set_sdk.go
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ func SetSDK(
out += fmt.Sprintf("%s%s.SetAttributes(attrMap)\n", indent, targetVarName)
}

opConfig, override := cfg.GetOverrideValues(op.Name)
opConfig, override := cfg.GetOverrideValues(op.ExportedName)
for memberIndex, memberName := range inputShape.MemberNames() {
if r.UnpacksAttributesMap() && memberName == "Attributes" {
continue
Expand Down Expand Up @@ -219,10 +219,10 @@ func SetSDK(
// Handles field renames, if applicable
fieldName := cfg.GetResourceFieldName(
r.Names.Original,
op.Name,
op.ExportedName,
memberName,
)
inSpec, inStatus := r.HasMember(fieldName, op.Name)
inSpec, inStatus := r.HasMember(fieldName, op.ExportedName)
if inSpec {
sourceAdaptedVarName += cfg.PrefixConfig.SpecField
f = r.SpecFields[fieldName]
Expand Down Expand Up @@ -792,7 +792,7 @@ func setSDKReadMany(
indent := strings.Repeat("\t", indentLevel)

resVarPath := ""
opConfig, override := cfg.GetOverrideValues(op.Name)
opConfig, override := cfg.GetOverrideValues(op.ExportedName)
var err error
for memberIndex, memberName := range inputShape.MemberNames() {
if override {
Expand All @@ -817,7 +817,7 @@ func setSDKReadMany(
// Handles field renames, if applicable
fieldName := cfg.GetResourceFieldName(
r.Names.Original,
op.Name,
op.ExportedName,
memberName,
)
resVarPath, err = r.GetSanitizedMemberPath(memberName, op, sourceVarName)
Expand Down
4 changes: 2 additions & 2 deletions pkg/model/crd.go
Original file line number Diff line number Diff line change
Expand Up @@ -668,13 +668,13 @@ func (r *CRD) GetSanitizedMemberPath(
// Handles field renames, if applicable
fieldName := cfg.GetResourceFieldName(
r.Names.Original,
op.Name,
op.ExportedName,
memberName,
)
cleanFieldNames := names.New(fieldName)
pathFieldName := cleanFieldNames.Camel

inSpec, inStatus := r.HasMember(fieldName, op.Name)
inSpec, inStatus := r.HasMember(fieldName, op.ExportedName)
if inSpec {
resVarPath = resVarPath + cfg.PrefixConfig.SpecField + "." + pathFieldName
} else if inStatus {
Expand Down
4 changes: 2 additions & 2 deletions templates/pkg/resource/sdk.go.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -160,8 +160,8 @@ func (rm *resourceManager) sdkDelete(
{{ $hookCode }}
{{- end }}
var resp {{ .CRD.GetOutputShapeGoType .CRD.Ops.Delete }}; _ = resp;
resp, err = rm.sdkapi.{{ .CRD.Ops.Delete.Name }}WithContext(ctx, input)
rm.metrics.RecordAPICall("DELETE", "{{ .CRD.Ops.Delete.Name }}", err)
resp, err = rm.sdkapi.{{ .CRD.Ops.Delete.ExportedName }}WithContext(ctx, input)
rm.metrics.RecordAPICall("DELETE", "{{ .CRD.Ops.Delete.ExportedName }}", err)
{{- if $hookCode := Hook .CRD "sdk_delete_post_request" }}
{{ $hookCode }}
{{- end }}
Expand Down