use serde::{Deserialize, Serialize}; use std::collections::HashMap; #[derive(Debug, Deserialize)] #[serde(rename_all = "camelCase")] pub struct BodySpec { pub mode: String, pub raw: Option, } #[derive(Debug, Deserialize)] #[serde(rename_all = "camelCase")] pub struct HttpSpec { pub method: String, pub url: String, #[serde(default)] pub headers: HashMap, pub query: Option>, pub body: Option, pub timeout_ms: Option, pub proxy: Option, } #[derive(Debug, Serialize)] #[serde(rename_all = "camelCase")] pub struct HttpResult { pub status: u16, pub headers: HashMap, pub body: String, pub time_ms: u128, pub size: usize, } #[derive(Debug, Deserialize)] #[serde(rename_all = "camelCase")] pub struct WsSpec { pub url: String, pub protocols: Option>, #[serde(default)] pub headers: HashMap, } #[derive(Clone, Serialize)] #[serde(rename_all = "camelCase")] pub struct WsEvent { pub session_id: String, pub kind: String, pub data: String, } #[derive(Debug, Deserialize)] pub struct ProxySettings { pub mode: String, pub http: String, pub https: String, pub bypass: String, pub auth: Option, } #[derive(Debug, Deserialize)] pub struct ProxyAuth { pub username: String, pub password: String, }