public Optional<ResourceShape> getResourceBinding(ToShapeId service, ToShapeId operationOrResource) {
        return getEntityBinding(service, operationOrResource)
                .filter(ResourceShape.class::isInstance)
                .map(ResourceShape.class::cast);
    }
Gets the direct parent resource of an operation or resource if and only if
the given resource or operation is bound to a resource and not bound to a
service.

@param service Service closure to query.
@param operationOrResource The operation or resource to query.
@return Returns the optionally found parent resource.
smithy-model/src/main/java/software/amazon/smithy/model/knowledge/BottomUpIndex.java