#[derive(
    Clone,
    Default,
    PartialEq,
    serde::Deserialize,
    serde::Serialize,
    std::fmt::Debug
)]
/// GangSchedulingPolicy defines the parameters for gang scheduling.
#[serde(rename_all = "camelCase", deny_unknown_fields)]
pub struct GangSchedulingPolicyAc {
    /// MinCount is the minimum number of pods that must be schedulable or scheduled at the same time for the scheduler to admit the entire group. It must be a positive integer.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub min_count: Option<i32>,
}
#[automatically_derived]
impl crate::Optionable
for k8s_openapi028::api::scheduling::v1alpha2::GangSchedulingPolicy {
    type Optioned = GangSchedulingPolicyAc;
}
#[automatically_derived]
impl crate::Optionable for GangSchedulingPolicyAc {
    type Optioned = GangSchedulingPolicyAc;
}
#[automatically_derived]
#[cfg(feature = "k8s_openapi_convert")]
impl crate::OptionableConvert
for k8s_openapi028::api::scheduling::v1alpha2::GangSchedulingPolicy {
    fn into_optioned(self) -> GangSchedulingPolicyAc {
        GangSchedulingPolicyAc {
            min_count: Some(self.min_count),
        }
    }
    fn try_from_optioned(value: GangSchedulingPolicyAc) -> Result<Self, crate::Error> {
        Ok(Self {
            min_count: value
                .min_count
                .ok_or(crate::Error {
                    missing_field: "min_count",
                })?,
        })
    }
    fn merge(&mut self, other: GangSchedulingPolicyAc) -> Result<(), crate::Error> {
        if let Some(other_value) = other.min_count {
            self.min_count = crate::OptionableConvert::try_from_optioned(other_value)?;
        }
        Ok(())
    }
}
#[automatically_derived]
#[cfg(feature = "k8s_openapi_convert")]
impl crate::OptionedConvert<
    k8s_openapi028::api::scheduling::v1alpha2::GangSchedulingPolicy,
> for GangSchedulingPolicyAc {
    fn from_optionable(
        value: k8s_openapi028::api::scheduling::v1alpha2::GangSchedulingPolicy,
    ) -> Self {
        crate::OptionableConvert::into_optioned(value)
    }
    fn try_into_optionable(
        self,
    ) -> Result<
        k8s_openapi028::api::scheduling::v1alpha2::GangSchedulingPolicy,
        crate::Error,
    > {
        crate::OptionableConvert::try_from_optioned(self)
    }
    fn merge_into(
        self,
        other: &mut k8s_openapi028::api::scheduling::v1alpha2::GangSchedulingPolicy,
    ) -> Result<(), crate::Error> {
        crate::OptionableConvert::merge(other, self)
    }
}
impl k8s_openapi028::DeepMerge for GangSchedulingPolicyAc {
    fn merge_from(&mut self, other: Self) {
        k8s_openapi028::DeepMerge::merge_from(&mut self.min_count, other.min_count);
    }
}
