def get_dict_of_struct(connection, host):
    """
    Transform SDK Host Struct type to Python dictionary.
    """
    if host is None:
        return dict()

    hosts_service = connection.system_service().hosts_service()
    host_service = hosts_service.host_service(host.id)
    clusters_service = connection.system_service().clusters_service()
    devices = host_service.devices_service().list()
    tags = host_service.tags_service().list()
    stats = host_service.statistics_service().list()
    labels = host_service.affinity_labels_service().list()
    groups = clusters_service.cluster_service(
        host.cluster.id
    ).affinity_groups_service().list()

    return {
        'id': host.id,
        'name': host.name,
        'address': host.address,
        'cluster': connection.follow_link(host.cluster).name,
        'status': str(host.status),
        'description': host.description,
        'os_type': host.os.type,
        'os_version': host.os.version.full_version,
        'libvirt_version': host.libvirt_version.full_version,
        'vdsm_version': host.version.full_version,
        'tags': [tag.name for tag in tags],
        'affinity_labels': [label.name for label in labels],
        'affinity_groups': [
            group.name for group in groups
            if (
                connection.is_link(group.hosts)
                and host.name in [
                    h.name for h in connection.follow_link(group.hosts)
                ]
            )
        ],
        'statistics': dict(
            (stat.name, stat.values[0].datum) for stat in stats
        ),
        'devices': [device.name for device in devices],
        'ansible_host': host.address,
    }