#[derive(
    Clone,
    Default,
    PartialEq,
    serde::Deserialize,
    serde::Serialize,
    std::fmt::Debug
)]
/// volumeDevice describes a mapping of a raw block device within a container.
#[serde(rename_all = "camelCase", deny_unknown_fields)]
pub struct VolumeDeviceAc {
    /// devicePath is the path inside of the container that the device will be mapped to.
    pub device_path: std::string::String,
    /// name must match the name of a persistentVolumeClaim in the pod
    #[serde(skip_serializing_if = "Option::is_none")]
    pub name: Option<std::string::String>,
}
#[automatically_derived]
impl crate::Optionable for k8s_openapi028::api::core::v1::VolumeDevice {
    type Optioned = VolumeDeviceAc;
}
#[automatically_derived]
impl crate::Optionable for VolumeDeviceAc {
    type Optioned = VolumeDeviceAc;
}
#[automatically_derived]
#[cfg(feature = "k8s_openapi_convert")]
impl crate::OptionableConvert for k8s_openapi028::api::core::v1::VolumeDevice {
    fn into_optioned(self) -> VolumeDeviceAc {
        VolumeDeviceAc {
            device_path: self.device_path,
            name: Some(self.name),
        }
    }
    fn try_from_optioned(value: VolumeDeviceAc) -> Result<Self, crate::Error> {
        Ok(Self {
            device_path: value.device_path,
            name: value
                .name
                .ok_or(crate::Error {
                    missing_field: "name",
                })?,
        })
    }
    fn merge(&mut self, other: VolumeDeviceAc) -> Result<(), crate::Error> {
        self.device_path = other.device_path;
        if let Some(other_value) = other.name {
            self.name = crate::OptionableConvert::try_from_optioned(other_value)?;
        }
        Ok(())
    }
}
#[automatically_derived]
impl crate::merge::OptionableMapKeysEq for k8s_openapi028::api::core::v1::VolumeDevice {
    fn keys_eq(&self, other: &<Self as crate::Optionable>::Optioned) -> bool {
        self.device_path == other.device_path
    }
}
#[automatically_derived]
#[cfg(feature = "k8s_openapi_convert")]
impl crate::OptionedConvert<k8s_openapi028::api::core::v1::VolumeDevice>
for VolumeDeviceAc {
    fn from_optionable(value: k8s_openapi028::api::core::v1::VolumeDevice) -> Self {
        crate::OptionableConvert::into_optioned(value)
    }
    fn try_into_optionable(
        self,
    ) -> Result<k8s_openapi028::api::core::v1::VolumeDevice, crate::Error> {
        crate::OptionableConvert::try_from_optioned(self)
    }
    fn merge_into(
        self,
        other: &mut k8s_openapi028::api::core::v1::VolumeDevice,
    ) -> Result<(), crate::Error> {
        crate::OptionableConvert::merge(other, self)
    }
}
impl k8s_openapi028::DeepMerge for VolumeDeviceAc {
    fn merge_from(&mut self, other: Self) {
        k8s_openapi028::DeepMerge::merge_from(&mut self.device_path, other.device_path);
        k8s_openapi028::DeepMerge::merge_from(&mut self.name, other.name);
    }
}
impl crate::merge::MapKeysEq for VolumeDeviceAc {
    fn keys_eq(&self, other: &Self) -> bool {
        self.device_path == other.device_path
    }
}
