package io.openems.edge.battery.fenecon.home.update;

import com.google.common.hash.HashCode;

import io.openems.common.session.Role;
import io.openems.edge.battery.fenecon.home.BatteryFeneconHomeHardwareType;
import io.openems.edge.battery.fenecon.home.TwoPartVersion;

public interface BatteryFeneconHomeUpdateParams {

	/**
	 * Gets the update meta information.
	 *
	 * @return the meta information
	 */
	UpdateInfo getMetaInfo();

	/**
	 * Gets the arm download location.
	 *
	 * @param updateParams the parameters to build the url
	 * @return the url to the arm file
	 */
	String getArmDownloadLocation(UpdateParams updateParams);

	/**
	 * Gets the update params to a specific fenecon home battery type.
	 *
	 * @param hardwareType the type of the fenecon home battery
	 * @return the update params; null if not available for the provided
	 *         {@link BatteryFeneconHomeHardwareType}
	 */
	UpdateParams getParams(BatteryFeneconHomeHardwareType hardwareType);

	record UpdateParams(String storageName, TwoPartVersion version, HashCode sha256) {
	}

	record UpdateInfo(String name, Role requiredMinRole) {
	}

}
