@staticmethod
def parse(obj: any, resolver: callable):
    if (dict == type(obj)):
        href = get_if_exists(obj, 'href', None)
        resolved = obj
        if href:
            resolved = {**default_if_none(resolver(href), {}), **obj}
        desc_type = get_if_exists(resolved, 'type', 'semantic')
        docs = get_if_exists(resolved, 'doc', None)
    else:
        return None
    id = get_if_exists(resolved, 'id')
    name = get_if_exists(resolved, 'name')
    if (desc_type == 'semantic'):
        desc = Semantic(id=id, name=name)
    elif (desc_type == 'safe'):
        desc = Safe(id=id, name=name)
    elif (desc_type == 'unsafe'):
        desc = Unsafe(id=id, name=name)
    elif (desc_type == 'idempotent'):
        desc = Idempotent(id=id, name=name)
    if docs:
        add_doc = getattr(desc, 'add_doc', None)
        if add_doc:
            add_doc(docs)
    for d in always_a_list(get_if_exists(resolved, 'descriptor', [])):
        desc.add_descriptor(d, resolver)
    return desc
@staticmethod
def parse(obj: any, resolver: callable):
    if (dict == type(obj)):
        href = get_if_exists(obj, 'href', None)
        resolved = obj
        if href:
            resolved = {**default_if_none(resolver(href), {}), **obj}
        desc_type = get_if_exists(resolved, 'type', 'semantic')
        docs = get_if_exists(resolved, 'doc', None)
    else:
        return None
    id = get_if_exists(resolved, 'id')
    name = get_if_exists(resolved, 'name')
    if (desc_type == 'semantic'):
        desc = Semantic(id=id, name=name)
    elif (desc_type == 'safe'):
        desc = Safe(id=id, name=name)
    elif (desc_type == 'unsafe'):
        desc = Unsafe(id=id, name=name)
    elif (desc_type == 'idempotent'):
        desc = Idempotent(id=id, name=name)
    if docs:
        add_doc = getattr(desc, 'add_doc', None)
        if add_doc:
            add_doc(docs)
    for d in always_a_list(get_if_exists(resolved, 'descriptor', [])):
        desc.add_descriptor(d, resolver)
    return desc