From 0328f60f5c515ed9504861bff6744b4a7ea2d5a2 Mon Sep 17 00:00:00 2001 From: michaelhtm <98621731+michaelhtm@users.noreply.github.com> Date: Thu, 16 Oct 2025 13:20:00 -0700 Subject: [PATCH] pass optype to setResourceReadMany from SetResource Currently, if the resource output shape is a list, code-gen triggers the readmany output generator. When doing so, it does not pass the operationType, which causes it to lose some of its functionality, which in this case was the ability to ignore setting resources for a desired method. With these changes, even sdk outputs that have a list as output type will be able to configure Create/Update/Delete set config in generator.yaml --- pkg/generate/code/set_resource.go | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/pkg/generate/code/set_resource.go b/pkg/generate/code/set_resource.go index 6ed6566f..d7c835b3 100644 --- a/pkg/generate/code/set_resource.go +++ b/pkg/generate/code/set_resource.go @@ -123,7 +123,7 @@ func SetResource( if op == r.Ops.ReadMany { return setResourceReadMany( cfg, r, - op, sourceVarName, targetVarName, indentLevel, + opType, op, sourceVarName, targetVarName, indentLevel, ) } else if wrapperFieldPath != nil { // fieldpath api requires fully-qualified path @@ -133,7 +133,7 @@ func SetResource( if sref.Shape.Type == "list" { return setResourceReadMany( cfg, r, - op, sourceVarName, targetVarName, indentLevel, + opType, op, sourceVarName, targetVarName, indentLevel, ) } } @@ -509,6 +509,8 @@ func ListMemberNameInReadManyOutput( func setResourceReadMany( cfg *ackgenconfig.Config, r *model.CRD, + // the operation type + opType model.OpType, // The ReadMany operation descriptor op *awssdkmodel.Operation, // String representing the name of the variable that we will grab the @@ -660,7 +662,7 @@ func setResourceReadMany( // We may have some special instructions for how to handle setting the // field value... - setCfg := f.GetSetterConfig(model.OpTypeList) + setCfg := f.GetSetterConfig(opType) if setCfg != nil && setCfg.IgnoreResourceSetter() { continue