Skip to content

Commit

Permalink
add inline finalize middleware gen
Browse files Browse the repository at this point in the history
  • Loading branch information
lucix-aws committed Nov 8, 2023
1 parent 6f75282 commit e8a6042
Showing 1 changed file with 22 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,28 @@ public static GoStackStepMiddlewareGenerator createFinalizeStepMiddleware(String
SmithyGoTypes.Middleware.FinalizeHandler);
}

/**
* Create an inline Finalize func.
*
* @param body is the function body.
* @return the generated middleware func.
*/
public static GoWriter.Writable generateFinalizeMiddlewareFunc(GoWriter.Writable body) {
return goTemplate("""
func(ctx $T, in $T, next $T) (
out $T, metadata $T, err error,
) {
$W
}
""",
GoStdlibTypes.Context.Context,
SmithyGoTypes.Middleware.FinalizeInput,
SmithyGoTypes.Middleware.FinalizeHandler,
SmithyGoTypes.Middleware.FinalizeOutput,
SmithyGoTypes.Middleware.Metadata,
body);
}

/**
* Create a new DeserializeStep middleware generator with the provided type name.
*
Expand Down

0 comments on commit e8a6042

Please sign in to comment.