#[derive(
    Clone,
    Default,
    PartialEq,
    serde::Deserialize,
    serde::Serialize,
    std::fmt::Debug
)]
/// GroupSubject holds detailed information for group-kind subject.
#[serde(rename_all = "camelCase", deny_unknown_fields)]
pub struct GroupSubjectAc {
    /// name is the user group that matches, or "*" to match all user groups. See https://github.com/kubernetes/apiserver/blob/master/pkg/authentication/user/user.go for some well-known group names. Required.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub name: Option<std::string::String>,
}
#[automatically_derived]
impl crate::Optionable for k8s_openapi028::api::flowcontrol::v1::GroupSubject {
    type Optioned = GroupSubjectAc;
}
#[automatically_derived]
impl crate::Optionable for GroupSubjectAc {
    type Optioned = GroupSubjectAc;
}
#[automatically_derived]
#[cfg(feature = "k8s_openapi_convert")]
impl crate::OptionableConvert for k8s_openapi028::api::flowcontrol::v1::GroupSubject {
    fn into_optioned(self) -> GroupSubjectAc {
        GroupSubjectAc {
            name: Some(self.name),
        }
    }
    fn try_from_optioned(value: GroupSubjectAc) -> Result<Self, crate::Error> {
        Ok(Self {
            name: value
                .name
                .ok_or(crate::Error {
                    missing_field: "name",
                })?,
        })
    }
    fn merge(&mut self, other: GroupSubjectAc) -> Result<(), crate::Error> {
        if let Some(other_value) = other.name {
            self.name = crate::OptionableConvert::try_from_optioned(other_value)?;
        }
        Ok(())
    }
}
#[automatically_derived]
#[cfg(feature = "k8s_openapi_convert")]
impl crate::OptionedConvert<k8s_openapi028::api::flowcontrol::v1::GroupSubject>
for GroupSubjectAc {
    fn from_optionable(
        value: k8s_openapi028::api::flowcontrol::v1::GroupSubject,
    ) -> Self {
        crate::OptionableConvert::into_optioned(value)
    }
    fn try_into_optionable(
        self,
    ) -> Result<k8s_openapi028::api::flowcontrol::v1::GroupSubject, crate::Error> {
        crate::OptionableConvert::try_from_optioned(self)
    }
    fn merge_into(
        self,
        other: &mut k8s_openapi028::api::flowcontrol::v1::GroupSubject,
    ) -> Result<(), crate::Error> {
        crate::OptionableConvert::merge(other, self)
    }
}
impl k8s_openapi028::DeepMerge for GroupSubjectAc {
    fn merge_from(&mut self, other: Self) {
        k8s_openapi028::DeepMerge::merge_from(&mut self.name, other.name);
    }
}
