Decode the response of each agent given by a bulk function.

    :param list response_bulk: list of dictionnary which represents
    the response for an agent.

    :return: decoded response.
    :rtype: list of dict.
483940
def _decode_response_bulk(response_bulk):
    
    resp = []
    for response in response_bulk:
      if ("status" in response) and (response.get("status") == 201):
        agent = {"id": response["id"],
                 "message": response["message"]}
        resp.append(agent)
      elif "status" in response:
        status_code = response["status"]
        message = response["message"]
        agent = {"error": CraftAIClient._get_error_from_status(status_code, message)}
        try:
          agent["id"] = response["id"]
        except KeyError:
          pass
        resp.append(agent)

      else:
        resp.append(response)

    return resp
1332663
protected base_resource[] get_nitro_bulk_response(nitro_service service, String response) throws Exception
	{
		xen_hotfix_responses result = (xen_hotfix_responses) service.get_payload_formatter().string_to_resource(xen_hotfix_responses.class, response);
		if(result.errorcode != 0)
		{
			if (result.errorcode == SESSION_NOT_EXISTS)
				service.clear_session();
			throw new nitro_exception(result.message, result.errorcode, (base_response [])result.xen_hotfix_response_array);
		}
		xen_hotfix[] result_xen_hotfix = new xen_hotfix[result.xen_hotfix_response_array.length];
		
		for(int i = 0; i < result.xen_hotfix_response_array.length; i++)
		{
			result_xen_hotfix[i] = result.xen_hotfix_response_array[i].xen_hotfix[0];
		}
		
		return result_xen_hotfix;
	}
748336
protected base_resource[] get_nitro_bulk_response(nitro_service service, String response) throws Exception
	{
		version_matrix_status_responses result = (version_matrix_status_responses) service.get_payload_formatter().string_to_resource(version_matrix_status_responses.class, response);
		if(result.errorcode != 0)
		{
			if (result.errorcode == SESSION_NOT_EXISTS)
				service.clear_session();
			throw new nitro_exception(result.message, result.errorcode, (base_response [])result.version_matrix_status_response_array);
		}
		version_matrix_status[] result_version_matrix_status = new version_matrix_status[result.version_matrix_status_response_array.length];
		
		for(int i = 0; i < result.version_matrix_status_response_array.length; i++)
		{
			result_version_matrix_status[i] = result.version_matrix_status_response_array[i].version_matrix_status[0];
		}
		
		return result_version_matrix_status;
	}
470067
protected base_resource[] get_nitro_bulk_response(nitro_service service, String response) throws Exception
	{
		backup_file_responses result = (backup_file_responses) service.get_payload_formatter().string_to_resource(backup_file_responses.class, response);
		if(result.errorcode != 0)
		{
			if (result.errorcode == SESSION_NOT_EXISTS)
				service.clear_session();
			throw new nitro_exception(result.message, result.errorcode, (base_response [])result.backup_file_response_array);
		}
		backup_file[] result_backup_file = new backup_file[result.backup_file_response_array.length];
		
		for(int i = 0; i < result.backup_file_response_array.length; i++)
		{
			result_backup_file[i] = result.backup_file_response_array[i].backup_file[0];
		}
		
		return result_backup_file;
	}
1267748
protected base_resource[] get_nitro_bulk_response(nitro_service service, String response) throws Exception
	{
		ntp_param_responses result = (ntp_param_responses) service.get_payload_formatter().string_to_resource(ntp_param_responses.class, response);
		if(result.errorcode != 0)
		{
			if (result.errorcode == SESSION_NOT_EXISTS)
				service.clear_session();
			throw new nitro_exception(result.message, result.errorcode, (base_response [])result.ntp_param_response_array);
		}
		ntp_param[] result_ntp_param = new ntp_param[result.ntp_param_response_array.length];
		
		for(int i = 0; i < result.ntp_param_response_array.length; i++)
		{
			result_ntp_param[i] = result.ntp_param_response_array[i].ntp_param[0];
		}
		
		return result_ntp_param;
	}
438094
protected base_resource[] get_nitro_bulk_response(nitro_service service, String response) throws Exception
	{
		version_matrix_file_responses result = (version_matrix_file_responses) service.get_payload_formatter().string_to_resource(version_matrix_file_responses.class, response);
		if(result.errorcode != 0)
		{
			if (result.errorcode == SESSION_NOT_EXISTS)
				service.clear_session();
			throw new nitro_exception(result.message, result.errorcode, (base_response [])result.version_matrix_file_response_array);
		}
		version_matrix_file[] result_version_matrix_file = new version_matrix_file[result.version_matrix_file_response_array.length];
		
		for(int i = 0; i < result.version_matrix_file_response_array.length; i++)
		{
			result_version_matrix_file[i] = result.version_matrix_file_response_array[i].version_matrix_file[0];
		}
		
		return result_version_matrix_file;
	}
1205243
protected base_resource[] get_nitro_bulk_response(nitro_service service, String response) throws Exception
	{
		xen_health_interface_responses result = (xen_health_interface_responses) service.get_payload_formatter().string_to_resource(xen_health_interface_responses.class, response);
		if(result.errorcode != 0)
		{
			if (result.errorcode == SESSION_NOT_EXISTS)
				service.clear_session();
			throw new nitro_exception(result.message, result.errorcode, (base_response [])result.xen_health_interface_response_array);
		}
		xen_health_interface[] result_xen_health_interface = new xen_health_interface[result.xen_health_interface_response_array.length];
		
		for(int i = 0; i < result.xen_health_interface_response_array.length; i++)
		{
			result_xen_health_interface[i] = result.xen_health_interface_response_array[i].xen_health_interface[0];
		}
		
		return result_xen_health_interface;
	}
758953
protected base_resource[] get_nitro_bulk_response(nitro_service service, String response) throws Exception
	{
		ftw_events_responses result = (ftw_events_responses) service.get_payload_formatter().string_to_resource(ftw_events_responses.class, response);
		if(result.errorcode != 0)
		{
			if (result.errorcode == SESSION_NOT_EXISTS)
				service.clear_session();
			throw new nitro_exception(result.message, result.errorcode, (base_response [])result.ftw_events_response_array);
		}
		ftw_events[] result_ftw_events = new ftw_events[result.ftw_events_response_array.length];
		
		for(int i = 0; i < result.ftw_events_response_array.length; i++)
		{
			result_ftw_events[i] = result.ftw_events_response_array[i].ftw_events[0];
		}
		
		return result_ftw_events;
	}
1299520
protected base_resource[] get_nitro_bulk_response(nitro_service service, String response) throws Exception
	{
		inventory_status_responses result = (inventory_status_responses) service.get_payload_formatter().string_to_resource(inventory_status_responses.class, response);
		if(result.errorcode != 0)
		{
			if (result.errorcode == SESSION_NOT_EXISTS)
				service.clear_session();
			throw new nitro_exception(result.message, result.errorcode, (base_response [])result.inventory_status_response_array);
		}
		inventory_status[] result_inventory_status = new inventory_status[result.inventory_status_response_array.length];
		
		for(int i = 0; i < result.inventory_status_response_array.length; i++)
		{
			result_inventory_status[i] = result.inventory_status_response_array[i].inventory_status[0];
		}
		
		return result_inventory_status;
	}
737698
protected base_resource[] get_nitro_bulk_response(nitro_service service, String response) throws Exception
	{
		mail_profile_responses result = (mail_profile_responses) service.get_payload_formatter().string_to_resource(mail_profile_responses.class, response);
		if(result.errorcode != 0)
		{
			if (result.errorcode == SESSION_NOT_EXISTS)
				service.clear_session();
			throw new nitro_exception(result.message, result.errorcode, (base_response [])result.mail_profile_response_array);
		}
		mail_profile[] result_mail_profile = new mail_profile[result.mail_profile_response_array.length];
		
		for(int i = 0; i < result.mail_profile_response_array.length; i++)
		{
			result_mail_profile[i] = result.mail_profile_response_array[i].mail_profile[0];
		}
		
		return result_mail_profile;
	}
149041
protected base_resource[] get_nitro_bulk_response(nitro_service service, String response) throws Exception
	{
		syslog_params_responses result = (syslog_params_responses) service.get_payload_formatter().string_to_resource(syslog_params_responses.class, response);
		if(result.errorcode != 0)
		{
			if (result.errorcode == SESSION_NOT_EXISTS)
				service.clear_session();
			throw new nitro_exception(result.message, result.errorcode, (base_response [])result.syslog_params_response_array);
		}
		syslog_params[] result_syslog_params = new syslog_params[result.syslog_params_response_array.length];
		
		for(int i = 0; i < result.syslog_params_response_array.length; i++)
		{
			result_syslog_params[i] = result.syslog_params_response_array[i].syslog_params[0];
		}
		
		return result_syslog_params;
	}
1070374
protected base_resource[] get_nitro_bulk_response(nitro_service service, String response) throws Exception
	{
		inventory_responses result = (inventory_responses) service.get_payload_formatter().string_to_resource(inventory_responses.class, response);
		if(result.errorcode != 0)
		{
			if (result.errorcode == SESSION_NOT_EXISTS)
				service.clear_session();
			throw new nitro_exception(result.message, result.errorcode, (base_response [])result.inventory_response_array);
		}
		inventory[] result_inventory = new inventory[result.inventory_response_array.length];
		
		for(int i = 0; i < result.inventory_response_array.length; i++)
		{
			result_inventory[i] = result.inventory_response_array[i].inventory[0];
		}
		
		return result_inventory;
	}
883077
protected base_resource[] get_nitro_bulk_response(nitro_service service, String response) throws Exception
	{
		ns_upgrade_responses result = (ns_upgrade_responses) service.get_payload_formatter().string_to_resource(ns_upgrade_responses.class, response);
		if(result.errorcode != 0)
		{
			if (result.errorcode == SESSION_NOT_EXISTS)
				service.clear_session();
			throw new nitro_exception(result.message, result.errorcode, (base_response [])result.ns_upgrade_response_array);
		}
		ns_upgrade[] result_ns_upgrade = new ns_upgrade[result.ns_upgrade_response_array.length];
		
		for(int i = 0; i < result.ns_upgrade_response_array.length; i++)
		{
			result_ns_upgrade[i] = result.ns_upgrade_response_array[i].ns_upgrade[0];
		}
		
		return result_ns_upgrade;
	}
41523
protected base_resource[] get_nitro_bulk_response(nitro_service service, String response) throws Exception
	{
		sdx_license_responses result = (sdx_license_responses) service.get_payload_formatter().string_to_resource(sdx_license_responses.class, response);
		if(result.errorcode != 0)
		{
			if (result.errorcode == SESSION_NOT_EXISTS)
				service.clear_session();
			throw new nitro_exception(result.message, result.errorcode, (base_response [])result.sdx_license_response_array);
		}
		sdx_license[] result_sdx_license = new sdx_license[result.sdx_license_response_array.length];
		
		for(int i = 0; i < result.sdx_license_response_array.length; i++)
		{
			result_sdx_license[i] = result.sdx_license_response_array[i].sdx_license[0];
		}
		
		return result_sdx_license;
	}
558039
protected base_resource[] get_nitro_bulk_response(nitro_service service, String response) throws Exception
	{
		device_profile_responses result = (device_profile_responses) service.get_payload_formatter().string_to_resource(device_profile_responses.class, response);
		if(result.errorcode != 0)
		{
			if (result.errorcode == SESSION_NOT_EXISTS)
				service.clear_session();
			throw new nitro_exception(result.message, result.errorcode, (base_response [])result.device_profile_response_array);
		}
		device_profile[] result_device_profile = new device_profile[result.device_profile_response_array.length];
		
		for(int i = 0; i < result.device_profile_response_array.length; i++)
		{
			result_device_profile[i] = result.device_profile_response_array[i].device_profile[0];
		}
		
		return result_device_profile;
	}
650488
protected base_resource[] get_nitro_bulk_response(nitro_service service, String response) throws Exception
	{
		xen_health_monitor_responses result = (xen_health_monitor_responses) service.get_payload_formatter().string_to_resource(xen_health_monitor_responses.class, response);
		if(result.errorcode != 0)
		{
			if (result.errorcode == SESSION_NOT_EXISTS)
				service.clear_session();
			throw new nitro_exception(result.message, result.errorcode, (base_response [])result.xen_health_monitor_response_array);
		}
		xen_health_monitor[] result_xen_health_monitor = new xen_health_monitor[result.xen_health_monitor_response_array.length];
		
		for(int i = 0; i < result.xen_health_monitor_response_array.length; i++)
		{
			result_xen_health_monitor[i] = result.xen_health_monitor_response_array[i].xen_health_monitor[0];
		}
		
		return result_xen_health_monitor;
	}
314256
protected base_resource[] get_nitro_bulk_response(nitro_service service, String response) throws Exception
	{
		xen_responses result = (xen_responses) service.get_payload_formatter().string_to_resource(xen_responses.class, response);
		if(result.errorcode != 0)
		{
			if (result.errorcode == SESSION_NOT_EXISTS)
				service.clear_session();
			throw new nitro_exception(result.message, result.errorcode, (base_response [])result.xen_response_array);
		}
		xen[] result_xen = new xen[result.xen_response_array.length];
		
		for(int i = 0; i < result.xen_response_array.length; i++)
		{
			result_xen[i] = result.xen_response_array[i].xen[0];
		}
		
		return result_xen;
	}