public int getResponseCode(ToShapeId shapeOrId) {
        ShapeId id = shapeOrId.toShapeId();
        Shape shape = getModel().getShape(id).orElseThrow(() -> new IllegalArgumentException("Shape not found " + id));

        if (shape.isOperationShape()) {
            return getHttpTrait(id).getCode();
        } else if (shape.hasTrait(HttpErrorTrait.ID)) {
            return shape.getTrait(HttpErrorTrait.class).get().getCode();
        } else if (shape.hasTrait(ErrorTrait.ID)) {
            return shape.getTrait(ErrorTrait.class).get().getDefaultHttpStatusCode();
        }

        throw new IllegalStateException(shape + " must be an operation or error structure");
    }
Gets the computed status code of an operation or error structure.

@param shapeOrId Operation or error structure shape ID.
@return Returns the computed HTTP status code.
@throws IllegalArgumentException if the given shape is not an operation
 or an error structure.
smithy-model/src/main/java/software/amazon/smithy/model/knowledge/HttpBindingIndex.java