#[derive(
    Clone,
    Default,
    PartialEq,
    serde::Deserialize,
    serde::Serialize,
    std::fmt::Debug
)]
/// PodResourceClaimStatus is stored in the PodStatus for each PodResourceClaim which references a ResourceClaimTemplate. It stores the generated name for the corresponding ResourceClaim.
#[serde(rename_all = "camelCase", deny_unknown_fields)]
pub struct PodResourceClaimStatusAc {
    /// Name uniquely identifies this resource claim inside the pod. This must match the name of an entry in pod.spec.resourceClaims, which implies that the string must be a DNS_LABEL.
    pub name: std::string::String,
    /// ResourceClaimName is the name of the ResourceClaim that was generated for the Pod in the namespace of the Pod. If this is unset, then generating a ResourceClaim was not necessary. The pod.spec.resourceClaims entry can be ignored in this case.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub resource_claim_name: Option<std::string::String>,
}
#[automatically_derived]
impl crate::Optionable for k8s_openapi028::api::core::v1::PodResourceClaimStatus {
    type Optioned = PodResourceClaimStatusAc;
}
#[automatically_derived]
impl crate::Optionable for PodResourceClaimStatusAc {
    type Optioned = PodResourceClaimStatusAc;
}
#[automatically_derived]
#[cfg(feature = "k8s_openapi_convert")]
impl crate::OptionableConvert for k8s_openapi028::api::core::v1::PodResourceClaimStatus {
    fn into_optioned(self) -> PodResourceClaimStatusAc {
        PodResourceClaimStatusAc {
            name: self.name,
            resource_claim_name: self.resource_claim_name,
        }
    }
    fn try_from_optioned(value: PodResourceClaimStatusAc) -> Result<Self, crate::Error> {
        Ok(Self {
            name: value.name,
            resource_claim_name: value.resource_claim_name,
        })
    }
    fn merge(&mut self, other: PodResourceClaimStatusAc) -> Result<(), crate::Error> {
        self.name = other.name;
        if self.resource_claim_name.is_none() {
            self.resource_claim_name = crate::OptionableConvert::try_from_optioned(
                other.resource_claim_name,
            )?;
        } else if let Some(self_value) = self.resource_claim_name.as_mut()
            && let Some(other_value) = other.resource_claim_name
        {
            crate::OptionableConvert::merge(self_value, other_value)?;
        }
        Ok(())
    }
}
#[automatically_derived]
impl crate::merge::OptionableMapKeysEq
for k8s_openapi028::api::core::v1::PodResourceClaimStatus {
    fn keys_eq(&self, other: &<Self as crate::Optionable>::Optioned) -> bool {
        self.name == other.name
    }
}
#[automatically_derived]
#[cfg(feature = "k8s_openapi_convert")]
impl crate::OptionedConvert<k8s_openapi028::api::core::v1::PodResourceClaimStatus>
for PodResourceClaimStatusAc {
    fn from_optionable(
        value: k8s_openapi028::api::core::v1::PodResourceClaimStatus,
    ) -> Self {
        crate::OptionableConvert::into_optioned(value)
    }
    fn try_into_optionable(
        self,
    ) -> Result<k8s_openapi028::api::core::v1::PodResourceClaimStatus, crate::Error> {
        crate::OptionableConvert::try_from_optioned(self)
    }
    fn merge_into(
        self,
        other: &mut k8s_openapi028::api::core::v1::PodResourceClaimStatus,
    ) -> Result<(), crate::Error> {
        crate::OptionableConvert::merge(other, self)
    }
}
impl k8s_openapi028::DeepMerge for PodResourceClaimStatusAc {
    fn merge_from(&mut self, other: Self) {
        k8s_openapi028::DeepMerge::merge_from(&mut self.name, other.name);
        k8s_openapi028::DeepMerge::merge_from(
            &mut self.resource_claim_name,
            other.resource_claim_name,
        );
    }
}
impl crate::merge::MapKeysEq for PodResourceClaimStatusAc {
    fn keys_eq(&self, other: &Self) -> bool {
        self.name == other.name
    }
}
