#[derive(
    Clone,
    Default,
    PartialEq,
    serde::Deserialize,
    serde::Serialize,
    std::fmt::Debug
)]
/// Eviction evicts a pod from its node subject to certain policies and safety constraints. This is a subresource of Pod.  A request to cause such an eviction is created by POSTing to .../pods/\<pod name\>/evictions.
#[serde(rename_all = "camelCase", deny_unknown_fields)]
pub struct EvictionAc {
    #[serde(
        serialize_with = "crate::k8s_openapi::serialize_api_version",
        deserialize_with = "crate::k8s_openapi::deserialize_api_version"
    )]
    pub api_version: std::marker::PhantomData<Self>,
    #[serde(
        serialize_with = "crate::k8s_openapi::serialize_kind",
        deserialize_with = "crate::k8s_openapi::deserialize_kind"
    )]
    pub kind: std::marker::PhantomData<Self>,
    /// DeleteOptions may be provided
    #[serde(skip_serializing_if = "Option::is_none")]
    pub delete_options: Option<
        <::k8s_openapi027::apimachinery::pkg::apis::meta::v1::DeleteOptions as crate::Optionable>::Optioned,
    >,
    /// ObjectMeta describes the pod that is being evicted.
    pub metadata: ::k8s_openapi027::apimachinery::pkg::apis::meta::v1::ObjectMeta,
}
#[automatically_derived]
impl crate::Optionable for k8s_openapi027::api::policy::v1::Eviction {
    type Optioned = EvictionAc;
}
#[automatically_derived]
impl crate::Optionable for EvictionAc {
    type Optioned = EvictionAc;
}
#[automatically_derived]
#[cfg(feature = "k8s_openapi_convert")]
impl crate::OptionableConvert for k8s_openapi027::api::policy::v1::Eviction {
    fn into_optioned(self) -> EvictionAc {
        EvictionAc {
            api_version: Default::default(),
            kind: Default::default(),
            delete_options: crate::OptionableConvert::into_optioned(self.delete_options),
            metadata: self.metadata,
        }
    }
    fn try_from_optioned(value: EvictionAc) -> Result<Self, crate::Error> {
        Ok(Self {
            delete_options: crate::OptionableConvert::try_from_optioned(
                value.delete_options,
            )?,
            metadata: value.metadata,
        })
    }
    fn merge(&mut self, other: EvictionAc) -> Result<(), crate::Error> {
        if self.delete_options.is_none() {
            self.delete_options = crate::OptionableConvert::try_from_optioned(
                other.delete_options,
            )?;
        } else if let Some(self_value) = self.delete_options.as_mut()
            && let Some(other_value) = other.delete_options
        {
            crate::OptionableConvert::merge(self_value, other_value)?;
        }
        self.metadata = other.metadata;
        Ok(())
    }
}
#[automatically_derived]
#[cfg(feature = "k8s_openapi_convert")]
impl crate::OptionedConvert<k8s_openapi027::api::policy::v1::Eviction> for EvictionAc {
    fn from_optionable(value: k8s_openapi027::api::policy::v1::Eviction) -> Self {
        crate::OptionableConvert::into_optioned(value)
    }
    fn try_into_optionable(
        self,
    ) -> Result<k8s_openapi027::api::policy::v1::Eviction, crate::Error> {
        crate::OptionableConvert::try_from_optioned(self)
    }
    fn merge_into(
        self,
        other: &mut k8s_openapi027::api::policy::v1::Eviction,
    ) -> Result<(), crate::Error> {
        crate::OptionableConvert::merge(other, self)
    }
}
impl k8s_openapi027::Resource for EvictionAc {
    const API_VERSION: &'static str = <k8s_openapi027::api::policy::v1::Eviction as k8s_openapi027::Resource>::API_VERSION;
    const GROUP: &'static str = <k8s_openapi027::api::policy::v1::Eviction as k8s_openapi027::Resource>::GROUP;
    const KIND: &'static str = <k8s_openapi027::api::policy::v1::Eviction as k8s_openapi027::Resource>::KIND;
    const VERSION: &'static str = <k8s_openapi027::api::policy::v1::Eviction as k8s_openapi027::Resource>::VERSION;
    const URL_PATH_SEGMENT: &'static str = <k8s_openapi027::api::policy::v1::Eviction as k8s_openapi027::Resource>::URL_PATH_SEGMENT;
    type Scope = <k8s_openapi027::api::policy::v1::Eviction as k8s_openapi027::Resource>::Scope;
}
impl k8s_openapi027::Metadata for EvictionAc {
    type Ty = <k8s_openapi027::api::policy::v1::Eviction as k8s_openapi027::Metadata>::Ty;
    fn metadata(&self) -> &<Self as k8s_openapi027::Metadata>::Ty {
        &self.metadata
    }
    fn metadata_mut(&mut self) -> &mut <Self as k8s_openapi027::Metadata>::Ty {
        &mut self.metadata
    }
}
#[cfg(test_k8s_openapi_roundtrip)]
#[test]
fn roundtrip_evictionac() {
    crate::testutil::roundtrip_test::<k8s_openapi027::api::policy::v1::Eviction>();
}
impl k8s_openapi027::DeepMerge for EvictionAc {
    fn merge_from(&mut self, other: Self) {
        k8s_openapi027::DeepMerge::merge_from(
            &mut self.delete_options,
            other.delete_options,
        );
        k8s_openapi027::DeepMerge::merge_from(&mut self.metadata, other.metadata);
    }
}
