use crate::error::OciSpecError;
use derive_builder::Builder;
use getset::{Getters, Setters};
use serde::{Deserialize, Serialize};
#[derive(
Builder, Clone, Debug, Default, Deserialize, Getters, Setters, Eq, PartialEq, Serialize,
)]
#[serde(rename_all = "camelCase")]
#[builder(
default,
pattern = "owned",
setter(into, strip_option),
build_fn(error = "OciSpecError")
)]
#[getset(get = "pub", set = "pub")]
pub struct Solaris {
#[serde(default, skip_serializing_if = "Option::is_none")]
milestone: Option<String>,
#[serde(default, skip_serializing_if = "Option::is_none")]
limitpriv: Option<String>,
#[serde(default, skip_serializing_if = "Option::is_none")]
max_shm_memory: Option<String>,
#[serde(default, skip_serializing_if = "Option::is_none")]
anet: Option<Vec<SolarisAnet>>,
#[serde(default, skip_serializing_if = "Option::is_none", rename = "cappedCPU")]
capped_cpu: Option<SolarisCappedCPU>,
#[serde(default, skip_serializing_if = "Option::is_none")]
capped_memory: Option<SolarisCappedMemory>,
}
#[derive(
Builder, Clone, Debug, Default, Deserialize, Getters, Setters, Eq, PartialEq, Serialize,
)]
#[serde(rename_all = "camelCase")]
#[builder(
default,
pattern = "owned",
setter(into, strip_option),
build_fn(error = "OciSpecError")
)]
#[getset(get = "pub", set = "pub")]
pub struct SolarisAnet {
#[serde(default, skip_serializing_if = "Option::is_none")]
linkname: Option<String>,
#[serde(default, skip_serializing_if = "Option::is_none")]
lower_link: Option<String>,
#[serde(default, skip_serializing_if = "Option::is_none")]
allowed_address: Option<String>,
#[serde(default, skip_serializing_if = "Option::is_none")]
configure_allowed_address: Option<String>,
#[serde(default, skip_serializing_if = "Option::is_none")]
defrouter: Option<String>,
#[serde(default, skip_serializing_if = "Option::is_none")]
link_protection: Option<String>,
#[serde(default, skip_serializing_if = "Option::is_none")]
mac_address: Option<String>,
}
#[derive(
Builder, Clone, Debug, Default, Deserialize, Getters, Setters, Eq, PartialEq, Serialize,
)]
#[builder(
default,
pattern = "owned",
setter(into, strip_option),
build_fn(error = "OciSpecError")
)]
#[getset(get = "pub", set = "pub")]
pub struct SolarisCappedCPU {
#[serde(default, skip_serializing_if = "Option::is_none")]
ncpus: Option<String>,
}
#[derive(
Builder, Clone, Debug, Default, Deserialize, Getters, Setters, Eq, PartialEq, Serialize,
)]
#[builder(
default,
pattern = "owned",
setter(into, strip_option),
build_fn(error = "OciSpecError")
)]
#[getset(get = "pub", set = "pub")]
pub struct SolarisCappedMemory {
#[serde(default, skip_serializing_if = "Option::is_none")]
physical: Option<String>,
#[serde(default, skip_serializing_if = "Option::is_none")]
swap: Option<String>,
}