private final ShapeModel generateOutputShapeModel(Operation c2jOperationModel,
                                                      String javaOutputShapeNameOverride,
                                                      Map<String, Shape> c2jShapes) {

        final Output c2jOutputModel = c2jOperationModel.getOutput();
        final String c2jOutputShapeName = c2jOutputModel.getShape();

        ShapeModel shapeModel = generateShapeModel(javaOutputShapeNameOverride, c2jOutputShapeName);

        shapeModel.setType(ShapeType.Response.getValue());

        // Set up unmarshaller metadata
        ShapeUnmarshaller shapeUnmarshaller = new ShapeUnmarshaller()
                .withFlattened(c2jShapes.get(c2jOutputShapeName).isFlattened())
                .withResultWrapper(c2jOutputModel.getResultWrapper());

        shapeModel.setUnmarshaller(shapeUnmarshaller);

        return shapeModel;
    }
Constructs the result shapes for the intermediate model. Analyzes the operations in the service
model to identify the result shapes that are to be generated.
aws-java-sdk-code-generator/src/main/java/com/amazonaws/codegen/AddOutputShapes.java