@staticmethod
def get_inventory_host_nics_data(host: dict, ipv4_first=True):

    def get_network_interface_ip(interface):
        addresses = ((interface.ipv4_addresses + interface.ipv6_addresses) if ipv4_first else (interface.ipv6_addresses + interface.ipv4_addresses))
        return (addresses[0].split('/')[0] if (len(addresses) > 0) else None)
    inventory = models.Inventory(**json.loads(host['inventory']))
    interfaces_list = [models.Interface(**interface) for interface in inventory.interfaces]
    return [{'name': interface.name, 'model': interface.product, 'mac': interface.mac_address, 'ip': get_network_interface_ip(interface), 'speed': interface.speed_mbps} for interface in interfaces_list]
@staticmethod
def get_inventory_host_nics_data(host: dict, ipv4_first=True):

    def get_network_interface_ip(interface):
        addresses = ((interface.ipv4_addresses + interface.ipv6_addresses) if ipv4_first else (interface.ipv6_addresses + interface.ipv4_addresses))
        return (addresses[0].split('/')[0] if (len(addresses) > 0) else None)
    inventory = models.Inventory(**json.loads(host['inventory']))
    interfaces_list = [models.Interface(**interface) for interface in inventory.interfaces]
    return [{'name': interface.name, 'model': interface.product, 'mac': interface.mac_address, 'ip': get_network_interface_ip(interface), 'speed': interface.speed_mbps} for interface in interfaces_list]