From 05be66687b928403ce189ce0585ed9c976c9130f Mon Sep 17 00:00:00 2001 From: rishav-karanjit Date: Fri, 17 Jan 2025 11:06:11 -0800 Subject: [PATCH] auto commit --- .../localservice/DafnyLocalServiceGenerator.java | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/codegen/smithy-dafny-codegen/src/main/java/software/amazon/polymorph/smithygo/localservice/DafnyLocalServiceGenerator.java b/codegen/smithy-dafny-codegen/src/main/java/software/amazon/polymorph/smithygo/localservice/DafnyLocalServiceGenerator.java index 191a74074..984cb1d79 100644 --- a/codegen/smithy-dafny-codegen/src/main/java/software/amazon/polymorph/smithygo/localservice/DafnyLocalServiceGenerator.java +++ b/codegen/smithy-dafny-codegen/src/main/java/software/amazon/polymorph/smithygo/localservice/DafnyLocalServiceGenerator.java @@ -734,6 +734,20 @@ void generateReferencedResources(final GenerationContext context) { ) { continue; } + model.expectShape(resource, ResourceShape.class).getOperations() + .forEach(operation -> { + final var operationShape = model.expectShape( + operation, + OperationShape.class + ); + var inputShape = operationShape.getInput().isPresent() ? context.model().expectShape(operationShape.getInput().orElseThrow()).asStructureShape().orElseThrow() : null; + var outputShape = operationShape.getOutput().isPresent() ? context.model().expectShape(operationShape.getOutput().orElseThrow()).asStructureShape().orElseThrow() : null; + var directedCodegen = new DafnyLocalServiceDirectedCodegen(); + if (inputShape != null) + directedCodegen.writeStructure(context, inputShape); + if (outputShape != null) + directedCodegen.writeStructure(context, outputShape); + }); writerDelegator.useFileWriter( "%s/types.go".formatted( SmithyNameResolver.smithyTypesNamespace(service)