public boolean isOutputStructure(ToShapeId structureId) {
        if (structureId instanceof Shape && ((Shape) structureId).hasTrait(OutputTrait.ID)) {
            return true;
        }

        ShapeId id = structureId.toShapeId();

        for (StructureShape shape : outputs.values()) {
            if (shape.getId().equals(id)) {
                return true;
            }
        }

        return false;
    }
Returns true if the given structure is used as output by any
operation in the model or is marked with the output trait.

@param structureId Structure to check.
@return Returns true if the structure is used as output.
smithy-model/src/main/java/software/amazon/smithy/model/knowledge/OperationIndex.java