use serde::Deserialize;
use serde_json::Value;
use std::collections::{BTreeMap, HashMap};
#[derive(Debug, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct TldItem {
pub name: Option<String>,
pub status: Option<String>,
pub min_registration_period: Option<u32>,
pub max_registration_period: Option<u32>,
pub constraints: Option<TldConstraints>,
pub prices: Option<Vec<Value>>,
}
#[derive(Debug, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct TldConstraints {
#[serde(alias = "maxLenght")]
pub max_length: Option<u32>,
pub min_length: Option<u32>,
}
pub type PeriodPriceMap = BTreeMap<u32, f64>;
#[derive(Debug)]
pub struct TldInfo {
pub id: u32,
pub tld: String,
pub status: String,
pub min_char: u32,
pub max_char: u32,
pub min_period: u32,
pub max_period: u32,
pub pricing: HashMap<String, PeriodPriceMap>,
pub currencies: HashMap<String, String>,
}
#[derive(Debug)]
pub struct TldListResponse {
pub tld_items: Vec<TldInfo>,
pub total_count: u32,
}