public List<EntityShape> getAllParents(ToShapeId service, ToShapeId operationOrResource) {
        Map<ShapeId, List<EntityShape>> serviceBindings = parentBindings.getOrDefault(
                service.toShapeId(),
                Collections.emptyMap());
        List<EntityShape> entities = serviceBindings.get(operationOrResource.toShapeId());
        return entities == null ? Collections.emptyList() : Collections.unmodifiableList(entities);
    }
Gets all of the parents of an operation or resource within a service.

<p>The returned list contains each {@link EntityShape} parent (a resource or
service shape). The first element in the list is the direct parent of the
resource/operation, followed by that resource's parent, until finally the last
element in the list is always a {@code ServiceShape}.

@param service Service to query.
@param operationOrResource The operation or resource for which to find the parents.
@return Returns the parents of the resource.
smithy-model/src/main/java/software/amazon/smithy/model/knowledge/BottomUpIndex.java