Skip to content

Commit

Permalink
Update creation of PropertyAssignmentFunctions
Browse files Browse the repository at this point in the history
  • Loading branch information
theunrepentantgeek committed Jul 7, 2021
1 parent 0017962 commit 4352807
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import (
"github.com/Azure/azure-service-operator/hack/generator/pkg/astmodel"
"github.com/Azure/azure-service-operator/hack/generator/pkg/codegen/storage"
"github.com/Azure/azure-service-operator/hack/generator/pkg/conversions"
"github.com/Azure/azure-service-operator/hack/generator/pkg/functions"
)

// injectPropertyAssignmentFunctionsStageId is the unique identifier for this pipeline stage
Expand Down Expand Up @@ -102,13 +103,13 @@ func (f propertyAssignmentFunctionsFactory) injectBetween(
// Create conversion functions
conversionContext := conversions.NewPropertyConversionContext(f.types, f.idFactory)

assignFromFn, err := conversions.NewPropertyAssignmentFromFunction(upstreamDef, downstreamDef, f.idFactory, conversionContext)
assignFromFn, err := functions.NewPropertyAssignmentFromFunction(upstreamDef, downstreamDef, f.idFactory, conversionContext)
upstreamName := upstreamDef.Name()
if err != nil {
return astmodel.TypeDefinition{}, errors.Wrapf(err, "creating AssignFrom() function for %q", upstreamName)
}

assignToFn, err := conversions.NewPropertyAssignmentToFunction(upstreamDef, downstreamDef, f.idFactory, conversionContext)
assignToFn, err := functions.NewPropertyAssignmentToFunction(upstreamDef, downstreamDef, f.idFactory, conversionContext)
if err != nil {
return astmodel.TypeDefinition{}, errors.Wrapf(err, "creating AssignTo() function for %q", upstreamName)
}
Expand Down

0 comments on commit 4352807

Please sign in to comment.