示例#1
0
class EndpointElements:
    cls: Type[EndpointResource] = attribute(default=None)
    uris: Set[str] = attribute(default=set())
    # {'method': path, 'get': path, 'post': path}
    methods: Dict[str, str] = attribute(default={})
    tags: List[str] = attribute(default=[])
    private: bool = attribute(default=False)
示例#2
0
class EndpointElements:
    exists = attribute(default=False)
    isbase = attribute(default=False)
    cls = attribute(default=None)
    uris = attribute(default={})
    methods = attribute(default=[])
    custom = attribute(default=ExtraAttributes())
    tags = attribute(default=[])
    base_uri = attribute(default='')
示例#3
0
class EndpointElements(object):
    exists = attribute(default=False)
    isbase = attribute(default=False)
    cls = attribute(default=None)
    # instance = attribute(default=None)  # became useless
    uris = attribute(default={})
    ids = attribute(default={})
    methods = attribute(default=[])
    custom = attribute(default=ExtraAttributes())
    tags = attribute(default=[])
示例#4
0
class ResponseElements(object):
    defined_content = attribute()
    elements = attribute(default=None)
    code = attribute(default=None)
    errors = attribute(default=None)
    headers = attribute(default={})
    meta = attribute(default=None)
    extra = attribute(default=None)
示例#5
0
class ResponseElements:
    defined_content = attribute()
    elements = attribute(default=None)
    code = attribute(default=None)
    errors = attribute(default=None)
    headers = attribute(default={})
    meta = attribute(default=None)
    head_method = attribute(default=False)
示例#6
0
class EndpointElements:
    # type of endpoint from flask_restful
    cls: Type[Resource] = attribute(default=None)
    uris: List[str] = attribute(default=[])
    methods: Dict[str, List[str]] = attribute(default={})
    tags: List[str] = attribute(default=[])
    base_uri: str = attribute(default="")
    private: bool = attribute(default=False)
示例#7
0
class InitObj(object):
    """
    A pythonic way to handle a method response with different features.
    Here's the list of needed attributes:
    """

    # User info
    username = attribute(default=None)
    extuser_object = attribute(default=None)
    # Service handlers
    icommands = attribute(default=None)
    db_handler = attribute(default=None)
    # Verify certificates or normal credentials
    is_proxy = attribute(default=False)
    valid_credentials = attribute(default=False)
    refreshed = attribute(default=False)
    # Save errors to report
    errors = attribute(default=None)
示例#8
0
class ExtraAttributes(object):
    auth = attribute(default=[])
    publish = attribute(default=True)
    schema = attribute(default={})
    whatever = attribute(default=None)
示例#9
0
class ExtraAttributes:
    auth = attribute(default=[])
    publish = attribute(default=True)
    schema = attribute(default={})
    whatever = attribute(default=None)
    required_roles = attribute(default=ALL_ROLES)
示例#10
0
class Node:
    value = attribute()
    parent = attribute(default=None, repr=False)
    children = attribute(default=attr.Factory(list))