#[derive(
    Clone,
    Default,
    PartialEq,
    serde::Deserialize,
    serde::Serialize,
    std::fmt::Debug
)]
#[serde(rename_all = "camelCase")]
pub struct HPAScalingRulesAc {
    #[serde(skip_serializing_if = "Option::is_none")]
    pub policies: <Option<
        std::vec::Vec<::k8s_openapi::api::autoscaling::v2::HPAScalingPolicy>,
    > as crate::Optionable>::Optioned,
    #[serde(skip_serializing_if = "Option::is_none")]
    pub select_policy: <Option<std::string::String> as crate::Optionable>::Optioned,
    #[serde(skip_serializing_if = "Option::is_none")]
    pub stabilization_window_seconds: <Option<i32> as crate::Optionable>::Optioned,
}
#[automatically_derived]
impl crate::Optionable for ::k8s_openapi::api::autoscaling::v2::HPAScalingRules {
    type Optioned = HPAScalingRulesAc;
}
#[automatically_derived]
impl crate::Optionable for HPAScalingRulesAc {
    type Optioned = HPAScalingRulesAc;
}
#[automatically_derived]
#[cfg(feature = "k8s_openapi_convert")]
impl crate::OptionableConvert for ::k8s_openapi::api::autoscaling::v2::HPAScalingRules {
    fn into_optioned(self) -> HPAScalingRulesAc {
        HPAScalingRulesAc {
            policies: crate::OptionableConvert::into_optioned(self.policies),
            select_policy: crate::OptionableConvert::into_optioned(self.select_policy),
            stabilization_window_seconds: crate::OptionableConvert::into_optioned(
                self.stabilization_window_seconds,
            ),
        }
    }
    fn try_from_optioned(value: HPAScalingRulesAc) -> Result<Self, crate::Error> {
        Ok(Self {
            policies: crate::OptionableConvert::try_from_optioned(value.policies)?,
            select_policy: crate::OptionableConvert::try_from_optioned(
                value.select_policy,
            )?,
            stabilization_window_seconds: crate::OptionableConvert::try_from_optioned(
                value.stabilization_window_seconds,
            )?,
        })
    }
    fn merge(&mut self, other: HPAScalingRulesAc) -> Result<(), crate::Error> {
        crate::OptionableConvert::merge(&mut self.policies, other.policies)?;
        crate::OptionableConvert::merge(&mut self.select_policy, other.select_policy)?;
        crate::OptionableConvert::merge(
            &mut self.stabilization_window_seconds,
            other.stabilization_window_seconds,
        )?;
        Ok(())
    }
}
