# Generated by cloudcoil-model-codegen v0.3.0
# DO NOT EDIT

from __future__ import annotations

from datetime import datetime
from typing import (
    Annotated,
    Any,
    Callable,
    Dict,
    List,
    Literal,
    Optional,
    Type,
    overload,
)

from pydantic import Field

from cloudcoil import apimachinery
from cloudcoil.pydantic import (
    BaseModel,
    BaseModelBuilder,
    BuilderContextBase,
    GenericListBuilder,
    ListBuilderContext,
    Never,
    Self,
)
from cloudcoil.resources import Resource


class IssuerRef(BaseModel):
    class Builder(BaseModelBuilder):
        @property
        def cls(self) -> Type["IssuerRef"]:
            return IssuerRef

        def build(self) -> "IssuerRef":
            return IssuerRef(**self._attrs)

        def group(self, value: Optional[str], /) -> Self:
            """
            Group of the resource being referred to.
            """
            return self._set("group", value)

        def kind(self, value: Optional[str], /) -> Self:
            """
            Kind of the resource being referred to.
            """
            return self._set("kind", value)

        def name(self, value: str, /) -> Self:
            """
            Name of the resource being referred to.
            """
            return self._set("name", value)

    class BuilderContext(BuilderContextBase["IssuerRef.Builder"]):
        def model_post_init(self, __context) -> None:
            self._builder = IssuerRef.Builder()
            self._builder._in_context = True
            self._parent_builder = None
            self._field_name = None

    @classmethod
    def builder(cls) -> Builder:
        return cls.Builder()

    @classmethod
    def new(cls) -> BuilderContext:
        """Creates a new context manager builder for IssuerRef."""
        return cls.BuilderContext()

    class ListBuilder(GenericListBuilder["IssuerRef", Builder]):
        def __init__(self):
            raise NotImplementedError(
                "This class is not meant to be instantiated. Use IssuerRef.list_builder() instead."
            )

    @classmethod
    def list_builder(cls) -> ListBuilder:
        return GenericListBuilder[cls, cls.Builder]()  # type: ignore

    group: Optional[str] = None
    """
    Group of the resource being referred to.
    """
    kind: Optional[str] = None
    """
    Kind of the resource being referred to.
    """
    name: str
    """
    Name of the resource being referred to.
    """


class CertificateRequestSpec(BaseModel):
    class Builder(BaseModelBuilder):
        @property
        def cls(self) -> Type["CertificateRequestSpec"]:
            return CertificateRequestSpec

        def build(self) -> "CertificateRequestSpec":
            return CertificateRequestSpec(**self._attrs)

        def duration(self, value: Optional[str], /) -> Self:
            """
            Requested 'duration' (i.e. lifetime) of the Certificate. Note that the
            issuer may choose to ignore the requested duration, just like any other
            requested attribute.
            """
            return self._set("duration", value)

        def extra(self, value: Optional[Dict[str, List[str]]], /) -> Self:
            """
            Extra contains extra attributes of the user that created the CertificateRequest.
            Populated by the cert-manager webhook on creation and immutable.
            """
            return self._set("extra", value)

        def groups(self, value: Optional[List[str]], /) -> Self:
            """
            Groups contains group membership of the user that created the CertificateRequest.
            Populated by the cert-manager webhook on creation and immutable.
            """
            return self._set("groups", value)

        def is_ca(self, value: Optional[bool], /) -> Self:
            """
            Requested basic constraints isCA value. Note that the issuer may choose
            to ignore the requested isCA value, just like any other requested attribute.

            NOTE: If the CSR in the `Request` field has a BasicConstraints extension,
            it must have the same isCA value as specified here.

            If true, this will automatically add the `cert sign` usage to the list
            of requested `usages`.
            """
            return self._set("is_ca", value)

        @overload
        def issuer_ref(
            self, value_or_callback: IssuerRef, /
        ) -> "CertificateRequestSpec.Builder": ...

        @overload
        def issuer_ref(
            self,
            value_or_callback: Callable[[IssuerRef.Builder], IssuerRef.Builder | IssuerRef],
            /,
        ) -> "CertificateRequestSpec.Builder": ...

        @overload
        def issuer_ref(self, value_or_callback: Never = ...) -> "IssuerRef.BuilderContext": ...

        def issuer_ref(self, value_or_callback=None, /):
            """
            Reference to the issuer responsible for issuing the certificate.
            If the issuer is namespace-scoped, it must be in the same namespace
            as the Certificate. If the issuer is cluster-scoped, it can be used
            from any namespace.

            The `name` field of the reference must always be specified.
            """
            if self._in_context and value_or_callback is None:
                context = IssuerRef.BuilderContext()
                context._parent_builder = self
                context._field_name = "issuer_ref"
                return context

            value = value_or_callback
            if callable(value_or_callback):
                output = value_or_callback(IssuerRef.builder())
                if isinstance(output, IssuerRef.Builder):
                    value = output.build()
                else:
                    value = output
            return self._set("issuer_ref", value)

        def request(self, value: str, /) -> Self:
            """
            The PEM-encoded X.509 certificate signing request to be submitted to the
            issuer for signing.

            If the CSR has a BasicConstraints extension, its isCA attribute must
            match the `isCA` value of this CertificateRequest.
            If the CSR has a KeyUsage extension, its key usages must match the
            key usages in the `usages` field of this CertificateRequest.
            If the CSR has a ExtKeyUsage extension, its extended key usages
            must match the extended key usages in the `usages` field of this
            CertificateRequest.
            """
            return self._set("request", value)

        def uid(self, value: Optional[str], /) -> Self:
            """
            UID contains the uid of the user that created the CertificateRequest.
            Populated by the cert-manager webhook on creation and immutable.
            """
            return self._set("uid", value)

        def usages(
            self,
            value: Optional[
                List[
                    Literal[
                        "signing",
                        "digital signature",
                        "content commitment",
                        "key encipherment",
                        "key agreement",
                        "data encipherment",
                        "cert sign",
                        "crl sign",
                        "encipher only",
                        "decipher only",
                        "any",
                        "server auth",
                        "client auth",
                        "code signing",
                        "email protection",
                        "s/mime",
                        "ipsec end system",
                        "ipsec tunnel",
                        "ipsec user",
                        "timestamping",
                        "ocsp signing",
                        "microsoft sgc",
                        "netscape sgc",
                    ]
                ]
            ],
            /,
        ) -> Self:
            """
            Requested key usages and extended key usages.

            NOTE: If the CSR in the `Request` field has uses the KeyUsage or
            ExtKeyUsage extension, these extensions must have the same values
            as specified here without any additional values.

            If unset, defaults to `digital signature` and `key encipherment`.
            """
            return self._set("usages", value)

        def username(self, value: Optional[str], /) -> Self:
            """
            Username contains the name of the user that created the CertificateRequest.
            Populated by the cert-manager webhook on creation and immutable.
            """
            return self._set("username", value)

    class BuilderContext(BuilderContextBase["CertificateRequestSpec.Builder"]):
        def model_post_init(self, __context) -> None:
            self._builder = CertificateRequestSpec.Builder()
            self._builder._in_context = True
            self._parent_builder = None
            self._field_name = None

    @classmethod
    def builder(cls) -> Builder:
        return cls.Builder()

    @classmethod
    def new(cls) -> BuilderContext:
        """Creates a new context manager builder for CertificateRequestSpec."""
        return cls.BuilderContext()

    class ListBuilder(GenericListBuilder["CertificateRequestSpec", Builder]):
        def __init__(self):
            raise NotImplementedError(
                "This class is not meant to be instantiated. Use CertificateRequestSpec.list_builder() instead."
            )

    @classmethod
    def list_builder(cls) -> ListBuilder:
        return GenericListBuilder[cls, cls.Builder]()  # type: ignore

    duration: Optional[str] = None
    """
    Requested 'duration' (i.e. lifetime) of the Certificate. Note that the
    issuer may choose to ignore the requested duration, just like any other
    requested attribute.
    """
    extra: Optional[Dict[str, List[str]]] = None
    """
    Extra contains extra attributes of the user that created the CertificateRequest.
    Populated by the cert-manager webhook on creation and immutable.
    """
    groups: Optional[List[str]] = None
    """
    Groups contains group membership of the user that created the CertificateRequest.
    Populated by the cert-manager webhook on creation and immutable.
    """
    is_ca: Annotated[Optional[bool], Field(alias="isCA")] = None
    """
    Requested basic constraints isCA value. Note that the issuer may choose
    to ignore the requested isCA value, just like any other requested attribute.

    NOTE: If the CSR in the `Request` field has a BasicConstraints extension,
    it must have the same isCA value as specified here.

    If true, this will automatically add the `cert sign` usage to the list
    of requested `usages`.
    """
    issuer_ref: Annotated[IssuerRef, Field(alias="issuerRef")]
    """
    Reference to the issuer responsible for issuing the certificate.
    If the issuer is namespace-scoped, it must be in the same namespace
    as the Certificate. If the issuer is cluster-scoped, it can be used
    from any namespace.

    The `name` field of the reference must always be specified.
    """
    request: str
    """
    The PEM-encoded X.509 certificate signing request to be submitted to the
    issuer for signing.

    If the CSR has a BasicConstraints extension, its isCA attribute must
    match the `isCA` value of this CertificateRequest.
    If the CSR has a KeyUsage extension, its key usages must match the
    key usages in the `usages` field of this CertificateRequest.
    If the CSR has a ExtKeyUsage extension, its extended key usages
    must match the extended key usages in the `usages` field of this
    CertificateRequest.
    """
    uid: Optional[str] = None
    """
    UID contains the uid of the user that created the CertificateRequest.
    Populated by the cert-manager webhook on creation and immutable.
    """
    usages: Optional[
        List[
            Literal[
                "signing",
                "digital signature",
                "content commitment",
                "key encipherment",
                "key agreement",
                "data encipherment",
                "cert sign",
                "crl sign",
                "encipher only",
                "decipher only",
                "any",
                "server auth",
                "client auth",
                "code signing",
                "email protection",
                "s/mime",
                "ipsec end system",
                "ipsec tunnel",
                "ipsec user",
                "timestamping",
                "ocsp signing",
                "microsoft sgc",
                "netscape sgc",
            ]
        ]
    ] = None
    """
    Requested key usages and extended key usages.

    NOTE: If the CSR in the `Request` field has uses the KeyUsage or
    ExtKeyUsage extension, these extensions must have the same values
    as specified here without any additional values.

    If unset, defaults to `digital signature` and `key encipherment`.
    """
    username: Optional[str] = None
    """
    Username contains the name of the user that created the CertificateRequest.
    Populated by the cert-manager webhook on creation and immutable.
    """


class Condition(BaseModel):
    class Builder(BaseModelBuilder):
        @property
        def cls(self) -> Type["Condition"]:
            return Condition

        def build(self) -> "Condition":
            return Condition(**self._attrs)

        def last_transition_time(self, value: Optional[datetime], /) -> Self:
            """
            LastTransitionTime is the timestamp corresponding to the last status
            change of this condition.
            """
            return self._set("last_transition_time", value)

        def message(self, value: Optional[str], /) -> Self:
            """
            Message is a human readable description of the details of the last
            transition, complementing reason.
            """
            return self._set("message", value)

        def reason(self, value: Optional[str], /) -> Self:
            """
            Reason is a brief machine readable explanation for the condition's last
            transition.
            """
            return self._set("reason", value)

        def status(self, value: Literal["True", "False", "Unknown"], /) -> Self:
            """
            Status of the condition, one of (`True`, `False`, `Unknown`).
            """
            return self._set("status", value)

        def type(self, value: str, /) -> Self:
            """
            Type of the condition, known values are (`Ready`, `InvalidRequest`,
            `Approved`, `Denied`).
            """
            return self._set("type", value)

    class BuilderContext(BuilderContextBase["Condition.Builder"]):
        def model_post_init(self, __context) -> None:
            self._builder = Condition.Builder()
            self._builder._in_context = True
            self._parent_builder = None
            self._field_name = None

    @classmethod
    def builder(cls) -> Builder:
        return cls.Builder()

    @classmethod
    def new(cls) -> BuilderContext:
        """Creates a new context manager builder for Condition."""
        return cls.BuilderContext()

    class ListBuilder(GenericListBuilder["Condition", Builder]):
        def __init__(self):
            raise NotImplementedError(
                "This class is not meant to be instantiated. Use Condition.list_builder() instead."
            )

    @classmethod
    def list_builder(cls) -> ListBuilder:
        return GenericListBuilder[cls, cls.Builder]()  # type: ignore

    last_transition_time: Annotated[Optional[datetime], Field(alias="lastTransitionTime")] = None
    """
    LastTransitionTime is the timestamp corresponding to the last status
    change of this condition.
    """
    message: Optional[str] = None
    """
    Message is a human readable description of the details of the last
    transition, complementing reason.
    """
    reason: Optional[str] = None
    """
    Reason is a brief machine readable explanation for the condition's last
    transition.
    """
    status: Literal["True", "False", "Unknown"]
    """
    Status of the condition, one of (`True`, `False`, `Unknown`).
    """
    type: str
    """
    Type of the condition, known values are (`Ready`, `InvalidRequest`,
    `Approved`, `Denied`).
    """


class CertificateRequestStatus(BaseModel):
    class Builder(BaseModelBuilder):
        @property
        def cls(self) -> Type["CertificateRequestStatus"]:
            return CertificateRequestStatus

        def build(self) -> "CertificateRequestStatus":
            return CertificateRequestStatus(**self._attrs)

        def ca(self, value: Optional[str], /) -> Self:
            """
            The PEM encoded X.509 certificate of the signer, also known as the CA
            (Certificate Authority).
            This is set on a best-effort basis by different issuers.
            If not set, the CA is assumed to be unknown/not available.
            """
            return self._set("ca", value)

        def certificate(self, value: Optional[str], /) -> Self:
            """
            The PEM encoded X.509 certificate resulting from the certificate
            signing request.
            If not set, the CertificateRequest has either not been completed or has
            failed. More information on failure can be found by checking the
            `conditions` field.
            """
            return self._set("certificate", value)

        @overload
        def conditions(
            self, value_or_callback: List[Condition], /
        ) -> "CertificateRequestStatus.Builder": ...

        @overload
        def conditions(
            self,
            value_or_callback: Callable[
                [GenericListBuilder[Condition, Condition.Builder]],
                GenericListBuilder[Condition, Condition.Builder] | List[Condition],
            ],
            /,
        ) -> "CertificateRequestStatus.Builder": ...

        @overload
        def conditions(
            self, value_or_callback: Never = ...
        ) -> ListBuilderContext[Condition.Builder]: ...

        def conditions(self, value_or_callback=None, /):
            """
            List of status conditions to indicate the status of a CertificateRequest.
            Known condition types are `Ready`, `InvalidRequest`, `Approved` and `Denied`.
            """
            if self._in_context and value_or_callback is None:
                context = ListBuilderContext[Condition.Builder]()
                context._parent_builder = self
                context._field_name = "conditions"
                return context

            value = value_or_callback
            if callable(value_or_callback):
                output = value_or_callback(Condition.list_builder())
                if isinstance(output, GenericListBuilder):
                    value = output.build()
                else:
                    value = output
            return self._set("conditions", value)

        def failure_time(self, value: Optional[datetime], /) -> Self:
            """
            FailureTime stores the time that this CertificateRequest failed. This is
            used to influence garbage collection and back-off.
            """
            return self._set("failure_time", value)

    class BuilderContext(BuilderContextBase["CertificateRequestStatus.Builder"]):
        def model_post_init(self, __context) -> None:
            self._builder = CertificateRequestStatus.Builder()
            self._builder._in_context = True
            self._parent_builder = None
            self._field_name = None

    @classmethod
    def builder(cls) -> Builder:
        return cls.Builder()

    @classmethod
    def new(cls) -> BuilderContext:
        """Creates a new context manager builder for CertificateRequestStatus."""
        return cls.BuilderContext()

    class ListBuilder(GenericListBuilder["CertificateRequestStatus", Builder]):
        def __init__(self):
            raise NotImplementedError(
                "This class is not meant to be instantiated. Use CertificateRequestStatus.list_builder() instead."
            )

    @classmethod
    def list_builder(cls) -> ListBuilder:
        return GenericListBuilder[cls, cls.Builder]()  # type: ignore

    ca: Optional[str] = None
    """
    The PEM encoded X.509 certificate of the signer, also known as the CA
    (Certificate Authority).
    This is set on a best-effort basis by different issuers.
    If not set, the CA is assumed to be unknown/not available.
    """
    certificate: Optional[str] = None
    """
    The PEM encoded X.509 certificate resulting from the certificate
    signing request.
    If not set, the CertificateRequest has either not been completed or has
    failed. More information on failure can be found by checking the
    `conditions` field.
    """
    conditions: Optional[List[Condition]] = None
    """
    List of status conditions to indicate the status of a CertificateRequest.
    Known condition types are `Ready`, `InvalidRequest`, `Approved` and `Denied`.
    """
    failure_time: Annotated[Optional[datetime], Field(alias="failureTime")] = None
    """
    FailureTime stores the time that this CertificateRequest failed. This is
    used to influence garbage collection and back-off.
    """


class AdditionalOutputFormat(BaseModel):
    class Builder(BaseModelBuilder):
        @property
        def cls(self) -> Type["AdditionalOutputFormat"]:
            return AdditionalOutputFormat

        def build(self) -> "AdditionalOutputFormat":
            return AdditionalOutputFormat(**self._attrs)

        def type(self, value: Literal["DER", "CombinedPEM"], /) -> Self:
            """
            Type is the name of the format type that should be written to the
            Certificate's target Secret.
            """
            return self._set("type", value)

    class BuilderContext(BuilderContextBase["AdditionalOutputFormat.Builder"]):
        def model_post_init(self, __context) -> None:
            self._builder = AdditionalOutputFormat.Builder()
            self._builder._in_context = True
            self._parent_builder = None
            self._field_name = None

    @classmethod
    def builder(cls) -> Builder:
        return cls.Builder()

    @classmethod
    def new(cls) -> BuilderContext:
        """Creates a new context manager builder for AdditionalOutputFormat."""
        return cls.BuilderContext()

    class ListBuilder(GenericListBuilder["AdditionalOutputFormat", Builder]):
        def __init__(self):
            raise NotImplementedError(
                "This class is not meant to be instantiated. Use AdditionalOutputFormat.list_builder() instead."
            )

    @classmethod
    def list_builder(cls) -> ListBuilder:
        return GenericListBuilder[cls, cls.Builder]()  # type: ignore

    type: Literal["DER", "CombinedPEM"]
    """
    Type is the name of the format type that should be written to the
    Certificate's target Secret.
    """


class PasswordSecretRef(BaseModel):
    class Builder(BaseModelBuilder):
        @property
        def cls(self) -> Type["PasswordSecretRef"]:
            return PasswordSecretRef

        def build(self) -> "PasswordSecretRef":
            return PasswordSecretRef(**self._attrs)

        def key(self, value: Optional[str], /) -> Self:
            """
            The key of the entry in the Secret resource's `data` field to be used.
            Some instances of this field may be defaulted, in others it may be
            required.
            """
            return self._set("key", value)

        def name(self, value: str, /) -> Self:
            """
            Name of the resource being referred to.
            More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
            """
            return self._set("name", value)

    class BuilderContext(BuilderContextBase["PasswordSecretRef.Builder"]):
        def model_post_init(self, __context) -> None:
            self._builder = PasswordSecretRef.Builder()
            self._builder._in_context = True
            self._parent_builder = None
            self._field_name = None

    @classmethod
    def builder(cls) -> Builder:
        return cls.Builder()

    @classmethod
    def new(cls) -> BuilderContext:
        """Creates a new context manager builder for PasswordSecretRef."""
        return cls.BuilderContext()

    class ListBuilder(GenericListBuilder["PasswordSecretRef", Builder]):
        def __init__(self):
            raise NotImplementedError(
                "This class is not meant to be instantiated. Use PasswordSecretRef.list_builder() instead."
            )

    @classmethod
    def list_builder(cls) -> ListBuilder:
        return GenericListBuilder[cls, cls.Builder]()  # type: ignore

    key: Optional[str] = None
    """
    The key of the entry in the Secret resource's `data` field to be used.
    Some instances of this field may be defaulted, in others it may be
    required.
    """
    name: str
    """
    Name of the resource being referred to.
    More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
    """


class Jks(BaseModel):
    class Builder(BaseModelBuilder):
        @property
        def cls(self) -> Type["Jks"]:
            return Jks

        def build(self) -> "Jks":
            return Jks(**self._attrs)

        def alias(self, value: Optional[str], /) -> Self:
            """
            Alias specifies the alias of the key in the keystore, required by the JKS format.
            If not provided, the default alias `certificate` will be used.
            """
            return self._set("alias", value)

        def create(self, value: bool, /) -> Self:
            """
            Create enables JKS keystore creation for the Certificate.
            If true, a file named `keystore.jks` will be created in the target
            Secret resource, encrypted using the password stored in
            `passwordSecretRef`.
            The keystore file will be updated immediately.
            If the issuer provided a CA certificate, a file named `truststore.jks`
            will also be created in the target Secret resource, encrypted using the
            password stored in `passwordSecretRef`
            containing the issuing Certificate Authority
            """
            return self._set("create", value)

        @overload
        def password_secret_ref(self, value_or_callback: PasswordSecretRef, /) -> "Jks.Builder": ...

        @overload
        def password_secret_ref(
            self,
            value_or_callback: Callable[
                [PasswordSecretRef.Builder],
                PasswordSecretRef.Builder | PasswordSecretRef,
            ],
            /,
        ) -> "Jks.Builder": ...

        @overload
        def password_secret_ref(
            self, value_or_callback: Never = ...
        ) -> "PasswordSecretRef.BuilderContext": ...

        def password_secret_ref(self, value_or_callback=None, /):
            """
            PasswordSecretRef is a reference to a key in a Secret resource
            containing the password used to encrypt the JKS keystore.
            """
            if self._in_context and value_or_callback is None:
                context = PasswordSecretRef.BuilderContext()
                context._parent_builder = self
                context._field_name = "password_secret_ref"
                return context

            value = value_or_callback
            if callable(value_or_callback):
                output = value_or_callback(PasswordSecretRef.builder())
                if isinstance(output, PasswordSecretRef.Builder):
                    value = output.build()
                else:
                    value = output
            return self._set("password_secret_ref", value)

    class BuilderContext(BuilderContextBase["Jks.Builder"]):
        def model_post_init(self, __context) -> None:
            self._builder = Jks.Builder()
            self._builder._in_context = True
            self._parent_builder = None
            self._field_name = None

    @classmethod
    def builder(cls) -> Builder:
        return cls.Builder()

    @classmethod
    def new(cls) -> BuilderContext:
        """Creates a new context manager builder for Jks."""
        return cls.BuilderContext()

    class ListBuilder(GenericListBuilder["Jks", Builder]):
        def __init__(self):
            raise NotImplementedError(
                "This class is not meant to be instantiated. Use Jks.list_builder() instead."
            )

    @classmethod
    def list_builder(cls) -> ListBuilder:
        return GenericListBuilder[cls, cls.Builder]()  # type: ignore

    alias: Optional[str] = None
    """
    Alias specifies the alias of the key in the keystore, required by the JKS format.
    If not provided, the default alias `certificate` will be used.
    """
    create: bool
    """
    Create enables JKS keystore creation for the Certificate.
    If true, a file named `keystore.jks` will be created in the target
    Secret resource, encrypted using the password stored in
    `passwordSecretRef`.
    The keystore file will be updated immediately.
    If the issuer provided a CA certificate, a file named `truststore.jks`
    will also be created in the target Secret resource, encrypted using the
    password stored in `passwordSecretRef`
    containing the issuing Certificate Authority
    """
    password_secret_ref: Annotated[PasswordSecretRef, Field(alias="passwordSecretRef")]
    """
    PasswordSecretRef is a reference to a key in a Secret resource
    containing the password used to encrypt the JKS keystore.
    """


class Pkcs12(BaseModel):
    class Builder(BaseModelBuilder):
        @property
        def cls(self) -> Type["Pkcs12"]:
            return Pkcs12

        def build(self) -> "Pkcs12":
            return Pkcs12(**self._attrs)

        def create(self, value: bool, /) -> Self:
            """
            Create enables PKCS12 keystore creation for the Certificate.
            If true, a file named `keystore.p12` will be created in the target
            Secret resource, encrypted using the password stored in
            `passwordSecretRef`.
            The keystore file will be updated immediately.
            If the issuer provided a CA certificate, a file named `truststore.p12` will
            also be created in the target Secret resource, encrypted using the
            password stored in `passwordSecretRef` containing the issuing Certificate
            Authority
            """
            return self._set("create", value)

        @overload
        def password_secret_ref(
            self, value_or_callback: PasswordSecretRef, /
        ) -> "Pkcs12.Builder": ...

        @overload
        def password_secret_ref(
            self,
            value_or_callback: Callable[
                [PasswordSecretRef.Builder],
                PasswordSecretRef.Builder | PasswordSecretRef,
            ],
            /,
        ) -> "Pkcs12.Builder": ...

        @overload
        def password_secret_ref(
            self, value_or_callback: Never = ...
        ) -> "PasswordSecretRef.BuilderContext": ...

        def password_secret_ref(self, value_or_callback=None, /):
            """
            PasswordSecretRef is a reference to a key in a Secret resource
            containing the password used to encrypt the PKCS12 keystore.
            """
            if self._in_context and value_or_callback is None:
                context = PasswordSecretRef.BuilderContext()
                context._parent_builder = self
                context._field_name = "password_secret_ref"
                return context

            value = value_or_callback
            if callable(value_or_callback):
                output = value_or_callback(PasswordSecretRef.builder())
                if isinstance(output, PasswordSecretRef.Builder):
                    value = output.build()
                else:
                    value = output
            return self._set("password_secret_ref", value)

        def profile(
            self, value: Optional[Literal["LegacyRC2", "LegacyDES", "Modern2023"]], /
        ) -> Self:
            """
            Profile specifies the key and certificate encryption algorithms and the HMAC algorithm
            used to create the PKCS12 keystore. Default value is `LegacyRC2` for backward compatibility.

            If provided, allowed values are:
            `LegacyRC2`: Deprecated. Not supported by default in OpenSSL 3 or Java 20.
            `LegacyDES`: Less secure algorithm. Use this option for maximal compatibility.
            `Modern2023`: Secure algorithm. Use this option in case you have to always use secure algorithms
            (eg. because of company policy). Please note that the security of the algorithm is not that important
            in reality, because the unencrypted certificate and private key are also stored in the Secret.
            """
            return self._set("profile", value)

    class BuilderContext(BuilderContextBase["Pkcs12.Builder"]):
        def model_post_init(self, __context) -> None:
            self._builder = Pkcs12.Builder()
            self._builder._in_context = True
            self._parent_builder = None
            self._field_name = None

    @classmethod
    def builder(cls) -> Builder:
        return cls.Builder()

    @classmethod
    def new(cls) -> BuilderContext:
        """Creates a new context manager builder for Pkcs12."""
        return cls.BuilderContext()

    class ListBuilder(GenericListBuilder["Pkcs12", Builder]):
        def __init__(self):
            raise NotImplementedError(
                "This class is not meant to be instantiated. Use Pkcs12.list_builder() instead."
            )

    @classmethod
    def list_builder(cls) -> ListBuilder:
        return GenericListBuilder[cls, cls.Builder]()  # type: ignore

    create: bool
    """
    Create enables PKCS12 keystore creation for the Certificate.
    If true, a file named `keystore.p12` will be created in the target
    Secret resource, encrypted using the password stored in
    `passwordSecretRef`.
    The keystore file will be updated immediately.
    If the issuer provided a CA certificate, a file named `truststore.p12` will
    also be created in the target Secret resource, encrypted using the
    password stored in `passwordSecretRef` containing the issuing Certificate
    Authority
    """
    password_secret_ref: Annotated[PasswordSecretRef, Field(alias="passwordSecretRef")]
    """
    PasswordSecretRef is a reference to a key in a Secret resource
    containing the password used to encrypt the PKCS12 keystore.
    """
    profile: Optional[Literal["LegacyRC2", "LegacyDES", "Modern2023"]] = None
    """
    Profile specifies the key and certificate encryption algorithms and the HMAC algorithm
    used to create the PKCS12 keystore. Default value is `LegacyRC2` for backward compatibility.

    If provided, allowed values are:
    `LegacyRC2`: Deprecated. Not supported by default in OpenSSL 3 or Java 20.
    `LegacyDES`: Less secure algorithm. Use this option for maximal compatibility.
    `Modern2023`: Secure algorithm. Use this option in case you have to always use secure algorithms
    (eg. because of company policy). Please note that the security of the algorithm is not that important
    in reality, because the unencrypted certificate and private key are also stored in the Secret.
    """


class Keystores(BaseModel):
    class Builder(BaseModelBuilder):
        @property
        def cls(self) -> Type["Keystores"]:
            return Keystores

        def build(self) -> "Keystores":
            return Keystores(**self._attrs)

        @overload
        def jks(self, value_or_callback: Optional[Jks], /) -> "Keystores.Builder": ...

        @overload
        def jks(
            self, value_or_callback: Callable[[Jks.Builder], Jks.Builder | Jks], /
        ) -> "Keystores.Builder": ...

        @overload
        def jks(self, value_or_callback: Never = ...) -> "Jks.BuilderContext": ...

        def jks(self, value_or_callback=None, /):
            """
            JKS configures options for storing a JKS keystore in the
            `spec.secretName` Secret resource.
            """
            if self._in_context and value_or_callback is None:
                context = Jks.BuilderContext()
                context._parent_builder = self
                context._field_name = "jks"
                return context

            value = value_or_callback
            if callable(value_or_callback):
                output = value_or_callback(Jks.builder())
                if isinstance(output, Jks.Builder):
                    value = output.build()
                else:
                    value = output
            return self._set("jks", value)

        @overload
        def pkcs12(self, value_or_callback: Optional[Pkcs12], /) -> "Keystores.Builder": ...

        @overload
        def pkcs12(
            self,
            value_or_callback: Callable[[Pkcs12.Builder], Pkcs12.Builder | Pkcs12],
            /,
        ) -> "Keystores.Builder": ...

        @overload
        def pkcs12(self, value_or_callback: Never = ...) -> "Pkcs12.BuilderContext": ...

        def pkcs12(self, value_or_callback=None, /):
            """
            PKCS12 configures options for storing a PKCS12 keystore in the
            `spec.secretName` Secret resource.
            """
            if self._in_context and value_or_callback is None:
                context = Pkcs12.BuilderContext()
                context._parent_builder = self
                context._field_name = "pkcs12"
                return context

            value = value_or_callback
            if callable(value_or_callback):
                output = value_or_callback(Pkcs12.builder())
                if isinstance(output, Pkcs12.Builder):
                    value = output.build()
                else:
                    value = output
            return self._set("pkcs12", value)

    class BuilderContext(BuilderContextBase["Keystores.Builder"]):
        def model_post_init(self, __context) -> None:
            self._builder = Keystores.Builder()
            self._builder._in_context = True
            self._parent_builder = None
            self._field_name = None

    @classmethod
    def builder(cls) -> Builder:
        return cls.Builder()

    @classmethod
    def new(cls) -> BuilderContext:
        """Creates a new context manager builder for Keystores."""
        return cls.BuilderContext()

    class ListBuilder(GenericListBuilder["Keystores", Builder]):
        def __init__(self):
            raise NotImplementedError(
                "This class is not meant to be instantiated. Use Keystores.list_builder() instead."
            )

    @classmethod
    def list_builder(cls) -> ListBuilder:
        return GenericListBuilder[cls, cls.Builder]()  # type: ignore

    jks: Optional[Jks] = None
    """
    JKS configures options for storing a JKS keystore in the
    `spec.secretName` Secret resource.
    """
    pkcs12: Optional[Pkcs12] = None
    """
    PKCS12 configures options for storing a PKCS12 keystore in the
    `spec.secretName` Secret resource.
    """


class Excluded(BaseModel):
    class Builder(BaseModelBuilder):
        @property
        def cls(self) -> Type["Excluded"]:
            return Excluded

        def build(self) -> "Excluded":
            return Excluded(**self._attrs)

        def dns_domains(self, value: Optional[List[str]], /) -> Self:
            """
            DNSDomains is a list of DNS domains that are permitted or excluded.
            """
            return self._set("dns_domains", value)

        def email_addresses(self, value: Optional[List[str]], /) -> Self:
            """
            EmailAddresses is a list of Email Addresses that are permitted or excluded.
            """
            return self._set("email_addresses", value)

        def ip_ranges(self, value: Optional[List[str]], /) -> Self:
            """
            IPRanges is a list of IP Ranges that are permitted or excluded.
            This should be a valid CIDR notation.
            """
            return self._set("ip_ranges", value)

        def uri_domains(self, value: Optional[List[str]], /) -> Self:
            """
            URIDomains is a list of URI domains that are permitted or excluded.
            """
            return self._set("uri_domains", value)

    class BuilderContext(BuilderContextBase["Excluded.Builder"]):
        def model_post_init(self, __context) -> None:
            self._builder = Excluded.Builder()
            self._builder._in_context = True
            self._parent_builder = None
            self._field_name = None

    @classmethod
    def builder(cls) -> Builder:
        return cls.Builder()

    @classmethod
    def new(cls) -> BuilderContext:
        """Creates a new context manager builder for Excluded."""
        return cls.BuilderContext()

    class ListBuilder(GenericListBuilder["Excluded", Builder]):
        def __init__(self):
            raise NotImplementedError(
                "This class is not meant to be instantiated. Use Excluded.list_builder() instead."
            )

    @classmethod
    def list_builder(cls) -> ListBuilder:
        return GenericListBuilder[cls, cls.Builder]()  # type: ignore

    dns_domains: Annotated[Optional[List[str]], Field(alias="dnsDomains")] = None
    """
    DNSDomains is a list of DNS domains that are permitted or excluded.
    """
    email_addresses: Annotated[Optional[List[str]], Field(alias="emailAddresses")] = None
    """
    EmailAddresses is a list of Email Addresses that are permitted or excluded.
    """
    ip_ranges: Annotated[Optional[List[str]], Field(alias="ipRanges")] = None
    """
    IPRanges is a list of IP Ranges that are permitted or excluded.
    This should be a valid CIDR notation.
    """
    uri_domains: Annotated[Optional[List[str]], Field(alias="uriDomains")] = None
    """
    URIDomains is a list of URI domains that are permitted or excluded.
    """


class Permitted(BaseModel):
    class Builder(BaseModelBuilder):
        @property
        def cls(self) -> Type["Permitted"]:
            return Permitted

        def build(self) -> "Permitted":
            return Permitted(**self._attrs)

        def dns_domains(self, value: Optional[List[str]], /) -> Self:
            """
            DNSDomains is a list of DNS domains that are permitted or excluded.
            """
            return self._set("dns_domains", value)

        def email_addresses(self, value: Optional[List[str]], /) -> Self:
            """
            EmailAddresses is a list of Email Addresses that are permitted or excluded.
            """
            return self._set("email_addresses", value)

        def ip_ranges(self, value: Optional[List[str]], /) -> Self:
            """
            IPRanges is a list of IP Ranges that are permitted or excluded.
            This should be a valid CIDR notation.
            """
            return self._set("ip_ranges", value)

        def uri_domains(self, value: Optional[List[str]], /) -> Self:
            """
            URIDomains is a list of URI domains that are permitted or excluded.
            """
            return self._set("uri_domains", value)

    class BuilderContext(BuilderContextBase["Permitted.Builder"]):
        def model_post_init(self, __context) -> None:
            self._builder = Permitted.Builder()
            self._builder._in_context = True
            self._parent_builder = None
            self._field_name = None

    @classmethod
    def builder(cls) -> Builder:
        return cls.Builder()

    @classmethod
    def new(cls) -> BuilderContext:
        """Creates a new context manager builder for Permitted."""
        return cls.BuilderContext()

    class ListBuilder(GenericListBuilder["Permitted", Builder]):
        def __init__(self):
            raise NotImplementedError(
                "This class is not meant to be instantiated. Use Permitted.list_builder() instead."
            )

    @classmethod
    def list_builder(cls) -> ListBuilder:
        return GenericListBuilder[cls, cls.Builder]()  # type: ignore

    dns_domains: Annotated[Optional[List[str]], Field(alias="dnsDomains")] = None
    """
    DNSDomains is a list of DNS domains that are permitted or excluded.
    """
    email_addresses: Annotated[Optional[List[str]], Field(alias="emailAddresses")] = None
    """
    EmailAddresses is a list of Email Addresses that are permitted or excluded.
    """
    ip_ranges: Annotated[Optional[List[str]], Field(alias="ipRanges")] = None
    """
    IPRanges is a list of IP Ranges that are permitted or excluded.
    This should be a valid CIDR notation.
    """
    uri_domains: Annotated[Optional[List[str]], Field(alias="uriDomains")] = None
    """
    URIDomains is a list of URI domains that are permitted or excluded.
    """


class NameConstraints(BaseModel):
    class Builder(BaseModelBuilder):
        @property
        def cls(self) -> Type["NameConstraints"]:
            return NameConstraints

        def build(self) -> "NameConstraints":
            return NameConstraints(**self._attrs)

        def critical(self, value: Optional[bool], /) -> Self:
            """
            if true then the name constraints are marked critical.
            """
            return self._set("critical", value)

        @overload
        def excluded(
            self, value_or_callback: Optional[Excluded], /
        ) -> "NameConstraints.Builder": ...

        @overload
        def excluded(
            self,
            value_or_callback: Callable[[Excluded.Builder], Excluded.Builder | Excluded],
            /,
        ) -> "NameConstraints.Builder": ...

        @overload
        def excluded(self, value_or_callback: Never = ...) -> "Excluded.BuilderContext": ...

        def excluded(self, value_or_callback=None, /):
            """
            Excluded contains the constraints which must be disallowed. Any name matching a
            restriction in the excluded field is invalid regardless
            of information appearing in the permitted
            """
            if self._in_context and value_or_callback is None:
                context = Excluded.BuilderContext()
                context._parent_builder = self
                context._field_name = "excluded"
                return context

            value = value_or_callback
            if callable(value_or_callback):
                output = value_or_callback(Excluded.builder())
                if isinstance(output, Excluded.Builder):
                    value = output.build()
                else:
                    value = output
            return self._set("excluded", value)

        @overload
        def permitted(
            self, value_or_callback: Optional[Permitted], /
        ) -> "NameConstraints.Builder": ...

        @overload
        def permitted(
            self,
            value_or_callback: Callable[[Permitted.Builder], Permitted.Builder | Permitted],
            /,
        ) -> "NameConstraints.Builder": ...

        @overload
        def permitted(self, value_or_callback: Never = ...) -> "Permitted.BuilderContext": ...

        def permitted(self, value_or_callback=None, /):
            """
            Permitted contains the constraints in which the names must be located.
            """
            if self._in_context and value_or_callback is None:
                context = Permitted.BuilderContext()
                context._parent_builder = self
                context._field_name = "permitted"
                return context

            value = value_or_callback
            if callable(value_or_callback):
                output = value_or_callback(Permitted.builder())
                if isinstance(output, Permitted.Builder):
                    value = output.build()
                else:
                    value = output
            return self._set("permitted", value)

    class BuilderContext(BuilderContextBase["NameConstraints.Builder"]):
        def model_post_init(self, __context) -> None:
            self._builder = NameConstraints.Builder()
            self._builder._in_context = True
            self._parent_builder = None
            self._field_name = None

    @classmethod
    def builder(cls) -> Builder:
        return cls.Builder()

    @classmethod
    def new(cls) -> BuilderContext:
        """Creates a new context manager builder for NameConstraints."""
        return cls.BuilderContext()

    class ListBuilder(GenericListBuilder["NameConstraints", Builder]):
        def __init__(self):
            raise NotImplementedError(
                "This class is not meant to be instantiated. Use NameConstraints.list_builder() instead."
            )

    @classmethod
    def list_builder(cls) -> ListBuilder:
        return GenericListBuilder[cls, cls.Builder]()  # type: ignore

    critical: Optional[bool] = None
    """
    if true then the name constraints are marked critical.
    """
    excluded: Optional[Excluded] = None
    """
    Excluded contains the constraints which must be disallowed. Any name matching a
    restriction in the excluded field is invalid regardless
    of information appearing in the permitted
    """
    permitted: Optional[Permitted] = None
    """
    Permitted contains the constraints in which the names must be located.
    """


class OtherName(BaseModel):
    class Builder(BaseModelBuilder):
        @property
        def cls(self) -> Type["OtherName"]:
            return OtherName

        def build(self) -> "OtherName":
            return OtherName(**self._attrs)

        def oid(self, value: Optional[str], /) -> Self:
            """
            OID is the object identifier for the otherName SAN.
            The object identifier must be expressed as a dotted string, for
            example, "1.2.840.113556.1.4.221".
            """
            return self._set("oid", value)

        def utf8_value(self, value: Optional[str], /) -> Self:
            """
            utf8Value is the string value of the otherName SAN.
            The utf8Value accepts any valid UTF8 string to set as value for the otherName SAN.
            """
            return self._set("utf8_value", value)

    class BuilderContext(BuilderContextBase["OtherName.Builder"]):
        def model_post_init(self, __context) -> None:
            self._builder = OtherName.Builder()
            self._builder._in_context = True
            self._parent_builder = None
            self._field_name = None

    @classmethod
    def builder(cls) -> Builder:
        return cls.Builder()

    @classmethod
    def new(cls) -> BuilderContext:
        """Creates a new context manager builder for OtherName."""
        return cls.BuilderContext()

    class ListBuilder(GenericListBuilder["OtherName", Builder]):
        def __init__(self):
            raise NotImplementedError(
                "This class is not meant to be instantiated. Use OtherName.list_builder() instead."
            )

    @classmethod
    def list_builder(cls) -> ListBuilder:
        return GenericListBuilder[cls, cls.Builder]()  # type: ignore

    oid: Optional[str] = None
    """
    OID is the object identifier for the otherName SAN.
    The object identifier must be expressed as a dotted string, for
    example, "1.2.840.113556.1.4.221".
    """
    utf8_value: Annotated[Optional[str], Field(alias="utf8Value")] = None
    """
    utf8Value is the string value of the otherName SAN.
    The utf8Value accepts any valid UTF8 string to set as value for the otherName SAN.
    """


class PrivateKey(BaseModel):
    class Builder(BaseModelBuilder):
        @property
        def cls(self) -> Type["PrivateKey"]:
            return PrivateKey

        def build(self) -> "PrivateKey":
            return PrivateKey(**self._attrs)

        def algorithm(self, value: Optional[Literal["RSA", "ECDSA", "Ed25519"]], /) -> Self:
            """
            Algorithm is the private key algorithm of the corresponding private key
            for this certificate.

            If provided, allowed values are either `RSA`, `ECDSA` or `Ed25519`.
            If `algorithm` is specified and `size` is not provided,
            key size of 2048 will be used for `RSA` key algorithm and
            key size of 256 will be used for `ECDSA` key algorithm.
            key size is ignored when using the `Ed25519` key algorithm.
            """
            return self._set("algorithm", value)

        def encoding(self, value: Optional[Literal["PKCS1", "PKCS8"]], /) -> Self:
            """
            The private key cryptography standards (PKCS) encoding for this
            certificate's private key to be encoded in.

            If provided, allowed values are `PKCS1` and `PKCS8` standing for PKCS#1
            and PKCS#8, respectively.
            Defaults to `PKCS1` if not specified.
            """
            return self._set("encoding", value)

        def rotation_policy(self, value: Optional[Literal["Never", "Always"]], /) -> Self:
            """
            RotationPolicy controls how private keys should be regenerated when a
            re-issuance is being processed.

            If set to `Never`, a private key will only be generated if one does not
            already exist in the target `spec.secretName`. If one does exist but it
            does not have the correct algorithm or size, a warning will be raised
            to await user intervention.
            If set to `Always`, a private key matching the specified requirements
            will be generated whenever a re-issuance occurs.
            Default is `Never` for backward compatibility.
            """
            return self._set("rotation_policy", value)

        def size(self, value: Optional[int], /) -> Self:
            """
            Size is the key bit size of the corresponding private key for this certificate.

            If `algorithm` is set to `RSA`, valid values are `2048`, `4096` or `8192`,
            and will default to `2048` if not specified.
            If `algorithm` is set to `ECDSA`, valid values are `256`, `384` or `521`,
            and will default to `256` if not specified.
            If `algorithm` is set to `Ed25519`, Size is ignored.
            No other values are allowed.
            """
            return self._set("size", value)

    class BuilderContext(BuilderContextBase["PrivateKey.Builder"]):
        def model_post_init(self, __context) -> None:
            self._builder = PrivateKey.Builder()
            self._builder._in_context = True
            self._parent_builder = None
            self._field_name = None

    @classmethod
    def builder(cls) -> Builder:
        return cls.Builder()

    @classmethod
    def new(cls) -> BuilderContext:
        """Creates a new context manager builder for PrivateKey."""
        return cls.BuilderContext()

    class ListBuilder(GenericListBuilder["PrivateKey", Builder]):
        def __init__(self):
            raise NotImplementedError(
                "This class is not meant to be instantiated. Use PrivateKey.list_builder() instead."
            )

    @classmethod
    def list_builder(cls) -> ListBuilder:
        return GenericListBuilder[cls, cls.Builder]()  # type: ignore

    algorithm: Optional[Literal["RSA", "ECDSA", "Ed25519"]] = None
    """
    Algorithm is the private key algorithm of the corresponding private key
    for this certificate.

    If provided, allowed values are either `RSA`, `ECDSA` or `Ed25519`.
    If `algorithm` is specified and `size` is not provided,
    key size of 2048 will be used for `RSA` key algorithm and
    key size of 256 will be used for `ECDSA` key algorithm.
    key size is ignored when using the `Ed25519` key algorithm.
    """
    encoding: Optional[Literal["PKCS1", "PKCS8"]] = None
    """
    The private key cryptography standards (PKCS) encoding for this
    certificate's private key to be encoded in.

    If provided, allowed values are `PKCS1` and `PKCS8` standing for PKCS#1
    and PKCS#8, respectively.
    Defaults to `PKCS1` if not specified.
    """
    rotation_policy: Annotated[
        Optional[Literal["Never", "Always"]], Field(alias="rotationPolicy")
    ] = None
    """
    RotationPolicy controls how private keys should be regenerated when a
    re-issuance is being processed.

    If set to `Never`, a private key will only be generated if one does not
    already exist in the target `spec.secretName`. If one does exist but it
    does not have the correct algorithm or size, a warning will be raised
    to await user intervention.
    If set to `Always`, a private key matching the specified requirements
    will be generated whenever a re-issuance occurs.
    Default is `Never` for backward compatibility.
    """
    size: Optional[int] = None
    """
    Size is the key bit size of the corresponding private key for this certificate.

    If `algorithm` is set to `RSA`, valid values are `2048`, `4096` or `8192`,
    and will default to `2048` if not specified.
    If `algorithm` is set to `ECDSA`, valid values are `256`, `384` or `521`,
    and will default to `256` if not specified.
    If `algorithm` is set to `Ed25519`, Size is ignored.
    No other values are allowed.
    """


class SecretTemplate(BaseModel):
    class Builder(BaseModelBuilder):
        @property
        def cls(self) -> Type["SecretTemplate"]:
            return SecretTemplate

        def build(self) -> "SecretTemplate":
            return SecretTemplate(**self._attrs)

        def annotations(self, value: Optional[Dict[str, str]], /) -> Self:
            """
            Annotations is a key value map to be copied to the target Kubernetes Secret.
            """
            return self._set("annotations", value)

        def labels(self, value: Optional[Dict[str, str]], /) -> Self:
            """
            Labels is a key value map to be copied to the target Kubernetes Secret.
            """
            return self._set("labels", value)

    class BuilderContext(BuilderContextBase["SecretTemplate.Builder"]):
        def model_post_init(self, __context) -> None:
            self._builder = SecretTemplate.Builder()
            self._builder._in_context = True
            self._parent_builder = None
            self._field_name = None

    @classmethod
    def builder(cls) -> Builder:
        return cls.Builder()

    @classmethod
    def new(cls) -> BuilderContext:
        """Creates a new context manager builder for SecretTemplate."""
        return cls.BuilderContext()

    class ListBuilder(GenericListBuilder["SecretTemplate", Builder]):
        def __init__(self):
            raise NotImplementedError(
                "This class is not meant to be instantiated. Use SecretTemplate.list_builder() instead."
            )

    @classmethod
    def list_builder(cls) -> ListBuilder:
        return GenericListBuilder[cls, cls.Builder]()  # type: ignore

    annotations: Optional[Dict[str, str]] = None
    """
    Annotations is a key value map to be copied to the target Kubernetes Secret.
    """
    labels: Optional[Dict[str, str]] = None
    """
    Labels is a key value map to be copied to the target Kubernetes Secret.
    """


class Subject(BaseModel):
    class Builder(BaseModelBuilder):
        @property
        def cls(self) -> Type["Subject"]:
            return Subject

        def build(self) -> "Subject":
            return Subject(**self._attrs)

        def countries(self, value: Optional[List[str]], /) -> Self:
            """
            Countries to be used on the Certificate.
            """
            return self._set("countries", value)

        def localities(self, value: Optional[List[str]], /) -> Self:
            """
            Cities to be used on the Certificate.
            """
            return self._set("localities", value)

        def organizational_units(self, value: Optional[List[str]], /) -> Self:
            """
            Organizational Units to be used on the Certificate.
            """
            return self._set("organizational_units", value)

        def organizations(self, value: Optional[List[str]], /) -> Self:
            """
            Organizations to be used on the Certificate.
            """
            return self._set("organizations", value)

        def postal_codes(self, value: Optional[List[str]], /) -> Self:
            """
            Postal codes to be used on the Certificate.
            """
            return self._set("postal_codes", value)

        def provinces(self, value: Optional[List[str]], /) -> Self:
            """
            State/Provinces to be used on the Certificate.
            """
            return self._set("provinces", value)

        def serial_number(self, value: Optional[str], /) -> Self:
            """
            Serial number to be used on the Certificate.
            """
            return self._set("serial_number", value)

        def street_addresses(self, value: Optional[List[str]], /) -> Self:
            """
            Street addresses to be used on the Certificate.
            """
            return self._set("street_addresses", value)

    class BuilderContext(BuilderContextBase["Subject.Builder"]):
        def model_post_init(self, __context) -> None:
            self._builder = Subject.Builder()
            self._builder._in_context = True
            self._parent_builder = None
            self._field_name = None

    @classmethod
    def builder(cls) -> Builder:
        return cls.Builder()

    @classmethod
    def new(cls) -> BuilderContext:
        """Creates a new context manager builder for Subject."""
        return cls.BuilderContext()

    class ListBuilder(GenericListBuilder["Subject", Builder]):
        def __init__(self):
            raise NotImplementedError(
                "This class is not meant to be instantiated. Use Subject.list_builder() instead."
            )

    @classmethod
    def list_builder(cls) -> ListBuilder:
        return GenericListBuilder[cls, cls.Builder]()  # type: ignore

    countries: Optional[List[str]] = None
    """
    Countries to be used on the Certificate.
    """
    localities: Optional[List[str]] = None
    """
    Cities to be used on the Certificate.
    """
    organizational_units: Annotated[Optional[List[str]], Field(alias="organizationalUnits")] = None
    """
    Organizational Units to be used on the Certificate.
    """
    organizations: Optional[List[str]] = None
    """
    Organizations to be used on the Certificate.
    """
    postal_codes: Annotated[Optional[List[str]], Field(alias="postalCodes")] = None
    """
    Postal codes to be used on the Certificate.
    """
    provinces: Optional[List[str]] = None
    """
    State/Provinces to be used on the Certificate.
    """
    serial_number: Annotated[Optional[str], Field(alias="serialNumber")] = None
    """
    Serial number to be used on the Certificate.
    """
    street_addresses: Annotated[Optional[List[str]], Field(alias="streetAddresses")] = None
    """
    Street addresses to be used on the Certificate.
    """


class CertificateSpec(BaseModel):
    class Builder(BaseModelBuilder):
        @property
        def cls(self) -> Type["CertificateSpec"]:
            return CertificateSpec

        def build(self) -> "CertificateSpec":
            return CertificateSpec(**self._attrs)

        @overload
        def additional_output_formats(
            self, value_or_callback: List[AdditionalOutputFormat], /
        ) -> "CertificateSpec.Builder": ...

        @overload
        def additional_output_formats(
            self,
            value_or_callback: Callable[
                [GenericListBuilder[AdditionalOutputFormat, AdditionalOutputFormat.Builder]],
                GenericListBuilder[AdditionalOutputFormat, AdditionalOutputFormat.Builder]
                | List[AdditionalOutputFormat],
            ],
            /,
        ) -> "CertificateSpec.Builder": ...

        @overload
        def additional_output_formats(
            self, value_or_callback: Never = ...
        ) -> ListBuilderContext[AdditionalOutputFormat.Builder]: ...

        def additional_output_formats(self, value_or_callback=None, /):
            """
            Defines extra output formats of the private key and signed certificate chain
            to be written to this Certificate's target Secret.

            This is a Beta Feature enabled by default. It can be disabled with the
            `--feature-gates=AdditionalCertificateOutputFormats=false` option set on both
            the controller and webhook components.
            """
            if self._in_context and value_or_callback is None:
                context = ListBuilderContext[AdditionalOutputFormat.Builder]()
                context._parent_builder = self
                context._field_name = "additional_output_formats"
                return context

            value = value_or_callback
            if callable(value_or_callback):
                output = value_or_callback(AdditionalOutputFormat.list_builder())
                if isinstance(output, GenericListBuilder):
                    value = output.build()
                else:
                    value = output
            return self._set("additional_output_formats", value)

        def common_name(self, value: Optional[str], /) -> Self:
            """
            Requested common name X509 certificate subject attribute.
            More info: https://datatracker.ietf.org/doc/html/rfc5280#section-4.1.2.6
            NOTE: TLS clients will ignore this value when any subject alternative name is
            set (see https://tools.ietf.org/html/rfc6125#section-6.4.4).

            Should have a length of 64 characters or fewer to avoid generating invalid CSRs.
            Cannot be set if the `literalSubject` field is set.
            """
            return self._set("common_name", value)

        def dns_names(self, value: Optional[List[str]], /) -> Self:
            """
            Requested DNS subject alternative names.
            """
            return self._set("dns_names", value)

        def duration(self, value: Optional[str], /) -> Self:
            """
            Requested 'duration' (i.e. lifetime) of the Certificate. Note that the
            issuer may choose to ignore the requested duration, just like any other
            requested attribute.

            If unset, this defaults to 90 days.
            Minimum accepted duration is 1 hour.
            Value must be in units accepted by Go time.ParseDuration https://golang.org/pkg/time/#ParseDuration.
            """
            return self._set("duration", value)

        def email_addresses(self, value: Optional[List[str]], /) -> Self:
            """
            Requested email subject alternative names.
            """
            return self._set("email_addresses", value)

        def encode_usages_in_request(self, value: Optional[bool], /) -> Self:
            """
            Whether the KeyUsage and ExtKeyUsage extensions should be set in the encoded CSR.

            This option defaults to true, and should only be disabled if the target
            issuer does not support CSRs with these X509 KeyUsage/ ExtKeyUsage extensions.
            """
            return self._set("encode_usages_in_request", value)

        def ip_addresses(self, value: Optional[List[str]], /) -> Self:
            """
            Requested IP address subject alternative names.
            """
            return self._set("ip_addresses", value)

        def is_ca(self, value: Optional[bool], /) -> Self:
            """
            Requested basic constraints isCA value.
            The isCA value is used to set the `isCA` field on the created CertificateRequest
            resources. Note that the issuer may choose to ignore the requested isCA value, just
            like any other requested attribute.

            If true, this will automatically add the `cert sign` usage to the list
            of requested `usages`.
            """
            return self._set("is_ca", value)

        @overload
        def issuer_ref(self, value_or_callback: IssuerRef, /) -> "CertificateSpec.Builder": ...

        @overload
        def issuer_ref(
            self,
            value_or_callback: Callable[[IssuerRef.Builder], IssuerRef.Builder | IssuerRef],
            /,
        ) -> "CertificateSpec.Builder": ...

        @overload
        def issuer_ref(self, value_or_callback: Never = ...) -> "IssuerRef.BuilderContext": ...

        def issuer_ref(self, value_or_callback=None, /):
            """
            Reference to the issuer responsible for issuing the certificate.
            If the issuer is namespace-scoped, it must be in the same namespace
            as the Certificate. If the issuer is cluster-scoped, it can be used
            from any namespace.

            The `name` field of the reference must always be specified.
            """
            if self._in_context and value_or_callback is None:
                context = IssuerRef.BuilderContext()
                context._parent_builder = self
                context._field_name = "issuer_ref"
                return context

            value = value_or_callback
            if callable(value_or_callback):
                output = value_or_callback(IssuerRef.builder())
                if isinstance(output, IssuerRef.Builder):
                    value = output.build()
                else:
                    value = output
            return self._set("issuer_ref", value)

        @overload
        def keystores(
            self, value_or_callback: Optional[Keystores], /
        ) -> "CertificateSpec.Builder": ...

        @overload
        def keystores(
            self,
            value_or_callback: Callable[[Keystores.Builder], Keystores.Builder | Keystores],
            /,
        ) -> "CertificateSpec.Builder": ...

        @overload
        def keystores(self, value_or_callback: Never = ...) -> "Keystores.BuilderContext": ...

        def keystores(self, value_or_callback=None, /):
            """
            Additional keystore output formats to be stored in the Certificate's Secret.
            """
            if self._in_context and value_or_callback is None:
                context = Keystores.BuilderContext()
                context._parent_builder = self
                context._field_name = "keystores"
                return context

            value = value_or_callback
            if callable(value_or_callback):
                output = value_or_callback(Keystores.builder())
                if isinstance(output, Keystores.Builder):
                    value = output.build()
                else:
                    value = output
            return self._set("keystores", value)

        def literal_subject(self, value: Optional[str], /) -> Self:
            """
            Requested X.509 certificate subject, represented using the LDAP "String
            Representation of a Distinguished Name" [1].
            Important: the LDAP string format also specifies the order of the attributes
            in the subject, this is important when issuing certs for LDAP authentication.
            Example: `CN=foo,DC=corp,DC=example,DC=com`
            More info [1]: https://datatracker.ietf.org/doc/html/rfc4514
            More info: https://github.com/cert-manager/cert-manager/issues/3203
            More info: https://github.com/cert-manager/cert-manager/issues/4424

            Cannot be set if the `subject` or `commonName` field is set.
            """
            return self._set("literal_subject", value)

        @overload
        def name_constraints(
            self, value_or_callback: Optional[NameConstraints], /
        ) -> "CertificateSpec.Builder": ...

        @overload
        def name_constraints(
            self,
            value_or_callback: Callable[
                [NameConstraints.Builder], NameConstraints.Builder | NameConstraints
            ],
            /,
        ) -> "CertificateSpec.Builder": ...

        @overload
        def name_constraints(
            self, value_or_callback: Never = ...
        ) -> "NameConstraints.BuilderContext": ...

        def name_constraints(self, value_or_callback=None, /):
            """
            x.509 certificate NameConstraint extension which MUST NOT be used in a non-CA certificate.
            More Info: https://datatracker.ietf.org/doc/html/rfc5280#section-4.2.1.10

            This is an Alpha Feature and is only enabled with the
            `--feature-gates=NameConstraints=true` option set on both
            the controller and webhook components.
            """
            if self._in_context and value_or_callback is None:
                context = NameConstraints.BuilderContext()
                context._parent_builder = self
                context._field_name = "name_constraints"
                return context

            value = value_or_callback
            if callable(value_or_callback):
                output = value_or_callback(NameConstraints.builder())
                if isinstance(output, NameConstraints.Builder):
                    value = output.build()
                else:
                    value = output
            return self._set("name_constraints", value)

        @overload
        def other_names(
            self, value_or_callback: List[OtherName], /
        ) -> "CertificateSpec.Builder": ...

        @overload
        def other_names(
            self,
            value_or_callback: Callable[
                [GenericListBuilder[OtherName, OtherName.Builder]],
                GenericListBuilder[OtherName, OtherName.Builder] | List[OtherName],
            ],
            /,
        ) -> "CertificateSpec.Builder": ...

        @overload
        def other_names(
            self, value_or_callback: Never = ...
        ) -> ListBuilderContext[OtherName.Builder]: ...

        def other_names(self, value_or_callback=None, /):
            """
            `otherNames` is an escape hatch for SAN that allows any type. We currently restrict the support to string like otherNames, cf RFC 5280 p 37
            Any UTF8 String valued otherName can be passed with by setting the keys oid: x.x.x.x and UTF8Value: somevalue for `otherName`.
            Most commonly this would be UPN set with oid: 1.3.6.1.4.1.311.20.2.3
            You should ensure that any OID passed is valid for the UTF8String type as we do not explicitly validate this.
            """
            if self._in_context and value_or_callback is None:
                context = ListBuilderContext[OtherName.Builder]()
                context._parent_builder = self
                context._field_name = "other_names"
                return context

            value = value_or_callback
            if callable(value_or_callback):
                output = value_or_callback(OtherName.list_builder())
                if isinstance(output, GenericListBuilder):
                    value = output.build()
                else:
                    value = output
            return self._set("other_names", value)

        @overload
        def private_key(
            self, value_or_callback: Optional[PrivateKey], /
        ) -> "CertificateSpec.Builder": ...

        @overload
        def private_key(
            self,
            value_or_callback: Callable[[PrivateKey.Builder], PrivateKey.Builder | PrivateKey],
            /,
        ) -> "CertificateSpec.Builder": ...

        @overload
        def private_key(self, value_or_callback: Never = ...) -> "PrivateKey.BuilderContext": ...

        def private_key(self, value_or_callback=None, /):
            """
            Private key options. These include the key algorithm and size, the used
            encoding and the rotation policy.
            """
            if self._in_context and value_or_callback is None:
                context = PrivateKey.BuilderContext()
                context._parent_builder = self
                context._field_name = "private_key"
                return context

            value = value_or_callback
            if callable(value_or_callback):
                output = value_or_callback(PrivateKey.builder())
                if isinstance(output, PrivateKey.Builder):
                    value = output.build()
                else:
                    value = output
            return self._set("private_key", value)

        def renew_before(self, value: Optional[str], /) -> Self:
            """
            How long before the currently issued certificate's expiry cert-manager should
            renew the certificate. For example, if a certificate is valid for 60 minutes,
            and `renewBefore=10m`, cert-manager will begin to attempt to renew the certificate
            50 minutes after it was issued (i.e. when there are 10 minutes remaining until
            the certificate is no longer valid).

            NOTE: The actual lifetime of the issued certificate is used to determine the
            renewal time. If an issuer returns a certificate with a different lifetime than
            the one requested, cert-manager will use the lifetime of the issued certificate.

            If unset, this defaults to 1/3 of the issued certificate's lifetime.
            Minimum accepted value is 5 minutes.
            Value must be in units accepted by Go time.ParseDuration https://golang.org/pkg/time/#ParseDuration.
            Cannot be set if the `renewBeforePercentage` field is set.
            """
            return self._set("renew_before", value)

        def renew_before_percentage(self, value: Optional[int], /) -> Self:
            """
            `renewBeforePercentage` is like `renewBefore`, except it is a relative percentage
            rather than an absolute duration. For example, if a certificate is valid for 60
            minutes, and  `renewBeforePercentage=25`, cert-manager will begin to attempt to
            renew the certificate 45 minutes after it was issued (i.e. when there are 15
            minutes (25%) remaining until the certificate is no longer valid).

            NOTE: The actual lifetime of the issued certificate is used to determine the
            renewal time. If an issuer returns a certificate with a different lifetime than
            the one requested, cert-manager will use the lifetime of the issued certificate.

            Value must be an integer in the range (0,100). The minimum effective
            `renewBefore` derived from the `renewBeforePercentage` and `duration` fields is 5
            minutes.
            Cannot be set if the `renewBefore` field is set.
            """
            return self._set("renew_before_percentage", value)

        def revision_history_limit(self, value: Optional[int], /) -> Self:
            """
            The maximum number of CertificateRequest revisions that are maintained in
            the Certificate's history. Each revision represents a single `CertificateRequest`
            created by this Certificate, either when it was created, renewed, or Spec
            was changed. Revisions will be removed by oldest first if the number of
            revisions exceeds this number.

            If set, revisionHistoryLimit must be a value of `1` or greater.
            If unset (`nil`), revisions will not be garbage collected.
            Default value is `nil`.
            """
            return self._set("revision_history_limit", value)

        def secret_name(self, value: str, /) -> Self:
            """
            Name of the Secret resource that will be automatically created and
            managed by this Certificate resource. It will be populated with a
            private key and certificate, signed by the denoted issuer. The Secret
            resource lives in the same namespace as the Certificate resource.
            """
            return self._set("secret_name", value)

        @overload
        def secret_template(
            self, value_or_callback: Optional[SecretTemplate], /
        ) -> "CertificateSpec.Builder": ...

        @overload
        def secret_template(
            self,
            value_or_callback: Callable[
                [SecretTemplate.Builder], SecretTemplate.Builder | SecretTemplate
            ],
            /,
        ) -> "CertificateSpec.Builder": ...

        @overload
        def secret_template(
            self, value_or_callback: Never = ...
        ) -> "SecretTemplate.BuilderContext": ...

        def secret_template(self, value_or_callback=None, /):
            """
            Defines annotations and labels to be copied to the Certificate's Secret.
            Labels and annotations on the Secret will be changed as they appear on the
            SecretTemplate when added or removed. SecretTemplate annotations are added
            in conjunction with, and cannot overwrite, the base set of annotations
            cert-manager sets on the Certificate's Secret.
            """
            if self._in_context and value_or_callback is None:
                context = SecretTemplate.BuilderContext()
                context._parent_builder = self
                context._field_name = "secret_template"
                return context

            value = value_or_callback
            if callable(value_or_callback):
                output = value_or_callback(SecretTemplate.builder())
                if isinstance(output, SecretTemplate.Builder):
                    value = output.build()
                else:
                    value = output
            return self._set("secret_template", value)

        @overload
        def subject(self, value_or_callback: Optional[Subject], /) -> "CertificateSpec.Builder": ...

        @overload
        def subject(
            self,
            value_or_callback: Callable[[Subject.Builder], Subject.Builder | Subject],
            /,
        ) -> "CertificateSpec.Builder": ...

        @overload
        def subject(self, value_or_callback: Never = ...) -> "Subject.BuilderContext": ...

        def subject(self, value_or_callback=None, /):
            """
            Requested set of X509 certificate subject attributes.
            More info: https://datatracker.ietf.org/doc/html/rfc5280#section-4.1.2.6

            The common name attribute is specified separately in the `commonName` field.
            Cannot be set if the `literalSubject` field is set.
            """
            if self._in_context and value_or_callback is None:
                context = Subject.BuilderContext()
                context._parent_builder = self
                context._field_name = "subject"
                return context

            value = value_or_callback
            if callable(value_or_callback):
                output = value_or_callback(Subject.builder())
                if isinstance(output, Subject.Builder):
                    value = output.build()
                else:
                    value = output
            return self._set("subject", value)

        def uris(self, value: Optional[List[str]], /) -> Self:
            """
            Requested URI subject alternative names.
            """
            return self._set("uris", value)

        def usages(
            self,
            value: Optional[
                List[
                    Literal[
                        "signing",
                        "digital signature",
                        "content commitment",
                        "key encipherment",
                        "key agreement",
                        "data encipherment",
                        "cert sign",
                        "crl sign",
                        "encipher only",
                        "decipher only",
                        "any",
                        "server auth",
                        "client auth",
                        "code signing",
                        "email protection",
                        "s/mime",
                        "ipsec end system",
                        "ipsec tunnel",
                        "ipsec user",
                        "timestamping",
                        "ocsp signing",
                        "microsoft sgc",
                        "netscape sgc",
                    ]
                ]
            ],
            /,
        ) -> Self:
            """
            Requested key usages and extended key usages.
            These usages are used to set the `usages` field on the created CertificateRequest
            resources. If `encodeUsagesInRequest` is unset or set to `true`, the usages
            will additionally be encoded in the `request` field which contains the CSR blob.

            If unset, defaults to `digital signature` and `key encipherment`.
            """
            return self._set("usages", value)

    class BuilderContext(BuilderContextBase["CertificateSpec.Builder"]):
        def model_post_init(self, __context) -> None:
            self._builder = CertificateSpec.Builder()
            self._builder._in_context = True
            self._parent_builder = None
            self._field_name = None

    @classmethod
    def builder(cls) -> Builder:
        return cls.Builder()

    @classmethod
    def new(cls) -> BuilderContext:
        """Creates a new context manager builder for CertificateSpec."""
        return cls.BuilderContext()

    class ListBuilder(GenericListBuilder["CertificateSpec", Builder]):
        def __init__(self):
            raise NotImplementedError(
                "This class is not meant to be instantiated. Use CertificateSpec.list_builder() instead."
            )

    @classmethod
    def list_builder(cls) -> ListBuilder:
        return GenericListBuilder[cls, cls.Builder]()  # type: ignore

    additional_output_formats: Annotated[
        Optional[List[AdditionalOutputFormat]], Field(alias="additionalOutputFormats")
    ] = None
    """
    Defines extra output formats of the private key and signed certificate chain
    to be written to this Certificate's target Secret.

    This is a Beta Feature enabled by default. It can be disabled with the
    `--feature-gates=AdditionalCertificateOutputFormats=false` option set on both
    the controller and webhook components.
    """
    common_name: Annotated[Optional[str], Field(alias="commonName")] = None
    """
    Requested common name X509 certificate subject attribute.
    More info: https://datatracker.ietf.org/doc/html/rfc5280#section-4.1.2.6
    NOTE: TLS clients will ignore this value when any subject alternative name is
    set (see https://tools.ietf.org/html/rfc6125#section-6.4.4).

    Should have a length of 64 characters or fewer to avoid generating invalid CSRs.
    Cannot be set if the `literalSubject` field is set.
    """
    dns_names: Annotated[Optional[List[str]], Field(alias="dnsNames")] = None
    """
    Requested DNS subject alternative names.
    """
    duration: Optional[str] = None
    """
    Requested 'duration' (i.e. lifetime) of the Certificate. Note that the
    issuer may choose to ignore the requested duration, just like any other
    requested attribute.

    If unset, this defaults to 90 days.
    Minimum accepted duration is 1 hour.
    Value must be in units accepted by Go time.ParseDuration https://golang.org/pkg/time/#ParseDuration.
    """
    email_addresses: Annotated[Optional[List[str]], Field(alias="emailAddresses")] = None
    """
    Requested email subject alternative names.
    """
    encode_usages_in_request: Annotated[Optional[bool], Field(alias="encodeUsagesInRequest")] = None
    """
    Whether the KeyUsage and ExtKeyUsage extensions should be set in the encoded CSR.

    This option defaults to true, and should only be disabled if the target
    issuer does not support CSRs with these X509 KeyUsage/ ExtKeyUsage extensions.
    """
    ip_addresses: Annotated[Optional[List[str]], Field(alias="ipAddresses")] = None
    """
    Requested IP address subject alternative names.
    """
    is_ca: Annotated[Optional[bool], Field(alias="isCA")] = None
    """
    Requested basic constraints isCA value.
    The isCA value is used to set the `isCA` field on the created CertificateRequest
    resources. Note that the issuer may choose to ignore the requested isCA value, just
    like any other requested attribute.

    If true, this will automatically add the `cert sign` usage to the list
    of requested `usages`.
    """
    issuer_ref: Annotated[IssuerRef, Field(alias="issuerRef")]
    """
    Reference to the issuer responsible for issuing the certificate.
    If the issuer is namespace-scoped, it must be in the same namespace
    as the Certificate. If the issuer is cluster-scoped, it can be used
    from any namespace.

    The `name` field of the reference must always be specified.
    """
    keystores: Optional[Keystores] = None
    """
    Additional keystore output formats to be stored in the Certificate's Secret.
    """
    literal_subject: Annotated[Optional[str], Field(alias="literalSubject")] = None
    """
    Requested X.509 certificate subject, represented using the LDAP "String
    Representation of a Distinguished Name" [1].
    Important: the LDAP string format also specifies the order of the attributes
    in the subject, this is important when issuing certs for LDAP authentication.
    Example: `CN=foo,DC=corp,DC=example,DC=com`
    More info [1]: https://datatracker.ietf.org/doc/html/rfc4514
    More info: https://github.com/cert-manager/cert-manager/issues/3203
    More info: https://github.com/cert-manager/cert-manager/issues/4424

    Cannot be set if the `subject` or `commonName` field is set.
    """
    name_constraints: Annotated[Optional[NameConstraints], Field(alias="nameConstraints")] = None
    """
    x.509 certificate NameConstraint extension which MUST NOT be used in a non-CA certificate.
    More Info: https://datatracker.ietf.org/doc/html/rfc5280#section-4.2.1.10

    This is an Alpha Feature and is only enabled with the
    `--feature-gates=NameConstraints=true` option set on both
    the controller and webhook components.
    """
    other_names: Annotated[Optional[List[OtherName]], Field(alias="otherNames")] = None
    """
    `otherNames` is an escape hatch for SAN that allows any type. We currently restrict the support to string like otherNames, cf RFC 5280 p 37
    Any UTF8 String valued otherName can be passed with by setting the keys oid: x.x.x.x and UTF8Value: somevalue for `otherName`.
    Most commonly this would be UPN set with oid: 1.3.6.1.4.1.311.20.2.3
    You should ensure that any OID passed is valid for the UTF8String type as we do not explicitly validate this.
    """
    private_key: Annotated[Optional[PrivateKey], Field(alias="privateKey")] = None
    """
    Private key options. These include the key algorithm and size, the used
    encoding and the rotation policy.
    """
    renew_before: Annotated[Optional[str], Field(alias="renewBefore")] = None
    """
    How long before the currently issued certificate's expiry cert-manager should
    renew the certificate. For example, if a certificate is valid for 60 minutes,
    and `renewBefore=10m`, cert-manager will begin to attempt to renew the certificate
    50 minutes after it was issued (i.e. when there are 10 minutes remaining until
    the certificate is no longer valid).

    NOTE: The actual lifetime of the issued certificate is used to determine the
    renewal time. If an issuer returns a certificate with a different lifetime than
    the one requested, cert-manager will use the lifetime of the issued certificate.

    If unset, this defaults to 1/3 of the issued certificate's lifetime.
    Minimum accepted value is 5 minutes.
    Value must be in units accepted by Go time.ParseDuration https://golang.org/pkg/time/#ParseDuration.
    Cannot be set if the `renewBeforePercentage` field is set.
    """
    renew_before_percentage: Annotated[Optional[int], Field(alias="renewBeforePercentage")] = None
    """
    `renewBeforePercentage` is like `renewBefore`, except it is a relative percentage
    rather than an absolute duration. For example, if a certificate is valid for 60
    minutes, and  `renewBeforePercentage=25`, cert-manager will begin to attempt to
    renew the certificate 45 minutes after it was issued (i.e. when there are 15
    minutes (25%) remaining until the certificate is no longer valid).

    NOTE: The actual lifetime of the issued certificate is used to determine the
    renewal time. If an issuer returns a certificate with a different lifetime than
    the one requested, cert-manager will use the lifetime of the issued certificate.

    Value must be an integer in the range (0,100). The minimum effective
    `renewBefore` derived from the `renewBeforePercentage` and `duration` fields is 5
    minutes.
    Cannot be set if the `renewBefore` field is set.
    """
    revision_history_limit: Annotated[Optional[int], Field(alias="revisionHistoryLimit")] = None
    """
    The maximum number of CertificateRequest revisions that are maintained in
    the Certificate's history. Each revision represents a single `CertificateRequest`
    created by this Certificate, either when it was created, renewed, or Spec
    was changed. Revisions will be removed by oldest first if the number of
    revisions exceeds this number.

    If set, revisionHistoryLimit must be a value of `1` or greater.
    If unset (`nil`), revisions will not be garbage collected.
    Default value is `nil`.
    """
    secret_name: Annotated[str, Field(alias="secretName")]
    """
    Name of the Secret resource that will be automatically created and
    managed by this Certificate resource. It will be populated with a
    private key and certificate, signed by the denoted issuer. The Secret
    resource lives in the same namespace as the Certificate resource.
    """
    secret_template: Annotated[Optional[SecretTemplate], Field(alias="secretTemplate")] = None
    """
    Defines annotations and labels to be copied to the Certificate's Secret.
    Labels and annotations on the Secret will be changed as they appear on the
    SecretTemplate when added or removed. SecretTemplate annotations are added
    in conjunction with, and cannot overwrite, the base set of annotations
    cert-manager sets on the Certificate's Secret.
    """
    subject: Optional[Subject] = None
    """
    Requested set of X509 certificate subject attributes.
    More info: https://datatracker.ietf.org/doc/html/rfc5280#section-4.1.2.6

    The common name attribute is specified separately in the `commonName` field.
    Cannot be set if the `literalSubject` field is set.
    """
    uris: Optional[List[str]] = None
    """
    Requested URI subject alternative names.
    """
    usages: Optional[
        List[
            Literal[
                "signing",
                "digital signature",
                "content commitment",
                "key encipherment",
                "key agreement",
                "data encipherment",
                "cert sign",
                "crl sign",
                "encipher only",
                "decipher only",
                "any",
                "server auth",
                "client auth",
                "code signing",
                "email protection",
                "s/mime",
                "ipsec end system",
                "ipsec tunnel",
                "ipsec user",
                "timestamping",
                "ocsp signing",
                "microsoft sgc",
                "netscape sgc",
            ]
        ]
    ] = None
    """
    Requested key usages and extended key usages.
    These usages are used to set the `usages` field on the created CertificateRequest
    resources. If `encodeUsagesInRequest` is unset or set to `true`, the usages
    will additionally be encoded in the `request` field which contains the CSR blob.

    If unset, defaults to `digital signature` and `key encipherment`.
    """


class ConditionModel(BaseModel):
    class Builder(BaseModelBuilder):
        @property
        def cls(self) -> Type["ConditionModel"]:
            return ConditionModel

        def build(self) -> "ConditionModel":
            return ConditionModel(**self._attrs)

        def last_transition_time(self, value: Optional[datetime], /) -> Self:
            """
            LastTransitionTime is the timestamp corresponding to the last status
            change of this condition.
            """
            return self._set("last_transition_time", value)

        def message(self, value: Optional[str], /) -> Self:
            """
            Message is a human readable description of the details of the last
            transition, complementing reason.
            """
            return self._set("message", value)

        def observed_generation(self, value: Optional[int], /) -> Self:
            """
            If set, this represents the .metadata.generation that the condition was
            set based upon.
            For instance, if .metadata.generation is currently 12, but the
            .status.condition[x].observedGeneration is 9, the condition is out of date
            with respect to the current state of the Certificate.
            """
            return self._set("observed_generation", value)

        def reason(self, value: Optional[str], /) -> Self:
            """
            Reason is a brief machine readable explanation for the condition's last
            transition.
            """
            return self._set("reason", value)

        def status(self, value: Literal["True", "False", "Unknown"], /) -> Self:
            """
            Status of the condition, one of (`True`, `False`, `Unknown`).
            """
            return self._set("status", value)

        def type(self, value: str, /) -> Self:
            """
            Type of the condition, known values are (`Ready`, `Issuing`).
            """
            return self._set("type", value)

    class BuilderContext(BuilderContextBase["ConditionModel.Builder"]):
        def model_post_init(self, __context) -> None:
            self._builder = ConditionModel.Builder()
            self._builder._in_context = True
            self._parent_builder = None
            self._field_name = None

    @classmethod
    def builder(cls) -> Builder:
        return cls.Builder()

    @classmethod
    def new(cls) -> BuilderContext:
        """Creates a new context manager builder for ConditionModel."""
        return cls.BuilderContext()

    class ListBuilder(GenericListBuilder["ConditionModel", Builder]):
        def __init__(self):
            raise NotImplementedError(
                "This class is not meant to be instantiated. Use ConditionModel.list_builder() instead."
            )

    @classmethod
    def list_builder(cls) -> ListBuilder:
        return GenericListBuilder[cls, cls.Builder]()  # type: ignore

    last_transition_time: Annotated[Optional[datetime], Field(alias="lastTransitionTime")] = None
    """
    LastTransitionTime is the timestamp corresponding to the last status
    change of this condition.
    """
    message: Optional[str] = None
    """
    Message is a human readable description of the details of the last
    transition, complementing reason.
    """
    observed_generation: Annotated[Optional[int], Field(alias="observedGeneration")] = None
    """
    If set, this represents the .metadata.generation that the condition was
    set based upon.
    For instance, if .metadata.generation is currently 12, but the
    .status.condition[x].observedGeneration is 9, the condition is out of date
    with respect to the current state of the Certificate.
    """
    reason: Optional[str] = None
    """
    Reason is a brief machine readable explanation for the condition's last
    transition.
    """
    status: Literal["True", "False", "Unknown"]
    """
    Status of the condition, one of (`True`, `False`, `Unknown`).
    """
    type: str
    """
    Type of the condition, known values are (`Ready`, `Issuing`).
    """


class CertificateStatus(BaseModel):
    class Builder(BaseModelBuilder):
        @property
        def cls(self) -> Type["CertificateStatus"]:
            return CertificateStatus

        def build(self) -> "CertificateStatus":
            return CertificateStatus(**self._attrs)

        @overload
        def conditions(
            self, value_or_callback: List[ConditionModel], /
        ) -> "CertificateStatus.Builder": ...

        @overload
        def conditions(
            self,
            value_or_callback: Callable[
                [GenericListBuilder[ConditionModel, ConditionModel.Builder]],
                GenericListBuilder[ConditionModel, ConditionModel.Builder] | List[ConditionModel],
            ],
            /,
        ) -> "CertificateStatus.Builder": ...

        @overload
        def conditions(
            self, value_or_callback: Never = ...
        ) -> ListBuilderContext[ConditionModel.Builder]: ...

        def conditions(self, value_or_callback=None, /):
            """
            List of status conditions to indicate the status of certificates.
            Known condition types are `Ready` and `Issuing`.
            """
            if self._in_context and value_or_callback is None:
                context = ListBuilderContext[ConditionModel.Builder]()
                context._parent_builder = self
                context._field_name = "conditions"
                return context

            value = value_or_callback
            if callable(value_or_callback):
                output = value_or_callback(ConditionModel.list_builder())
                if isinstance(output, GenericListBuilder):
                    value = output.build()
                else:
                    value = output
            return self._set("conditions", value)

        def failed_issuance_attempts(self, value: Optional[int], /) -> Self:
            """
            The number of continuous failed issuance attempts up till now. This
            field gets removed (if set) on a successful issuance and gets set to
            1 if unset and an issuance has failed. If an issuance has failed, the
            delay till the next issuance will be calculated using formula
            time.Hour * 2 ^ (failedIssuanceAttempts - 1).
            """
            return self._set("failed_issuance_attempts", value)

        def last_failure_time(self, value: Optional[datetime], /) -> Self:
            """
            LastFailureTime is set only if the latest issuance for this
            Certificate failed and contains the time of the failure. If an
            issuance has failed, the delay till the next issuance will be
            calculated using formula time.Hour * 2 ^ (failedIssuanceAttempts -
            1). If the latest issuance has succeeded this field will be unset.
            """
            return self._set("last_failure_time", value)

        def next_private_key_secret_name(self, value: Optional[str], /) -> Self:
            """
            The name of the Secret resource containing the private key to be used
            for the next certificate iteration.
            The keymanager controller will automatically set this field if the
            `Issuing` condition is set to `True`.
            It will automatically unset this field when the Issuing condition is
            not set or False.
            """
            return self._set("next_private_key_secret_name", value)

        def not_after(self, value: Optional[datetime], /) -> Self:
            """
            The expiration time of the certificate stored in the secret named
            by this resource in `spec.secretName`.
            """
            return self._set("not_after", value)

        def not_before(self, value: Optional[datetime], /) -> Self:
            """
            The time after which the certificate stored in the secret named
            by this resource in `spec.secretName` is valid.
            """
            return self._set("not_before", value)

        def renewal_time(self, value: Optional[datetime], /) -> Self:
            """
            RenewalTime is the time at which the certificate will be next
            renewed.
            If not set, no upcoming renewal is scheduled.
            """
            return self._set("renewal_time", value)

        def revision(self, value: Optional[int], /) -> Self:
            """
            The current 'revision' of the certificate as issued.

            When a CertificateRequest resource is created, it will have the
            `cert-manager.io/certificate-revision` set to one greater than the
            current value of this field.

            Upon issuance, this field will be set to the value of the annotation
            on the CertificateRequest resource used to issue the certificate.

            Persisting the value on the CertificateRequest resource allows the
            certificates controller to know whether a request is part of an old
            issuance or if it is part of the ongoing revision's issuance by
            checking if the revision value in the annotation is greater than this
            field.
            """
            return self._set("revision", value)

    class BuilderContext(BuilderContextBase["CertificateStatus.Builder"]):
        def model_post_init(self, __context) -> None:
            self._builder = CertificateStatus.Builder()
            self._builder._in_context = True
            self._parent_builder = None
            self._field_name = None

    @classmethod
    def builder(cls) -> Builder:
        return cls.Builder()

    @classmethod
    def new(cls) -> BuilderContext:
        """Creates a new context manager builder for CertificateStatus."""
        return cls.BuilderContext()

    class ListBuilder(GenericListBuilder["CertificateStatus", Builder]):
        def __init__(self):
            raise NotImplementedError(
                "This class is not meant to be instantiated. Use CertificateStatus.list_builder() instead."
            )

    @classmethod
    def list_builder(cls) -> ListBuilder:
        return GenericListBuilder[cls, cls.Builder]()  # type: ignore

    conditions: Optional[List[ConditionModel]] = None
    """
    List of status conditions to indicate the status of certificates.
    Known condition types are `Ready` and `Issuing`.
    """
    failed_issuance_attempts: Annotated[Optional[int], Field(alias="failedIssuanceAttempts")] = None
    """
    The number of continuous failed issuance attempts up till now. This
    field gets removed (if set) on a successful issuance and gets set to
    1 if unset and an issuance has failed. If an issuance has failed, the
    delay till the next issuance will be calculated using formula
    time.Hour * 2 ^ (failedIssuanceAttempts - 1).
    """
    last_failure_time: Annotated[Optional[datetime], Field(alias="lastFailureTime")] = None
    """
    LastFailureTime is set only if the latest issuance for this
    Certificate failed and contains the time of the failure. If an
    issuance has failed, the delay till the next issuance will be
    calculated using formula time.Hour * 2 ^ (failedIssuanceAttempts -
    1). If the latest issuance has succeeded this field will be unset.
    """
    next_private_key_secret_name: Annotated[
        Optional[str], Field(alias="nextPrivateKeySecretName")
    ] = None
    """
    The name of the Secret resource containing the private key to be used
    for the next certificate iteration.
    The keymanager controller will automatically set this field if the
    `Issuing` condition is set to `True`.
    It will automatically unset this field when the Issuing condition is
    not set or False.
    """
    not_after: Annotated[Optional[datetime], Field(alias="notAfter")] = None
    """
    The expiration time of the certificate stored in the secret named
    by this resource in `spec.secretName`.
    """
    not_before: Annotated[Optional[datetime], Field(alias="notBefore")] = None
    """
    The time after which the certificate stored in the secret named
    by this resource in `spec.secretName` is valid.
    """
    renewal_time: Annotated[Optional[datetime], Field(alias="renewalTime")] = None
    """
    RenewalTime is the time at which the certificate will be next
    renewed.
    If not set, no upcoming renewal is scheduled.
    """
    revision: Optional[int] = None
    """
    The current 'revision' of the certificate as issued.

    When a CertificateRequest resource is created, it will have the
    `cert-manager.io/certificate-revision` set to one greater than the
    current value of this field.

    Upon issuance, this field will be set to the value of the annotation
    on the CertificateRequest resource used to issue the certificate.

    Persisting the value on the CertificateRequest resource allows the
    certificates controller to know whether a request is part of an old
    issuance or if it is part of the ongoing revision's issuance by
    checking if the revision value in the annotation is greater than this
    field.
    """


class KeySecretRef(BaseModel):
    class Builder(BaseModelBuilder):
        @property
        def cls(self) -> Type["KeySecretRef"]:
            return KeySecretRef

        def build(self) -> "KeySecretRef":
            return KeySecretRef(**self._attrs)

        def key(self, value: Optional[str], /) -> Self:
            """
            The key of the entry in the Secret resource's `data` field to be used.
            Some instances of this field may be defaulted, in others it may be
            required.
            """
            return self._set("key", value)

        def name(self, value: str, /) -> Self:
            """
            Name of the resource being referred to.
            More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
            """
            return self._set("name", value)

    class BuilderContext(BuilderContextBase["KeySecretRef.Builder"]):
        def model_post_init(self, __context) -> None:
            self._builder = KeySecretRef.Builder()
            self._builder._in_context = True
            self._parent_builder = None
            self._field_name = None

    @classmethod
    def builder(cls) -> Builder:
        return cls.Builder()

    @classmethod
    def new(cls) -> BuilderContext:
        """Creates a new context manager builder for KeySecretRef."""
        return cls.BuilderContext()

    class ListBuilder(GenericListBuilder["KeySecretRef", Builder]):
        def __init__(self):
            raise NotImplementedError(
                "This class is not meant to be instantiated. Use KeySecretRef.list_builder() instead."
            )

    @classmethod
    def list_builder(cls) -> ListBuilder:
        return GenericListBuilder[cls, cls.Builder]()  # type: ignore

    key: Optional[str] = None
    """
    The key of the entry in the Secret resource's `data` field to be used.
    Some instances of this field may be defaulted, in others it may be
    required.
    """
    name: str
    """
    Name of the resource being referred to.
    More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
    """


class ExternalAccountBinding(BaseModel):
    class Builder(BaseModelBuilder):
        @property
        def cls(self) -> Type["ExternalAccountBinding"]:
            return ExternalAccountBinding

        def build(self) -> "ExternalAccountBinding":
            return ExternalAccountBinding(**self._attrs)

        def key_algorithm(self, value: Optional[Literal["HS256", "HS384", "HS512"]], /) -> Self:
            """
            Deprecated: keyAlgorithm field exists for historical compatibility
            reasons and should not be used. The algorithm is now hardcoded to HS256
            in golang/x/crypto/acme.
            """
            return self._set("key_algorithm", value)

        def key_id(self, value: str, /) -> Self:
            """
            keyID is the ID of the CA key that the External Account is bound to.
            """
            return self._set("key_id", value)

        @overload
        def key_secret_ref(
            self, value_or_callback: KeySecretRef, /
        ) -> "ExternalAccountBinding.Builder": ...

        @overload
        def key_secret_ref(
            self,
            value_or_callback: Callable[
                [KeySecretRef.Builder], KeySecretRef.Builder | KeySecretRef
            ],
            /,
        ) -> "ExternalAccountBinding.Builder": ...

        @overload
        def key_secret_ref(
            self, value_or_callback: Never = ...
        ) -> "KeySecretRef.BuilderContext": ...

        def key_secret_ref(self, value_or_callback=None, /):
            """
            keySecretRef is a Secret Key Selector referencing a data item in a Kubernetes
            Secret which holds the symmetric MAC key of the External Account Binding.
            The `key` is the index string that is paired with the key data in the
            Secret and should not be confused with the key data itself, or indeed with
            the External Account Binding keyID above.
            The secret key stored in the Secret **must** be un-padded, base64 URL
            encoded data.
            """
            if self._in_context and value_or_callback is None:
                context = KeySecretRef.BuilderContext()
                context._parent_builder = self
                context._field_name = "key_secret_ref"
                return context

            value = value_or_callback
            if callable(value_or_callback):
                output = value_or_callback(KeySecretRef.builder())
                if isinstance(output, KeySecretRef.Builder):
                    value = output.build()
                else:
                    value = output
            return self._set("key_secret_ref", value)

    class BuilderContext(BuilderContextBase["ExternalAccountBinding.Builder"]):
        def model_post_init(self, __context) -> None:
            self._builder = ExternalAccountBinding.Builder()
            self._builder._in_context = True
            self._parent_builder = None
            self._field_name = None

    @classmethod
    def builder(cls) -> Builder:
        return cls.Builder()

    @classmethod
    def new(cls) -> BuilderContext:
        """Creates a new context manager builder for ExternalAccountBinding."""
        return cls.BuilderContext()

    class ListBuilder(GenericListBuilder["ExternalAccountBinding", Builder]):
        def __init__(self):
            raise NotImplementedError(
                "This class is not meant to be instantiated. Use ExternalAccountBinding.list_builder() instead."
            )

    @classmethod
    def list_builder(cls) -> ListBuilder:
        return GenericListBuilder[cls, cls.Builder]()  # type: ignore

    key_algorithm: Annotated[
        Optional[Literal["HS256", "HS384", "HS512"]], Field(alias="keyAlgorithm")
    ] = None
    """
    Deprecated: keyAlgorithm field exists for historical compatibility
    reasons and should not be used. The algorithm is now hardcoded to HS256
    in golang/x/crypto/acme.
    """
    key_id: Annotated[str, Field(alias="keyID")]
    """
    keyID is the ID of the CA key that the External Account is bound to.
    """
    key_secret_ref: Annotated[KeySecretRef, Field(alias="keySecretRef")]
    """
    keySecretRef is a Secret Key Selector referencing a data item in a Kubernetes
    Secret which holds the symmetric MAC key of the External Account Binding.
    The `key` is the index string that is paired with the key data in the
    Secret and should not be confused with the key data itself, or indeed with
    the External Account Binding keyID above.
    The secret key stored in the Secret **must** be un-padded, base64 URL
    encoded data.
    """


class PrivateKeySecretRef(BaseModel):
    class Builder(BaseModelBuilder):
        @property
        def cls(self) -> Type["PrivateKeySecretRef"]:
            return PrivateKeySecretRef

        def build(self) -> "PrivateKeySecretRef":
            return PrivateKeySecretRef(**self._attrs)

        def key(self, value: Optional[str], /) -> Self:
            """
            The key of the entry in the Secret resource's `data` field to be used.
            Some instances of this field may be defaulted, in others it may be
            required.
            """
            return self._set("key", value)

        def name(self, value: str, /) -> Self:
            """
            Name of the resource being referred to.
            More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
            """
            return self._set("name", value)

    class BuilderContext(BuilderContextBase["PrivateKeySecretRef.Builder"]):
        def model_post_init(self, __context) -> None:
            self._builder = PrivateKeySecretRef.Builder()
            self._builder._in_context = True
            self._parent_builder = None
            self._field_name = None

    @classmethod
    def builder(cls) -> Builder:
        return cls.Builder()

    @classmethod
    def new(cls) -> BuilderContext:
        """Creates a new context manager builder for PrivateKeySecretRef."""
        return cls.BuilderContext()

    class ListBuilder(GenericListBuilder["PrivateKeySecretRef", Builder]):
        def __init__(self):
            raise NotImplementedError(
                "This class is not meant to be instantiated. Use PrivateKeySecretRef.list_builder() instead."
            )

    @classmethod
    def list_builder(cls) -> ListBuilder:
        return GenericListBuilder[cls, cls.Builder]()  # type: ignore

    key: Optional[str] = None
    """
    The key of the entry in the Secret resource's `data` field to be used.
    Some instances of this field may be defaulted, in others it may be
    required.
    """
    name: str
    """
    Name of the resource being referred to.
    More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
    """


class AccountSecretRef(BaseModel):
    class Builder(BaseModelBuilder):
        @property
        def cls(self) -> Type["AccountSecretRef"]:
            return AccountSecretRef

        def build(self) -> "AccountSecretRef":
            return AccountSecretRef(**self._attrs)

        def key(self, value: Optional[str], /) -> Self:
            """
            The key of the entry in the Secret resource's `data` field to be used.
            Some instances of this field may be defaulted, in others it may be
            required.
            """
            return self._set("key", value)

        def name(self, value: str, /) -> Self:
            """
            Name of the resource being referred to.
            More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
            """
            return self._set("name", value)

    class BuilderContext(BuilderContextBase["AccountSecretRef.Builder"]):
        def model_post_init(self, __context) -> None:
            self._builder = AccountSecretRef.Builder()
            self._builder._in_context = True
            self._parent_builder = None
            self._field_name = None

    @classmethod
    def builder(cls) -> Builder:
        return cls.Builder()

    @classmethod
    def new(cls) -> BuilderContext:
        """Creates a new context manager builder for AccountSecretRef."""
        return cls.BuilderContext()

    class ListBuilder(GenericListBuilder["AccountSecretRef", Builder]):
        def __init__(self):
            raise NotImplementedError(
                "This class is not meant to be instantiated. Use AccountSecretRef.list_builder() instead."
            )

    @classmethod
    def list_builder(cls) -> ListBuilder:
        return GenericListBuilder[cls, cls.Builder]()  # type: ignore

    key: Optional[str] = None
    """
    The key of the entry in the Secret resource's `data` field to be used.
    Some instances of this field may be defaulted, in others it may be
    required.
    """
    name: str
    """
    Name of the resource being referred to.
    More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
    """


class AcmeDns(BaseModel):
    class Builder(BaseModelBuilder):
        @property
        def cls(self) -> Type["AcmeDns"]:
            return AcmeDns

        def build(self) -> "AcmeDns":
            return AcmeDns(**self._attrs)

        @overload
        def account_secret_ref(
            self, value_or_callback: AccountSecretRef, /
        ) -> "AcmeDns.Builder": ...

        @overload
        def account_secret_ref(
            self,
            value_or_callback: Callable[
                [AccountSecretRef.Builder], AccountSecretRef.Builder | AccountSecretRef
            ],
            /,
        ) -> "AcmeDns.Builder": ...

        @overload
        def account_secret_ref(
            self, value_or_callback: Never = ...
        ) -> "AccountSecretRef.BuilderContext": ...

        def account_secret_ref(self, value_or_callback=None, /):
            """
            A reference to a specific 'key' within a Secret resource.
            In some instances, `key` is a required field.
            """
            if self._in_context and value_or_callback is None:
                context = AccountSecretRef.BuilderContext()
                context._parent_builder = self
                context._field_name = "account_secret_ref"
                return context

            value = value_or_callback
            if callable(value_or_callback):
                output = value_or_callback(AccountSecretRef.builder())
                if isinstance(output, AccountSecretRef.Builder):
                    value = output.build()
                else:
                    value = output
            return self._set("account_secret_ref", value)

        def host(self, value: str, /) -> Self:
            return self._set("host", value)

    class BuilderContext(BuilderContextBase["AcmeDns.Builder"]):
        def model_post_init(self, __context) -> None:
            self._builder = AcmeDns.Builder()
            self._builder._in_context = True
            self._parent_builder = None
            self._field_name = None

    @classmethod
    def builder(cls) -> Builder:
        return cls.Builder()

    @classmethod
    def new(cls) -> BuilderContext:
        """Creates a new context manager builder for AcmeDns."""
        return cls.BuilderContext()

    class ListBuilder(GenericListBuilder["AcmeDns", Builder]):
        def __init__(self):
            raise NotImplementedError(
                "This class is not meant to be instantiated. Use AcmeDns.list_builder() instead."
            )

    @classmethod
    def list_builder(cls) -> ListBuilder:
        return GenericListBuilder[cls, cls.Builder]()  # type: ignore

    account_secret_ref: Annotated[AccountSecretRef, Field(alias="accountSecretRef")]
    """
    A reference to a specific 'key' within a Secret resource.
    In some instances, `key` is a required field.
    """
    host: str


class AccessTokenSecretRef(BaseModel):
    class Builder(BaseModelBuilder):
        @property
        def cls(self) -> Type["AccessTokenSecretRef"]:
            return AccessTokenSecretRef

        def build(self) -> "AccessTokenSecretRef":
            return AccessTokenSecretRef(**self._attrs)

        def key(self, value: Optional[str], /) -> Self:
            """
            The key of the entry in the Secret resource's `data` field to be used.
            Some instances of this field may be defaulted, in others it may be
            required.
            """
            return self._set("key", value)

        def name(self, value: str, /) -> Self:
            """
            Name of the resource being referred to.
            More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
            """
            return self._set("name", value)

    class BuilderContext(BuilderContextBase["AccessTokenSecretRef.Builder"]):
        def model_post_init(self, __context) -> None:
            self._builder = AccessTokenSecretRef.Builder()
            self._builder._in_context = True
            self._parent_builder = None
            self._field_name = None

    @classmethod
    def builder(cls) -> Builder:
        return cls.Builder()

    @classmethod
    def new(cls) -> BuilderContext:
        """Creates a new context manager builder for AccessTokenSecretRef."""
        return cls.BuilderContext()

    class ListBuilder(GenericListBuilder["AccessTokenSecretRef", Builder]):
        def __init__(self):
            raise NotImplementedError(
                "This class is not meant to be instantiated. Use AccessTokenSecretRef.list_builder() instead."
            )

    @classmethod
    def list_builder(cls) -> ListBuilder:
        return GenericListBuilder[cls, cls.Builder]()  # type: ignore

    key: Optional[str] = None
    """
    The key of the entry in the Secret resource's `data` field to be used.
    Some instances of this field may be defaulted, in others it may be
    required.
    """
    name: str
    """
    Name of the resource being referred to.
    More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
    """


class ClientSecretSecretRef(BaseModel):
    class Builder(BaseModelBuilder):
        @property
        def cls(self) -> Type["ClientSecretSecretRef"]:
            return ClientSecretSecretRef

        def build(self) -> "ClientSecretSecretRef":
            return ClientSecretSecretRef(**self._attrs)

        def key(self, value: Optional[str], /) -> Self:
            """
            The key of the entry in the Secret resource's `data` field to be used.
            Some instances of this field may be defaulted, in others it may be
            required.
            """
            return self._set("key", value)

        def name(self, value: str, /) -> Self:
            """
            Name of the resource being referred to.
            More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
            """
            return self._set("name", value)

    class BuilderContext(BuilderContextBase["ClientSecretSecretRef.Builder"]):
        def model_post_init(self, __context) -> None:
            self._builder = ClientSecretSecretRef.Builder()
            self._builder._in_context = True
            self._parent_builder = None
            self._field_name = None

    @classmethod
    def builder(cls) -> Builder:
        return cls.Builder()

    @classmethod
    def new(cls) -> BuilderContext:
        """Creates a new context manager builder for ClientSecretSecretRef."""
        return cls.BuilderContext()

    class ListBuilder(GenericListBuilder["ClientSecretSecretRef", Builder]):
        def __init__(self):
            raise NotImplementedError(
                "This class is not meant to be instantiated. Use ClientSecretSecretRef.list_builder() instead."
            )

    @classmethod
    def list_builder(cls) -> ListBuilder:
        return GenericListBuilder[cls, cls.Builder]()  # type: ignore

    key: Optional[str] = None
    """
    The key of the entry in the Secret resource's `data` field to be used.
    Some instances of this field may be defaulted, in others it may be
    required.
    """
    name: str
    """
    Name of the resource being referred to.
    More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
    """


class ClientTokenSecretRef(BaseModel):
    class Builder(BaseModelBuilder):
        @property
        def cls(self) -> Type["ClientTokenSecretRef"]:
            return ClientTokenSecretRef

        def build(self) -> "ClientTokenSecretRef":
            return ClientTokenSecretRef(**self._attrs)

        def key(self, value: Optional[str], /) -> Self:
            """
            The key of the entry in the Secret resource's `data` field to be used.
            Some instances of this field may be defaulted, in others it may be
            required.
            """
            return self._set("key", value)

        def name(self, value: str, /) -> Self:
            """
            Name of the resource being referred to.
            More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
            """
            return self._set("name", value)

    class BuilderContext(BuilderContextBase["ClientTokenSecretRef.Builder"]):
        def model_post_init(self, __context) -> None:
            self._builder = ClientTokenSecretRef.Builder()
            self._builder._in_context = True
            self._parent_builder = None
            self._field_name = None

    @classmethod
    def builder(cls) -> Builder:
        return cls.Builder()

    @classmethod
    def new(cls) -> BuilderContext:
        """Creates a new context manager builder for ClientTokenSecretRef."""
        return cls.BuilderContext()

    class ListBuilder(GenericListBuilder["ClientTokenSecretRef", Builder]):
        def __init__(self):
            raise NotImplementedError(
                "This class is not meant to be instantiated. Use ClientTokenSecretRef.list_builder() instead."
            )

    @classmethod
    def list_builder(cls) -> ListBuilder:
        return GenericListBuilder[cls, cls.Builder]()  # type: ignore

    key: Optional[str] = None
    """
    The key of the entry in the Secret resource's `data` field to be used.
    Some instances of this field may be defaulted, in others it may be
    required.
    """
    name: str
    """
    Name of the resource being referred to.
    More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
    """


class Akamai(BaseModel):
    class Builder(BaseModelBuilder):
        @property
        def cls(self) -> Type["Akamai"]:
            return Akamai

        def build(self) -> "Akamai":
            return Akamai(**self._attrs)

        @overload
        def access_token_secret_ref(
            self, value_or_callback: AccessTokenSecretRef, /
        ) -> "Akamai.Builder": ...

        @overload
        def access_token_secret_ref(
            self,
            value_or_callback: Callable[
                [AccessTokenSecretRef.Builder],
                AccessTokenSecretRef.Builder | AccessTokenSecretRef,
            ],
            /,
        ) -> "Akamai.Builder": ...

        @overload
        def access_token_secret_ref(
            self, value_or_callback: Never = ...
        ) -> "AccessTokenSecretRef.BuilderContext": ...

        def access_token_secret_ref(self, value_or_callback=None, /):
            """
            A reference to a specific 'key' within a Secret resource.
            In some instances, `key` is a required field.
            """
            if self._in_context and value_or_callback is None:
                context = AccessTokenSecretRef.BuilderContext()
                context._parent_builder = self
                context._field_name = "access_token_secret_ref"
                return context

            value = value_or_callback
            if callable(value_or_callback):
                output = value_or_callback(AccessTokenSecretRef.builder())
                if isinstance(output, AccessTokenSecretRef.Builder):
                    value = output.build()
                else:
                    value = output
            return self._set("access_token_secret_ref", value)

        @overload
        def client_secret_secret_ref(
            self, value_or_callback: ClientSecretSecretRef, /
        ) -> "Akamai.Builder": ...

        @overload
        def client_secret_secret_ref(
            self,
            value_or_callback: Callable[
                [ClientSecretSecretRef.Builder],
                ClientSecretSecretRef.Builder | ClientSecretSecretRef,
            ],
            /,
        ) -> "Akamai.Builder": ...

        @overload
        def client_secret_secret_ref(
            self, value_or_callback: Never = ...
        ) -> "ClientSecretSecretRef.BuilderContext": ...

        def client_secret_secret_ref(self, value_or_callback=None, /):
            """
            A reference to a specific 'key' within a Secret resource.
            In some instances, `key` is a required field.
            """
            if self._in_context and value_or_callback is None:
                context = ClientSecretSecretRef.BuilderContext()
                context._parent_builder = self
                context._field_name = "client_secret_secret_ref"
                return context

            value = value_or_callback
            if callable(value_or_callback):
                output = value_or_callback(ClientSecretSecretRef.builder())
                if isinstance(output, ClientSecretSecretRef.Builder):
                    value = output.build()
                else:
                    value = output
            return self._set("client_secret_secret_ref", value)

        @overload
        def client_token_secret_ref(
            self, value_or_callback: ClientTokenSecretRef, /
        ) -> "Akamai.Builder": ...

        @overload
        def client_token_secret_ref(
            self,
            value_or_callback: Callable[
                [ClientTokenSecretRef.Builder],
                ClientTokenSecretRef.Builder | ClientTokenSecretRef,
            ],
            /,
        ) -> "Akamai.Builder": ...

        @overload
        def client_token_secret_ref(
            self, value_or_callback: Never = ...
        ) -> "ClientTokenSecretRef.BuilderContext": ...

        def client_token_secret_ref(self, value_or_callback=None, /):
            """
            A reference to a specific 'key' within a Secret resource.
            In some instances, `key` is a required field.
            """
            if self._in_context and value_or_callback is None:
                context = ClientTokenSecretRef.BuilderContext()
                context._parent_builder = self
                context._field_name = "client_token_secret_ref"
                return context

            value = value_or_callback
            if callable(value_or_callback):
                output = value_or_callback(ClientTokenSecretRef.builder())
                if isinstance(output, ClientTokenSecretRef.Builder):
                    value = output.build()
                else:
                    value = output
            return self._set("client_token_secret_ref", value)

        def service_consumer_domain(self, value: str, /) -> Self:
            return self._set("service_consumer_domain", value)

    class BuilderContext(BuilderContextBase["Akamai.Builder"]):
        def model_post_init(self, __context) -> None:
            self._builder = Akamai.Builder()
            self._builder._in_context = True
            self._parent_builder = None
            self._field_name = None

    @classmethod
    def builder(cls) -> Builder:
        return cls.Builder()

    @classmethod
    def new(cls) -> BuilderContext:
        """Creates a new context manager builder for Akamai."""
        return cls.BuilderContext()

    class ListBuilder(GenericListBuilder["Akamai", Builder]):
        def __init__(self):
            raise NotImplementedError(
                "This class is not meant to be instantiated. Use Akamai.list_builder() instead."
            )

    @classmethod
    def list_builder(cls) -> ListBuilder:
        return GenericListBuilder[cls, cls.Builder]()  # type: ignore

    access_token_secret_ref: Annotated[AccessTokenSecretRef, Field(alias="accessTokenSecretRef")]
    """
    A reference to a specific 'key' within a Secret resource.
    In some instances, `key` is a required field.
    """
    client_secret_secret_ref: Annotated[ClientSecretSecretRef, Field(alias="clientSecretSecretRef")]
    """
    A reference to a specific 'key' within a Secret resource.
    In some instances, `key` is a required field.
    """
    client_token_secret_ref: Annotated[ClientTokenSecretRef, Field(alias="clientTokenSecretRef")]
    """
    A reference to a specific 'key' within a Secret resource.
    In some instances, `key` is a required field.
    """
    service_consumer_domain: Annotated[str, Field(alias="serviceConsumerDomain")]


class ManagedIdentity(BaseModel):
    class Builder(BaseModelBuilder):
        @property
        def cls(self) -> Type["ManagedIdentity"]:
            return ManagedIdentity

        def build(self) -> "ManagedIdentity":
            return ManagedIdentity(**self._attrs)

        def client_id(self, value: Optional[str], /) -> Self:
            """
            client ID of the managed identity, can not be used at the same time as resourceID
            """
            return self._set("client_id", value)

        def resource_id(self, value: Optional[str], /) -> Self:
            """
            resource ID of the managed identity, can not be used at the same time as clientID
            Cannot be used for Azure Managed Service Identity
            """
            return self._set("resource_id", value)

    class BuilderContext(BuilderContextBase["ManagedIdentity.Builder"]):
        def model_post_init(self, __context) -> None:
            self._builder = ManagedIdentity.Builder()
            self._builder._in_context = True
            self._parent_builder = None
            self._field_name = None

    @classmethod
    def builder(cls) -> Builder:
        return cls.Builder()

    @classmethod
    def new(cls) -> BuilderContext:
        """Creates a new context manager builder for ManagedIdentity."""
        return cls.BuilderContext()

    class ListBuilder(GenericListBuilder["ManagedIdentity", Builder]):
        def __init__(self):
            raise NotImplementedError(
                "This class is not meant to be instantiated. Use ManagedIdentity.list_builder() instead."
            )

    @classmethod
    def list_builder(cls) -> ListBuilder:
        return GenericListBuilder[cls, cls.Builder]()  # type: ignore

    client_id: Annotated[Optional[str], Field(alias="clientID")] = None
    """
    client ID of the managed identity, can not be used at the same time as resourceID
    """
    resource_id: Annotated[Optional[str], Field(alias="resourceID")] = None
    """
    resource ID of the managed identity, can not be used at the same time as clientID
    Cannot be used for Azure Managed Service Identity
    """


class AzureDns(BaseModel):
    class Builder(BaseModelBuilder):
        @property
        def cls(self) -> Type["AzureDns"]:
            return AzureDns

        def build(self) -> "AzureDns":
            return AzureDns(**self._attrs)

        def client_id(self, value: Optional[str], /) -> Self:
            """
            Auth: Azure Service Principal:
            The ClientID of the Azure Service Principal used to authenticate with Azure DNS.
            If set, ClientSecret and TenantID must also be set.
            """
            return self._set("client_id", value)

        @overload
        def client_secret_secret_ref(
            self, value_or_callback: Optional[ClientSecretSecretRef], /
        ) -> "AzureDns.Builder": ...

        @overload
        def client_secret_secret_ref(
            self,
            value_or_callback: Callable[
                [ClientSecretSecretRef.Builder],
                ClientSecretSecretRef.Builder | ClientSecretSecretRef,
            ],
            /,
        ) -> "AzureDns.Builder": ...

        @overload
        def client_secret_secret_ref(
            self, value_or_callback: Never = ...
        ) -> "ClientSecretSecretRef.BuilderContext": ...

        def client_secret_secret_ref(self, value_or_callback=None, /):
            """
            Auth: Azure Service Principal:
            A reference to a Secret containing the password associated with the Service Principal.
            If set, ClientID and TenantID must also be set.
            """
            if self._in_context and value_or_callback is None:
                context = ClientSecretSecretRef.BuilderContext()
                context._parent_builder = self
                context._field_name = "client_secret_secret_ref"
                return context

            value = value_or_callback
            if callable(value_or_callback):
                output = value_or_callback(ClientSecretSecretRef.builder())
                if isinstance(output, ClientSecretSecretRef.Builder):
                    value = output.build()
                else:
                    value = output
            return self._set("client_secret_secret_ref", value)

        def environment(
            self,
            value: Optional[
                Literal[
                    "AzurePublicCloud",
                    "AzureChinaCloud",
                    "AzureGermanCloud",
                    "AzureUSGovernmentCloud",
                ]
            ],
            /,
        ) -> Self:
            """
            name of the Azure environment (default AzurePublicCloud)
            """
            return self._set("environment", value)

        def hosted_zone_name(self, value: Optional[str], /) -> Self:
            """
            name of the DNS zone that should be used
            """
            return self._set("hosted_zone_name", value)

        @overload
        def managed_identity(
            self, value_or_callback: Optional[ManagedIdentity], /
        ) -> "AzureDns.Builder": ...

        @overload
        def managed_identity(
            self,
            value_or_callback: Callable[
                [ManagedIdentity.Builder], ManagedIdentity.Builder | ManagedIdentity
            ],
            /,
        ) -> "AzureDns.Builder": ...

        @overload
        def managed_identity(
            self, value_or_callback: Never = ...
        ) -> "ManagedIdentity.BuilderContext": ...

        def managed_identity(self, value_or_callback=None, /):
            """
            Auth: Azure Workload Identity or Azure Managed Service Identity:
            Settings to enable Azure Workload Identity or Azure Managed Service Identity
            If set, ClientID, ClientSecret and TenantID must not be set.
            """
            if self._in_context and value_or_callback is None:
                context = ManagedIdentity.BuilderContext()
                context._parent_builder = self
                context._field_name = "managed_identity"
                return context

            value = value_or_callback
            if callable(value_or_callback):
                output = value_or_callback(ManagedIdentity.builder())
                if isinstance(output, ManagedIdentity.Builder):
                    value = output.build()
                else:
                    value = output
            return self._set("managed_identity", value)

        def resource_group_name(self, value: str, /) -> Self:
            """
            resource group the DNS zone is located in
            """
            return self._set("resource_group_name", value)

        def subscription_id(self, value: str, /) -> Self:
            """
            ID of the Azure subscription
            """
            return self._set("subscription_id", value)

        def tenant_id(self, value: Optional[str], /) -> Self:
            """
            Auth: Azure Service Principal:
            The TenantID of the Azure Service Principal used to authenticate with Azure DNS.
            If set, ClientID and ClientSecret must also be set.
            """
            return self._set("tenant_id", value)

    class BuilderContext(BuilderContextBase["AzureDns.Builder"]):
        def model_post_init(self, __context) -> None:
            self._builder = AzureDns.Builder()
            self._builder._in_context = True
            self._parent_builder = None
            self._field_name = None

    @classmethod
    def builder(cls) -> Builder:
        return cls.Builder()

    @classmethod
    def new(cls) -> BuilderContext:
        """Creates a new context manager builder for AzureDns."""
        return cls.BuilderContext()

    class ListBuilder(GenericListBuilder["AzureDns", Builder]):
        def __init__(self):
            raise NotImplementedError(
                "This class is not meant to be instantiated. Use AzureDns.list_builder() instead."
            )

    @classmethod
    def list_builder(cls) -> ListBuilder:
        return GenericListBuilder[cls, cls.Builder]()  # type: ignore

    client_id: Annotated[Optional[str], Field(alias="clientID")] = None
    """
    Auth: Azure Service Principal:
    The ClientID of the Azure Service Principal used to authenticate with Azure DNS.
    If set, ClientSecret and TenantID must also be set.
    """
    client_secret_secret_ref: Annotated[
        Optional[ClientSecretSecretRef], Field(alias="clientSecretSecretRef")
    ] = None
    """
    Auth: Azure Service Principal:
    A reference to a Secret containing the password associated with the Service Principal.
    If set, ClientID and TenantID must also be set.
    """
    environment: Optional[
        Literal[
            "AzurePublicCloud",
            "AzureChinaCloud",
            "AzureGermanCloud",
            "AzureUSGovernmentCloud",
        ]
    ] = None
    """
    name of the Azure environment (default AzurePublicCloud)
    """
    hosted_zone_name: Annotated[Optional[str], Field(alias="hostedZoneName")] = None
    """
    name of the DNS zone that should be used
    """
    managed_identity: Annotated[Optional[ManagedIdentity], Field(alias="managedIdentity")] = None
    """
    Auth: Azure Workload Identity or Azure Managed Service Identity:
    Settings to enable Azure Workload Identity or Azure Managed Service Identity
    If set, ClientID, ClientSecret and TenantID must not be set.
    """
    resource_group_name: Annotated[str, Field(alias="resourceGroupName")]
    """
    resource group the DNS zone is located in
    """
    subscription_id: Annotated[str, Field(alias="subscriptionID")]
    """
    ID of the Azure subscription
    """
    tenant_id: Annotated[Optional[str], Field(alias="tenantID")] = None
    """
    Auth: Azure Service Principal:
    The TenantID of the Azure Service Principal used to authenticate with Azure DNS.
    If set, ClientID and ClientSecret must also be set.
    """


class ServiceAccountSecretRef(BaseModel):
    class Builder(BaseModelBuilder):
        @property
        def cls(self) -> Type["ServiceAccountSecretRef"]:
            return ServiceAccountSecretRef

        def build(self) -> "ServiceAccountSecretRef":
            return ServiceAccountSecretRef(**self._attrs)

        def key(self, value: Optional[str], /) -> Self:
            """
            The key of the entry in the Secret resource's `data` field to be used.
            Some instances of this field may be defaulted, in others it may be
            required.
            """
            return self._set("key", value)

        def name(self, value: str, /) -> Self:
            """
            Name of the resource being referred to.
            More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
            """
            return self._set("name", value)

    class BuilderContext(BuilderContextBase["ServiceAccountSecretRef.Builder"]):
        def model_post_init(self, __context) -> None:
            self._builder = ServiceAccountSecretRef.Builder()
            self._builder._in_context = True
            self._parent_builder = None
            self._field_name = None

    @classmethod
    def builder(cls) -> Builder:
        return cls.Builder()

    @classmethod
    def new(cls) -> BuilderContext:
        """Creates a new context manager builder for ServiceAccountSecretRef."""
        return cls.BuilderContext()

    class ListBuilder(GenericListBuilder["ServiceAccountSecretRef", Builder]):
        def __init__(self):
            raise NotImplementedError(
                "This class is not meant to be instantiated. Use ServiceAccountSecretRef.list_builder() instead."
            )

    @classmethod
    def list_builder(cls) -> ListBuilder:
        return GenericListBuilder[cls, cls.Builder]()  # type: ignore

    key: Optional[str] = None
    """
    The key of the entry in the Secret resource's `data` field to be used.
    Some instances of this field may be defaulted, in others it may be
    required.
    """
    name: str
    """
    Name of the resource being referred to.
    More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
    """


class CloudDns(BaseModel):
    class Builder(BaseModelBuilder):
        @property
        def cls(self) -> Type["CloudDns"]:
            return CloudDns

        def build(self) -> "CloudDns":
            return CloudDns(**self._attrs)

        def hosted_zone_name(self, value: Optional[str], /) -> Self:
            """
            HostedZoneName is an optional field that tells cert-manager in which
            Cloud DNS zone the challenge record has to be created.
            If left empty cert-manager will automatically choose a zone.
            """
            return self._set("hosted_zone_name", value)

        def project(self, value: str, /) -> Self:
            return self._set("project", value)

        @overload
        def service_account_secret_ref(
            self, value_or_callback: Optional[ServiceAccountSecretRef], /
        ) -> "CloudDns.Builder": ...

        @overload
        def service_account_secret_ref(
            self,
            value_or_callback: Callable[
                [ServiceAccountSecretRef.Builder],
                ServiceAccountSecretRef.Builder | ServiceAccountSecretRef,
            ],
            /,
        ) -> "CloudDns.Builder": ...

        @overload
        def service_account_secret_ref(
            self, value_or_callback: Never = ...
        ) -> "ServiceAccountSecretRef.BuilderContext": ...

        def service_account_secret_ref(self, value_or_callback=None, /):
            """
            A reference to a specific 'key' within a Secret resource.
            In some instances, `key` is a required field.
            """
            if self._in_context and value_or_callback is None:
                context = ServiceAccountSecretRef.BuilderContext()
                context._parent_builder = self
                context._field_name = "service_account_secret_ref"
                return context

            value = value_or_callback
            if callable(value_or_callback):
                output = value_or_callback(ServiceAccountSecretRef.builder())
                if isinstance(output, ServiceAccountSecretRef.Builder):
                    value = output.build()
                else:
                    value = output
            return self._set("service_account_secret_ref", value)

    class BuilderContext(BuilderContextBase["CloudDns.Builder"]):
        def model_post_init(self, __context) -> None:
            self._builder = CloudDns.Builder()
            self._builder._in_context = True
            self._parent_builder = None
            self._field_name = None

    @classmethod
    def builder(cls) -> Builder:
        return cls.Builder()

    @classmethod
    def new(cls) -> BuilderContext:
        """Creates a new context manager builder for CloudDns."""
        return cls.BuilderContext()

    class ListBuilder(GenericListBuilder["CloudDns", Builder]):
        def __init__(self):
            raise NotImplementedError(
                "This class is not meant to be instantiated. Use CloudDns.list_builder() instead."
            )

    @classmethod
    def list_builder(cls) -> ListBuilder:
        return GenericListBuilder[cls, cls.Builder]()  # type: ignore

    hosted_zone_name: Annotated[Optional[str], Field(alias="hostedZoneName")] = None
    """
    HostedZoneName is an optional field that tells cert-manager in which
    Cloud DNS zone the challenge record has to be created.
    If left empty cert-manager will automatically choose a zone.
    """
    project: str
    service_account_secret_ref: Annotated[
        Optional[ServiceAccountSecretRef], Field(alias="serviceAccountSecretRef")
    ] = None
    """
    A reference to a specific 'key' within a Secret resource.
    In some instances, `key` is a required field.
    """


class ApiKeySecretRef(BaseModel):
    class Builder(BaseModelBuilder):
        @property
        def cls(self) -> Type["ApiKeySecretRef"]:
            return ApiKeySecretRef

        def build(self) -> "ApiKeySecretRef":
            return ApiKeySecretRef(**self._attrs)

        def key(self, value: Optional[str], /) -> Self:
            """
            The key of the entry in the Secret resource's `data` field to be used.
            Some instances of this field may be defaulted, in others it may be
            required.
            """
            return self._set("key", value)

        def name(self, value: str, /) -> Self:
            """
            Name of the resource being referred to.
            More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
            """
            return self._set("name", value)

    class BuilderContext(BuilderContextBase["ApiKeySecretRef.Builder"]):
        def model_post_init(self, __context) -> None:
            self._builder = ApiKeySecretRef.Builder()
            self._builder._in_context = True
            self._parent_builder = None
            self._field_name = None

    @classmethod
    def builder(cls) -> Builder:
        return cls.Builder()

    @classmethod
    def new(cls) -> BuilderContext:
        """Creates a new context manager builder for ApiKeySecretRef."""
        return cls.BuilderContext()

    class ListBuilder(GenericListBuilder["ApiKeySecretRef", Builder]):
        def __init__(self):
            raise NotImplementedError(
                "This class is not meant to be instantiated. Use ApiKeySecretRef.list_builder() instead."
            )

    @classmethod
    def list_builder(cls) -> ListBuilder:
        return GenericListBuilder[cls, cls.Builder]()  # type: ignore

    key: Optional[str] = None
    """
    The key of the entry in the Secret resource's `data` field to be used.
    Some instances of this field may be defaulted, in others it may be
    required.
    """
    name: str
    """
    Name of the resource being referred to.
    More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
    """


class ApiTokenSecretRef(BaseModel):
    class Builder(BaseModelBuilder):
        @property
        def cls(self) -> Type["ApiTokenSecretRef"]:
            return ApiTokenSecretRef

        def build(self) -> "ApiTokenSecretRef":
            return ApiTokenSecretRef(**self._attrs)

        def key(self, value: Optional[str], /) -> Self:
            """
            The key of the entry in the Secret resource's `data` field to be used.
            Some instances of this field may be defaulted, in others it may be
            required.
            """
            return self._set("key", value)

        def name(self, value: str, /) -> Self:
            """
            Name of the resource being referred to.
            More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
            """
            return self._set("name", value)

    class BuilderContext(BuilderContextBase["ApiTokenSecretRef.Builder"]):
        def model_post_init(self, __context) -> None:
            self._builder = ApiTokenSecretRef.Builder()
            self._builder._in_context = True
            self._parent_builder = None
            self._field_name = None

    @classmethod
    def builder(cls) -> Builder:
        return cls.Builder()

    @classmethod
    def new(cls) -> BuilderContext:
        """Creates a new context manager builder for ApiTokenSecretRef."""
        return cls.BuilderContext()

    class ListBuilder(GenericListBuilder["ApiTokenSecretRef", Builder]):
        def __init__(self):
            raise NotImplementedError(
                "This class is not meant to be instantiated. Use ApiTokenSecretRef.list_builder() instead."
            )

    @classmethod
    def list_builder(cls) -> ListBuilder:
        return GenericListBuilder[cls, cls.Builder]()  # type: ignore

    key: Optional[str] = None
    """
    The key of the entry in the Secret resource's `data` field to be used.
    Some instances of this field may be defaulted, in others it may be
    required.
    """
    name: str
    """
    Name of the resource being referred to.
    More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
    """


class Cloudflare(BaseModel):
    class Builder(BaseModelBuilder):
        @property
        def cls(self) -> Type["Cloudflare"]:
            return Cloudflare

        def build(self) -> "Cloudflare":
            return Cloudflare(**self._attrs)

        @overload
        def api_key_secret_ref(
            self, value_or_callback: Optional[ApiKeySecretRef], /
        ) -> "Cloudflare.Builder": ...

        @overload
        def api_key_secret_ref(
            self,
            value_or_callback: Callable[
                [ApiKeySecretRef.Builder], ApiKeySecretRef.Builder | ApiKeySecretRef
            ],
            /,
        ) -> "Cloudflare.Builder": ...

        @overload
        def api_key_secret_ref(
            self, value_or_callback: Never = ...
        ) -> "ApiKeySecretRef.BuilderContext": ...

        def api_key_secret_ref(self, value_or_callback=None, /):
            """
            API key to use to authenticate with Cloudflare.
            Note: using an API token to authenticate is now the recommended method
            as it allows greater control of permissions.
            """
            if self._in_context and value_or_callback is None:
                context = ApiKeySecretRef.BuilderContext()
                context._parent_builder = self
                context._field_name = "api_key_secret_ref"
                return context

            value = value_or_callback
            if callable(value_or_callback):
                output = value_or_callback(ApiKeySecretRef.builder())
                if isinstance(output, ApiKeySecretRef.Builder):
                    value = output.build()
                else:
                    value = output
            return self._set("api_key_secret_ref", value)

        @overload
        def api_token_secret_ref(
            self, value_or_callback: Optional[ApiTokenSecretRef], /
        ) -> "Cloudflare.Builder": ...

        @overload
        def api_token_secret_ref(
            self,
            value_or_callback: Callable[
                [ApiTokenSecretRef.Builder],
                ApiTokenSecretRef.Builder | ApiTokenSecretRef,
            ],
            /,
        ) -> "Cloudflare.Builder": ...

        @overload
        def api_token_secret_ref(
            self, value_or_callback: Never = ...
        ) -> "ApiTokenSecretRef.BuilderContext": ...

        def api_token_secret_ref(self, value_or_callback=None, /):
            """
            API token used to authenticate with Cloudflare.
            """
            if self._in_context and value_or_callback is None:
                context = ApiTokenSecretRef.BuilderContext()
                context._parent_builder = self
                context._field_name = "api_token_secret_ref"
                return context

            value = value_or_callback
            if callable(value_or_callback):
                output = value_or_callback(ApiTokenSecretRef.builder())
                if isinstance(output, ApiTokenSecretRef.Builder):
                    value = output.build()
                else:
                    value = output
            return self._set("api_token_secret_ref", value)

        def email(self, value: Optional[str], /) -> Self:
            """
            Email of the account, only required when using API key based authentication.
            """
            return self._set("email", value)

    class BuilderContext(BuilderContextBase["Cloudflare.Builder"]):
        def model_post_init(self, __context) -> None:
            self._builder = Cloudflare.Builder()
            self._builder._in_context = True
            self._parent_builder = None
            self._field_name = None

    @classmethod
    def builder(cls) -> Builder:
        return cls.Builder()

    @classmethod
    def new(cls) -> BuilderContext:
        """Creates a new context manager builder for Cloudflare."""
        return cls.BuilderContext()

    class ListBuilder(GenericListBuilder["Cloudflare", Builder]):
        def __init__(self):
            raise NotImplementedError(
                "This class is not meant to be instantiated. Use Cloudflare.list_builder() instead."
            )

    @classmethod
    def list_builder(cls) -> ListBuilder:
        return GenericListBuilder[cls, cls.Builder]()  # type: ignore

    api_key_secret_ref: Annotated[Optional[ApiKeySecretRef], Field(alias="apiKeySecretRef")] = None
    """
    API key to use to authenticate with Cloudflare.
    Note: using an API token to authenticate is now the recommended method
    as it allows greater control of permissions.
    """
    api_token_secret_ref: Annotated[
        Optional[ApiTokenSecretRef], Field(alias="apiTokenSecretRef")
    ] = None
    """
    API token used to authenticate with Cloudflare.
    """
    email: Optional[str] = None
    """
    Email of the account, only required when using API key based authentication.
    """


class TokenSecretRef(BaseModel):
    class Builder(BaseModelBuilder):
        @property
        def cls(self) -> Type["TokenSecretRef"]:
            return TokenSecretRef

        def build(self) -> "TokenSecretRef":
            return TokenSecretRef(**self._attrs)

        def key(self, value: Optional[str], /) -> Self:
            """
            The key of the entry in the Secret resource's `data` field to be used.
            Some instances of this field may be defaulted, in others it may be
            required.
            """
            return self._set("key", value)

        def name(self, value: str, /) -> Self:
            """
            Name of the resource being referred to.
            More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
            """
            return self._set("name", value)

    class BuilderContext(BuilderContextBase["TokenSecretRef.Builder"]):
        def model_post_init(self, __context) -> None:
            self._builder = TokenSecretRef.Builder()
            self._builder._in_context = True
            self._parent_builder = None
            self._field_name = None

    @classmethod
    def builder(cls) -> Builder:
        return cls.Builder()

    @classmethod
    def new(cls) -> BuilderContext:
        """Creates a new context manager builder for TokenSecretRef."""
        return cls.BuilderContext()

    class ListBuilder(GenericListBuilder["TokenSecretRef", Builder]):
        def __init__(self):
            raise NotImplementedError(
                "This class is not meant to be instantiated. Use TokenSecretRef.list_builder() instead."
            )

    @classmethod
    def list_builder(cls) -> ListBuilder:
        return GenericListBuilder[cls, cls.Builder]()  # type: ignore

    key: Optional[str] = None
    """
    The key of the entry in the Secret resource's `data` field to be used.
    Some instances of this field may be defaulted, in others it may be
    required.
    """
    name: str
    """
    Name of the resource being referred to.
    More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
    """


class Digitalocean(BaseModel):
    class Builder(BaseModelBuilder):
        @property
        def cls(self) -> Type["Digitalocean"]:
            return Digitalocean

        def build(self) -> "Digitalocean":
            return Digitalocean(**self._attrs)

        @overload
        def token_secret_ref(
            self, value_or_callback: TokenSecretRef, /
        ) -> "Digitalocean.Builder": ...

        @overload
        def token_secret_ref(
            self,
            value_or_callback: Callable[
                [TokenSecretRef.Builder], TokenSecretRef.Builder | TokenSecretRef
            ],
            /,
        ) -> "Digitalocean.Builder": ...

        @overload
        def token_secret_ref(
            self, value_or_callback: Never = ...
        ) -> "TokenSecretRef.BuilderContext": ...

        def token_secret_ref(self, value_or_callback=None, /):
            """
            A reference to a specific 'key' within a Secret resource.
            In some instances, `key` is a required field.
            """
            if self._in_context and value_or_callback is None:
                context = TokenSecretRef.BuilderContext()
                context._parent_builder = self
                context._field_name = "token_secret_ref"
                return context

            value = value_or_callback
            if callable(value_or_callback):
                output = value_or_callback(TokenSecretRef.builder())
                if isinstance(output, TokenSecretRef.Builder):
                    value = output.build()
                else:
                    value = output
            return self._set("token_secret_ref", value)

    class BuilderContext(BuilderContextBase["Digitalocean.Builder"]):
        def model_post_init(self, __context) -> None:
            self._builder = Digitalocean.Builder()
            self._builder._in_context = True
            self._parent_builder = None
            self._field_name = None

    @classmethod
    def builder(cls) -> Builder:
        return cls.Builder()

    @classmethod
    def new(cls) -> BuilderContext:
        """Creates a new context manager builder for Digitalocean."""
        return cls.BuilderContext()

    class ListBuilder(GenericListBuilder["Digitalocean", Builder]):
        def __init__(self):
            raise NotImplementedError(
                "This class is not meant to be instantiated. Use Digitalocean.list_builder() instead."
            )

    @classmethod
    def list_builder(cls) -> ListBuilder:
        return GenericListBuilder[cls, cls.Builder]()  # type: ignore

    token_secret_ref: Annotated[TokenSecretRef, Field(alias="tokenSecretRef")]
    """
    A reference to a specific 'key' within a Secret resource.
    In some instances, `key` is a required field.
    """


class TsigSecretSecretRef(BaseModel):
    class Builder(BaseModelBuilder):
        @property
        def cls(self) -> Type["TsigSecretSecretRef"]:
            return TsigSecretSecretRef

        def build(self) -> "TsigSecretSecretRef":
            return TsigSecretSecretRef(**self._attrs)

        def key(self, value: Optional[str], /) -> Self:
            """
            The key of the entry in the Secret resource's `data` field to be used.
            Some instances of this field may be defaulted, in others it may be
            required.
            """
            return self._set("key", value)

        def name(self, value: str, /) -> Self:
            """
            Name of the resource being referred to.
            More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
            """
            return self._set("name", value)

    class BuilderContext(BuilderContextBase["TsigSecretSecretRef.Builder"]):
        def model_post_init(self, __context) -> None:
            self._builder = TsigSecretSecretRef.Builder()
            self._builder._in_context = True
            self._parent_builder = None
            self._field_name = None

    @classmethod
    def builder(cls) -> Builder:
        return cls.Builder()

    @classmethod
    def new(cls) -> BuilderContext:
        """Creates a new context manager builder for TsigSecretSecretRef."""
        return cls.BuilderContext()

    class ListBuilder(GenericListBuilder["TsigSecretSecretRef", Builder]):
        def __init__(self):
            raise NotImplementedError(
                "This class is not meant to be instantiated. Use TsigSecretSecretRef.list_builder() instead."
            )

    @classmethod
    def list_builder(cls) -> ListBuilder:
        return GenericListBuilder[cls, cls.Builder]()  # type: ignore

    key: Optional[str] = None
    """
    The key of the entry in the Secret resource's `data` field to be used.
    Some instances of this field may be defaulted, in others it may be
    required.
    """
    name: str
    """
    Name of the resource being referred to.
    More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
    """


class Rfc2136(BaseModel):
    class Builder(BaseModelBuilder):
        @property
        def cls(self) -> Type["Rfc2136"]:
            return Rfc2136

        def build(self) -> "Rfc2136":
            return Rfc2136(**self._attrs)

        def nameserver(self, value: str, /) -> Self:
            """
            The IP address or hostname of an authoritative DNS server supporting
            RFC2136 in the form host:port. If the host is an IPv6 address it must be
            enclosed in square brackets (e.g [2001:db8::1]) ; port is optional.
            This field is required.
            """
            return self._set("nameserver", value)

        def tsig_algorithm(self, value: Optional[str], /) -> Self:
            """
            The TSIG Algorithm configured in the DNS supporting RFC2136. Used only
            when ``tsigSecretSecretRef`` and ``tsigKeyName`` are defined.
            Supported values are (case-insensitive): ``HMACMD5`` (default),
            ``HMACSHA1``, ``HMACSHA256`` or ``HMACSHA512``.
            """
            return self._set("tsig_algorithm", value)

        def tsig_key_name(self, value: Optional[str], /) -> Self:
            """
            The TSIG Key name configured in the DNS.
            If ``tsigSecretSecretRef`` is defined, this field is required.
            """
            return self._set("tsig_key_name", value)

        @overload
        def tsig_secret_secret_ref(
            self, value_or_callback: Optional[TsigSecretSecretRef], /
        ) -> "Rfc2136.Builder": ...

        @overload
        def tsig_secret_secret_ref(
            self,
            value_or_callback: Callable[
                [TsigSecretSecretRef.Builder],
                TsigSecretSecretRef.Builder | TsigSecretSecretRef,
            ],
            /,
        ) -> "Rfc2136.Builder": ...

        @overload
        def tsig_secret_secret_ref(
            self, value_or_callback: Never = ...
        ) -> "TsigSecretSecretRef.BuilderContext": ...

        def tsig_secret_secret_ref(self, value_or_callback=None, /):
            """
            The name of the secret containing the TSIG value.
            If ``tsigKeyName`` is defined, this field is required.
            """
            if self._in_context and value_or_callback is None:
                context = TsigSecretSecretRef.BuilderContext()
                context._parent_builder = self
                context._field_name = "tsig_secret_secret_ref"
                return context

            value = value_or_callback
            if callable(value_or_callback):
                output = value_or_callback(TsigSecretSecretRef.builder())
                if isinstance(output, TsigSecretSecretRef.Builder):
                    value = output.build()
                else:
                    value = output
            return self._set("tsig_secret_secret_ref", value)

    class BuilderContext(BuilderContextBase["Rfc2136.Builder"]):
        def model_post_init(self, __context) -> None:
            self._builder = Rfc2136.Builder()
            self._builder._in_context = True
            self._parent_builder = None
            self._field_name = None

    @classmethod
    def builder(cls) -> Builder:
        return cls.Builder()

    @classmethod
    def new(cls) -> BuilderContext:
        """Creates a new context manager builder for Rfc2136."""
        return cls.BuilderContext()

    class ListBuilder(GenericListBuilder["Rfc2136", Builder]):
        def __init__(self):
            raise NotImplementedError(
                "This class is not meant to be instantiated. Use Rfc2136.list_builder() instead."
            )

    @classmethod
    def list_builder(cls) -> ListBuilder:
        return GenericListBuilder[cls, cls.Builder]()  # type: ignore

    nameserver: str
    """
    The IP address or hostname of an authoritative DNS server supporting
    RFC2136 in the form host:port. If the host is an IPv6 address it must be
    enclosed in square brackets (e.g [2001:db8::1]) ; port is optional.
    This field is required.
    """
    tsig_algorithm: Annotated[Optional[str], Field(alias="tsigAlgorithm")] = None
    """
    The TSIG Algorithm configured in the DNS supporting RFC2136. Used only
    when ``tsigSecretSecretRef`` and ``tsigKeyName`` are defined.
    Supported values are (case-insensitive): ``HMACMD5`` (default),
    ``HMACSHA1``, ``HMACSHA256`` or ``HMACSHA512``.
    """
    tsig_key_name: Annotated[Optional[str], Field(alias="tsigKeyName")] = None
    """
    The TSIG Key name configured in the DNS.
    If ``tsigSecretSecretRef`` is defined, this field is required.
    """
    tsig_secret_secret_ref: Annotated[
        Optional[TsigSecretSecretRef], Field(alias="tsigSecretSecretRef")
    ] = None
    """
    The name of the secret containing the TSIG value.
    If ``tsigKeyName`` is defined, this field is required.
    """


class AccessKeyIdSecretRef(BaseModel):
    class Builder(BaseModelBuilder):
        @property
        def cls(self) -> Type["AccessKeyIdSecretRef"]:
            return AccessKeyIdSecretRef

        def build(self) -> "AccessKeyIdSecretRef":
            return AccessKeyIdSecretRef(**self._attrs)

        def key(self, value: Optional[str], /) -> Self:
            """
            The key of the entry in the Secret resource's `data` field to be used.
            Some instances of this field may be defaulted, in others it may be
            required.
            """
            return self._set("key", value)

        def name(self, value: str, /) -> Self:
            """
            Name of the resource being referred to.
            More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
            """
            return self._set("name", value)

    class BuilderContext(BuilderContextBase["AccessKeyIdSecretRef.Builder"]):
        def model_post_init(self, __context) -> None:
            self._builder = AccessKeyIdSecretRef.Builder()
            self._builder._in_context = True
            self._parent_builder = None
            self._field_name = None

    @classmethod
    def builder(cls) -> Builder:
        return cls.Builder()

    @classmethod
    def new(cls) -> BuilderContext:
        """Creates a new context manager builder for AccessKeyIdSecretRef."""
        return cls.BuilderContext()

    class ListBuilder(GenericListBuilder["AccessKeyIdSecretRef", Builder]):
        def __init__(self):
            raise NotImplementedError(
                "This class is not meant to be instantiated. Use AccessKeyIdSecretRef.list_builder() instead."
            )

    @classmethod
    def list_builder(cls) -> ListBuilder:
        return GenericListBuilder[cls, cls.Builder]()  # type: ignore

    key: Optional[str] = None
    """
    The key of the entry in the Secret resource's `data` field to be used.
    Some instances of this field may be defaulted, in others it may be
    required.
    """
    name: str
    """
    Name of the resource being referred to.
    More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
    """


class ServiceAccountRef(BaseModel):
    class Builder(BaseModelBuilder):
        @property
        def cls(self) -> Type["ServiceAccountRef"]:
            return ServiceAccountRef

        def build(self) -> "ServiceAccountRef":
            return ServiceAccountRef(**self._attrs)

        def audiences(self, value: Optional[List[str]], /) -> Self:
            """
            TokenAudiences is an optional list of audiences to include in the
            token passed to AWS. The default token consisting of the issuer's namespace
            and name is always included.
            If unset the audience defaults to `sts.amazonaws.com`.
            """
            return self._set("audiences", value)

        def name(self, value: str, /) -> Self:
            """
            Name of the ServiceAccount used to request a token.
            """
            return self._set("name", value)

    class BuilderContext(BuilderContextBase["ServiceAccountRef.Builder"]):
        def model_post_init(self, __context) -> None:
            self._builder = ServiceAccountRef.Builder()
            self._builder._in_context = True
            self._parent_builder = None
            self._field_name = None

    @classmethod
    def builder(cls) -> Builder:
        return cls.Builder()

    @classmethod
    def new(cls) -> BuilderContext:
        """Creates a new context manager builder for ServiceAccountRef."""
        return cls.BuilderContext()

    class ListBuilder(GenericListBuilder["ServiceAccountRef", Builder]):
        def __init__(self):
            raise NotImplementedError(
                "This class is not meant to be instantiated. Use ServiceAccountRef.list_builder() instead."
            )

    @classmethod
    def list_builder(cls) -> ListBuilder:
        return GenericListBuilder[cls, cls.Builder]()  # type: ignore

    audiences: Optional[List[str]] = None
    """
    TokenAudiences is an optional list of audiences to include in the
    token passed to AWS. The default token consisting of the issuer's namespace
    and name is always included.
    If unset the audience defaults to `sts.amazonaws.com`.
    """
    name: str
    """
    Name of the ServiceAccount used to request a token.
    """


class Kubernetes(BaseModel):
    class Builder(BaseModelBuilder):
        @property
        def cls(self) -> Type["Kubernetes"]:
            return Kubernetes

        def build(self) -> "Kubernetes":
            return Kubernetes(**self._attrs)

        @overload
        def service_account_ref(
            self, value_or_callback: ServiceAccountRef, /
        ) -> "Kubernetes.Builder": ...

        @overload
        def service_account_ref(
            self,
            value_or_callback: Callable[
                [ServiceAccountRef.Builder],
                ServiceAccountRef.Builder | ServiceAccountRef,
            ],
            /,
        ) -> "Kubernetes.Builder": ...

        @overload
        def service_account_ref(
            self, value_or_callback: Never = ...
        ) -> "ServiceAccountRef.BuilderContext": ...

        def service_account_ref(self, value_or_callback=None, /):
            """
            A reference to a service account that will be used to request a bound
            token (also known as "projected token"). To use this field, you must
            configure an RBAC rule to let cert-manager request a token.
            """
            if self._in_context and value_or_callback is None:
                context = ServiceAccountRef.BuilderContext()
                context._parent_builder = self
                context._field_name = "service_account_ref"
                return context

            value = value_or_callback
            if callable(value_or_callback):
                output = value_or_callback(ServiceAccountRef.builder())
                if isinstance(output, ServiceAccountRef.Builder):
                    value = output.build()
                else:
                    value = output
            return self._set("service_account_ref", value)

    class BuilderContext(BuilderContextBase["Kubernetes.Builder"]):
        def model_post_init(self, __context) -> None:
            self._builder = Kubernetes.Builder()
            self._builder._in_context = True
            self._parent_builder = None
            self._field_name = None

    @classmethod
    def builder(cls) -> Builder:
        return cls.Builder()

    @classmethod
    def new(cls) -> BuilderContext:
        """Creates a new context manager builder for Kubernetes."""
        return cls.BuilderContext()

    class ListBuilder(GenericListBuilder["Kubernetes", Builder]):
        def __init__(self):
            raise NotImplementedError(
                "This class is not meant to be instantiated. Use Kubernetes.list_builder() instead."
            )

    @classmethod
    def list_builder(cls) -> ListBuilder:
        return GenericListBuilder[cls, cls.Builder]()  # type: ignore

    service_account_ref: Annotated[ServiceAccountRef, Field(alias="serviceAccountRef")]
    """
    A reference to a service account that will be used to request a bound
    token (also known as "projected token"). To use this field, you must
    configure an RBAC rule to let cert-manager request a token.
    """


class Auth(BaseModel):
    class Builder(BaseModelBuilder):
        @property
        def cls(self) -> Type["Auth"]:
            return Auth

        def build(self) -> "Auth":
            return Auth(**self._attrs)

        @overload
        def kubernetes(self, value_or_callback: Kubernetes, /) -> "Auth.Builder": ...

        @overload
        def kubernetes(
            self,
            value_or_callback: Callable[[Kubernetes.Builder], Kubernetes.Builder | Kubernetes],
            /,
        ) -> "Auth.Builder": ...

        @overload
        def kubernetes(self, value_or_callback: Never = ...) -> "Kubernetes.BuilderContext": ...

        def kubernetes(self, value_or_callback=None, /):
            """
            Kubernetes authenticates with Route53 using AssumeRoleWithWebIdentity
            by passing a bound ServiceAccount token.
            """
            if self._in_context and value_or_callback is None:
                context = Kubernetes.BuilderContext()
                context._parent_builder = self
                context._field_name = "kubernetes"
                return context

            value = value_or_callback
            if callable(value_or_callback):
                output = value_or_callback(Kubernetes.builder())
                if isinstance(output, Kubernetes.Builder):
                    value = output.build()
                else:
                    value = output
            return self._set("kubernetes", value)

    class BuilderContext(BuilderContextBase["Auth.Builder"]):
        def model_post_init(self, __context) -> None:
            self._builder = Auth.Builder()
            self._builder._in_context = True
            self._parent_builder = None
            self._field_name = None

    @classmethod
    def builder(cls) -> Builder:
        return cls.Builder()

    @classmethod
    def new(cls) -> BuilderContext:
        """Creates a new context manager builder for Auth."""
        return cls.BuilderContext()

    class ListBuilder(GenericListBuilder["Auth", Builder]):
        def __init__(self):
            raise NotImplementedError(
                "This class is not meant to be instantiated. Use Auth.list_builder() instead."
            )

    @classmethod
    def list_builder(cls) -> ListBuilder:
        return GenericListBuilder[cls, cls.Builder]()  # type: ignore

    kubernetes: Kubernetes
    """
    Kubernetes authenticates with Route53 using AssumeRoleWithWebIdentity
    by passing a bound ServiceAccount token.
    """


class SecretAccessKeySecretRef(BaseModel):
    class Builder(BaseModelBuilder):
        @property
        def cls(self) -> Type["SecretAccessKeySecretRef"]:
            return SecretAccessKeySecretRef

        def build(self) -> "SecretAccessKeySecretRef":
            return SecretAccessKeySecretRef(**self._attrs)

        def key(self, value: Optional[str], /) -> Self:
            """
            The key of the entry in the Secret resource's `data` field to be used.
            Some instances of this field may be defaulted, in others it may be
            required.
            """
            return self._set("key", value)

        def name(self, value: str, /) -> Self:
            """
            Name of the resource being referred to.
            More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
            """
            return self._set("name", value)

    class BuilderContext(BuilderContextBase["SecretAccessKeySecretRef.Builder"]):
        def model_post_init(self, __context) -> None:
            self._builder = SecretAccessKeySecretRef.Builder()
            self._builder._in_context = True
            self._parent_builder = None
            self._field_name = None

    @classmethod
    def builder(cls) -> Builder:
        return cls.Builder()

    @classmethod
    def new(cls) -> BuilderContext:
        """Creates a new context manager builder for SecretAccessKeySecretRef."""
        return cls.BuilderContext()

    class ListBuilder(GenericListBuilder["SecretAccessKeySecretRef", Builder]):
        def __init__(self):
            raise NotImplementedError(
                "This class is not meant to be instantiated. Use SecretAccessKeySecretRef.list_builder() instead."
            )

    @classmethod
    def list_builder(cls) -> ListBuilder:
        return GenericListBuilder[cls, cls.Builder]()  # type: ignore

    key: Optional[str] = None
    """
    The key of the entry in the Secret resource's `data` field to be used.
    Some instances of this field may be defaulted, in others it may be
    required.
    """
    name: str
    """
    Name of the resource being referred to.
    More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
    """


class Route53(BaseModel):
    class Builder(BaseModelBuilder):
        @property
        def cls(self) -> Type["Route53"]:
            return Route53

        def build(self) -> "Route53":
            return Route53(**self._attrs)

        def access_key_id(self, value: Optional[str], /) -> Self:
            """
            The AccessKeyID is used for authentication.
            Cannot be set when SecretAccessKeyID is set.
            If neither the Access Key nor Key ID are set, we fall-back to using env
            vars, shared credentials file or AWS Instance metadata,
            see: https://docs.aws.amazon.com/sdk-for-go/v1/developer-guide/configuring-sdk.html#specifying-credentials
            """
            return self._set("access_key_id", value)

        @overload
        def access_key_id_secret_ref(
            self, value_or_callback: Optional[AccessKeyIdSecretRef], /
        ) -> "Route53.Builder": ...

        @overload
        def access_key_id_secret_ref(
            self,
            value_or_callback: Callable[
                [AccessKeyIdSecretRef.Builder],
                AccessKeyIdSecretRef.Builder | AccessKeyIdSecretRef,
            ],
            /,
        ) -> "Route53.Builder": ...

        @overload
        def access_key_id_secret_ref(
            self, value_or_callback: Never = ...
        ) -> "AccessKeyIdSecretRef.BuilderContext": ...

        def access_key_id_secret_ref(self, value_or_callback=None, /):
            """
            The SecretAccessKey is used for authentication. If set, pull the AWS
            access key ID from a key within a Kubernetes Secret.
            Cannot be set when AccessKeyID is set.
            If neither the Access Key nor Key ID are set, we fall-back to using env
            vars, shared credentials file or AWS Instance metadata,
            see: https://docs.aws.amazon.com/sdk-for-go/v1/developer-guide/configuring-sdk.html#specifying-credentials
            """
            if self._in_context and value_or_callback is None:
                context = AccessKeyIdSecretRef.BuilderContext()
                context._parent_builder = self
                context._field_name = "access_key_id_secret_ref"
                return context

            value = value_or_callback
            if callable(value_or_callback):
                output = value_or_callback(AccessKeyIdSecretRef.builder())
                if isinstance(output, AccessKeyIdSecretRef.Builder):
                    value = output.build()
                else:
                    value = output
            return self._set("access_key_id_secret_ref", value)

        @overload
        def auth(self, value_or_callback: Optional[Auth], /) -> "Route53.Builder": ...

        @overload
        def auth(
            self, value_or_callback: Callable[[Auth.Builder], Auth.Builder | Auth], /
        ) -> "Route53.Builder": ...

        @overload
        def auth(self, value_or_callback: Never = ...) -> "Auth.BuilderContext": ...

        def auth(self, value_or_callback=None, /):
            """
            Auth configures how cert-manager authenticates.
            """
            if self._in_context and value_or_callback is None:
                context = Auth.BuilderContext()
                context._parent_builder = self
                context._field_name = "auth"
                return context

            value = value_or_callback
            if callable(value_or_callback):
                output = value_or_callback(Auth.builder())
                if isinstance(output, Auth.Builder):
                    value = output.build()
                else:
                    value = output
            return self._set("auth", value)

        def hosted_zone_id(self, value: Optional[str], /) -> Self:
            """
            If set, the provider will manage only this zone in Route53 and will not do a lookup using the route53:ListHostedZonesByName api call.
            """
            return self._set("hosted_zone_id", value)

        def region(self, value: Optional[str], /) -> Self:
            """
            Override the AWS region.

            Route53 is a global service and does not have regional endpoints but the
            region specified here (or via environment variables) is used as a hint to
            help compute the correct AWS credential scope and partition when it
            connects to Route53. See:
            - [Amazon Route 53 endpoints and quotas](https://docs.aws.amazon.com/general/latest/gr/r53.html)
            - [Global services](https://docs.aws.amazon.com/whitepapers/latest/aws-fault-isolation-boundaries/global-services.html)

            If you omit this region field, cert-manager will use the region from
            AWS_REGION and AWS_DEFAULT_REGION environment variables, if they are set
            in the cert-manager controller Pod.

            The `region` field is not needed if you use [IAM Roles for Service Accounts (IRSA)](https://docs.aws.amazon.com/eks/latest/userguide/iam-roles-for-service-accounts.html).
            Instead an AWS_REGION environment variable is added to the cert-manager controller Pod by:
            [Amazon EKS Pod Identity Webhook](https://github.com/aws/amazon-eks-pod-identity-webhook).
            In this case this `region` field value is ignored.

            The `region` field is not needed if you use [EKS Pod Identities](https://docs.aws.amazon.com/eks/latest/userguide/pod-identities.html).
            Instead an AWS_REGION environment variable is added to the cert-manager controller Pod by:
            [Amazon EKS Pod Identity Agent](https://github.com/aws/eks-pod-identity-agent),
            In this case this `region` field value is ignored.
            """
            return self._set("region", value)

        def role(self, value: Optional[str], /) -> Self:
            """
            Role is a Role ARN which the Route53 provider will assume using either the explicit credentials AccessKeyID/SecretAccessKey
            or the inferred credentials from environment variables, shared credentials file or AWS Instance metadata
            """
            return self._set("role", value)

        @overload
        def secret_access_key_secret_ref(
            self, value_or_callback: Optional[SecretAccessKeySecretRef], /
        ) -> "Route53.Builder": ...

        @overload
        def secret_access_key_secret_ref(
            self,
            value_or_callback: Callable[
                [SecretAccessKeySecretRef.Builder],
                SecretAccessKeySecretRef.Builder | SecretAccessKeySecretRef,
            ],
            /,
        ) -> "Route53.Builder": ...

        @overload
        def secret_access_key_secret_ref(
            self, value_or_callback: Never = ...
        ) -> "SecretAccessKeySecretRef.BuilderContext": ...

        def secret_access_key_secret_ref(self, value_or_callback=None, /):
            """
            The SecretAccessKey is used for authentication.
            If neither the Access Key nor Key ID are set, we fall-back to using env
            vars, shared credentials file or AWS Instance metadata,
            see: https://docs.aws.amazon.com/sdk-for-go/v1/developer-guide/configuring-sdk.html#specifying-credentials
            """
            if self._in_context and value_or_callback is None:
                context = SecretAccessKeySecretRef.BuilderContext()
                context._parent_builder = self
                context._field_name = "secret_access_key_secret_ref"
                return context

            value = value_or_callback
            if callable(value_or_callback):
                output = value_or_callback(SecretAccessKeySecretRef.builder())
                if isinstance(output, SecretAccessKeySecretRef.Builder):
                    value = output.build()
                else:
                    value = output
            return self._set("secret_access_key_secret_ref", value)

    class BuilderContext(BuilderContextBase["Route53.Builder"]):
        def model_post_init(self, __context) -> None:
            self._builder = Route53.Builder()
            self._builder._in_context = True
            self._parent_builder = None
            self._field_name = None

    @classmethod
    def builder(cls) -> Builder:
        return cls.Builder()

    @classmethod
    def new(cls) -> BuilderContext:
        """Creates a new context manager builder for Route53."""
        return cls.BuilderContext()

    class ListBuilder(GenericListBuilder["Route53", Builder]):
        def __init__(self):
            raise NotImplementedError(
                "This class is not meant to be instantiated. Use Route53.list_builder() instead."
            )

    @classmethod
    def list_builder(cls) -> ListBuilder:
        return GenericListBuilder[cls, cls.Builder]()  # type: ignore

    access_key_id: Annotated[Optional[str], Field(alias="accessKeyID")] = None
    """
    The AccessKeyID is used for authentication.
    Cannot be set when SecretAccessKeyID is set.
    If neither the Access Key nor Key ID are set, we fall-back to using env
    vars, shared credentials file or AWS Instance metadata,
    see: https://docs.aws.amazon.com/sdk-for-go/v1/developer-guide/configuring-sdk.html#specifying-credentials
    """
    access_key_id_secret_ref: Annotated[
        Optional[AccessKeyIdSecretRef], Field(alias="accessKeyIDSecretRef")
    ] = None
    """
    The SecretAccessKey is used for authentication. If set, pull the AWS
    access key ID from a key within a Kubernetes Secret.
    Cannot be set when AccessKeyID is set.
    If neither the Access Key nor Key ID are set, we fall-back to using env
    vars, shared credentials file or AWS Instance metadata,
    see: https://docs.aws.amazon.com/sdk-for-go/v1/developer-guide/configuring-sdk.html#specifying-credentials
    """
    auth: Optional[Auth] = None
    """
    Auth configures how cert-manager authenticates.
    """
    hosted_zone_id: Annotated[Optional[str], Field(alias="hostedZoneID")] = None
    """
    If set, the provider will manage only this zone in Route53 and will not do a lookup using the route53:ListHostedZonesByName api call.
    """
    region: Optional[str] = None
    """
    Override the AWS region.

    Route53 is a global service and does not have regional endpoints but the
    region specified here (or via environment variables) is used as a hint to
    help compute the correct AWS credential scope and partition when it
    connects to Route53. See:
    - [Amazon Route 53 endpoints and quotas](https://docs.aws.amazon.com/general/latest/gr/r53.html)
    - [Global services](https://docs.aws.amazon.com/whitepapers/latest/aws-fault-isolation-boundaries/global-services.html)

    If you omit this region field, cert-manager will use the region from
    AWS_REGION and AWS_DEFAULT_REGION environment variables, if they are set
    in the cert-manager controller Pod.

    The `region` field is not needed if you use [IAM Roles for Service Accounts (IRSA)](https://docs.aws.amazon.com/eks/latest/userguide/iam-roles-for-service-accounts.html).
    Instead an AWS_REGION environment variable is added to the cert-manager controller Pod by:
    [Amazon EKS Pod Identity Webhook](https://github.com/aws/amazon-eks-pod-identity-webhook).
    In this case this `region` field value is ignored.

    The `region` field is not needed if you use [EKS Pod Identities](https://docs.aws.amazon.com/eks/latest/userguide/pod-identities.html).
    Instead an AWS_REGION environment variable is added to the cert-manager controller Pod by:
    [Amazon EKS Pod Identity Agent](https://github.com/aws/eks-pod-identity-agent),
    In this case this `region` field value is ignored.
    """
    role: Optional[str] = None
    """
    Role is a Role ARN which the Route53 provider will assume using either the explicit credentials AccessKeyID/SecretAccessKey
    or the inferred credentials from environment variables, shared credentials file or AWS Instance metadata
    """
    secret_access_key_secret_ref: Annotated[
        Optional[SecretAccessKeySecretRef], Field(alias="secretAccessKeySecretRef")
    ] = None
    """
    The SecretAccessKey is used for authentication.
    If neither the Access Key nor Key ID are set, we fall-back to using env
    vars, shared credentials file or AWS Instance metadata,
    see: https://docs.aws.amazon.com/sdk-for-go/v1/developer-guide/configuring-sdk.html#specifying-credentials
    """


class Webhook(BaseModel):
    class Builder(BaseModelBuilder):
        @property
        def cls(self) -> Type["Webhook"]:
            return Webhook

        def build(self) -> "Webhook":
            return Webhook(**self._attrs)

        def config(self, value: Optional[Any], /) -> Self:
            """
            Additional configuration that should be passed to the webhook apiserver
            when challenges are processed.
            This can contain arbitrary JSON data.
            Secret values should not be specified in this stanza.
            If secret values are needed (e.g. credentials for a DNS service), you
            should use a SecretKeySelector to reference a Secret resource.
            For details on the schema of this field, consult the webhook provider
            implementation's documentation.
            """
            return self._set("config", value)

        def group_name(self, value: str, /) -> Self:
            """
            The API group name that should be used when POSTing ChallengePayload
            resources to the webhook apiserver.
            This should be the same as the GroupName specified in the webhook
            provider implementation.
            """
            return self._set("group_name", value)

        def solver_name(self, value: str, /) -> Self:
            """
            The name of the solver to use, as defined in the webhook provider
            implementation.
            This will typically be the name of the provider, e.g. 'cloudflare'.
            """
            return self._set("solver_name", value)

    class BuilderContext(BuilderContextBase["Webhook.Builder"]):
        def model_post_init(self, __context) -> None:
            self._builder = Webhook.Builder()
            self._builder._in_context = True
            self._parent_builder = None
            self._field_name = None

    @classmethod
    def builder(cls) -> Builder:
        return cls.Builder()

    @classmethod
    def new(cls) -> BuilderContext:
        """Creates a new context manager builder for Webhook."""
        return cls.BuilderContext()

    class ListBuilder(GenericListBuilder["Webhook", Builder]):
        def __init__(self):
            raise NotImplementedError(
                "This class is not meant to be instantiated. Use Webhook.list_builder() instead."
            )

    @classmethod
    def list_builder(cls) -> ListBuilder:
        return GenericListBuilder[cls, cls.Builder]()  # type: ignore

    config: Optional[Any] = None
    """
    Additional configuration that should be passed to the webhook apiserver
    when challenges are processed.
    This can contain arbitrary JSON data.
    Secret values should not be specified in this stanza.
    If secret values are needed (e.g. credentials for a DNS service), you
    should use a SecretKeySelector to reference a Secret resource.
    For details on the schema of this field, consult the webhook provider
    implementation's documentation.
    """
    group_name: Annotated[str, Field(alias="groupName")]
    """
    The API group name that should be used when POSTing ChallengePayload
    resources to the webhook apiserver.
    This should be the same as the GroupName specified in the webhook
    provider implementation.
    """
    solver_name: Annotated[str, Field(alias="solverName")]
    """
    The name of the solver to use, as defined in the webhook provider
    implementation.
    This will typically be the name of the provider, e.g. 'cloudflare'.
    """


class Dns01(BaseModel):
    class Builder(BaseModelBuilder):
        @property
        def cls(self) -> Type["Dns01"]:
            return Dns01

        def build(self) -> "Dns01":
            return Dns01(**self._attrs)

        @overload
        def acme_dns(self, value_or_callback: Optional[AcmeDns], /) -> "Dns01.Builder": ...

        @overload
        def acme_dns(
            self,
            value_or_callback: Callable[[AcmeDns.Builder], AcmeDns.Builder | AcmeDns],
            /,
        ) -> "Dns01.Builder": ...

        @overload
        def acme_dns(self, value_or_callback: Never = ...) -> "AcmeDns.BuilderContext": ...

        def acme_dns(self, value_or_callback=None, /):
            """
            Use the 'ACME DNS' (https://github.com/joohoi/acme-dns) API to manage
            DNS01 challenge records.
            """
            if self._in_context and value_or_callback is None:
                context = AcmeDns.BuilderContext()
                context._parent_builder = self
                context._field_name = "acme_dns"
                return context

            value = value_or_callback
            if callable(value_or_callback):
                output = value_or_callback(AcmeDns.builder())
                if isinstance(output, AcmeDns.Builder):
                    value = output.build()
                else:
                    value = output
            return self._set("acme_dns", value)

        @overload
        def akamai(self, value_or_callback: Optional[Akamai], /) -> "Dns01.Builder": ...

        @overload
        def akamai(
            self,
            value_or_callback: Callable[[Akamai.Builder], Akamai.Builder | Akamai],
            /,
        ) -> "Dns01.Builder": ...

        @overload
        def akamai(self, value_or_callback: Never = ...) -> "Akamai.BuilderContext": ...

        def akamai(self, value_or_callback=None, /):
            """
            Use the Akamai DNS zone management API to manage DNS01 challenge records.
            """
            if self._in_context and value_or_callback is None:
                context = Akamai.BuilderContext()
                context._parent_builder = self
                context._field_name = "akamai"
                return context

            value = value_or_callback
            if callable(value_or_callback):
                output = value_or_callback(Akamai.builder())
                if isinstance(output, Akamai.Builder):
                    value = output.build()
                else:
                    value = output
            return self._set("akamai", value)

        @overload
        def azure_dns(self, value_or_callback: Optional[AzureDns], /) -> "Dns01.Builder": ...

        @overload
        def azure_dns(
            self,
            value_or_callback: Callable[[AzureDns.Builder], AzureDns.Builder | AzureDns],
            /,
        ) -> "Dns01.Builder": ...

        @overload
        def azure_dns(self, value_or_callback: Never = ...) -> "AzureDns.BuilderContext": ...

        def azure_dns(self, value_or_callback=None, /):
            """
            Use the Microsoft Azure DNS API to manage DNS01 challenge records.
            """
            if self._in_context and value_or_callback is None:
                context = AzureDns.BuilderContext()
                context._parent_builder = self
                context._field_name = "azure_dns"
                return context

            value = value_or_callback
            if callable(value_or_callback):
                output = value_or_callback(AzureDns.builder())
                if isinstance(output, AzureDns.Builder):
                    value = output.build()
                else:
                    value = output
            return self._set("azure_dns", value)

        @overload
        def cloud_dns(self, value_or_callback: Optional[CloudDns], /) -> "Dns01.Builder": ...

        @overload
        def cloud_dns(
            self,
            value_or_callback: Callable[[CloudDns.Builder], CloudDns.Builder | CloudDns],
            /,
        ) -> "Dns01.Builder": ...

        @overload
        def cloud_dns(self, value_or_callback: Never = ...) -> "CloudDns.BuilderContext": ...

        def cloud_dns(self, value_or_callback=None, /):
            """
            Use the Google Cloud DNS API to manage DNS01 challenge records.
            """
            if self._in_context and value_or_callback is None:
                context = CloudDns.BuilderContext()
                context._parent_builder = self
                context._field_name = "cloud_dns"
                return context

            value = value_or_callback
            if callable(value_or_callback):
                output = value_or_callback(CloudDns.builder())
                if isinstance(output, CloudDns.Builder):
                    value = output.build()
                else:
                    value = output
            return self._set("cloud_dns", value)

        @overload
        def cloudflare(self, value_or_callback: Optional[Cloudflare], /) -> "Dns01.Builder": ...

        @overload
        def cloudflare(
            self,
            value_or_callback: Callable[[Cloudflare.Builder], Cloudflare.Builder | Cloudflare],
            /,
        ) -> "Dns01.Builder": ...

        @overload
        def cloudflare(self, value_or_callback: Never = ...) -> "Cloudflare.BuilderContext": ...

        def cloudflare(self, value_or_callback=None, /):
            """
            Use the Cloudflare API to manage DNS01 challenge records.
            """
            if self._in_context and value_or_callback is None:
                context = Cloudflare.BuilderContext()
                context._parent_builder = self
                context._field_name = "cloudflare"
                return context

            value = value_or_callback
            if callable(value_or_callback):
                output = value_or_callback(Cloudflare.builder())
                if isinstance(output, Cloudflare.Builder):
                    value = output.build()
                else:
                    value = output
            return self._set("cloudflare", value)

        def cname_strategy(self, value: Optional[Literal["None", "Follow"]], /) -> Self:
            """
            CNAMEStrategy configures how the DNS01 provider should handle CNAME
            records when found in DNS zones.
            """
            return self._set("cname_strategy", value)

        @overload
        def digitalocean(self, value_or_callback: Optional[Digitalocean], /) -> "Dns01.Builder": ...

        @overload
        def digitalocean(
            self,
            value_or_callback: Callable[
                [Digitalocean.Builder], Digitalocean.Builder | Digitalocean
            ],
            /,
        ) -> "Dns01.Builder": ...

        @overload
        def digitalocean(self, value_or_callback: Never = ...) -> "Digitalocean.BuilderContext": ...

        def digitalocean(self, value_or_callback=None, /):
            """
            Use the DigitalOcean DNS API to manage DNS01 challenge records.
            """
            if self._in_context and value_or_callback is None:
                context = Digitalocean.BuilderContext()
                context._parent_builder = self
                context._field_name = "digitalocean"
                return context

            value = value_or_callback
            if callable(value_or_callback):
                output = value_or_callback(Digitalocean.builder())
                if isinstance(output, Digitalocean.Builder):
                    value = output.build()
                else:
                    value = output
            return self._set("digitalocean", value)

        @overload
        def rfc2136(self, value_or_callback: Optional[Rfc2136], /) -> "Dns01.Builder": ...

        @overload
        def rfc2136(
            self,
            value_or_callback: Callable[[Rfc2136.Builder], Rfc2136.Builder | Rfc2136],
            /,
        ) -> "Dns01.Builder": ...

        @overload
        def rfc2136(self, value_or_callback: Never = ...) -> "Rfc2136.BuilderContext": ...

        def rfc2136(self, value_or_callback=None, /):
            """
            Use RFC2136 ("Dynamic Updates in the Domain Name System") (https://datatracker.ietf.org/doc/rfc2136/)
            to manage DNS01 challenge records.
            """
            if self._in_context and value_or_callback is None:
                context = Rfc2136.BuilderContext()
                context._parent_builder = self
                context._field_name = "rfc2136"
                return context

            value = value_or_callback
            if callable(value_or_callback):
                output = value_or_callback(Rfc2136.builder())
                if isinstance(output, Rfc2136.Builder):
                    value = output.build()
                else:
                    value = output
            return self._set("rfc2136", value)

        @overload
        def route53(self, value_or_callback: Optional[Route53], /) -> "Dns01.Builder": ...

        @overload
        def route53(
            self,
            value_or_callback: Callable[[Route53.Builder], Route53.Builder | Route53],
            /,
        ) -> "Dns01.Builder": ...

        @overload
        def route53(self, value_or_callback: Never = ...) -> "Route53.BuilderContext": ...

        def route53(self, value_or_callback=None, /):
            """
            Use the AWS Route53 API to manage DNS01 challenge records.
            """
            if self._in_context and value_or_callback is None:
                context = Route53.BuilderContext()
                context._parent_builder = self
                context._field_name = "route53"
                return context

            value = value_or_callback
            if callable(value_or_callback):
                output = value_or_callback(Route53.builder())
                if isinstance(output, Route53.Builder):
                    value = output.build()
                else:
                    value = output
            return self._set("route53", value)

        @overload
        def webhook(self, value_or_callback: Optional[Webhook], /) -> "Dns01.Builder": ...

        @overload
        def webhook(
            self,
            value_or_callback: Callable[[Webhook.Builder], Webhook.Builder | Webhook],
            /,
        ) -> "Dns01.Builder": ...

        @overload
        def webhook(self, value_or_callback: Never = ...) -> "Webhook.BuilderContext": ...

        def webhook(self, value_or_callback=None, /):
            """
            Configure an external webhook based DNS01 challenge solver to manage
            DNS01 challenge records.
            """
            if self._in_context and value_or_callback is None:
                context = Webhook.BuilderContext()
                context._parent_builder = self
                context._field_name = "webhook"
                return context

            value = value_or_callback
            if callable(value_or_callback):
                output = value_or_callback(Webhook.builder())
                if isinstance(output, Webhook.Builder):
                    value = output.build()
                else:
                    value = output
            return self._set("webhook", value)

    class BuilderContext(BuilderContextBase["Dns01.Builder"]):
        def model_post_init(self, __context) -> None:
            self._builder = Dns01.Builder()
            self._builder._in_context = True
            self._parent_builder = None
            self._field_name = None

    @classmethod
    def builder(cls) -> Builder:
        return cls.Builder()

    @classmethod
    def new(cls) -> BuilderContext:
        """Creates a new context manager builder for Dns01."""
        return cls.BuilderContext()

    class ListBuilder(GenericListBuilder["Dns01", Builder]):
        def __init__(self):
            raise NotImplementedError(
                "This class is not meant to be instantiated. Use Dns01.list_builder() instead."
            )

    @classmethod
    def list_builder(cls) -> ListBuilder:
        return GenericListBuilder[cls, cls.Builder]()  # type: ignore

    acme_dns: Annotated[Optional[AcmeDns], Field(alias="acmeDNS")] = None
    """
    Use the 'ACME DNS' (https://github.com/joohoi/acme-dns) API to manage
    DNS01 challenge records.
    """
    akamai: Optional[Akamai] = None
    """
    Use the Akamai DNS zone management API to manage DNS01 challenge records.
    """
    azure_dns: Annotated[Optional[AzureDns], Field(alias="azureDNS")] = None
    """
    Use the Microsoft Azure DNS API to manage DNS01 challenge records.
    """
    cloud_dns: Annotated[Optional[CloudDns], Field(alias="cloudDNS")] = None
    """
    Use the Google Cloud DNS API to manage DNS01 challenge records.
    """
    cloudflare: Optional[Cloudflare] = None
    """
    Use the Cloudflare API to manage DNS01 challenge records.
    """
    cname_strategy: Annotated[Optional[Literal["None", "Follow"]], Field(alias="cnameStrategy")] = (
        None
    )
    """
    CNAMEStrategy configures how the DNS01 provider should handle CNAME
    records when found in DNS zones.
    """
    digitalocean: Optional[Digitalocean] = None
    """
    Use the DigitalOcean DNS API to manage DNS01 challenge records.
    """
    rfc2136: Optional[Rfc2136] = None
    """
    Use RFC2136 ("Dynamic Updates in the Domain Name System") (https://datatracker.ietf.org/doc/rfc2136/)
    to manage DNS01 challenge records.
    """
    route53: Optional[Route53] = None
    """
    Use the AWS Route53 API to manage DNS01 challenge records.
    """
    webhook: Optional[Webhook] = None
    """
    Configure an external webhook based DNS01 challenge solver to manage
    DNS01 challenge records.
    """


class ParentRef(BaseModel):
    class Builder(BaseModelBuilder):
        @property
        def cls(self) -> Type["ParentRef"]:
            return ParentRef

        def build(self) -> "ParentRef":
            return ParentRef(**self._attrs)

        def group(self, value: Optional[str], /) -> Self:
            """
            Group is the group of the referent.
            When unspecified, "gateway.networking.k8s.io" is inferred.
            To set the core API group (such as for a "Service" kind referent),
            Group must be explicitly set to "" (empty string).

            Support: Core
            """
            return self._set("group", value)

        def kind(self, value: Optional[str], /) -> Self:
            """
            Kind is kind of the referent.

            There are two kinds of parent resources with "Core" support:

            * Gateway (Gateway conformance profile)
            * Service (Mesh conformance profile, ClusterIP Services only)

            Support for other resources is Implementation-Specific.
            """
            return self._set("kind", value)

        def name(self, value: str, /) -> Self:
            """
            Name is the name of the referent.

            Support: Core
            """
            return self._set("name", value)

        def namespace(self, value: Optional[str], /) -> Self:
            """
            Namespace is the namespace of the referent. When unspecified, this refers
            to the local namespace of the Route.

            Note that there are specific rules for ParentRefs which cross namespace
            boundaries. Cross-namespace references are only valid if they are explicitly
            allowed by something in the namespace they are referring to. For example:
            Gateway has the AllowedRoutes field, and ReferenceGrant provides a
            generic way to enable any other kind of cross-namespace reference.

            <gateway:experimental:description>
            ParentRefs from a Route to a Service in the same namespace are "producer"
            routes, which apply default routing rules to inbound connections from
            any namespace to the Service.

            ParentRefs from a Route to a Service in a different namespace are
            "consumer" routes, and these routing rules are only applied to outbound
            connections originating from the same namespace as the Route, for which
            the intended destination of the connections are a Service targeted as a
            ParentRef of the Route.
            </gateway:experimental:description>

            Support: Core
            """
            return self._set("namespace", value)

        def port(self, value: Optional[int], /) -> Self:
            """
            Port is the network port this Route targets. It can be interpreted
            differently based on the type of parent resource.

            When the parent resource is a Gateway, this targets all listeners
            listening on the specified port that also support this kind of Route(and
            select this Route). It's not recommended to set `Port` unless the
            networking behaviors specified in a Route must apply to a specific port
            as opposed to a listener(s) whose port(s) may be changed. When both Port
            and SectionName are specified, the name and port of the selected listener
            must match both specified values.

            <gateway:experimental:description>
            When the parent resource is a Service, this targets a specific port in the
            Service spec. When both Port (experimental) and SectionName are specified,
            the name and port of the selected port must match both specified values.
            </gateway:experimental:description>

            Implementations MAY choose to support other parent resources.
            Implementations supporting other types of parent resources MUST clearly
            document how/if Port is interpreted.

            For the purpose of status, an attachment is considered successful as
            long as the parent resource accepts it partially. For example, Gateway
            listeners can restrict which Routes can attach to them by Route kind,
            namespace, or hostname. If 1 of 2 Gateway listeners accept attachment
            from the referencing Route, the Route MUST be considered successfully
            attached. If no Gateway listeners accept attachment from this Route,
            the Route MUST be considered detached from the Gateway.

            Support: Extended
            """
            return self._set("port", value)

        def section_name(self, value: Optional[str], /) -> Self:
            """
            SectionName is the name of a section within the target resource. In the
            following resources, SectionName is interpreted as the following:

            * Gateway: Listener name. When both Port (experimental) and SectionName
            are specified, the name and port of the selected listener must match
            both specified values.
            * Service: Port name. When both Port (experimental) and SectionName
            are specified, the name and port of the selected listener must match
            both specified values.

            Implementations MAY choose to support attaching Routes to other resources.
            If that is the case, they MUST clearly document how SectionName is
            interpreted.

            When unspecified (empty string), this will reference the entire resource.
            For the purpose of status, an attachment is considered successful if at
            least one section in the parent resource accepts it. For example, Gateway
            listeners can restrict which Routes can attach to them by Route kind,
            namespace, or hostname. If 1 of 2 Gateway listeners accept attachment from
            the referencing Route, the Route MUST be considered successfully
            attached. If no Gateway listeners accept attachment from this Route, the
            Route MUST be considered detached from the Gateway.

            Support: Core
            """
            return self._set("section_name", value)

    class BuilderContext(BuilderContextBase["ParentRef.Builder"]):
        def model_post_init(self, __context) -> None:
            self._builder = ParentRef.Builder()
            self._builder._in_context = True
            self._parent_builder = None
            self._field_name = None

    @classmethod
    def builder(cls) -> Builder:
        return cls.Builder()

    @classmethod
    def new(cls) -> BuilderContext:
        """Creates a new context manager builder for ParentRef."""
        return cls.BuilderContext()

    class ListBuilder(GenericListBuilder["ParentRef", Builder]):
        def __init__(self):
            raise NotImplementedError(
                "This class is not meant to be instantiated. Use ParentRef.list_builder() instead."
            )

    @classmethod
    def list_builder(cls) -> ListBuilder:
        return GenericListBuilder[cls, cls.Builder]()  # type: ignore

    group: Annotated[
        Optional[str],
        Field(
            max_length=253,
            pattern="^$|^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$",
        ),
    ] = "gateway.networking.k8s.io"
    """
    Group is the group of the referent.
    When unspecified, "gateway.networking.k8s.io" is inferred.
    To set the core API group (such as for a "Service" kind referent),
    Group must be explicitly set to "" (empty string).

    Support: Core
    """
    kind: Annotated[
        Optional[str],
        Field(max_length=63, min_length=1, pattern="^[a-zA-Z]([-a-zA-Z0-9]*[a-zA-Z0-9])?$"),
    ] = "Gateway"
    """
    Kind is kind of the referent.

    There are two kinds of parent resources with "Core" support:

    * Gateway (Gateway conformance profile)
    * Service (Mesh conformance profile, ClusterIP Services only)

    Support for other resources is Implementation-Specific.
    """
    name: Annotated[str, Field(max_length=253, min_length=1)]
    """
    Name is the name of the referent.

    Support: Core
    """
    namespace: Annotated[
        Optional[str],
        Field(max_length=63, min_length=1, pattern="^[a-z0-9]([-a-z0-9]*[a-z0-9])?$"),
    ] = None
    """
    Namespace is the namespace of the referent. When unspecified, this refers
    to the local namespace of the Route.

    Note that there are specific rules for ParentRefs which cross namespace
    boundaries. Cross-namespace references are only valid if they are explicitly
    allowed by something in the namespace they are referring to. For example:
    Gateway has the AllowedRoutes field, and ReferenceGrant provides a
    generic way to enable any other kind of cross-namespace reference.

    <gateway:experimental:description>
    ParentRefs from a Route to a Service in the same namespace are "producer"
    routes, which apply default routing rules to inbound connections from
    any namespace to the Service.

    ParentRefs from a Route to a Service in a different namespace are
    "consumer" routes, and these routing rules are only applied to outbound
    connections originating from the same namespace as the Route, for which
    the intended destination of the connections are a Service targeted as a
    ParentRef of the Route.
    </gateway:experimental:description>

    Support: Core
    """
    port: Annotated[Optional[int], Field(ge=1, le=65535)] = None
    """
    Port is the network port this Route targets. It can be interpreted
    differently based on the type of parent resource.

    When the parent resource is a Gateway, this targets all listeners
    listening on the specified port that also support this kind of Route(and
    select this Route). It's not recommended to set `Port` unless the
    networking behaviors specified in a Route must apply to a specific port
    as opposed to a listener(s) whose port(s) may be changed. When both Port
    and SectionName are specified, the name and port of the selected listener
    must match both specified values.

    <gateway:experimental:description>
    When the parent resource is a Service, this targets a specific port in the
    Service spec. When both Port (experimental) and SectionName are specified,
    the name and port of the selected port must match both specified values.
    </gateway:experimental:description>

    Implementations MAY choose to support other parent resources.
    Implementations supporting other types of parent resources MUST clearly
    document how/if Port is interpreted.

    For the purpose of status, an attachment is considered successful as
    long as the parent resource accepts it partially. For example, Gateway
    listeners can restrict which Routes can attach to them by Route kind,
    namespace, or hostname. If 1 of 2 Gateway listeners accept attachment
    from the referencing Route, the Route MUST be considered successfully
    attached. If no Gateway listeners accept attachment from this Route,
    the Route MUST be considered detached from the Gateway.

    Support: Extended
    """
    section_name: Annotated[
        Optional[str],
        Field(
            alias="sectionName",
            max_length=253,
            min_length=1,
            pattern="^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$",
        ),
    ] = None
    """
    SectionName is the name of a section within the target resource. In the
    following resources, SectionName is interpreted as the following:

    * Gateway: Listener name. When both Port (experimental) and SectionName
    are specified, the name and port of the selected listener must match
    both specified values.
    * Service: Port name. When both Port (experimental) and SectionName
    are specified, the name and port of the selected listener must match
    both specified values.

    Implementations MAY choose to support attaching Routes to other resources.
    If that is the case, they MUST clearly document how SectionName is
    interpreted.

    When unspecified (empty string), this will reference the entire resource.
    For the purpose of status, an attachment is considered successful if at
    least one section in the parent resource accepts it. For example, Gateway
    listeners can restrict which Routes can attach to them by Route kind,
    namespace, or hostname. If 1 of 2 Gateway listeners accept attachment from
    the referencing Route, the Route MUST be considered successfully
    attached. If no Gateway listeners accept attachment from this Route, the
    Route MUST be considered detached from the Gateway.

    Support: Core
    """


class Metadata(BaseModel):
    class Builder(BaseModelBuilder):
        @property
        def cls(self) -> Type["Metadata"]:
            return Metadata

        def build(self) -> "Metadata":
            return Metadata(**self._attrs)

        def annotations(self, value: Optional[Dict[str, str]], /) -> Self:
            """
            Annotations that should be added to the created ACME HTTP01 solver pods.
            """
            return self._set("annotations", value)

        def labels(self, value: Optional[Dict[str, str]], /) -> Self:
            """
            Labels that should be added to the created ACME HTTP01 solver pods.
            """
            return self._set("labels", value)

    class BuilderContext(BuilderContextBase["Metadata.Builder"]):
        def model_post_init(self, __context) -> None:
            self._builder = Metadata.Builder()
            self._builder._in_context = True
            self._parent_builder = None
            self._field_name = None

    @classmethod
    def builder(cls) -> Builder:
        return cls.Builder()

    @classmethod
    def new(cls) -> BuilderContext:
        """Creates a new context manager builder for Metadata."""
        return cls.BuilderContext()

    class ListBuilder(GenericListBuilder["Metadata", Builder]):
        def __init__(self):
            raise NotImplementedError(
                "This class is not meant to be instantiated. Use Metadata.list_builder() instead."
            )

    @classmethod
    def list_builder(cls) -> ListBuilder:
        return GenericListBuilder[cls, cls.Builder]()  # type: ignore

    annotations: Optional[Dict[str, str]] = None
    """
    Annotations that should be added to the created ACME HTTP01 solver pods.
    """
    labels: Optional[Dict[str, str]] = None
    """
    Labels that should be added to the created ACME HTTP01 solver pods.
    """


class MatchExpression(BaseModel):
    class Builder(BaseModelBuilder):
        @property
        def cls(self) -> Type["MatchExpression"]:
            return MatchExpression

        def build(self) -> "MatchExpression":
            return MatchExpression(**self._attrs)

        def key(self, value: str, /) -> Self:
            """
            The label key that the selector applies to.
            """
            return self._set("key", value)

        def operator(self, value: str, /) -> Self:
            """
            Represents a key's relationship to a set of values.
            Valid operators are In, NotIn, Exists, DoesNotExist. Gt, and Lt.
            """
            return self._set("operator", value)

        def values(self, value: Optional[List[str]], /) -> Self:
            """
            An array of string values. If the operator is In or NotIn,
            the values array must be non-empty. If the operator is Exists or DoesNotExist,
            the values array must be empty. If the operator is Gt or Lt, the values
            array must have a single element, which will be interpreted as an integer.
            This array is replaced during a strategic merge patch.
            """
            return self._set("values", value)

    class BuilderContext(BuilderContextBase["MatchExpression.Builder"]):
        def model_post_init(self, __context) -> None:
            self._builder = MatchExpression.Builder()
            self._builder._in_context = True
            self._parent_builder = None
            self._field_name = None

    @classmethod
    def builder(cls) -> Builder:
        return cls.Builder()

    @classmethod
    def new(cls) -> BuilderContext:
        """Creates a new context manager builder for MatchExpression."""
        return cls.BuilderContext()

    class ListBuilder(GenericListBuilder["MatchExpression", Builder]):
        def __init__(self):
            raise NotImplementedError(
                "This class is not meant to be instantiated. Use MatchExpression.list_builder() instead."
            )

    @classmethod
    def list_builder(cls) -> ListBuilder:
        return GenericListBuilder[cls, cls.Builder]()  # type: ignore

    key: str
    """
    The label key that the selector applies to.
    """
    operator: str
    """
    Represents a key's relationship to a set of values.
    Valid operators are In, NotIn, Exists, DoesNotExist. Gt, and Lt.
    """
    values: Optional[List[str]] = None
    """
    An array of string values. If the operator is In or NotIn,
    the values array must be non-empty. If the operator is Exists or DoesNotExist,
    the values array must be empty. If the operator is Gt or Lt, the values
    array must have a single element, which will be interpreted as an integer.
    This array is replaced during a strategic merge patch.
    """


class MatchField(BaseModel):
    class Builder(BaseModelBuilder):
        @property
        def cls(self) -> Type["MatchField"]:
            return MatchField

        def build(self) -> "MatchField":
            return MatchField(**self._attrs)

        def key(self, value: str, /) -> Self:
            """
            The label key that the selector applies to.
            """
            return self._set("key", value)

        def operator(self, value: str, /) -> Self:
            """
            Represents a key's relationship to a set of values.
            Valid operators are In, NotIn, Exists, DoesNotExist. Gt, and Lt.
            """
            return self._set("operator", value)

        def values(self, value: Optional[List[str]], /) -> Self:
            """
            An array of string values. If the operator is In or NotIn,
            the values array must be non-empty. If the operator is Exists or DoesNotExist,
            the values array must be empty. If the operator is Gt or Lt, the values
            array must have a single element, which will be interpreted as an integer.
            This array is replaced during a strategic merge patch.
            """
            return self._set("values", value)

    class BuilderContext(BuilderContextBase["MatchField.Builder"]):
        def model_post_init(self, __context) -> None:
            self._builder = MatchField.Builder()
            self._builder._in_context = True
            self._parent_builder = None
            self._field_name = None

    @classmethod
    def builder(cls) -> Builder:
        return cls.Builder()

    @classmethod
    def new(cls) -> BuilderContext:
        """Creates a new context manager builder for MatchField."""
        return cls.BuilderContext()

    class ListBuilder(GenericListBuilder["MatchField", Builder]):
        def __init__(self):
            raise NotImplementedError(
                "This class is not meant to be instantiated. Use MatchField.list_builder() instead."
            )

    @classmethod
    def list_builder(cls) -> ListBuilder:
        return GenericListBuilder[cls, cls.Builder]()  # type: ignore

    key: str
    """
    The label key that the selector applies to.
    """
    operator: str
    """
    Represents a key's relationship to a set of values.
    Valid operators are In, NotIn, Exists, DoesNotExist. Gt, and Lt.
    """
    values: Optional[List[str]] = None
    """
    An array of string values. If the operator is In or NotIn,
    the values array must be non-empty. If the operator is Exists or DoesNotExist,
    the values array must be empty. If the operator is Gt or Lt, the values
    array must have a single element, which will be interpreted as an integer.
    This array is replaced during a strategic merge patch.
    """


class Preference(BaseModel):
    class Builder(BaseModelBuilder):
        @property
        def cls(self) -> Type["Preference"]:
            return Preference

        def build(self) -> "Preference":
            return Preference(**self._attrs)

        @overload
        def match_expressions(
            self, value_or_callback: List[MatchExpression], /
        ) -> "Preference.Builder": ...

        @overload
        def match_expressions(
            self,
            value_or_callback: Callable[
                [GenericListBuilder[MatchExpression, MatchExpression.Builder]],
                GenericListBuilder[MatchExpression, MatchExpression.Builder]
                | List[MatchExpression],
            ],
            /,
        ) -> "Preference.Builder": ...

        @overload
        def match_expressions(
            self, value_or_callback: Never = ...
        ) -> ListBuilderContext[MatchExpression.Builder]: ...

        def match_expressions(self, value_or_callback=None, /):
            """
            A list of node selector requirements by node's labels.
            """
            if self._in_context and value_or_callback is None:
                context = ListBuilderContext[MatchExpression.Builder]()
                context._parent_builder = self
                context._field_name = "match_expressions"
                return context

            value = value_or_callback
            if callable(value_or_callback):
                output = value_or_callback(MatchExpression.list_builder())
                if isinstance(output, GenericListBuilder):
                    value = output.build()
                else:
                    value = output
            return self._set("match_expressions", value)

        @overload
        def match_fields(self, value_or_callback: List[MatchField], /) -> "Preference.Builder": ...

        @overload
        def match_fields(
            self,
            value_or_callback: Callable[
                [GenericListBuilder[MatchField, MatchField.Builder]],
                GenericListBuilder[MatchField, MatchField.Builder] | List[MatchField],
            ],
            /,
        ) -> "Preference.Builder": ...

        @overload
        def match_fields(
            self, value_or_callback: Never = ...
        ) -> ListBuilderContext[MatchField.Builder]: ...

        def match_fields(self, value_or_callback=None, /):
            """
            A list of node selector requirements by node's fields.
            """
            if self._in_context and value_or_callback is None:
                context = ListBuilderContext[MatchField.Builder]()
                context._parent_builder = self
                context._field_name = "match_fields"
                return context

            value = value_or_callback
            if callable(value_or_callback):
                output = value_or_callback(MatchField.list_builder())
                if isinstance(output, GenericListBuilder):
                    value = output.build()
                else:
                    value = output
            return self._set("match_fields", value)

    class BuilderContext(BuilderContextBase["Preference.Builder"]):
        def model_post_init(self, __context) -> None:
            self._builder = Preference.Builder()
            self._builder._in_context = True
            self._parent_builder = None
            self._field_name = None

    @classmethod
    def builder(cls) -> Builder:
        return cls.Builder()

    @classmethod
    def new(cls) -> BuilderContext:
        """Creates a new context manager builder for Preference."""
        return cls.BuilderContext()

    class ListBuilder(GenericListBuilder["Preference", Builder]):
        def __init__(self):
            raise NotImplementedError(
                "This class is not meant to be instantiated. Use Preference.list_builder() instead."
            )

    @classmethod
    def list_builder(cls) -> ListBuilder:
        return GenericListBuilder[cls, cls.Builder]()  # type: ignore

    match_expressions: Annotated[
        Optional[List[MatchExpression]], Field(alias="matchExpressions")
    ] = None
    """
    A list of node selector requirements by node's labels.
    """
    match_fields: Annotated[Optional[List[MatchField]], Field(alias="matchFields")] = None
    """
    A list of node selector requirements by node's fields.
    """


class PreferredDuringSchedulingIgnoredDuringExecution(BaseModel):
    class Builder(BaseModelBuilder):
        @property
        def cls(self) -> Type["PreferredDuringSchedulingIgnoredDuringExecution"]:
            return PreferredDuringSchedulingIgnoredDuringExecution

        def build(self) -> "PreferredDuringSchedulingIgnoredDuringExecution":
            return PreferredDuringSchedulingIgnoredDuringExecution(**self._attrs)

        @overload
        def preference(
            self, value_or_callback: Preference, /
        ) -> "PreferredDuringSchedulingIgnoredDuringExecution.Builder": ...

        @overload
        def preference(
            self,
            value_or_callback: Callable[[Preference.Builder], Preference.Builder | Preference],
            /,
        ) -> "PreferredDuringSchedulingIgnoredDuringExecution.Builder": ...

        @overload
        def preference(self, value_or_callback: Never = ...) -> "Preference.BuilderContext": ...

        def preference(self, value_or_callback=None, /):
            """
            A node selector term, associated with the corresponding weight.
            """
            if self._in_context and value_or_callback is None:
                context = Preference.BuilderContext()
                context._parent_builder = self
                context._field_name = "preference"
                return context

            value = value_or_callback
            if callable(value_or_callback):
                output = value_or_callback(Preference.builder())
                if isinstance(output, Preference.Builder):
                    value = output.build()
                else:
                    value = output
            return self._set("preference", value)

        def weight(self, value: int, /) -> Self:
            """
            Weight associated with matching the corresponding nodeSelectorTerm, in the range 1-100.
            """
            return self._set("weight", value)

    class BuilderContext(
        BuilderContextBase["PreferredDuringSchedulingIgnoredDuringExecution.Builder"]
    ):
        def model_post_init(self, __context) -> None:
            self._builder = PreferredDuringSchedulingIgnoredDuringExecution.Builder()
            self._builder._in_context = True
            self._parent_builder = None
            self._field_name = None

    @classmethod
    def builder(cls) -> Builder:
        return cls.Builder()

    @classmethod
    def new(cls) -> BuilderContext:
        """Creates a new context manager builder for PreferredDuringSchedulingIgnoredDuringExecution."""
        return cls.BuilderContext()

    class ListBuilder(
        GenericListBuilder["PreferredDuringSchedulingIgnoredDuringExecution", Builder]
    ):
        def __init__(self):
            raise NotImplementedError(
                "This class is not meant to be instantiated. Use PreferredDuringSchedulingIgnoredDuringExecution.list_builder() instead."
            )

    @classmethod
    def list_builder(cls) -> ListBuilder:
        return GenericListBuilder[cls, cls.Builder]()  # type: ignore

    preference: Preference
    """
    A node selector term, associated with the corresponding weight.
    """
    weight: int
    """
    Weight associated with matching the corresponding nodeSelectorTerm, in the range 1-100.
    """


class NodeSelectorTerm(BaseModel):
    class Builder(BaseModelBuilder):
        @property
        def cls(self) -> Type["NodeSelectorTerm"]:
            return NodeSelectorTerm

        def build(self) -> "NodeSelectorTerm":
            return NodeSelectorTerm(**self._attrs)

        @overload
        def match_expressions(
            self, value_or_callback: List[MatchExpression], /
        ) -> "NodeSelectorTerm.Builder": ...

        @overload
        def match_expressions(
            self,
            value_or_callback: Callable[
                [GenericListBuilder[MatchExpression, MatchExpression.Builder]],
                GenericListBuilder[MatchExpression, MatchExpression.Builder]
                | List[MatchExpression],
            ],
            /,
        ) -> "NodeSelectorTerm.Builder": ...

        @overload
        def match_expressions(
            self, value_or_callback: Never = ...
        ) -> ListBuilderContext[MatchExpression.Builder]: ...

        def match_expressions(self, value_or_callback=None, /):
            """
            A list of node selector requirements by node's labels.
            """
            if self._in_context and value_or_callback is None:
                context = ListBuilderContext[MatchExpression.Builder]()
                context._parent_builder = self
                context._field_name = "match_expressions"
                return context

            value = value_or_callback
            if callable(value_or_callback):
                output = value_or_callback(MatchExpression.list_builder())
                if isinstance(output, GenericListBuilder):
                    value = output.build()
                else:
                    value = output
            return self._set("match_expressions", value)

        @overload
        def match_fields(
            self, value_or_callback: List[MatchField], /
        ) -> "NodeSelectorTerm.Builder": ...

        @overload
        def match_fields(
            self,
            value_or_callback: Callable[
                [GenericListBuilder[MatchField, MatchField.Builder]],
                GenericListBuilder[MatchField, MatchField.Builder] | List[MatchField],
            ],
            /,
        ) -> "NodeSelectorTerm.Builder": ...

        @overload
        def match_fields(
            self, value_or_callback: Never = ...
        ) -> ListBuilderContext[MatchField.Builder]: ...

        def match_fields(self, value_or_callback=None, /):
            """
            A list of node selector requirements by node's fields.
            """
            if self._in_context and value_or_callback is None:
                context = ListBuilderContext[MatchField.Builder]()
                context._parent_builder = self
                context._field_name = "match_fields"
                return context

            value = value_or_callback
            if callable(value_or_callback):
                output = value_or_callback(MatchField.list_builder())
                if isinstance(output, GenericListBuilder):
                    value = output.build()
                else:
                    value = output
            return self._set("match_fields", value)

    class BuilderContext(BuilderContextBase["NodeSelectorTerm.Builder"]):
        def model_post_init(self, __context) -> None:
            self._builder = NodeSelectorTerm.Builder()
            self._builder._in_context = True
            self._parent_builder = None
            self._field_name = None

    @classmethod
    def builder(cls) -> Builder:
        return cls.Builder()

    @classmethod
    def new(cls) -> BuilderContext:
        """Creates a new context manager builder for NodeSelectorTerm."""
        return cls.BuilderContext()

    class ListBuilder(GenericListBuilder["NodeSelectorTerm", Builder]):
        def __init__(self):
            raise NotImplementedError(
                "This class is not meant to be instantiated. Use NodeSelectorTerm.list_builder() instead."
            )

    @classmethod
    def list_builder(cls) -> ListBuilder:
        return GenericListBuilder[cls, cls.Builder]()  # type: ignore

    match_expressions: Annotated[
        Optional[List[MatchExpression]], Field(alias="matchExpressions")
    ] = None
    """
    A list of node selector requirements by node's labels.
    """
    match_fields: Annotated[Optional[List[MatchField]], Field(alias="matchFields")] = None
    """
    A list of node selector requirements by node's fields.
    """


class RequiredDuringSchedulingIgnoredDuringExecution(BaseModel):
    class Builder(BaseModelBuilder):
        @property
        def cls(self) -> Type["RequiredDuringSchedulingIgnoredDuringExecution"]:
            return RequiredDuringSchedulingIgnoredDuringExecution

        def build(self) -> "RequiredDuringSchedulingIgnoredDuringExecution":
            return RequiredDuringSchedulingIgnoredDuringExecution(**self._attrs)

        @overload
        def node_selector_terms(
            self, value_or_callback: List[NodeSelectorTerm], /
        ) -> "RequiredDuringSchedulingIgnoredDuringExecution.Builder": ...

        @overload
        def node_selector_terms(
            self,
            value_or_callback: Callable[
                [GenericListBuilder[NodeSelectorTerm, NodeSelectorTerm.Builder]],
                GenericListBuilder[NodeSelectorTerm, NodeSelectorTerm.Builder]
                | List[NodeSelectorTerm],
            ],
            /,
        ) -> "RequiredDuringSchedulingIgnoredDuringExecution.Builder": ...

        @overload
        def node_selector_terms(
            self, value_or_callback: Never = ...
        ) -> ListBuilderContext[NodeSelectorTerm.Builder]: ...

        def node_selector_terms(self, value_or_callback=None, /):
            """
            Required. A list of node selector terms. The terms are ORed.
            """
            if self._in_context and value_or_callback is None:
                context = ListBuilderContext[NodeSelectorTerm.Builder]()
                context._parent_builder = self
                context._field_name = "node_selector_terms"
                return context

            value = value_or_callback
            if callable(value_or_callback):
                output = value_or_callback(NodeSelectorTerm.list_builder())
                if isinstance(output, GenericListBuilder):
                    value = output.build()
                else:
                    value = output
            return self._set("node_selector_terms", value)

    class BuilderContext(
        BuilderContextBase["RequiredDuringSchedulingIgnoredDuringExecution.Builder"]
    ):
        def model_post_init(self, __context) -> None:
            self._builder = RequiredDuringSchedulingIgnoredDuringExecution.Builder()
            self._builder._in_context = True
            self._parent_builder = None
            self._field_name = None

    @classmethod
    def builder(cls) -> Builder:
        return cls.Builder()

    @classmethod
    def new(cls) -> BuilderContext:
        """Creates a new context manager builder for RequiredDuringSchedulingIgnoredDuringExecution."""
        return cls.BuilderContext()

    class ListBuilder(
        GenericListBuilder["RequiredDuringSchedulingIgnoredDuringExecution", Builder]
    ):
        def __init__(self):
            raise NotImplementedError(
                "This class is not meant to be instantiated. Use RequiredDuringSchedulingIgnoredDuringExecution.list_builder() instead."
            )

    @classmethod
    def list_builder(cls) -> ListBuilder:
        return GenericListBuilder[cls, cls.Builder]()  # type: ignore

    node_selector_terms: Annotated[List[NodeSelectorTerm], Field(alias="nodeSelectorTerms")]
    """
    Required. A list of node selector terms. The terms are ORed.
    """


class NodeAffinity(BaseModel):
    class Builder(BaseModelBuilder):
        @property
        def cls(self) -> Type["NodeAffinity"]:
            return NodeAffinity

        def build(self) -> "NodeAffinity":
            return NodeAffinity(**self._attrs)

        @overload
        def preferred_during_scheduling_ignored_during_execution(
            self,
            value_or_callback: List[PreferredDuringSchedulingIgnoredDuringExecution],
            /,
        ) -> "NodeAffinity.Builder": ...

        @overload
        def preferred_during_scheduling_ignored_during_execution(
            self,
            value_or_callback: Callable[
                [
                    GenericListBuilder[
                        PreferredDuringSchedulingIgnoredDuringExecution,
                        PreferredDuringSchedulingIgnoredDuringExecution.Builder,
                    ]
                ],
                GenericListBuilder[
                    PreferredDuringSchedulingIgnoredDuringExecution,
                    PreferredDuringSchedulingIgnoredDuringExecution.Builder,
                ]
                | List[PreferredDuringSchedulingIgnoredDuringExecution],
            ],
            /,
        ) -> "NodeAffinity.Builder": ...

        @overload
        def preferred_during_scheduling_ignored_during_execution(
            self, value_or_callback: Never = ...
        ) -> ListBuilderContext[PreferredDuringSchedulingIgnoredDuringExecution.Builder]: ...

        def preferred_during_scheduling_ignored_during_execution(self, value_or_callback=None, /):
            """
            The scheduler will prefer to schedule pods to nodes that satisfy
            the affinity expressions specified by this field, but it may choose
            a node that violates one or more of the expressions. The node that is
            most preferred is the one with the greatest sum of weights, i.e.
            for each node that meets all of the scheduling requirements (resource
            request, requiredDuringScheduling affinity expressions, etc.),
            compute a sum by iterating through the elements of this field and adding
            "weight" to the sum if the node matches the corresponding matchExpressions; the
            node(s) with the highest sum are the most preferred.
            """
            if self._in_context and value_or_callback is None:
                context = ListBuilderContext[
                    PreferredDuringSchedulingIgnoredDuringExecution.Builder
                ]()
                context._parent_builder = self
                context._field_name = "preferred_during_scheduling_ignored_during_execution"
                return context

            value = value_or_callback
            if callable(value_or_callback):
                output = value_or_callback(
                    PreferredDuringSchedulingIgnoredDuringExecution.list_builder()
                )
                if isinstance(output, GenericListBuilder):
                    value = output.build()
                else:
                    value = output
            return self._set("preferred_during_scheduling_ignored_during_execution", value)

        @overload
        def required_during_scheduling_ignored_during_execution(
            self,
            value_or_callback: Optional[RequiredDuringSchedulingIgnoredDuringExecution],
            /,
        ) -> "NodeAffinity.Builder": ...

        @overload
        def required_during_scheduling_ignored_during_execution(
            self,
            value_or_callback: Callable[
                [RequiredDuringSchedulingIgnoredDuringExecution.Builder],
                RequiredDuringSchedulingIgnoredDuringExecution.Builder
                | RequiredDuringSchedulingIgnoredDuringExecution,
            ],
            /,
        ) -> "NodeAffinity.Builder": ...

        @overload
        def required_during_scheduling_ignored_during_execution(
            self, value_or_callback: Never = ...
        ) -> "RequiredDuringSchedulingIgnoredDuringExecution.BuilderContext": ...

        def required_during_scheduling_ignored_during_execution(self, value_or_callback=None, /):
            """
            If the affinity requirements specified by this field are not met at
            scheduling time, the pod will not be scheduled onto the node.
            If the affinity requirements specified by this field cease to be met
            at some point during pod execution (e.g. due to an update), the system
            may or may not try to eventually evict the pod from its node.
            """
            if self._in_context and value_or_callback is None:
                context = RequiredDuringSchedulingIgnoredDuringExecution.BuilderContext()
                context._parent_builder = self
                context._field_name = "required_during_scheduling_ignored_during_execution"
                return context

            value = value_or_callback
            if callable(value_or_callback):
                output = value_or_callback(RequiredDuringSchedulingIgnoredDuringExecution.builder())
                if isinstance(output, RequiredDuringSchedulingIgnoredDuringExecution.Builder):
                    value = output.build()
                else:
                    value = output
            return self._set("required_during_scheduling_ignored_during_execution", value)

    class BuilderContext(BuilderContextBase["NodeAffinity.Builder"]):
        def model_post_init(self, __context) -> None:
            self._builder = NodeAffinity.Builder()
            self._builder._in_context = True
            self._parent_builder = None
            self._field_name = None

    @classmethod
    def builder(cls) -> Builder:
        return cls.Builder()

    @classmethod
    def new(cls) -> BuilderContext:
        """Creates a new context manager builder for NodeAffinity."""
        return cls.BuilderContext()

    class ListBuilder(GenericListBuilder["NodeAffinity", Builder]):
        def __init__(self):
            raise NotImplementedError(
                "This class is not meant to be instantiated. Use NodeAffinity.list_builder() instead."
            )

    @classmethod
    def list_builder(cls) -> ListBuilder:
        return GenericListBuilder[cls, cls.Builder]()  # type: ignore

    preferred_during_scheduling_ignored_during_execution: Annotated[
        Optional[List[PreferredDuringSchedulingIgnoredDuringExecution]],
        Field(alias="preferredDuringSchedulingIgnoredDuringExecution"),
    ] = None
    """
    The scheduler will prefer to schedule pods to nodes that satisfy
    the affinity expressions specified by this field, but it may choose
    a node that violates one or more of the expressions. The node that is
    most preferred is the one with the greatest sum of weights, i.e.
    for each node that meets all of the scheduling requirements (resource
    request, requiredDuringScheduling affinity expressions, etc.),
    compute a sum by iterating through the elements of this field and adding
    "weight" to the sum if the node matches the corresponding matchExpressions; the
    node(s) with the highest sum are the most preferred.
    """
    required_during_scheduling_ignored_during_execution: Annotated[
        Optional[RequiredDuringSchedulingIgnoredDuringExecution],
        Field(alias="requiredDuringSchedulingIgnoredDuringExecution"),
    ] = None
    """
    If the affinity requirements specified by this field are not met at
    scheduling time, the pod will not be scheduled onto the node.
    If the affinity requirements specified by this field cease to be met
    at some point during pod execution (e.g. due to an update), the system
    may or may not try to eventually evict the pod from its node.
    """


class MatchExpressionModel(BaseModel):
    class Builder(BaseModelBuilder):
        @property
        def cls(self) -> Type["MatchExpressionModel"]:
            return MatchExpressionModel

        def build(self) -> "MatchExpressionModel":
            return MatchExpressionModel(**self._attrs)

        def key(self, value: str, /) -> Self:
            """
            key is the label key that the selector applies to.
            """
            return self._set("key", value)

        def operator(self, value: str, /) -> Self:
            """
            operator represents a key's relationship to a set of values.
            Valid operators are In, NotIn, Exists and DoesNotExist.
            """
            return self._set("operator", value)

        def values(self, value: Optional[List[str]], /) -> Self:
            """
            values is an array of string values. If the operator is In or NotIn,
            the values array must be non-empty. If the operator is Exists or DoesNotExist,
            the values array must be empty. This array is replaced during a strategic
            merge patch.
            """
            return self._set("values", value)

    class BuilderContext(BuilderContextBase["MatchExpressionModel.Builder"]):
        def model_post_init(self, __context) -> None:
            self._builder = MatchExpressionModel.Builder()
            self._builder._in_context = True
            self._parent_builder = None
            self._field_name = None

    @classmethod
    def builder(cls) -> Builder:
        return cls.Builder()

    @classmethod
    def new(cls) -> BuilderContext:
        """Creates a new context manager builder for MatchExpressionModel."""
        return cls.BuilderContext()

    class ListBuilder(GenericListBuilder["MatchExpressionModel", Builder]):
        def __init__(self):
            raise NotImplementedError(
                "This class is not meant to be instantiated. Use MatchExpressionModel.list_builder() instead."
            )

    @classmethod
    def list_builder(cls) -> ListBuilder:
        return GenericListBuilder[cls, cls.Builder]()  # type: ignore

    key: str
    """
    key is the label key that the selector applies to.
    """
    operator: str
    """
    operator represents a key's relationship to a set of values.
    Valid operators are In, NotIn, Exists and DoesNotExist.
    """
    values: Optional[List[str]] = None
    """
    values is an array of string values. If the operator is In or NotIn,
    the values array must be non-empty. If the operator is Exists or DoesNotExist,
    the values array must be empty. This array is replaced during a strategic
    merge patch.
    """


class LabelSelector(BaseModel):
    class Builder(BaseModelBuilder):
        @property
        def cls(self) -> Type["LabelSelector"]:
            return LabelSelector

        def build(self) -> "LabelSelector":
            return LabelSelector(**self._attrs)

        @overload
        def match_expressions(
            self, value_or_callback: List[MatchExpressionModel], /
        ) -> "LabelSelector.Builder": ...

        @overload
        def match_expressions(
            self,
            value_or_callback: Callable[
                [GenericListBuilder[MatchExpressionModel, MatchExpressionModel.Builder]],
                GenericListBuilder[MatchExpressionModel, MatchExpressionModel.Builder]
                | List[MatchExpressionModel],
            ],
            /,
        ) -> "LabelSelector.Builder": ...

        @overload
        def match_expressions(
            self, value_or_callback: Never = ...
        ) -> ListBuilderContext[MatchExpressionModel.Builder]: ...

        def match_expressions(self, value_or_callback=None, /):
            """
            matchExpressions is a list of label selector requirements. The requirements are ANDed.
            """
            if self._in_context and value_or_callback is None:
                context = ListBuilderContext[MatchExpressionModel.Builder]()
                context._parent_builder = self
                context._field_name = "match_expressions"
                return context

            value = value_or_callback
            if callable(value_or_callback):
                output = value_or_callback(MatchExpressionModel.list_builder())
                if isinstance(output, GenericListBuilder):
                    value = output.build()
                else:
                    value = output
            return self._set("match_expressions", value)

        def match_labels(self, value: Optional[Dict[str, str]], /) -> Self:
            """
            matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels
            map is equivalent to an element of matchExpressions, whose key field is "key", the
            operator is "In", and the values array contains only "value". The requirements are ANDed.
            """
            return self._set("match_labels", value)

    class BuilderContext(BuilderContextBase["LabelSelector.Builder"]):
        def model_post_init(self, __context) -> None:
            self._builder = LabelSelector.Builder()
            self._builder._in_context = True
            self._parent_builder = None
            self._field_name = None

    @classmethod
    def builder(cls) -> Builder:
        return cls.Builder()

    @classmethod
    def new(cls) -> BuilderContext:
        """Creates a new context manager builder for LabelSelector."""
        return cls.BuilderContext()

    class ListBuilder(GenericListBuilder["LabelSelector", Builder]):
        def __init__(self):
            raise NotImplementedError(
                "This class is not meant to be instantiated. Use LabelSelector.list_builder() instead."
            )

    @classmethod
    def list_builder(cls) -> ListBuilder:
        return GenericListBuilder[cls, cls.Builder]()  # type: ignore

    match_expressions: Annotated[
        Optional[List[MatchExpressionModel]], Field(alias="matchExpressions")
    ] = None
    """
    matchExpressions is a list of label selector requirements. The requirements are ANDed.
    """
    match_labels: Annotated[Optional[Dict[str, str]], Field(alias="matchLabels")] = None
    """
    matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels
    map is equivalent to an element of matchExpressions, whose key field is "key", the
    operator is "In", and the values array contains only "value". The requirements are ANDed.
    """


class NamespaceSelector(BaseModel):
    class Builder(BaseModelBuilder):
        @property
        def cls(self) -> Type["NamespaceSelector"]:
            return NamespaceSelector

        def build(self) -> "NamespaceSelector":
            return NamespaceSelector(**self._attrs)

        @overload
        def match_expressions(
            self, value_or_callback: List[MatchExpressionModel], /
        ) -> "NamespaceSelector.Builder": ...

        @overload
        def match_expressions(
            self,
            value_or_callback: Callable[
                [GenericListBuilder[MatchExpressionModel, MatchExpressionModel.Builder]],
                GenericListBuilder[MatchExpressionModel, MatchExpressionModel.Builder]
                | List[MatchExpressionModel],
            ],
            /,
        ) -> "NamespaceSelector.Builder": ...

        @overload
        def match_expressions(
            self, value_or_callback: Never = ...
        ) -> ListBuilderContext[MatchExpressionModel.Builder]: ...

        def match_expressions(self, value_or_callback=None, /):
            """
            matchExpressions is a list of label selector requirements. The requirements are ANDed.
            """
            if self._in_context and value_or_callback is None:
                context = ListBuilderContext[MatchExpressionModel.Builder]()
                context._parent_builder = self
                context._field_name = "match_expressions"
                return context

            value = value_or_callback
            if callable(value_or_callback):
                output = value_or_callback(MatchExpressionModel.list_builder())
                if isinstance(output, GenericListBuilder):
                    value = output.build()
                else:
                    value = output
            return self._set("match_expressions", value)

        def match_labels(self, value: Optional[Dict[str, str]], /) -> Self:
            """
            matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels
            map is equivalent to an element of matchExpressions, whose key field is "key", the
            operator is "In", and the values array contains only "value". The requirements are ANDed.
            """
            return self._set("match_labels", value)

    class BuilderContext(BuilderContextBase["NamespaceSelector.Builder"]):
        def model_post_init(self, __context) -> None:
            self._builder = NamespaceSelector.Builder()
            self._builder._in_context = True
            self._parent_builder = None
            self._field_name = None

    @classmethod
    def builder(cls) -> Builder:
        return cls.Builder()

    @classmethod
    def new(cls) -> BuilderContext:
        """Creates a new context manager builder for NamespaceSelector."""
        return cls.BuilderContext()

    class ListBuilder(GenericListBuilder["NamespaceSelector", Builder]):
        def __init__(self):
            raise NotImplementedError(
                "This class is not meant to be instantiated. Use NamespaceSelector.list_builder() instead."
            )

    @classmethod
    def list_builder(cls) -> ListBuilder:
        return GenericListBuilder[cls, cls.Builder]()  # type: ignore

    match_expressions: Annotated[
        Optional[List[MatchExpressionModel]], Field(alias="matchExpressions")
    ] = None
    """
    matchExpressions is a list of label selector requirements. The requirements are ANDed.
    """
    match_labels: Annotated[Optional[Dict[str, str]], Field(alias="matchLabels")] = None
    """
    matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels
    map is equivalent to an element of matchExpressions, whose key field is "key", the
    operator is "In", and the values array contains only "value". The requirements are ANDed.
    """


class PodAffinityTerm(BaseModel):
    class Builder(BaseModelBuilder):
        @property
        def cls(self) -> Type["PodAffinityTerm"]:
            return PodAffinityTerm

        def build(self) -> "PodAffinityTerm":
            return PodAffinityTerm(**self._attrs)

        @overload
        def label_selector(
            self, value_or_callback: Optional[LabelSelector], /
        ) -> "PodAffinityTerm.Builder": ...

        @overload
        def label_selector(
            self,
            value_or_callback: Callable[
                [LabelSelector.Builder], LabelSelector.Builder | LabelSelector
            ],
            /,
        ) -> "PodAffinityTerm.Builder": ...

        @overload
        def label_selector(
            self, value_or_callback: Never = ...
        ) -> "LabelSelector.BuilderContext": ...

        def label_selector(self, value_or_callback=None, /):
            """
            A label query over a set of resources, in this case pods.
            If it's null, this PodAffinityTerm matches with no Pods.
            """
            if self._in_context and value_or_callback is None:
                context = LabelSelector.BuilderContext()
                context._parent_builder = self
                context._field_name = "label_selector"
                return context

            value = value_or_callback
            if callable(value_or_callback):
                output = value_or_callback(LabelSelector.builder())
                if isinstance(output, LabelSelector.Builder):
                    value = output.build()
                else:
                    value = output
            return self._set("label_selector", value)

        def match_label_keys(self, value: Optional[List[str]], /) -> Self:
            """
            MatchLabelKeys is a set of pod label keys to select which pods will
            be taken into consideration. The keys are used to lookup values from the
            incoming pod labels, those key-value labels are merged with `labelSelector` as `key in (value)`
            to select the group of existing pods which pods will be taken into consideration
            for the incoming pod's pod (anti) affinity. Keys that don't exist in the incoming
            pod labels will be ignored. The default value is empty.
            The same key is forbidden to exist in both matchLabelKeys and labelSelector.
            Also, matchLabelKeys cannot be set when labelSelector isn't set.
            This is a beta field and requires enabling MatchLabelKeysInPodAffinity feature gate (enabled by default).
            """
            return self._set("match_label_keys", value)

        def mismatch_label_keys(self, value: Optional[List[str]], /) -> Self:
            """
            MismatchLabelKeys is a set of pod label keys to select which pods will
            be taken into consideration. The keys are used to lookup values from the
            incoming pod labels, those key-value labels are merged with `labelSelector` as `key notin (value)`
            to select the group of existing pods which pods will be taken into consideration
            for the incoming pod's pod (anti) affinity. Keys that don't exist in the incoming
            pod labels will be ignored. The default value is empty.
            The same key is forbidden to exist in both mismatchLabelKeys and labelSelector.
            Also, mismatchLabelKeys cannot be set when labelSelector isn't set.
            This is a beta field and requires enabling MatchLabelKeysInPodAffinity feature gate (enabled by default).
            """
            return self._set("mismatch_label_keys", value)

        @overload
        def namespace_selector(
            self, value_or_callback: Optional[NamespaceSelector], /
        ) -> "PodAffinityTerm.Builder": ...

        @overload
        def namespace_selector(
            self,
            value_or_callback: Callable[
                [NamespaceSelector.Builder],
                NamespaceSelector.Builder | NamespaceSelector,
            ],
            /,
        ) -> "PodAffinityTerm.Builder": ...

        @overload
        def namespace_selector(
            self, value_or_callback: Never = ...
        ) -> "NamespaceSelector.BuilderContext": ...

        def namespace_selector(self, value_or_callback=None, /):
            """
            A label query over the set of namespaces that the term applies to.
            The term is applied to the union of the namespaces selected by this field
            and the ones listed in the namespaces field.
            null selector and null or empty namespaces list means "this pod's namespace".
            An empty selector ({}) matches all namespaces.
            """
            if self._in_context and value_or_callback is None:
                context = NamespaceSelector.BuilderContext()
                context._parent_builder = self
                context._field_name = "namespace_selector"
                return context

            value = value_or_callback
            if callable(value_or_callback):
                output = value_or_callback(NamespaceSelector.builder())
                if isinstance(output, NamespaceSelector.Builder):
                    value = output.build()
                else:
                    value = output
            return self._set("namespace_selector", value)

        def namespaces(self, value: Optional[List[str]], /) -> Self:
            """
            namespaces specifies a static list of namespace names that the term applies to.
            The term is applied to the union of the namespaces listed in this field
            and the ones selected by namespaceSelector.
            null or empty namespaces list and null namespaceSelector means "this pod's namespace".
            """
            return self._set("namespaces", value)

        def topology_key(self, value: str, /) -> Self:
            """
            This pod should be co-located (affinity) or not co-located (anti-affinity) with the pods matching
            the labelSelector in the specified namespaces, where co-located is defined as running on a node
            whose value of the label with key topologyKey matches that of any node on which any of the
            selected pods is running.
            Empty topologyKey is not allowed.
            """
            return self._set("topology_key", value)

    class BuilderContext(BuilderContextBase["PodAffinityTerm.Builder"]):
        def model_post_init(self, __context) -> None:
            self._builder = PodAffinityTerm.Builder()
            self._builder._in_context = True
            self._parent_builder = None
            self._field_name = None

    @classmethod
    def builder(cls) -> Builder:
        return cls.Builder()

    @classmethod
    def new(cls) -> BuilderContext:
        """Creates a new context manager builder for PodAffinityTerm."""
        return cls.BuilderContext()

    class ListBuilder(GenericListBuilder["PodAffinityTerm", Builder]):
        def __init__(self):
            raise NotImplementedError(
                "This class is not meant to be instantiated. Use PodAffinityTerm.list_builder() instead."
            )

    @classmethod
    def list_builder(cls) -> ListBuilder:
        return GenericListBuilder[cls, cls.Builder]()  # type: ignore

    label_selector: Annotated[Optional[LabelSelector], Field(alias="labelSelector")] = None
    """
    A label query over a set of resources, in this case pods.
    If it's null, this PodAffinityTerm matches with no Pods.
    """
    match_label_keys: Annotated[Optional[List[str]], Field(alias="matchLabelKeys")] = None
    """
    MatchLabelKeys is a set of pod label keys to select which pods will
    be taken into consideration. The keys are used to lookup values from the
    incoming pod labels, those key-value labels are merged with `labelSelector` as `key in (value)`
    to select the group of existing pods which pods will be taken into consideration
    for the incoming pod's pod (anti) affinity. Keys that don't exist in the incoming
    pod labels will be ignored. The default value is empty.
    The same key is forbidden to exist in both matchLabelKeys and labelSelector.
    Also, matchLabelKeys cannot be set when labelSelector isn't set.
    This is a beta field and requires enabling MatchLabelKeysInPodAffinity feature gate (enabled by default).
    """
    mismatch_label_keys: Annotated[Optional[List[str]], Field(alias="mismatchLabelKeys")] = None
    """
    MismatchLabelKeys is a set of pod label keys to select which pods will
    be taken into consideration. The keys are used to lookup values from the
    incoming pod labels, those key-value labels are merged with `labelSelector` as `key notin (value)`
    to select the group of existing pods which pods will be taken into consideration
    for the incoming pod's pod (anti) affinity. Keys that don't exist in the incoming
    pod labels will be ignored. The default value is empty.
    The same key is forbidden to exist in both mismatchLabelKeys and labelSelector.
    Also, mismatchLabelKeys cannot be set when labelSelector isn't set.
    This is a beta field and requires enabling MatchLabelKeysInPodAffinity feature gate (enabled by default).
    """
    namespace_selector: Annotated[Optional[NamespaceSelector], Field(alias="namespaceSelector")] = (
        None
    )
    """
    A label query over the set of namespaces that the term applies to.
    The term is applied to the union of the namespaces selected by this field
    and the ones listed in the namespaces field.
    null selector and null or empty namespaces list means "this pod's namespace".
    An empty selector ({}) matches all namespaces.
    """
    namespaces: Optional[List[str]] = None
    """
    namespaces specifies a static list of namespace names that the term applies to.
    The term is applied to the union of the namespaces listed in this field
    and the ones selected by namespaceSelector.
    null or empty namespaces list and null namespaceSelector means "this pod's namespace".
    """
    topology_key: Annotated[str, Field(alias="topologyKey")]
    """
    This pod should be co-located (affinity) or not co-located (anti-affinity) with the pods matching
    the labelSelector in the specified namespaces, where co-located is defined as running on a node
    whose value of the label with key topologyKey matches that of any node on which any of the
    selected pods is running.
    Empty topologyKey is not allowed.
    """


class PreferredDuringSchedulingIgnoredDuringExecutionModel(BaseModel):
    class Builder(BaseModelBuilder):
        @property
        def cls(self) -> Type["PreferredDuringSchedulingIgnoredDuringExecutionModel"]:
            return PreferredDuringSchedulingIgnoredDuringExecutionModel

        def build(self) -> "PreferredDuringSchedulingIgnoredDuringExecutionModel":
            return PreferredDuringSchedulingIgnoredDuringExecutionModel(**self._attrs)

        @overload
        def pod_affinity_term(
            self, value_or_callback: PodAffinityTerm, /
        ) -> "PreferredDuringSchedulingIgnoredDuringExecutionModel.Builder": ...

        @overload
        def pod_affinity_term(
            self,
            value_or_callback: Callable[
                [PodAffinityTerm.Builder], PodAffinityTerm.Builder | PodAffinityTerm
            ],
            /,
        ) -> "PreferredDuringSchedulingIgnoredDuringExecutionModel.Builder": ...

        @overload
        def pod_affinity_term(
            self, value_or_callback: Never = ...
        ) -> "PodAffinityTerm.BuilderContext": ...

        def pod_affinity_term(self, value_or_callback=None, /):
            """
            Required. A pod affinity term, associated with the corresponding weight.
            """
            if self._in_context and value_or_callback is None:
                context = PodAffinityTerm.BuilderContext()
                context._parent_builder = self
                context._field_name = "pod_affinity_term"
                return context

            value = value_or_callback
            if callable(value_or_callback):
                output = value_or_callback(PodAffinityTerm.builder())
                if isinstance(output, PodAffinityTerm.Builder):
                    value = output.build()
                else:
                    value = output
            return self._set("pod_affinity_term", value)

        def weight(self, value: int, /) -> Self:
            """
            weight associated with matching the corresponding podAffinityTerm,
            in the range 1-100.
            """
            return self._set("weight", value)

    class BuilderContext(
        BuilderContextBase["PreferredDuringSchedulingIgnoredDuringExecutionModel.Builder"]
    ):
        def model_post_init(self, __context) -> None:
            self._builder = PreferredDuringSchedulingIgnoredDuringExecutionModel.Builder()
            self._builder._in_context = True
            self._parent_builder = None
            self._field_name = None

    @classmethod
    def builder(cls) -> Builder:
        return cls.Builder()

    @classmethod
    def new(cls) -> BuilderContext:
        """Creates a new context manager builder for PreferredDuringSchedulingIgnoredDuringExecutionModel."""
        return cls.BuilderContext()

    class ListBuilder(
        GenericListBuilder["PreferredDuringSchedulingIgnoredDuringExecutionModel", Builder]
    ):
        def __init__(self):
            raise NotImplementedError(
                "This class is not meant to be instantiated. Use PreferredDuringSchedulingIgnoredDuringExecutionModel.list_builder() instead."
            )

    @classmethod
    def list_builder(cls) -> ListBuilder:
        return GenericListBuilder[cls, cls.Builder]()  # type: ignore

    pod_affinity_term: Annotated[PodAffinityTerm, Field(alias="podAffinityTerm")]
    """
    Required. A pod affinity term, associated with the corresponding weight.
    """
    weight: int
    """
    weight associated with matching the corresponding podAffinityTerm,
    in the range 1-100.
    """


class RequiredDuringSchedulingIgnoredDuringExecutionModel(BaseModel):
    class Builder(BaseModelBuilder):
        @property
        def cls(self) -> Type["RequiredDuringSchedulingIgnoredDuringExecutionModel"]:
            return RequiredDuringSchedulingIgnoredDuringExecutionModel

        def build(self) -> "RequiredDuringSchedulingIgnoredDuringExecutionModel":
            return RequiredDuringSchedulingIgnoredDuringExecutionModel(**self._attrs)

        @overload
        def label_selector(
            self, value_or_callback: Optional[LabelSelector], /
        ) -> "RequiredDuringSchedulingIgnoredDuringExecutionModel.Builder": ...

        @overload
        def label_selector(
            self,
            value_or_callback: Callable[
                [LabelSelector.Builder], LabelSelector.Builder | LabelSelector
            ],
            /,
        ) -> "RequiredDuringSchedulingIgnoredDuringExecutionModel.Builder": ...

        @overload
        def label_selector(
            self, value_or_callback: Never = ...
        ) -> "LabelSelector.BuilderContext": ...

        def label_selector(self, value_or_callback=None, /):
            """
            A label query over a set of resources, in this case pods.
            If it's null, this PodAffinityTerm matches with no Pods.
            """
            if self._in_context and value_or_callback is None:
                context = LabelSelector.BuilderContext()
                context._parent_builder = self
                context._field_name = "label_selector"
                return context

            value = value_or_callback
            if callable(value_or_callback):
                output = value_or_callback(LabelSelector.builder())
                if isinstance(output, LabelSelector.Builder):
                    value = output.build()
                else:
                    value = output
            return self._set("label_selector", value)

        def match_label_keys(self, value: Optional[List[str]], /) -> Self:
            """
            MatchLabelKeys is a set of pod label keys to select which pods will
            be taken into consideration. The keys are used to lookup values from the
            incoming pod labels, those key-value labels are merged with `labelSelector` as `key in (value)`
            to select the group of existing pods which pods will be taken into consideration
            for the incoming pod's pod (anti) affinity. Keys that don't exist in the incoming
            pod labels will be ignored. The default value is empty.
            The same key is forbidden to exist in both matchLabelKeys and labelSelector.
            Also, matchLabelKeys cannot be set when labelSelector isn't set.
            This is a beta field and requires enabling MatchLabelKeysInPodAffinity feature gate (enabled by default).
            """
            return self._set("match_label_keys", value)

        def mismatch_label_keys(self, value: Optional[List[str]], /) -> Self:
            """
            MismatchLabelKeys is a set of pod label keys to select which pods will
            be taken into consideration. The keys are used to lookup values from the
            incoming pod labels, those key-value labels are merged with `labelSelector` as `key notin (value)`
            to select the group of existing pods which pods will be taken into consideration
            for the incoming pod's pod (anti) affinity. Keys that don't exist in the incoming
            pod labels will be ignored. The default value is empty.
            The same key is forbidden to exist in both mismatchLabelKeys and labelSelector.
            Also, mismatchLabelKeys cannot be set when labelSelector isn't set.
            This is a beta field and requires enabling MatchLabelKeysInPodAffinity feature gate (enabled by default).
            """
            return self._set("mismatch_label_keys", value)

        @overload
        def namespace_selector(
            self, value_or_callback: Optional[NamespaceSelector], /
        ) -> "RequiredDuringSchedulingIgnoredDuringExecutionModel.Builder": ...

        @overload
        def namespace_selector(
            self,
            value_or_callback: Callable[
                [NamespaceSelector.Builder],
                NamespaceSelector.Builder | NamespaceSelector,
            ],
            /,
        ) -> "RequiredDuringSchedulingIgnoredDuringExecutionModel.Builder": ...

        @overload
        def namespace_selector(
            self, value_or_callback: Never = ...
        ) -> "NamespaceSelector.BuilderContext": ...

        def namespace_selector(self, value_or_callback=None, /):
            """
            A label query over the set of namespaces that the term applies to.
            The term is applied to the union of the namespaces selected by this field
            and the ones listed in the namespaces field.
            null selector and null or empty namespaces list means "this pod's namespace".
            An empty selector ({}) matches all namespaces.
            """
            if self._in_context and value_or_callback is None:
                context = NamespaceSelector.BuilderContext()
                context._parent_builder = self
                context._field_name = "namespace_selector"
                return context

            value = value_or_callback
            if callable(value_or_callback):
                output = value_or_callback(NamespaceSelector.builder())
                if isinstance(output, NamespaceSelector.Builder):
                    value = output.build()
                else:
                    value = output
            return self._set("namespace_selector", value)

        def namespaces(self, value: Optional[List[str]], /) -> Self:
            """
            namespaces specifies a static list of namespace names that the term applies to.
            The term is applied to the union of the namespaces listed in this field
            and the ones selected by namespaceSelector.
            null or empty namespaces list and null namespaceSelector means "this pod's namespace".
            """
            return self._set("namespaces", value)

        def topology_key(self, value: str, /) -> Self:
            """
            This pod should be co-located (affinity) or not co-located (anti-affinity) with the pods matching
            the labelSelector in the specified namespaces, where co-located is defined as running on a node
            whose value of the label with key topologyKey matches that of any node on which any of the
            selected pods is running.
            Empty topologyKey is not allowed.
            """
            return self._set("topology_key", value)

    class BuilderContext(
        BuilderContextBase["RequiredDuringSchedulingIgnoredDuringExecutionModel.Builder"]
    ):
        def model_post_init(self, __context) -> None:
            self._builder = RequiredDuringSchedulingIgnoredDuringExecutionModel.Builder()
            self._builder._in_context = True
            self._parent_builder = None
            self._field_name = None

    @classmethod
    def builder(cls) -> Builder:
        return cls.Builder()

    @classmethod
    def new(cls) -> BuilderContext:
        """Creates a new context manager builder for RequiredDuringSchedulingIgnoredDuringExecutionModel."""
        return cls.BuilderContext()

    class ListBuilder(
        GenericListBuilder["RequiredDuringSchedulingIgnoredDuringExecutionModel", Builder]
    ):
        def __init__(self):
            raise NotImplementedError(
                "This class is not meant to be instantiated. Use RequiredDuringSchedulingIgnoredDuringExecutionModel.list_builder() instead."
            )

    @classmethod
    def list_builder(cls) -> ListBuilder:
        return GenericListBuilder[cls, cls.Builder]()  # type: ignore

    label_selector: Annotated[Optional[LabelSelector], Field(alias="labelSelector")] = None
    """
    A label query over a set of resources, in this case pods.
    If it's null, this PodAffinityTerm matches with no Pods.
    """
    match_label_keys: Annotated[Optional[List[str]], Field(alias="matchLabelKeys")] = None
    """
    MatchLabelKeys is a set of pod label keys to select which pods will
    be taken into consideration. The keys are used to lookup values from the
    incoming pod labels, those key-value labels are merged with `labelSelector` as `key in (value)`
    to select the group of existing pods which pods will be taken into consideration
    for the incoming pod's pod (anti) affinity. Keys that don't exist in the incoming
    pod labels will be ignored. The default value is empty.
    The same key is forbidden to exist in both matchLabelKeys and labelSelector.
    Also, matchLabelKeys cannot be set when labelSelector isn't set.
    This is a beta field and requires enabling MatchLabelKeysInPodAffinity feature gate (enabled by default).
    """
    mismatch_label_keys: Annotated[Optional[List[str]], Field(alias="mismatchLabelKeys")] = None
    """
    MismatchLabelKeys is a set of pod label keys to select which pods will
    be taken into consideration. The keys are used to lookup values from the
    incoming pod labels, those key-value labels are merged with `labelSelector` as `key notin (value)`
    to select the group of existing pods which pods will be taken into consideration
    for the incoming pod's pod (anti) affinity. Keys that don't exist in the incoming
    pod labels will be ignored. The default value is empty.
    The same key is forbidden to exist in both mismatchLabelKeys and labelSelector.
    Also, mismatchLabelKeys cannot be set when labelSelector isn't set.
    This is a beta field and requires enabling MatchLabelKeysInPodAffinity feature gate (enabled by default).
    """
    namespace_selector: Annotated[Optional[NamespaceSelector], Field(alias="namespaceSelector")] = (
        None
    )
    """
    A label query over the set of namespaces that the term applies to.
    The term is applied to the union of the namespaces selected by this field
    and the ones listed in the namespaces field.
    null selector and null or empty namespaces list means "this pod's namespace".
    An empty selector ({}) matches all namespaces.
    """
    namespaces: Optional[List[str]] = None
    """
    namespaces specifies a static list of namespace names that the term applies to.
    The term is applied to the union of the namespaces listed in this field
    and the ones selected by namespaceSelector.
    null or empty namespaces list and null namespaceSelector means "this pod's namespace".
    """
    topology_key: Annotated[str, Field(alias="topologyKey")]
    """
    This pod should be co-located (affinity) or not co-located (anti-affinity) with the pods matching
    the labelSelector in the specified namespaces, where co-located is defined as running on a node
    whose value of the label with key topologyKey matches that of any node on which any of the
    selected pods is running.
    Empty topologyKey is not allowed.
    """


class PodAffinity(BaseModel):
    class Builder(BaseModelBuilder):
        @property
        def cls(self) -> Type["PodAffinity"]:
            return PodAffinity

        def build(self) -> "PodAffinity":
            return PodAffinity(**self._attrs)

        @overload
        def preferred_during_scheduling_ignored_during_execution(
            self,
            value_or_callback: List[PreferredDuringSchedulingIgnoredDuringExecutionModel],
            /,
        ) -> "PodAffinity.Builder": ...

        @overload
        def preferred_during_scheduling_ignored_during_execution(
            self,
            value_or_callback: Callable[
                [
                    GenericListBuilder[
                        PreferredDuringSchedulingIgnoredDuringExecutionModel,
                        PreferredDuringSchedulingIgnoredDuringExecutionModel.Builder,
                    ]
                ],
                GenericListBuilder[
                    PreferredDuringSchedulingIgnoredDuringExecutionModel,
                    PreferredDuringSchedulingIgnoredDuringExecutionModel.Builder,
                ]
                | List[PreferredDuringSchedulingIgnoredDuringExecutionModel],
            ],
            /,
        ) -> "PodAffinity.Builder": ...

        @overload
        def preferred_during_scheduling_ignored_during_execution(
            self, value_or_callback: Never = ...
        ) -> ListBuilderContext[PreferredDuringSchedulingIgnoredDuringExecutionModel.Builder]: ...

        def preferred_during_scheduling_ignored_during_execution(self, value_or_callback=None, /):
            """
            The scheduler will prefer to schedule pods to nodes that satisfy
            the affinity expressions specified by this field, but it may choose
            a node that violates one or more of the expressions. The node that is
            most preferred is the one with the greatest sum of weights, i.e.
            for each node that meets all of the scheduling requirements (resource
            request, requiredDuringScheduling affinity expressions, etc.),
            compute a sum by iterating through the elements of this field and adding
            "weight" to the sum if the node has pods which matches the corresponding podAffinityTerm; the
            node(s) with the highest sum are the most preferred.
            """
            if self._in_context and value_or_callback is None:
                context = ListBuilderContext[
                    PreferredDuringSchedulingIgnoredDuringExecutionModel.Builder
                ]()
                context._parent_builder = self
                context._field_name = "preferred_during_scheduling_ignored_during_execution"
                return context

            value = value_or_callback
            if callable(value_or_callback):
                output = value_or_callback(
                    PreferredDuringSchedulingIgnoredDuringExecutionModel.list_builder()
                )
                if isinstance(output, GenericListBuilder):
                    value = output.build()
                else:
                    value = output
            return self._set("preferred_during_scheduling_ignored_during_execution", value)

        @overload
        def required_during_scheduling_ignored_during_execution(
            self,
            value_or_callback: List[RequiredDuringSchedulingIgnoredDuringExecutionModel],
            /,
        ) -> "PodAffinity.Builder": ...

        @overload
        def required_during_scheduling_ignored_during_execution(
            self,
            value_or_callback: Callable[
                [
                    GenericListBuilder[
                        RequiredDuringSchedulingIgnoredDuringExecutionModel,
                        RequiredDuringSchedulingIgnoredDuringExecutionModel.Builder,
                    ]
                ],
                GenericListBuilder[
                    RequiredDuringSchedulingIgnoredDuringExecutionModel,
                    RequiredDuringSchedulingIgnoredDuringExecutionModel.Builder,
                ]
                | List[RequiredDuringSchedulingIgnoredDuringExecutionModel],
            ],
            /,
        ) -> "PodAffinity.Builder": ...

        @overload
        def required_during_scheduling_ignored_during_execution(
            self, value_or_callback: Never = ...
        ) -> ListBuilderContext[RequiredDuringSchedulingIgnoredDuringExecutionModel.Builder]: ...

        def required_during_scheduling_ignored_during_execution(self, value_or_callback=None, /):
            """
            If the affinity requirements specified by this field are not met at
            scheduling time, the pod will not be scheduled onto the node.
            If the affinity requirements specified by this field cease to be met
            at some point during pod execution (e.g. due to a pod label update), the
            system may or may not try to eventually evict the pod from its node.
            When there are multiple elements, the lists of nodes corresponding to each
            podAffinityTerm are intersected, i.e. all terms must be satisfied.
            """
            if self._in_context and value_or_callback is None:
                context = ListBuilderContext[
                    RequiredDuringSchedulingIgnoredDuringExecutionModel.Builder
                ]()
                context._parent_builder = self
                context._field_name = "required_during_scheduling_ignored_during_execution"
                return context

            value = value_or_callback
            if callable(value_or_callback):
                output = value_or_callback(
                    RequiredDuringSchedulingIgnoredDuringExecutionModel.list_builder()
                )
                if isinstance(output, GenericListBuilder):
                    value = output.build()
                else:
                    value = output
            return self._set("required_during_scheduling_ignored_during_execution", value)

    class BuilderContext(BuilderContextBase["PodAffinity.Builder"]):
        def model_post_init(self, __context) -> None:
            self._builder = PodAffinity.Builder()
            self._builder._in_context = True
            self._parent_builder = None
            self._field_name = None

    @classmethod
    def builder(cls) -> Builder:
        return cls.Builder()

    @classmethod
    def new(cls) -> BuilderContext:
        """Creates a new context manager builder for PodAffinity."""
        return cls.BuilderContext()

    class ListBuilder(GenericListBuilder["PodAffinity", Builder]):
        def __init__(self):
            raise NotImplementedError(
                "This class is not meant to be instantiated. Use PodAffinity.list_builder() instead."
            )

    @classmethod
    def list_builder(cls) -> ListBuilder:
        return GenericListBuilder[cls, cls.Builder]()  # type: ignore

    preferred_during_scheduling_ignored_during_execution: Annotated[
        Optional[List[PreferredDuringSchedulingIgnoredDuringExecutionModel]],
        Field(alias="preferredDuringSchedulingIgnoredDuringExecution"),
    ] = None
    """
    The scheduler will prefer to schedule pods to nodes that satisfy
    the affinity expressions specified by this field, but it may choose
    a node that violates one or more of the expressions. The node that is
    most preferred is the one with the greatest sum of weights, i.e.
    for each node that meets all of the scheduling requirements (resource
    request, requiredDuringScheduling affinity expressions, etc.),
    compute a sum by iterating through the elements of this field and adding
    "weight" to the sum if the node has pods which matches the corresponding podAffinityTerm; the
    node(s) with the highest sum are the most preferred.
    """
    required_during_scheduling_ignored_during_execution: Annotated[
        Optional[List[RequiredDuringSchedulingIgnoredDuringExecutionModel]],
        Field(alias="requiredDuringSchedulingIgnoredDuringExecution"),
    ] = None
    """
    If the affinity requirements specified by this field are not met at
    scheduling time, the pod will not be scheduled onto the node.
    If the affinity requirements specified by this field cease to be met
    at some point during pod execution (e.g. due to a pod label update), the
    system may or may not try to eventually evict the pod from its node.
    When there are multiple elements, the lists of nodes corresponding to each
    podAffinityTerm are intersected, i.e. all terms must be satisfied.
    """


class PodAntiAffinity(BaseModel):
    class Builder(BaseModelBuilder):
        @property
        def cls(self) -> Type["PodAntiAffinity"]:
            return PodAntiAffinity

        def build(self) -> "PodAntiAffinity":
            return PodAntiAffinity(**self._attrs)

        @overload
        def preferred_during_scheduling_ignored_during_execution(
            self,
            value_or_callback: List[PreferredDuringSchedulingIgnoredDuringExecutionModel],
            /,
        ) -> "PodAntiAffinity.Builder": ...

        @overload
        def preferred_during_scheduling_ignored_during_execution(
            self,
            value_or_callback: Callable[
                [
                    GenericListBuilder[
                        PreferredDuringSchedulingIgnoredDuringExecutionModel,
                        PreferredDuringSchedulingIgnoredDuringExecutionModel.Builder,
                    ]
                ],
                GenericListBuilder[
                    PreferredDuringSchedulingIgnoredDuringExecutionModel,
                    PreferredDuringSchedulingIgnoredDuringExecutionModel.Builder,
                ]
                | List[PreferredDuringSchedulingIgnoredDuringExecutionModel],
            ],
            /,
        ) -> "PodAntiAffinity.Builder": ...

        @overload
        def preferred_during_scheduling_ignored_during_execution(
            self, value_or_callback: Never = ...
        ) -> ListBuilderContext[PreferredDuringSchedulingIgnoredDuringExecutionModel.Builder]: ...

        def preferred_during_scheduling_ignored_during_execution(self, value_or_callback=None, /):
            """
            The scheduler will prefer to schedule pods to nodes that satisfy
            the anti-affinity expressions specified by this field, but it may choose
            a node that violates one or more of the expressions. The node that is
            most preferred is the one with the greatest sum of weights, i.e.
            for each node that meets all of the scheduling requirements (resource
            request, requiredDuringScheduling anti-affinity expressions, etc.),
            compute a sum by iterating through the elements of this field and adding
            "weight" to the sum if the node has pods which matches the corresponding podAffinityTerm; the
            node(s) with the highest sum are the most preferred.
            """
            if self._in_context and value_or_callback is None:
                context = ListBuilderContext[
                    PreferredDuringSchedulingIgnoredDuringExecutionModel.Builder
                ]()
                context._parent_builder = self
                context._field_name = "preferred_during_scheduling_ignored_during_execution"
                return context

            value = value_or_callback
            if callable(value_or_callback):
                output = value_or_callback(
                    PreferredDuringSchedulingIgnoredDuringExecutionModel.list_builder()
                )
                if isinstance(output, GenericListBuilder):
                    value = output.build()
                else:
                    value = output
            return self._set("preferred_during_scheduling_ignored_during_execution", value)

        @overload
        def required_during_scheduling_ignored_during_execution(
            self,
            value_or_callback: List[RequiredDuringSchedulingIgnoredDuringExecutionModel],
            /,
        ) -> "PodAntiAffinity.Builder": ...

        @overload
        def required_during_scheduling_ignored_during_execution(
            self,
            value_or_callback: Callable[
                [
                    GenericListBuilder[
                        RequiredDuringSchedulingIgnoredDuringExecutionModel,
                        RequiredDuringSchedulingIgnoredDuringExecutionModel.Builder,
                    ]
                ],
                GenericListBuilder[
                    RequiredDuringSchedulingIgnoredDuringExecutionModel,
                    RequiredDuringSchedulingIgnoredDuringExecutionModel.Builder,
                ]
                | List[RequiredDuringSchedulingIgnoredDuringExecutionModel],
            ],
            /,
        ) -> "PodAntiAffinity.Builder": ...

        @overload
        def required_during_scheduling_ignored_during_execution(
            self, value_or_callback: Never = ...
        ) -> ListBuilderContext[RequiredDuringSchedulingIgnoredDuringExecutionModel.Builder]: ...

        def required_during_scheduling_ignored_during_execution(self, value_or_callback=None, /):
            """
            If the anti-affinity requirements specified by this field are not met at
            scheduling time, the pod will not be scheduled onto the node.
            If the anti-affinity requirements specified by this field cease to be met
            at some point during pod execution (e.g. due to a pod label update), the
            system may or may not try to eventually evict the pod from its node.
            When there are multiple elements, the lists of nodes corresponding to each
            podAffinityTerm are intersected, i.e. all terms must be satisfied.
            """
            if self._in_context and value_or_callback is None:
                context = ListBuilderContext[
                    RequiredDuringSchedulingIgnoredDuringExecutionModel.Builder
                ]()
                context._parent_builder = self
                context._field_name = "required_during_scheduling_ignored_during_execution"
                return context

            value = value_or_callback
            if callable(value_or_callback):
                output = value_or_callback(
                    RequiredDuringSchedulingIgnoredDuringExecutionModel.list_builder()
                )
                if isinstance(output, GenericListBuilder):
                    value = output.build()
                else:
                    value = output
            return self._set("required_during_scheduling_ignored_during_execution", value)

    class BuilderContext(BuilderContextBase["PodAntiAffinity.Builder"]):
        def model_post_init(self, __context) -> None:
            self._builder = PodAntiAffinity.Builder()
            self._builder._in_context = True
            self._parent_builder = None
            self._field_name = None

    @classmethod
    def builder(cls) -> Builder:
        return cls.Builder()

    @classmethod
    def new(cls) -> BuilderContext:
        """Creates a new context manager builder for PodAntiAffinity."""
        return cls.BuilderContext()

    class ListBuilder(GenericListBuilder["PodAntiAffinity", Builder]):
        def __init__(self):
            raise NotImplementedError(
                "This class is not meant to be instantiated. Use PodAntiAffinity.list_builder() instead."
            )

    @classmethod
    def list_builder(cls) -> ListBuilder:
        return GenericListBuilder[cls, cls.Builder]()  # type: ignore

    preferred_during_scheduling_ignored_during_execution: Annotated[
        Optional[List[PreferredDuringSchedulingIgnoredDuringExecutionModel]],
        Field(alias="preferredDuringSchedulingIgnoredDuringExecution"),
    ] = None
    """
    The scheduler will prefer to schedule pods to nodes that satisfy
    the anti-affinity expressions specified by this field, but it may choose
    a node that violates one or more of the expressions. The node that is
    most preferred is the one with the greatest sum of weights, i.e.
    for each node that meets all of the scheduling requirements (resource
    request, requiredDuringScheduling anti-affinity expressions, etc.),
    compute a sum by iterating through the elements of this field and adding
    "weight" to the sum if the node has pods which matches the corresponding podAffinityTerm; the
    node(s) with the highest sum are the most preferred.
    """
    required_during_scheduling_ignored_during_execution: Annotated[
        Optional[List[RequiredDuringSchedulingIgnoredDuringExecutionModel]],
        Field(alias="requiredDuringSchedulingIgnoredDuringExecution"),
    ] = None
    """
    If the anti-affinity requirements specified by this field are not met at
    scheduling time, the pod will not be scheduled onto the node.
    If the anti-affinity requirements specified by this field cease to be met
    at some point during pod execution (e.g. due to a pod label update), the
    system may or may not try to eventually evict the pod from its node.
    When there are multiple elements, the lists of nodes corresponding to each
    podAffinityTerm are intersected, i.e. all terms must be satisfied.
    """


class Affinity(BaseModel):
    class Builder(BaseModelBuilder):
        @property
        def cls(self) -> Type["Affinity"]:
            return Affinity

        def build(self) -> "Affinity":
            return Affinity(**self._attrs)

        @overload
        def node_affinity(
            self, value_or_callback: Optional[NodeAffinity], /
        ) -> "Affinity.Builder": ...

        @overload
        def node_affinity(
            self,
            value_or_callback: Callable[
                [NodeAffinity.Builder], NodeAffinity.Builder | NodeAffinity
            ],
            /,
        ) -> "Affinity.Builder": ...

        @overload
        def node_affinity(
            self, value_or_callback: Never = ...
        ) -> "NodeAffinity.BuilderContext": ...

        def node_affinity(self, value_or_callback=None, /):
            """
            Describes node affinity scheduling rules for the pod.
            """
            if self._in_context and value_or_callback is None:
                context = NodeAffinity.BuilderContext()
                context._parent_builder = self
                context._field_name = "node_affinity"
                return context

            value = value_or_callback
            if callable(value_or_callback):
                output = value_or_callback(NodeAffinity.builder())
                if isinstance(output, NodeAffinity.Builder):
                    value = output.build()
                else:
                    value = output
            return self._set("node_affinity", value)

        @overload
        def pod_affinity(
            self, value_or_callback: Optional[PodAffinity], /
        ) -> "Affinity.Builder": ...

        @overload
        def pod_affinity(
            self,
            value_or_callback: Callable[[PodAffinity.Builder], PodAffinity.Builder | PodAffinity],
            /,
        ) -> "Affinity.Builder": ...

        @overload
        def pod_affinity(self, value_or_callback: Never = ...) -> "PodAffinity.BuilderContext": ...

        def pod_affinity(self, value_or_callback=None, /):
            """
            Describes pod affinity scheduling rules (e.g. co-locate this pod in the same node, zone, etc. as some other pod(s)).
            """
            if self._in_context and value_or_callback is None:
                context = PodAffinity.BuilderContext()
                context._parent_builder = self
                context._field_name = "pod_affinity"
                return context

            value = value_or_callback
            if callable(value_or_callback):
                output = value_or_callback(PodAffinity.builder())
                if isinstance(output, PodAffinity.Builder):
                    value = output.build()
                else:
                    value = output
            return self._set("pod_affinity", value)

        @overload
        def pod_anti_affinity(
            self, value_or_callback: Optional[PodAntiAffinity], /
        ) -> "Affinity.Builder": ...

        @overload
        def pod_anti_affinity(
            self,
            value_or_callback: Callable[
                [PodAntiAffinity.Builder], PodAntiAffinity.Builder | PodAntiAffinity
            ],
            /,
        ) -> "Affinity.Builder": ...

        @overload
        def pod_anti_affinity(
            self, value_or_callback: Never = ...
        ) -> "PodAntiAffinity.BuilderContext": ...

        def pod_anti_affinity(self, value_or_callback=None, /):
            """
            Describes pod anti-affinity scheduling rules (e.g. avoid putting this pod in the same node, zone, etc. as some other pod(s)).
            """
            if self._in_context and value_or_callback is None:
                context = PodAntiAffinity.BuilderContext()
                context._parent_builder = self
                context._field_name = "pod_anti_affinity"
                return context

            value = value_or_callback
            if callable(value_or_callback):
                output = value_or_callback(PodAntiAffinity.builder())
                if isinstance(output, PodAntiAffinity.Builder):
                    value = output.build()
                else:
                    value = output
            return self._set("pod_anti_affinity", value)

    class BuilderContext(BuilderContextBase["Affinity.Builder"]):
        def model_post_init(self, __context) -> None:
            self._builder = Affinity.Builder()
            self._builder._in_context = True
            self._parent_builder = None
            self._field_name = None

    @classmethod
    def builder(cls) -> Builder:
        return cls.Builder()

    @classmethod
    def new(cls) -> BuilderContext:
        """Creates a new context manager builder for Affinity."""
        return cls.BuilderContext()

    class ListBuilder(GenericListBuilder["Affinity", Builder]):
        def __init__(self):
            raise NotImplementedError(
                "This class is not meant to be instantiated. Use Affinity.list_builder() instead."
            )

    @classmethod
    def list_builder(cls) -> ListBuilder:
        return GenericListBuilder[cls, cls.Builder]()  # type: ignore

    node_affinity: Annotated[Optional[NodeAffinity], Field(alias="nodeAffinity")] = None
    """
    Describes node affinity scheduling rules for the pod.
    """
    pod_affinity: Annotated[Optional[PodAffinity], Field(alias="podAffinity")] = None
    """
    Describes pod affinity scheduling rules (e.g. co-locate this pod in the same node, zone, etc. as some other pod(s)).
    """
    pod_anti_affinity: Annotated[Optional[PodAntiAffinity], Field(alias="podAntiAffinity")] = None
    """
    Describes pod anti-affinity scheduling rules (e.g. avoid putting this pod in the same node, zone, etc. as some other pod(s)).
    """


class ImagePullSecret(BaseModel):
    class Builder(BaseModelBuilder):
        @property
        def cls(self) -> Type["ImagePullSecret"]:
            return ImagePullSecret

        def build(self) -> "ImagePullSecret":
            return ImagePullSecret(**self._attrs)

        def name(self, value: Optional[str], /) -> Self:
            """
            Name of the referent.
            This field is effectively required, but due to backwards compatibility is
            allowed to be empty. Instances of this type with an empty value here are
            almost certainly wrong.
            More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
            """
            return self._set("name", value)

    class BuilderContext(BuilderContextBase["ImagePullSecret.Builder"]):
        def model_post_init(self, __context) -> None:
            self._builder = ImagePullSecret.Builder()
            self._builder._in_context = True
            self._parent_builder = None
            self._field_name = None

    @classmethod
    def builder(cls) -> Builder:
        return cls.Builder()

    @classmethod
    def new(cls) -> BuilderContext:
        """Creates a new context manager builder for ImagePullSecret."""
        return cls.BuilderContext()

    class ListBuilder(GenericListBuilder["ImagePullSecret", Builder]):
        def __init__(self):
            raise NotImplementedError(
                "This class is not meant to be instantiated. Use ImagePullSecret.list_builder() instead."
            )

    @classmethod
    def list_builder(cls) -> ListBuilder:
        return GenericListBuilder[cls, cls.Builder]()  # type: ignore

    name: Optional[str] = ""
    """
    Name of the referent.
    This field is effectively required, but due to backwards compatibility is
    allowed to be empty. Instances of this type with an empty value here are
    almost certainly wrong.
    More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
    """


class SeLinuxOptions(BaseModel):
    class Builder(BaseModelBuilder):
        @property
        def cls(self) -> Type["SeLinuxOptions"]:
            return SeLinuxOptions

        def build(self) -> "SeLinuxOptions":
            return SeLinuxOptions(**self._attrs)

        def level(self, value: Optional[str], /) -> Self:
            """
            Level is SELinux level label that applies to the container.
            """
            return self._set("level", value)

        def role(self, value: Optional[str], /) -> Self:
            """
            Role is a SELinux role label that applies to the container.
            """
            return self._set("role", value)

        def type(self, value: Optional[str], /) -> Self:
            """
            Type is a SELinux type label that applies to the container.
            """
            return self._set("type", value)

        def user(self, value: Optional[str], /) -> Self:
            """
            User is a SELinux user label that applies to the container.
            """
            return self._set("user", value)

    class BuilderContext(BuilderContextBase["SeLinuxOptions.Builder"]):
        def model_post_init(self, __context) -> None:
            self._builder = SeLinuxOptions.Builder()
            self._builder._in_context = True
            self._parent_builder = None
            self._field_name = None

    @classmethod
    def builder(cls) -> Builder:
        return cls.Builder()

    @classmethod
    def new(cls) -> BuilderContext:
        """Creates a new context manager builder for SeLinuxOptions."""
        return cls.BuilderContext()

    class ListBuilder(GenericListBuilder["SeLinuxOptions", Builder]):
        def __init__(self):
            raise NotImplementedError(
                "This class is not meant to be instantiated. Use SeLinuxOptions.list_builder() instead."
            )

    @classmethod
    def list_builder(cls) -> ListBuilder:
        return GenericListBuilder[cls, cls.Builder]()  # type: ignore

    level: Optional[str] = None
    """
    Level is SELinux level label that applies to the container.
    """
    role: Optional[str] = None
    """
    Role is a SELinux role label that applies to the container.
    """
    type: Optional[str] = None
    """
    Type is a SELinux type label that applies to the container.
    """
    user: Optional[str] = None
    """
    User is a SELinux user label that applies to the container.
    """


class SeccompProfile(BaseModel):
    class Builder(BaseModelBuilder):
        @property
        def cls(self) -> Type["SeccompProfile"]:
            return SeccompProfile

        def build(self) -> "SeccompProfile":
            return SeccompProfile(**self._attrs)

        def localhost_profile(self, value: Optional[str], /) -> Self:
            """
            localhostProfile indicates a profile defined in a file on the node should be used.
            The profile must be preconfigured on the node to work.
            Must be a descending path, relative to the kubelet's configured seccomp profile location.
            Must be set if type is "Localhost". Must NOT be set for any other type.
            """
            return self._set("localhost_profile", value)

        def type(self, value: str, /) -> Self:
            """
            type indicates which kind of seccomp profile will be applied.
            Valid options are:

            Localhost - a profile defined in a file on the node should be used.
            RuntimeDefault - the container runtime default profile should be used.
            Unconfined - no profile should be applied.
            """
            return self._set("type", value)

    class BuilderContext(BuilderContextBase["SeccompProfile.Builder"]):
        def model_post_init(self, __context) -> None:
            self._builder = SeccompProfile.Builder()
            self._builder._in_context = True
            self._parent_builder = None
            self._field_name = None

    @classmethod
    def builder(cls) -> Builder:
        return cls.Builder()

    @classmethod
    def new(cls) -> BuilderContext:
        """Creates a new context manager builder for SeccompProfile."""
        return cls.BuilderContext()

    class ListBuilder(GenericListBuilder["SeccompProfile", Builder]):
        def __init__(self):
            raise NotImplementedError(
                "This class is not meant to be instantiated. Use SeccompProfile.list_builder() instead."
            )

    @classmethod
    def list_builder(cls) -> ListBuilder:
        return GenericListBuilder[cls, cls.Builder]()  # type: ignore

    localhost_profile: Annotated[Optional[str], Field(alias="localhostProfile")] = None
    """
    localhostProfile indicates a profile defined in a file on the node should be used.
    The profile must be preconfigured on the node to work.
    Must be a descending path, relative to the kubelet's configured seccomp profile location.
    Must be set if type is "Localhost". Must NOT be set for any other type.
    """
    type: str
    """
    type indicates which kind of seccomp profile will be applied.
    Valid options are:

    Localhost - a profile defined in a file on the node should be used.
    RuntimeDefault - the container runtime default profile should be used.
    Unconfined - no profile should be applied.
    """


class Sysctl(BaseModel):
    class Builder(BaseModelBuilder):
        @property
        def cls(self) -> Type["Sysctl"]:
            return Sysctl

        def build(self) -> "Sysctl":
            return Sysctl(**self._attrs)

        def name(self, value: str, /) -> Self:
            """
            Name of a property to set
            """
            return self._set("name", value)

        def value(self, value: str, /) -> Self:
            """
            Value of a property to set
            """
            return self._set("value", value)

    class BuilderContext(BuilderContextBase["Sysctl.Builder"]):
        def model_post_init(self, __context) -> None:
            self._builder = Sysctl.Builder()
            self._builder._in_context = True
            self._parent_builder = None
            self._field_name = None

    @classmethod
    def builder(cls) -> Builder:
        return cls.Builder()

    @classmethod
    def new(cls) -> BuilderContext:
        """Creates a new context manager builder for Sysctl."""
        return cls.BuilderContext()

    class ListBuilder(GenericListBuilder["Sysctl", Builder]):
        def __init__(self):
            raise NotImplementedError(
                "This class is not meant to be instantiated. Use Sysctl.list_builder() instead."
            )

    @classmethod
    def list_builder(cls) -> ListBuilder:
        return GenericListBuilder[cls, cls.Builder]()  # type: ignore

    name: str
    """
    Name of a property to set
    """
    value: str
    """
    Value of a property to set
    """


class SecurityContext(BaseModel):
    class Builder(BaseModelBuilder):
        @property
        def cls(self) -> Type["SecurityContext"]:
            return SecurityContext

        def build(self) -> "SecurityContext":
            return SecurityContext(**self._attrs)

        def fs_group(self, value: Optional[int], /) -> Self:
            """
            A special supplemental group that applies to all containers in a pod.
            Some volume types allow the Kubelet to change the ownership of that volume
            to be owned by the pod:

            1. The owning GID will be the FSGroup
            2. The setgid bit is set (new files created in the volume will be owned by FSGroup)
            3. The permission bits are OR'd with rw-rw----

            If unset, the Kubelet will not modify the ownership and permissions of any volume.
            Note that this field cannot be set when spec.os.name is windows.
            """
            return self._set("fs_group", value)

        def fs_group_change_policy(self, value: Optional[str], /) -> Self:
            """
            fsGroupChangePolicy defines behavior of changing ownership and permission of the volume
            before being exposed inside Pod. This field will only apply to
            volume types which support fsGroup based ownership(and permissions).
            It will have no effect on ephemeral volume types such as: secret, configmaps
            and emptydir.
            Valid values are "OnRootMismatch" and "Always". If not specified, "Always" is used.
            Note that this field cannot be set when spec.os.name is windows.
            """
            return self._set("fs_group_change_policy", value)

        def run_as_group(self, value: Optional[int], /) -> Self:
            """
            The GID to run the entrypoint of the container process.
            Uses runtime default if unset.
            May also be set in SecurityContext.  If set in both SecurityContext and
            PodSecurityContext, the value specified in SecurityContext takes precedence
            for that container.
            Note that this field cannot be set when spec.os.name is windows.
            """
            return self._set("run_as_group", value)

        def run_as_non_root(self, value: Optional[bool], /) -> Self:
            """
            Indicates that the container must run as a non-root user.
            If true, the Kubelet will validate the image at runtime to ensure that it
            does not run as UID 0 (root) and fail to start the container if it does.
            If unset or false, no such validation will be performed.
            May also be set in SecurityContext.  If set in both SecurityContext and
            PodSecurityContext, the value specified in SecurityContext takes precedence.
            """
            return self._set("run_as_non_root", value)

        def run_as_user(self, value: Optional[int], /) -> Self:
            """
            The UID to run the entrypoint of the container process.
            Defaults to user specified in image metadata if unspecified.
            May also be set in SecurityContext.  If set in both SecurityContext and
            PodSecurityContext, the value specified in SecurityContext takes precedence
            for that container.
            Note that this field cannot be set when spec.os.name is windows.
            """
            return self._set("run_as_user", value)

        @overload
        def se_linux_options(
            self, value_or_callback: Optional[SeLinuxOptions], /
        ) -> "SecurityContext.Builder": ...

        @overload
        def se_linux_options(
            self,
            value_or_callback: Callable[
                [SeLinuxOptions.Builder], SeLinuxOptions.Builder | SeLinuxOptions
            ],
            /,
        ) -> "SecurityContext.Builder": ...

        @overload
        def se_linux_options(
            self, value_or_callback: Never = ...
        ) -> "SeLinuxOptions.BuilderContext": ...

        def se_linux_options(self, value_or_callback=None, /):
            """
            The SELinux context to be applied to all containers.
            If unspecified, the container runtime will allocate a random SELinux context for each
            container.  May also be set in SecurityContext.  If set in
            both SecurityContext and PodSecurityContext, the value specified in SecurityContext
            takes precedence for that container.
            Note that this field cannot be set when spec.os.name is windows.
            """
            if self._in_context and value_or_callback is None:
                context = SeLinuxOptions.BuilderContext()
                context._parent_builder = self
                context._field_name = "se_linux_options"
                return context

            value = value_or_callback
            if callable(value_or_callback):
                output = value_or_callback(SeLinuxOptions.builder())
                if isinstance(output, SeLinuxOptions.Builder):
                    value = output.build()
                else:
                    value = output
            return self._set("se_linux_options", value)

        @overload
        def seccomp_profile(
            self, value_or_callback: Optional[SeccompProfile], /
        ) -> "SecurityContext.Builder": ...

        @overload
        def seccomp_profile(
            self,
            value_or_callback: Callable[
                [SeccompProfile.Builder], SeccompProfile.Builder | SeccompProfile
            ],
            /,
        ) -> "SecurityContext.Builder": ...

        @overload
        def seccomp_profile(
            self, value_or_callback: Never = ...
        ) -> "SeccompProfile.BuilderContext": ...

        def seccomp_profile(self, value_or_callback=None, /):
            """
            The seccomp options to use by the containers in this pod.
            Note that this field cannot be set when spec.os.name is windows.
            """
            if self._in_context and value_or_callback is None:
                context = SeccompProfile.BuilderContext()
                context._parent_builder = self
                context._field_name = "seccomp_profile"
                return context

            value = value_or_callback
            if callable(value_or_callback):
                output = value_or_callback(SeccompProfile.builder())
                if isinstance(output, SeccompProfile.Builder):
                    value = output.build()
                else:
                    value = output
            return self._set("seccomp_profile", value)

        def supplemental_groups(self, value: Optional[List[int]], /) -> Self:
            """
            A list of groups applied to the first process run in each container, in addition
            to the container's primary GID, the fsGroup (if specified), and group memberships
            defined in the container image for the uid of the container process. If unspecified,
            no additional groups are added to any container. Note that group memberships
            defined in the container image for the uid of the container process are still effective,
            even if they are not included in this list.
            Note that this field cannot be set when spec.os.name is windows.
            """
            return self._set("supplemental_groups", value)

        @overload
        def sysctls(self, value_or_callback: List[Sysctl], /) -> "SecurityContext.Builder": ...

        @overload
        def sysctls(
            self,
            value_or_callback: Callable[
                [GenericListBuilder[Sysctl, Sysctl.Builder]],
                GenericListBuilder[Sysctl, Sysctl.Builder] | List[Sysctl],
            ],
            /,
        ) -> "SecurityContext.Builder": ...

        @overload
        def sysctls(self, value_or_callback: Never = ...) -> ListBuilderContext[Sysctl.Builder]: ...

        def sysctls(self, value_or_callback=None, /):
            """
            Sysctls hold a list of namespaced sysctls used for the pod. Pods with unsupported
            sysctls (by the container runtime) might fail to launch.
            Note that this field cannot be set when spec.os.name is windows.
            """
            if self._in_context and value_or_callback is None:
                context = ListBuilderContext[Sysctl.Builder]()
                context._parent_builder = self
                context._field_name = "sysctls"
                return context

            value = value_or_callback
            if callable(value_or_callback):
                output = value_or_callback(Sysctl.list_builder())
                if isinstance(output, GenericListBuilder):
                    value = output.build()
                else:
                    value = output
            return self._set("sysctls", value)

    class BuilderContext(BuilderContextBase["SecurityContext.Builder"]):
        def model_post_init(self, __context) -> None:
            self._builder = SecurityContext.Builder()
            self._builder._in_context = True
            self._parent_builder = None
            self._field_name = None

    @classmethod
    def builder(cls) -> Builder:
        return cls.Builder()

    @classmethod
    def new(cls) -> BuilderContext:
        """Creates a new context manager builder for SecurityContext."""
        return cls.BuilderContext()

    class ListBuilder(GenericListBuilder["SecurityContext", Builder]):
        def __init__(self):
            raise NotImplementedError(
                "This class is not meant to be instantiated. Use SecurityContext.list_builder() instead."
            )

    @classmethod
    def list_builder(cls) -> ListBuilder:
        return GenericListBuilder[cls, cls.Builder]()  # type: ignore

    fs_group: Annotated[Optional[int], Field(alias="fsGroup")] = None
    """
    A special supplemental group that applies to all containers in a pod.
    Some volume types allow the Kubelet to change the ownership of that volume
    to be owned by the pod:

    1. The owning GID will be the FSGroup
    2. The setgid bit is set (new files created in the volume will be owned by FSGroup)
    3. The permission bits are OR'd with rw-rw----

    If unset, the Kubelet will not modify the ownership and permissions of any volume.
    Note that this field cannot be set when spec.os.name is windows.
    """
    fs_group_change_policy: Annotated[Optional[str], Field(alias="fsGroupChangePolicy")] = None
    """
    fsGroupChangePolicy defines behavior of changing ownership and permission of the volume
    before being exposed inside Pod. This field will only apply to
    volume types which support fsGroup based ownership(and permissions).
    It will have no effect on ephemeral volume types such as: secret, configmaps
    and emptydir.
    Valid values are "OnRootMismatch" and "Always". If not specified, "Always" is used.
    Note that this field cannot be set when spec.os.name is windows.
    """
    run_as_group: Annotated[Optional[int], Field(alias="runAsGroup")] = None
    """
    The GID to run the entrypoint of the container process.
    Uses runtime default if unset.
    May also be set in SecurityContext.  If set in both SecurityContext and
    PodSecurityContext, the value specified in SecurityContext takes precedence
    for that container.
    Note that this field cannot be set when spec.os.name is windows.
    """
    run_as_non_root: Annotated[Optional[bool], Field(alias="runAsNonRoot")] = None
    """
    Indicates that the container must run as a non-root user.
    If true, the Kubelet will validate the image at runtime to ensure that it
    does not run as UID 0 (root) and fail to start the container if it does.
    If unset or false, no such validation will be performed.
    May also be set in SecurityContext.  If set in both SecurityContext and
    PodSecurityContext, the value specified in SecurityContext takes precedence.
    """
    run_as_user: Annotated[Optional[int], Field(alias="runAsUser")] = None
    """
    The UID to run the entrypoint of the container process.
    Defaults to user specified in image metadata if unspecified.
    May also be set in SecurityContext.  If set in both SecurityContext and
    PodSecurityContext, the value specified in SecurityContext takes precedence
    for that container.
    Note that this field cannot be set when spec.os.name is windows.
    """
    se_linux_options: Annotated[Optional[SeLinuxOptions], Field(alias="seLinuxOptions")] = None
    """
    The SELinux context to be applied to all containers.
    If unspecified, the container runtime will allocate a random SELinux context for each
    container.  May also be set in SecurityContext.  If set in
    both SecurityContext and PodSecurityContext, the value specified in SecurityContext
    takes precedence for that container.
    Note that this field cannot be set when spec.os.name is windows.
    """
    seccomp_profile: Annotated[Optional[SeccompProfile], Field(alias="seccompProfile")] = None
    """
    The seccomp options to use by the containers in this pod.
    Note that this field cannot be set when spec.os.name is windows.
    """
    supplemental_groups: Annotated[Optional[List[int]], Field(alias="supplementalGroups")] = None
    """
    A list of groups applied to the first process run in each container, in addition
    to the container's primary GID, the fsGroup (if specified), and group memberships
    defined in the container image for the uid of the container process. If unspecified,
    no additional groups are added to any container. Note that group memberships
    defined in the container image for the uid of the container process are still effective,
    even if they are not included in this list.
    Note that this field cannot be set when spec.os.name is windows.
    """
    sysctls: Optional[List[Sysctl]] = None
    """
    Sysctls hold a list of namespaced sysctls used for the pod. Pods with unsupported
    sysctls (by the container runtime) might fail to launch.
    Note that this field cannot be set when spec.os.name is windows.
    """


class Toleration(BaseModel):
    class Builder(BaseModelBuilder):
        @property
        def cls(self) -> Type["Toleration"]:
            return Toleration

        def build(self) -> "Toleration":
            return Toleration(**self._attrs)

        def effect(self, value: Optional[str], /) -> Self:
            """
            Effect indicates the taint effect to match. Empty means match all taint effects.
            When specified, allowed values are NoSchedule, PreferNoSchedule and NoExecute.
            """
            return self._set("effect", value)

        def key(self, value: Optional[str], /) -> Self:
            """
            Key is the taint key that the toleration applies to. Empty means match all taint keys.
            If the key is empty, operator must be Exists; this combination means to match all values and all keys.
            """
            return self._set("key", value)

        def operator(self, value: Optional[str], /) -> Self:
            """
            Operator represents a key's relationship to the value.
            Valid operators are Exists and Equal. Defaults to Equal.
            Exists is equivalent to wildcard for value, so that a pod can
            tolerate all taints of a particular category.
            """
            return self._set("operator", value)

        def toleration_seconds(self, value: Optional[int], /) -> Self:
            """
            TolerationSeconds represents the period of time the toleration (which must be
            of effect NoExecute, otherwise this field is ignored) tolerates the taint. By default,
            it is not set, which means tolerate the taint forever (do not evict). Zero and
            negative values will be treated as 0 (evict immediately) by the system.
            """
            return self._set("toleration_seconds", value)

        def value(self, value: Optional[str], /) -> Self:
            """
            Value is the taint value the toleration matches to.
            If the operator is Exists, the value should be empty, otherwise just a regular string.
            """
            return self._set("value", value)

    class BuilderContext(BuilderContextBase["Toleration.Builder"]):
        def model_post_init(self, __context) -> None:
            self._builder = Toleration.Builder()
            self._builder._in_context = True
            self._parent_builder = None
            self._field_name = None

    @classmethod
    def builder(cls) -> Builder:
        return cls.Builder()

    @classmethod
    def new(cls) -> BuilderContext:
        """Creates a new context manager builder for Toleration."""
        return cls.BuilderContext()

    class ListBuilder(GenericListBuilder["Toleration", Builder]):
        def __init__(self):
            raise NotImplementedError(
                "This class is not meant to be instantiated. Use Toleration.list_builder() instead."
            )

    @classmethod
    def list_builder(cls) -> ListBuilder:
        return GenericListBuilder[cls, cls.Builder]()  # type: ignore

    effect: Optional[str] = None
    """
    Effect indicates the taint effect to match. Empty means match all taint effects.
    When specified, allowed values are NoSchedule, PreferNoSchedule and NoExecute.
    """
    key: Optional[str] = None
    """
    Key is the taint key that the toleration applies to. Empty means match all taint keys.
    If the key is empty, operator must be Exists; this combination means to match all values and all keys.
    """
    operator: Optional[str] = None
    """
    Operator represents a key's relationship to the value.
    Valid operators are Exists and Equal. Defaults to Equal.
    Exists is equivalent to wildcard for value, so that a pod can
    tolerate all taints of a particular category.
    """
    toleration_seconds: Annotated[Optional[int], Field(alias="tolerationSeconds")] = None
    """
    TolerationSeconds represents the period of time the toleration (which must be
    of effect NoExecute, otherwise this field is ignored) tolerates the taint. By default,
    it is not set, which means tolerate the taint forever (do not evict). Zero and
    negative values will be treated as 0 (evict immediately) by the system.
    """
    value: Optional[str] = None
    """
    Value is the taint value the toleration matches to.
    If the operator is Exists, the value should be empty, otherwise just a regular string.
    """


class Spec(BaseModel):
    class Builder(BaseModelBuilder):
        @property
        def cls(self) -> Type["Spec"]:
            return Spec

        def build(self) -> "Spec":
            return Spec(**self._attrs)

        @overload
        def affinity(self, value_or_callback: Optional[Affinity], /) -> "Spec.Builder": ...

        @overload
        def affinity(
            self,
            value_or_callback: Callable[[Affinity.Builder], Affinity.Builder | Affinity],
            /,
        ) -> "Spec.Builder": ...

        @overload
        def affinity(self, value_or_callback: Never = ...) -> "Affinity.BuilderContext": ...

        def affinity(self, value_or_callback=None, /):
            """
            If specified, the pod's scheduling constraints
            """
            if self._in_context and value_or_callback is None:
                context = Affinity.BuilderContext()
                context._parent_builder = self
                context._field_name = "affinity"
                return context

            value = value_or_callback
            if callable(value_or_callback):
                output = value_or_callback(Affinity.builder())
                if isinstance(output, Affinity.Builder):
                    value = output.build()
                else:
                    value = output
            return self._set("affinity", value)

        @overload
        def image_pull_secrets(
            self, value_or_callback: List[ImagePullSecret], /
        ) -> "Spec.Builder": ...

        @overload
        def image_pull_secrets(
            self,
            value_or_callback: Callable[
                [GenericListBuilder[ImagePullSecret, ImagePullSecret.Builder]],
                GenericListBuilder[ImagePullSecret, ImagePullSecret.Builder]
                | List[ImagePullSecret],
            ],
            /,
        ) -> "Spec.Builder": ...

        @overload
        def image_pull_secrets(
            self, value_or_callback: Never = ...
        ) -> ListBuilderContext[ImagePullSecret.Builder]: ...

        def image_pull_secrets(self, value_or_callback=None, /):
            """
            If specified, the pod's imagePullSecrets
            """
            if self._in_context and value_or_callback is None:
                context = ListBuilderContext[ImagePullSecret.Builder]()
                context._parent_builder = self
                context._field_name = "image_pull_secrets"
                return context

            value = value_or_callback
            if callable(value_or_callback):
                output = value_or_callback(ImagePullSecret.list_builder())
                if isinstance(output, GenericListBuilder):
                    value = output.build()
                else:
                    value = output
            return self._set("image_pull_secrets", value)

        def node_selector(self, value: Optional[Dict[str, str]], /) -> Self:
            """
            NodeSelector is a selector which must be true for the pod to fit on a node.
            Selector which must match a node's labels for the pod to be scheduled on that node.
            More info: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/
            """
            return self._set("node_selector", value)

        def priority_class_name(self, value: Optional[str], /) -> Self:
            """
            If specified, the pod's priorityClassName.
            """
            return self._set("priority_class_name", value)

        @overload
        def security_context(
            self, value_or_callback: Optional[SecurityContext], /
        ) -> "Spec.Builder": ...

        @overload
        def security_context(
            self,
            value_or_callback: Callable[
                [SecurityContext.Builder], SecurityContext.Builder | SecurityContext
            ],
            /,
        ) -> "Spec.Builder": ...

        @overload
        def security_context(
            self, value_or_callback: Never = ...
        ) -> "SecurityContext.BuilderContext": ...

        def security_context(self, value_or_callback=None, /):
            """
            If specified, the pod's security context
            """
            if self._in_context and value_or_callback is None:
                context = SecurityContext.BuilderContext()
                context._parent_builder = self
                context._field_name = "security_context"
                return context

            value = value_or_callback
            if callable(value_or_callback):
                output = value_or_callback(SecurityContext.builder())
                if isinstance(output, SecurityContext.Builder):
                    value = output.build()
                else:
                    value = output
            return self._set("security_context", value)

        def service_account_name(self, value: Optional[str], /) -> Self:
            """
            If specified, the pod's service account
            """
            return self._set("service_account_name", value)

        @overload
        def tolerations(self, value_or_callback: List[Toleration], /) -> "Spec.Builder": ...

        @overload
        def tolerations(
            self,
            value_or_callback: Callable[
                [GenericListBuilder[Toleration, Toleration.Builder]],
                GenericListBuilder[Toleration, Toleration.Builder] | List[Toleration],
            ],
            /,
        ) -> "Spec.Builder": ...

        @overload
        def tolerations(
            self, value_or_callback: Never = ...
        ) -> ListBuilderContext[Toleration.Builder]: ...

        def tolerations(self, value_or_callback=None, /):
            """
            If specified, the pod's tolerations.
            """
            if self._in_context and value_or_callback is None:
                context = ListBuilderContext[Toleration.Builder]()
                context._parent_builder = self
                context._field_name = "tolerations"
                return context

            value = value_or_callback
            if callable(value_or_callback):
                output = value_or_callback(Toleration.list_builder())
                if isinstance(output, GenericListBuilder):
                    value = output.build()
                else:
                    value = output
            return self._set("tolerations", value)

    class BuilderContext(BuilderContextBase["Spec.Builder"]):
        def model_post_init(self, __context) -> None:
            self._builder = Spec.Builder()
            self._builder._in_context = True
            self._parent_builder = None
            self._field_name = None

    @classmethod
    def builder(cls) -> Builder:
        return cls.Builder()

    @classmethod
    def new(cls) -> BuilderContext:
        """Creates a new context manager builder for Spec."""
        return cls.BuilderContext()

    class ListBuilder(GenericListBuilder["Spec", Builder]):
        def __init__(self):
            raise NotImplementedError(
                "This class is not meant to be instantiated. Use Spec.list_builder() instead."
            )

    @classmethod
    def list_builder(cls) -> ListBuilder:
        return GenericListBuilder[cls, cls.Builder]()  # type: ignore

    affinity: Optional[Affinity] = None
    """
    If specified, the pod's scheduling constraints
    """
    image_pull_secrets: Annotated[
        Optional[List[ImagePullSecret]], Field(alias="imagePullSecrets")
    ] = None
    """
    If specified, the pod's imagePullSecrets
    """
    node_selector: Annotated[Optional[Dict[str, str]], Field(alias="nodeSelector")] = None
    """
    NodeSelector is a selector which must be true for the pod to fit on a node.
    Selector which must match a node's labels for the pod to be scheduled on that node.
    More info: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/
    """
    priority_class_name: Annotated[Optional[str], Field(alias="priorityClassName")] = None
    """
    If specified, the pod's priorityClassName.
    """
    security_context: Annotated[Optional[SecurityContext], Field(alias="securityContext")] = None
    """
    If specified, the pod's security context
    """
    service_account_name: Annotated[Optional[str], Field(alias="serviceAccountName")] = None
    """
    If specified, the pod's service account
    """
    tolerations: Optional[List[Toleration]] = None
    """
    If specified, the pod's tolerations.
    """


class PodTemplate(BaseModel):
    class Builder(BaseModelBuilder):
        @property
        def cls(self) -> Type["PodTemplate"]:
            return PodTemplate

        def build(self) -> "PodTemplate":
            return PodTemplate(**self._attrs)

        @overload
        def metadata(self, value_or_callback: Optional[Metadata], /) -> "PodTemplate.Builder": ...

        @overload
        def metadata(
            self,
            value_or_callback: Callable[[Metadata.Builder], Metadata.Builder | Metadata],
            /,
        ) -> "PodTemplate.Builder": ...

        @overload
        def metadata(self, value_or_callback: Never = ...) -> "Metadata.BuilderContext": ...

        def metadata(self, value_or_callback=None, /):
            """
            ObjectMeta overrides for the pod used to solve HTTP01 challenges.
            Only the 'labels' and 'annotations' fields may be set.
            If labels or annotations overlap with in-built values, the values here
            will override the in-built values.
            """
            if self._in_context and value_or_callback is None:
                context = Metadata.BuilderContext()
                context._parent_builder = self
                context._field_name = "metadata"
                return context

            value = value_or_callback
            if callable(value_or_callback):
                output = value_or_callback(Metadata.builder())
                if isinstance(output, Metadata.Builder):
                    value = output.build()
                else:
                    value = output
            return self._set("metadata", value)

        @overload
        def spec(self, value_or_callback: Optional[Spec], /) -> "PodTemplate.Builder": ...

        @overload
        def spec(
            self, value_or_callback: Callable[[Spec.Builder], Spec.Builder | Spec], /
        ) -> "PodTemplate.Builder": ...

        @overload
        def spec(self, value_or_callback: Never = ...) -> "Spec.BuilderContext": ...

        def spec(self, value_or_callback=None, /):
            """
            PodSpec defines overrides for the HTTP01 challenge solver pod.
            Check ACMEChallengeSolverHTTP01IngressPodSpec to find out currently supported fields.
            All other fields will be ignored.
            """
            if self._in_context and value_or_callback is None:
                context = Spec.BuilderContext()
                context._parent_builder = self
                context._field_name = "spec"
                return context

            value = value_or_callback
            if callable(value_or_callback):
                output = value_or_callback(Spec.builder())
                if isinstance(output, Spec.Builder):
                    value = output.build()
                else:
                    value = output
            return self._set("spec", value)

    class BuilderContext(BuilderContextBase["PodTemplate.Builder"]):
        def model_post_init(self, __context) -> None:
            self._builder = PodTemplate.Builder()
            self._builder._in_context = True
            self._parent_builder = None
            self._field_name = None

    @classmethod
    def builder(cls) -> Builder:
        return cls.Builder()

    @classmethod
    def new(cls) -> BuilderContext:
        """Creates a new context manager builder for PodTemplate."""
        return cls.BuilderContext()

    class ListBuilder(GenericListBuilder["PodTemplate", Builder]):
        def __init__(self):
            raise NotImplementedError(
                "This class is not meant to be instantiated. Use PodTemplate.list_builder() instead."
            )

    @classmethod
    def list_builder(cls) -> ListBuilder:
        return GenericListBuilder[cls, cls.Builder]()  # type: ignore

    metadata: Optional[Metadata] = None
    """
    ObjectMeta overrides for the pod used to solve HTTP01 challenges.
    Only the 'labels' and 'annotations' fields may be set.
    If labels or annotations overlap with in-built values, the values here
    will override the in-built values.
    """
    spec: Optional[Spec] = None
    """
    PodSpec defines overrides for the HTTP01 challenge solver pod.
    Check ACMEChallengeSolverHTTP01IngressPodSpec to find out currently supported fields.
    All other fields will be ignored.
    """


class GatewayHttpRoute(BaseModel):
    class Builder(BaseModelBuilder):
        @property
        def cls(self) -> Type["GatewayHttpRoute"]:
            return GatewayHttpRoute

        def build(self) -> "GatewayHttpRoute":
            return GatewayHttpRoute(**self._attrs)

        def labels(self, value: Optional[Dict[str, str]], /) -> Self:
            """
            Custom labels that will be applied to HTTPRoutes created by cert-manager
            while solving HTTP-01 challenges.
            """
            return self._set("labels", value)

        @overload
        def parent_refs(
            self, value_or_callback: List[ParentRef], /
        ) -> "GatewayHttpRoute.Builder": ...

        @overload
        def parent_refs(
            self,
            value_or_callback: Callable[
                [GenericListBuilder[ParentRef, ParentRef.Builder]],
                GenericListBuilder[ParentRef, ParentRef.Builder] | List[ParentRef],
            ],
            /,
        ) -> "GatewayHttpRoute.Builder": ...

        @overload
        def parent_refs(
            self, value_or_callback: Never = ...
        ) -> ListBuilderContext[ParentRef.Builder]: ...

        def parent_refs(self, value_or_callback=None, /):
            """
            When solving an HTTP-01 challenge, cert-manager creates an HTTPRoute.
            cert-manager needs to know which parentRefs should be used when creating
            the HTTPRoute. Usually, the parentRef references a Gateway. See:
            https://gateway-api.sigs.k8s.io/api-types/httproute/#attaching-to-gateways
            """
            if self._in_context and value_or_callback is None:
                context = ListBuilderContext[ParentRef.Builder]()
                context._parent_builder = self
                context._field_name = "parent_refs"
                return context

            value = value_or_callback
            if callable(value_or_callback):
                output = value_or_callback(ParentRef.list_builder())
                if isinstance(output, GenericListBuilder):
                    value = output.build()
                else:
                    value = output
            return self._set("parent_refs", value)

        @overload
        def pod_template(
            self, value_or_callback: Optional[PodTemplate], /
        ) -> "GatewayHttpRoute.Builder": ...

        @overload
        def pod_template(
            self,
            value_or_callback: Callable[[PodTemplate.Builder], PodTemplate.Builder | PodTemplate],
            /,
        ) -> "GatewayHttpRoute.Builder": ...

        @overload
        def pod_template(self, value_or_callback: Never = ...) -> "PodTemplate.BuilderContext": ...

        def pod_template(self, value_or_callback=None, /):
            """
            Optional pod template used to configure the ACME challenge solver pods
            used for HTTP01 challenges.
            """
            if self._in_context and value_or_callback is None:
                context = PodTemplate.BuilderContext()
                context._parent_builder = self
                context._field_name = "pod_template"
                return context

            value = value_or_callback
            if callable(value_or_callback):
                output = value_or_callback(PodTemplate.builder())
                if isinstance(output, PodTemplate.Builder):
                    value = output.build()
                else:
                    value = output
            return self._set("pod_template", value)

        def service_type(self, value: Optional[str], /) -> Self:
            """
            Optional service type for Kubernetes solver service. Supported values
            are NodePort or ClusterIP. If unset, defaults to NodePort.
            """
            return self._set("service_type", value)

    class BuilderContext(BuilderContextBase["GatewayHttpRoute.Builder"]):
        def model_post_init(self, __context) -> None:
            self._builder = GatewayHttpRoute.Builder()
            self._builder._in_context = True
            self._parent_builder = None
            self._field_name = None

    @classmethod
    def builder(cls) -> Builder:
        return cls.Builder()

    @classmethod
    def new(cls) -> BuilderContext:
        """Creates a new context manager builder for GatewayHttpRoute."""
        return cls.BuilderContext()

    class ListBuilder(GenericListBuilder["GatewayHttpRoute", Builder]):
        def __init__(self):
            raise NotImplementedError(
                "This class is not meant to be instantiated. Use GatewayHttpRoute.list_builder() instead."
            )

    @classmethod
    def list_builder(cls) -> ListBuilder:
        return GenericListBuilder[cls, cls.Builder]()  # type: ignore

    labels: Optional[Dict[str, str]] = None
    """
    Custom labels that will be applied to HTTPRoutes created by cert-manager
    while solving HTTP-01 challenges.
    """
    parent_refs: Annotated[Optional[List[ParentRef]], Field(alias="parentRefs")] = None
    """
    When solving an HTTP-01 challenge, cert-manager creates an HTTPRoute.
    cert-manager needs to know which parentRefs should be used when creating
    the HTTPRoute. Usually, the parentRef references a Gateway. See:
    https://gateway-api.sigs.k8s.io/api-types/httproute/#attaching-to-gateways
    """
    pod_template: Annotated[Optional[PodTemplate], Field(alias="podTemplate")] = None
    """
    Optional pod template used to configure the ACME challenge solver pods
    used for HTTP01 challenges.
    """
    service_type: Annotated[Optional[str], Field(alias="serviceType")] = None
    """
    Optional service type for Kubernetes solver service. Supported values
    are NodePort or ClusterIP. If unset, defaults to NodePort.
    """


class MetadataModel(BaseModel):
    class Builder(BaseModelBuilder):
        @property
        def cls(self) -> Type["MetadataModel"]:
            return MetadataModel

        def build(self) -> "MetadataModel":
            return MetadataModel(**self._attrs)

        def annotations(self, value: Optional[Dict[str, str]], /) -> Self:
            """
            Annotations that should be added to the created ACME HTTP01 solver ingress.
            """
            return self._set("annotations", value)

        def labels(self, value: Optional[Dict[str, str]], /) -> Self:
            """
            Labels that should be added to the created ACME HTTP01 solver ingress.
            """
            return self._set("labels", value)

    class BuilderContext(BuilderContextBase["MetadataModel.Builder"]):
        def model_post_init(self, __context) -> None:
            self._builder = MetadataModel.Builder()
            self._builder._in_context = True
            self._parent_builder = None
            self._field_name = None

    @classmethod
    def builder(cls) -> Builder:
        return cls.Builder()

    @classmethod
    def new(cls) -> BuilderContext:
        """Creates a new context manager builder for MetadataModel."""
        return cls.BuilderContext()

    class ListBuilder(GenericListBuilder["MetadataModel", Builder]):
        def __init__(self):
            raise NotImplementedError(
                "This class is not meant to be instantiated. Use MetadataModel.list_builder() instead."
            )

    @classmethod
    def list_builder(cls) -> ListBuilder:
        return GenericListBuilder[cls, cls.Builder]()  # type: ignore

    annotations: Optional[Dict[str, str]] = None
    """
    Annotations that should be added to the created ACME HTTP01 solver ingress.
    """
    labels: Optional[Dict[str, str]] = None
    """
    Labels that should be added to the created ACME HTTP01 solver ingress.
    """


class IngressTemplate(BaseModel):
    class Builder(BaseModelBuilder):
        @property
        def cls(self) -> Type["IngressTemplate"]:
            return IngressTemplate

        def build(self) -> "IngressTemplate":
            return IngressTemplate(**self._attrs)

        @overload
        def metadata(
            self, value_or_callback: Optional[MetadataModel], /
        ) -> "IngressTemplate.Builder": ...

        @overload
        def metadata(
            self,
            value_or_callback: Callable[
                [MetadataModel.Builder], MetadataModel.Builder | MetadataModel
            ],
            /,
        ) -> "IngressTemplate.Builder": ...

        @overload
        def metadata(self, value_or_callback: Never = ...) -> "MetadataModel.BuilderContext": ...

        def metadata(self, value_or_callback=None, /):
            """
            ObjectMeta overrides for the ingress used to solve HTTP01 challenges.
            Only the 'labels' and 'annotations' fields may be set.
            If labels or annotations overlap with in-built values, the values here
            will override the in-built values.
            """
            if self._in_context and value_or_callback is None:
                context = MetadataModel.BuilderContext()
                context._parent_builder = self
                context._field_name = "metadata"
                return context

            value = value_or_callback
            if callable(value_or_callback):
                output = value_or_callback(MetadataModel.builder())
                if isinstance(output, MetadataModel.Builder):
                    value = output.build()
                else:
                    value = output
            return self._set("metadata", value)

    class BuilderContext(BuilderContextBase["IngressTemplate.Builder"]):
        def model_post_init(self, __context) -> None:
            self._builder = IngressTemplate.Builder()
            self._builder._in_context = True
            self._parent_builder = None
            self._field_name = None

    @classmethod
    def builder(cls) -> Builder:
        return cls.Builder()

    @classmethod
    def new(cls) -> BuilderContext:
        """Creates a new context manager builder for IngressTemplate."""
        return cls.BuilderContext()

    class ListBuilder(GenericListBuilder["IngressTemplate", Builder]):
        def __init__(self):
            raise NotImplementedError(
                "This class is not meant to be instantiated. Use IngressTemplate.list_builder() instead."
            )

    @classmethod
    def list_builder(cls) -> ListBuilder:
        return GenericListBuilder[cls, cls.Builder]()  # type: ignore

    metadata: Optional[MetadataModel] = None
    """
    ObjectMeta overrides for the ingress used to solve HTTP01 challenges.
    Only the 'labels' and 'annotations' fields may be set.
    If labels or annotations overlap with in-built values, the values here
    will override the in-built values.
    """


class MetadataModel1(BaseModel):
    class Builder(BaseModelBuilder):
        @property
        def cls(self) -> Type["MetadataModel1"]:
            return MetadataModel1

        def build(self) -> "MetadataModel1":
            return MetadataModel1(**self._attrs)

        def annotations(self, value: Optional[Dict[str, str]], /) -> Self:
            """
            Annotations that should be added to the created ACME HTTP01 solver pods.
            """
            return self._set("annotations", value)

        def labels(self, value: Optional[Dict[str, str]], /) -> Self:
            """
            Labels that should be added to the created ACME HTTP01 solver pods.
            """
            return self._set("labels", value)

    class BuilderContext(BuilderContextBase["MetadataModel1.Builder"]):
        def model_post_init(self, __context) -> None:
            self._builder = MetadataModel1.Builder()
            self._builder._in_context = True
            self._parent_builder = None
            self._field_name = None

    @classmethod
    def builder(cls) -> Builder:
        return cls.Builder()

    @classmethod
    def new(cls) -> BuilderContext:
        """Creates a new context manager builder for MetadataModel1."""
        return cls.BuilderContext()

    class ListBuilder(GenericListBuilder["MetadataModel1", Builder]):
        def __init__(self):
            raise NotImplementedError(
                "This class is not meant to be instantiated. Use MetadataModel1.list_builder() instead."
            )

    @classmethod
    def list_builder(cls) -> ListBuilder:
        return GenericListBuilder[cls, cls.Builder]()  # type: ignore

    annotations: Optional[Dict[str, str]] = None
    """
    Annotations that should be added to the created ACME HTTP01 solver pods.
    """
    labels: Optional[Dict[str, str]] = None
    """
    Labels that should be added to the created ACME HTTP01 solver pods.
    """


class MatchExpressionModel1(BaseModel):
    class Builder(BaseModelBuilder):
        @property
        def cls(self) -> Type["MatchExpressionModel1"]:
            return MatchExpressionModel1

        def build(self) -> "MatchExpressionModel1":
            return MatchExpressionModel1(**self._attrs)

        def key(self, value: str, /) -> Self:
            """
            The label key that the selector applies to.
            """
            return self._set("key", value)

        def operator(self, value: str, /) -> Self:
            """
            Represents a key's relationship to a set of values.
            Valid operators are In, NotIn, Exists, DoesNotExist. Gt, and Lt.
            """
            return self._set("operator", value)

        def values(self, value: Optional[List[str]], /) -> Self:
            """
            An array of string values. If the operator is In or NotIn,
            the values array must be non-empty. If the operator is Exists or DoesNotExist,
            the values array must be empty. If the operator is Gt or Lt, the values
            array must have a single element, which will be interpreted as an integer.
            This array is replaced during a strategic merge patch.
            """
            return self._set("values", value)

    class BuilderContext(BuilderContextBase["MatchExpressionModel1.Builder"]):
        def model_post_init(self, __context) -> None:
            self._builder = MatchExpressionModel1.Builder()
            self._builder._in_context = True
            self._parent_builder = None
            self._field_name = None

    @classmethod
    def builder(cls) -> Builder:
        return cls.Builder()

    @classmethod
    def new(cls) -> BuilderContext:
        """Creates a new context manager builder for MatchExpressionModel1."""
        return cls.BuilderContext()

    class ListBuilder(GenericListBuilder["MatchExpressionModel1", Builder]):
        def __init__(self):
            raise NotImplementedError(
                "This class is not meant to be instantiated. Use MatchExpressionModel1.list_builder() instead."
            )

    @classmethod
    def list_builder(cls) -> ListBuilder:
        return GenericListBuilder[cls, cls.Builder]()  # type: ignore

    key: str
    """
    The label key that the selector applies to.
    """
    operator: str
    """
    Represents a key's relationship to a set of values.
    Valid operators are In, NotIn, Exists, DoesNotExist. Gt, and Lt.
    """
    values: Optional[List[str]] = None
    """
    An array of string values. If the operator is In or NotIn,
    the values array must be non-empty. If the operator is Exists or DoesNotExist,
    the values array must be empty. If the operator is Gt or Lt, the values
    array must have a single element, which will be interpreted as an integer.
    This array is replaced during a strategic merge patch.
    """


class PreferredDuringSchedulingIgnoredDuringExecutionModel1(BaseModel):
    class Builder(BaseModelBuilder):
        @property
        def cls(self) -> Type["PreferredDuringSchedulingIgnoredDuringExecutionModel1"]:
            return PreferredDuringSchedulingIgnoredDuringExecutionModel1

        def build(self) -> "PreferredDuringSchedulingIgnoredDuringExecutionModel1":
            return PreferredDuringSchedulingIgnoredDuringExecutionModel1(**self._attrs)

        @overload
        def preference(
            self, value_or_callback: Preference, /
        ) -> "PreferredDuringSchedulingIgnoredDuringExecutionModel1.Builder": ...

        @overload
        def preference(
            self,
            value_or_callback: Callable[[Preference.Builder], Preference.Builder | Preference],
            /,
        ) -> "PreferredDuringSchedulingIgnoredDuringExecutionModel1.Builder": ...

        @overload
        def preference(self, value_or_callback: Never = ...) -> "Preference.BuilderContext": ...

        def preference(self, value_or_callback=None, /):
            """
            A node selector term, associated with the corresponding weight.
            """
            if self._in_context and value_or_callback is None:
                context = Preference.BuilderContext()
                context._parent_builder = self
                context._field_name = "preference"
                return context

            value = value_or_callback
            if callable(value_or_callback):
                output = value_or_callback(Preference.builder())
                if isinstance(output, Preference.Builder):
                    value = output.build()
                else:
                    value = output
            return self._set("preference", value)

        def weight(self, value: int, /) -> Self:
            """
            Weight associated with matching the corresponding nodeSelectorTerm, in the range 1-100.
            """
            return self._set("weight", value)

    class BuilderContext(
        BuilderContextBase["PreferredDuringSchedulingIgnoredDuringExecutionModel1.Builder"]
    ):
        def model_post_init(self, __context) -> None:
            self._builder = PreferredDuringSchedulingIgnoredDuringExecutionModel1.Builder()
            self._builder._in_context = True
            self._parent_builder = None
            self._field_name = None

    @classmethod
    def builder(cls) -> Builder:
        return cls.Builder()

    @classmethod
    def new(cls) -> BuilderContext:
        """Creates a new context manager builder for PreferredDuringSchedulingIgnoredDuringExecutionModel1."""
        return cls.BuilderContext()

    class ListBuilder(
        GenericListBuilder["PreferredDuringSchedulingIgnoredDuringExecutionModel1", Builder]
    ):
        def __init__(self):
            raise NotImplementedError(
                "This class is not meant to be instantiated. Use PreferredDuringSchedulingIgnoredDuringExecutionModel1.list_builder() instead."
            )

    @classmethod
    def list_builder(cls) -> ListBuilder:
        return GenericListBuilder[cls, cls.Builder]()  # type: ignore

    preference: Preference
    """
    A node selector term, associated with the corresponding weight.
    """
    weight: int
    """
    Weight associated with matching the corresponding nodeSelectorTerm, in the range 1-100.
    """


class RequiredDuringSchedulingIgnoredDuringExecutionModel1(BaseModel):
    class Builder(BaseModelBuilder):
        @property
        def cls(self) -> Type["RequiredDuringSchedulingIgnoredDuringExecutionModel1"]:
            return RequiredDuringSchedulingIgnoredDuringExecutionModel1

        def build(self) -> "RequiredDuringSchedulingIgnoredDuringExecutionModel1":
            return RequiredDuringSchedulingIgnoredDuringExecutionModel1(**self._attrs)

        @overload
        def node_selector_terms(
            self, value_or_callback: List[NodeSelectorTerm], /
        ) -> "RequiredDuringSchedulingIgnoredDuringExecutionModel1.Builder": ...

        @overload
        def node_selector_terms(
            self,
            value_or_callback: Callable[
                [GenericListBuilder[NodeSelectorTerm, NodeSelectorTerm.Builder]],
                GenericListBuilder[NodeSelectorTerm, NodeSelectorTerm.Builder]
                | List[NodeSelectorTerm],
            ],
            /,
        ) -> "RequiredDuringSchedulingIgnoredDuringExecutionModel1.Builder": ...

        @overload
        def node_selector_terms(
            self, value_or_callback: Never = ...
        ) -> ListBuilderContext[NodeSelectorTerm.Builder]: ...

        def node_selector_terms(self, value_or_callback=None, /):
            """
            Required. A list of node selector terms. The terms are ORed.
            """
            if self._in_context and value_or_callback is None:
                context = ListBuilderContext[NodeSelectorTerm.Builder]()
                context._parent_builder = self
                context._field_name = "node_selector_terms"
                return context

            value = value_or_callback
            if callable(value_or_callback):
                output = value_or_callback(NodeSelectorTerm.list_builder())
                if isinstance(output, GenericListBuilder):
                    value = output.build()
                else:
                    value = output
            return self._set("node_selector_terms", value)

    class BuilderContext(
        BuilderContextBase["RequiredDuringSchedulingIgnoredDuringExecutionModel1.Builder"]
    ):
        def model_post_init(self, __context) -> None:
            self._builder = RequiredDuringSchedulingIgnoredDuringExecutionModel1.Builder()
            self._builder._in_context = True
            self._parent_builder = None
            self._field_name = None

    @classmethod
    def builder(cls) -> Builder:
        return cls.Builder()

    @classmethod
    def new(cls) -> BuilderContext:
        """Creates a new context manager builder for RequiredDuringSchedulingIgnoredDuringExecutionModel1."""
        return cls.BuilderContext()

    class ListBuilder(
        GenericListBuilder["RequiredDuringSchedulingIgnoredDuringExecutionModel1", Builder]
    ):
        def __init__(self):
            raise NotImplementedError(
                "This class is not meant to be instantiated. Use RequiredDuringSchedulingIgnoredDuringExecutionModel1.list_builder() instead."
            )

    @classmethod
    def list_builder(cls) -> ListBuilder:
        return GenericListBuilder[cls, cls.Builder]()  # type: ignore

    node_selector_terms: Annotated[List[NodeSelectorTerm], Field(alias="nodeSelectorTerms")]
    """
    Required. A list of node selector terms. The terms are ORed.
    """


class MatchExpressionModel2(BaseModel):
    class Builder(BaseModelBuilder):
        @property
        def cls(self) -> Type["MatchExpressionModel2"]:
            return MatchExpressionModel2

        def build(self) -> "MatchExpressionModel2":
            return MatchExpressionModel2(**self._attrs)

        def key(self, value: str, /) -> Self:
            """
            key is the label key that the selector applies to.
            """
            return self._set("key", value)

        def operator(self, value: str, /) -> Self:
            """
            operator represents a key's relationship to a set of values.
            Valid operators are In, NotIn, Exists and DoesNotExist.
            """
            return self._set("operator", value)

        def values(self, value: Optional[List[str]], /) -> Self:
            """
            values is an array of string values. If the operator is In or NotIn,
            the values array must be non-empty. If the operator is Exists or DoesNotExist,
            the values array must be empty. This array is replaced during a strategic
            merge patch.
            """
            return self._set("values", value)

    class BuilderContext(BuilderContextBase["MatchExpressionModel2.Builder"]):
        def model_post_init(self, __context) -> None:
            self._builder = MatchExpressionModel2.Builder()
            self._builder._in_context = True
            self._parent_builder = None
            self._field_name = None

    @classmethod
    def builder(cls) -> Builder:
        return cls.Builder()

    @classmethod
    def new(cls) -> BuilderContext:
        """Creates a new context manager builder for MatchExpressionModel2."""
        return cls.BuilderContext()

    class ListBuilder(GenericListBuilder["MatchExpressionModel2", Builder]):
        def __init__(self):
            raise NotImplementedError(
                "This class is not meant to be instantiated. Use MatchExpressionModel2.list_builder() instead."
            )

    @classmethod
    def list_builder(cls) -> ListBuilder:
        return GenericListBuilder[cls, cls.Builder]()  # type: ignore

    key: str
    """
    key is the label key that the selector applies to.
    """
    operator: str
    """
    operator represents a key's relationship to a set of values.
    Valid operators are In, NotIn, Exists and DoesNotExist.
    """
    values: Optional[List[str]] = None
    """
    values is an array of string values. If the operator is In or NotIn,
    the values array must be non-empty. If the operator is Exists or DoesNotExist,
    the values array must be empty. This array is replaced during a strategic
    merge patch.
    """


class PreferredDuringSchedulingIgnoredDuringExecutionModel2(BaseModel):
    class Builder(BaseModelBuilder):
        @property
        def cls(self) -> Type["PreferredDuringSchedulingIgnoredDuringExecutionModel2"]:
            return PreferredDuringSchedulingIgnoredDuringExecutionModel2

        def build(self) -> "PreferredDuringSchedulingIgnoredDuringExecutionModel2":
            return PreferredDuringSchedulingIgnoredDuringExecutionModel2(**self._attrs)

        @overload
        def pod_affinity_term(
            self, value_or_callback: PodAffinityTerm, /
        ) -> "PreferredDuringSchedulingIgnoredDuringExecutionModel2.Builder": ...

        @overload
        def pod_affinity_term(
            self,
            value_or_callback: Callable[
                [PodAffinityTerm.Builder], PodAffinityTerm.Builder | PodAffinityTerm
            ],
            /,
        ) -> "PreferredDuringSchedulingIgnoredDuringExecutionModel2.Builder": ...

        @overload
        def pod_affinity_term(
            self, value_or_callback: Never = ...
        ) -> "PodAffinityTerm.BuilderContext": ...

        def pod_affinity_term(self, value_or_callback=None, /):
            """
            Required. A pod affinity term, associated with the corresponding weight.
            """
            if self._in_context and value_or_callback is None:
                context = PodAffinityTerm.BuilderContext()
                context._parent_builder = self
                context._field_name = "pod_affinity_term"
                return context

            value = value_or_callback
            if callable(value_or_callback):
                output = value_or_callback(PodAffinityTerm.builder())
                if isinstance(output, PodAffinityTerm.Builder):
                    value = output.build()
                else:
                    value = output
            return self._set("pod_affinity_term", value)

        def weight(self, value: int, /) -> Self:
            """
            weight associated with matching the corresponding podAffinityTerm,
            in the range 1-100.
            """
            return self._set("weight", value)

    class BuilderContext(
        BuilderContextBase["PreferredDuringSchedulingIgnoredDuringExecutionModel2.Builder"]
    ):
        def model_post_init(self, __context) -> None:
            self._builder = PreferredDuringSchedulingIgnoredDuringExecutionModel2.Builder()
            self._builder._in_context = True
            self._parent_builder = None
            self._field_name = None

    @classmethod
    def builder(cls) -> Builder:
        return cls.Builder()

    @classmethod
    def new(cls) -> BuilderContext:
        """Creates a new context manager builder for PreferredDuringSchedulingIgnoredDuringExecutionModel2."""
        return cls.BuilderContext()

    class ListBuilder(
        GenericListBuilder["PreferredDuringSchedulingIgnoredDuringExecutionModel2", Builder]
    ):
        def __init__(self):
            raise NotImplementedError(
                "This class is not meant to be instantiated. Use PreferredDuringSchedulingIgnoredDuringExecutionModel2.list_builder() instead."
            )

    @classmethod
    def list_builder(cls) -> ListBuilder:
        return GenericListBuilder[cls, cls.Builder]()  # type: ignore

    pod_affinity_term: Annotated[PodAffinityTerm, Field(alias="podAffinityTerm")]
    """
    Required. A pod affinity term, associated with the corresponding weight.
    """
    weight: int
    """
    weight associated with matching the corresponding podAffinityTerm,
    in the range 1-100.
    """


class RequiredDuringSchedulingIgnoredDuringExecutionModel2(BaseModel):
    class Builder(BaseModelBuilder):
        @property
        def cls(self) -> Type["RequiredDuringSchedulingIgnoredDuringExecutionModel2"]:
            return RequiredDuringSchedulingIgnoredDuringExecutionModel2

        def build(self) -> "RequiredDuringSchedulingIgnoredDuringExecutionModel2":
            return RequiredDuringSchedulingIgnoredDuringExecutionModel2(**self._attrs)

        @overload
        def label_selector(
            self, value_or_callback: Optional[LabelSelector], /
        ) -> "RequiredDuringSchedulingIgnoredDuringExecutionModel2.Builder": ...

        @overload
        def label_selector(
            self,
            value_or_callback: Callable[
                [LabelSelector.Builder], LabelSelector.Builder | LabelSelector
            ],
            /,
        ) -> "RequiredDuringSchedulingIgnoredDuringExecutionModel2.Builder": ...

        @overload
        def label_selector(
            self, value_or_callback: Never = ...
        ) -> "LabelSelector.BuilderContext": ...

        def label_selector(self, value_or_callback=None, /):
            """
            A label query over a set of resources, in this case pods.
            If it's null, this PodAffinityTerm matches with no Pods.
            """
            if self._in_context and value_or_callback is None:
                context = LabelSelector.BuilderContext()
                context._parent_builder = self
                context._field_name = "label_selector"
                return context

            value = value_or_callback
            if callable(value_or_callback):
                output = value_or_callback(LabelSelector.builder())
                if isinstance(output, LabelSelector.Builder):
                    value = output.build()
                else:
                    value = output
            return self._set("label_selector", value)

        def match_label_keys(self, value: Optional[List[str]], /) -> Self:
            """
            MatchLabelKeys is a set of pod label keys to select which pods will
            be taken into consideration. The keys are used to lookup values from the
            incoming pod labels, those key-value labels are merged with `labelSelector` as `key in (value)`
            to select the group of existing pods which pods will be taken into consideration
            for the incoming pod's pod (anti) affinity. Keys that don't exist in the incoming
            pod labels will be ignored. The default value is empty.
            The same key is forbidden to exist in both matchLabelKeys and labelSelector.
            Also, matchLabelKeys cannot be set when labelSelector isn't set.
            This is a beta field and requires enabling MatchLabelKeysInPodAffinity feature gate (enabled by default).
            """
            return self._set("match_label_keys", value)

        def mismatch_label_keys(self, value: Optional[List[str]], /) -> Self:
            """
            MismatchLabelKeys is a set of pod label keys to select which pods will
            be taken into consideration. The keys are used to lookup values from the
            incoming pod labels, those key-value labels are merged with `labelSelector` as `key notin (value)`
            to select the group of existing pods which pods will be taken into consideration
            for the incoming pod's pod (anti) affinity. Keys that don't exist in the incoming
            pod labels will be ignored. The default value is empty.
            The same key is forbidden to exist in both mismatchLabelKeys and labelSelector.
            Also, mismatchLabelKeys cannot be set when labelSelector isn't set.
            This is a beta field and requires enabling MatchLabelKeysInPodAffinity feature gate (enabled by default).
            """
            return self._set("mismatch_label_keys", value)

        @overload
        def namespace_selector(
            self, value_or_callback: Optional[NamespaceSelector], /
        ) -> "RequiredDuringSchedulingIgnoredDuringExecutionModel2.Builder": ...

        @overload
        def namespace_selector(
            self,
            value_or_callback: Callable[
                [NamespaceSelector.Builder],
                NamespaceSelector.Builder | NamespaceSelector,
            ],
            /,
        ) -> "RequiredDuringSchedulingIgnoredDuringExecutionModel2.Builder": ...

        @overload
        def namespace_selector(
            self, value_or_callback: Never = ...
        ) -> "NamespaceSelector.BuilderContext": ...

        def namespace_selector(self, value_or_callback=None, /):
            """
            A label query over the set of namespaces that the term applies to.
            The term is applied to the union of the namespaces selected by this field
            and the ones listed in the namespaces field.
            null selector and null or empty namespaces list means "this pod's namespace".
            An empty selector ({}) matches all namespaces.
            """
            if self._in_context and value_or_callback is None:
                context = NamespaceSelector.BuilderContext()
                context._parent_builder = self
                context._field_name = "namespace_selector"
                return context

            value = value_or_callback
            if callable(value_or_callback):
                output = value_or_callback(NamespaceSelector.builder())
                if isinstance(output, NamespaceSelector.Builder):
                    value = output.build()
                else:
                    value = output
            return self._set("namespace_selector", value)

        def namespaces(self, value: Optional[List[str]], /) -> Self:
            """
            namespaces specifies a static list of namespace names that the term applies to.
            The term is applied to the union of the namespaces listed in this field
            and the ones selected by namespaceSelector.
            null or empty namespaces list and null namespaceSelector means "this pod's namespace".
            """
            return self._set("namespaces", value)

        def topology_key(self, value: str, /) -> Self:
            """
            This pod should be co-located (affinity) or not co-located (anti-affinity) with the pods matching
            the labelSelector in the specified namespaces, where co-located is defined as running on a node
            whose value of the label with key topologyKey matches that of any node on which any of the
            selected pods is running.
            Empty topologyKey is not allowed.
            """
            return self._set("topology_key", value)

    class BuilderContext(
        BuilderContextBase["RequiredDuringSchedulingIgnoredDuringExecutionModel2.Builder"]
    ):
        def model_post_init(self, __context) -> None:
            self._builder = RequiredDuringSchedulingIgnoredDuringExecutionModel2.Builder()
            self._builder._in_context = True
            self._parent_builder = None
            self._field_name = None

    @classmethod
    def builder(cls) -> Builder:
        return cls.Builder()

    @classmethod
    def new(cls) -> BuilderContext:
        """Creates a new context manager builder for RequiredDuringSchedulingIgnoredDuringExecutionModel2."""
        return cls.BuilderContext()

    class ListBuilder(
        GenericListBuilder["RequiredDuringSchedulingIgnoredDuringExecutionModel2", Builder]
    ):
        def __init__(self):
            raise NotImplementedError(
                "This class is not meant to be instantiated. Use RequiredDuringSchedulingIgnoredDuringExecutionModel2.list_builder() instead."
            )

    @classmethod
    def list_builder(cls) -> ListBuilder:
        return GenericListBuilder[cls, cls.Builder]()  # type: ignore

    label_selector: Annotated[Optional[LabelSelector], Field(alias="labelSelector")] = None
    """
    A label query over a set of resources, in this case pods.
    If it's null, this PodAffinityTerm matches with no Pods.
    """
    match_label_keys: Annotated[Optional[List[str]], Field(alias="matchLabelKeys")] = None
    """
    MatchLabelKeys is a set of pod label keys to select which pods will
    be taken into consideration. The keys are used to lookup values from the
    incoming pod labels, those key-value labels are merged with `labelSelector` as `key in (value)`
    to select the group of existing pods which pods will be taken into consideration
    for the incoming pod's pod (anti) affinity. Keys that don't exist in the incoming
    pod labels will be ignored. The default value is empty.
    The same key is forbidden to exist in both matchLabelKeys and labelSelector.
    Also, matchLabelKeys cannot be set when labelSelector isn't set.
    This is a beta field and requires enabling MatchLabelKeysInPodAffinity feature gate (enabled by default).
    """
    mismatch_label_keys: Annotated[Optional[List[str]], Field(alias="mismatchLabelKeys")] = None
    """
    MismatchLabelKeys is a set of pod label keys to select which pods will
    be taken into consideration. The keys are used to lookup values from the
    incoming pod labels, those key-value labels are merged with `labelSelector` as `key notin (value)`
    to select the group of existing pods which pods will be taken into consideration
    for the incoming pod's pod (anti) affinity. Keys that don't exist in the incoming
    pod labels will be ignored. The default value is empty.
    The same key is forbidden to exist in both mismatchLabelKeys and labelSelector.
    Also, mismatchLabelKeys cannot be set when labelSelector isn't set.
    This is a beta field and requires enabling MatchLabelKeysInPodAffinity feature gate (enabled by default).
    """
    namespace_selector: Annotated[Optional[NamespaceSelector], Field(alias="namespaceSelector")] = (
        None
    )
    """
    A label query over the set of namespaces that the term applies to.
    The term is applied to the union of the namespaces selected by this field
    and the ones listed in the namespaces field.
    null selector and null or empty namespaces list means "this pod's namespace".
    An empty selector ({}) matches all namespaces.
    """
    namespaces: Optional[List[str]] = None
    """
    namespaces specifies a static list of namespace names that the term applies to.
    The term is applied to the union of the namespaces listed in this field
    and the ones selected by namespaceSelector.
    null or empty namespaces list and null namespaceSelector means "this pod's namespace".
    """
    topology_key: Annotated[str, Field(alias="topologyKey")]
    """
    This pod should be co-located (affinity) or not co-located (anti-affinity) with the pods matching
    the labelSelector in the specified namespaces, where co-located is defined as running on a node
    whose value of the label with key topologyKey matches that of any node on which any of the
    selected pods is running.
    Empty topologyKey is not allowed.
    """


class Ingress(BaseModel):
    class Builder(BaseModelBuilder):
        @property
        def cls(self) -> Type["Ingress"]:
            return Ingress

        def build(self) -> "Ingress":
            return Ingress(**self._attrs)

        def class_(self, value: Optional[str], /) -> Self:
            """
            This field configures the annotation `kubernetes.io/ingress.class` when
            creating Ingress resources to solve ACME challenges that use this
            challenge solver. Only one of `class`, `name` or `ingressClassName` may
            be specified.
            """
            return self._set("class_", value)

        def ingress_class_name(self, value: Optional[str], /) -> Self:
            """
            This field configures the field `ingressClassName` on the created Ingress
            resources used to solve ACME challenges that use this challenge solver.
            This is the recommended way of configuring the ingress class. Only one of
            `class`, `name` or `ingressClassName` may be specified.
            """
            return self._set("ingress_class_name", value)

        @overload
        def ingress_template(
            self, value_or_callback: Optional[IngressTemplate], /
        ) -> "Ingress.Builder": ...

        @overload
        def ingress_template(
            self,
            value_or_callback: Callable[
                [IngressTemplate.Builder], IngressTemplate.Builder | IngressTemplate
            ],
            /,
        ) -> "Ingress.Builder": ...

        @overload
        def ingress_template(
            self, value_or_callback: Never = ...
        ) -> "IngressTemplate.BuilderContext": ...

        def ingress_template(self, value_or_callback=None, /):
            """
            Optional ingress template used to configure the ACME challenge solver
            ingress used for HTTP01 challenges.
            """
            if self._in_context and value_or_callback is None:
                context = IngressTemplate.BuilderContext()
                context._parent_builder = self
                context._field_name = "ingress_template"
                return context

            value = value_or_callback
            if callable(value_or_callback):
                output = value_or_callback(IngressTemplate.builder())
                if isinstance(output, IngressTemplate.Builder):
                    value = output.build()
                else:
                    value = output
            return self._set("ingress_template", value)

        def name(self, value: Optional[str], /) -> Self:
            """
            The name of the ingress resource that should have ACME challenge solving
            routes inserted into it in order to solve HTTP01 challenges.
            This is typically used in conjunction with ingress controllers like
            ingress-gce, which maintains a 1:1 mapping between external IPs and
            ingress resources. Only one of `class`, `name` or `ingressClassName` may
            be specified.
            """
            return self._set("name", value)

        @overload
        def pod_template(
            self, value_or_callback: Optional[PodTemplate], /
        ) -> "Ingress.Builder": ...

        @overload
        def pod_template(
            self,
            value_or_callback: Callable[[PodTemplate.Builder], PodTemplate.Builder | PodTemplate],
            /,
        ) -> "Ingress.Builder": ...

        @overload
        def pod_template(self, value_or_callback: Never = ...) -> "PodTemplate.BuilderContext": ...

        def pod_template(self, value_or_callback=None, /):
            """
            Optional pod template used to configure the ACME challenge solver pods
            used for HTTP01 challenges.
            """
            if self._in_context and value_or_callback is None:
                context = PodTemplate.BuilderContext()
                context._parent_builder = self
                context._field_name = "pod_template"
                return context

            value = value_or_callback
            if callable(value_or_callback):
                output = value_or_callback(PodTemplate.builder())
                if isinstance(output, PodTemplate.Builder):
                    value = output.build()
                else:
                    value = output
            return self._set("pod_template", value)

        def service_type(self, value: Optional[str], /) -> Self:
            """
            Optional service type for Kubernetes solver service. Supported values
            are NodePort or ClusterIP. If unset, defaults to NodePort.
            """
            return self._set("service_type", value)

    class BuilderContext(BuilderContextBase["Ingress.Builder"]):
        def model_post_init(self, __context) -> None:
            self._builder = Ingress.Builder()
            self._builder._in_context = True
            self._parent_builder = None
            self._field_name = None

    @classmethod
    def builder(cls) -> Builder:
        return cls.Builder()

    @classmethod
    def new(cls) -> BuilderContext:
        """Creates a new context manager builder for Ingress."""
        return cls.BuilderContext()

    class ListBuilder(GenericListBuilder["Ingress", Builder]):
        def __init__(self):
            raise NotImplementedError(
                "This class is not meant to be instantiated. Use Ingress.list_builder() instead."
            )

    @classmethod
    def list_builder(cls) -> ListBuilder:
        return GenericListBuilder[cls, cls.Builder]()  # type: ignore

    class_: Annotated[Optional[str], Field(alias="class")] = None
    """
    This field configures the annotation `kubernetes.io/ingress.class` when
    creating Ingress resources to solve ACME challenges that use this
    challenge solver. Only one of `class`, `name` or `ingressClassName` may
    be specified.
    """
    ingress_class_name: Annotated[Optional[str], Field(alias="ingressClassName")] = None
    """
    This field configures the field `ingressClassName` on the created Ingress
    resources used to solve ACME challenges that use this challenge solver.
    This is the recommended way of configuring the ingress class. Only one of
    `class`, `name` or `ingressClassName` may be specified.
    """
    ingress_template: Annotated[Optional[IngressTemplate], Field(alias="ingressTemplate")] = None
    """
    Optional ingress template used to configure the ACME challenge solver
    ingress used for HTTP01 challenges.
    """
    name: Optional[str] = None
    """
    The name of the ingress resource that should have ACME challenge solving
    routes inserted into it in order to solve HTTP01 challenges.
    This is typically used in conjunction with ingress controllers like
    ingress-gce, which maintains a 1:1 mapping between external IPs and
    ingress resources. Only one of `class`, `name` or `ingressClassName` may
    be specified.
    """
    pod_template: Annotated[Optional[PodTemplate], Field(alias="podTemplate")] = None
    """
    Optional pod template used to configure the ACME challenge solver pods
    used for HTTP01 challenges.
    """
    service_type: Annotated[Optional[str], Field(alias="serviceType")] = None
    """
    Optional service type for Kubernetes solver service. Supported values
    are NodePort or ClusterIP. If unset, defaults to NodePort.
    """


class Http01(BaseModel):
    class Builder(BaseModelBuilder):
        @property
        def cls(self) -> Type["Http01"]:
            return Http01

        def build(self) -> "Http01":
            return Http01(**self._attrs)

        @overload
        def gateway_http_route(
            self, value_or_callback: Optional[GatewayHttpRoute], /
        ) -> "Http01.Builder": ...

        @overload
        def gateway_http_route(
            self,
            value_or_callback: Callable[
                [GatewayHttpRoute.Builder], GatewayHttpRoute.Builder | GatewayHttpRoute
            ],
            /,
        ) -> "Http01.Builder": ...

        @overload
        def gateway_http_route(
            self, value_or_callback: Never = ...
        ) -> "GatewayHttpRoute.BuilderContext": ...

        def gateway_http_route(self, value_or_callback=None, /):
            """
            The Gateway API is a sig-network community API that models service networking
            in Kubernetes (https://gateway-api.sigs.k8s.io/). The Gateway solver will
            create HTTPRoutes with the specified labels in the same namespace as the challenge.
            This solver is experimental, and fields / behaviour may change in the future.
            """
            if self._in_context and value_or_callback is None:
                context = GatewayHttpRoute.BuilderContext()
                context._parent_builder = self
                context._field_name = "gateway_http_route"
                return context

            value = value_or_callback
            if callable(value_or_callback):
                output = value_or_callback(GatewayHttpRoute.builder())
                if isinstance(output, GatewayHttpRoute.Builder):
                    value = output.build()
                else:
                    value = output
            return self._set("gateway_http_route", value)

        @overload
        def ingress(self, value_or_callback: Optional[Ingress], /) -> "Http01.Builder": ...

        @overload
        def ingress(
            self,
            value_or_callback: Callable[[Ingress.Builder], Ingress.Builder | Ingress],
            /,
        ) -> "Http01.Builder": ...

        @overload
        def ingress(self, value_or_callback: Never = ...) -> "Ingress.BuilderContext": ...

        def ingress(self, value_or_callback=None, /):
            """
            The ingress based HTTP01 challenge solver will solve challenges by
            creating or modifying Ingress resources in order to route requests for
            '/.well-known/acme-challenge/XYZ' to 'challenge solver' pods that are
            provisioned by cert-manager for each Challenge to be completed.
            """
            if self._in_context and value_or_callback is None:
                context = Ingress.BuilderContext()
                context._parent_builder = self
                context._field_name = "ingress"
                return context

            value = value_or_callback
            if callable(value_or_callback):
                output = value_or_callback(Ingress.builder())
                if isinstance(output, Ingress.Builder):
                    value = output.build()
                else:
                    value = output
            return self._set("ingress", value)

    class BuilderContext(BuilderContextBase["Http01.Builder"]):
        def model_post_init(self, __context) -> None:
            self._builder = Http01.Builder()
            self._builder._in_context = True
            self._parent_builder = None
            self._field_name = None

    @classmethod
    def builder(cls) -> Builder:
        return cls.Builder()

    @classmethod
    def new(cls) -> BuilderContext:
        """Creates a new context manager builder for Http01."""
        return cls.BuilderContext()

    class ListBuilder(GenericListBuilder["Http01", Builder]):
        def __init__(self):
            raise NotImplementedError(
                "This class is not meant to be instantiated. Use Http01.list_builder() instead."
            )

    @classmethod
    def list_builder(cls) -> ListBuilder:
        return GenericListBuilder[cls, cls.Builder]()  # type: ignore

    gateway_http_route: Annotated[Optional[GatewayHttpRoute], Field(alias="gatewayHTTPRoute")] = (
        None
    )
    """
    The Gateway API is a sig-network community API that models service networking
    in Kubernetes (https://gateway-api.sigs.k8s.io/). The Gateway solver will
    create HTTPRoutes with the specified labels in the same namespace as the challenge.
    This solver is experimental, and fields / behaviour may change in the future.
    """
    ingress: Optional[Ingress] = None
    """
    The ingress based HTTP01 challenge solver will solve challenges by
    creating or modifying Ingress resources in order to route requests for
    '/.well-known/acme-challenge/XYZ' to 'challenge solver' pods that are
    provisioned by cert-manager for each Challenge to be completed.
    """


class Selector(BaseModel):
    class Builder(BaseModelBuilder):
        @property
        def cls(self) -> Type["Selector"]:
            return Selector

        def build(self) -> "Selector":
            return Selector(**self._attrs)

        def dns_names(self, value: Optional[List[str]], /) -> Self:
            """
            List of DNSNames that this solver will be used to solve.
            If specified and a match is found, a dnsNames selector will take
            precedence over a dnsZones selector.
            If multiple solvers match with the same dnsNames value, the solver
            with the most matching labels in matchLabels will be selected.
            If neither has more matches, the solver defined earlier in the list
            will be selected.
            """
            return self._set("dns_names", value)

        def dns_zones(self, value: Optional[List[str]], /) -> Self:
            """
            List of DNSZones that this solver will be used to solve.
            The most specific DNS zone match specified here will take precedence
            over other DNS zone matches, so a solver specifying sys.example.com
            will be selected over one specifying example.com for the domain
            www.sys.example.com.
            If multiple solvers match with the same dnsZones value, the solver
            with the most matching labels in matchLabels will be selected.
            If neither has more matches, the solver defined earlier in the list
            will be selected.
            """
            return self._set("dns_zones", value)

        def match_labels(self, value: Optional[Dict[str, str]], /) -> Self:
            """
            A label selector that is used to refine the set of certificate's that
            this challenge solver will apply to.
            """
            return self._set("match_labels", value)

    class BuilderContext(BuilderContextBase["Selector.Builder"]):
        def model_post_init(self, __context) -> None:
            self._builder = Selector.Builder()
            self._builder._in_context = True
            self._parent_builder = None
            self._field_name = None

    @classmethod
    def builder(cls) -> Builder:
        return cls.Builder()

    @classmethod
    def new(cls) -> BuilderContext:
        """Creates a new context manager builder for Selector."""
        return cls.BuilderContext()

    class ListBuilder(GenericListBuilder["Selector", Builder]):
        def __init__(self):
            raise NotImplementedError(
                "This class is not meant to be instantiated. Use Selector.list_builder() instead."
            )

    @classmethod
    def list_builder(cls) -> ListBuilder:
        return GenericListBuilder[cls, cls.Builder]()  # type: ignore

    dns_names: Annotated[Optional[List[str]], Field(alias="dnsNames")] = None
    """
    List of DNSNames that this solver will be used to solve.
    If specified and a match is found, a dnsNames selector will take
    precedence over a dnsZones selector.
    If multiple solvers match with the same dnsNames value, the solver
    with the most matching labels in matchLabels will be selected.
    If neither has more matches, the solver defined earlier in the list
    will be selected.
    """
    dns_zones: Annotated[Optional[List[str]], Field(alias="dnsZones")] = None
    """
    List of DNSZones that this solver will be used to solve.
    The most specific DNS zone match specified here will take precedence
    over other DNS zone matches, so a solver specifying sys.example.com
    will be selected over one specifying example.com for the domain
    www.sys.example.com.
    If multiple solvers match with the same dnsZones value, the solver
    with the most matching labels in matchLabels will be selected.
    If neither has more matches, the solver defined earlier in the list
    will be selected.
    """
    match_labels: Annotated[Optional[Dict[str, str]], Field(alias="matchLabels")] = None
    """
    A label selector that is used to refine the set of certificate's that
    this challenge solver will apply to.
    """


class Solver(BaseModel):
    class Builder(BaseModelBuilder):
        @property
        def cls(self) -> Type["Solver"]:
            return Solver

        def build(self) -> "Solver":
            return Solver(**self._attrs)

        @overload
        def dns01(self, value_or_callback: Optional[Dns01], /) -> "Solver.Builder": ...

        @overload
        def dns01(
            self, value_or_callback: Callable[[Dns01.Builder], Dns01.Builder | Dns01], /
        ) -> "Solver.Builder": ...

        @overload
        def dns01(self, value_or_callback: Never = ...) -> "Dns01.BuilderContext": ...

        def dns01(self, value_or_callback=None, /):
            """
            Configures cert-manager to attempt to complete authorizations by
            performing the DNS01 challenge flow.
            """
            if self._in_context and value_or_callback is None:
                context = Dns01.BuilderContext()
                context._parent_builder = self
                context._field_name = "dns01"
                return context

            value = value_or_callback
            if callable(value_or_callback):
                output = value_or_callback(Dns01.builder())
                if isinstance(output, Dns01.Builder):
                    value = output.build()
                else:
                    value = output
            return self._set("dns01", value)

        @overload
        def http01(self, value_or_callback: Optional[Http01], /) -> "Solver.Builder": ...

        @overload
        def http01(
            self,
            value_or_callback: Callable[[Http01.Builder], Http01.Builder | Http01],
            /,
        ) -> "Solver.Builder": ...

        @overload
        def http01(self, value_or_callback: Never = ...) -> "Http01.BuilderContext": ...

        def http01(self, value_or_callback=None, /):
            """
            Configures cert-manager to attempt to complete authorizations by
            performing the HTTP01 challenge flow.
            It is not possible to obtain certificates for wildcard domain names
            (e.g. `*.example.com`) using the HTTP01 challenge mechanism.
            """
            if self._in_context and value_or_callback is None:
                context = Http01.BuilderContext()
                context._parent_builder = self
                context._field_name = "http01"
                return context

            value = value_or_callback
            if callable(value_or_callback):
                output = value_or_callback(Http01.builder())
                if isinstance(output, Http01.Builder):
                    value = output.build()
                else:
                    value = output
            return self._set("http01", value)

        @overload
        def selector(self, value_or_callback: Optional[Selector], /) -> "Solver.Builder": ...

        @overload
        def selector(
            self,
            value_or_callback: Callable[[Selector.Builder], Selector.Builder | Selector],
            /,
        ) -> "Solver.Builder": ...

        @overload
        def selector(self, value_or_callback: Never = ...) -> "Selector.BuilderContext": ...

        def selector(self, value_or_callback=None, /):
            """
            Selector selects a set of DNSNames on the Certificate resource that
            should be solved using this challenge solver.
            If not specified, the solver will be treated as the 'default' solver
            with the lowest priority, i.e. if any other solver has a more specific
            match, it will be used instead.
            """
            if self._in_context and value_or_callback is None:
                context = Selector.BuilderContext()
                context._parent_builder = self
                context._field_name = "selector"
                return context

            value = value_or_callback
            if callable(value_or_callback):
                output = value_or_callback(Selector.builder())
                if isinstance(output, Selector.Builder):
                    value = output.build()
                else:
                    value = output
            return self._set("selector", value)

    class BuilderContext(BuilderContextBase["Solver.Builder"]):
        def model_post_init(self, __context) -> None:
            self._builder = Solver.Builder()
            self._builder._in_context = True
            self._parent_builder = None
            self._field_name = None

    @classmethod
    def builder(cls) -> Builder:
        return cls.Builder()

    @classmethod
    def new(cls) -> BuilderContext:
        """Creates a new context manager builder for Solver."""
        return cls.BuilderContext()

    class ListBuilder(GenericListBuilder["Solver", Builder]):
        def __init__(self):
            raise NotImplementedError(
                "This class is not meant to be instantiated. Use Solver.list_builder() instead."
            )

    @classmethod
    def list_builder(cls) -> ListBuilder:
        return GenericListBuilder[cls, cls.Builder]()  # type: ignore

    dns01: Optional[Dns01] = None
    """
    Configures cert-manager to attempt to complete authorizations by
    performing the DNS01 challenge flow.
    """
    http01: Optional[Http01] = None
    """
    Configures cert-manager to attempt to complete authorizations by
    performing the HTTP01 challenge flow.
    It is not possible to obtain certificates for wildcard domain names
    (e.g. `*.example.com`) using the HTTP01 challenge mechanism.
    """
    selector: Optional[Selector] = None
    """
    Selector selects a set of DNSNames on the Certificate resource that
    should be solved using this challenge solver.
    If not specified, the solver will be treated as the 'default' solver
    with the lowest priority, i.e. if any other solver has a more specific
    match, it will be used instead.
    """


class Acme(BaseModel):
    class Builder(BaseModelBuilder):
        @property
        def cls(self) -> Type["Acme"]:
            return Acme

        def build(self) -> "Acme":
            return Acme(**self._attrs)

        def ca_bundle(self, value: Optional[str], /) -> Self:
            """
            Base64-encoded bundle of PEM CAs which can be used to validate the certificate
            chain presented by the ACME server.
            Mutually exclusive with SkipTLSVerify; prefer using CABundle to prevent various
            kinds of security vulnerabilities.
            If CABundle and SkipTLSVerify are unset, the system certificate bundle inside
            the container is used to validate the TLS connection.
            """
            return self._set("ca_bundle", value)

        def disable_account_key_generation(self, value: Optional[bool], /) -> Self:
            """
            Enables or disables generating a new ACME account key.
            If true, the Issuer resource will *not* request a new account but will expect
            the account key to be supplied via an existing secret.
            If false, the cert-manager system will generate a new ACME account key
            for the Issuer.
            Defaults to false.
            """
            return self._set("disable_account_key_generation", value)

        def email(self, value: Optional[str], /) -> Self:
            """
            Email is the email address to be associated with the ACME account.
            This field is optional, but it is strongly recommended to be set.
            It will be used to contact you in case of issues with your account or
            certificates, including expiry notification emails.
            This field may be updated after the account is initially registered.
            """
            return self._set("email", value)

        def enable_duration_feature(self, value: Optional[bool], /) -> Self:
            """
            Enables requesting a Not After date on certificates that matches the
            duration of the certificate. This is not supported by all ACME servers
            like Let's Encrypt. If set to true when the ACME server does not support
            it, it will create an error on the Order.
            Defaults to false.
            """
            return self._set("enable_duration_feature", value)

        @overload
        def external_account_binding(
            self, value_or_callback: Optional[ExternalAccountBinding], /
        ) -> "Acme.Builder": ...

        @overload
        def external_account_binding(
            self,
            value_or_callback: Callable[
                [ExternalAccountBinding.Builder],
                ExternalAccountBinding.Builder | ExternalAccountBinding,
            ],
            /,
        ) -> "Acme.Builder": ...

        @overload
        def external_account_binding(
            self, value_or_callback: Never = ...
        ) -> "ExternalAccountBinding.BuilderContext": ...

        def external_account_binding(self, value_or_callback=None, /):
            """
            ExternalAccountBinding is a reference to a CA external account of the ACME
            server.
            If set, upon registration cert-manager will attempt to associate the given
            external account credentials with the registered ACME account.
            """
            if self._in_context and value_or_callback is None:
                context = ExternalAccountBinding.BuilderContext()
                context._parent_builder = self
                context._field_name = "external_account_binding"
                return context

            value = value_or_callback
            if callable(value_or_callback):
                output = value_or_callback(ExternalAccountBinding.builder())
                if isinstance(output, ExternalAccountBinding.Builder):
                    value = output.build()
                else:
                    value = output
            return self._set("external_account_binding", value)

        def preferred_chain(self, value: Optional[str], /) -> Self:
            """
            PreferredChain is the chain to use if the ACME server outputs multiple.
            PreferredChain is no guarantee that this one gets delivered by the ACME
            endpoint.
            For example, for Let's Encrypt's DST crosssign you would use:
            "DST Root CA X3" or "ISRG Root X1" for the newer Let's Encrypt root CA.
            This value picks the first certificate bundle in the combined set of
            ACME default and alternative chains that has a root-most certificate with
            this value as its issuer's commonname.
            """
            return self._set("preferred_chain", value)

        @overload
        def private_key_secret_ref(
            self, value_or_callback: PrivateKeySecretRef, /
        ) -> "Acme.Builder": ...

        @overload
        def private_key_secret_ref(
            self,
            value_or_callback: Callable[
                [PrivateKeySecretRef.Builder],
                PrivateKeySecretRef.Builder | PrivateKeySecretRef,
            ],
            /,
        ) -> "Acme.Builder": ...

        @overload
        def private_key_secret_ref(
            self, value_or_callback: Never = ...
        ) -> "PrivateKeySecretRef.BuilderContext": ...

        def private_key_secret_ref(self, value_or_callback=None, /):
            """
            PrivateKey is the name of a Kubernetes Secret resource that will be used to
            store the automatically generated ACME account private key.
            Optionally, a `key` may be specified to select a specific entry within
            the named Secret resource.
            If `key` is not specified, a default of `tls.key` will be used.
            """
            if self._in_context and value_or_callback is None:
                context = PrivateKeySecretRef.BuilderContext()
                context._parent_builder = self
                context._field_name = "private_key_secret_ref"
                return context

            value = value_or_callback
            if callable(value_or_callback):
                output = value_or_callback(PrivateKeySecretRef.builder())
                if isinstance(output, PrivateKeySecretRef.Builder):
                    value = output.build()
                else:
                    value = output
            return self._set("private_key_secret_ref", value)

        def server(self, value: str, /) -> Self:
            """
            Server is the URL used to access the ACME server's 'directory' endpoint.
            For example, for Let's Encrypt's staging endpoint, you would use:
            "https://acme-staging-v02.api.letsencrypt.org/directory".
            Only ACME v2 endpoints (i.e. RFC 8555) are supported.
            """
            return self._set("server", value)

        def skip_tls_verify(self, value: Optional[bool], /) -> Self:
            """
            INSECURE: Enables or disables validation of the ACME server TLS certificate.
            If true, requests to the ACME server will not have the TLS certificate chain
            validated.
            Mutually exclusive with CABundle; prefer using CABundle to prevent various
            kinds of security vulnerabilities.
            Only enable this option in development environments.
            If CABundle and SkipTLSVerify are unset, the system certificate bundle inside
            the container is used to validate the TLS connection.
            Defaults to false.
            """
            return self._set("skip_tls_verify", value)

        @overload
        def solvers(self, value_or_callback: List[Solver], /) -> "Acme.Builder": ...

        @overload
        def solvers(
            self,
            value_or_callback: Callable[
                [GenericListBuilder[Solver, Solver.Builder]],
                GenericListBuilder[Solver, Solver.Builder] | List[Solver],
            ],
            /,
        ) -> "Acme.Builder": ...

        @overload
        def solvers(self, value_or_callback: Never = ...) -> ListBuilderContext[Solver.Builder]: ...

        def solvers(self, value_or_callback=None, /):
            """
            Solvers is a list of challenge solvers that will be used to solve
            ACME challenges for the matching domains.
            Solver configurations must be provided in order to obtain certificates
            from an ACME server.
            For more information, see: https://cert-manager.io/docs/configuration/acme/
            """
            if self._in_context and value_or_callback is None:
                context = ListBuilderContext[Solver.Builder]()
                context._parent_builder = self
                context._field_name = "solvers"
                return context

            value = value_or_callback
            if callable(value_or_callback):
                output = value_or_callback(Solver.list_builder())
                if isinstance(output, GenericListBuilder):
                    value = output.build()
                else:
                    value = output
            return self._set("solvers", value)

    class BuilderContext(BuilderContextBase["Acme.Builder"]):
        def model_post_init(self, __context) -> None:
            self._builder = Acme.Builder()
            self._builder._in_context = True
            self._parent_builder = None
            self._field_name = None

    @classmethod
    def builder(cls) -> Builder:
        return cls.Builder()

    @classmethod
    def new(cls) -> BuilderContext:
        """Creates a new context manager builder for Acme."""
        return cls.BuilderContext()

    class ListBuilder(GenericListBuilder["Acme", Builder]):
        def __init__(self):
            raise NotImplementedError(
                "This class is not meant to be instantiated. Use Acme.list_builder() instead."
            )

    @classmethod
    def list_builder(cls) -> ListBuilder:
        return GenericListBuilder[cls, cls.Builder]()  # type: ignore

    ca_bundle: Annotated[Optional[str], Field(alias="caBundle")] = None
    """
    Base64-encoded bundle of PEM CAs which can be used to validate the certificate
    chain presented by the ACME server.
    Mutually exclusive with SkipTLSVerify; prefer using CABundle to prevent various
    kinds of security vulnerabilities.
    If CABundle and SkipTLSVerify are unset, the system certificate bundle inside
    the container is used to validate the TLS connection.
    """
    disable_account_key_generation: Annotated[
        Optional[bool], Field(alias="disableAccountKeyGeneration")
    ] = None
    """
    Enables or disables generating a new ACME account key.
    If true, the Issuer resource will *not* request a new account but will expect
    the account key to be supplied via an existing secret.
    If false, the cert-manager system will generate a new ACME account key
    for the Issuer.
    Defaults to false.
    """
    email: Optional[str] = None
    """
    Email is the email address to be associated with the ACME account.
    This field is optional, but it is strongly recommended to be set.
    It will be used to contact you in case of issues with your account or
    certificates, including expiry notification emails.
    This field may be updated after the account is initially registered.
    """
    enable_duration_feature: Annotated[Optional[bool], Field(alias="enableDurationFeature")] = None
    """
    Enables requesting a Not After date on certificates that matches the
    duration of the certificate. This is not supported by all ACME servers
    like Let's Encrypt. If set to true when the ACME server does not support
    it, it will create an error on the Order.
    Defaults to false.
    """
    external_account_binding: Annotated[
        Optional[ExternalAccountBinding], Field(alias="externalAccountBinding")
    ] = None
    """
    ExternalAccountBinding is a reference to a CA external account of the ACME
    server.
    If set, upon registration cert-manager will attempt to associate the given
    external account credentials with the registered ACME account.
    """
    preferred_chain: Annotated[Optional[str], Field(alias="preferredChain", max_length=64)] = None
    """
    PreferredChain is the chain to use if the ACME server outputs multiple.
    PreferredChain is no guarantee that this one gets delivered by the ACME
    endpoint.
    For example, for Let's Encrypt's DST crosssign you would use:
    "DST Root CA X3" or "ISRG Root X1" for the newer Let's Encrypt root CA.
    This value picks the first certificate bundle in the combined set of
    ACME default and alternative chains that has a root-most certificate with
    this value as its issuer's commonname.
    """
    private_key_secret_ref: Annotated[PrivateKeySecretRef, Field(alias="privateKeySecretRef")]
    """
    PrivateKey is the name of a Kubernetes Secret resource that will be used to
    store the automatically generated ACME account private key.
    Optionally, a `key` may be specified to select a specific entry within
    the named Secret resource.
    If `key` is not specified, a default of `tls.key` will be used.
    """
    server: str
    """
    Server is the URL used to access the ACME server's 'directory' endpoint.
    For example, for Let's Encrypt's staging endpoint, you would use:
    "https://acme-staging-v02.api.letsencrypt.org/directory".
    Only ACME v2 endpoints (i.e. RFC 8555) are supported.
    """
    skip_tls_verify: Annotated[Optional[bool], Field(alias="skipTLSVerify")] = None
    """
    INSECURE: Enables or disables validation of the ACME server TLS certificate.
    If true, requests to the ACME server will not have the TLS certificate chain
    validated.
    Mutually exclusive with CABundle; prefer using CABundle to prevent various
    kinds of security vulnerabilities.
    Only enable this option in development environments.
    If CABundle and SkipTLSVerify are unset, the system certificate bundle inside
    the container is used to validate the TLS connection.
    Defaults to false.
    """
    solvers: Optional[List[Solver]] = None
    """
    Solvers is a list of challenge solvers that will be used to solve
    ACME challenges for the matching domains.
    Solver configurations must be provided in order to obtain certificates
    from an ACME server.
    For more information, see: https://cert-manager.io/docs/configuration/acme/
    """


class Ca(BaseModel):
    class Builder(BaseModelBuilder):
        @property
        def cls(self) -> Type["Ca"]:
            return Ca

        def build(self) -> "Ca":
            return Ca(**self._attrs)

        def crl_distribution_points(self, value: Optional[List[str]], /) -> Self:
            """
            The CRL distribution points is an X.509 v3 certificate extension which identifies
            the location of the CRL from which the revocation of this certificate can be checked.
            If not set, certificates will be issued without distribution points set.
            """
            return self._set("crl_distribution_points", value)

        def issuing_certificate_ur_ls(self, value: Optional[List[str]], /) -> Self:
            """
            IssuingCertificateURLs is a list of URLs which this issuer should embed into certificates
            it creates. See https://www.rfc-editor.org/rfc/rfc5280#section-4.2.2.1 for more details.
            As an example, such a URL might be "http://ca.domain.com/ca.crt".
            """
            return self._set("issuing_certificate_ur_ls", value)

        def ocsp_servers(self, value: Optional[List[str]], /) -> Self:
            """
            The OCSP server list is an X.509 v3 extension that defines a list of
            URLs of OCSP responders. The OCSP responders can be queried for the
            revocation status of an issued certificate. If not set, the
            certificate will be issued with no OCSP servers set. For example, an
            OCSP server URL could be "http://ocsp.int-x3.letsencrypt.org".
            """
            return self._set("ocsp_servers", value)

        def secret_name(self, value: str, /) -> Self:
            """
            SecretName is the name of the secret used to sign Certificates issued
            by this Issuer.
            """
            return self._set("secret_name", value)

    class BuilderContext(BuilderContextBase["Ca.Builder"]):
        def model_post_init(self, __context) -> None:
            self._builder = Ca.Builder()
            self._builder._in_context = True
            self._parent_builder = None
            self._field_name = None

    @classmethod
    def builder(cls) -> Builder:
        return cls.Builder()

    @classmethod
    def new(cls) -> BuilderContext:
        """Creates a new context manager builder for Ca."""
        return cls.BuilderContext()

    class ListBuilder(GenericListBuilder["Ca", Builder]):
        def __init__(self):
            raise NotImplementedError(
                "This class is not meant to be instantiated. Use Ca.list_builder() instead."
            )

    @classmethod
    def list_builder(cls) -> ListBuilder:
        return GenericListBuilder[cls, cls.Builder]()  # type: ignore

    crl_distribution_points: Annotated[
        Optional[List[str]], Field(alias="crlDistributionPoints")
    ] = None
    """
    The CRL distribution points is an X.509 v3 certificate extension which identifies
    the location of the CRL from which the revocation of this certificate can be checked.
    If not set, certificates will be issued without distribution points set.
    """
    issuing_certificate_ur_ls: Annotated[
        Optional[List[str]], Field(alias="issuingCertificateURLs")
    ] = None
    """
    IssuingCertificateURLs is a list of URLs which this issuer should embed into certificates
    it creates. See https://www.rfc-editor.org/rfc/rfc5280#section-4.2.2.1 for more details.
    As an example, such a URL might be "http://ca.domain.com/ca.crt".
    """
    ocsp_servers: Annotated[Optional[List[str]], Field(alias="ocspServers")] = None
    """
    The OCSP server list is an X.509 v3 extension that defines a list of
    URLs of OCSP responders. The OCSP responders can be queried for the
    revocation status of an issued certificate. If not set, the
    certificate will be issued with no OCSP servers set. For example, an
    OCSP server URL could be "http://ocsp.int-x3.letsencrypt.org".
    """
    secret_name: Annotated[str, Field(alias="secretName")]
    """
    SecretName is the name of the secret used to sign Certificates issued
    by this Issuer.
    """


class SelfSigned(BaseModel):
    class Builder(BaseModelBuilder):
        @property
        def cls(self) -> Type["SelfSigned"]:
            return SelfSigned

        def build(self) -> "SelfSigned":
            return SelfSigned(**self._attrs)

        def crl_distribution_points(self, value: Optional[List[str]], /) -> Self:
            """
            The CRL distribution points is an X.509 v3 certificate extension which identifies
            the location of the CRL from which the revocation of this certificate can be checked.
            If not set certificate will be issued without CDP. Values are strings.
            """
            return self._set("crl_distribution_points", value)

    class BuilderContext(BuilderContextBase["SelfSigned.Builder"]):
        def model_post_init(self, __context) -> None:
            self._builder = SelfSigned.Builder()
            self._builder._in_context = True
            self._parent_builder = None
            self._field_name = None

    @classmethod
    def builder(cls) -> Builder:
        return cls.Builder()

    @classmethod
    def new(cls) -> BuilderContext:
        """Creates a new context manager builder for SelfSigned."""
        return cls.BuilderContext()

    class ListBuilder(GenericListBuilder["SelfSigned", Builder]):
        def __init__(self):
            raise NotImplementedError(
                "This class is not meant to be instantiated. Use SelfSigned.list_builder() instead."
            )

    @classmethod
    def list_builder(cls) -> ListBuilder:
        return GenericListBuilder[cls, cls.Builder]()  # type: ignore

    crl_distribution_points: Annotated[
        Optional[List[str]], Field(alias="crlDistributionPoints")
    ] = None
    """
    The CRL distribution points is an X.509 v3 certificate extension which identifies
    the location of the CRL from which the revocation of this certificate can be checked.
    If not set certificate will be issued without CDP. Values are strings.
    """


class SecretRef(BaseModel):
    class Builder(BaseModelBuilder):
        @property
        def cls(self) -> Type["SecretRef"]:
            return SecretRef

        def build(self) -> "SecretRef":
            return SecretRef(**self._attrs)

        def key(self, value: Optional[str], /) -> Self:
            """
            The key of the entry in the Secret resource's `data` field to be used.
            Some instances of this field may be defaulted, in others it may be
            required.
            """
            return self._set("key", value)

        def name(self, value: str, /) -> Self:
            """
            Name of the resource being referred to.
            More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
            """
            return self._set("name", value)

    class BuilderContext(BuilderContextBase["SecretRef.Builder"]):
        def model_post_init(self, __context) -> None:
            self._builder = SecretRef.Builder()
            self._builder._in_context = True
            self._parent_builder = None
            self._field_name = None

    @classmethod
    def builder(cls) -> Builder:
        return cls.Builder()

    @classmethod
    def new(cls) -> BuilderContext:
        """Creates a new context manager builder for SecretRef."""
        return cls.BuilderContext()

    class ListBuilder(GenericListBuilder["SecretRef", Builder]):
        def __init__(self):
            raise NotImplementedError(
                "This class is not meant to be instantiated. Use SecretRef.list_builder() instead."
            )

    @classmethod
    def list_builder(cls) -> ListBuilder:
        return GenericListBuilder[cls, cls.Builder]()  # type: ignore

    key: Optional[str] = None
    """
    The key of the entry in the Secret resource's `data` field to be used.
    Some instances of this field may be defaulted, in others it may be
    required.
    """
    name: str
    """
    Name of the resource being referred to.
    More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
    """


class AppRole(BaseModel):
    class Builder(BaseModelBuilder):
        @property
        def cls(self) -> Type["AppRole"]:
            return AppRole

        def build(self) -> "AppRole":
            return AppRole(**self._attrs)

        def path(self, value: str, /) -> Self:
            """
            Path where the App Role authentication backend is mounted in Vault, e.g:
            "approle"
            """
            return self._set("path", value)

        def role_id(self, value: str, /) -> Self:
            """
            RoleID configured in the App Role authentication backend when setting
            up the authentication backend in Vault.
            """
            return self._set("role_id", value)

        @overload
        def secret_ref(self, value_or_callback: SecretRef, /) -> "AppRole.Builder": ...

        @overload
        def secret_ref(
            self,
            value_or_callback: Callable[[SecretRef.Builder], SecretRef.Builder | SecretRef],
            /,
        ) -> "AppRole.Builder": ...

        @overload
        def secret_ref(self, value_or_callback: Never = ...) -> "SecretRef.BuilderContext": ...

        def secret_ref(self, value_or_callback=None, /):
            """
            Reference to a key in a Secret that contains the App Role secret used
            to authenticate with Vault.
            The `key` field must be specified and denotes which entry within the Secret
            resource is used as the app role secret.
            """
            if self._in_context and value_or_callback is None:
                context = SecretRef.BuilderContext()
                context._parent_builder = self
                context._field_name = "secret_ref"
                return context

            value = value_or_callback
            if callable(value_or_callback):
                output = value_or_callback(SecretRef.builder())
                if isinstance(output, SecretRef.Builder):
                    value = output.build()
                else:
                    value = output
            return self._set("secret_ref", value)

    class BuilderContext(BuilderContextBase["AppRole.Builder"]):
        def model_post_init(self, __context) -> None:
            self._builder = AppRole.Builder()
            self._builder._in_context = True
            self._parent_builder = None
            self._field_name = None

    @classmethod
    def builder(cls) -> Builder:
        return cls.Builder()

    @classmethod
    def new(cls) -> BuilderContext:
        """Creates a new context manager builder for AppRole."""
        return cls.BuilderContext()

    class ListBuilder(GenericListBuilder["AppRole", Builder]):
        def __init__(self):
            raise NotImplementedError(
                "This class is not meant to be instantiated. Use AppRole.list_builder() instead."
            )

    @classmethod
    def list_builder(cls) -> ListBuilder:
        return GenericListBuilder[cls, cls.Builder]()  # type: ignore

    path: str
    """
    Path where the App Role authentication backend is mounted in Vault, e.g:
    "approle"
    """
    role_id: Annotated[str, Field(alias="roleId")]
    """
    RoleID configured in the App Role authentication backend when setting
    up the authentication backend in Vault.
    """
    secret_ref: Annotated[SecretRef, Field(alias="secretRef")]
    """
    Reference to a key in a Secret that contains the App Role secret used
    to authenticate with Vault.
    The `key` field must be specified and denotes which entry within the Secret
    resource is used as the app role secret.
    """


class ClientCertificate(BaseModel):
    class Builder(BaseModelBuilder):
        @property
        def cls(self) -> Type["ClientCertificate"]:
            return ClientCertificate

        def build(self) -> "ClientCertificate":
            return ClientCertificate(**self._attrs)

        def mount_path(self, value: Optional[str], /) -> Self:
            """
            The Vault mountPath here is the mount path to use when authenticating with
            Vault. For example, setting a value to `/v1/auth/foo`, will use the path
            `/v1/auth/foo/login` to authenticate with Vault. If unspecified, the
            default value "/v1/auth/cert" will be used.
            """
            return self._set("mount_path", value)

        def name(self, value: Optional[str], /) -> Self:
            """
            Name of the certificate role to authenticate against.
            If not set, matching any certificate role, if available.
            """
            return self._set("name", value)

        def secret_name(self, value: Optional[str], /) -> Self:
            """
            Reference to Kubernetes Secret of type "kubernetes.io/tls" (hence containing
            tls.crt and tls.key) used to authenticate to Vault using TLS client
            authentication.
            """
            return self._set("secret_name", value)

    class BuilderContext(BuilderContextBase["ClientCertificate.Builder"]):
        def model_post_init(self, __context) -> None:
            self._builder = ClientCertificate.Builder()
            self._builder._in_context = True
            self._parent_builder = None
            self._field_name = None

    @classmethod
    def builder(cls) -> Builder:
        return cls.Builder()

    @classmethod
    def new(cls) -> BuilderContext:
        """Creates a new context manager builder for ClientCertificate."""
        return cls.BuilderContext()

    class ListBuilder(GenericListBuilder["ClientCertificate", Builder]):
        def __init__(self):
            raise NotImplementedError(
                "This class is not meant to be instantiated. Use ClientCertificate.list_builder() instead."
            )

    @classmethod
    def list_builder(cls) -> ListBuilder:
        return GenericListBuilder[cls, cls.Builder]()  # type: ignore

    mount_path: Annotated[Optional[str], Field(alias="mountPath")] = None
    """
    The Vault mountPath here is the mount path to use when authenticating with
    Vault. For example, setting a value to `/v1/auth/foo`, will use the path
    `/v1/auth/foo/login` to authenticate with Vault. If unspecified, the
    default value "/v1/auth/cert" will be used.
    """
    name: Optional[str] = None
    """
    Name of the certificate role to authenticate against.
    If not set, matching any certificate role, if available.
    """
    secret_name: Annotated[Optional[str], Field(alias="secretName")] = None
    """
    Reference to Kubernetes Secret of type "kubernetes.io/tls" (hence containing
    tls.crt and tls.key) used to authenticate to Vault using TLS client
    authentication.
    """


class ServiceAccountRefModel(BaseModel):
    class Builder(BaseModelBuilder):
        @property
        def cls(self) -> Type["ServiceAccountRefModel"]:
            return ServiceAccountRefModel

        def build(self) -> "ServiceAccountRefModel":
            return ServiceAccountRefModel(**self._attrs)

        def audiences(self, value: Optional[List[str]], /) -> Self:
            """
            TokenAudiences is an optional list of extra audiences to include in the token passed to Vault. The default token
            consisting of the issuer's namespace and name is always included.
            """
            return self._set("audiences", value)

        def name(self, value: str, /) -> Self:
            """
            Name of the ServiceAccount used to request a token.
            """
            return self._set("name", value)

    class BuilderContext(BuilderContextBase["ServiceAccountRefModel.Builder"]):
        def model_post_init(self, __context) -> None:
            self._builder = ServiceAccountRefModel.Builder()
            self._builder._in_context = True
            self._parent_builder = None
            self._field_name = None

    @classmethod
    def builder(cls) -> Builder:
        return cls.Builder()

    @classmethod
    def new(cls) -> BuilderContext:
        """Creates a new context manager builder for ServiceAccountRefModel."""
        return cls.BuilderContext()

    class ListBuilder(GenericListBuilder["ServiceAccountRefModel", Builder]):
        def __init__(self):
            raise NotImplementedError(
                "This class is not meant to be instantiated. Use ServiceAccountRefModel.list_builder() instead."
            )

    @classmethod
    def list_builder(cls) -> ListBuilder:
        return GenericListBuilder[cls, cls.Builder]()  # type: ignore

    audiences: Optional[List[str]] = None
    """
    TokenAudiences is an optional list of extra audiences to include in the token passed to Vault. The default token
    consisting of the issuer's namespace and name is always included.
    """
    name: str
    """
    Name of the ServiceAccount used to request a token.
    """


class KubernetesModel(BaseModel):
    class Builder(BaseModelBuilder):
        @property
        def cls(self) -> Type["KubernetesModel"]:
            return KubernetesModel

        def build(self) -> "KubernetesModel":
            return KubernetesModel(**self._attrs)

        def mount_path(self, value: Optional[str], /) -> Self:
            """
            The Vault mountPath here is the mount path to use when authenticating with
            Vault. For example, setting a value to `/v1/auth/foo`, will use the path
            `/v1/auth/foo/login` to authenticate with Vault. If unspecified, the
            default value "/v1/auth/kubernetes" will be used.
            """
            return self._set("mount_path", value)

        def role(self, value: str, /) -> Self:
            """
            A required field containing the Vault Role to assume. A Role binds a
            Kubernetes ServiceAccount with a set of Vault policies.
            """
            return self._set("role", value)

        @overload
        def secret_ref(
            self, value_or_callback: Optional[SecretRef], /
        ) -> "KubernetesModel.Builder": ...

        @overload
        def secret_ref(
            self,
            value_or_callback: Callable[[SecretRef.Builder], SecretRef.Builder | SecretRef],
            /,
        ) -> "KubernetesModel.Builder": ...

        @overload
        def secret_ref(self, value_or_callback: Never = ...) -> "SecretRef.BuilderContext": ...

        def secret_ref(self, value_or_callback=None, /):
            """
            The required Secret field containing a Kubernetes ServiceAccount JWT used
            for authenticating with Vault. Use of 'ambient credentials' is not
            supported.
            """
            if self._in_context and value_or_callback is None:
                context = SecretRef.BuilderContext()
                context._parent_builder = self
                context._field_name = "secret_ref"
                return context

            value = value_or_callback
            if callable(value_or_callback):
                output = value_or_callback(SecretRef.builder())
                if isinstance(output, SecretRef.Builder):
                    value = output.build()
                else:
                    value = output
            return self._set("secret_ref", value)

        @overload
        def service_account_ref(
            self, value_or_callback: Optional[ServiceAccountRefModel], /
        ) -> "KubernetesModel.Builder": ...

        @overload
        def service_account_ref(
            self,
            value_or_callback: Callable[
                [ServiceAccountRefModel.Builder],
                ServiceAccountRefModel.Builder | ServiceAccountRefModel,
            ],
            /,
        ) -> "KubernetesModel.Builder": ...

        @overload
        def service_account_ref(
            self, value_or_callback: Never = ...
        ) -> "ServiceAccountRefModel.BuilderContext": ...

        def service_account_ref(self, value_or_callback=None, /):
            """
            A reference to a service account that will be used to request a bound
            token (also known as "projected token"). Compared to using "secretRef",
            using this field means that you don't rely on statically bound tokens. To
            use this field, you must configure an RBAC rule to let cert-manager
            request a token.
            """
            if self._in_context and value_or_callback is None:
                context = ServiceAccountRefModel.BuilderContext()
                context._parent_builder = self
                context._field_name = "service_account_ref"
                return context

            value = value_or_callback
            if callable(value_or_callback):
                output = value_or_callback(ServiceAccountRefModel.builder())
                if isinstance(output, ServiceAccountRefModel.Builder):
                    value = output.build()
                else:
                    value = output
            return self._set("service_account_ref", value)

    class BuilderContext(BuilderContextBase["KubernetesModel.Builder"]):
        def model_post_init(self, __context) -> None:
            self._builder = KubernetesModel.Builder()
            self._builder._in_context = True
            self._parent_builder = None
            self._field_name = None

    @classmethod
    def builder(cls) -> Builder:
        return cls.Builder()

    @classmethod
    def new(cls) -> BuilderContext:
        """Creates a new context manager builder for KubernetesModel."""
        return cls.BuilderContext()

    class ListBuilder(GenericListBuilder["KubernetesModel", Builder]):
        def __init__(self):
            raise NotImplementedError(
                "This class is not meant to be instantiated. Use KubernetesModel.list_builder() instead."
            )

    @classmethod
    def list_builder(cls) -> ListBuilder:
        return GenericListBuilder[cls, cls.Builder]()  # type: ignore

    mount_path: Annotated[Optional[str], Field(alias="mountPath")] = None
    """
    The Vault mountPath here is the mount path to use when authenticating with
    Vault. For example, setting a value to `/v1/auth/foo`, will use the path
    `/v1/auth/foo/login` to authenticate with Vault. If unspecified, the
    default value "/v1/auth/kubernetes" will be used.
    """
    role: str
    """
    A required field containing the Vault Role to assume. A Role binds a
    Kubernetes ServiceAccount with a set of Vault policies.
    """
    secret_ref: Annotated[Optional[SecretRef], Field(alias="secretRef")] = None
    """
    The required Secret field containing a Kubernetes ServiceAccount JWT used
    for authenticating with Vault. Use of 'ambient credentials' is not
    supported.
    """
    service_account_ref: Annotated[
        Optional[ServiceAccountRefModel], Field(alias="serviceAccountRef")
    ] = None
    """
    A reference to a service account that will be used to request a bound
    token (also known as "projected token"). Compared to using "secretRef",
    using this field means that you don't rely on statically bound tokens. To
    use this field, you must configure an RBAC rule to let cert-manager
    request a token.
    """


class AuthModel(BaseModel):
    class Builder(BaseModelBuilder):
        @property
        def cls(self) -> Type["AuthModel"]:
            return AuthModel

        def build(self) -> "AuthModel":
            return AuthModel(**self._attrs)

        @overload
        def app_role(self, value_or_callback: Optional[AppRole], /) -> "AuthModel.Builder": ...

        @overload
        def app_role(
            self,
            value_or_callback: Callable[[AppRole.Builder], AppRole.Builder | AppRole],
            /,
        ) -> "AuthModel.Builder": ...

        @overload
        def app_role(self, value_or_callback: Never = ...) -> "AppRole.BuilderContext": ...

        def app_role(self, value_or_callback=None, /):
            """
            AppRole authenticates with Vault using the App Role auth mechanism,
            with the role and secret stored in a Kubernetes Secret resource.
            """
            if self._in_context and value_or_callback is None:
                context = AppRole.BuilderContext()
                context._parent_builder = self
                context._field_name = "app_role"
                return context

            value = value_or_callback
            if callable(value_or_callback):
                output = value_or_callback(AppRole.builder())
                if isinstance(output, AppRole.Builder):
                    value = output.build()
                else:
                    value = output
            return self._set("app_role", value)

        @overload
        def client_certificate(
            self, value_or_callback: Optional[ClientCertificate], /
        ) -> "AuthModel.Builder": ...

        @overload
        def client_certificate(
            self,
            value_or_callback: Callable[
                [ClientCertificate.Builder],
                ClientCertificate.Builder | ClientCertificate,
            ],
            /,
        ) -> "AuthModel.Builder": ...

        @overload
        def client_certificate(
            self, value_or_callback: Never = ...
        ) -> "ClientCertificate.BuilderContext": ...

        def client_certificate(self, value_or_callback=None, /):
            """
            ClientCertificate authenticates with Vault by presenting a client
            certificate during the request's TLS handshake.
            Works only when using HTTPS protocol.
            """
            if self._in_context and value_or_callback is None:
                context = ClientCertificate.BuilderContext()
                context._parent_builder = self
                context._field_name = "client_certificate"
                return context

            value = value_or_callback
            if callable(value_or_callback):
                output = value_or_callback(ClientCertificate.builder())
                if isinstance(output, ClientCertificate.Builder):
                    value = output.build()
                else:
                    value = output
            return self._set("client_certificate", value)

        @overload
        def kubernetes(
            self, value_or_callback: Optional[KubernetesModel], /
        ) -> "AuthModel.Builder": ...

        @overload
        def kubernetes(
            self,
            value_or_callback: Callable[
                [KubernetesModel.Builder], KubernetesModel.Builder | KubernetesModel
            ],
            /,
        ) -> "AuthModel.Builder": ...

        @overload
        def kubernetes(
            self, value_or_callback: Never = ...
        ) -> "KubernetesModel.BuilderContext": ...

        def kubernetes(self, value_or_callback=None, /):
            """
            Kubernetes authenticates with Vault by passing the ServiceAccount
            token stored in the named Secret resource to the Vault server.
            """
            if self._in_context and value_or_callback is None:
                context = KubernetesModel.BuilderContext()
                context._parent_builder = self
                context._field_name = "kubernetes"
                return context

            value = value_or_callback
            if callable(value_or_callback):
                output = value_or_callback(KubernetesModel.builder())
                if isinstance(output, KubernetesModel.Builder):
                    value = output.build()
                else:
                    value = output
            return self._set("kubernetes", value)

        @overload
        def token_secret_ref(
            self, value_or_callback: Optional[TokenSecretRef], /
        ) -> "AuthModel.Builder": ...

        @overload
        def token_secret_ref(
            self,
            value_or_callback: Callable[
                [TokenSecretRef.Builder], TokenSecretRef.Builder | TokenSecretRef
            ],
            /,
        ) -> "AuthModel.Builder": ...

        @overload
        def token_secret_ref(
            self, value_or_callback: Never = ...
        ) -> "TokenSecretRef.BuilderContext": ...

        def token_secret_ref(self, value_or_callback=None, /):
            """
            TokenSecretRef authenticates with Vault by presenting a token.
            """
            if self._in_context and value_or_callback is None:
                context = TokenSecretRef.BuilderContext()
                context._parent_builder = self
                context._field_name = "token_secret_ref"
                return context

            value = value_or_callback
            if callable(value_or_callback):
                output = value_or_callback(TokenSecretRef.builder())
                if isinstance(output, TokenSecretRef.Builder):
                    value = output.build()
                else:
                    value = output
            return self._set("token_secret_ref", value)

    class BuilderContext(BuilderContextBase["AuthModel.Builder"]):
        def model_post_init(self, __context) -> None:
            self._builder = AuthModel.Builder()
            self._builder._in_context = True
            self._parent_builder = None
            self._field_name = None

    @classmethod
    def builder(cls) -> Builder:
        return cls.Builder()

    @classmethod
    def new(cls) -> BuilderContext:
        """Creates a new context manager builder for AuthModel."""
        return cls.BuilderContext()

    class ListBuilder(GenericListBuilder["AuthModel", Builder]):
        def __init__(self):
            raise NotImplementedError(
                "This class is not meant to be instantiated. Use AuthModel.list_builder() instead."
            )

    @classmethod
    def list_builder(cls) -> ListBuilder:
        return GenericListBuilder[cls, cls.Builder]()  # type: ignore

    app_role: Annotated[Optional[AppRole], Field(alias="appRole")] = None
    """
    AppRole authenticates with Vault using the App Role auth mechanism,
    with the role and secret stored in a Kubernetes Secret resource.
    """
    client_certificate: Annotated[Optional[ClientCertificate], Field(alias="clientCertificate")] = (
        None
    )
    """
    ClientCertificate authenticates with Vault by presenting a client
    certificate during the request's TLS handshake.
    Works only when using HTTPS protocol.
    """
    kubernetes: Optional[KubernetesModel] = None
    """
    Kubernetes authenticates with Vault by passing the ServiceAccount
    token stored in the named Secret resource to the Vault server.
    """
    token_secret_ref: Annotated[Optional[TokenSecretRef], Field(alias="tokenSecretRef")] = None
    """
    TokenSecretRef authenticates with Vault by presenting a token.
    """


class CaBundleSecretRef(BaseModel):
    class Builder(BaseModelBuilder):
        @property
        def cls(self) -> Type["CaBundleSecretRef"]:
            return CaBundleSecretRef

        def build(self) -> "CaBundleSecretRef":
            return CaBundleSecretRef(**self._attrs)

        def key(self, value: Optional[str], /) -> Self:
            """
            The key of the entry in the Secret resource's `data` field to be used.
            Some instances of this field may be defaulted, in others it may be
            required.
            """
            return self._set("key", value)

        def name(self, value: str, /) -> Self:
            """
            Name of the resource being referred to.
            More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
            """
            return self._set("name", value)

    class BuilderContext(BuilderContextBase["CaBundleSecretRef.Builder"]):
        def model_post_init(self, __context) -> None:
            self._builder = CaBundleSecretRef.Builder()
            self._builder._in_context = True
            self._parent_builder = None
            self._field_name = None

    @classmethod
    def builder(cls) -> Builder:
        return cls.Builder()

    @classmethod
    def new(cls) -> BuilderContext:
        """Creates a new context manager builder for CaBundleSecretRef."""
        return cls.BuilderContext()

    class ListBuilder(GenericListBuilder["CaBundleSecretRef", Builder]):
        def __init__(self):
            raise NotImplementedError(
                "This class is not meant to be instantiated. Use CaBundleSecretRef.list_builder() instead."
            )

    @classmethod
    def list_builder(cls) -> ListBuilder:
        return GenericListBuilder[cls, cls.Builder]()  # type: ignore

    key: Optional[str] = None
    """
    The key of the entry in the Secret resource's `data` field to be used.
    Some instances of this field may be defaulted, in others it may be
    required.
    """
    name: str
    """
    Name of the resource being referred to.
    More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
    """


class ClientCertSecretRef(BaseModel):
    class Builder(BaseModelBuilder):
        @property
        def cls(self) -> Type["ClientCertSecretRef"]:
            return ClientCertSecretRef

        def build(self) -> "ClientCertSecretRef":
            return ClientCertSecretRef(**self._attrs)

        def key(self, value: Optional[str], /) -> Self:
            """
            The key of the entry in the Secret resource's `data` field to be used.
            Some instances of this field may be defaulted, in others it may be
            required.
            """
            return self._set("key", value)

        def name(self, value: str, /) -> Self:
            """
            Name of the resource being referred to.
            More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
            """
            return self._set("name", value)

    class BuilderContext(BuilderContextBase["ClientCertSecretRef.Builder"]):
        def model_post_init(self, __context) -> None:
            self._builder = ClientCertSecretRef.Builder()
            self._builder._in_context = True
            self._parent_builder = None
            self._field_name = None

    @classmethod
    def builder(cls) -> Builder:
        return cls.Builder()

    @classmethod
    def new(cls) -> BuilderContext:
        """Creates a new context manager builder for ClientCertSecretRef."""
        return cls.BuilderContext()

    class ListBuilder(GenericListBuilder["ClientCertSecretRef", Builder]):
        def __init__(self):
            raise NotImplementedError(
                "This class is not meant to be instantiated. Use ClientCertSecretRef.list_builder() instead."
            )

    @classmethod
    def list_builder(cls) -> ListBuilder:
        return GenericListBuilder[cls, cls.Builder]()  # type: ignore

    key: Optional[str] = None
    """
    The key of the entry in the Secret resource's `data` field to be used.
    Some instances of this field may be defaulted, in others it may be
    required.
    """
    name: str
    """
    Name of the resource being referred to.
    More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
    """


class ClientKeySecretRef(BaseModel):
    class Builder(BaseModelBuilder):
        @property
        def cls(self) -> Type["ClientKeySecretRef"]:
            return ClientKeySecretRef

        def build(self) -> "ClientKeySecretRef":
            return ClientKeySecretRef(**self._attrs)

        def key(self, value: Optional[str], /) -> Self:
            """
            The key of the entry in the Secret resource's `data` field to be used.
            Some instances of this field may be defaulted, in others it may be
            required.
            """
            return self._set("key", value)

        def name(self, value: str, /) -> Self:
            """
            Name of the resource being referred to.
            More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
            """
            return self._set("name", value)

    class BuilderContext(BuilderContextBase["ClientKeySecretRef.Builder"]):
        def model_post_init(self, __context) -> None:
            self._builder = ClientKeySecretRef.Builder()
            self._builder._in_context = True
            self._parent_builder = None
            self._field_name = None

    @classmethod
    def builder(cls) -> Builder:
        return cls.Builder()

    @classmethod
    def new(cls) -> BuilderContext:
        """Creates a new context manager builder for ClientKeySecretRef."""
        return cls.BuilderContext()

    class ListBuilder(GenericListBuilder["ClientKeySecretRef", Builder]):
        def __init__(self):
            raise NotImplementedError(
                "This class is not meant to be instantiated. Use ClientKeySecretRef.list_builder() instead."
            )

    @classmethod
    def list_builder(cls) -> ListBuilder:
        return GenericListBuilder[cls, cls.Builder]()  # type: ignore

    key: Optional[str] = None
    """
    The key of the entry in the Secret resource's `data` field to be used.
    Some instances of this field may be defaulted, in others it may be
    required.
    """
    name: str
    """
    Name of the resource being referred to.
    More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
    """


class Vault(BaseModel):
    class Builder(BaseModelBuilder):
        @property
        def cls(self) -> Type["Vault"]:
            return Vault

        def build(self) -> "Vault":
            return Vault(**self._attrs)

        @overload
        def auth(self, value_or_callback: AuthModel, /) -> "Vault.Builder": ...

        @overload
        def auth(
            self,
            value_or_callback: Callable[[AuthModel.Builder], AuthModel.Builder | AuthModel],
            /,
        ) -> "Vault.Builder": ...

        @overload
        def auth(self, value_or_callback: Never = ...) -> "AuthModel.BuilderContext": ...

        def auth(self, value_or_callback=None, /):
            """
            Auth configures how cert-manager authenticates with the Vault server.
            """
            if self._in_context and value_or_callback is None:
                context = AuthModel.BuilderContext()
                context._parent_builder = self
                context._field_name = "auth"
                return context

            value = value_or_callback
            if callable(value_or_callback):
                output = value_or_callback(AuthModel.builder())
                if isinstance(output, AuthModel.Builder):
                    value = output.build()
                else:
                    value = output
            return self._set("auth", value)

        def ca_bundle(self, value: Optional[str], /) -> Self:
            """
            Base64-encoded bundle of PEM CAs which will be used to validate the certificate
            chain presented by Vault. Only used if using HTTPS to connect to Vault and
            ignored for HTTP connections.
            Mutually exclusive with CABundleSecretRef.
            If neither CABundle nor CABundleSecretRef are defined, the certificate bundle in
            the cert-manager controller container is used to validate the TLS connection.
            """
            return self._set("ca_bundle", value)

        @overload
        def ca_bundle_secret_ref(
            self, value_or_callback: Optional[CaBundleSecretRef], /
        ) -> "Vault.Builder": ...

        @overload
        def ca_bundle_secret_ref(
            self,
            value_or_callback: Callable[
                [CaBundleSecretRef.Builder],
                CaBundleSecretRef.Builder | CaBundleSecretRef,
            ],
            /,
        ) -> "Vault.Builder": ...

        @overload
        def ca_bundle_secret_ref(
            self, value_or_callback: Never = ...
        ) -> "CaBundleSecretRef.BuilderContext": ...

        def ca_bundle_secret_ref(self, value_or_callback=None, /):
            """
            Reference to a Secret containing a bundle of PEM-encoded CAs to use when
            verifying the certificate chain presented by Vault when using HTTPS.
            Mutually exclusive with CABundle.
            If neither CABundle nor CABundleSecretRef are defined, the certificate bundle in
            the cert-manager controller container is used to validate the TLS connection.
            If no key for the Secret is specified, cert-manager will default to 'ca.crt'.
            """
            if self._in_context and value_or_callback is None:
                context = CaBundleSecretRef.BuilderContext()
                context._parent_builder = self
                context._field_name = "ca_bundle_secret_ref"
                return context

            value = value_or_callback
            if callable(value_or_callback):
                output = value_or_callback(CaBundleSecretRef.builder())
                if isinstance(output, CaBundleSecretRef.Builder):
                    value = output.build()
                else:
                    value = output
            return self._set("ca_bundle_secret_ref", value)

        @overload
        def client_cert_secret_ref(
            self, value_or_callback: Optional[ClientCertSecretRef], /
        ) -> "Vault.Builder": ...

        @overload
        def client_cert_secret_ref(
            self,
            value_or_callback: Callable[
                [ClientCertSecretRef.Builder],
                ClientCertSecretRef.Builder | ClientCertSecretRef,
            ],
            /,
        ) -> "Vault.Builder": ...

        @overload
        def client_cert_secret_ref(
            self, value_or_callback: Never = ...
        ) -> "ClientCertSecretRef.BuilderContext": ...

        def client_cert_secret_ref(self, value_or_callback=None, /):
            """
            Reference to a Secret containing a PEM-encoded Client Certificate to use when the
            Vault server requires mTLS.
            """
            if self._in_context and value_or_callback is None:
                context = ClientCertSecretRef.BuilderContext()
                context._parent_builder = self
                context._field_name = "client_cert_secret_ref"
                return context

            value = value_or_callback
            if callable(value_or_callback):
                output = value_or_callback(ClientCertSecretRef.builder())
                if isinstance(output, ClientCertSecretRef.Builder):
                    value = output.build()
                else:
                    value = output
            return self._set("client_cert_secret_ref", value)

        @overload
        def client_key_secret_ref(
            self, value_or_callback: Optional[ClientKeySecretRef], /
        ) -> "Vault.Builder": ...

        @overload
        def client_key_secret_ref(
            self,
            value_or_callback: Callable[
                [ClientKeySecretRef.Builder],
                ClientKeySecretRef.Builder | ClientKeySecretRef,
            ],
            /,
        ) -> "Vault.Builder": ...

        @overload
        def client_key_secret_ref(
            self, value_or_callback: Never = ...
        ) -> "ClientKeySecretRef.BuilderContext": ...

        def client_key_secret_ref(self, value_or_callback=None, /):
            """
            Reference to a Secret containing a PEM-encoded Client Private Key to use when the
            Vault server requires mTLS.
            """
            if self._in_context and value_or_callback is None:
                context = ClientKeySecretRef.BuilderContext()
                context._parent_builder = self
                context._field_name = "client_key_secret_ref"
                return context

            value = value_or_callback
            if callable(value_or_callback):
                output = value_or_callback(ClientKeySecretRef.builder())
                if isinstance(output, ClientKeySecretRef.Builder):
                    value = output.build()
                else:
                    value = output
            return self._set("client_key_secret_ref", value)

        def namespace(self, value: Optional[str], /) -> Self:
            """
            Name of the vault namespace. Namespaces is a set of features within Vault Enterprise that allows Vault environments to support Secure Multi-tenancy. e.g: "ns1"
            More about namespaces can be found here https://www.vaultproject.io/docs/enterprise/namespaces
            """
            return self._set("namespace", value)

        def path(self, value: str, /) -> Self:
            """
            Path is the mount path of the Vault PKI backend's `sign` endpoint, e.g:
            "my_pki_mount/sign/my-role-name".
            """
            return self._set("path", value)

        def server(self, value: str, /) -> Self:
            """
            Server is the connection address for the Vault server, e.g: "https://vault.example.com:8200".
            """
            return self._set("server", value)

    class BuilderContext(BuilderContextBase["Vault.Builder"]):
        def model_post_init(self, __context) -> None:
            self._builder = Vault.Builder()
            self._builder._in_context = True
            self._parent_builder = None
            self._field_name = None

    @classmethod
    def builder(cls) -> Builder:
        return cls.Builder()

    @classmethod
    def new(cls) -> BuilderContext:
        """Creates a new context manager builder for Vault."""
        return cls.BuilderContext()

    class ListBuilder(GenericListBuilder["Vault", Builder]):
        def __init__(self):
            raise NotImplementedError(
                "This class is not meant to be instantiated. Use Vault.list_builder() instead."
            )

    @classmethod
    def list_builder(cls) -> ListBuilder:
        return GenericListBuilder[cls, cls.Builder]()  # type: ignore

    auth: AuthModel
    """
    Auth configures how cert-manager authenticates with the Vault server.
    """
    ca_bundle: Annotated[Optional[str], Field(alias="caBundle")] = None
    """
    Base64-encoded bundle of PEM CAs which will be used to validate the certificate
    chain presented by Vault. Only used if using HTTPS to connect to Vault and
    ignored for HTTP connections.
    Mutually exclusive with CABundleSecretRef.
    If neither CABundle nor CABundleSecretRef are defined, the certificate bundle in
    the cert-manager controller container is used to validate the TLS connection.
    """
    ca_bundle_secret_ref: Annotated[
        Optional[CaBundleSecretRef], Field(alias="caBundleSecretRef")
    ] = None
    """
    Reference to a Secret containing a bundle of PEM-encoded CAs to use when
    verifying the certificate chain presented by Vault when using HTTPS.
    Mutually exclusive with CABundle.
    If neither CABundle nor CABundleSecretRef are defined, the certificate bundle in
    the cert-manager controller container is used to validate the TLS connection.
    If no key for the Secret is specified, cert-manager will default to 'ca.crt'.
    """
    client_cert_secret_ref: Annotated[
        Optional[ClientCertSecretRef], Field(alias="clientCertSecretRef")
    ] = None
    """
    Reference to a Secret containing a PEM-encoded Client Certificate to use when the
    Vault server requires mTLS.
    """
    client_key_secret_ref: Annotated[
        Optional[ClientKeySecretRef], Field(alias="clientKeySecretRef")
    ] = None
    """
    Reference to a Secret containing a PEM-encoded Client Private Key to use when the
    Vault server requires mTLS.
    """
    namespace: Optional[str] = None
    """
    Name of the vault namespace. Namespaces is a set of features within Vault Enterprise that allows Vault environments to support Secure Multi-tenancy. e.g: "ns1"
    More about namespaces can be found here https://www.vaultproject.io/docs/enterprise/namespaces
    """
    path: str
    """
    Path is the mount path of the Vault PKI backend's `sign` endpoint, e.g:
    "my_pki_mount/sign/my-role-name".
    """
    server: str
    """
    Server is the connection address for the Vault server, e.g: "https://vault.example.com:8200".
    """


class Cloud(BaseModel):
    class Builder(BaseModelBuilder):
        @property
        def cls(self) -> Type["Cloud"]:
            return Cloud

        def build(self) -> "Cloud":
            return Cloud(**self._attrs)

        @overload
        def api_token_secret_ref(
            self, value_or_callback: ApiTokenSecretRef, /
        ) -> "Cloud.Builder": ...

        @overload
        def api_token_secret_ref(
            self,
            value_or_callback: Callable[
                [ApiTokenSecretRef.Builder],
                ApiTokenSecretRef.Builder | ApiTokenSecretRef,
            ],
            /,
        ) -> "Cloud.Builder": ...

        @overload
        def api_token_secret_ref(
            self, value_or_callback: Never = ...
        ) -> "ApiTokenSecretRef.BuilderContext": ...

        def api_token_secret_ref(self, value_or_callback=None, /):
            """
            APITokenSecretRef is a secret key selector for the Venafi Cloud API token.
            """
            if self._in_context and value_or_callback is None:
                context = ApiTokenSecretRef.BuilderContext()
                context._parent_builder = self
                context._field_name = "api_token_secret_ref"
                return context

            value = value_or_callback
            if callable(value_or_callback):
                output = value_or_callback(ApiTokenSecretRef.builder())
                if isinstance(output, ApiTokenSecretRef.Builder):
                    value = output.build()
                else:
                    value = output
            return self._set("api_token_secret_ref", value)

        def url(self, value: Optional[str], /) -> Self:
            """
            URL is the base URL for Venafi Cloud.
            Defaults to "https://api.venafi.cloud/v1".
            """
            return self._set("url", value)

    class BuilderContext(BuilderContextBase["Cloud.Builder"]):
        def model_post_init(self, __context) -> None:
            self._builder = Cloud.Builder()
            self._builder._in_context = True
            self._parent_builder = None
            self._field_name = None

    @classmethod
    def builder(cls) -> Builder:
        return cls.Builder()

    @classmethod
    def new(cls) -> BuilderContext:
        """Creates a new context manager builder for Cloud."""
        return cls.BuilderContext()

    class ListBuilder(GenericListBuilder["Cloud", Builder]):
        def __init__(self):
            raise NotImplementedError(
                "This class is not meant to be instantiated. Use Cloud.list_builder() instead."
            )

    @classmethod
    def list_builder(cls) -> ListBuilder:
        return GenericListBuilder[cls, cls.Builder]()  # type: ignore

    api_token_secret_ref: Annotated[ApiTokenSecretRef, Field(alias="apiTokenSecretRef")]
    """
    APITokenSecretRef is a secret key selector for the Venafi Cloud API token.
    """
    url: Optional[str] = None
    """
    URL is the base URL for Venafi Cloud.
    Defaults to "https://api.venafi.cloud/v1".
    """


class CredentialsRef(BaseModel):
    class Builder(BaseModelBuilder):
        @property
        def cls(self) -> Type["CredentialsRef"]:
            return CredentialsRef

        def build(self) -> "CredentialsRef":
            return CredentialsRef(**self._attrs)

        def name(self, value: str, /) -> Self:
            """
            Name of the resource being referred to.
            More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
            """
            return self._set("name", value)

    class BuilderContext(BuilderContextBase["CredentialsRef.Builder"]):
        def model_post_init(self, __context) -> None:
            self._builder = CredentialsRef.Builder()
            self._builder._in_context = True
            self._parent_builder = None
            self._field_name = None

    @classmethod
    def builder(cls) -> Builder:
        return cls.Builder()

    @classmethod
    def new(cls) -> BuilderContext:
        """Creates a new context manager builder for CredentialsRef."""
        return cls.BuilderContext()

    class ListBuilder(GenericListBuilder["CredentialsRef", Builder]):
        def __init__(self):
            raise NotImplementedError(
                "This class is not meant to be instantiated. Use CredentialsRef.list_builder() instead."
            )

    @classmethod
    def list_builder(cls) -> ListBuilder:
        return GenericListBuilder[cls, cls.Builder]()  # type: ignore

    name: str
    """
    Name of the resource being referred to.
    More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
    """


class Tpp(BaseModel):
    class Builder(BaseModelBuilder):
        @property
        def cls(self) -> Type["Tpp"]:
            return Tpp

        def build(self) -> "Tpp":
            return Tpp(**self._attrs)

        def ca_bundle(self, value: Optional[str], /) -> Self:
            """
            Base64-encoded bundle of PEM CAs which will be used to validate the certificate
            chain presented by the TPP server. Only used if using HTTPS; ignored for HTTP.
            If undefined, the certificate bundle in the cert-manager controller container
            is used to validate the chain.
            """
            return self._set("ca_bundle", value)

        @overload
        def ca_bundle_secret_ref(
            self, value_or_callback: Optional[CaBundleSecretRef], /
        ) -> "Tpp.Builder": ...

        @overload
        def ca_bundle_secret_ref(
            self,
            value_or_callback: Callable[
                [CaBundleSecretRef.Builder],
                CaBundleSecretRef.Builder | CaBundleSecretRef,
            ],
            /,
        ) -> "Tpp.Builder": ...

        @overload
        def ca_bundle_secret_ref(
            self, value_or_callback: Never = ...
        ) -> "CaBundleSecretRef.BuilderContext": ...

        def ca_bundle_secret_ref(self, value_or_callback=None, /):
            """
            Reference to a Secret containing a base64-encoded bundle of PEM CAs
            which will be used to validate the certificate chain presented by the TPP server.
            Only used if using HTTPS; ignored for HTTP. Mutually exclusive with CABundle.
            If neither CABundle nor CABundleSecretRef is defined, the certificate bundle in
            the cert-manager controller container is used to validate the TLS connection.
            """
            if self._in_context and value_or_callback is None:
                context = CaBundleSecretRef.BuilderContext()
                context._parent_builder = self
                context._field_name = "ca_bundle_secret_ref"
                return context

            value = value_or_callback
            if callable(value_or_callback):
                output = value_or_callback(CaBundleSecretRef.builder())
                if isinstance(output, CaBundleSecretRef.Builder):
                    value = output.build()
                else:
                    value = output
            return self._set("ca_bundle_secret_ref", value)

        @overload
        def credentials_ref(self, value_or_callback: CredentialsRef, /) -> "Tpp.Builder": ...

        @overload
        def credentials_ref(
            self,
            value_or_callback: Callable[
                [CredentialsRef.Builder], CredentialsRef.Builder | CredentialsRef
            ],
            /,
        ) -> "Tpp.Builder": ...

        @overload
        def credentials_ref(
            self, value_or_callback: Never = ...
        ) -> "CredentialsRef.BuilderContext": ...

        def credentials_ref(self, value_or_callback=None, /):
            """
            CredentialsRef is a reference to a Secret containing the Venafi TPP API credentials.
            The secret must contain the key 'access-token' for the Access Token Authentication,
            or two keys, 'username' and 'password' for the API Keys Authentication.
            """
            if self._in_context and value_or_callback is None:
                context = CredentialsRef.BuilderContext()
                context._parent_builder = self
                context._field_name = "credentials_ref"
                return context

            value = value_or_callback
            if callable(value_or_callback):
                output = value_or_callback(CredentialsRef.builder())
                if isinstance(output, CredentialsRef.Builder):
                    value = output.build()
                else:
                    value = output
            return self._set("credentials_ref", value)

        def url(self, value: str, /) -> Self:
            """
            URL is the base URL for the vedsdk endpoint of the Venafi TPP instance,
            for example: "https://tpp.example.com/vedsdk".
            """
            return self._set("url", value)

    class BuilderContext(BuilderContextBase["Tpp.Builder"]):
        def model_post_init(self, __context) -> None:
            self._builder = Tpp.Builder()
            self._builder._in_context = True
            self._parent_builder = None
            self._field_name = None

    @classmethod
    def builder(cls) -> Builder:
        return cls.Builder()

    @classmethod
    def new(cls) -> BuilderContext:
        """Creates a new context manager builder for Tpp."""
        return cls.BuilderContext()

    class ListBuilder(GenericListBuilder["Tpp", Builder]):
        def __init__(self):
            raise NotImplementedError(
                "This class is not meant to be instantiated. Use Tpp.list_builder() instead."
            )

    @classmethod
    def list_builder(cls) -> ListBuilder:
        return GenericListBuilder[cls, cls.Builder]()  # type: ignore

    ca_bundle: Annotated[Optional[str], Field(alias="caBundle")] = None
    """
    Base64-encoded bundle of PEM CAs which will be used to validate the certificate
    chain presented by the TPP server. Only used if using HTTPS; ignored for HTTP.
    If undefined, the certificate bundle in the cert-manager controller container
    is used to validate the chain.
    """
    ca_bundle_secret_ref: Annotated[
        Optional[CaBundleSecretRef], Field(alias="caBundleSecretRef")
    ] = None
    """
    Reference to a Secret containing a base64-encoded bundle of PEM CAs
    which will be used to validate the certificate chain presented by the TPP server.
    Only used if using HTTPS; ignored for HTTP. Mutually exclusive with CABundle.
    If neither CABundle nor CABundleSecretRef is defined, the certificate bundle in
    the cert-manager controller container is used to validate the TLS connection.
    """
    credentials_ref: Annotated[CredentialsRef, Field(alias="credentialsRef")]
    """
    CredentialsRef is a reference to a Secret containing the Venafi TPP API credentials.
    The secret must contain the key 'access-token' for the Access Token Authentication,
    or two keys, 'username' and 'password' for the API Keys Authentication.
    """
    url: str
    """
    URL is the base URL for the vedsdk endpoint of the Venafi TPP instance,
    for example: "https://tpp.example.com/vedsdk".
    """


class Venafi(BaseModel):
    class Builder(BaseModelBuilder):
        @property
        def cls(self) -> Type["Venafi"]:
            return Venafi

        def build(self) -> "Venafi":
            return Venafi(**self._attrs)

        @overload
        def cloud(self, value_or_callback: Optional[Cloud], /) -> "Venafi.Builder": ...

        @overload
        def cloud(
            self, value_or_callback: Callable[[Cloud.Builder], Cloud.Builder | Cloud], /
        ) -> "Venafi.Builder": ...

        @overload
        def cloud(self, value_or_callback: Never = ...) -> "Cloud.BuilderContext": ...

        def cloud(self, value_or_callback=None, /):
            """
            Cloud specifies the Venafi cloud configuration settings.
            Only one of TPP or Cloud may be specified.
            """
            if self._in_context and value_or_callback is None:
                context = Cloud.BuilderContext()
                context._parent_builder = self
                context._field_name = "cloud"
                return context

            value = value_or_callback
            if callable(value_or_callback):
                output = value_or_callback(Cloud.builder())
                if isinstance(output, Cloud.Builder):
                    value = output.build()
                else:
                    value = output
            return self._set("cloud", value)

        @overload
        def tpp(self, value_or_callback: Optional[Tpp], /) -> "Venafi.Builder": ...

        @overload
        def tpp(
            self, value_or_callback: Callable[[Tpp.Builder], Tpp.Builder | Tpp], /
        ) -> "Venafi.Builder": ...

        @overload
        def tpp(self, value_or_callback: Never = ...) -> "Tpp.BuilderContext": ...

        def tpp(self, value_or_callback=None, /):
            """
            TPP specifies Trust Protection Platform configuration settings.
            Only one of TPP or Cloud may be specified.
            """
            if self._in_context and value_or_callback is None:
                context = Tpp.BuilderContext()
                context._parent_builder = self
                context._field_name = "tpp"
                return context

            value = value_or_callback
            if callable(value_or_callback):
                output = value_or_callback(Tpp.builder())
                if isinstance(output, Tpp.Builder):
                    value = output.build()
                else:
                    value = output
            return self._set("tpp", value)

        def zone(self, value: str, /) -> Self:
            """
            Zone is the Venafi Policy Zone to use for this issuer.
            All requests made to the Venafi platform will be restricted by the named
            zone policy.
            This field is required.
            """
            return self._set("zone", value)

    class BuilderContext(BuilderContextBase["Venafi.Builder"]):
        def model_post_init(self, __context) -> None:
            self._builder = Venafi.Builder()
            self._builder._in_context = True
            self._parent_builder = None
            self._field_name = None

    @classmethod
    def builder(cls) -> Builder:
        return cls.Builder()

    @classmethod
    def new(cls) -> BuilderContext:
        """Creates a new context manager builder for Venafi."""
        return cls.BuilderContext()

    class ListBuilder(GenericListBuilder["Venafi", Builder]):
        def __init__(self):
            raise NotImplementedError(
                "This class is not meant to be instantiated. Use Venafi.list_builder() instead."
            )

    @classmethod
    def list_builder(cls) -> ListBuilder:
        return GenericListBuilder[cls, cls.Builder]()  # type: ignore

    cloud: Optional[Cloud] = None
    """
    Cloud specifies the Venafi cloud configuration settings.
    Only one of TPP or Cloud may be specified.
    """
    tpp: Optional[Tpp] = None
    """
    TPP specifies Trust Protection Platform configuration settings.
    Only one of TPP or Cloud may be specified.
    """
    zone: str
    """
    Zone is the Venafi Policy Zone to use for this issuer.
    All requests made to the Venafi platform will be restricted by the named
    zone policy.
    This field is required.
    """


class ClusterIssuerSpec(BaseModel):
    class Builder(BaseModelBuilder):
        @property
        def cls(self) -> Type["ClusterIssuerSpec"]:
            return ClusterIssuerSpec

        def build(self) -> "ClusterIssuerSpec":
            return ClusterIssuerSpec(**self._attrs)

        @overload
        def acme(self, value_or_callback: Optional[Acme], /) -> "ClusterIssuerSpec.Builder": ...

        @overload
        def acme(
            self, value_or_callback: Callable[[Acme.Builder], Acme.Builder | Acme], /
        ) -> "ClusterIssuerSpec.Builder": ...

        @overload
        def acme(self, value_or_callback: Never = ...) -> "Acme.BuilderContext": ...

        def acme(self, value_or_callback=None, /):
            """
            ACME configures this issuer to communicate with a RFC8555 (ACME) server
            to obtain signed x509 certificates.
            """
            if self._in_context and value_or_callback is None:
                context = Acme.BuilderContext()
                context._parent_builder = self
                context._field_name = "acme"
                return context

            value = value_or_callback
            if callable(value_or_callback):
                output = value_or_callback(Acme.builder())
                if isinstance(output, Acme.Builder):
                    value = output.build()
                else:
                    value = output
            return self._set("acme", value)

        @overload
        def ca(self, value_or_callback: Optional[Ca], /) -> "ClusterIssuerSpec.Builder": ...

        @overload
        def ca(
            self, value_or_callback: Callable[[Ca.Builder], Ca.Builder | Ca], /
        ) -> "ClusterIssuerSpec.Builder": ...

        @overload
        def ca(self, value_or_callback: Never = ...) -> "Ca.BuilderContext": ...

        def ca(self, value_or_callback=None, /):
            """
            CA configures this issuer to sign certificates using a signing CA keypair
            stored in a Secret resource.
            This is used to build internal PKIs that are managed by cert-manager.
            """
            if self._in_context and value_or_callback is None:
                context = Ca.BuilderContext()
                context._parent_builder = self
                context._field_name = "ca"
                return context

            value = value_or_callback
            if callable(value_or_callback):
                output = value_or_callback(Ca.builder())
                if isinstance(output, Ca.Builder):
                    value = output.build()
                else:
                    value = output
            return self._set("ca", value)

        @overload
        def self_signed(
            self, value_or_callback: Optional[SelfSigned], /
        ) -> "ClusterIssuerSpec.Builder": ...

        @overload
        def self_signed(
            self,
            value_or_callback: Callable[[SelfSigned.Builder], SelfSigned.Builder | SelfSigned],
            /,
        ) -> "ClusterIssuerSpec.Builder": ...

        @overload
        def self_signed(self, value_or_callback: Never = ...) -> "SelfSigned.BuilderContext": ...

        def self_signed(self, value_or_callback=None, /):
            """
            SelfSigned configures this issuer to 'self sign' certificates using the
            private key used to create the CertificateRequest object.
            """
            if self._in_context and value_or_callback is None:
                context = SelfSigned.BuilderContext()
                context._parent_builder = self
                context._field_name = "self_signed"
                return context

            value = value_or_callback
            if callable(value_or_callback):
                output = value_or_callback(SelfSigned.builder())
                if isinstance(output, SelfSigned.Builder):
                    value = output.build()
                else:
                    value = output
            return self._set("self_signed", value)

        @overload
        def vault(self, value_or_callback: Optional[Vault], /) -> "ClusterIssuerSpec.Builder": ...

        @overload
        def vault(
            self, value_or_callback: Callable[[Vault.Builder], Vault.Builder | Vault], /
        ) -> "ClusterIssuerSpec.Builder": ...

        @overload
        def vault(self, value_or_callback: Never = ...) -> "Vault.BuilderContext": ...

        def vault(self, value_or_callback=None, /):
            """
            Vault configures this issuer to sign certificates using a HashiCorp Vault
            PKI backend.
            """
            if self._in_context and value_or_callback is None:
                context = Vault.BuilderContext()
                context._parent_builder = self
                context._field_name = "vault"
                return context

            value = value_or_callback
            if callable(value_or_callback):
                output = value_or_callback(Vault.builder())
                if isinstance(output, Vault.Builder):
                    value = output.build()
                else:
                    value = output
            return self._set("vault", value)

        @overload
        def venafi(self, value_or_callback: Optional[Venafi], /) -> "ClusterIssuerSpec.Builder": ...

        @overload
        def venafi(
            self,
            value_or_callback: Callable[[Venafi.Builder], Venafi.Builder | Venafi],
            /,
        ) -> "ClusterIssuerSpec.Builder": ...

        @overload
        def venafi(self, value_or_callback: Never = ...) -> "Venafi.BuilderContext": ...

        def venafi(self, value_or_callback=None, /):
            """
            Venafi configures this issuer to sign certificates using a Venafi TPP
            or Venafi Cloud policy zone.
            """
            if self._in_context and value_or_callback is None:
                context = Venafi.BuilderContext()
                context._parent_builder = self
                context._field_name = "venafi"
                return context

            value = value_or_callback
            if callable(value_or_callback):
                output = value_or_callback(Venafi.builder())
                if isinstance(output, Venafi.Builder):
                    value = output.build()
                else:
                    value = output
            return self._set("venafi", value)

    class BuilderContext(BuilderContextBase["ClusterIssuerSpec.Builder"]):
        def model_post_init(self, __context) -> None:
            self._builder = ClusterIssuerSpec.Builder()
            self._builder._in_context = True
            self._parent_builder = None
            self._field_name = None

    @classmethod
    def builder(cls) -> Builder:
        return cls.Builder()

    @classmethod
    def new(cls) -> BuilderContext:
        """Creates a new context manager builder for ClusterIssuerSpec."""
        return cls.BuilderContext()

    class ListBuilder(GenericListBuilder["ClusterIssuerSpec", Builder]):
        def __init__(self):
            raise NotImplementedError(
                "This class is not meant to be instantiated. Use ClusterIssuerSpec.list_builder() instead."
            )

    @classmethod
    def list_builder(cls) -> ListBuilder:
        return GenericListBuilder[cls, cls.Builder]()  # type: ignore

    acme: Optional[Acme] = None
    """
    ACME configures this issuer to communicate with a RFC8555 (ACME) server
    to obtain signed x509 certificates.
    """
    ca: Optional[Ca] = None
    """
    CA configures this issuer to sign certificates using a signing CA keypair
    stored in a Secret resource.
    This is used to build internal PKIs that are managed by cert-manager.
    """
    self_signed: Annotated[Optional[SelfSigned], Field(alias="selfSigned")] = None
    """
    SelfSigned configures this issuer to 'self sign' certificates using the
    private key used to create the CertificateRequest object.
    """
    vault: Optional[Vault] = None
    """
    Vault configures this issuer to sign certificates using a HashiCorp Vault
    PKI backend.
    """
    venafi: Optional[Venafi] = None
    """
    Venafi configures this issuer to sign certificates using a Venafi TPP
    or Venafi Cloud policy zone.
    """


class AcmeModel(BaseModel):
    class Builder(BaseModelBuilder):
        @property
        def cls(self) -> Type["AcmeModel"]:
            return AcmeModel

        def build(self) -> "AcmeModel":
            return AcmeModel(**self._attrs)

        def last_private_key_hash(self, value: Optional[str], /) -> Self:
            """
            LastPrivateKeyHash is a hash of the private key associated with the latest
            registered ACME account, in order to track changes made to registered account
            associated with the Issuer
            """
            return self._set("last_private_key_hash", value)

        def last_registered_email(self, value: Optional[str], /) -> Self:
            """
            LastRegisteredEmail is the email associated with the latest registered
            ACME account, in order to track changes made to registered account
            associated with the  Issuer
            """
            return self._set("last_registered_email", value)

        def uri(self, value: Optional[str], /) -> Self:
            """
            URI is the unique account identifier, which can also be used to retrieve
            account details from the CA
            """
            return self._set("uri", value)

    class BuilderContext(BuilderContextBase["AcmeModel.Builder"]):
        def model_post_init(self, __context) -> None:
            self._builder = AcmeModel.Builder()
            self._builder._in_context = True
            self._parent_builder = None
            self._field_name = None

    @classmethod
    def builder(cls) -> Builder:
        return cls.Builder()

    @classmethod
    def new(cls) -> BuilderContext:
        """Creates a new context manager builder for AcmeModel."""
        return cls.BuilderContext()

    class ListBuilder(GenericListBuilder["AcmeModel", Builder]):
        def __init__(self):
            raise NotImplementedError(
                "This class is not meant to be instantiated. Use AcmeModel.list_builder() instead."
            )

    @classmethod
    def list_builder(cls) -> ListBuilder:
        return GenericListBuilder[cls, cls.Builder]()  # type: ignore

    last_private_key_hash: Annotated[Optional[str], Field(alias="lastPrivateKeyHash")] = None
    """
    LastPrivateKeyHash is a hash of the private key associated with the latest
    registered ACME account, in order to track changes made to registered account
    associated with the Issuer
    """
    last_registered_email: Annotated[Optional[str], Field(alias="lastRegisteredEmail")] = None
    """
    LastRegisteredEmail is the email associated with the latest registered
    ACME account, in order to track changes made to registered account
    associated with the  Issuer
    """
    uri: Optional[str] = None
    """
    URI is the unique account identifier, which can also be used to retrieve
    account details from the CA
    """


class ConditionModel1(BaseModel):
    class Builder(BaseModelBuilder):
        @property
        def cls(self) -> Type["ConditionModel1"]:
            return ConditionModel1

        def build(self) -> "ConditionModel1":
            return ConditionModel1(**self._attrs)

        def last_transition_time(self, value: Optional[datetime], /) -> Self:
            """
            LastTransitionTime is the timestamp corresponding to the last status
            change of this condition.
            """
            return self._set("last_transition_time", value)

        def message(self, value: Optional[str], /) -> Self:
            """
            Message is a human readable description of the details of the last
            transition, complementing reason.
            """
            return self._set("message", value)

        def observed_generation(self, value: Optional[int], /) -> Self:
            """
            If set, this represents the .metadata.generation that the condition was
            set based upon.
            For instance, if .metadata.generation is currently 12, but the
            .status.condition[x].observedGeneration is 9, the condition is out of date
            with respect to the current state of the Issuer.
            """
            return self._set("observed_generation", value)

        def reason(self, value: Optional[str], /) -> Self:
            """
            Reason is a brief machine readable explanation for the condition's last
            transition.
            """
            return self._set("reason", value)

        def status(self, value: Literal["True", "False", "Unknown"], /) -> Self:
            """
            Status of the condition, one of (`True`, `False`, `Unknown`).
            """
            return self._set("status", value)

        def type(self, value: str, /) -> Self:
            """
            Type of the condition, known values are (`Ready`).
            """
            return self._set("type", value)

    class BuilderContext(BuilderContextBase["ConditionModel1.Builder"]):
        def model_post_init(self, __context) -> None:
            self._builder = ConditionModel1.Builder()
            self._builder._in_context = True
            self._parent_builder = None
            self._field_name = None

    @classmethod
    def builder(cls) -> Builder:
        return cls.Builder()

    @classmethod
    def new(cls) -> BuilderContext:
        """Creates a new context manager builder for ConditionModel1."""
        return cls.BuilderContext()

    class ListBuilder(GenericListBuilder["ConditionModel1", Builder]):
        def __init__(self):
            raise NotImplementedError(
                "This class is not meant to be instantiated. Use ConditionModel1.list_builder() instead."
            )

    @classmethod
    def list_builder(cls) -> ListBuilder:
        return GenericListBuilder[cls, cls.Builder]()  # type: ignore

    last_transition_time: Annotated[Optional[datetime], Field(alias="lastTransitionTime")] = None
    """
    LastTransitionTime is the timestamp corresponding to the last status
    change of this condition.
    """
    message: Optional[str] = None
    """
    Message is a human readable description of the details of the last
    transition, complementing reason.
    """
    observed_generation: Annotated[Optional[int], Field(alias="observedGeneration")] = None
    """
    If set, this represents the .metadata.generation that the condition was
    set based upon.
    For instance, if .metadata.generation is currently 12, but the
    .status.condition[x].observedGeneration is 9, the condition is out of date
    with respect to the current state of the Issuer.
    """
    reason: Optional[str] = None
    """
    Reason is a brief machine readable explanation for the condition's last
    transition.
    """
    status: Literal["True", "False", "Unknown"]
    """
    Status of the condition, one of (`True`, `False`, `Unknown`).
    """
    type: str
    """
    Type of the condition, known values are (`Ready`).
    """


class ClusterIssuerStatus(BaseModel):
    class Builder(BaseModelBuilder):
        @property
        def cls(self) -> Type["ClusterIssuerStatus"]:
            return ClusterIssuerStatus

        def build(self) -> "ClusterIssuerStatus":
            return ClusterIssuerStatus(**self._attrs)

        @overload
        def acme(
            self, value_or_callback: Optional[AcmeModel], /
        ) -> "ClusterIssuerStatus.Builder": ...

        @overload
        def acme(
            self,
            value_or_callback: Callable[[AcmeModel.Builder], AcmeModel.Builder | AcmeModel],
            /,
        ) -> "ClusterIssuerStatus.Builder": ...

        @overload
        def acme(self, value_or_callback: Never = ...) -> "AcmeModel.BuilderContext": ...

        def acme(self, value_or_callback=None, /):
            """
            ACME specific status options.
            This field should only be set if the Issuer is configured to use an ACME
            server to issue certificates.
            """
            if self._in_context and value_or_callback is None:
                context = AcmeModel.BuilderContext()
                context._parent_builder = self
                context._field_name = "acme"
                return context

            value = value_or_callback
            if callable(value_or_callback):
                output = value_or_callback(AcmeModel.builder())
                if isinstance(output, AcmeModel.Builder):
                    value = output.build()
                else:
                    value = output
            return self._set("acme", value)

        @overload
        def conditions(
            self, value_or_callback: List[ConditionModel1], /
        ) -> "ClusterIssuerStatus.Builder": ...

        @overload
        def conditions(
            self,
            value_or_callback: Callable[
                [GenericListBuilder[ConditionModel1, ConditionModel1.Builder]],
                GenericListBuilder[ConditionModel1, ConditionModel1.Builder]
                | List[ConditionModel1],
            ],
            /,
        ) -> "ClusterIssuerStatus.Builder": ...

        @overload
        def conditions(
            self, value_or_callback: Never = ...
        ) -> ListBuilderContext[ConditionModel1.Builder]: ...

        def conditions(self, value_or_callback=None, /):
            """
            List of status conditions to indicate the status of a CertificateRequest.
            Known condition types are `Ready`.
            """
            if self._in_context and value_or_callback is None:
                context = ListBuilderContext[ConditionModel1.Builder]()
                context._parent_builder = self
                context._field_name = "conditions"
                return context

            value = value_or_callback
            if callable(value_or_callback):
                output = value_or_callback(ConditionModel1.list_builder())
                if isinstance(output, GenericListBuilder):
                    value = output.build()
                else:
                    value = output
            return self._set("conditions", value)

    class BuilderContext(BuilderContextBase["ClusterIssuerStatus.Builder"]):
        def model_post_init(self, __context) -> None:
            self._builder = ClusterIssuerStatus.Builder()
            self._builder._in_context = True
            self._parent_builder = None
            self._field_name = None

    @classmethod
    def builder(cls) -> Builder:
        return cls.Builder()

    @classmethod
    def new(cls) -> BuilderContext:
        """Creates a new context manager builder for ClusterIssuerStatus."""
        return cls.BuilderContext()

    class ListBuilder(GenericListBuilder["ClusterIssuerStatus", Builder]):
        def __init__(self):
            raise NotImplementedError(
                "This class is not meant to be instantiated. Use ClusterIssuerStatus.list_builder() instead."
            )

    @classmethod
    def list_builder(cls) -> ListBuilder:
        return GenericListBuilder[cls, cls.Builder]()  # type: ignore

    acme: Optional[AcmeModel] = None
    """
    ACME specific status options.
    This field should only be set if the Issuer is configured to use an ACME
    server to issue certificates.
    """
    conditions: Optional[List[ConditionModel1]] = None
    """
    List of status conditions to indicate the status of a CertificateRequest.
    Known condition types are `Ready`.
    """


class ServiceAccountRefModel1(BaseModel):
    class Builder(BaseModelBuilder):
        @property
        def cls(self) -> Type["ServiceAccountRefModel1"]:
            return ServiceAccountRefModel1

        def build(self) -> "ServiceAccountRefModel1":
            return ServiceAccountRefModel1(**self._attrs)

        def audiences(self, value: Optional[List[str]], /) -> Self:
            """
            TokenAudiences is an optional list of audiences to include in the
            token passed to AWS. The default token consisting of the issuer's namespace
            and name is always included.
            If unset the audience defaults to `sts.amazonaws.com`.
            """
            return self._set("audiences", value)

        def name(self, value: str, /) -> Self:
            """
            Name of the ServiceAccount used to request a token.
            """
            return self._set("name", value)

    class BuilderContext(BuilderContextBase["ServiceAccountRefModel1.Builder"]):
        def model_post_init(self, __context) -> None:
            self._builder = ServiceAccountRefModel1.Builder()
            self._builder._in_context = True
            self._parent_builder = None
            self._field_name = None

    @classmethod
    def builder(cls) -> Builder:
        return cls.Builder()

    @classmethod
    def new(cls) -> BuilderContext:
        """Creates a new context manager builder for ServiceAccountRefModel1."""
        return cls.BuilderContext()

    class ListBuilder(GenericListBuilder["ServiceAccountRefModel1", Builder]):
        def __init__(self):
            raise NotImplementedError(
                "This class is not meant to be instantiated. Use ServiceAccountRefModel1.list_builder() instead."
            )

    @classmethod
    def list_builder(cls) -> ListBuilder:
        return GenericListBuilder[cls, cls.Builder]()  # type: ignore

    audiences: Optional[List[str]] = None
    """
    TokenAudiences is an optional list of audiences to include in the
    token passed to AWS. The default token consisting of the issuer's namespace
    and name is always included.
    If unset the audience defaults to `sts.amazonaws.com`.
    """
    name: str
    """
    Name of the ServiceAccount used to request a token.
    """


class KubernetesModel1(BaseModel):
    class Builder(BaseModelBuilder):
        @property
        def cls(self) -> Type["KubernetesModel1"]:
            return KubernetesModel1

        def build(self) -> "KubernetesModel1":
            return KubernetesModel1(**self._attrs)

        @overload
        def service_account_ref(
            self, value_or_callback: ServiceAccountRefModel1, /
        ) -> "KubernetesModel1.Builder": ...

        @overload
        def service_account_ref(
            self,
            value_or_callback: Callable[
                [ServiceAccountRefModel1.Builder],
                ServiceAccountRefModel1.Builder | ServiceAccountRefModel1,
            ],
            /,
        ) -> "KubernetesModel1.Builder": ...

        @overload
        def service_account_ref(
            self, value_or_callback: Never = ...
        ) -> "ServiceAccountRefModel1.BuilderContext": ...

        def service_account_ref(self, value_or_callback=None, /):
            """
            A reference to a service account that will be used to request a bound
            token (also known as "projected token"). To use this field, you must
            configure an RBAC rule to let cert-manager request a token.
            """
            if self._in_context and value_or_callback is None:
                context = ServiceAccountRefModel1.BuilderContext()
                context._parent_builder = self
                context._field_name = "service_account_ref"
                return context

            value = value_or_callback
            if callable(value_or_callback):
                output = value_or_callback(ServiceAccountRefModel1.builder())
                if isinstance(output, ServiceAccountRefModel1.Builder):
                    value = output.build()
                else:
                    value = output
            return self._set("service_account_ref", value)

    class BuilderContext(BuilderContextBase["KubernetesModel1.Builder"]):
        def model_post_init(self, __context) -> None:
            self._builder = KubernetesModel1.Builder()
            self._builder._in_context = True
            self._parent_builder = None
            self._field_name = None

    @classmethod
    def builder(cls) -> Builder:
        return cls.Builder()

    @classmethod
    def new(cls) -> BuilderContext:
        """Creates a new context manager builder for KubernetesModel1."""
        return cls.BuilderContext()

    class ListBuilder(GenericListBuilder["KubernetesModel1", Builder]):
        def __init__(self):
            raise NotImplementedError(
                "This class is not meant to be instantiated. Use KubernetesModel1.list_builder() instead."
            )

    @classmethod
    def list_builder(cls) -> ListBuilder:
        return GenericListBuilder[cls, cls.Builder]()  # type: ignore

    service_account_ref: Annotated[ServiceAccountRefModel1, Field(alias="serviceAccountRef")]
    """
    A reference to a service account that will be used to request a bound
    token (also known as "projected token"). To use this field, you must
    configure an RBAC rule to let cert-manager request a token.
    """


class AuthModel1(BaseModel):
    class Builder(BaseModelBuilder):
        @property
        def cls(self) -> Type["AuthModel1"]:
            return AuthModel1

        def build(self) -> "AuthModel1":
            return AuthModel1(**self._attrs)

        @overload
        def kubernetes(self, value_or_callback: KubernetesModel1, /) -> "AuthModel1.Builder": ...

        @overload
        def kubernetes(
            self,
            value_or_callback: Callable[
                [KubernetesModel1.Builder], KubernetesModel1.Builder | KubernetesModel1
            ],
            /,
        ) -> "AuthModel1.Builder": ...

        @overload
        def kubernetes(
            self, value_or_callback: Never = ...
        ) -> "KubernetesModel1.BuilderContext": ...

        def kubernetes(self, value_or_callback=None, /):
            """
            Kubernetes authenticates with Route53 using AssumeRoleWithWebIdentity
            by passing a bound ServiceAccount token.
            """
            if self._in_context and value_or_callback is None:
                context = KubernetesModel1.BuilderContext()
                context._parent_builder = self
                context._field_name = "kubernetes"
                return context

            value = value_or_callback
            if callable(value_or_callback):
                output = value_or_callback(KubernetesModel1.builder())
                if isinstance(output, KubernetesModel1.Builder):
                    value = output.build()
                else:
                    value = output
            return self._set("kubernetes", value)

    class BuilderContext(BuilderContextBase["AuthModel1.Builder"]):
        def model_post_init(self, __context) -> None:
            self._builder = AuthModel1.Builder()
            self._builder._in_context = True
            self._parent_builder = None
            self._field_name = None

    @classmethod
    def builder(cls) -> Builder:
        return cls.Builder()

    @classmethod
    def new(cls) -> BuilderContext:
        """Creates a new context manager builder for AuthModel1."""
        return cls.BuilderContext()

    class ListBuilder(GenericListBuilder["AuthModel1", Builder]):
        def __init__(self):
            raise NotImplementedError(
                "This class is not meant to be instantiated. Use AuthModel1.list_builder() instead."
            )

    @classmethod
    def list_builder(cls) -> ListBuilder:
        return GenericListBuilder[cls, cls.Builder]()  # type: ignore

    kubernetes: KubernetesModel1
    """
    Kubernetes authenticates with Route53 using AssumeRoleWithWebIdentity
    by passing a bound ServiceAccount token.
    """


class MatchExpressionModel3(BaseModel):
    class Builder(BaseModelBuilder):
        @property
        def cls(self) -> Type["MatchExpressionModel3"]:
            return MatchExpressionModel3

        def build(self) -> "MatchExpressionModel3":
            return MatchExpressionModel3(**self._attrs)

        def key(self, value: str, /) -> Self:
            """
            The label key that the selector applies to.
            """
            return self._set("key", value)

        def operator(self, value: str, /) -> Self:
            """
            Represents a key's relationship to a set of values.
            Valid operators are In, NotIn, Exists, DoesNotExist. Gt, and Lt.
            """
            return self._set("operator", value)

        def values(self, value: Optional[List[str]], /) -> Self:
            """
            An array of string values. If the operator is In or NotIn,
            the values array must be non-empty. If the operator is Exists or DoesNotExist,
            the values array must be empty. If the operator is Gt or Lt, the values
            array must have a single element, which will be interpreted as an integer.
            This array is replaced during a strategic merge patch.
            """
            return self._set("values", value)

    class BuilderContext(BuilderContextBase["MatchExpressionModel3.Builder"]):
        def model_post_init(self, __context) -> None:
            self._builder = MatchExpressionModel3.Builder()
            self._builder._in_context = True
            self._parent_builder = None
            self._field_name = None

    @classmethod
    def builder(cls) -> Builder:
        return cls.Builder()

    @classmethod
    def new(cls) -> BuilderContext:
        """Creates a new context manager builder for MatchExpressionModel3."""
        return cls.BuilderContext()

    class ListBuilder(GenericListBuilder["MatchExpressionModel3", Builder]):
        def __init__(self):
            raise NotImplementedError(
                "This class is not meant to be instantiated. Use MatchExpressionModel3.list_builder() instead."
            )

    @classmethod
    def list_builder(cls) -> ListBuilder:
        return GenericListBuilder[cls, cls.Builder]()  # type: ignore

    key: str
    """
    The label key that the selector applies to.
    """
    operator: str
    """
    Represents a key's relationship to a set of values.
    Valid operators are In, NotIn, Exists, DoesNotExist. Gt, and Lt.
    """
    values: Optional[List[str]] = None
    """
    An array of string values. If the operator is In or NotIn,
    the values array must be non-empty. If the operator is Exists or DoesNotExist,
    the values array must be empty. If the operator is Gt or Lt, the values
    array must have a single element, which will be interpreted as an integer.
    This array is replaced during a strategic merge patch.
    """


class PreferredDuringSchedulingIgnoredDuringExecutionModel3(BaseModel):
    class Builder(BaseModelBuilder):
        @property
        def cls(self) -> Type["PreferredDuringSchedulingIgnoredDuringExecutionModel3"]:
            return PreferredDuringSchedulingIgnoredDuringExecutionModel3

        def build(self) -> "PreferredDuringSchedulingIgnoredDuringExecutionModel3":
            return PreferredDuringSchedulingIgnoredDuringExecutionModel3(**self._attrs)

        @overload
        def preference(
            self, value_or_callback: Preference, /
        ) -> "PreferredDuringSchedulingIgnoredDuringExecutionModel3.Builder": ...

        @overload
        def preference(
            self,
            value_or_callback: Callable[[Preference.Builder], Preference.Builder | Preference],
            /,
        ) -> "PreferredDuringSchedulingIgnoredDuringExecutionModel3.Builder": ...

        @overload
        def preference(self, value_or_callback: Never = ...) -> "Preference.BuilderContext": ...

        def preference(self, value_or_callback=None, /):
            """
            A node selector term, associated with the corresponding weight.
            """
            if self._in_context and value_or_callback is None:
                context = Preference.BuilderContext()
                context._parent_builder = self
                context._field_name = "preference"
                return context

            value = value_or_callback
            if callable(value_or_callback):
                output = value_or_callback(Preference.builder())
                if isinstance(output, Preference.Builder):
                    value = output.build()
                else:
                    value = output
            return self._set("preference", value)

        def weight(self, value: int, /) -> Self:
            """
            Weight associated with matching the corresponding nodeSelectorTerm, in the range 1-100.
            """
            return self._set("weight", value)

    class BuilderContext(
        BuilderContextBase["PreferredDuringSchedulingIgnoredDuringExecutionModel3.Builder"]
    ):
        def model_post_init(self, __context) -> None:
            self._builder = PreferredDuringSchedulingIgnoredDuringExecutionModel3.Builder()
            self._builder._in_context = True
            self._parent_builder = None
            self._field_name = None

    @classmethod
    def builder(cls) -> Builder:
        return cls.Builder()

    @classmethod
    def new(cls) -> BuilderContext:
        """Creates a new context manager builder for PreferredDuringSchedulingIgnoredDuringExecutionModel3."""
        return cls.BuilderContext()

    class ListBuilder(
        GenericListBuilder["PreferredDuringSchedulingIgnoredDuringExecutionModel3", Builder]
    ):
        def __init__(self):
            raise NotImplementedError(
                "This class is not meant to be instantiated. Use PreferredDuringSchedulingIgnoredDuringExecutionModel3.list_builder() instead."
            )

    @classmethod
    def list_builder(cls) -> ListBuilder:
        return GenericListBuilder[cls, cls.Builder]()  # type: ignore

    preference: Preference
    """
    A node selector term, associated with the corresponding weight.
    """
    weight: int
    """
    Weight associated with matching the corresponding nodeSelectorTerm, in the range 1-100.
    """


class RequiredDuringSchedulingIgnoredDuringExecutionModel3(BaseModel):
    class Builder(BaseModelBuilder):
        @property
        def cls(self) -> Type["RequiredDuringSchedulingIgnoredDuringExecutionModel3"]:
            return RequiredDuringSchedulingIgnoredDuringExecutionModel3

        def build(self) -> "RequiredDuringSchedulingIgnoredDuringExecutionModel3":
            return RequiredDuringSchedulingIgnoredDuringExecutionModel3(**self._attrs)

        @overload
        def node_selector_terms(
            self, value_or_callback: List[NodeSelectorTerm], /
        ) -> "RequiredDuringSchedulingIgnoredDuringExecutionModel3.Builder": ...

        @overload
        def node_selector_terms(
            self,
            value_or_callback: Callable[
                [GenericListBuilder[NodeSelectorTerm, NodeSelectorTerm.Builder]],
                GenericListBuilder[NodeSelectorTerm, NodeSelectorTerm.Builder]
                | List[NodeSelectorTerm],
            ],
            /,
        ) -> "RequiredDuringSchedulingIgnoredDuringExecutionModel3.Builder": ...

        @overload
        def node_selector_terms(
            self, value_or_callback: Never = ...
        ) -> ListBuilderContext[NodeSelectorTerm.Builder]: ...

        def node_selector_terms(self, value_or_callback=None, /):
            """
            Required. A list of node selector terms. The terms are ORed.
            """
            if self._in_context and value_or_callback is None:
                context = ListBuilderContext[NodeSelectorTerm.Builder]()
                context._parent_builder = self
                context._field_name = "node_selector_terms"
                return context

            value = value_or_callback
            if callable(value_or_callback):
                output = value_or_callback(NodeSelectorTerm.list_builder())
                if isinstance(output, GenericListBuilder):
                    value = output.build()
                else:
                    value = output
            return self._set("node_selector_terms", value)

    class BuilderContext(
        BuilderContextBase["RequiredDuringSchedulingIgnoredDuringExecutionModel3.Builder"]
    ):
        def model_post_init(self, __context) -> None:
            self._builder = RequiredDuringSchedulingIgnoredDuringExecutionModel3.Builder()
            self._builder._in_context = True
            self._parent_builder = None
            self._field_name = None

    @classmethod
    def builder(cls) -> Builder:
        return cls.Builder()

    @classmethod
    def new(cls) -> BuilderContext:
        """Creates a new context manager builder for RequiredDuringSchedulingIgnoredDuringExecutionModel3."""
        return cls.BuilderContext()

    class ListBuilder(
        GenericListBuilder["RequiredDuringSchedulingIgnoredDuringExecutionModel3", Builder]
    ):
        def __init__(self):
            raise NotImplementedError(
                "This class is not meant to be instantiated. Use RequiredDuringSchedulingIgnoredDuringExecutionModel3.list_builder() instead."
            )

    @classmethod
    def list_builder(cls) -> ListBuilder:
        return GenericListBuilder[cls, cls.Builder]()  # type: ignore

    node_selector_terms: Annotated[List[NodeSelectorTerm], Field(alias="nodeSelectorTerms")]
    """
    Required. A list of node selector terms. The terms are ORed.
    """


class MatchExpressionModel4(BaseModel):
    class Builder(BaseModelBuilder):
        @property
        def cls(self) -> Type["MatchExpressionModel4"]:
            return MatchExpressionModel4

        def build(self) -> "MatchExpressionModel4":
            return MatchExpressionModel4(**self._attrs)

        def key(self, value: str, /) -> Self:
            """
            key is the label key that the selector applies to.
            """
            return self._set("key", value)

        def operator(self, value: str, /) -> Self:
            """
            operator represents a key's relationship to a set of values.
            Valid operators are In, NotIn, Exists and DoesNotExist.
            """
            return self._set("operator", value)

        def values(self, value: Optional[List[str]], /) -> Self:
            """
            values is an array of string values. If the operator is In or NotIn,
            the values array must be non-empty. If the operator is Exists or DoesNotExist,
            the values array must be empty. This array is replaced during a strategic
            merge patch.
            """
            return self._set("values", value)

    class BuilderContext(BuilderContextBase["MatchExpressionModel4.Builder"]):
        def model_post_init(self, __context) -> None:
            self._builder = MatchExpressionModel4.Builder()
            self._builder._in_context = True
            self._parent_builder = None
            self._field_name = None

    @classmethod
    def builder(cls) -> Builder:
        return cls.Builder()

    @classmethod
    def new(cls) -> BuilderContext:
        """Creates a new context manager builder for MatchExpressionModel4."""
        return cls.BuilderContext()

    class ListBuilder(GenericListBuilder["MatchExpressionModel4", Builder]):
        def __init__(self):
            raise NotImplementedError(
                "This class is not meant to be instantiated. Use MatchExpressionModel4.list_builder() instead."
            )

    @classmethod
    def list_builder(cls) -> ListBuilder:
        return GenericListBuilder[cls, cls.Builder]()  # type: ignore

    key: str
    """
    key is the label key that the selector applies to.
    """
    operator: str
    """
    operator represents a key's relationship to a set of values.
    Valid operators are In, NotIn, Exists and DoesNotExist.
    """
    values: Optional[List[str]] = None
    """
    values is an array of string values. If the operator is In or NotIn,
    the values array must be non-empty. If the operator is Exists or DoesNotExist,
    the values array must be empty. This array is replaced during a strategic
    merge patch.
    """


class PreferredDuringSchedulingIgnoredDuringExecutionModel4(BaseModel):
    class Builder(BaseModelBuilder):
        @property
        def cls(self) -> Type["PreferredDuringSchedulingIgnoredDuringExecutionModel4"]:
            return PreferredDuringSchedulingIgnoredDuringExecutionModel4

        def build(self) -> "PreferredDuringSchedulingIgnoredDuringExecutionModel4":
            return PreferredDuringSchedulingIgnoredDuringExecutionModel4(**self._attrs)

        @overload
        def pod_affinity_term(
            self, value_or_callback: PodAffinityTerm, /
        ) -> "PreferredDuringSchedulingIgnoredDuringExecutionModel4.Builder": ...

        @overload
        def pod_affinity_term(
            self,
            value_or_callback: Callable[
                [PodAffinityTerm.Builder], PodAffinityTerm.Builder | PodAffinityTerm
            ],
            /,
        ) -> "PreferredDuringSchedulingIgnoredDuringExecutionModel4.Builder": ...

        @overload
        def pod_affinity_term(
            self, value_or_callback: Never = ...
        ) -> "PodAffinityTerm.BuilderContext": ...

        def pod_affinity_term(self, value_or_callback=None, /):
            """
            Required. A pod affinity term, associated with the corresponding weight.
            """
            if self._in_context and value_or_callback is None:
                context = PodAffinityTerm.BuilderContext()
                context._parent_builder = self
                context._field_name = "pod_affinity_term"
                return context

            value = value_or_callback
            if callable(value_or_callback):
                output = value_or_callback(PodAffinityTerm.builder())
                if isinstance(output, PodAffinityTerm.Builder):
                    value = output.build()
                else:
                    value = output
            return self._set("pod_affinity_term", value)

        def weight(self, value: int, /) -> Self:
            """
            weight associated with matching the corresponding podAffinityTerm,
            in the range 1-100.
            """
            return self._set("weight", value)

    class BuilderContext(
        BuilderContextBase["PreferredDuringSchedulingIgnoredDuringExecutionModel4.Builder"]
    ):
        def model_post_init(self, __context) -> None:
            self._builder = PreferredDuringSchedulingIgnoredDuringExecutionModel4.Builder()
            self._builder._in_context = True
            self._parent_builder = None
            self._field_name = None

    @classmethod
    def builder(cls) -> Builder:
        return cls.Builder()

    @classmethod
    def new(cls) -> BuilderContext:
        """Creates a new context manager builder for PreferredDuringSchedulingIgnoredDuringExecutionModel4."""
        return cls.BuilderContext()

    class ListBuilder(
        GenericListBuilder["PreferredDuringSchedulingIgnoredDuringExecutionModel4", Builder]
    ):
        def __init__(self):
            raise NotImplementedError(
                "This class is not meant to be instantiated. Use PreferredDuringSchedulingIgnoredDuringExecutionModel4.list_builder() instead."
            )

    @classmethod
    def list_builder(cls) -> ListBuilder:
        return GenericListBuilder[cls, cls.Builder]()  # type: ignore

    pod_affinity_term: Annotated[PodAffinityTerm, Field(alias="podAffinityTerm")]
    """
    Required. A pod affinity term, associated with the corresponding weight.
    """
    weight: int
    """
    weight associated with matching the corresponding podAffinityTerm,
    in the range 1-100.
    """


class RequiredDuringSchedulingIgnoredDuringExecutionModel4(BaseModel):
    class Builder(BaseModelBuilder):
        @property
        def cls(self) -> Type["RequiredDuringSchedulingIgnoredDuringExecutionModel4"]:
            return RequiredDuringSchedulingIgnoredDuringExecutionModel4

        def build(self) -> "RequiredDuringSchedulingIgnoredDuringExecutionModel4":
            return RequiredDuringSchedulingIgnoredDuringExecutionModel4(**self._attrs)

        @overload
        def label_selector(
            self, value_or_callback: Optional[LabelSelector], /
        ) -> "RequiredDuringSchedulingIgnoredDuringExecutionModel4.Builder": ...

        @overload
        def label_selector(
            self,
            value_or_callback: Callable[
                [LabelSelector.Builder], LabelSelector.Builder | LabelSelector
            ],
            /,
        ) -> "RequiredDuringSchedulingIgnoredDuringExecutionModel4.Builder": ...

        @overload
        def label_selector(
            self, value_or_callback: Never = ...
        ) -> "LabelSelector.BuilderContext": ...

        def label_selector(self, value_or_callback=None, /):
            """
            A label query over a set of resources, in this case pods.
            If it's null, this PodAffinityTerm matches with no Pods.
            """
            if self._in_context and value_or_callback is None:
                context = LabelSelector.BuilderContext()
                context._parent_builder = self
                context._field_name = "label_selector"
                return context

            value = value_or_callback
            if callable(value_or_callback):
                output = value_or_callback(LabelSelector.builder())
                if isinstance(output, LabelSelector.Builder):
                    value = output.build()
                else:
                    value = output
            return self._set("label_selector", value)

        def match_label_keys(self, value: Optional[List[str]], /) -> Self:
            """
            MatchLabelKeys is a set of pod label keys to select which pods will
            be taken into consideration. The keys are used to lookup values from the
            incoming pod labels, those key-value labels are merged with `labelSelector` as `key in (value)`
            to select the group of existing pods which pods will be taken into consideration
            for the incoming pod's pod (anti) affinity. Keys that don't exist in the incoming
            pod labels will be ignored. The default value is empty.
            The same key is forbidden to exist in both matchLabelKeys and labelSelector.
            Also, matchLabelKeys cannot be set when labelSelector isn't set.
            This is a beta field and requires enabling MatchLabelKeysInPodAffinity feature gate (enabled by default).
            """
            return self._set("match_label_keys", value)

        def mismatch_label_keys(self, value: Optional[List[str]], /) -> Self:
            """
            MismatchLabelKeys is a set of pod label keys to select which pods will
            be taken into consideration. The keys are used to lookup values from the
            incoming pod labels, those key-value labels are merged with `labelSelector` as `key notin (value)`
            to select the group of existing pods which pods will be taken into consideration
            for the incoming pod's pod (anti) affinity. Keys that don't exist in the incoming
            pod labels will be ignored. The default value is empty.
            The same key is forbidden to exist in both mismatchLabelKeys and labelSelector.
            Also, mismatchLabelKeys cannot be set when labelSelector isn't set.
            This is a beta field and requires enabling MatchLabelKeysInPodAffinity feature gate (enabled by default).
            """
            return self._set("mismatch_label_keys", value)

        @overload
        def namespace_selector(
            self, value_or_callback: Optional[NamespaceSelector], /
        ) -> "RequiredDuringSchedulingIgnoredDuringExecutionModel4.Builder": ...

        @overload
        def namespace_selector(
            self,
            value_or_callback: Callable[
                [NamespaceSelector.Builder],
                NamespaceSelector.Builder | NamespaceSelector,
            ],
            /,
        ) -> "RequiredDuringSchedulingIgnoredDuringExecutionModel4.Builder": ...

        @overload
        def namespace_selector(
            self, value_or_callback: Never = ...
        ) -> "NamespaceSelector.BuilderContext": ...

        def namespace_selector(self, value_or_callback=None, /):
            """
            A label query over the set of namespaces that the term applies to.
            The term is applied to the union of the namespaces selected by this field
            and the ones listed in the namespaces field.
            null selector and null or empty namespaces list means "this pod's namespace".
            An empty selector ({}) matches all namespaces.
            """
            if self._in_context and value_or_callback is None:
                context = NamespaceSelector.BuilderContext()
                context._parent_builder = self
                context._field_name = "namespace_selector"
                return context

            value = value_or_callback
            if callable(value_or_callback):
                output = value_or_callback(NamespaceSelector.builder())
                if isinstance(output, NamespaceSelector.Builder):
                    value = output.build()
                else:
                    value = output
            return self._set("namespace_selector", value)

        def namespaces(self, value: Optional[List[str]], /) -> Self:
            """
            namespaces specifies a static list of namespace names that the term applies to.
            The term is applied to the union of the namespaces listed in this field
            and the ones selected by namespaceSelector.
            null or empty namespaces list and null namespaceSelector means "this pod's namespace".
            """
            return self._set("namespaces", value)

        def topology_key(self, value: str, /) -> Self:
            """
            This pod should be co-located (affinity) or not co-located (anti-affinity) with the pods matching
            the labelSelector in the specified namespaces, where co-located is defined as running on a node
            whose value of the label with key topologyKey matches that of any node on which any of the
            selected pods is running.
            Empty topologyKey is not allowed.
            """
            return self._set("topology_key", value)

    class BuilderContext(
        BuilderContextBase["RequiredDuringSchedulingIgnoredDuringExecutionModel4.Builder"]
    ):
        def model_post_init(self, __context) -> None:
            self._builder = RequiredDuringSchedulingIgnoredDuringExecutionModel4.Builder()
            self._builder._in_context = True
            self._parent_builder = None
            self._field_name = None

    @classmethod
    def builder(cls) -> Builder:
        return cls.Builder()

    @classmethod
    def new(cls) -> BuilderContext:
        """Creates a new context manager builder for RequiredDuringSchedulingIgnoredDuringExecutionModel4."""
        return cls.BuilderContext()

    class ListBuilder(
        GenericListBuilder["RequiredDuringSchedulingIgnoredDuringExecutionModel4", Builder]
    ):
        def __init__(self):
            raise NotImplementedError(
                "This class is not meant to be instantiated. Use RequiredDuringSchedulingIgnoredDuringExecutionModel4.list_builder() instead."
            )

    @classmethod
    def list_builder(cls) -> ListBuilder:
        return GenericListBuilder[cls, cls.Builder]()  # type: ignore

    label_selector: Annotated[Optional[LabelSelector], Field(alias="labelSelector")] = None
    """
    A label query over a set of resources, in this case pods.
    If it's null, this PodAffinityTerm matches with no Pods.
    """
    match_label_keys: Annotated[Optional[List[str]], Field(alias="matchLabelKeys")] = None
    """
    MatchLabelKeys is a set of pod label keys to select which pods will
    be taken into consideration. The keys are used to lookup values from the
    incoming pod labels, those key-value labels are merged with `labelSelector` as `key in (value)`
    to select the group of existing pods which pods will be taken into consideration
    for the incoming pod's pod (anti) affinity. Keys that don't exist in the incoming
    pod labels will be ignored. The default value is empty.
    The same key is forbidden to exist in both matchLabelKeys and labelSelector.
    Also, matchLabelKeys cannot be set when labelSelector isn't set.
    This is a beta field and requires enabling MatchLabelKeysInPodAffinity feature gate (enabled by default).
    """
    mismatch_label_keys: Annotated[Optional[List[str]], Field(alias="mismatchLabelKeys")] = None
    """
    MismatchLabelKeys is a set of pod label keys to select which pods will
    be taken into consideration. The keys are used to lookup values from the
    incoming pod labels, those key-value labels are merged with `labelSelector` as `key notin (value)`
    to select the group of existing pods which pods will be taken into consideration
    for the incoming pod's pod (anti) affinity. Keys that don't exist in the incoming
    pod labels will be ignored. The default value is empty.
    The same key is forbidden to exist in both mismatchLabelKeys and labelSelector.
    Also, mismatchLabelKeys cannot be set when labelSelector isn't set.
    This is a beta field and requires enabling MatchLabelKeysInPodAffinity feature gate (enabled by default).
    """
    namespace_selector: Annotated[Optional[NamespaceSelector], Field(alias="namespaceSelector")] = (
        None
    )
    """
    A label query over the set of namespaces that the term applies to.
    The term is applied to the union of the namespaces selected by this field
    and the ones listed in the namespaces field.
    null selector and null or empty namespaces list means "this pod's namespace".
    An empty selector ({}) matches all namespaces.
    """
    namespaces: Optional[List[str]] = None
    """
    namespaces specifies a static list of namespace names that the term applies to.
    The term is applied to the union of the namespaces listed in this field
    and the ones selected by namespaceSelector.
    null or empty namespaces list and null namespaceSelector means "this pod's namespace".
    """
    topology_key: Annotated[str, Field(alias="topologyKey")]
    """
    This pod should be co-located (affinity) or not co-located (anti-affinity) with the pods matching
    the labelSelector in the specified namespaces, where co-located is defined as running on a node
    whose value of the label with key topologyKey matches that of any node on which any of the
    selected pods is running.
    Empty topologyKey is not allowed.
    """


class MetadataModel2(BaseModel):
    class Builder(BaseModelBuilder):
        @property
        def cls(self) -> Type["MetadataModel2"]:
            return MetadataModel2

        def build(self) -> "MetadataModel2":
            return MetadataModel2(**self._attrs)

        def annotations(self, value: Optional[Dict[str, str]], /) -> Self:
            """
            Annotations that should be added to the created ACME HTTP01 solver ingress.
            """
            return self._set("annotations", value)

        def labels(self, value: Optional[Dict[str, str]], /) -> Self:
            """
            Labels that should be added to the created ACME HTTP01 solver ingress.
            """
            return self._set("labels", value)

    class BuilderContext(BuilderContextBase["MetadataModel2.Builder"]):
        def model_post_init(self, __context) -> None:
            self._builder = MetadataModel2.Builder()
            self._builder._in_context = True
            self._parent_builder = None
            self._field_name = None

    @classmethod
    def builder(cls) -> Builder:
        return cls.Builder()

    @classmethod
    def new(cls) -> BuilderContext:
        """Creates a new context manager builder for MetadataModel2."""
        return cls.BuilderContext()

    class ListBuilder(GenericListBuilder["MetadataModel2", Builder]):
        def __init__(self):
            raise NotImplementedError(
                "This class is not meant to be instantiated. Use MetadataModel2.list_builder() instead."
            )

    @classmethod
    def list_builder(cls) -> ListBuilder:
        return GenericListBuilder[cls, cls.Builder]()  # type: ignore

    annotations: Optional[Dict[str, str]] = None
    """
    Annotations that should be added to the created ACME HTTP01 solver ingress.
    """
    labels: Optional[Dict[str, str]] = None
    """
    Labels that should be added to the created ACME HTTP01 solver ingress.
    """


class MetadataModel3(BaseModel):
    class Builder(BaseModelBuilder):
        @property
        def cls(self) -> Type["MetadataModel3"]:
            return MetadataModel3

        def build(self) -> "MetadataModel3":
            return MetadataModel3(**self._attrs)

        def annotations(self, value: Optional[Dict[str, str]], /) -> Self:
            """
            Annotations that should be added to the created ACME HTTP01 solver pods.
            """
            return self._set("annotations", value)

        def labels(self, value: Optional[Dict[str, str]], /) -> Self:
            """
            Labels that should be added to the created ACME HTTP01 solver pods.
            """
            return self._set("labels", value)

    class BuilderContext(BuilderContextBase["MetadataModel3.Builder"]):
        def model_post_init(self, __context) -> None:
            self._builder = MetadataModel3.Builder()
            self._builder._in_context = True
            self._parent_builder = None
            self._field_name = None

    @classmethod
    def builder(cls) -> Builder:
        return cls.Builder()

    @classmethod
    def new(cls) -> BuilderContext:
        """Creates a new context manager builder for MetadataModel3."""
        return cls.BuilderContext()

    class ListBuilder(GenericListBuilder["MetadataModel3", Builder]):
        def __init__(self):
            raise NotImplementedError(
                "This class is not meant to be instantiated. Use MetadataModel3.list_builder() instead."
            )

    @classmethod
    def list_builder(cls) -> ListBuilder:
        return GenericListBuilder[cls, cls.Builder]()  # type: ignore

    annotations: Optional[Dict[str, str]] = None
    """
    Annotations that should be added to the created ACME HTTP01 solver pods.
    """
    labels: Optional[Dict[str, str]] = None
    """
    Labels that should be added to the created ACME HTTP01 solver pods.
    """


class MatchExpressionModel5(BaseModel):
    class Builder(BaseModelBuilder):
        @property
        def cls(self) -> Type["MatchExpressionModel5"]:
            return MatchExpressionModel5

        def build(self) -> "MatchExpressionModel5":
            return MatchExpressionModel5(**self._attrs)

        def key(self, value: str, /) -> Self:
            """
            The label key that the selector applies to.
            """
            return self._set("key", value)

        def operator(self, value: str, /) -> Self:
            """
            Represents a key's relationship to a set of values.
            Valid operators are In, NotIn, Exists, DoesNotExist. Gt, and Lt.
            """
            return self._set("operator", value)

        def values(self, value: Optional[List[str]], /) -> Self:
            """
            An array of string values. If the operator is In or NotIn,
            the values array must be non-empty. If the operator is Exists or DoesNotExist,
            the values array must be empty. If the operator is Gt or Lt, the values
            array must have a single element, which will be interpreted as an integer.
            This array is replaced during a strategic merge patch.
            """
            return self._set("values", value)

    class BuilderContext(BuilderContextBase["MatchExpressionModel5.Builder"]):
        def model_post_init(self, __context) -> None:
            self._builder = MatchExpressionModel5.Builder()
            self._builder._in_context = True
            self._parent_builder = None
            self._field_name = None

    @classmethod
    def builder(cls) -> Builder:
        return cls.Builder()

    @classmethod
    def new(cls) -> BuilderContext:
        """Creates a new context manager builder for MatchExpressionModel5."""
        return cls.BuilderContext()

    class ListBuilder(GenericListBuilder["MatchExpressionModel5", Builder]):
        def __init__(self):
            raise NotImplementedError(
                "This class is not meant to be instantiated. Use MatchExpressionModel5.list_builder() instead."
            )

    @classmethod
    def list_builder(cls) -> ListBuilder:
        return GenericListBuilder[cls, cls.Builder]()  # type: ignore

    key: str
    """
    The label key that the selector applies to.
    """
    operator: str
    """
    Represents a key's relationship to a set of values.
    Valid operators are In, NotIn, Exists, DoesNotExist. Gt, and Lt.
    """
    values: Optional[List[str]] = None
    """
    An array of string values. If the operator is In or NotIn,
    the values array must be non-empty. If the operator is Exists or DoesNotExist,
    the values array must be empty. If the operator is Gt or Lt, the values
    array must have a single element, which will be interpreted as an integer.
    This array is replaced during a strategic merge patch.
    """


class PreferredDuringSchedulingIgnoredDuringExecutionModel5(BaseModel):
    class Builder(BaseModelBuilder):
        @property
        def cls(self) -> Type["PreferredDuringSchedulingIgnoredDuringExecutionModel5"]:
            return PreferredDuringSchedulingIgnoredDuringExecutionModel5

        def build(self) -> "PreferredDuringSchedulingIgnoredDuringExecutionModel5":
            return PreferredDuringSchedulingIgnoredDuringExecutionModel5(**self._attrs)

        @overload
        def preference(
            self, value_or_callback: Preference, /
        ) -> "PreferredDuringSchedulingIgnoredDuringExecutionModel5.Builder": ...

        @overload
        def preference(
            self,
            value_or_callback: Callable[[Preference.Builder], Preference.Builder | Preference],
            /,
        ) -> "PreferredDuringSchedulingIgnoredDuringExecutionModel5.Builder": ...

        @overload
        def preference(self, value_or_callback: Never = ...) -> "Preference.BuilderContext": ...

        def preference(self, value_or_callback=None, /):
            """
            A node selector term, associated with the corresponding weight.
            """
            if self._in_context and value_or_callback is None:
                context = Preference.BuilderContext()
                context._parent_builder = self
                context._field_name = "preference"
                return context

            value = value_or_callback
            if callable(value_or_callback):
                output = value_or_callback(Preference.builder())
                if isinstance(output, Preference.Builder):
                    value = output.build()
                else:
                    value = output
            return self._set("preference", value)

        def weight(self, value: int, /) -> Self:
            """
            Weight associated with matching the corresponding nodeSelectorTerm, in the range 1-100.
            """
            return self._set("weight", value)

    class BuilderContext(
        BuilderContextBase["PreferredDuringSchedulingIgnoredDuringExecutionModel5.Builder"]
    ):
        def model_post_init(self, __context) -> None:
            self._builder = PreferredDuringSchedulingIgnoredDuringExecutionModel5.Builder()
            self._builder._in_context = True
            self._parent_builder = None
            self._field_name = None

    @classmethod
    def builder(cls) -> Builder:
        return cls.Builder()

    @classmethod
    def new(cls) -> BuilderContext:
        """Creates a new context manager builder for PreferredDuringSchedulingIgnoredDuringExecutionModel5."""
        return cls.BuilderContext()

    class ListBuilder(
        GenericListBuilder["PreferredDuringSchedulingIgnoredDuringExecutionModel5", Builder]
    ):
        def __init__(self):
            raise NotImplementedError(
                "This class is not meant to be instantiated. Use PreferredDuringSchedulingIgnoredDuringExecutionModel5.list_builder() instead."
            )

    @classmethod
    def list_builder(cls) -> ListBuilder:
        return GenericListBuilder[cls, cls.Builder]()  # type: ignore

    preference: Preference
    """
    A node selector term, associated with the corresponding weight.
    """
    weight: int
    """
    Weight associated with matching the corresponding nodeSelectorTerm, in the range 1-100.
    """


class RequiredDuringSchedulingIgnoredDuringExecutionModel5(BaseModel):
    class Builder(BaseModelBuilder):
        @property
        def cls(self) -> Type["RequiredDuringSchedulingIgnoredDuringExecutionModel5"]:
            return RequiredDuringSchedulingIgnoredDuringExecutionModel5

        def build(self) -> "RequiredDuringSchedulingIgnoredDuringExecutionModel5":
            return RequiredDuringSchedulingIgnoredDuringExecutionModel5(**self._attrs)

        @overload
        def node_selector_terms(
            self, value_or_callback: List[NodeSelectorTerm], /
        ) -> "RequiredDuringSchedulingIgnoredDuringExecutionModel5.Builder": ...

        @overload
        def node_selector_terms(
            self,
            value_or_callback: Callable[
                [GenericListBuilder[NodeSelectorTerm, NodeSelectorTerm.Builder]],
                GenericListBuilder[NodeSelectorTerm, NodeSelectorTerm.Builder]
                | List[NodeSelectorTerm],
            ],
            /,
        ) -> "RequiredDuringSchedulingIgnoredDuringExecutionModel5.Builder": ...

        @overload
        def node_selector_terms(
            self, value_or_callback: Never = ...
        ) -> ListBuilderContext[NodeSelectorTerm.Builder]: ...

        def node_selector_terms(self, value_or_callback=None, /):
            """
            Required. A list of node selector terms. The terms are ORed.
            """
            if self._in_context and value_or_callback is None:
                context = ListBuilderContext[NodeSelectorTerm.Builder]()
                context._parent_builder = self
                context._field_name = "node_selector_terms"
                return context

            value = value_or_callback
            if callable(value_or_callback):
                output = value_or_callback(NodeSelectorTerm.list_builder())
                if isinstance(output, GenericListBuilder):
                    value = output.build()
                else:
                    value = output
            return self._set("node_selector_terms", value)

    class BuilderContext(
        BuilderContextBase["RequiredDuringSchedulingIgnoredDuringExecutionModel5.Builder"]
    ):
        def model_post_init(self, __context) -> None:
            self._builder = RequiredDuringSchedulingIgnoredDuringExecutionModel5.Builder()
            self._builder._in_context = True
            self._parent_builder = None
            self._field_name = None

    @classmethod
    def builder(cls) -> Builder:
        return cls.Builder()

    @classmethod
    def new(cls) -> BuilderContext:
        """Creates a new context manager builder for RequiredDuringSchedulingIgnoredDuringExecutionModel5."""
        return cls.BuilderContext()

    class ListBuilder(
        GenericListBuilder["RequiredDuringSchedulingIgnoredDuringExecutionModel5", Builder]
    ):
        def __init__(self):
            raise NotImplementedError(
                "This class is not meant to be instantiated. Use RequiredDuringSchedulingIgnoredDuringExecutionModel5.list_builder() instead."
            )

    @classmethod
    def list_builder(cls) -> ListBuilder:
        return GenericListBuilder[cls, cls.Builder]()  # type: ignore

    node_selector_terms: Annotated[List[NodeSelectorTerm], Field(alias="nodeSelectorTerms")]
    """
    Required. A list of node selector terms. The terms are ORed.
    """


class MatchExpressionModel6(BaseModel):
    class Builder(BaseModelBuilder):
        @property
        def cls(self) -> Type["MatchExpressionModel6"]:
            return MatchExpressionModel6

        def build(self) -> "MatchExpressionModel6":
            return MatchExpressionModel6(**self._attrs)

        def key(self, value: str, /) -> Self:
            """
            key is the label key that the selector applies to.
            """
            return self._set("key", value)

        def operator(self, value: str, /) -> Self:
            """
            operator represents a key's relationship to a set of values.
            Valid operators are In, NotIn, Exists and DoesNotExist.
            """
            return self._set("operator", value)

        def values(self, value: Optional[List[str]], /) -> Self:
            """
            values is an array of string values. If the operator is In or NotIn,
            the values array must be non-empty. If the operator is Exists or DoesNotExist,
            the values array must be empty. This array is replaced during a strategic
            merge patch.
            """
            return self._set("values", value)

    class BuilderContext(BuilderContextBase["MatchExpressionModel6.Builder"]):
        def model_post_init(self, __context) -> None:
            self._builder = MatchExpressionModel6.Builder()
            self._builder._in_context = True
            self._parent_builder = None
            self._field_name = None

    @classmethod
    def builder(cls) -> Builder:
        return cls.Builder()

    @classmethod
    def new(cls) -> BuilderContext:
        """Creates a new context manager builder for MatchExpressionModel6."""
        return cls.BuilderContext()

    class ListBuilder(GenericListBuilder["MatchExpressionModel6", Builder]):
        def __init__(self):
            raise NotImplementedError(
                "This class is not meant to be instantiated. Use MatchExpressionModel6.list_builder() instead."
            )

    @classmethod
    def list_builder(cls) -> ListBuilder:
        return GenericListBuilder[cls, cls.Builder]()  # type: ignore

    key: str
    """
    key is the label key that the selector applies to.
    """
    operator: str
    """
    operator represents a key's relationship to a set of values.
    Valid operators are In, NotIn, Exists and DoesNotExist.
    """
    values: Optional[List[str]] = None
    """
    values is an array of string values. If the operator is In or NotIn,
    the values array must be non-empty. If the operator is Exists or DoesNotExist,
    the values array must be empty. This array is replaced during a strategic
    merge patch.
    """


class PreferredDuringSchedulingIgnoredDuringExecutionModel6(BaseModel):
    class Builder(BaseModelBuilder):
        @property
        def cls(self) -> Type["PreferredDuringSchedulingIgnoredDuringExecutionModel6"]:
            return PreferredDuringSchedulingIgnoredDuringExecutionModel6

        def build(self) -> "PreferredDuringSchedulingIgnoredDuringExecutionModel6":
            return PreferredDuringSchedulingIgnoredDuringExecutionModel6(**self._attrs)

        @overload
        def pod_affinity_term(
            self, value_or_callback: PodAffinityTerm, /
        ) -> "PreferredDuringSchedulingIgnoredDuringExecutionModel6.Builder": ...

        @overload
        def pod_affinity_term(
            self,
            value_or_callback: Callable[
                [PodAffinityTerm.Builder], PodAffinityTerm.Builder | PodAffinityTerm
            ],
            /,
        ) -> "PreferredDuringSchedulingIgnoredDuringExecutionModel6.Builder": ...

        @overload
        def pod_affinity_term(
            self, value_or_callback: Never = ...
        ) -> "PodAffinityTerm.BuilderContext": ...

        def pod_affinity_term(self, value_or_callback=None, /):
            """
            Required. A pod affinity term, associated with the corresponding weight.
            """
            if self._in_context and value_or_callback is None:
                context = PodAffinityTerm.BuilderContext()
                context._parent_builder = self
                context._field_name = "pod_affinity_term"
                return context

            value = value_or_callback
            if callable(value_or_callback):
                output = value_or_callback(PodAffinityTerm.builder())
                if isinstance(output, PodAffinityTerm.Builder):
                    value = output.build()
                else:
                    value = output
            return self._set("pod_affinity_term", value)

        def weight(self, value: int, /) -> Self:
            """
            weight associated with matching the corresponding podAffinityTerm,
            in the range 1-100.
            """
            return self._set("weight", value)

    class BuilderContext(
        BuilderContextBase["PreferredDuringSchedulingIgnoredDuringExecutionModel6.Builder"]
    ):
        def model_post_init(self, __context) -> None:
            self._builder = PreferredDuringSchedulingIgnoredDuringExecutionModel6.Builder()
            self._builder._in_context = True
            self._parent_builder = None
            self._field_name = None

    @classmethod
    def builder(cls) -> Builder:
        return cls.Builder()

    @classmethod
    def new(cls) -> BuilderContext:
        """Creates a new context manager builder for PreferredDuringSchedulingIgnoredDuringExecutionModel6."""
        return cls.BuilderContext()

    class ListBuilder(
        GenericListBuilder["PreferredDuringSchedulingIgnoredDuringExecutionModel6", Builder]
    ):
        def __init__(self):
            raise NotImplementedError(
                "This class is not meant to be instantiated. Use PreferredDuringSchedulingIgnoredDuringExecutionModel6.list_builder() instead."
            )

    @classmethod
    def list_builder(cls) -> ListBuilder:
        return GenericListBuilder[cls, cls.Builder]()  # type: ignore

    pod_affinity_term: Annotated[PodAffinityTerm, Field(alias="podAffinityTerm")]
    """
    Required. A pod affinity term, associated with the corresponding weight.
    """
    weight: int
    """
    weight associated with matching the corresponding podAffinityTerm,
    in the range 1-100.
    """


class RequiredDuringSchedulingIgnoredDuringExecutionModel6(BaseModel):
    class Builder(BaseModelBuilder):
        @property
        def cls(self) -> Type["RequiredDuringSchedulingIgnoredDuringExecutionModel6"]:
            return RequiredDuringSchedulingIgnoredDuringExecutionModel6

        def build(self) -> "RequiredDuringSchedulingIgnoredDuringExecutionModel6":
            return RequiredDuringSchedulingIgnoredDuringExecutionModel6(**self._attrs)

        @overload
        def label_selector(
            self, value_or_callback: Optional[LabelSelector], /
        ) -> "RequiredDuringSchedulingIgnoredDuringExecutionModel6.Builder": ...

        @overload
        def label_selector(
            self,
            value_or_callback: Callable[
                [LabelSelector.Builder], LabelSelector.Builder | LabelSelector
            ],
            /,
        ) -> "RequiredDuringSchedulingIgnoredDuringExecutionModel6.Builder": ...

        @overload
        def label_selector(
            self, value_or_callback: Never = ...
        ) -> "LabelSelector.BuilderContext": ...

        def label_selector(self, value_or_callback=None, /):
            """
            A label query over a set of resources, in this case pods.
            If it's null, this PodAffinityTerm matches with no Pods.
            """
            if self._in_context and value_or_callback is None:
                context = LabelSelector.BuilderContext()
                context._parent_builder = self
                context._field_name = "label_selector"
                return context

            value = value_or_callback
            if callable(value_or_callback):
                output = value_or_callback(LabelSelector.builder())
                if isinstance(output, LabelSelector.Builder):
                    value = output.build()
                else:
                    value = output
            return self._set("label_selector", value)

        def match_label_keys(self, value: Optional[List[str]], /) -> Self:
            """
            MatchLabelKeys is a set of pod label keys to select which pods will
            be taken into consideration. The keys are used to lookup values from the
            incoming pod labels, those key-value labels are merged with `labelSelector` as `key in (value)`
            to select the group of existing pods which pods will be taken into consideration
            for the incoming pod's pod (anti) affinity. Keys that don't exist in the incoming
            pod labels will be ignored. The default value is empty.
            The same key is forbidden to exist in both matchLabelKeys and labelSelector.
            Also, matchLabelKeys cannot be set when labelSelector isn't set.
            This is a beta field and requires enabling MatchLabelKeysInPodAffinity feature gate (enabled by default).
            """
            return self._set("match_label_keys", value)

        def mismatch_label_keys(self, value: Optional[List[str]], /) -> Self:
            """
            MismatchLabelKeys is a set of pod label keys to select which pods will
            be taken into consideration. The keys are used to lookup values from the
            incoming pod labels, those key-value labels are merged with `labelSelector` as `key notin (value)`
            to select the group of existing pods which pods will be taken into consideration
            for the incoming pod's pod (anti) affinity. Keys that don't exist in the incoming
            pod labels will be ignored. The default value is empty.
            The same key is forbidden to exist in both mismatchLabelKeys and labelSelector.
            Also, mismatchLabelKeys cannot be set when labelSelector isn't set.
            This is a beta field and requires enabling MatchLabelKeysInPodAffinity feature gate (enabled by default).
            """
            return self._set("mismatch_label_keys", value)

        @overload
        def namespace_selector(
            self, value_or_callback: Optional[NamespaceSelector], /
        ) -> "RequiredDuringSchedulingIgnoredDuringExecutionModel6.Builder": ...

        @overload
        def namespace_selector(
            self,
            value_or_callback: Callable[
                [NamespaceSelector.Builder],
                NamespaceSelector.Builder | NamespaceSelector,
            ],
            /,
        ) -> "RequiredDuringSchedulingIgnoredDuringExecutionModel6.Builder": ...

        @overload
        def namespace_selector(
            self, value_or_callback: Never = ...
        ) -> "NamespaceSelector.BuilderContext": ...

        def namespace_selector(self, value_or_callback=None, /):
            """
            A label query over the set of namespaces that the term applies to.
            The term is applied to the union of the namespaces selected by this field
            and the ones listed in the namespaces field.
            null selector and null or empty namespaces list means "this pod's namespace".
            An empty selector ({}) matches all namespaces.
            """
            if self._in_context and value_or_callback is None:
                context = NamespaceSelector.BuilderContext()
                context._parent_builder = self
                context._field_name = "namespace_selector"
                return context

            value = value_or_callback
            if callable(value_or_callback):
                output = value_or_callback(NamespaceSelector.builder())
                if isinstance(output, NamespaceSelector.Builder):
                    value = output.build()
                else:
                    value = output
            return self._set("namespace_selector", value)

        def namespaces(self, value: Optional[List[str]], /) -> Self:
            """
            namespaces specifies a static list of namespace names that the term applies to.
            The term is applied to the union of the namespaces listed in this field
            and the ones selected by namespaceSelector.
            null or empty namespaces list and null namespaceSelector means "this pod's namespace".
            """
            return self._set("namespaces", value)

        def topology_key(self, value: str, /) -> Self:
            """
            This pod should be co-located (affinity) or not co-located (anti-affinity) with the pods matching
            the labelSelector in the specified namespaces, where co-located is defined as running on a node
            whose value of the label with key topologyKey matches that of any node on which any of the
            selected pods is running.
            Empty topologyKey is not allowed.
            """
            return self._set("topology_key", value)

    class BuilderContext(
        BuilderContextBase["RequiredDuringSchedulingIgnoredDuringExecutionModel6.Builder"]
    ):
        def model_post_init(self, __context) -> None:
            self._builder = RequiredDuringSchedulingIgnoredDuringExecutionModel6.Builder()
            self._builder._in_context = True
            self._parent_builder = None
            self._field_name = None

    @classmethod
    def builder(cls) -> Builder:
        return cls.Builder()

    @classmethod
    def new(cls) -> BuilderContext:
        """Creates a new context manager builder for RequiredDuringSchedulingIgnoredDuringExecutionModel6."""
        return cls.BuilderContext()

    class ListBuilder(
        GenericListBuilder["RequiredDuringSchedulingIgnoredDuringExecutionModel6", Builder]
    ):
        def __init__(self):
            raise NotImplementedError(
                "This class is not meant to be instantiated. Use RequiredDuringSchedulingIgnoredDuringExecutionModel6.list_builder() instead."
            )

    @classmethod
    def list_builder(cls) -> ListBuilder:
        return GenericListBuilder[cls, cls.Builder]()  # type: ignore

    label_selector: Annotated[Optional[LabelSelector], Field(alias="labelSelector")] = None
    """
    A label query over a set of resources, in this case pods.
    If it's null, this PodAffinityTerm matches with no Pods.
    """
    match_label_keys: Annotated[Optional[List[str]], Field(alias="matchLabelKeys")] = None
    """
    MatchLabelKeys is a set of pod label keys to select which pods will
    be taken into consideration. The keys are used to lookup values from the
    incoming pod labels, those key-value labels are merged with `labelSelector` as `key in (value)`
    to select the group of existing pods which pods will be taken into consideration
    for the incoming pod's pod (anti) affinity. Keys that don't exist in the incoming
    pod labels will be ignored. The default value is empty.
    The same key is forbidden to exist in both matchLabelKeys and labelSelector.
    Also, matchLabelKeys cannot be set when labelSelector isn't set.
    This is a beta field and requires enabling MatchLabelKeysInPodAffinity feature gate (enabled by default).
    """
    mismatch_label_keys: Annotated[Optional[List[str]], Field(alias="mismatchLabelKeys")] = None
    """
    MismatchLabelKeys is a set of pod label keys to select which pods will
    be taken into consideration. The keys are used to lookup values from the
    incoming pod labels, those key-value labels are merged with `labelSelector` as `key notin (value)`
    to select the group of existing pods which pods will be taken into consideration
    for the incoming pod's pod (anti) affinity. Keys that don't exist in the incoming
    pod labels will be ignored. The default value is empty.
    The same key is forbidden to exist in both mismatchLabelKeys and labelSelector.
    Also, mismatchLabelKeys cannot be set when labelSelector isn't set.
    This is a beta field and requires enabling MatchLabelKeysInPodAffinity feature gate (enabled by default).
    """
    namespace_selector: Annotated[Optional[NamespaceSelector], Field(alias="namespaceSelector")] = (
        None
    )
    """
    A label query over the set of namespaces that the term applies to.
    The term is applied to the union of the namespaces selected by this field
    and the ones listed in the namespaces field.
    null selector and null or empty namespaces list means "this pod's namespace".
    An empty selector ({}) matches all namespaces.
    """
    namespaces: Optional[List[str]] = None
    """
    namespaces specifies a static list of namespace names that the term applies to.
    The term is applied to the union of the namespaces listed in this field
    and the ones selected by namespaceSelector.
    null or empty namespaces list and null namespaceSelector means "this pod's namespace".
    """
    topology_key: Annotated[str, Field(alias="topologyKey")]
    """
    This pod should be co-located (affinity) or not co-located (anti-affinity) with the pods matching
    the labelSelector in the specified namespaces, where co-located is defined as running on a node
    whose value of the label with key topologyKey matches that of any node on which any of the
    selected pods is running.
    Empty topologyKey is not allowed.
    """


class AcmeModel1(BaseModel):
    class Builder(BaseModelBuilder):
        @property
        def cls(self) -> Type["AcmeModel1"]:
            return AcmeModel1

        def build(self) -> "AcmeModel1":
            return AcmeModel1(**self._attrs)

        def ca_bundle(self, value: Optional[str], /) -> Self:
            """
            Base64-encoded bundle of PEM CAs which can be used to validate the certificate
            chain presented by the ACME server.
            Mutually exclusive with SkipTLSVerify; prefer using CABundle to prevent various
            kinds of security vulnerabilities.
            If CABundle and SkipTLSVerify are unset, the system certificate bundle inside
            the container is used to validate the TLS connection.
            """
            return self._set("ca_bundle", value)

        def disable_account_key_generation(self, value: Optional[bool], /) -> Self:
            """
            Enables or disables generating a new ACME account key.
            If true, the Issuer resource will *not* request a new account but will expect
            the account key to be supplied via an existing secret.
            If false, the cert-manager system will generate a new ACME account key
            for the Issuer.
            Defaults to false.
            """
            return self._set("disable_account_key_generation", value)

        def email(self, value: Optional[str], /) -> Self:
            """
            Email is the email address to be associated with the ACME account.
            This field is optional, but it is strongly recommended to be set.
            It will be used to contact you in case of issues with your account or
            certificates, including expiry notification emails.
            This field may be updated after the account is initially registered.
            """
            return self._set("email", value)

        def enable_duration_feature(self, value: Optional[bool], /) -> Self:
            """
            Enables requesting a Not After date on certificates that matches the
            duration of the certificate. This is not supported by all ACME servers
            like Let's Encrypt. If set to true when the ACME server does not support
            it, it will create an error on the Order.
            Defaults to false.
            """
            return self._set("enable_duration_feature", value)

        @overload
        def external_account_binding(
            self, value_or_callback: Optional[ExternalAccountBinding], /
        ) -> "AcmeModel1.Builder": ...

        @overload
        def external_account_binding(
            self,
            value_or_callback: Callable[
                [ExternalAccountBinding.Builder],
                ExternalAccountBinding.Builder | ExternalAccountBinding,
            ],
            /,
        ) -> "AcmeModel1.Builder": ...

        @overload
        def external_account_binding(
            self, value_or_callback: Never = ...
        ) -> "ExternalAccountBinding.BuilderContext": ...

        def external_account_binding(self, value_or_callback=None, /):
            """
            ExternalAccountBinding is a reference to a CA external account of the ACME
            server.
            If set, upon registration cert-manager will attempt to associate the given
            external account credentials with the registered ACME account.
            """
            if self._in_context and value_or_callback is None:
                context = ExternalAccountBinding.BuilderContext()
                context._parent_builder = self
                context._field_name = "external_account_binding"
                return context

            value = value_or_callback
            if callable(value_or_callback):
                output = value_or_callback(ExternalAccountBinding.builder())
                if isinstance(output, ExternalAccountBinding.Builder):
                    value = output.build()
                else:
                    value = output
            return self._set("external_account_binding", value)

        def preferred_chain(self, value: Optional[str], /) -> Self:
            """
            PreferredChain is the chain to use if the ACME server outputs multiple.
            PreferredChain is no guarantee that this one gets delivered by the ACME
            endpoint.
            For example, for Let's Encrypt's DST crosssign you would use:
            "DST Root CA X3" or "ISRG Root X1" for the newer Let's Encrypt root CA.
            This value picks the first certificate bundle in the combined set of
            ACME default and alternative chains that has a root-most certificate with
            this value as its issuer's commonname.
            """
            return self._set("preferred_chain", value)

        @overload
        def private_key_secret_ref(
            self, value_or_callback: PrivateKeySecretRef, /
        ) -> "AcmeModel1.Builder": ...

        @overload
        def private_key_secret_ref(
            self,
            value_or_callback: Callable[
                [PrivateKeySecretRef.Builder],
                PrivateKeySecretRef.Builder | PrivateKeySecretRef,
            ],
            /,
        ) -> "AcmeModel1.Builder": ...

        @overload
        def private_key_secret_ref(
            self, value_or_callback: Never = ...
        ) -> "PrivateKeySecretRef.BuilderContext": ...

        def private_key_secret_ref(self, value_or_callback=None, /):
            """
            PrivateKey is the name of a Kubernetes Secret resource that will be used to
            store the automatically generated ACME account private key.
            Optionally, a `key` may be specified to select a specific entry within
            the named Secret resource.
            If `key` is not specified, a default of `tls.key` will be used.
            """
            if self._in_context and value_or_callback is None:
                context = PrivateKeySecretRef.BuilderContext()
                context._parent_builder = self
                context._field_name = "private_key_secret_ref"
                return context

            value = value_or_callback
            if callable(value_or_callback):
                output = value_or_callback(PrivateKeySecretRef.builder())
                if isinstance(output, PrivateKeySecretRef.Builder):
                    value = output.build()
                else:
                    value = output
            return self._set("private_key_secret_ref", value)

        def server(self, value: str, /) -> Self:
            """
            Server is the URL used to access the ACME server's 'directory' endpoint.
            For example, for Let's Encrypt's staging endpoint, you would use:
            "https://acme-staging-v02.api.letsencrypt.org/directory".
            Only ACME v2 endpoints (i.e. RFC 8555) are supported.
            """
            return self._set("server", value)

        def skip_tls_verify(self, value: Optional[bool], /) -> Self:
            """
            INSECURE: Enables or disables validation of the ACME server TLS certificate.
            If true, requests to the ACME server will not have the TLS certificate chain
            validated.
            Mutually exclusive with CABundle; prefer using CABundle to prevent various
            kinds of security vulnerabilities.
            Only enable this option in development environments.
            If CABundle and SkipTLSVerify are unset, the system certificate bundle inside
            the container is used to validate the TLS connection.
            Defaults to false.
            """
            return self._set("skip_tls_verify", value)

        @overload
        def solvers(self, value_or_callback: List[Solver], /) -> "AcmeModel1.Builder": ...

        @overload
        def solvers(
            self,
            value_or_callback: Callable[
                [GenericListBuilder[Solver, Solver.Builder]],
                GenericListBuilder[Solver, Solver.Builder] | List[Solver],
            ],
            /,
        ) -> "AcmeModel1.Builder": ...

        @overload
        def solvers(self, value_or_callback: Never = ...) -> ListBuilderContext[Solver.Builder]: ...

        def solvers(self, value_or_callback=None, /):
            """
            Solvers is a list of challenge solvers that will be used to solve
            ACME challenges for the matching domains.
            Solver configurations must be provided in order to obtain certificates
            from an ACME server.
            For more information, see: https://cert-manager.io/docs/configuration/acme/
            """
            if self._in_context and value_or_callback is None:
                context = ListBuilderContext[Solver.Builder]()
                context._parent_builder = self
                context._field_name = "solvers"
                return context

            value = value_or_callback
            if callable(value_or_callback):
                output = value_or_callback(Solver.list_builder())
                if isinstance(output, GenericListBuilder):
                    value = output.build()
                else:
                    value = output
            return self._set("solvers", value)

    class BuilderContext(BuilderContextBase["AcmeModel1.Builder"]):
        def model_post_init(self, __context) -> None:
            self._builder = AcmeModel1.Builder()
            self._builder._in_context = True
            self._parent_builder = None
            self._field_name = None

    @classmethod
    def builder(cls) -> Builder:
        return cls.Builder()

    @classmethod
    def new(cls) -> BuilderContext:
        """Creates a new context manager builder for AcmeModel1."""
        return cls.BuilderContext()

    class ListBuilder(GenericListBuilder["AcmeModel1", Builder]):
        def __init__(self):
            raise NotImplementedError(
                "This class is not meant to be instantiated. Use AcmeModel1.list_builder() instead."
            )

    @classmethod
    def list_builder(cls) -> ListBuilder:
        return GenericListBuilder[cls, cls.Builder]()  # type: ignore

    ca_bundle: Annotated[Optional[str], Field(alias="caBundle")] = None
    """
    Base64-encoded bundle of PEM CAs which can be used to validate the certificate
    chain presented by the ACME server.
    Mutually exclusive with SkipTLSVerify; prefer using CABundle to prevent various
    kinds of security vulnerabilities.
    If CABundle and SkipTLSVerify are unset, the system certificate bundle inside
    the container is used to validate the TLS connection.
    """
    disable_account_key_generation: Annotated[
        Optional[bool], Field(alias="disableAccountKeyGeneration")
    ] = None
    """
    Enables or disables generating a new ACME account key.
    If true, the Issuer resource will *not* request a new account but will expect
    the account key to be supplied via an existing secret.
    If false, the cert-manager system will generate a new ACME account key
    for the Issuer.
    Defaults to false.
    """
    email: Optional[str] = None
    """
    Email is the email address to be associated with the ACME account.
    This field is optional, but it is strongly recommended to be set.
    It will be used to contact you in case of issues with your account or
    certificates, including expiry notification emails.
    This field may be updated after the account is initially registered.
    """
    enable_duration_feature: Annotated[Optional[bool], Field(alias="enableDurationFeature")] = None
    """
    Enables requesting a Not After date on certificates that matches the
    duration of the certificate. This is not supported by all ACME servers
    like Let's Encrypt. If set to true when the ACME server does not support
    it, it will create an error on the Order.
    Defaults to false.
    """
    external_account_binding: Annotated[
        Optional[ExternalAccountBinding], Field(alias="externalAccountBinding")
    ] = None
    """
    ExternalAccountBinding is a reference to a CA external account of the ACME
    server.
    If set, upon registration cert-manager will attempt to associate the given
    external account credentials with the registered ACME account.
    """
    preferred_chain: Annotated[Optional[str], Field(alias="preferredChain", max_length=64)] = None
    """
    PreferredChain is the chain to use if the ACME server outputs multiple.
    PreferredChain is no guarantee that this one gets delivered by the ACME
    endpoint.
    For example, for Let's Encrypt's DST crosssign you would use:
    "DST Root CA X3" or "ISRG Root X1" for the newer Let's Encrypt root CA.
    This value picks the first certificate bundle in the combined set of
    ACME default and alternative chains that has a root-most certificate with
    this value as its issuer's commonname.
    """
    private_key_secret_ref: Annotated[PrivateKeySecretRef, Field(alias="privateKeySecretRef")]
    """
    PrivateKey is the name of a Kubernetes Secret resource that will be used to
    store the automatically generated ACME account private key.
    Optionally, a `key` may be specified to select a specific entry within
    the named Secret resource.
    If `key` is not specified, a default of `tls.key` will be used.
    """
    server: str
    """
    Server is the URL used to access the ACME server's 'directory' endpoint.
    For example, for Let's Encrypt's staging endpoint, you would use:
    "https://acme-staging-v02.api.letsencrypt.org/directory".
    Only ACME v2 endpoints (i.e. RFC 8555) are supported.
    """
    skip_tls_verify: Annotated[Optional[bool], Field(alias="skipTLSVerify")] = None
    """
    INSECURE: Enables or disables validation of the ACME server TLS certificate.
    If true, requests to the ACME server will not have the TLS certificate chain
    validated.
    Mutually exclusive with CABundle; prefer using CABundle to prevent various
    kinds of security vulnerabilities.
    Only enable this option in development environments.
    If CABundle and SkipTLSVerify are unset, the system certificate bundle inside
    the container is used to validate the TLS connection.
    Defaults to false.
    """
    solvers: Optional[List[Solver]] = None
    """
    Solvers is a list of challenge solvers that will be used to solve
    ACME challenges for the matching domains.
    Solver configurations must be provided in order to obtain certificates
    from an ACME server.
    For more information, see: https://cert-manager.io/docs/configuration/acme/
    """


class ServiceAccountRefModel2(BaseModel):
    class Builder(BaseModelBuilder):
        @property
        def cls(self) -> Type["ServiceAccountRefModel2"]:
            return ServiceAccountRefModel2

        def build(self) -> "ServiceAccountRefModel2":
            return ServiceAccountRefModel2(**self._attrs)

        def audiences(self, value: Optional[List[str]], /) -> Self:
            """
            TokenAudiences is an optional list of extra audiences to include in the token passed to Vault. The default token
            consisting of the issuer's namespace and name is always included.
            """
            return self._set("audiences", value)

        def name(self, value: str, /) -> Self:
            """
            Name of the ServiceAccount used to request a token.
            """
            return self._set("name", value)

    class BuilderContext(BuilderContextBase["ServiceAccountRefModel2.Builder"]):
        def model_post_init(self, __context) -> None:
            self._builder = ServiceAccountRefModel2.Builder()
            self._builder._in_context = True
            self._parent_builder = None
            self._field_name = None

    @classmethod
    def builder(cls) -> Builder:
        return cls.Builder()

    @classmethod
    def new(cls) -> BuilderContext:
        """Creates a new context manager builder for ServiceAccountRefModel2."""
        return cls.BuilderContext()

    class ListBuilder(GenericListBuilder["ServiceAccountRefModel2", Builder]):
        def __init__(self):
            raise NotImplementedError(
                "This class is not meant to be instantiated. Use ServiceAccountRefModel2.list_builder() instead."
            )

    @classmethod
    def list_builder(cls) -> ListBuilder:
        return GenericListBuilder[cls, cls.Builder]()  # type: ignore

    audiences: Optional[List[str]] = None
    """
    TokenAudiences is an optional list of extra audiences to include in the token passed to Vault. The default token
    consisting of the issuer's namespace and name is always included.
    """
    name: str
    """
    Name of the ServiceAccount used to request a token.
    """


class KubernetesModel2(BaseModel):
    class Builder(BaseModelBuilder):
        @property
        def cls(self) -> Type["KubernetesModel2"]:
            return KubernetesModel2

        def build(self) -> "KubernetesModel2":
            return KubernetesModel2(**self._attrs)

        def mount_path(self, value: Optional[str], /) -> Self:
            """
            The Vault mountPath here is the mount path to use when authenticating with
            Vault. For example, setting a value to `/v1/auth/foo`, will use the path
            `/v1/auth/foo/login` to authenticate with Vault. If unspecified, the
            default value "/v1/auth/kubernetes" will be used.
            """
            return self._set("mount_path", value)

        def role(self, value: str, /) -> Self:
            """
            A required field containing the Vault Role to assume. A Role binds a
            Kubernetes ServiceAccount with a set of Vault policies.
            """
            return self._set("role", value)

        @overload
        def secret_ref(
            self, value_or_callback: Optional[SecretRef], /
        ) -> "KubernetesModel2.Builder": ...

        @overload
        def secret_ref(
            self,
            value_or_callback: Callable[[SecretRef.Builder], SecretRef.Builder | SecretRef],
            /,
        ) -> "KubernetesModel2.Builder": ...

        @overload
        def secret_ref(self, value_or_callback: Never = ...) -> "SecretRef.BuilderContext": ...

        def secret_ref(self, value_or_callback=None, /):
            """
            The required Secret field containing a Kubernetes ServiceAccount JWT used
            for authenticating with Vault. Use of 'ambient credentials' is not
            supported.
            """
            if self._in_context and value_or_callback is None:
                context = SecretRef.BuilderContext()
                context._parent_builder = self
                context._field_name = "secret_ref"
                return context

            value = value_or_callback
            if callable(value_or_callback):
                output = value_or_callback(SecretRef.builder())
                if isinstance(output, SecretRef.Builder):
                    value = output.build()
                else:
                    value = output
            return self._set("secret_ref", value)

        @overload
        def service_account_ref(
            self, value_or_callback: Optional[ServiceAccountRefModel2], /
        ) -> "KubernetesModel2.Builder": ...

        @overload
        def service_account_ref(
            self,
            value_or_callback: Callable[
                [ServiceAccountRefModel2.Builder],
                ServiceAccountRefModel2.Builder | ServiceAccountRefModel2,
            ],
            /,
        ) -> "KubernetesModel2.Builder": ...

        @overload
        def service_account_ref(
            self, value_or_callback: Never = ...
        ) -> "ServiceAccountRefModel2.BuilderContext": ...

        def service_account_ref(self, value_or_callback=None, /):
            """
            A reference to a service account that will be used to request a bound
            token (also known as "projected token"). Compared to using "secretRef",
            using this field means that you don't rely on statically bound tokens. To
            use this field, you must configure an RBAC rule to let cert-manager
            request a token.
            """
            if self._in_context and value_or_callback is None:
                context = ServiceAccountRefModel2.BuilderContext()
                context._parent_builder = self
                context._field_name = "service_account_ref"
                return context

            value = value_or_callback
            if callable(value_or_callback):
                output = value_or_callback(ServiceAccountRefModel2.builder())
                if isinstance(output, ServiceAccountRefModel2.Builder):
                    value = output.build()
                else:
                    value = output
            return self._set("service_account_ref", value)

    class BuilderContext(BuilderContextBase["KubernetesModel2.Builder"]):
        def model_post_init(self, __context) -> None:
            self._builder = KubernetesModel2.Builder()
            self._builder._in_context = True
            self._parent_builder = None
            self._field_name = None

    @classmethod
    def builder(cls) -> Builder:
        return cls.Builder()

    @classmethod
    def new(cls) -> BuilderContext:
        """Creates a new context manager builder for KubernetesModel2."""
        return cls.BuilderContext()

    class ListBuilder(GenericListBuilder["KubernetesModel2", Builder]):
        def __init__(self):
            raise NotImplementedError(
                "This class is not meant to be instantiated. Use KubernetesModel2.list_builder() instead."
            )

    @classmethod
    def list_builder(cls) -> ListBuilder:
        return GenericListBuilder[cls, cls.Builder]()  # type: ignore

    mount_path: Annotated[Optional[str], Field(alias="mountPath")] = None
    """
    The Vault mountPath here is the mount path to use when authenticating with
    Vault. For example, setting a value to `/v1/auth/foo`, will use the path
    `/v1/auth/foo/login` to authenticate with Vault. If unspecified, the
    default value "/v1/auth/kubernetes" will be used.
    """
    role: str
    """
    A required field containing the Vault Role to assume. A Role binds a
    Kubernetes ServiceAccount with a set of Vault policies.
    """
    secret_ref: Annotated[Optional[SecretRef], Field(alias="secretRef")] = None
    """
    The required Secret field containing a Kubernetes ServiceAccount JWT used
    for authenticating with Vault. Use of 'ambient credentials' is not
    supported.
    """
    service_account_ref: Annotated[
        Optional[ServiceAccountRefModel2], Field(alias="serviceAccountRef")
    ] = None
    """
    A reference to a service account that will be used to request a bound
    token (also known as "projected token"). Compared to using "secretRef",
    using this field means that you don't rely on statically bound tokens. To
    use this field, you must configure an RBAC rule to let cert-manager
    request a token.
    """


class AuthModel2(BaseModel):
    class Builder(BaseModelBuilder):
        @property
        def cls(self) -> Type["AuthModel2"]:
            return AuthModel2

        def build(self) -> "AuthModel2":
            return AuthModel2(**self._attrs)

        @overload
        def app_role(self, value_or_callback: Optional[AppRole], /) -> "AuthModel2.Builder": ...

        @overload
        def app_role(
            self,
            value_or_callback: Callable[[AppRole.Builder], AppRole.Builder | AppRole],
            /,
        ) -> "AuthModel2.Builder": ...

        @overload
        def app_role(self, value_or_callback: Never = ...) -> "AppRole.BuilderContext": ...

        def app_role(self, value_or_callback=None, /):
            """
            AppRole authenticates with Vault using the App Role auth mechanism,
            with the role and secret stored in a Kubernetes Secret resource.
            """
            if self._in_context and value_or_callback is None:
                context = AppRole.BuilderContext()
                context._parent_builder = self
                context._field_name = "app_role"
                return context

            value = value_or_callback
            if callable(value_or_callback):
                output = value_or_callback(AppRole.builder())
                if isinstance(output, AppRole.Builder):
                    value = output.build()
                else:
                    value = output
            return self._set("app_role", value)

        @overload
        def client_certificate(
            self, value_or_callback: Optional[ClientCertificate], /
        ) -> "AuthModel2.Builder": ...

        @overload
        def client_certificate(
            self,
            value_or_callback: Callable[
                [ClientCertificate.Builder],
                ClientCertificate.Builder | ClientCertificate,
            ],
            /,
        ) -> "AuthModel2.Builder": ...

        @overload
        def client_certificate(
            self, value_or_callback: Never = ...
        ) -> "ClientCertificate.BuilderContext": ...

        def client_certificate(self, value_or_callback=None, /):
            """
            ClientCertificate authenticates with Vault by presenting a client
            certificate during the request's TLS handshake.
            Works only when using HTTPS protocol.
            """
            if self._in_context and value_or_callback is None:
                context = ClientCertificate.BuilderContext()
                context._parent_builder = self
                context._field_name = "client_certificate"
                return context

            value = value_or_callback
            if callable(value_or_callback):
                output = value_or_callback(ClientCertificate.builder())
                if isinstance(output, ClientCertificate.Builder):
                    value = output.build()
                else:
                    value = output
            return self._set("client_certificate", value)

        @overload
        def kubernetes(
            self, value_or_callback: Optional[KubernetesModel2], /
        ) -> "AuthModel2.Builder": ...

        @overload
        def kubernetes(
            self,
            value_or_callback: Callable[
                [KubernetesModel2.Builder], KubernetesModel2.Builder | KubernetesModel2
            ],
            /,
        ) -> "AuthModel2.Builder": ...

        @overload
        def kubernetes(
            self, value_or_callback: Never = ...
        ) -> "KubernetesModel2.BuilderContext": ...

        def kubernetes(self, value_or_callback=None, /):
            """
            Kubernetes authenticates with Vault by passing the ServiceAccount
            token stored in the named Secret resource to the Vault server.
            """
            if self._in_context and value_or_callback is None:
                context = KubernetesModel2.BuilderContext()
                context._parent_builder = self
                context._field_name = "kubernetes"
                return context

            value = value_or_callback
            if callable(value_or_callback):
                output = value_or_callback(KubernetesModel2.builder())
                if isinstance(output, KubernetesModel2.Builder):
                    value = output.build()
                else:
                    value = output
            return self._set("kubernetes", value)

        @overload
        def token_secret_ref(
            self, value_or_callback: Optional[TokenSecretRef], /
        ) -> "AuthModel2.Builder": ...

        @overload
        def token_secret_ref(
            self,
            value_or_callback: Callable[
                [TokenSecretRef.Builder], TokenSecretRef.Builder | TokenSecretRef
            ],
            /,
        ) -> "AuthModel2.Builder": ...

        @overload
        def token_secret_ref(
            self, value_or_callback: Never = ...
        ) -> "TokenSecretRef.BuilderContext": ...

        def token_secret_ref(self, value_or_callback=None, /):
            """
            TokenSecretRef authenticates with Vault by presenting a token.
            """
            if self._in_context and value_or_callback is None:
                context = TokenSecretRef.BuilderContext()
                context._parent_builder = self
                context._field_name = "token_secret_ref"
                return context

            value = value_or_callback
            if callable(value_or_callback):
                output = value_or_callback(TokenSecretRef.builder())
                if isinstance(output, TokenSecretRef.Builder):
                    value = output.build()
                else:
                    value = output
            return self._set("token_secret_ref", value)

    class BuilderContext(BuilderContextBase["AuthModel2.Builder"]):
        def model_post_init(self, __context) -> None:
            self._builder = AuthModel2.Builder()
            self._builder._in_context = True
            self._parent_builder = None
            self._field_name = None

    @classmethod
    def builder(cls) -> Builder:
        return cls.Builder()

    @classmethod
    def new(cls) -> BuilderContext:
        """Creates a new context manager builder for AuthModel2."""
        return cls.BuilderContext()

    class ListBuilder(GenericListBuilder["AuthModel2", Builder]):
        def __init__(self):
            raise NotImplementedError(
                "This class is not meant to be instantiated. Use AuthModel2.list_builder() instead."
            )

    @classmethod
    def list_builder(cls) -> ListBuilder:
        return GenericListBuilder[cls, cls.Builder]()  # type: ignore

    app_role: Annotated[Optional[AppRole], Field(alias="appRole")] = None
    """
    AppRole authenticates with Vault using the App Role auth mechanism,
    with the role and secret stored in a Kubernetes Secret resource.
    """
    client_certificate: Annotated[Optional[ClientCertificate], Field(alias="clientCertificate")] = (
        None
    )
    """
    ClientCertificate authenticates with Vault by presenting a client
    certificate during the request's TLS handshake.
    Works only when using HTTPS protocol.
    """
    kubernetes: Optional[KubernetesModel2] = None
    """
    Kubernetes authenticates with Vault by passing the ServiceAccount
    token stored in the named Secret resource to the Vault server.
    """
    token_secret_ref: Annotated[Optional[TokenSecretRef], Field(alias="tokenSecretRef")] = None
    """
    TokenSecretRef authenticates with Vault by presenting a token.
    """


class IssuerSpec(BaseModel):
    class Builder(BaseModelBuilder):
        @property
        def cls(self) -> Type["IssuerSpec"]:
            return IssuerSpec

        def build(self) -> "IssuerSpec":
            return IssuerSpec(**self._attrs)

        @overload
        def acme(self, value_or_callback: Optional[AcmeModel1], /) -> "IssuerSpec.Builder": ...

        @overload
        def acme(
            self,
            value_or_callback: Callable[[AcmeModel1.Builder], AcmeModel1.Builder | AcmeModel1],
            /,
        ) -> "IssuerSpec.Builder": ...

        @overload
        def acme(self, value_or_callback: Never = ...) -> "AcmeModel1.BuilderContext": ...

        def acme(self, value_or_callback=None, /):
            """
            ACME configures this issuer to communicate with a RFC8555 (ACME) server
            to obtain signed x509 certificates.
            """
            if self._in_context and value_or_callback is None:
                context = AcmeModel1.BuilderContext()
                context._parent_builder = self
                context._field_name = "acme"
                return context

            value = value_or_callback
            if callable(value_or_callback):
                output = value_or_callback(AcmeModel1.builder())
                if isinstance(output, AcmeModel1.Builder):
                    value = output.build()
                else:
                    value = output
            return self._set("acme", value)

        @overload
        def ca(self, value_or_callback: Optional[Ca], /) -> "IssuerSpec.Builder": ...

        @overload
        def ca(
            self, value_or_callback: Callable[[Ca.Builder], Ca.Builder | Ca], /
        ) -> "IssuerSpec.Builder": ...

        @overload
        def ca(self, value_or_callback: Never = ...) -> "Ca.BuilderContext": ...

        def ca(self, value_or_callback=None, /):
            """
            CA configures this issuer to sign certificates using a signing CA keypair
            stored in a Secret resource.
            This is used to build internal PKIs that are managed by cert-manager.
            """
            if self._in_context and value_or_callback is None:
                context = Ca.BuilderContext()
                context._parent_builder = self
                context._field_name = "ca"
                return context

            value = value_or_callback
            if callable(value_or_callback):
                output = value_or_callback(Ca.builder())
                if isinstance(output, Ca.Builder):
                    value = output.build()
                else:
                    value = output
            return self._set("ca", value)

        @overload
        def self_signed(
            self, value_or_callback: Optional[SelfSigned], /
        ) -> "IssuerSpec.Builder": ...

        @overload
        def self_signed(
            self,
            value_or_callback: Callable[[SelfSigned.Builder], SelfSigned.Builder | SelfSigned],
            /,
        ) -> "IssuerSpec.Builder": ...

        @overload
        def self_signed(self, value_or_callback: Never = ...) -> "SelfSigned.BuilderContext": ...

        def self_signed(self, value_or_callback=None, /):
            """
            SelfSigned configures this issuer to 'self sign' certificates using the
            private key used to create the CertificateRequest object.
            """
            if self._in_context and value_or_callback is None:
                context = SelfSigned.BuilderContext()
                context._parent_builder = self
                context._field_name = "self_signed"
                return context

            value = value_or_callback
            if callable(value_or_callback):
                output = value_or_callback(SelfSigned.builder())
                if isinstance(output, SelfSigned.Builder):
                    value = output.build()
                else:
                    value = output
            return self._set("self_signed", value)

        @overload
        def vault(self, value_or_callback: Optional[Vault], /) -> "IssuerSpec.Builder": ...

        @overload
        def vault(
            self, value_or_callback: Callable[[Vault.Builder], Vault.Builder | Vault], /
        ) -> "IssuerSpec.Builder": ...

        @overload
        def vault(self, value_or_callback: Never = ...) -> "Vault.BuilderContext": ...

        def vault(self, value_or_callback=None, /):
            """
            Vault configures this issuer to sign certificates using a HashiCorp Vault
            PKI backend.
            """
            if self._in_context and value_or_callback is None:
                context = Vault.BuilderContext()
                context._parent_builder = self
                context._field_name = "vault"
                return context

            value = value_or_callback
            if callable(value_or_callback):
                output = value_or_callback(Vault.builder())
                if isinstance(output, Vault.Builder):
                    value = output.build()
                else:
                    value = output
            return self._set("vault", value)

        @overload
        def venafi(self, value_or_callback: Optional[Venafi], /) -> "IssuerSpec.Builder": ...

        @overload
        def venafi(
            self,
            value_or_callback: Callable[[Venafi.Builder], Venafi.Builder | Venafi],
            /,
        ) -> "IssuerSpec.Builder": ...

        @overload
        def venafi(self, value_or_callback: Never = ...) -> "Venafi.BuilderContext": ...

        def venafi(self, value_or_callback=None, /):
            """
            Venafi configures this issuer to sign certificates using a Venafi TPP
            or Venafi Cloud policy zone.
            """
            if self._in_context and value_or_callback is None:
                context = Venafi.BuilderContext()
                context._parent_builder = self
                context._field_name = "venafi"
                return context

            value = value_or_callback
            if callable(value_or_callback):
                output = value_or_callback(Venafi.builder())
                if isinstance(output, Venafi.Builder):
                    value = output.build()
                else:
                    value = output
            return self._set("venafi", value)

    class BuilderContext(BuilderContextBase["IssuerSpec.Builder"]):
        def model_post_init(self, __context) -> None:
            self._builder = IssuerSpec.Builder()
            self._builder._in_context = True
            self._parent_builder = None
            self._field_name = None

    @classmethod
    def builder(cls) -> Builder:
        return cls.Builder()

    @classmethod
    def new(cls) -> BuilderContext:
        """Creates a new context manager builder for IssuerSpec."""
        return cls.BuilderContext()

    class ListBuilder(GenericListBuilder["IssuerSpec", Builder]):
        def __init__(self):
            raise NotImplementedError(
                "This class is not meant to be instantiated. Use IssuerSpec.list_builder() instead."
            )

    @classmethod
    def list_builder(cls) -> ListBuilder:
        return GenericListBuilder[cls, cls.Builder]()  # type: ignore

    acme: Optional[AcmeModel1] = None
    """
    ACME configures this issuer to communicate with a RFC8555 (ACME) server
    to obtain signed x509 certificates.
    """
    ca: Optional[Ca] = None
    """
    CA configures this issuer to sign certificates using a signing CA keypair
    stored in a Secret resource.
    This is used to build internal PKIs that are managed by cert-manager.
    """
    self_signed: Annotated[Optional[SelfSigned], Field(alias="selfSigned")] = None
    """
    SelfSigned configures this issuer to 'self sign' certificates using the
    private key used to create the CertificateRequest object.
    """
    vault: Optional[Vault] = None
    """
    Vault configures this issuer to sign certificates using a HashiCorp Vault
    PKI backend.
    """
    venafi: Optional[Venafi] = None
    """
    Venafi configures this issuer to sign certificates using a Venafi TPP
    or Venafi Cloud policy zone.
    """


class AcmeModel2(BaseModel):
    class Builder(BaseModelBuilder):
        @property
        def cls(self) -> Type["AcmeModel2"]:
            return AcmeModel2

        def build(self) -> "AcmeModel2":
            return AcmeModel2(**self._attrs)

        def last_private_key_hash(self, value: Optional[str], /) -> Self:
            """
            LastPrivateKeyHash is a hash of the private key associated with the latest
            registered ACME account, in order to track changes made to registered account
            associated with the Issuer
            """
            return self._set("last_private_key_hash", value)

        def last_registered_email(self, value: Optional[str], /) -> Self:
            """
            LastRegisteredEmail is the email associated with the latest registered
            ACME account, in order to track changes made to registered account
            associated with the  Issuer
            """
            return self._set("last_registered_email", value)

        def uri(self, value: Optional[str], /) -> Self:
            """
            URI is the unique account identifier, which can also be used to retrieve
            account details from the CA
            """
            return self._set("uri", value)

    class BuilderContext(BuilderContextBase["AcmeModel2.Builder"]):
        def model_post_init(self, __context) -> None:
            self._builder = AcmeModel2.Builder()
            self._builder._in_context = True
            self._parent_builder = None
            self._field_name = None

    @classmethod
    def builder(cls) -> Builder:
        return cls.Builder()

    @classmethod
    def new(cls) -> BuilderContext:
        """Creates a new context manager builder for AcmeModel2."""
        return cls.BuilderContext()

    class ListBuilder(GenericListBuilder["AcmeModel2", Builder]):
        def __init__(self):
            raise NotImplementedError(
                "This class is not meant to be instantiated. Use AcmeModel2.list_builder() instead."
            )

    @classmethod
    def list_builder(cls) -> ListBuilder:
        return GenericListBuilder[cls, cls.Builder]()  # type: ignore

    last_private_key_hash: Annotated[Optional[str], Field(alias="lastPrivateKeyHash")] = None
    """
    LastPrivateKeyHash is a hash of the private key associated with the latest
    registered ACME account, in order to track changes made to registered account
    associated with the Issuer
    """
    last_registered_email: Annotated[Optional[str], Field(alias="lastRegisteredEmail")] = None
    """
    LastRegisteredEmail is the email associated with the latest registered
    ACME account, in order to track changes made to registered account
    associated with the  Issuer
    """
    uri: Optional[str] = None
    """
    URI is the unique account identifier, which can also be used to retrieve
    account details from the CA
    """


class IssuerStatus(BaseModel):
    class Builder(BaseModelBuilder):
        @property
        def cls(self) -> Type["IssuerStatus"]:
            return IssuerStatus

        def build(self) -> "IssuerStatus":
            return IssuerStatus(**self._attrs)

        @overload
        def acme(self, value_or_callback: Optional[AcmeModel2], /) -> "IssuerStatus.Builder": ...

        @overload
        def acme(
            self,
            value_or_callback: Callable[[AcmeModel2.Builder], AcmeModel2.Builder | AcmeModel2],
            /,
        ) -> "IssuerStatus.Builder": ...

        @overload
        def acme(self, value_or_callback: Never = ...) -> "AcmeModel2.BuilderContext": ...

        def acme(self, value_or_callback=None, /):
            """
            ACME specific status options.
            This field should only be set if the Issuer is configured to use an ACME
            server to issue certificates.
            """
            if self._in_context and value_or_callback is None:
                context = AcmeModel2.BuilderContext()
                context._parent_builder = self
                context._field_name = "acme"
                return context

            value = value_or_callback
            if callable(value_or_callback):
                output = value_or_callback(AcmeModel2.builder())
                if isinstance(output, AcmeModel2.Builder):
                    value = output.build()
                else:
                    value = output
            return self._set("acme", value)

        @overload
        def conditions(
            self, value_or_callback: List[ConditionModel1], /
        ) -> "IssuerStatus.Builder": ...

        @overload
        def conditions(
            self,
            value_or_callback: Callable[
                [GenericListBuilder[ConditionModel1, ConditionModel1.Builder]],
                GenericListBuilder[ConditionModel1, ConditionModel1.Builder]
                | List[ConditionModel1],
            ],
            /,
        ) -> "IssuerStatus.Builder": ...

        @overload
        def conditions(
            self, value_or_callback: Never = ...
        ) -> ListBuilderContext[ConditionModel1.Builder]: ...

        def conditions(self, value_or_callback=None, /):
            """
            List of status conditions to indicate the status of a CertificateRequest.
            Known condition types are `Ready`.
            """
            if self._in_context and value_or_callback is None:
                context = ListBuilderContext[ConditionModel1.Builder]()
                context._parent_builder = self
                context._field_name = "conditions"
                return context

            value = value_or_callback
            if callable(value_or_callback):
                output = value_or_callback(ConditionModel1.list_builder())
                if isinstance(output, GenericListBuilder):
                    value = output.build()
                else:
                    value = output
            return self._set("conditions", value)

    class BuilderContext(BuilderContextBase["IssuerStatus.Builder"]):
        def model_post_init(self, __context) -> None:
            self._builder = IssuerStatus.Builder()
            self._builder._in_context = True
            self._parent_builder = None
            self._field_name = None

    @classmethod
    def builder(cls) -> Builder:
        return cls.Builder()

    @classmethod
    def new(cls) -> BuilderContext:
        """Creates a new context manager builder for IssuerStatus."""
        return cls.BuilderContext()

    class ListBuilder(GenericListBuilder["IssuerStatus", Builder]):
        def __init__(self):
            raise NotImplementedError(
                "This class is not meant to be instantiated. Use IssuerStatus.list_builder() instead."
            )

    @classmethod
    def list_builder(cls) -> ListBuilder:
        return GenericListBuilder[cls, cls.Builder]()  # type: ignore

    acme: Optional[AcmeModel2] = None
    """
    ACME specific status options.
    This field should only be set if the Issuer is configured to use an ACME
    server to issue certificates.
    """
    conditions: Optional[List[ConditionModel1]] = None
    """
    List of status conditions to indicate the status of a CertificateRequest.
    Known condition types are `Ready`.
    """


class CertificateRequest(Resource):
    class Builder(BaseModelBuilder):
        @property
        def cls(self) -> Type["CertificateRequest"]:
            return CertificateRequest

        def build(self) -> "CertificateRequest":
            return CertificateRequest(**self._attrs)

        def api_version(self, value: Optional[Literal["cert-manager.io/v1"]], /) -> Self:
            """
            APIVersion defines the versioned schema of this representation of an object.
            Servers should convert recognized schemas to the latest internal value, and
            may reject unrecognized values.
            More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
            """
            return self._set("api_version", value)

        def kind(self, value: Optional[Literal["CertificateRequest"]], /) -> Self:
            """
            Kind is a string value representing the REST resource this object represents.
            Servers may infer this from the endpoint the client submits requests to.
            Cannot be updated.
            In CamelCase.
            More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
            """
            return self._set("kind", value)

        @overload
        def metadata(
            self, value_or_callback: Optional[apimachinery.ObjectMeta], /
        ) -> "CertificateRequest.Builder": ...

        @overload
        def metadata(
            self,
            value_or_callback: Callable[
                [apimachinery.ObjectMeta.Builder],
                apimachinery.ObjectMeta.Builder | apimachinery.ObjectMeta,
            ],
            /,
        ) -> "CertificateRequest.Builder": ...

        @overload
        def metadata(
            self, value_or_callback: Never = ...
        ) -> "apimachinery.ObjectMeta.BuilderContext": ...

        def metadata(self, value_or_callback=None, /):
            if self._in_context and value_or_callback is None:
                context = apimachinery.ObjectMeta.BuilderContext()
                context._parent_builder = self
                context._field_name = "metadata"
                return context

            value = value_or_callback
            if callable(value_or_callback):
                output = value_or_callback(apimachinery.ObjectMeta.builder())
                if isinstance(output, apimachinery.ObjectMeta.Builder):
                    value = output.build()
                else:
                    value = output
            return self._set("metadata", value)

        @overload
        def spec(
            self, value_or_callback: Optional[CertificateRequestSpec], /
        ) -> "CertificateRequest.Builder": ...

        @overload
        def spec(
            self,
            value_or_callback: Callable[
                [CertificateRequestSpec.Builder],
                CertificateRequestSpec.Builder | CertificateRequestSpec,
            ],
            /,
        ) -> "CertificateRequest.Builder": ...

        @overload
        def spec(
            self, value_or_callback: Never = ...
        ) -> "CertificateRequestSpec.BuilderContext": ...

        def spec(self, value_or_callback=None, /):
            if self._in_context and value_or_callback is None:
                context = CertificateRequestSpec.BuilderContext()
                context._parent_builder = self
                context._field_name = "spec"
                return context

            value = value_or_callback
            if callable(value_or_callback):
                output = value_or_callback(CertificateRequestSpec.builder())
                if isinstance(output, CertificateRequestSpec.Builder):
                    value = output.build()
                else:
                    value = output
            return self._set("spec", value)

        @overload
        def status(
            self, value_or_callback: Optional[CertificateRequestStatus], /
        ) -> "CertificateRequest.Builder": ...

        @overload
        def status(
            self,
            value_or_callback: Callable[
                [CertificateRequestStatus.Builder],
                CertificateRequestStatus.Builder | CertificateRequestStatus,
            ],
            /,
        ) -> "CertificateRequest.Builder": ...

        @overload
        def status(
            self, value_or_callback: Never = ...
        ) -> "CertificateRequestStatus.BuilderContext": ...

        def status(self, value_or_callback=None, /):
            if self._in_context and value_or_callback is None:
                context = CertificateRequestStatus.BuilderContext()
                context._parent_builder = self
                context._field_name = "status"
                return context

            value = value_or_callback
            if callable(value_or_callback):
                output = value_or_callback(CertificateRequestStatus.builder())
                if isinstance(output, CertificateRequestStatus.Builder):
                    value = output.build()
                else:
                    value = output
            return self._set("status", value)

    class BuilderContext(BuilderContextBase["CertificateRequest.Builder"]):
        def model_post_init(self, __context) -> None:
            self._builder = CertificateRequest.Builder()
            self._builder._in_context = True
            self._parent_builder = None
            self._field_name = None

    @classmethod
    def builder(cls) -> Builder:
        return cls.Builder()

    @classmethod
    def new(cls) -> BuilderContext:
        """Creates a new context manager builder for CertificateRequest."""
        return cls.BuilderContext()

    class ListBuilder(GenericListBuilder["CertificateRequest", Builder]):
        def __init__(self):
            raise NotImplementedError(
                "This class is not meant to be instantiated. Use CertificateRequest.list_builder() instead."
            )

    @classmethod
    def list_builder(cls) -> ListBuilder:
        return GenericListBuilder[cls, cls.Builder]()  # type: ignore

    api_version: Annotated[Optional[Literal["cert-manager.io/v1"]], Field(alias="apiVersion")] = (
        "cert-manager.io/v1"
    )
    """
    APIVersion defines the versioned schema of this representation of an object.
    Servers should convert recognized schemas to the latest internal value, and
    may reject unrecognized values.
    More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
    """
    kind: Optional[Literal["CertificateRequest"]] = "CertificateRequest"
    """
    Kind is a string value representing the REST resource this object represents.
    Servers may infer this from the endpoint the client submits requests to.
    Cannot be updated.
    In CamelCase.
    More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
    """
    metadata: Optional[apimachinery.ObjectMeta] = None
    spec: Optional[CertificateRequestSpec] = None
    status: Optional[CertificateRequestStatus] = None


class Certificate(Resource):
    class Builder(BaseModelBuilder):
        @property
        def cls(self) -> Type["Certificate"]:
            return Certificate

        def build(self) -> "Certificate":
            return Certificate(**self._attrs)

        def api_version(self, value: Optional[Literal["cert-manager.io/v1"]], /) -> Self:
            """
            APIVersion defines the versioned schema of this representation of an object.
            Servers should convert recognized schemas to the latest internal value, and
            may reject unrecognized values.
            More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
            """
            return self._set("api_version", value)

        def kind(self, value: Optional[Literal["Certificate"]], /) -> Self:
            """
            Kind is a string value representing the REST resource this object represents.
            Servers may infer this from the endpoint the client submits requests to.
            Cannot be updated.
            In CamelCase.
            More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
            """
            return self._set("kind", value)

        @overload
        def metadata(
            self, value_or_callback: Optional[apimachinery.ObjectMeta], /
        ) -> "Certificate.Builder": ...

        @overload
        def metadata(
            self,
            value_or_callback: Callable[
                [apimachinery.ObjectMeta.Builder],
                apimachinery.ObjectMeta.Builder | apimachinery.ObjectMeta,
            ],
            /,
        ) -> "Certificate.Builder": ...

        @overload
        def metadata(
            self, value_or_callback: Never = ...
        ) -> "apimachinery.ObjectMeta.BuilderContext": ...

        def metadata(self, value_or_callback=None, /):
            if self._in_context and value_or_callback is None:
                context = apimachinery.ObjectMeta.BuilderContext()
                context._parent_builder = self
                context._field_name = "metadata"
                return context

            value = value_or_callback
            if callable(value_or_callback):
                output = value_or_callback(apimachinery.ObjectMeta.builder())
                if isinstance(output, apimachinery.ObjectMeta.Builder):
                    value = output.build()
                else:
                    value = output
            return self._set("metadata", value)

        @overload
        def spec(
            self, value_or_callback: Optional[CertificateSpec], /
        ) -> "Certificate.Builder": ...

        @overload
        def spec(
            self,
            value_or_callback: Callable[
                [CertificateSpec.Builder], CertificateSpec.Builder | CertificateSpec
            ],
            /,
        ) -> "Certificate.Builder": ...

        @overload
        def spec(self, value_or_callback: Never = ...) -> "CertificateSpec.BuilderContext": ...

        def spec(self, value_or_callback=None, /):
            if self._in_context and value_or_callback is None:
                context = CertificateSpec.BuilderContext()
                context._parent_builder = self
                context._field_name = "spec"
                return context

            value = value_or_callback
            if callable(value_or_callback):
                output = value_or_callback(CertificateSpec.builder())
                if isinstance(output, CertificateSpec.Builder):
                    value = output.build()
                else:
                    value = output
            return self._set("spec", value)

        @overload
        def status(
            self, value_or_callback: Optional[CertificateStatus], /
        ) -> "Certificate.Builder": ...

        @overload
        def status(
            self,
            value_or_callback: Callable[
                [CertificateStatus.Builder],
                CertificateStatus.Builder | CertificateStatus,
            ],
            /,
        ) -> "Certificate.Builder": ...

        @overload
        def status(self, value_or_callback: Never = ...) -> "CertificateStatus.BuilderContext": ...

        def status(self, value_or_callback=None, /):
            if self._in_context and value_or_callback is None:
                context = CertificateStatus.BuilderContext()
                context._parent_builder = self
                context._field_name = "status"
                return context

            value = value_or_callback
            if callable(value_or_callback):
                output = value_or_callback(CertificateStatus.builder())
                if isinstance(output, CertificateStatus.Builder):
                    value = output.build()
                else:
                    value = output
            return self._set("status", value)

    class BuilderContext(BuilderContextBase["Certificate.Builder"]):
        def model_post_init(self, __context) -> None:
            self._builder = Certificate.Builder()
            self._builder._in_context = True
            self._parent_builder = None
            self._field_name = None

    @classmethod
    def builder(cls) -> Builder:
        return cls.Builder()

    @classmethod
    def new(cls) -> BuilderContext:
        """Creates a new context manager builder for Certificate."""
        return cls.BuilderContext()

    class ListBuilder(GenericListBuilder["Certificate", Builder]):
        def __init__(self):
            raise NotImplementedError(
                "This class is not meant to be instantiated. Use Certificate.list_builder() instead."
            )

    @classmethod
    def list_builder(cls) -> ListBuilder:
        return GenericListBuilder[cls, cls.Builder]()  # type: ignore

    api_version: Annotated[Optional[Literal["cert-manager.io/v1"]], Field(alias="apiVersion")] = (
        "cert-manager.io/v1"
    )
    """
    APIVersion defines the versioned schema of this representation of an object.
    Servers should convert recognized schemas to the latest internal value, and
    may reject unrecognized values.
    More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
    """
    kind: Optional[Literal["Certificate"]] = "Certificate"
    """
    Kind is a string value representing the REST resource this object represents.
    Servers may infer this from the endpoint the client submits requests to.
    Cannot be updated.
    In CamelCase.
    More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
    """
    metadata: Optional[apimachinery.ObjectMeta] = None
    spec: Optional[CertificateSpec] = None
    status: Optional[CertificateStatus] = None


class ClusterIssuer(Resource):
    class Builder(BaseModelBuilder):
        @property
        def cls(self) -> Type["ClusterIssuer"]:
            return ClusterIssuer

        def build(self) -> "ClusterIssuer":
            return ClusterIssuer(**self._attrs)

        def api_version(self, value: Optional[Literal["cert-manager.io/v1"]], /) -> Self:
            """
            APIVersion defines the versioned schema of this representation of an object.
            Servers should convert recognized schemas to the latest internal value, and
            may reject unrecognized values.
            More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
            """
            return self._set("api_version", value)

        def kind(self, value: Optional[Literal["ClusterIssuer"]], /) -> Self:
            """
            Kind is a string value representing the REST resource this object represents.
            Servers may infer this from the endpoint the client submits requests to.
            Cannot be updated.
            In CamelCase.
            More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
            """
            return self._set("kind", value)

        @overload
        def metadata(
            self, value_or_callback: Optional[apimachinery.ObjectMeta], /
        ) -> "ClusterIssuer.Builder": ...

        @overload
        def metadata(
            self,
            value_or_callback: Callable[
                [apimachinery.ObjectMeta.Builder],
                apimachinery.ObjectMeta.Builder | apimachinery.ObjectMeta,
            ],
            /,
        ) -> "ClusterIssuer.Builder": ...

        @overload
        def metadata(
            self, value_or_callback: Never = ...
        ) -> "apimachinery.ObjectMeta.BuilderContext": ...

        def metadata(self, value_or_callback=None, /):
            if self._in_context and value_or_callback is None:
                context = apimachinery.ObjectMeta.BuilderContext()
                context._parent_builder = self
                context._field_name = "metadata"
                return context

            value = value_or_callback
            if callable(value_or_callback):
                output = value_or_callback(apimachinery.ObjectMeta.builder())
                if isinstance(output, apimachinery.ObjectMeta.Builder):
                    value = output.build()
                else:
                    value = output
            return self._set("metadata", value)

        @overload
        def spec(self, value_or_callback: ClusterIssuerSpec, /) -> "ClusterIssuer.Builder": ...

        @overload
        def spec(
            self,
            value_or_callback: Callable[
                [ClusterIssuerSpec.Builder],
                ClusterIssuerSpec.Builder | ClusterIssuerSpec,
            ],
            /,
        ) -> "ClusterIssuer.Builder": ...

        @overload
        def spec(self, value_or_callback: Never = ...) -> "ClusterIssuerSpec.BuilderContext": ...

        def spec(self, value_or_callback=None, /):
            if self._in_context and value_or_callback is None:
                context = ClusterIssuerSpec.BuilderContext()
                context._parent_builder = self
                context._field_name = "spec"
                return context

            value = value_or_callback
            if callable(value_or_callback):
                output = value_or_callback(ClusterIssuerSpec.builder())
                if isinstance(output, ClusterIssuerSpec.Builder):
                    value = output.build()
                else:
                    value = output
            return self._set("spec", value)

        @overload
        def status(
            self, value_or_callback: Optional[ClusterIssuerStatus], /
        ) -> "ClusterIssuer.Builder": ...

        @overload
        def status(
            self,
            value_or_callback: Callable[
                [ClusterIssuerStatus.Builder],
                ClusterIssuerStatus.Builder | ClusterIssuerStatus,
            ],
            /,
        ) -> "ClusterIssuer.Builder": ...

        @overload
        def status(
            self, value_or_callback: Never = ...
        ) -> "ClusterIssuerStatus.BuilderContext": ...

        def status(self, value_or_callback=None, /):
            if self._in_context and value_or_callback is None:
                context = ClusterIssuerStatus.BuilderContext()
                context._parent_builder = self
                context._field_name = "status"
                return context

            value = value_or_callback
            if callable(value_or_callback):
                output = value_or_callback(ClusterIssuerStatus.builder())
                if isinstance(output, ClusterIssuerStatus.Builder):
                    value = output.build()
                else:
                    value = output
            return self._set("status", value)

    class BuilderContext(BuilderContextBase["ClusterIssuer.Builder"]):
        def model_post_init(self, __context) -> None:
            self._builder = ClusterIssuer.Builder()
            self._builder._in_context = True
            self._parent_builder = None
            self._field_name = None

    @classmethod
    def builder(cls) -> Builder:
        return cls.Builder()

    @classmethod
    def new(cls) -> BuilderContext:
        """Creates a new context manager builder for ClusterIssuer."""
        return cls.BuilderContext()

    class ListBuilder(GenericListBuilder["ClusterIssuer", Builder]):
        def __init__(self):
            raise NotImplementedError(
                "This class is not meant to be instantiated. Use ClusterIssuer.list_builder() instead."
            )

    @classmethod
    def list_builder(cls) -> ListBuilder:
        return GenericListBuilder[cls, cls.Builder]()  # type: ignore

    api_version: Annotated[Optional[Literal["cert-manager.io/v1"]], Field(alias="apiVersion")] = (
        "cert-manager.io/v1"
    )
    """
    APIVersion defines the versioned schema of this representation of an object.
    Servers should convert recognized schemas to the latest internal value, and
    may reject unrecognized values.
    More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
    """
    kind: Optional[Literal["ClusterIssuer"]] = "ClusterIssuer"
    """
    Kind is a string value representing the REST resource this object represents.
    Servers may infer this from the endpoint the client submits requests to.
    Cannot be updated.
    In CamelCase.
    More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
    """
    metadata: Optional[apimachinery.ObjectMeta] = None
    spec: ClusterIssuerSpec
    status: Optional[ClusterIssuerStatus] = None


class Issuer(Resource):
    class Builder(BaseModelBuilder):
        @property
        def cls(self) -> Type["Issuer"]:
            return Issuer

        def build(self) -> "Issuer":
            return Issuer(**self._attrs)

        def api_version(self, value: Optional[Literal["cert-manager.io/v1"]], /) -> Self:
            """
            APIVersion defines the versioned schema of this representation of an object.
            Servers should convert recognized schemas to the latest internal value, and
            may reject unrecognized values.
            More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
            """
            return self._set("api_version", value)

        def kind(self, value: Optional[Literal["Issuer"]], /) -> Self:
            """
            Kind is a string value representing the REST resource this object represents.
            Servers may infer this from the endpoint the client submits requests to.
            Cannot be updated.
            In CamelCase.
            More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
            """
            return self._set("kind", value)

        @overload
        def metadata(
            self, value_or_callback: Optional[apimachinery.ObjectMeta], /
        ) -> "Issuer.Builder": ...

        @overload
        def metadata(
            self,
            value_or_callback: Callable[
                [apimachinery.ObjectMeta.Builder],
                apimachinery.ObjectMeta.Builder | apimachinery.ObjectMeta,
            ],
            /,
        ) -> "Issuer.Builder": ...

        @overload
        def metadata(
            self, value_or_callback: Never = ...
        ) -> "apimachinery.ObjectMeta.BuilderContext": ...

        def metadata(self, value_or_callback=None, /):
            if self._in_context and value_or_callback is None:
                context = apimachinery.ObjectMeta.BuilderContext()
                context._parent_builder = self
                context._field_name = "metadata"
                return context

            value = value_or_callback
            if callable(value_or_callback):
                output = value_or_callback(apimachinery.ObjectMeta.builder())
                if isinstance(output, apimachinery.ObjectMeta.Builder):
                    value = output.build()
                else:
                    value = output
            return self._set("metadata", value)

        @overload
        def spec(self, value_or_callback: IssuerSpec, /) -> "Issuer.Builder": ...

        @overload
        def spec(
            self,
            value_or_callback: Callable[[IssuerSpec.Builder], IssuerSpec.Builder | IssuerSpec],
            /,
        ) -> "Issuer.Builder": ...

        @overload
        def spec(self, value_or_callback: Never = ...) -> "IssuerSpec.BuilderContext": ...

        def spec(self, value_or_callback=None, /):
            if self._in_context and value_or_callback is None:
                context = IssuerSpec.BuilderContext()
                context._parent_builder = self
                context._field_name = "spec"
                return context

            value = value_or_callback
            if callable(value_or_callback):
                output = value_or_callback(IssuerSpec.builder())
                if isinstance(output, IssuerSpec.Builder):
                    value = output.build()
                else:
                    value = output
            return self._set("spec", value)

        @overload
        def status(self, value_or_callback: Optional[IssuerStatus], /) -> "Issuer.Builder": ...

        @overload
        def status(
            self,
            value_or_callback: Callable[
                [IssuerStatus.Builder], IssuerStatus.Builder | IssuerStatus
            ],
            /,
        ) -> "Issuer.Builder": ...

        @overload
        def status(self, value_or_callback: Never = ...) -> "IssuerStatus.BuilderContext": ...

        def status(self, value_or_callback=None, /):
            if self._in_context and value_or_callback is None:
                context = IssuerStatus.BuilderContext()
                context._parent_builder = self
                context._field_name = "status"
                return context

            value = value_or_callback
            if callable(value_or_callback):
                output = value_or_callback(IssuerStatus.builder())
                if isinstance(output, IssuerStatus.Builder):
                    value = output.build()
                else:
                    value = output
            return self._set("status", value)

    class BuilderContext(BuilderContextBase["Issuer.Builder"]):
        def model_post_init(self, __context) -> None:
            self._builder = Issuer.Builder()
            self._builder._in_context = True
            self._parent_builder = None
            self._field_name = None

    @classmethod
    def builder(cls) -> Builder:
        return cls.Builder()

    @classmethod
    def new(cls) -> BuilderContext:
        """Creates a new context manager builder for Issuer."""
        return cls.BuilderContext()

    class ListBuilder(GenericListBuilder["Issuer", Builder]):
        def __init__(self):
            raise NotImplementedError(
                "This class is not meant to be instantiated. Use Issuer.list_builder() instead."
            )

    @classmethod
    def list_builder(cls) -> ListBuilder:
        return GenericListBuilder[cls, cls.Builder]()  # type: ignore

    api_version: Annotated[Optional[Literal["cert-manager.io/v1"]], Field(alias="apiVersion")] = (
        "cert-manager.io/v1"
    )
    """
    APIVersion defines the versioned schema of this representation of an object.
    Servers should convert recognized schemas to the latest internal value, and
    may reject unrecognized values.
    More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
    """
    kind: Optional[Literal["Issuer"]] = "Issuer"
    """
    Kind is a string value representing the REST resource this object represents.
    Servers may infer this from the endpoint the client submits requests to.
    Cannot be updated.
    In CamelCase.
    More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
    """
    metadata: Optional[apimachinery.ObjectMeta] = None
    spec: IssuerSpec
    status: Optional[IssuerStatus] = None
