use serde::Deserialize; #[derive(Debug, Deserialize)] pub struct Instance { #[serde(rename = "network-config")] pub network_config: InstanceNetworkConfig, } #[derive(Debug, Deserialize)] pub struct InstanceNetworkConfig { pub config: Vec, } #[derive(Debug, Deserialize)] pub struct InstanceNetworkConfigConfig { pub name: String, pub subnets: Vec, } #[derive(Debug, Deserialize)] #[serde(tag = "type")] pub enum InstanceNetworkConfigConfigSubnet { #[serde(rename = "static")] Static { ipv6: Option, ipv4: Option, address: String, gateway: String, }, #[serde(rename = "dhcp")] Dhcp {}, }