use std::collections::HashMap; use serde::{Serialize, Deserialize}; use serde_json::{ to_string_pretty, Value }; use anyhow::Result; use std::sync::Arc; use std::fmt::Display; use chrono::{DateTime, Local}; #[derive(Serialize, Deserialize, Debug)] pub struct ApiConfig { #[serde(default)] pub endpoints : Vec, pub delay : u32, } #[derive(Serialize, Deserialize, Debug)] pub struct ApiEndpoint { pub url : String, pub method : String, } impl Default for ApiConfig { fn default() -> Self { ApiConfig { endpoints : vec![], delay : 0, } } } // v2 #[derive(Serialize, Deserialize, Debug, PartialEq)] pub struct ApiConfigV2 { pub id : u64, #[serde(default)] pub template : Vec