How to use the uplink.utils.is_subclass function in uplink

To help you get started, we’ve selected a few uplink examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github prkumar / uplink / uplink / decorators.py View on Github external
def _is_consumer_class(c):
        return utils.is_subclass(c, interfaces.Consumer)
github prkumar / uplink / uplink / clients / __init__.py View on Github external
def _client_class_handler(key):
    if utils.is_subclass(key, interfaces.HttpClientAdapter):
        return key()
github prkumar / uplink / uplink / converters / marshmallow_.py View on Github external
def _get_schema(cls, type_):
        if utils.is_subclass(type_, cls.marshmallow.Schema):
            return type_()
        elif isinstance(type_, cls.marshmallow.Schema):
            return type_
        raise ValueError("Expected marshmallow.Scheme subclass or instance.")
github prkumar / uplink / uplink / models.py View on Github external
def _is_relevant(self, type_, argument_annotations, method_annotations):
        return (
            utils.is_subclass(type_, self._model_class) and
            self._contains_annotations(argument_annotations, method_annotations)
        )
github prkumar / uplink / uplink / arguments.py View on Github external
def _is_annotation(annotation):
        cls = interfaces.Annotation
        return utils.is_subclass(annotation, cls) or isinstance(annotation, cls)