@classmethod
def from_json(cls, config, lists, **kwargs):
    """
        Generate object from JSON.
        :return:
        """
    id = config['definitionId']
    name = config['name']
    description = config['description']
    references = config.get('references')
    vpn = cls.get_list_obj(config['definition']['vpnList'], lists)
    topos = []
    for topo in config['definition']['subDefinitions']:
        for spoke in topo['spokes']:
            spoke['siteList'] = cls.get_list_obj(spoke['siteList'], lists)
            for hub in spoke['hubs']:
                hub['siteList'] = cls.get_list_obj(hub['siteList'], lists)
                for i in range(0, len(hub['prefixLists'])):
                    hub['prefixLists'][i] = cls.get_list_obj(hub[
                        'prefixLists'][i], lists)
                if hub.get('ipv6PrefixLists'):
                    for i in range(0, len(hub['ipv6PrefixLists'])):
                        hub['ipv6PrefixLists'][i] = cls.get_list_obj(hub[
                            'ipv6PrefixLists'][i], lists)
                else:
                    hub['ipv6PrefixLists'] = []
        if topo.get('tlocList'):
            topo['tlocList'] = cls.get_list_obj(topo['tlocList'], lists)
        topos.append(topo)
    return cls(name, description, vpn, topos, id, references, **kwargs)
