use serde::Deserialize;

#[derive(Deserialize, Debug)]
struct ForecastData {
    publishingOffice: String,
    reportDatetime: String,
    targetArea: String,
    headlineText: String,
    text: String,
}

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    let url = "https://www.jma.go.jp/bosai/forecast/data/overview_forecast/130000.json";
    let response = reqwest::get(url).await?;
    let text = response.json::<ForecastData>().await?;
    println!("{text:?}");
    Ok(())
}
