#[derive(
    Clone,
    Default,
    PartialEq,
    serde::Deserialize,
    serde::Serialize,
    std::fmt::Debug
)]
/// ClusterTrustBundle is a cluster-scoped container for X.509 trust anchors (root certificates).
///
/// ClusterTrustBundle objects are considered to be readable by any authenticated user in the cluster, because they can be mounted by pods using the `clusterTrustBundle` projection.  All service accounts have read access to ClusterTrustBundles by default.  Users who only have namespace-level access to a cluster can read ClusterTrustBundles by impersonating a serviceaccount that they have access to.
///
/// It can be optionally associated with a particular assigner, in which case it contains one valid set of trust anchors for that signer. Signers may have multiple associated ClusterTrustBundles; each is an independent set of trust anchors for that signer. Admission control is used to enforce that only users with permissions on the signer can create or modify the corresponding bundle.
#[serde(rename_all = "camelCase", deny_unknown_fields)]
pub struct ClusterTrustBundleAc {
    #[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>,
    /// metadata contains the object metadata.
    pub metadata: ::k8s_openapi027::apimachinery::pkg::apis::meta::v1::ObjectMeta,
    /// spec contains the signer (if any) and trust anchors.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub spec: Option<
        <::k8s_openapi027::api::certificates::v1beta1::ClusterTrustBundleSpec as crate::Optionable>::Optioned,
    >,
}
#[automatically_derived]
impl crate::Optionable
for k8s_openapi027::api::certificates::v1beta1::ClusterTrustBundle {
    type Optioned = ClusterTrustBundleAc;
}
#[automatically_derived]
impl crate::Optionable for ClusterTrustBundleAc {
    type Optioned = ClusterTrustBundleAc;
}
#[automatically_derived]
#[cfg(feature = "k8s_openapi_convert")]
impl crate::OptionableConvert
for k8s_openapi027::api::certificates::v1beta1::ClusterTrustBundle {
    fn into_optioned(self) -> ClusterTrustBundleAc {
        ClusterTrustBundleAc {
            api_version: Default::default(),
            kind: Default::default(),
            metadata: self.metadata,
            spec: Some(crate::OptionableConvert::into_optioned(self.spec)),
        }
    }
    fn try_from_optioned(value: ClusterTrustBundleAc) -> Result<Self, crate::Error> {
        Ok(Self {
            metadata: value.metadata,
            spec: crate::OptionableConvert::try_from_optioned(
                value
                    .spec
                    .ok_or(crate::Error {
                        missing_field: "spec",
                    })?,
            )?,
        })
    }
    fn merge(&mut self, other: ClusterTrustBundleAc) -> Result<(), crate::Error> {
        self.metadata = other.metadata;
        if let Some(other_value) = other.spec {
            crate::OptionableConvert::merge(&mut self.spec, other_value)?;
        }
        Ok(())
    }
}
#[automatically_derived]
#[cfg(feature = "k8s_openapi_convert")]
impl crate::OptionedConvert<
    k8s_openapi027::api::certificates::v1beta1::ClusterTrustBundle,
> for ClusterTrustBundleAc {
    fn from_optionable(
        value: k8s_openapi027::api::certificates::v1beta1::ClusterTrustBundle,
    ) -> Self {
        crate::OptionableConvert::into_optioned(value)
    }
    fn try_into_optionable(
        self,
    ) -> Result<
        k8s_openapi027::api::certificates::v1beta1::ClusterTrustBundle,
        crate::Error,
    > {
        crate::OptionableConvert::try_from_optioned(self)
    }
    fn merge_into(
        self,
        other: &mut k8s_openapi027::api::certificates::v1beta1::ClusterTrustBundle,
    ) -> Result<(), crate::Error> {
        crate::OptionableConvert::merge(other, self)
    }
}
impl k8s_openapi027::Resource for ClusterTrustBundleAc {
    const API_VERSION: &'static str = <k8s_openapi027::api::certificates::v1beta1::ClusterTrustBundle as k8s_openapi027::Resource>::API_VERSION;
    const GROUP: &'static str = <k8s_openapi027::api::certificates::v1beta1::ClusterTrustBundle as k8s_openapi027::Resource>::GROUP;
    const KIND: &'static str = <k8s_openapi027::api::certificates::v1beta1::ClusterTrustBundle as k8s_openapi027::Resource>::KIND;
    const VERSION: &'static str = <k8s_openapi027::api::certificates::v1beta1::ClusterTrustBundle as k8s_openapi027::Resource>::VERSION;
    const URL_PATH_SEGMENT: &'static str = <k8s_openapi027::api::certificates::v1beta1::ClusterTrustBundle as k8s_openapi027::Resource>::URL_PATH_SEGMENT;
    type Scope = <k8s_openapi027::api::certificates::v1beta1::ClusterTrustBundle as k8s_openapi027::Resource>::Scope;
}
impl k8s_openapi027::Metadata for ClusterTrustBundleAc {
    type Ty = <k8s_openapi027::api::certificates::v1beta1::ClusterTrustBundle 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_clustertrustbundleac() {
    crate::testutil::roundtrip_test::<
        k8s_openapi027::api::certificates::v1beta1::ClusterTrustBundle,
    >();
}
impl k8s_openapi027::DeepMerge for ClusterTrustBundleAc {
    fn merge_from(&mut self, other: Self) {
        k8s_openapi027::DeepMerge::merge_from(&mut self.metadata, other.metadata);
        k8s_openapi027::DeepMerge::merge_from(&mut self.spec, other.spec);
    }
}
