//! Azure Cognitive Services Speech stub.
//!
//! Phase voice-plugin-extract Fase F Step 27 — feature scaffold
//! only. Real REST integration (Speech SSML POST + region/key)
//! lands in a follow-up.

use async_trait::async_trait;

use super::{CostClass, SynthesizeOutput, SynthesizeRequest, TtsProvider};
use crate::error::{Result, VoiceError};

#[derive(Debug, Clone, Default)]
pub struct AzureTtsProvider {
    pub region: Option<String>,
    pub api_key: Option<String>,
}

#[async_trait]
impl TtsProvider for AzureTtsProvider {
    fn id(&self) -> &'static str {
        "azure"
    }

    fn label(&self) -> &str {
        "Azure Cognitive Services"
    }

    fn auto_select_order(&self) -> u32 {
        60
    }

    fn cost_class(&self) -> CostClass {
        CostClass::Cheap
    }

    fn is_configured(&self) -> bool {
        self.region.as_deref().map(str::is_empty).map(|e| !e).unwrap_or(false)
            && self
                .api_key
                .as_deref()
                .map(str::is_empty)
                .map(|e| !e)
                .unwrap_or(false)
    }

    async fn synthesize(&self, _req: SynthesizeRequest<'_>) -> Result<SynthesizeOutput> {
        Err(VoiceError::NotSupported(
            "azure provider stub — REST integration ships in a follow-up",
        ))
    }
}
