private static void addOperationShapes(OperationModel op,
            Map<String, ShapeModel> in,
            Map<String, ShapeModel> out) {

        final VariableModel input = op.getInput();
        if (input != null) {
            addShapeAndMembers(input.getSimpleType(), in, out);
        }

        final ReturnTypeModel output = op.getReturnType();
        if (output != null) {
            addShapeAndMembers(output.getReturnType(), in, out);
        }

        final List<ExceptionModel> exceptions = op.getExceptions();
        if (op.getExceptions() != null) {
            for (ExceptionModel e : exceptions) {
                addShapeAndMembers(e.getExceptionName(), in, out);
            }
        }
    }
Removes the un-used shapes from the intermediate model. This is done by
re-constructing the shapes map. First add the shapes referenced by the
operations and then adding the shapes referenced by each shapes.
aws-java-sdk-code-generator/src/main/java/com/amazonaws/codegen/RemoveUnusedShapes.java