use async_trait::async_trait;
use serde::Serialize;

use crate::{
    data::{Id, Version},
    interpret::{Interpret, InterpretError, InterpretName, InterpretStatus, Outcome},
    inventory::Inventory,
    score::Score,
    topology::Topology,
};

#[derive(Debug, Clone, Serialize)]
pub struct K3DInstallationScore {}

impl K3DInstallationScore {
    pub fn new() -> Self {
        Self {}
    }
}

impl<T: Topology> Score<T> for K3DInstallationScore {
    fn create_interpret(&self) -> Box<dyn crate::interpret::Interpret<T>> {
        todo!("
        1. Decide if I create a new crate for k3d management, especially to avoid the ocrtograb dependency
        2. Implement k3d management
        3. Find latest tag
        4. Download k3d to some path managed by harmony (or not?)
        5. Bootstrap cluster
        6. Get kubeconfig
        7. Load kubeconfig in k8s anywhere
        8. Complete k8sanywhere setup
        ")
    }

    fn name(&self) -> String {
        todo!()
    }
}

#[derive(Debug)]
struct K3dInstallationInterpret {}

#[async_trait]
impl<T: Topology> Interpret<T> for K3dInstallationInterpret {
    async fn execute(
        &self,
        inventory: &Inventory,
        topology: &T,
    ) -> Result<Outcome, InterpretError> {
        todo!()
    }
    fn get_name(&self) -> InterpretName {
        InterpretName::K3dInstallation
    }
    fn get_version(&self) -> Version {
        todo!()
    }
    fn get_status(&self) -> InterpretStatus {
        todo!()
    }
    fn get_children(&self) -> Vec<Id> {
        todo!()
    }
}
