//! Manual live smoke test against a real fin-proxy.
//! Run: FINPROXY_URL=http://127.0.0.1:8080 FINPROXY_KEY=... cargo run -p fin-proxy-client --example smoke

use fin_proxy_client::fmp::SymbolParams;
use fin_proxy_client::FinProxy;

#[tokio::main(flavor = "current_thread")]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    let url = std::env::var("FINPROXY_URL").unwrap_or_else(|_| "http://127.0.0.1:8080".into());
    let mut client = FinProxy::new(&url)?;
    if let Ok(key) = std::env::var("FINPROXY_KEY") {
        client = client.with_api_key(key);
    }
    let q = client.fmp().quote(&SymbolParams::new("AAPL")).await?;
    println!("AAPL quote via {:?}: {:?}", q.provider, q.results);
    Ok(())
}
