def getschemacls(self, resource, besteffort=True):
        """Get schema class related to input resource.

        :param resource: resource from which get schema class.
        :param bool besteffort: if True (default) try a best effort in parsing
            the inheritance tree of resource if resource is a class.
        :rtype: type
        """
        result = None

        if hasattr(resource, 'mro') and besteffort and isclass(resource):
            resources = list(resource.mro())

        else:
            resources = [resource]

        for _resource in resources:
            if _resource in self._schemasbyresource:
                result = self._schemasbyresource[_resource]

                break

        return result