use serde::{Deserialize, Serialize};
use super::Merge;
#[derive(Serialize, Deserialize, PartialEq, Eq, Clone, Debug, Default, schemars::JsonSchema)]
pub struct CapabilityLoggingV1 {
#[serde(skip_serializing_if = "Option::is_none")]
pub enabled: Option<bool>,
#[serde(skip_serializing_if = "Option::is_none")]
pub capture_stdout: Option<bool>,
#[serde(skip_serializing_if = "Option::is_none")]
pub capture_stderr: Option<bool>,
}
impl CapabilityLoggingV1 {
pub fn enabled(&self) -> bool {
self.enabled.unwrap_or_default()
}
pub fn capture_stdout(&self) -> bool {
self.capture_stdout.unwrap_or_default()
}
pub fn capture_stderr(&self) -> bool {
self.capture_stderr.unwrap_or_default()
}
}
impl Merge for CapabilityLoggingV1 {
fn merge_extend(self, other: &Self) -> Self {
Self {
enabled: self.enabled.merge_extend(&other.enabled),
capture_stdout: self.capture_stdout.merge_extend(&other.capture_stdout),
capture_stderr: self.capture_stderr.merge_extend(&other.capture_stderr),
}
}
}