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

from __future__ import annotations

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

from pydantic import Field, RootModel

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


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

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

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

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

    class BuilderContext(BuilderContextBase["SecretKeyRef.Builder"]):
        def model_post_init(self, __context) -> None:
            self._builder = SecretKeyRef.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 SecretKeyRef."""
        return cls.BuilderContext()

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

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

    key: str
    name: str


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

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

        @overload
        def secret_key_ref(self, value_or_callback: SecretKeyRef, /) -> "ValueFrom.Builder": ...

        @overload
        def secret_key_ref(
            self,
            value_or_callback: Callable[
                [SecretKeyRef.Builder], SecretKeyRef.Builder | SecretKeyRef
            ],
            /,
        ) -> "ValueFrom.Builder": ...

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

        def secret_key_ref(self, value_or_callback=None, /):
            if self._in_context and value_or_callback is None:
                context = SecretKeyRef.BuilderContext()
                context._parent_builder = self
                context._field_name = "secret_key_ref"
                return context

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

    class BuilderContext(BuilderContextBase["ValueFrom.Builder"]):
        def model_post_init(self, __context) -> None:
            self._builder = ValueFrom.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 ValueFrom."""
        return cls.BuilderContext()

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

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

    secret_key_ref: Annotated[SecretKeyRef, Field(alias="secretKeyRef")]


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

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

        @overload
        def value_from(self, value_or_callback: ValueFrom, /) -> "AccessKey.Builder": ...

        @overload
        def value_from(
            self,
            value_or_callback: Callable[[ValueFrom.Builder], ValueFrom.Builder | ValueFrom],
            /,
        ) -> "AccessKey.Builder": ...

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

        def value_from(self, value_or_callback=None, /):
            if self._in_context and value_or_callback is None:
                context = ValueFrom.BuilderContext()
                context._parent_builder = self
                context._field_name = "value_from"
                return context

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

    class BuilderContext(BuilderContextBase["AccessKey.Builder"]):
        def model_post_init(self, __context) -> None:
            self._builder = AccessKey.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 AccessKey."""
        return cls.BuilderContext()

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

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

    value_from: Annotated[ValueFrom, Field(alias="valueFrom")]


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

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

        @overload
        def value_from(self, value_or_callback: ValueFrom, /) -> "AccessSecretKey.Builder": ...

        @overload
        def value_from(
            self,
            value_or_callback: Callable[[ValueFrom.Builder], ValueFrom.Builder | ValueFrom],
            /,
        ) -> "AccessSecretKey.Builder": ...

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

        def value_from(self, value_or_callback=None, /):
            if self._in_context and value_or_callback is None:
                context = ValueFrom.BuilderContext()
                context._parent_builder = self
                context._field_name = "value_from"
                return context

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

    class BuilderContext(BuilderContextBase["AccessSecretKey.Builder"]):
        def model_post_init(self, __context) -> None:
            self._builder = AccessSecretKey.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 AccessSecretKey."""
        return cls.BuilderContext()

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

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

    value_from: Annotated[ValueFrom, Field(alias="valueFrom")]


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

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

        @overload
        def value_from(self, value_or_callback: ValueFrom, /) -> "AccessToken.Builder": ...

        @overload
        def value_from(
            self,
            value_or_callback: Callable[[ValueFrom.Builder], ValueFrom.Builder | ValueFrom],
            /,
        ) -> "AccessToken.Builder": ...

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

        def value_from(self, value_or_callback=None, /):
            if self._in_context and value_or_callback is None:
                context = ValueFrom.BuilderContext()
                context._parent_builder = self
                context._field_name = "value_from"
                return context

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

    class BuilderContext(BuilderContextBase["AccessToken.Builder"]):
        def model_post_init(self, __context) -> None:
            self._builder = AccessToken.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 AccessToken."""
        return cls.BuilderContext()

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

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

    value_from: Annotated[ValueFrom, Field(alias="valueFrom")]


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

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

        @overload
        def access_key(self, value_or_callback: AccessKey, /) -> "Credentials.Builder": ...

        @overload
        def access_key(
            self,
            value_or_callback: Callable[[AccessKey.Builder], AccessKey.Builder | AccessKey],
            /,
        ) -> "Credentials.Builder": ...

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

        def access_key(self, value_or_callback=None, /):
            if self._in_context and value_or_callback is None:
                context = AccessKey.BuilderContext()
                context._parent_builder = self
                context._field_name = "access_key"
                return context

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

        @overload
        def access_secret_key(
            self, value_or_callback: AccessSecretKey, /
        ) -> "Credentials.Builder": ...

        @overload
        def access_secret_key(
            self,
            value_or_callback: Callable[
                [AccessSecretKey.Builder], AccessSecretKey.Builder | AccessSecretKey
            ],
            /,
        ) -> "Credentials.Builder": ...

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

        def access_secret_key(self, value_or_callback=None, /):
            if self._in_context and value_or_callback is None:
                context = AccessSecretKey.BuilderContext()
                context._parent_builder = self
                context._field_name = "access_secret_key"
                return context

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

        @overload
        def access_token(
            self, value_or_callback: Optional[AccessToken], /
        ) -> "Credentials.Builder": ...

        @overload
        def access_token(
            self,
            value_or_callback: Callable[[AccessToken.Builder], AccessToken.Builder | AccessToken],
            /,
        ) -> "Credentials.Builder": ...

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

        def access_token(self, value_or_callback=None, /):
            if self._in_context and value_or_callback is None:
                context = AccessToken.BuilderContext()
                context._parent_builder = self
                context._field_name = "access_token"
                return context

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

    class BuilderContext(BuilderContextBase["Credentials.Builder"]):
        def model_post_init(self, __context) -> None:
            self._builder = Credentials.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 Credentials."""
        return cls.BuilderContext()

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

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

    access_key: Annotated[AccessKey, Field(alias="accessKey")]
    access_secret_key: Annotated[AccessSecretKey, Field(alias="accessSecretKey")]
    access_token: Annotated[Optional[AccessToken], Field(alias="accessToken")] = None


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

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

        def identity_authority_host(self, value: Optional[str], /) -> Self:
            """
            Set identityAuthorityHost to override the default Azure authority host. If this is set, then the IdentityTenantID must also be set
            """
            return self._set("identity_authority_host", value)

        def identity_id(self, value: Optional[str], /) -> Self:
            return self._set("identity_id", value)

        def identity_owner(self, value: Optional[Literal["keda", "workload"]], /) -> Self:
            """
            IdentityOwner configures which identity has to be used during auto discovery, keda or the scaled workload. Mutually exclusive with roleArn
            """
            return self._set("identity_owner", value)

        def identity_tenant_id(self, value: Optional[str], /) -> Self:
            """
            Set identityTenantId to override the default Azure tenant id. If this is set, then the IdentityID must also be set
            """
            return self._set("identity_tenant_id", value)

        def provider(
            self, value: Literal["azure-workload", "gcp", "aws", "aws-eks", "none"], /
        ) -> Self:
            """
            PodIdentityProvider contains the list of providers
            """
            return self._set("provider", value)

        def role_arn(self, value: Optional[str], /) -> Self:
            """
            RoleArn sets the AWS RoleArn to be used. Mutually exclusive with IdentityOwner
            """
            return self._set("role_arn", value)

    class BuilderContext(BuilderContextBase["PodIdentity.Builder"]):
        def model_post_init(self, __context) -> None:
            self._builder = PodIdentity.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 PodIdentity."""
        return cls.BuilderContext()

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

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

    identity_authority_host: Annotated[Optional[str], Field(alias="identityAuthorityHost")] = None
    """
    Set identityAuthorityHost to override the default Azure authority host. If this is set, then the IdentityTenantID must also be set
    """
    identity_id: Annotated[Optional[str], Field(alias="identityId")] = None
    identity_owner: Annotated[
        Optional[Literal["keda", "workload"]], Field(alias="identityOwner")
    ] = None
    """
    IdentityOwner configures which identity has to be used during auto discovery, keda or the scaled workload. Mutually exclusive with roleArn
    """
    identity_tenant_id: Annotated[Optional[str], Field(alias="identityTenantId")] = None
    """
    Set identityTenantId to override the default Azure tenant id. If this is set, then the IdentityID must also be set
    """
    provider: Literal["azure-workload", "gcp", "aws", "aws-eks", "none"]
    """
    PodIdentityProvider contains the list of providers
    """
    role_arn: Annotated[Optional[str], Field(alias="roleArn")] = None
    """
    RoleArn sets the AWS RoleArn to be used. Mutually exclusive with IdentityOwner
    """


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

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

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

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

        def version_id(self, value: Optional[str], /) -> Self:
            return self._set("version_id", value)

        def version_stage(self, value: Optional[str], /) -> Self:
            return self._set("version_stage", value)

    class BuilderContext(BuilderContextBase["Secret.Builder"]):
        def model_post_init(self, __context) -> None:
            self._builder = Secret.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 Secret."""
        return cls.BuilderContext()

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

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

    name: str
    parameter: str
    version_id: Annotated[Optional[str], Field(alias="versionId")] = None
    version_stage: Annotated[Optional[str], Field(alias="versionStage")] = None


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

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

        @overload
        def credentials(
            self, value_or_callback: Optional[Credentials], /
        ) -> "AwsSecretManager.Builder": ...

        @overload
        def credentials(
            self,
            value_or_callback: Callable[[Credentials.Builder], Credentials.Builder | Credentials],
            /,
        ) -> "AwsSecretManager.Builder": ...

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

        def credentials(self, value_or_callback=None, /):
            if self._in_context and value_or_callback is None:
                context = Credentials.BuilderContext()
                context._parent_builder = self
                context._field_name = "credentials"
                return context

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

        @overload
        def pod_identity(
            self, value_or_callback: Optional[PodIdentity], /
        ) -> "AwsSecretManager.Builder": ...

        @overload
        def pod_identity(
            self,
            value_or_callback: Callable[[PodIdentity.Builder], PodIdentity.Builder | PodIdentity],
            /,
        ) -> "AwsSecretManager.Builder": ...

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

        def pod_identity(self, value_or_callback=None, /):
            """
            AuthPodIdentity allows users to select the platform native identity
            mechanism
            """
            if self._in_context and value_or_callback is None:
                context = PodIdentity.BuilderContext()
                context._parent_builder = self
                context._field_name = "pod_identity"
                return context

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

        def region(self, value: Optional[str], /) -> Self:
            return self._set("region", value)

        @overload
        def secrets(self, value_or_callback: List[Secret], /) -> "AwsSecretManager.Builder": ...

        @overload
        def secrets(
            self,
            value_or_callback: Callable[
                [GenericListBuilder[Secret, Secret.Builder]],
                GenericListBuilder[Secret, Secret.Builder] | List[Secret],
            ],
            /,
        ) -> "AwsSecretManager.Builder": ...

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

        def secrets(self, value_or_callback=None, /):
            if self._in_context and value_or_callback is None:
                context = ListBuilderContext[Secret.Builder]()
                context._parent_builder = self
                context._field_name = "secrets"
                return context

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

    class BuilderContext(BuilderContextBase["AwsSecretManager.Builder"]):
        def model_post_init(self, __context) -> None:
            self._builder = AwsSecretManager.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 AwsSecretManager."""
        return cls.BuilderContext()

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

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

    credentials: Optional[Credentials] = None
    pod_identity: Annotated[Optional[PodIdentity], Field(alias="podIdentity")] = None
    """
    AuthPodIdentity allows users to select the platform native identity
    mechanism
    """
    region: Optional[str] = None
    secrets: List[Secret]


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

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

        def active_directory_endpoint(self, value: Optional[str], /) -> Self:
            return self._set("active_directory_endpoint", value)

        def key_vault_resource_url(self, value: Optional[str], /) -> Self:
            return self._set("key_vault_resource_url", value)

        def type(self, value: str, /) -> Self:
            return self._set("type", 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

    active_directory_endpoint: Annotated[Optional[str], Field(alias="activeDirectoryEndpoint")] = (
        None
    )
    key_vault_resource_url: Annotated[Optional[str], Field(alias="keyVaultResourceURL")] = None
    type: str


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

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

        @overload
        def value_from(self, value_or_callback: ValueFrom, /) -> "ClientSecret.Builder": ...

        @overload
        def value_from(
            self,
            value_or_callback: Callable[[ValueFrom.Builder], ValueFrom.Builder | ValueFrom],
            /,
        ) -> "ClientSecret.Builder": ...

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

        def value_from(self, value_or_callback=None, /):
            if self._in_context and value_or_callback is None:
                context = ValueFrom.BuilderContext()
                context._parent_builder = self
                context._field_name = "value_from"
                return context

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

    class BuilderContext(BuilderContextBase["ClientSecret.Builder"]):
        def model_post_init(self, __context) -> None:
            self._builder = ClientSecret.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 ClientSecret."""
        return cls.BuilderContext()

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

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

    value_from: Annotated[ValueFrom, Field(alias="valueFrom")]


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

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

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

        @overload
        def client_secret(
            self, value_or_callback: ClientSecret, /
        ) -> "CredentialsModel.Builder": ...

        @overload
        def client_secret(
            self,
            value_or_callback: Callable[
                [ClientSecret.Builder], ClientSecret.Builder | ClientSecret
            ],
            /,
        ) -> "CredentialsModel.Builder": ...

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

        def client_secret(self, value_or_callback=None, /):
            if self._in_context and value_or_callback is None:
                context = ClientSecret.BuilderContext()
                context._parent_builder = self
                context._field_name = "client_secret"
                return context

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

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

    class BuilderContext(BuilderContextBase["CredentialsModel.Builder"]):
        def model_post_init(self, __context) -> None:
            self._builder = CredentialsModel.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 CredentialsModel."""
        return cls.BuilderContext()

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

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

    client_id: Annotated[str, Field(alias="clientId")]
    client_secret: Annotated[ClientSecret, Field(alias="clientSecret")]
    tenant_id: Annotated[str, Field(alias="tenantId")]


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

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

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

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

        def version(self, value: Optional[str], /) -> Self:
            return self._set("version", value)

    class BuilderContext(BuilderContextBase["SecretModel.Builder"]):
        def model_post_init(self, __context) -> None:
            self._builder = SecretModel.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 SecretModel."""
        return cls.BuilderContext()

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

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

    name: str
    parameter: str
    version: Optional[str] = None


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

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

        @overload
        def cloud(self, value_or_callback: Optional[Cloud], /) -> "AzureKeyVault.Builder": ...

        @overload
        def cloud(
            self, value_or_callback: Callable[[Cloud.Builder], Cloud.Builder | Cloud], /
        ) -> "AzureKeyVault.Builder": ...

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

        def cloud(self, value_or_callback=None, /):
            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 credentials(
            self, value_or_callback: Optional[CredentialsModel], /
        ) -> "AzureKeyVault.Builder": ...

        @overload
        def credentials(
            self,
            value_or_callback: Callable[
                [CredentialsModel.Builder], CredentialsModel.Builder | CredentialsModel
            ],
            /,
        ) -> "AzureKeyVault.Builder": ...

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

        def credentials(self, value_or_callback=None, /):
            if self._in_context and value_or_callback is None:
                context = CredentialsModel.BuilderContext()
                context._parent_builder = self
                context._field_name = "credentials"
                return context

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

        @overload
        def pod_identity(
            self, value_or_callback: Optional[PodIdentity], /
        ) -> "AzureKeyVault.Builder": ...

        @overload
        def pod_identity(
            self,
            value_or_callback: Callable[[PodIdentity.Builder], PodIdentity.Builder | PodIdentity],
            /,
        ) -> "AzureKeyVault.Builder": ...

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

        def pod_identity(self, value_or_callback=None, /):
            """
            AuthPodIdentity allows users to select the platform native identity
            mechanism
            """
            if self._in_context and value_or_callback is None:
                context = PodIdentity.BuilderContext()
                context._parent_builder = self
                context._field_name = "pod_identity"
                return context

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

        @overload
        def secrets(self, value_or_callback: List[SecretModel], /) -> "AzureKeyVault.Builder": ...

        @overload
        def secrets(
            self,
            value_or_callback: Callable[
                [GenericListBuilder[SecretModel, SecretModel.Builder]],
                GenericListBuilder[SecretModel, SecretModel.Builder] | List[SecretModel],
            ],
            /,
        ) -> "AzureKeyVault.Builder": ...

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

        def secrets(self, value_or_callback=None, /):
            if self._in_context and value_or_callback is None:
                context = ListBuilderContext[SecretModel.Builder]()
                context._parent_builder = self
                context._field_name = "secrets"
                return context

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

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

    class BuilderContext(BuilderContextBase["AzureKeyVault.Builder"]):
        def model_post_init(self, __context) -> None:
            self._builder = AzureKeyVault.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 AzureKeyVault."""
        return cls.BuilderContext()

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

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

    cloud: Optional[Cloud] = None
    credentials: Optional[CredentialsModel] = None
    pod_identity: Annotated[Optional[PodIdentity], Field(alias="podIdentity")] = None
    """
    AuthPodIdentity allows users to select the platform native identity
    mechanism
    """
    secrets: List[SecretModel]
    vault_uri: Annotated[str, Field(alias="vaultUri")]


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

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

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

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

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

    class BuilderContext(BuilderContextBase["ConfigMapTargetRef.Builder"]):
        def model_post_init(self, __context) -> None:
            self._builder = ConfigMapTargetRef.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 ConfigMapTargetRef."""
        return cls.BuilderContext()

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

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

    key: str
    name: str
    parameter: str


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

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

        def container_name(self, value: Optional[str], /) -> Self:
            return self._set("container_name", value)

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

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

    class BuilderContext(BuilderContextBase["Env.Builder"]):
        def model_post_init(self, __context) -> None:
            self._builder = Env.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 Env."""
        return cls.BuilderContext()

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

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

    container_name: Annotated[Optional[str], Field(alias="containerName")] = None
    name: str
    parameter: str


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

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

        @overload
        def client_secret(
            self, value_or_callback: ClientSecret, /
        ) -> "CredentialsModel1.Builder": ...

        @overload
        def client_secret(
            self,
            value_or_callback: Callable[
                [ClientSecret.Builder], ClientSecret.Builder | ClientSecret
            ],
            /,
        ) -> "CredentialsModel1.Builder": ...

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

        def client_secret(self, value_or_callback=None, /):
            if self._in_context and value_or_callback is None:
                context = ClientSecret.BuilderContext()
                context._parent_builder = self
                context._field_name = "client_secret"
                return context

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

    class BuilderContext(BuilderContextBase["CredentialsModel1.Builder"]):
        def model_post_init(self, __context) -> None:
            self._builder = CredentialsModel1.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 CredentialsModel1."""
        return cls.BuilderContext()

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

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

    client_secret: Annotated[ClientSecret, Field(alias="clientSecret")]


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

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

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

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

        def version(self, value: Optional[str], /) -> Self:
            return self._set("version", value)

    class BuilderContext(BuilderContextBase["SecretModel1.Builder"]):
        def model_post_init(self, __context) -> None:
            self._builder = SecretModel1.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 SecretModel1."""
        return cls.BuilderContext()

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

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

    id: str
    parameter: str
    version: Optional[str] = None


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

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

        @overload
        def credentials(
            self, value_or_callback: Optional[CredentialsModel1], /
        ) -> "GcpSecretManager.Builder": ...

        @overload
        def credentials(
            self,
            value_or_callback: Callable[
                [CredentialsModel1.Builder],
                CredentialsModel1.Builder | CredentialsModel1,
            ],
            /,
        ) -> "GcpSecretManager.Builder": ...

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

        def credentials(self, value_or_callback=None, /):
            if self._in_context and value_or_callback is None:
                context = CredentialsModel1.BuilderContext()
                context._parent_builder = self
                context._field_name = "credentials"
                return context

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

        @overload
        def pod_identity(
            self, value_or_callback: Optional[PodIdentity], /
        ) -> "GcpSecretManager.Builder": ...

        @overload
        def pod_identity(
            self,
            value_or_callback: Callable[[PodIdentity.Builder], PodIdentity.Builder | PodIdentity],
            /,
        ) -> "GcpSecretManager.Builder": ...

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

        def pod_identity(self, value_or_callback=None, /):
            """
            AuthPodIdentity allows users to select the platform native identity
            mechanism
            """
            if self._in_context and value_or_callback is None:
                context = PodIdentity.BuilderContext()
                context._parent_builder = self
                context._field_name = "pod_identity"
                return context

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

        @overload
        def secrets(
            self, value_or_callback: List[SecretModel1], /
        ) -> "GcpSecretManager.Builder": ...

        @overload
        def secrets(
            self,
            value_or_callback: Callable[
                [GenericListBuilder[SecretModel1, SecretModel1.Builder]],
                GenericListBuilder[SecretModel1, SecretModel1.Builder] | List[SecretModel1],
            ],
            /,
        ) -> "GcpSecretManager.Builder": ...

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

        def secrets(self, value_or_callback=None, /):
            if self._in_context and value_or_callback is None:
                context = ListBuilderContext[SecretModel1.Builder]()
                context._parent_builder = self
                context._field_name = "secrets"
                return context

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

    class BuilderContext(BuilderContextBase["GcpSecretManager.Builder"]):
        def model_post_init(self, __context) -> None:
            self._builder = GcpSecretManager.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 GcpSecretManager."""
        return cls.BuilderContext()

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

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

    credentials: Optional[CredentialsModel1] = None
    pod_identity: Annotated[Optional[PodIdentity], Field(alias="podIdentity")] = None
    """
    AuthPodIdentity allows users to select the platform native identity
    mechanism
    """
    secrets: List[SecretModel1]


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

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

        def service_account(self, value: Optional[str], /) -> Self:
            return self._set("service_account", value)

        def token(self, value: Optional[str], /) -> Self:
            return self._set("token", value)

    class BuilderContext(BuilderContextBase["Credential.Builder"]):
        def model_post_init(self, __context) -> None:
            self._builder = Credential.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 Credential."""
        return cls.BuilderContext()

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

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

    service_account: Annotated[Optional[str], Field(alias="serviceAccount")] = None
    token: Optional[str] = None


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

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

        def alt_names(self, value: Optional[str], /) -> Self:
            return self._set("alt_names", value)

        def common_name(self, value: Optional[str], /) -> Self:
            return self._set("common_name", value)

        def format(self, value: Optional[str], /) -> Self:
            return self._set("format", value)

        def ip_sans(self, value: Optional[str], /) -> Self:
            return self._set("ip_sans", value)

        def other_sans(self, value: Optional[str], /) -> Self:
            return self._set("other_sans", value)

        def ttl(self, value: Optional[str], /) -> Self:
            return self._set("ttl", value)

        def uri_sans(self, value: Optional[str], /) -> Self:
            return self._set("uri_sans", value)

    class BuilderContext(BuilderContextBase["PkiData.Builder"]):
        def model_post_init(self, __context) -> None:
            self._builder = PkiData.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 PkiData."""
        return cls.BuilderContext()

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

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

    alt_names: Annotated[Optional[str], Field(alias="altNames")] = None
    common_name: Annotated[Optional[str], Field(alias="commonName")] = None
    format: Optional[str] = None
    ip_sans: Annotated[Optional[str], Field(alias="ipSans")] = None
    other_sans: Annotated[Optional[str], Field(alias="otherSans")] = None
    ttl: Optional[str] = None
    uri_sans: Annotated[Optional[str], Field(alias="uriSans")] = None


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

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

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

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

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

        @overload
        def pki_data(self, value_or_callback: Optional[PkiData], /) -> "SecretModel2.Builder": ...

        @overload
        def pki_data(
            self,
            value_or_callback: Callable[[PkiData.Builder], PkiData.Builder | PkiData],
            /,
        ) -> "SecretModel2.Builder": ...

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

        def pki_data(self, value_or_callback=None, /):
            if self._in_context and value_or_callback is None:
                context = PkiData.BuilderContext()
                context._parent_builder = self
                context._field_name = "pki_data"
                return context

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

        def type(self, value: Optional[str], /) -> Self:
            """
            VaultSecretType defines the type of vault secret
            """
            return self._set("type", value)

    class BuilderContext(BuilderContextBase["SecretModel2.Builder"]):
        def model_post_init(self, __context) -> None:
            self._builder = SecretModel2.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 SecretModel2."""
        return cls.BuilderContext()

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

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

    key: str
    parameter: str
    path: str
    pki_data: Annotated[Optional[PkiData], Field(alias="pkiData")] = None
    type: Optional[str] = None
    """
    VaultSecretType defines the type of vault secret
    """


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

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

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

        def authentication(self, value: str, /) -> Self:
            """
            VaultAuthentication contains the list of Hashicorp Vault authentication methods
            """
            return self._set("authentication", value)

        @overload
        def credential(
            self, value_or_callback: Optional[Credential], /
        ) -> "HashiCorpVault.Builder": ...

        @overload
        def credential(
            self,
            value_or_callback: Callable[[Credential.Builder], Credential.Builder | Credential],
            /,
        ) -> "HashiCorpVault.Builder": ...

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

        def credential(self, value_or_callback=None, /):
            """
            Credential defines the Hashicorp Vault credentials depending on the authentication method
            """
            if self._in_context and value_or_callback is None:
                context = Credential.BuilderContext()
                context._parent_builder = self
                context._field_name = "credential"
                return context

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

        def mount(self, value: Optional[str], /) -> Self:
            return self._set("mount", value)

        def namespace(self, value: Optional[str], /) -> Self:
            return self._set("namespace", value)

        def role(self, value: Optional[str], /) -> Self:
            return self._set("role", value)

        @overload
        def secrets(self, value_or_callback: List[SecretModel2], /) -> "HashiCorpVault.Builder": ...

        @overload
        def secrets(
            self,
            value_or_callback: Callable[
                [GenericListBuilder[SecretModel2, SecretModel2.Builder]],
                GenericListBuilder[SecretModel2, SecretModel2.Builder] | List[SecretModel2],
            ],
            /,
        ) -> "HashiCorpVault.Builder": ...

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

        def secrets(self, value_or_callback=None, /):
            if self._in_context and value_or_callback is None:
                context = ListBuilderContext[SecretModel2.Builder]()
                context._parent_builder = self
                context._field_name = "secrets"
                return context

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

    class BuilderContext(BuilderContextBase["HashiCorpVault.Builder"]):
        def model_post_init(self, __context) -> None:
            self._builder = HashiCorpVault.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 HashiCorpVault."""
        return cls.BuilderContext()

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

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

    address: str
    authentication: str
    """
    VaultAuthentication contains the list of Hashicorp Vault authentication methods
    """
    credential: Optional[Credential] = None
    """
    Credential defines the Hashicorp Vault credentials depending on the authentication method
    """
    mount: Optional[str] = None
    namespace: Optional[str] = None
    role: Optional[str] = None
    secrets: List[SecretModel2]


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

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

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

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

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

    class BuilderContext(BuilderContextBase["SecretTargetRef.Builder"]):
        def model_post_init(self, __context) -> None:
            self._builder = SecretTargetRef.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 SecretTargetRef."""
        return cls.BuilderContext()

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

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

    key: str
    name: str
    parameter: str


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

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

        @overload
        def aws_secret_manager(
            self, value_or_callback: Optional[AwsSecretManager], /
        ) -> "ClusterTriggerAuthenticationSpec.Builder": ...

        @overload
        def aws_secret_manager(
            self,
            value_or_callback: Callable[
                [AwsSecretManager.Builder], AwsSecretManager.Builder | AwsSecretManager
            ],
            /,
        ) -> "ClusterTriggerAuthenticationSpec.Builder": ...

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

        def aws_secret_manager(self, value_or_callback=None, /):
            """
            AwsSecretManager is used to authenticate using AwsSecretManager
            """
            if self._in_context and value_or_callback is None:
                context = AwsSecretManager.BuilderContext()
                context._parent_builder = self
                context._field_name = "aws_secret_manager"
                return context

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

        @overload
        def azure_key_vault(
            self, value_or_callback: Optional[AzureKeyVault], /
        ) -> "ClusterTriggerAuthenticationSpec.Builder": ...

        @overload
        def azure_key_vault(
            self,
            value_or_callback: Callable[
                [AzureKeyVault.Builder], AzureKeyVault.Builder | AzureKeyVault
            ],
            /,
        ) -> "ClusterTriggerAuthenticationSpec.Builder": ...

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

        def azure_key_vault(self, value_or_callback=None, /):
            """
            AzureKeyVault is used to authenticate using Azure Key Vault
            """
            if self._in_context and value_or_callback is None:
                context = AzureKeyVault.BuilderContext()
                context._parent_builder = self
                context._field_name = "azure_key_vault"
                return context

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

        @overload
        def config_map_target_ref(
            self, value_or_callback: List[ConfigMapTargetRef], /
        ) -> "ClusterTriggerAuthenticationSpec.Builder": ...

        @overload
        def config_map_target_ref(
            self,
            value_or_callback: Callable[
                [GenericListBuilder[ConfigMapTargetRef, ConfigMapTargetRef.Builder]],
                GenericListBuilder[ConfigMapTargetRef, ConfigMapTargetRef.Builder]
                | List[ConfigMapTargetRef],
            ],
            /,
        ) -> "ClusterTriggerAuthenticationSpec.Builder": ...

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

        def config_map_target_ref(self, value_or_callback=None, /):
            if self._in_context and value_or_callback is None:
                context = ListBuilderContext[ConfigMapTargetRef.Builder]()
                context._parent_builder = self
                context._field_name = "config_map_target_ref"
                return context

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

        @overload
        def env(
            self, value_or_callback: List[Env], /
        ) -> "ClusterTriggerAuthenticationSpec.Builder": ...

        @overload
        def env(
            self,
            value_or_callback: Callable[
                [GenericListBuilder[Env, Env.Builder]],
                GenericListBuilder[Env, Env.Builder] | List[Env],
            ],
            /,
        ) -> "ClusterTriggerAuthenticationSpec.Builder": ...

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

        def env(self, value_or_callback=None, /):
            if self._in_context and value_or_callback is None:
                context = ListBuilderContext[Env.Builder]()
                context._parent_builder = self
                context._field_name = "env"
                return context

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

        @overload
        def gcp_secret_manager(
            self, value_or_callback: Optional[GcpSecretManager], /
        ) -> "ClusterTriggerAuthenticationSpec.Builder": ...

        @overload
        def gcp_secret_manager(
            self,
            value_or_callback: Callable[
                [GcpSecretManager.Builder], GcpSecretManager.Builder | GcpSecretManager
            ],
            /,
        ) -> "ClusterTriggerAuthenticationSpec.Builder": ...

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

        def gcp_secret_manager(self, value_or_callback=None, /):
            if self._in_context and value_or_callback is None:
                context = GcpSecretManager.BuilderContext()
                context._parent_builder = self
                context._field_name = "gcp_secret_manager"
                return context

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

        @overload
        def hashi_corp_vault(
            self, value_or_callback: Optional[HashiCorpVault], /
        ) -> "ClusterTriggerAuthenticationSpec.Builder": ...

        @overload
        def hashi_corp_vault(
            self,
            value_or_callback: Callable[
                [HashiCorpVault.Builder], HashiCorpVault.Builder | HashiCorpVault
            ],
            /,
        ) -> "ClusterTriggerAuthenticationSpec.Builder": ...

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

        def hashi_corp_vault(self, value_or_callback=None, /):
            """
            HashiCorpVault is used to authenticate using Hashicorp Vault
            """
            if self._in_context and value_or_callback is None:
                context = HashiCorpVault.BuilderContext()
                context._parent_builder = self
                context._field_name = "hashi_corp_vault"
                return context

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

        @overload
        def pod_identity(
            self, value_or_callback: Optional[PodIdentity], /
        ) -> "ClusterTriggerAuthenticationSpec.Builder": ...

        @overload
        def pod_identity(
            self,
            value_or_callback: Callable[[PodIdentity.Builder], PodIdentity.Builder | PodIdentity],
            /,
        ) -> "ClusterTriggerAuthenticationSpec.Builder": ...

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

        def pod_identity(self, value_or_callback=None, /):
            """
            AuthPodIdentity allows users to select the platform native identity
            mechanism
            """
            if self._in_context and value_or_callback is None:
                context = PodIdentity.BuilderContext()
                context._parent_builder = self
                context._field_name = "pod_identity"
                return context

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

        @overload
        def secret_target_ref(
            self, value_or_callback: List[SecretTargetRef], /
        ) -> "ClusterTriggerAuthenticationSpec.Builder": ...

        @overload
        def secret_target_ref(
            self,
            value_or_callback: Callable[
                [GenericListBuilder[SecretTargetRef, SecretTargetRef.Builder]],
                GenericListBuilder[SecretTargetRef, SecretTargetRef.Builder]
                | List[SecretTargetRef],
            ],
            /,
        ) -> "ClusterTriggerAuthenticationSpec.Builder": ...

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

        def secret_target_ref(self, value_or_callback=None, /):
            if self._in_context and value_or_callback is None:
                context = ListBuilderContext[SecretTargetRef.Builder]()
                context._parent_builder = self
                context._field_name = "secret_target_ref"
                return context

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

    class BuilderContext(BuilderContextBase["ClusterTriggerAuthenticationSpec.Builder"]):
        def model_post_init(self, __context) -> None:
            self._builder = ClusterTriggerAuthenticationSpec.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 ClusterTriggerAuthenticationSpec."""
        return cls.BuilderContext()

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

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

    aws_secret_manager: Annotated[Optional[AwsSecretManager], Field(alias="awsSecretManager")] = (
        None
    )
    """
    AwsSecretManager is used to authenticate using AwsSecretManager
    """
    azure_key_vault: Annotated[Optional[AzureKeyVault], Field(alias="azureKeyVault")] = None
    """
    AzureKeyVault is used to authenticate using Azure Key Vault
    """
    config_map_target_ref: Annotated[
        Optional[List[ConfigMapTargetRef]], Field(alias="configMapTargetRef")
    ] = None
    env: Optional[List[Env]] = None
    gcp_secret_manager: Annotated[Optional[GcpSecretManager], Field(alias="gcpSecretManager")] = (
        None
    )
    hashi_corp_vault: Annotated[Optional[HashiCorpVault], Field(alias="hashiCorpVault")] = None
    """
    HashiCorpVault is used to authenticate using Hashicorp Vault
    """
    pod_identity: Annotated[Optional[PodIdentity], Field(alias="podIdentity")] = None
    """
    AuthPodIdentity allows users to select the platform native identity
    mechanism
    """
    secret_target_ref: Annotated[
        Optional[List[SecretTargetRef]], Field(alias="secretTargetRef")
    ] = None


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

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

        def scaledjobs(self, value: Optional[str], /) -> Self:
            return self._set("scaledjobs", value)

        def scaledobjects(self, value: Optional[str], /) -> Self:
            return self._set("scaledobjects", value)

    class BuilderContext(BuilderContextBase["ClusterTriggerAuthenticationStatus.Builder"]):
        def model_post_init(self, __context) -> None:
            self._builder = ClusterTriggerAuthenticationStatus.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 ClusterTriggerAuthenticationStatus."""
        return cls.BuilderContext()

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

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

    scaledjobs: Optional[str] = None
    scaledobjects: Optional[str] = None


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

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

        def container_name(self, value: Optional[str], /) -> Self:
            """
            Restricts the check for exit codes to the container with the
            specified name. When null, the rule applies to all containers.
            When specified, it should match one the container or initContainer
            names in the pod template.
            """
            return self._set("container_name", value)

        def operator(self, value: str, /) -> Self:
            """
            Represents the relationship between the container exit code(s) and the
            specified values. Containers completed with success (exit code 0) are
            excluded from the requirement check. Possible values are:

            - In: the requirement is satisfied if at least one container exit code
              (might be multiple if there are multiple containers not restricted
              by the 'containerName' field) is in the set of specified values.
            - NotIn: the requirement is satisfied if at least one container exit code
              (might be multiple if there are multiple containers not restricted
              by the 'containerName' field) is not in the set of specified values.
            Additional values are considered to be added in the future. Clients should
            react to an unknown operator by assuming the requirement is not satisfied.
            """
            return self._set("operator", value)

        def values(self, value: List[int], /) -> Self:
            """
            Specifies the set of values. Each returned container exit code (might be
            multiple in case of multiple containers) is checked against this set of
            values with respect to the operator. The list of values must be ordered
            and must not contain duplicates. Value '0' cannot be used for the In operator.
            At least one element is required. At most 255 elements are allowed.
            """
            return self._set("values", value)

    class BuilderContext(BuilderContextBase["OnExitCodes.Builder"]):
        def model_post_init(self, __context) -> None:
            self._builder = OnExitCodes.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 OnExitCodes."""
        return cls.BuilderContext()

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

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

    container_name: Annotated[Optional[str], Field(alias="containerName")] = None
    """
    Restricts the check for exit codes to the container with the
    specified name. When null, the rule applies to all containers.
    When specified, it should match one the container or initContainer
    names in the pod template.
    """
    operator: str
    """
    Represents the relationship between the container exit code(s) and the
    specified values. Containers completed with success (exit code 0) are
    excluded from the requirement check. Possible values are:

    - In: the requirement is satisfied if at least one container exit code
      (might be multiple if there are multiple containers not restricted
      by the 'containerName' field) is in the set of specified values.
    - NotIn: the requirement is satisfied if at least one container exit code
      (might be multiple if there are multiple containers not restricted
      by the 'containerName' field) is not in the set of specified values.
    Additional values are considered to be added in the future. Clients should
    react to an unknown operator by assuming the requirement is not satisfied.
    """
    values: List[int]
    """
    Specifies the set of values. Each returned container exit code (might be
    multiple in case of multiple containers) is checked against this set of
    values with respect to the operator. The list of values must be ordered
    and must not contain duplicates. Value '0' cannot be used for the In operator.
    At least one element is required. At most 255 elements are allowed.
    """


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

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

        def status(self, value: str, /) -> Self:
            """
            Specifies the required Pod condition status. To match a pod condition
            it is required that the specified status equals the pod condition status.
            Defaults to True.
            """
            return self._set("status", value)

        def type(self, value: str, /) -> Self:
            """
            Specifies the required Pod condition type. To match a pod condition
            it is required that specified type equals the pod condition type.
            """
            return self._set("type", value)

    class BuilderContext(BuilderContextBase["OnPodCondition.Builder"]):
        def model_post_init(self, __context) -> None:
            self._builder = OnPodCondition.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 OnPodCondition."""
        return cls.BuilderContext()

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

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

    status: str
    """
    Specifies the required Pod condition status. To match a pod condition
    it is required that the specified status equals the pod condition status.
    Defaults to True.
    """
    type: str
    """
    Specifies the required Pod condition type. To match a pod condition
    it is required that specified type equals the pod condition type.
    """


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

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

        def action(self, value: str, /) -> Self:
            """
            Specifies the action taken on a pod failure when the requirements are satisfied.
            Possible values are:

            - FailJob: indicates that the pod's job is marked as Failed and all
              running pods are terminated.
            - FailIndex: indicates that the pod's index is marked as Failed and will
              not be restarted.
              This value is beta-level. It can be used when the
              `JobBackoffLimitPerIndex` feature gate is enabled (enabled by default).
            - Ignore: indicates that the counter towards the .backoffLimit is not
              incremented and a replacement pod is created.
            - Count: indicates that the pod is handled in the default way - the
              counter towards the .backoffLimit is incremented.
            Additional values are considered to be added in the future. Clients should
            react to an unknown action by skipping the rule.
            """
            return self._set("action", value)

        @overload
        def on_exit_codes(self, value_or_callback: Optional[OnExitCodes], /) -> "Rule.Builder": ...

        @overload
        def on_exit_codes(
            self,
            value_or_callback: Callable[[OnExitCodes.Builder], OnExitCodes.Builder | OnExitCodes],
            /,
        ) -> "Rule.Builder": ...

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

        def on_exit_codes(self, value_or_callback=None, /):
            """
            Represents the requirement on the container exit codes.
            """
            if self._in_context and value_or_callback is None:
                context = OnExitCodes.BuilderContext()
                context._parent_builder = self
                context._field_name = "on_exit_codes"
                return context

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

        @overload
        def on_pod_conditions(
            self, value_or_callback: List[OnPodCondition], /
        ) -> "Rule.Builder": ...

        @overload
        def on_pod_conditions(
            self,
            value_or_callback: Callable[
                [GenericListBuilder[OnPodCondition, OnPodCondition.Builder]],
                GenericListBuilder[OnPodCondition, OnPodCondition.Builder] | List[OnPodCondition],
            ],
            /,
        ) -> "Rule.Builder": ...

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

        def on_pod_conditions(self, value_or_callback=None, /):
            """
            Represents the requirement on the pod conditions. The requirement is represented
            as a list of pod condition patterns. The requirement is satisfied if at
            least one pattern matches an actual pod condition. At most 20 elements are allowed.
            """
            if self._in_context and value_or_callback is None:
                context = ListBuilderContext[OnPodCondition.Builder]()
                context._parent_builder = self
                context._field_name = "on_pod_conditions"
                return context

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

    class BuilderContext(BuilderContextBase["Rule.Builder"]):
        def model_post_init(self, __context) -> None:
            self._builder = Rule.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 Rule."""
        return cls.BuilderContext()

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

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

    action: str
    """
    Specifies the action taken on a pod failure when the requirements are satisfied.
    Possible values are:

    - FailJob: indicates that the pod's job is marked as Failed and all
      running pods are terminated.
    - FailIndex: indicates that the pod's index is marked as Failed and will
      not be restarted.
      This value is beta-level. It can be used when the
      `JobBackoffLimitPerIndex` feature gate is enabled (enabled by default).
    - Ignore: indicates that the counter towards the .backoffLimit is not
      incremented and a replacement pod is created.
    - Count: indicates that the pod is handled in the default way - the
      counter towards the .backoffLimit is incremented.
    Additional values are considered to be added in the future. Clients should
    react to an unknown action by skipping the rule.
    """
    on_exit_codes: Annotated[Optional[OnExitCodes], Field(alias="onExitCodes")] = None
    """
    Represents the requirement on the container exit codes.
    """
    on_pod_conditions: Annotated[Optional[List[OnPodCondition]], Field(alias="onPodConditions")] = (
        None
    )
    """
    Represents the requirement on the pod conditions. The requirement is represented
    as a list of pod condition patterns. The requirement is satisfied if at
    least one pattern matches an actual pod condition. At most 20 elements are allowed.
    """


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

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

        @overload
        def rules(self, value_or_callback: List[Rule], /) -> "PodFailurePolicy.Builder": ...

        @overload
        def rules(
            self,
            value_or_callback: Callable[
                [GenericListBuilder[Rule, Rule.Builder]],
                GenericListBuilder[Rule, Rule.Builder] | List[Rule],
            ],
            /,
        ) -> "PodFailurePolicy.Builder": ...

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

        def rules(self, value_or_callback=None, /):
            """
            A list of pod failure policy rules. The rules are evaluated in order.
            Once a rule matches a Pod failure, the remaining of the rules are ignored.
            When no rule matches the Pod failure, the default handling applies - the
            counter of pod failures is incremented and it is checked against
            the backoffLimit. At most 20 elements are allowed.
            """
            if self._in_context and value_or_callback is None:
                context = ListBuilderContext[Rule.Builder]()
                context._parent_builder = self
                context._field_name = "rules"
                return context

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

    class BuilderContext(BuilderContextBase["PodFailurePolicy.Builder"]):
        def model_post_init(self, __context) -> None:
            self._builder = PodFailurePolicy.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 PodFailurePolicy."""
        return cls.BuilderContext()

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

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

    rules: List[Rule]
    """
    A list of pod failure policy rules. The rules are evaluated in order.
    Once a rule matches a Pod failure, the remaining of the rules are ignored.
    When no rule matches the Pod failure, the default handling applies - the
    counter of pod failures is incremented and it is checked against
    the backoffLimit. At most 20 elements are allowed.
    """


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:
            """
            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["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
    """
    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 Selector(BaseModel):
    class Builder(BaseModelBuilder):
        @property
        def cls(self) -> Type["Selector"]:
            return Selector

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

        @overload
        def match_expressions(
            self, value_or_callback: List[MatchExpression], /
        ) -> "Selector.Builder": ...

        @overload
        def match_expressions(
            self,
            value_or_callback: Callable[
                [GenericListBuilder[MatchExpression, MatchExpression.Builder]],
                GenericListBuilder[MatchExpression, MatchExpression.Builder]
                | List[MatchExpression],
            ],
            /,
        ) -> "Selector.Builder": ...

        @overload
        def match_expressions(
            self, value_or_callback: Never = ...
        ) -> ListBuilderContext[MatchExpression.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[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)

        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["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

    match_expressions: Annotated[
        Optional[List[MatchExpression]], 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 RuleModel(BaseModel):
    class Builder(BaseModelBuilder):
        @property
        def cls(self) -> Type["RuleModel"]:
            return RuleModel

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

        def succeeded_count(self, value: Optional[int], /) -> Self:
            """
            succeededCount specifies the minimal required size of the actual set of the succeeded indexes
            for the Job. When succeededCount is used along with succeededIndexes, the check is
            constrained only to the set of indexes specified by succeededIndexes.
            For example, given that succeededIndexes is "1-4", succeededCount is "3",
            and completed indexes are "1", "3", and "5", the Job isn't declared as succeeded
            because only "1" and "3" indexes are considered in that rules.
            When this field is null, this doesn't default to any value and
            is never evaluated at any time.
            When specified it needs to be a positive integer.
            """
            return self._set("succeeded_count", value)

        def succeeded_indexes(self, value: Optional[str], /) -> Self:
            """
            succeededIndexes specifies the set of indexes
            which need to be contained in the actual set of the succeeded indexes for the Job.
            The list of indexes must be within 0 to ".spec.completions-1" and
            must not contain duplicates. At least one element is required.
            The indexes are represented as intervals separated by commas.
            The intervals can be a decimal integer or a pair of decimal integers separated by a hyphen.
            The number are listed in represented by the first and last element of the series,
            separated by a hyphen.
            For example, if the completed indexes are 1, 3, 4, 5 and 7, they are
            represented as "1,3-5,7".
            When this field is null, this field doesn't default to any value
            and is never evaluated at any time.
            """
            return self._set("succeeded_indexes", value)

    class BuilderContext(BuilderContextBase["RuleModel.Builder"]):
        def model_post_init(self, __context) -> None:
            self._builder = RuleModel.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 RuleModel."""
        return cls.BuilderContext()

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

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

    succeeded_count: Annotated[Optional[int], Field(alias="succeededCount")] = None
    """
    succeededCount specifies the minimal required size of the actual set of the succeeded indexes
    for the Job. When succeededCount is used along with succeededIndexes, the check is
    constrained only to the set of indexes specified by succeededIndexes.
    For example, given that succeededIndexes is "1-4", succeededCount is "3",
    and completed indexes are "1", "3", and "5", the Job isn't declared as succeeded
    because only "1" and "3" indexes are considered in that rules.
    When this field is null, this doesn't default to any value and
    is never evaluated at any time.
    When specified it needs to be a positive integer.
    """
    succeeded_indexes: Annotated[Optional[str], Field(alias="succeededIndexes")] = None
    """
    succeededIndexes specifies the set of indexes
    which need to be contained in the actual set of the succeeded indexes for the Job.
    The list of indexes must be within 0 to ".spec.completions-1" and
    must not contain duplicates. At least one element is required.
    The indexes are represented as intervals separated by commas.
    The intervals can be a decimal integer or a pair of decimal integers separated by a hyphen.
    The number are listed in represented by the first and last element of the series,
    separated by a hyphen.
    For example, if the completed indexes are 1, 3, 4, 5 and 7, they are
    represented as "1,3-5,7".
    When this field is null, this field doesn't default to any value
    and is never evaluated at any time.
    """


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

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

        @overload
        def rules(self, value_or_callback: List[RuleModel], /) -> "SuccessPolicy.Builder": ...

        @overload
        def rules(
            self,
            value_or_callback: Callable[
                [GenericListBuilder[RuleModel, RuleModel.Builder]],
                GenericListBuilder[RuleModel, RuleModel.Builder] | List[RuleModel],
            ],
            /,
        ) -> "SuccessPolicy.Builder": ...

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

        def rules(self, value_or_callback=None, /):
            """
            rules represents the list of alternative rules for the declaring the Jobs
            as successful before `.status.succeeded >= .spec.completions`. Once any of the rules are met,
            the "SucceededCriteriaMet" condition is added, and the lingering pods are removed.
            The terminal state for such a Job has the "Complete" condition.
            Additionally, these rules are evaluated in order; Once the Job meets one of the rules,
            other rules are ignored. At most 20 elements are allowed.
            """
            if self._in_context and value_or_callback is None:
                context = ListBuilderContext[RuleModel.Builder]()
                context._parent_builder = self
                context._field_name = "rules"
                return context

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

    class BuilderContext(BuilderContextBase["SuccessPolicy.Builder"]):
        def model_post_init(self, __context) -> None:
            self._builder = SuccessPolicy.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 SuccessPolicy."""
        return cls.BuilderContext()

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

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

    rules: List[RuleModel]
    """
    rules represents the list of alternative rules for the declaring the Jobs
    as successful before `.status.succeeded >= .spec.completions`. Once any of the rules are met,
    the "SucceededCriteriaMet" condition is added, and the lingering pods are removed.
    The terminal state for such a Job has the "Complete" condition.
    Additionally, these rules are evaluated in order; Once the Job meets one of the rules,
    other rules are ignored. At most 20 elements are allowed.
    """


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:
            return self._set("annotations", value)

        def finalizers(self, value: Optional[List[str]], /) -> Self:
            return self._set("finalizers", value)

        def labels(self, value: Optional[Dict[str, str]], /) -> Self:
            return self._set("labels", value)

        def name(self, value: Optional[str], /) -> Self:
            return self._set("name", value)

        def namespace(self, value: Optional[str], /) -> Self:
            return self._set("namespace", 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
    finalizers: Optional[List[str]] = None
    labels: Optional[Dict[str, str]] = None
    name: Optional[str] = None
    namespace: Optional[str] = None


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:
            """
            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["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
    """
    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[MatchExpressionModel], /
        ) -> "Preference.Builder": ...

        @overload
        def match_expressions(
            self,
            value_or_callback: Callable[
                [GenericListBuilder[MatchExpressionModel, MatchExpressionModel.Builder]],
                GenericListBuilder[MatchExpressionModel, MatchExpressionModel.Builder]
                | List[MatchExpressionModel],
            ],
            /,
        ) -> "Preference.Builder": ...

        @overload
        def match_expressions(
            self, value_or_callback: Never = ...
        ) -> ListBuilderContext[MatchExpressionModel.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[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)

        @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[MatchExpressionModel]], 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[MatchExpressionModel], /
        ) -> "NodeSelectorTerm.Builder": ...

        @overload
        def match_expressions(
            self,
            value_or_callback: Callable[
                [GenericListBuilder[MatchExpressionModel, MatchExpressionModel.Builder]],
                GenericListBuilder[MatchExpressionModel, MatchExpressionModel.Builder]
                | List[MatchExpressionModel],
            ],
            /,
        ) -> "NodeSelectorTerm.Builder": ...

        @overload
        def match_expressions(
            self, value_or_callback: Never = ...
        ) -> ListBuilderContext[MatchExpressionModel.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[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)

        @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[MatchExpressionModel]], 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 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:
            """
            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["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
    """
    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[MatchExpressionModel1], /
        ) -> "LabelSelector.Builder": ...

        @overload
        def match_expressions(
            self,
            value_or_callback: Callable[
                [GenericListBuilder[MatchExpressionModel1, MatchExpressionModel1.Builder]],
                GenericListBuilder[MatchExpressionModel1, MatchExpressionModel1.Builder]
                | List[MatchExpressionModel1],
            ],
            /,
        ) -> "LabelSelector.Builder": ...

        @overload
        def match_expressions(
            self, value_or_callback: Never = ...
        ) -> ListBuilderContext[MatchExpressionModel1.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[MatchExpressionModel1.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(MatchExpressionModel1.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[MatchExpressionModel1]], 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[MatchExpressionModel1], /
        ) -> "NamespaceSelector.Builder": ...

        @overload
        def match_expressions(
            self,
            value_or_callback: Callable[
                [GenericListBuilder[MatchExpressionModel1, MatchExpressionModel1.Builder]],
                GenericListBuilder[MatchExpressionModel1, MatchExpressionModel1.Builder]
                | List[MatchExpressionModel1],
            ],
            /,
        ) -> "NamespaceSelector.Builder": ...

        @overload
        def match_expressions(
            self, value_or_callback: Never = ...
        ) -> ListBuilderContext[MatchExpressionModel1.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[MatchExpressionModel1.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(MatchExpressionModel1.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[MatchExpressionModel1]], 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 ConfigMapKeyRef(BaseModel):
    class Builder(BaseModelBuilder):
        @property
        def cls(self) -> Type["ConfigMapKeyRef"]:
            return ConfigMapKeyRef

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

        def key(self, value: str, /) -> Self:
            """
            The key to select.
            """
            return self._set("key", value)

        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)

        def optional(self, value: Optional[bool], /) -> Self:
            """
            Specify whether the ConfigMap or its key must be defined
            """
            return self._set("optional", value)

    class BuilderContext(BuilderContextBase["ConfigMapKeyRef.Builder"]):
        def model_post_init(self, __context) -> None:
            self._builder = ConfigMapKeyRef.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 ConfigMapKeyRef."""
        return cls.BuilderContext()

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

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

    key: str
    """
    The key to select.
    """
    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
    """
    optional: Optional[bool] = None
    """
    Specify whether the ConfigMap or its key must be defined
    """


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

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

        def api_version(self, value: Optional[str], /) -> Self:
            """
            Version of the schema the FieldPath is written in terms of, defaults to "v1".
            """
            return self._set("api_version", value)

        def field_path(self, value: str, /) -> Self:
            """
            Path of the field to select in the specified API version.
            """
            return self._set("field_path", value)

    class BuilderContext(BuilderContextBase["FieldRef.Builder"]):
        def model_post_init(self, __context) -> None:
            self._builder = FieldRef.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 FieldRef."""
        return cls.BuilderContext()

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

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

    api_version: Annotated[Optional[str], Field(alias="apiVersion")] = None
    """
    Version of the schema the FieldPath is written in terms of, defaults to "v1".
    """
    field_path: Annotated[str, Field(alias="fieldPath")]
    """
    Path of the field to select in the specified API version.
    """


class Divisor(RootModel[int]):
    class Builder(BaseBuilder):
        _value: int | None = None

        def root(self, value: int, /) -> Self:
            """
            Specifies the output format of the exposed resources, defaults to "1"
            """
            self._value = value
            return self

        def __call__(self, value: int, /) -> Self:
            """
            Specifies the output format of the exposed resources, defaults to "1"
            """
            self._value = value
            return self

        def build(self) -> "Divisor":
            value = cast(int, self._value)
            return Divisor(value)

    root: Annotated[
        int,
        Field(
            pattern="^(\\+|-)?(([0-9]+(\\.[0-9]*)?)|(\\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\\+|-)?(([0-9]+(\\.[0-9]*)?)|(\\.[0-9]+))))?$"
        ),
    ]
    """
    Specifies the output format of the exposed resources, defaults to "1"
    """

    class BuilderContext(BuilderContextBase["Divisor.Builder"]):
        def model_post_init(self, __context) -> None:
            self._builder = Divisor.Builder()
            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 Divisor."""
        return cls.BuilderContext()


class DivisorModel(RootModel[str]):
    class Builder(BaseBuilder):
        _value: str | None = None

        def root(self, value: str, /) -> Self:
            """
            Specifies the output format of the exposed resources, defaults to "1"
            """
            self._value = value
            return self

        def __call__(self, value: str, /) -> Self:
            """
            Specifies the output format of the exposed resources, defaults to "1"
            """
            self._value = value
            return self

        def build(self) -> "DivisorModel":
            value = cast(str, self._value)
            return DivisorModel(value)

    root: Annotated[
        str,
        Field(
            pattern="^(\\+|-)?(([0-9]+(\\.[0-9]*)?)|(\\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\\+|-)?(([0-9]+(\\.[0-9]*)?)|(\\.[0-9]+))))?$"
        ),
    ]
    """
    Specifies the output format of the exposed resources, defaults to "1"
    """

    class BuilderContext(BuilderContextBase["DivisorModel.Builder"]):
        def model_post_init(self, __context) -> None:
            self._builder = DivisorModel.Builder()
            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 DivisorModel."""
        return cls.BuilderContext()


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

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

        def container_name(self, value: Optional[str], /) -> Self:
            """
            Container name: required for volumes, optional for env vars
            """
            return self._set("container_name", value)

        def divisor(self, value: Optional[Union[Divisor, DivisorModel]], /) -> Self:
            """
            Specifies the output format of the exposed resources, defaults to "1"
            """
            return self._set("divisor", value)

        def resource(self, value: str, /) -> Self:
            """
            Required: resource to select
            """
            return self._set("resource", value)

    class BuilderContext(BuilderContextBase["ResourceFieldRef.Builder"]):
        def model_post_init(self, __context) -> None:
            self._builder = ResourceFieldRef.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 ResourceFieldRef."""
        return cls.BuilderContext()

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

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

    container_name: Annotated[Optional[str], Field(alias="containerName")] = None
    """
    Container name: required for volumes, optional for env vars
    """
    divisor: Optional[Union[Divisor, DivisorModel]] = None
    """
    Specifies the output format of the exposed resources, defaults to "1"
    """
    resource: str
    """
    Required: resource to select
    """


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

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

        def key(self, value: str, /) -> Self:
            """
            The key of the secret to select from.  Must be a valid secret key.
            """
            return self._set("key", value)

        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)

        def optional(self, value: Optional[bool], /) -> Self:
            """
            Specify whether the Secret or its key must be defined
            """
            return self._set("optional", value)

    class BuilderContext(BuilderContextBase["SecretKeyRefModel.Builder"]):
        def model_post_init(self, __context) -> None:
            self._builder = SecretKeyRefModel.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 SecretKeyRefModel."""
        return cls.BuilderContext()

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

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

    key: str
    """
    The key of the secret to select from.  Must be a valid secret key.
    """
    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
    """
    optional: Optional[bool] = None
    """
    Specify whether the Secret or its key must be defined
    """


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

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

        @overload
        def config_map_key_ref(
            self, value_or_callback: Optional[ConfigMapKeyRef], /
        ) -> "ValueFromModel.Builder": ...

        @overload
        def config_map_key_ref(
            self,
            value_or_callback: Callable[
                [ConfigMapKeyRef.Builder], ConfigMapKeyRef.Builder | ConfigMapKeyRef
            ],
            /,
        ) -> "ValueFromModel.Builder": ...

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

        def config_map_key_ref(self, value_or_callback=None, /):
            """
            Selects a key of a ConfigMap.
            """
            if self._in_context and value_or_callback is None:
                context = ConfigMapKeyRef.BuilderContext()
                context._parent_builder = self
                context._field_name = "config_map_key_ref"
                return context

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

        @overload
        def field_ref(
            self, value_or_callback: Optional[FieldRef], /
        ) -> "ValueFromModel.Builder": ...

        @overload
        def field_ref(
            self,
            value_or_callback: Callable[[FieldRef.Builder], FieldRef.Builder | FieldRef],
            /,
        ) -> "ValueFromModel.Builder": ...

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

        def field_ref(self, value_or_callback=None, /):
            """
            Selects a field of the pod: supports metadata.name, metadata.namespace, `metadata.labels['<KEY>']`, `metadata.annotations['<KEY>']`,
            spec.nodeName, spec.serviceAccountName, status.hostIP, status.podIP, status.podIPs.
            """
            if self._in_context and value_or_callback is None:
                context = FieldRef.BuilderContext()
                context._parent_builder = self
                context._field_name = "field_ref"
                return context

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

        @overload
        def resource_field_ref(
            self, value_or_callback: Optional[ResourceFieldRef], /
        ) -> "ValueFromModel.Builder": ...

        @overload
        def resource_field_ref(
            self,
            value_or_callback: Callable[
                [ResourceFieldRef.Builder], ResourceFieldRef.Builder | ResourceFieldRef
            ],
            /,
        ) -> "ValueFromModel.Builder": ...

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

        def resource_field_ref(self, value_or_callback=None, /):
            """
            Selects a resource of the container: only resources limits and requests
            (limits.cpu, limits.memory, limits.ephemeral-storage, requests.cpu, requests.memory and requests.ephemeral-storage) are currently supported.
            """
            if self._in_context and value_or_callback is None:
                context = ResourceFieldRef.BuilderContext()
                context._parent_builder = self
                context._field_name = "resource_field_ref"
                return context

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

        @overload
        def secret_key_ref(
            self, value_or_callback: Optional[SecretKeyRefModel], /
        ) -> "ValueFromModel.Builder": ...

        @overload
        def secret_key_ref(
            self,
            value_or_callback: Callable[
                [SecretKeyRefModel.Builder],
                SecretKeyRefModel.Builder | SecretKeyRefModel,
            ],
            /,
        ) -> "ValueFromModel.Builder": ...

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

        def secret_key_ref(self, value_or_callback=None, /):
            """
            Selects a key of a secret in the pod's namespace
            """
            if self._in_context and value_or_callback is None:
                context = SecretKeyRefModel.BuilderContext()
                context._parent_builder = self
                context._field_name = "secret_key_ref"
                return context

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

    class BuilderContext(BuilderContextBase["ValueFromModel.Builder"]):
        def model_post_init(self, __context) -> None:
            self._builder = ValueFromModel.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 ValueFromModel."""
        return cls.BuilderContext()

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

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

    config_map_key_ref: Annotated[Optional[ConfigMapKeyRef], Field(alias="configMapKeyRef")] = None
    """
    Selects a key of a ConfigMap.
    """
    field_ref: Annotated[Optional[FieldRef], Field(alias="fieldRef")] = None
    """
    Selects a field of the pod: supports metadata.name, metadata.namespace, `metadata.labels['<KEY>']`, `metadata.annotations['<KEY>']`,
    spec.nodeName, spec.serviceAccountName, status.hostIP, status.podIP, status.podIPs.
    """
    resource_field_ref: Annotated[Optional[ResourceFieldRef], Field(alias="resourceFieldRef")] = (
        None
    )
    """
    Selects a resource of the container: only resources limits and requests
    (limits.cpu, limits.memory, limits.ephemeral-storage, requests.cpu, requests.memory and requests.ephemeral-storage) are currently supported.
    """
    secret_key_ref: Annotated[Optional[SecretKeyRefModel], Field(alias="secretKeyRef")] = None
    """
    Selects a key of a secret in the pod's namespace
    """


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

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

        def name(self, value: str, /) -> Self:
            """
            Name of the environment variable. Must be a C_IDENTIFIER.
            """
            return self._set("name", value)

        def value(self, value: Optional[str], /) -> Self:
            """
            Variable references $(VAR_NAME) are expanded
            using the previously defined environment variables in the container and
            any service environment variables. If a variable cannot be resolved,
            the reference in the input string will be unchanged. Double $$ are reduced
            to a single $, which allows for escaping the $(VAR_NAME) syntax: i.e.
            "$$(VAR_NAME)" will produce the string literal "$(VAR_NAME)".
            Escaped references will never be expanded, regardless of whether the variable
            exists or not.
            Defaults to "".
            """
            return self._set("value", value)

        @overload
        def value_from(
            self, value_or_callback: Optional[ValueFromModel], /
        ) -> "EnvModel.Builder": ...

        @overload
        def value_from(
            self,
            value_or_callback: Callable[
                [ValueFromModel.Builder], ValueFromModel.Builder | ValueFromModel
            ],
            /,
        ) -> "EnvModel.Builder": ...

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

        def value_from(self, value_or_callback=None, /):
            """
            Source for the environment variable's value. Cannot be used if value is not empty.
            """
            if self._in_context and value_or_callback is None:
                context = ValueFromModel.BuilderContext()
                context._parent_builder = self
                context._field_name = "value_from"
                return context

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

    class BuilderContext(BuilderContextBase["EnvModel.Builder"]):
        def model_post_init(self, __context) -> None:
            self._builder = EnvModel.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 EnvModel."""
        return cls.BuilderContext()

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

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

    name: str
    """
    Name of the environment variable. Must be a C_IDENTIFIER.
    """
    value: Optional[str] = None
    """
    Variable references $(VAR_NAME) are expanded
    using the previously defined environment variables in the container and
    any service environment variables. If a variable cannot be resolved,
    the reference in the input string will be unchanged. Double $$ are reduced
    to a single $, which allows for escaping the $(VAR_NAME) syntax: i.e.
    "$$(VAR_NAME)" will produce the string literal "$(VAR_NAME)".
    Escaped references will never be expanded, regardless of whether the variable
    exists or not.
    Defaults to "".
    """
    value_from: Annotated[Optional[ValueFromModel], Field(alias="valueFrom")] = None
    """
    Source for the environment variable's value. Cannot be used if value is not empty.
    """


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

        def build(self) -> "ConfigMapRef":
            return ConfigMapRef(**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)

        def optional(self, value: Optional[bool], /) -> Self:
            """
            Specify whether the ConfigMap must be defined
            """
            return self._set("optional", value)

    class BuilderContext(BuilderContextBase["ConfigMapRef.Builder"]):
        def model_post_init(self, __context) -> None:
            self._builder = ConfigMapRef.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 ConfigMapRef."""
        return cls.BuilderContext()

    class ListBuilder(GenericListBuilder["ConfigMapRef", Builder]):
        def __init__(self):
            raise NotImplementedError(
                "This class is not meant to be instantiated. Use ConfigMapRef.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
    """
    optional: Optional[bool] = None
    """
    Specify whether the ConfigMap must be defined
    """


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

        def build(self) -> "SecretRef":
            return SecretRef(**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)

        def optional(self, value: Optional[bool], /) -> Self:
            """
            Specify whether the Secret must be defined
            """
            return self._set("optional", 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

    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
    """
    optional: Optional[bool] = None
    """
    Specify whether the Secret must be defined
    """


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

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

        @overload
        def config_map_ref(
            self, value_or_callback: Optional[ConfigMapRef], /
        ) -> "EnvFrom.Builder": ...

        @overload
        def config_map_ref(
            self,
            value_or_callback: Callable[
                [ConfigMapRef.Builder], ConfigMapRef.Builder | ConfigMapRef
            ],
            /,
        ) -> "EnvFrom.Builder": ...

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

        def config_map_ref(self, value_or_callback=None, /):
            """
            The ConfigMap to select from
            """
            if self._in_context and value_or_callback is None:
                context = ConfigMapRef.BuilderContext()
                context._parent_builder = self
                context._field_name = "config_map_ref"
                return context

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

        def prefix(self, value: Optional[str], /) -> Self:
            """
            An optional identifier to prepend to each key in the ConfigMap. Must be a C_IDENTIFIER.
            """
            return self._set("prefix", value)

        @overload
        def secret_ref(self, value_or_callback: Optional[SecretRef], /) -> "EnvFrom.Builder": ...

        @overload
        def secret_ref(
            self,
            value_or_callback: Callable[[SecretRef.Builder], SecretRef.Builder | SecretRef],
            /,
        ) -> "EnvFrom.Builder": ...

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

        def secret_ref(self, value_or_callback=None, /):
            """
            The Secret to select from
            """
            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["EnvFrom.Builder"]):
        def model_post_init(self, __context) -> None:
            self._builder = EnvFrom.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 EnvFrom."""
        return cls.BuilderContext()

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

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

    config_map_ref: Annotated[Optional[ConfigMapRef], Field(alias="configMapRef")] = None
    """
    The ConfigMap to select from
    """
    prefix: Optional[str] = None
    """
    An optional identifier to prepend to each key in the ConfigMap. Must be a C_IDENTIFIER.
    """
    secret_ref: Annotated[Optional[SecretRef], Field(alias="secretRef")] = None
    """
    The Secret to select from
    """


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

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

        def command(self, value: Optional[List[str]], /) -> Self:
            """
            Command is the command line to execute inside the container, the working directory for the
            command  is root ('/') in the container's filesystem. The command is simply exec'd, it is
            not run inside a shell, so traditional shell instructions ('|', etc) won't work. To use
            a shell, you need to explicitly call out to that shell.
            Exit status of 0 is treated as live/healthy and non-zero is unhealthy.
            """
            return self._set("command", value)

    class BuilderContext(BuilderContextBase["Exec.Builder"]):
        def model_post_init(self, __context) -> None:
            self._builder = Exec.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 Exec."""
        return cls.BuilderContext()

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

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

    command: Optional[List[str]] = None
    """
    Command is the command line to execute inside the container, the working directory for the
    command  is root ('/') in the container's filesystem. The command is simply exec'd, it is
    not run inside a shell, so traditional shell instructions ('|', etc) won't work. To use
    a shell, you need to explicitly call out to that shell.
    Exit status of 0 is treated as live/healthy and non-zero is unhealthy.
    """


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

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

        def name(self, value: str, /) -> Self:
            """
            The header field name.
            This will be canonicalized upon output, so case-variant names will be understood as the same header.
            """
            return self._set("name", value)

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

    class BuilderContext(BuilderContextBase["HttpHeader.Builder"]):
        def model_post_init(self, __context) -> None:
            self._builder = HttpHeader.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 HttpHeader."""
        return cls.BuilderContext()

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

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

    name: str
    """
    The header field name.
    This will be canonicalized upon output, so case-variant names will be understood as the same header.
    """
    value: str
    """
    The header field value
    """


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

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

        def host(self, value: Optional[str], /) -> Self:
            """
            Host name to connect to, defaults to the pod IP. You probably want to set
            "Host" in httpHeaders instead.
            """
            return self._set("host", value)

        @overload
        def http_headers(self, value_or_callback: List[HttpHeader], /) -> "HttpGet.Builder": ...

        @overload
        def http_headers(
            self,
            value_or_callback: Callable[
                [GenericListBuilder[HttpHeader, HttpHeader.Builder]],
                GenericListBuilder[HttpHeader, HttpHeader.Builder] | List[HttpHeader],
            ],
            /,
        ) -> "HttpGet.Builder": ...

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

        def http_headers(self, value_or_callback=None, /):
            """
            Custom headers to set in the request. HTTP allows repeated headers.
            """
            if self._in_context and value_or_callback is None:
                context = ListBuilderContext[HttpHeader.Builder]()
                context._parent_builder = self
                context._field_name = "http_headers"
                return context

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

        def path(self, value: Optional[str], /) -> Self:
            """
            Path to access on the HTTP server.
            """
            return self._set("path", value)

        def port(self, value: Union[int, str], /) -> Self:
            """
            Name or number of the port to access on the container.
            Number must be in the range 1 to 65535.
            Name must be an IANA_SVC_NAME.
            """
            return self._set("port", value)

        def scheme(self, value: Optional[str], /) -> Self:
            """
            Scheme to use for connecting to the host.
            Defaults to HTTP.
            """
            return self._set("scheme", value)

    class BuilderContext(BuilderContextBase["HttpGet.Builder"]):
        def model_post_init(self, __context) -> None:
            self._builder = HttpGet.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 HttpGet."""
        return cls.BuilderContext()

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

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

    host: Optional[str] = None
    """
    Host name to connect to, defaults to the pod IP. You probably want to set
    "Host" in httpHeaders instead.
    """
    http_headers: Annotated[Optional[List[HttpHeader]], Field(alias="httpHeaders")] = None
    """
    Custom headers to set in the request. HTTP allows repeated headers.
    """
    path: Optional[str] = None
    """
    Path to access on the HTTP server.
    """
    port: Union[int, str]
    """
    Name or number of the port to access on the container.
    Number must be in the range 1 to 65535.
    Name must be an IANA_SVC_NAME.
    """
    scheme: Optional[str] = None
    """
    Scheme to use for connecting to the host.
    Defaults to HTTP.
    """


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

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

        def seconds(self, value: int, /) -> Self:
            """
            Seconds is the number of seconds to sleep.
            """
            return self._set("seconds", value)

    class BuilderContext(BuilderContextBase["Sleep.Builder"]):
        def model_post_init(self, __context) -> None:
            self._builder = Sleep.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 Sleep."""
        return cls.BuilderContext()

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

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

    seconds: int
    """
    Seconds is the number of seconds to sleep.
    """


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

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

        def host(self, value: Optional[str], /) -> Self:
            """
            Optional: Host name to connect to, defaults to the pod IP.
            """
            return self._set("host", value)

        def port(self, value: Union[int, str], /) -> Self:
            """
            Number or name of the port to access on the container.
            Number must be in the range 1 to 65535.
            Name must be an IANA_SVC_NAME.
            """
            return self._set("port", value)

    class BuilderContext(BuilderContextBase["TcpSocket.Builder"]):
        def model_post_init(self, __context) -> None:
            self._builder = TcpSocket.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 TcpSocket."""
        return cls.BuilderContext()

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

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

    host: Optional[str] = None
    """
    Optional: Host name to connect to, defaults to the pod IP.
    """
    port: Union[int, str]
    """
    Number or name of the port to access on the container.
    Number must be in the range 1 to 65535.
    Name must be an IANA_SVC_NAME.
    """


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

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

        @overload
        def exec(self, value_or_callback: Optional[Exec], /) -> "PostStart.Builder": ...

        @overload
        def exec(
            self, value_or_callback: Callable[[Exec.Builder], Exec.Builder | Exec], /
        ) -> "PostStart.Builder": ...

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

        def exec(self, value_or_callback=None, /):
            """
            Exec specifies the action to take.
            """
            if self._in_context and value_or_callback is None:
                context = Exec.BuilderContext()
                context._parent_builder = self
                context._field_name = "exec"
                return context

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

        @overload
        def http_get(self, value_or_callback: Optional[HttpGet], /) -> "PostStart.Builder": ...

        @overload
        def http_get(
            self,
            value_or_callback: Callable[[HttpGet.Builder], HttpGet.Builder | HttpGet],
            /,
        ) -> "PostStart.Builder": ...

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

        def http_get(self, value_or_callback=None, /):
            """
            HTTPGet specifies the http request to perform.
            """
            if self._in_context and value_or_callback is None:
                context = HttpGet.BuilderContext()
                context._parent_builder = self
                context._field_name = "http_get"
                return context

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

        @overload
        def sleep(self, value_or_callback: Optional[Sleep], /) -> "PostStart.Builder": ...

        @overload
        def sleep(
            self, value_or_callback: Callable[[Sleep.Builder], Sleep.Builder | Sleep], /
        ) -> "PostStart.Builder": ...

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

        def sleep(self, value_or_callback=None, /):
            """
            Sleep represents the duration that the container should sleep before being terminated.
            """
            if self._in_context and value_or_callback is None:
                context = Sleep.BuilderContext()
                context._parent_builder = self
                context._field_name = "sleep"
                return context

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

        @overload
        def tcp_socket(self, value_or_callback: Optional[TcpSocket], /) -> "PostStart.Builder": ...

        @overload
        def tcp_socket(
            self,
            value_or_callback: Callable[[TcpSocket.Builder], TcpSocket.Builder | TcpSocket],
            /,
        ) -> "PostStart.Builder": ...

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

        def tcp_socket(self, value_or_callback=None, /):
            """
            Deprecated. TCPSocket is NOT supported as a LifecycleHandler and kept
            for the backward compatibility. There are no validation of this field and
            lifecycle hooks will fail in runtime when tcp handler is specified.
            """
            if self._in_context and value_or_callback is None:
                context = TcpSocket.BuilderContext()
                context._parent_builder = self
                context._field_name = "tcp_socket"
                return context

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

    class BuilderContext(BuilderContextBase["PostStart.Builder"]):
        def model_post_init(self, __context) -> None:
            self._builder = PostStart.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 PostStart."""
        return cls.BuilderContext()

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

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

    exec: Optional[Exec] = None
    """
    Exec specifies the action to take.
    """
    http_get: Annotated[Optional[HttpGet], Field(alias="httpGet")] = None
    """
    HTTPGet specifies the http request to perform.
    """
    sleep: Optional[Sleep] = None
    """
    Sleep represents the duration that the container should sleep before being terminated.
    """
    tcp_socket: Annotated[Optional[TcpSocket], Field(alias="tcpSocket")] = None
    """
    Deprecated. TCPSocket is NOT supported as a LifecycleHandler and kept
    for the backward compatibility. There are no validation of this field and
    lifecycle hooks will fail in runtime when tcp handler is specified.
    """


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

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

        @overload
        def exec(self, value_or_callback: Optional[Exec], /) -> "PreStop.Builder": ...

        @overload
        def exec(
            self, value_or_callback: Callable[[Exec.Builder], Exec.Builder | Exec], /
        ) -> "PreStop.Builder": ...

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

        def exec(self, value_or_callback=None, /):
            """
            Exec specifies the action to take.
            """
            if self._in_context and value_or_callback is None:
                context = Exec.BuilderContext()
                context._parent_builder = self
                context._field_name = "exec"
                return context

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

        @overload
        def http_get(self, value_or_callback: Optional[HttpGet], /) -> "PreStop.Builder": ...

        @overload
        def http_get(
            self,
            value_or_callback: Callable[[HttpGet.Builder], HttpGet.Builder | HttpGet],
            /,
        ) -> "PreStop.Builder": ...

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

        def http_get(self, value_or_callback=None, /):
            """
            HTTPGet specifies the http request to perform.
            """
            if self._in_context and value_or_callback is None:
                context = HttpGet.BuilderContext()
                context._parent_builder = self
                context._field_name = "http_get"
                return context

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

        @overload
        def sleep(self, value_or_callback: Optional[Sleep], /) -> "PreStop.Builder": ...

        @overload
        def sleep(
            self, value_or_callback: Callable[[Sleep.Builder], Sleep.Builder | Sleep], /
        ) -> "PreStop.Builder": ...

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

        def sleep(self, value_or_callback=None, /):
            """
            Sleep represents the duration that the container should sleep before being terminated.
            """
            if self._in_context and value_or_callback is None:
                context = Sleep.BuilderContext()
                context._parent_builder = self
                context._field_name = "sleep"
                return context

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

        @overload
        def tcp_socket(self, value_or_callback: Optional[TcpSocket], /) -> "PreStop.Builder": ...

        @overload
        def tcp_socket(
            self,
            value_or_callback: Callable[[TcpSocket.Builder], TcpSocket.Builder | TcpSocket],
            /,
        ) -> "PreStop.Builder": ...

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

        def tcp_socket(self, value_or_callback=None, /):
            """
            Deprecated. TCPSocket is NOT supported as a LifecycleHandler and kept
            for the backward compatibility. There are no validation of this field and
            lifecycle hooks will fail in runtime when tcp handler is specified.
            """
            if self._in_context and value_or_callback is None:
                context = TcpSocket.BuilderContext()
                context._parent_builder = self
                context._field_name = "tcp_socket"
                return context

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

    class BuilderContext(BuilderContextBase["PreStop.Builder"]):
        def model_post_init(self, __context) -> None:
            self._builder = PreStop.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 PreStop."""
        return cls.BuilderContext()

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

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

    exec: Optional[Exec] = None
    """
    Exec specifies the action to take.
    """
    http_get: Annotated[Optional[HttpGet], Field(alias="httpGet")] = None
    """
    HTTPGet specifies the http request to perform.
    """
    sleep: Optional[Sleep] = None
    """
    Sleep represents the duration that the container should sleep before being terminated.
    """
    tcp_socket: Annotated[Optional[TcpSocket], Field(alias="tcpSocket")] = None
    """
    Deprecated. TCPSocket is NOT supported as a LifecycleHandler and kept
    for the backward compatibility. There are no validation of this field and
    lifecycle hooks will fail in runtime when tcp handler is specified.
    """


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

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

        @overload
        def post_start(self, value_or_callback: Optional[PostStart], /) -> "Lifecycle.Builder": ...

        @overload
        def post_start(
            self,
            value_or_callback: Callable[[PostStart.Builder], PostStart.Builder | PostStart],
            /,
        ) -> "Lifecycle.Builder": ...

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

        def post_start(self, value_or_callback=None, /):
            """
            PostStart is called immediately after a container is created. If the handler fails,
            the container is terminated and restarted according to its restart policy.
            Other management of the container blocks until the hook completes.
            More info: https://kubernetes.io/docs/concepts/containers/container-lifecycle-hooks/#container-hooks
            """
            if self._in_context and value_or_callback is None:
                context = PostStart.BuilderContext()
                context._parent_builder = self
                context._field_name = "post_start"
                return context

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

        @overload
        def pre_stop(self, value_or_callback: Optional[PreStop], /) -> "Lifecycle.Builder": ...

        @overload
        def pre_stop(
            self,
            value_or_callback: Callable[[PreStop.Builder], PreStop.Builder | PreStop],
            /,
        ) -> "Lifecycle.Builder": ...

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

        def pre_stop(self, value_or_callback=None, /):
            """
            PreStop is called immediately before a container is terminated due to an
            API request or management event such as liveness/startup probe failure,
            preemption, resource contention, etc. The handler is not called if the
            container crashes or exits. The Pod's termination grace period countdown begins before the
            PreStop hook is executed. Regardless of the outcome of the handler, the
            container will eventually terminate within the Pod's termination grace
            period (unless delayed by finalizers). Other management of the container blocks until the hook completes
            or until the termination grace period is reached.
            More info: https://kubernetes.io/docs/concepts/containers/container-lifecycle-hooks/#container-hooks
            """
            if self._in_context and value_or_callback is None:
                context = PreStop.BuilderContext()
                context._parent_builder = self
                context._field_name = "pre_stop"
                return context

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

    class BuilderContext(BuilderContextBase["Lifecycle.Builder"]):
        def model_post_init(self, __context) -> None:
            self._builder = Lifecycle.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 Lifecycle."""
        return cls.BuilderContext()

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

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

    post_start: Annotated[Optional[PostStart], Field(alias="postStart")] = None
    """
    PostStart is called immediately after a container is created. If the handler fails,
    the container is terminated and restarted according to its restart policy.
    Other management of the container blocks until the hook completes.
    More info: https://kubernetes.io/docs/concepts/containers/container-lifecycle-hooks/#container-hooks
    """
    pre_stop: Annotated[Optional[PreStop], Field(alias="preStop")] = None
    """
    PreStop is called immediately before a container is terminated due to an
    API request or management event such as liveness/startup probe failure,
    preemption, resource contention, etc. The handler is not called if the
    container crashes or exits. The Pod's termination grace period countdown begins before the
    PreStop hook is executed. Regardless of the outcome of the handler, the
    container will eventually terminate within the Pod's termination grace
    period (unless delayed by finalizers). Other management of the container blocks until the hook completes
    or until the termination grace period is reached.
    More info: https://kubernetes.io/docs/concepts/containers/container-lifecycle-hooks/#container-hooks
    """


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

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

        def port(self, value: int, /) -> Self:
            """
            Port number of the gRPC service. Number must be in the range 1 to 65535.
            """
            return self._set("port", value)

        def service(self, value: Optional[str], /) -> Self:
            """
            Service is the name of the service to place in the gRPC HealthCheckRequest
            (see https://github.com/grpc/grpc/blob/master/doc/health-checking.md).

            If this is not specified, the default behavior is defined by gRPC.
            """
            return self._set("service", value)

    class BuilderContext(BuilderContextBase["Grpc.Builder"]):
        def model_post_init(self, __context) -> None:
            self._builder = Grpc.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 Grpc."""
        return cls.BuilderContext()

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

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

    port: int
    """
    Port number of the gRPC service. Number must be in the range 1 to 65535.
    """
    service: Optional[str] = ""
    """
    Service is the name of the service to place in the gRPC HealthCheckRequest
    (see https://github.com/grpc/grpc/blob/master/doc/health-checking.md).

    If this is not specified, the default behavior is defined by gRPC.
    """


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

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

        @overload
        def exec(self, value_or_callback: Optional[Exec], /) -> "LivenessProbe.Builder": ...

        @overload
        def exec(
            self, value_or_callback: Callable[[Exec.Builder], Exec.Builder | Exec], /
        ) -> "LivenessProbe.Builder": ...

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

        def exec(self, value_or_callback=None, /):
            """
            Exec specifies the action to take.
            """
            if self._in_context and value_or_callback is None:
                context = Exec.BuilderContext()
                context._parent_builder = self
                context._field_name = "exec"
                return context

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

        def failure_threshold(self, value: Optional[int], /) -> Self:
            """
            Minimum consecutive failures for the probe to be considered failed after having succeeded.
            Defaults to 3. Minimum value is 1.
            """
            return self._set("failure_threshold", value)

        @overload
        def grpc(self, value_or_callback: Optional[Grpc], /) -> "LivenessProbe.Builder": ...

        @overload
        def grpc(
            self, value_or_callback: Callable[[Grpc.Builder], Grpc.Builder | Grpc], /
        ) -> "LivenessProbe.Builder": ...

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

        def grpc(self, value_or_callback=None, /):
            """
            GRPC specifies an action involving a GRPC port.
            """
            if self._in_context and value_or_callback is None:
                context = Grpc.BuilderContext()
                context._parent_builder = self
                context._field_name = "grpc"
                return context

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

        @overload
        def http_get(self, value_or_callback: Optional[HttpGet], /) -> "LivenessProbe.Builder": ...

        @overload
        def http_get(
            self,
            value_or_callback: Callable[[HttpGet.Builder], HttpGet.Builder | HttpGet],
            /,
        ) -> "LivenessProbe.Builder": ...

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

        def http_get(self, value_or_callback=None, /):
            """
            HTTPGet specifies the http request to perform.
            """
            if self._in_context and value_or_callback is None:
                context = HttpGet.BuilderContext()
                context._parent_builder = self
                context._field_name = "http_get"
                return context

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

        def initial_delay_seconds(self, value: Optional[int], /) -> Self:
            """
            Number of seconds after the container has started before liveness probes are initiated.
            More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes
            """
            return self._set("initial_delay_seconds", value)

        def period_seconds(self, value: Optional[int], /) -> Self:
            """
            How often (in seconds) to perform the probe.
            Default to 10 seconds. Minimum value is 1.
            """
            return self._set("period_seconds", value)

        def success_threshold(self, value: Optional[int], /) -> Self:
            """
            Minimum consecutive successes for the probe to be considered successful after having failed.
            Defaults to 1. Must be 1 for liveness and startup. Minimum value is 1.
            """
            return self._set("success_threshold", value)

        @overload
        def tcp_socket(
            self, value_or_callback: Optional[TcpSocket], /
        ) -> "LivenessProbe.Builder": ...

        @overload
        def tcp_socket(
            self,
            value_or_callback: Callable[[TcpSocket.Builder], TcpSocket.Builder | TcpSocket],
            /,
        ) -> "LivenessProbe.Builder": ...

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

        def tcp_socket(self, value_or_callback=None, /):
            """
            TCPSocket specifies an action involving a TCP port.
            """
            if self._in_context and value_or_callback is None:
                context = TcpSocket.BuilderContext()
                context._parent_builder = self
                context._field_name = "tcp_socket"
                return context

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

        def termination_grace_period_seconds(self, value: Optional[int], /) -> Self:
            """
            Optional duration in seconds the pod needs to terminate gracefully upon probe failure.
            The grace period is the duration in seconds after the processes running in the pod are sent
            a termination signal and the time when the processes are forcibly halted with a kill signal.
            Set this value longer than the expected cleanup time for your process.
            If this value is nil, the pod's terminationGracePeriodSeconds will be used. Otherwise, this
            value overrides the value provided by the pod spec.
            Value must be non-negative integer. The value zero indicates stop immediately via
            the kill signal (no opportunity to shut down).
            This is a beta field and requires enabling ProbeTerminationGracePeriod feature gate.
            Minimum value is 1. spec.terminationGracePeriodSeconds is used if unset.
            """
            return self._set("termination_grace_period_seconds", value)

        def timeout_seconds(self, value: Optional[int], /) -> Self:
            """
            Number of seconds after which the probe times out.
            Defaults to 1 second. Minimum value is 1.
            More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes
            """
            return self._set("timeout_seconds", value)

    class BuilderContext(BuilderContextBase["LivenessProbe.Builder"]):
        def model_post_init(self, __context) -> None:
            self._builder = LivenessProbe.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 LivenessProbe."""
        return cls.BuilderContext()

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

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

    exec: Optional[Exec] = None
    """
    Exec specifies the action to take.
    """
    failure_threshold: Annotated[Optional[int], Field(alias="failureThreshold")] = None
    """
    Minimum consecutive failures for the probe to be considered failed after having succeeded.
    Defaults to 3. Minimum value is 1.
    """
    grpc: Optional[Grpc] = None
    """
    GRPC specifies an action involving a GRPC port.
    """
    http_get: Annotated[Optional[HttpGet], Field(alias="httpGet")] = None
    """
    HTTPGet specifies the http request to perform.
    """
    initial_delay_seconds: Annotated[Optional[int], Field(alias="initialDelaySeconds")] = None
    """
    Number of seconds after the container has started before liveness probes are initiated.
    More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes
    """
    period_seconds: Annotated[Optional[int], Field(alias="periodSeconds")] = None
    """
    How often (in seconds) to perform the probe.
    Default to 10 seconds. Minimum value is 1.
    """
    success_threshold: Annotated[Optional[int], Field(alias="successThreshold")] = None
    """
    Minimum consecutive successes for the probe to be considered successful after having failed.
    Defaults to 1. Must be 1 for liveness and startup. Minimum value is 1.
    """
    tcp_socket: Annotated[Optional[TcpSocket], Field(alias="tcpSocket")] = None
    """
    TCPSocket specifies an action involving a TCP port.
    """
    termination_grace_period_seconds: Annotated[
        Optional[int], Field(alias="terminationGracePeriodSeconds")
    ] = None
    """
    Optional duration in seconds the pod needs to terminate gracefully upon probe failure.
    The grace period is the duration in seconds after the processes running in the pod are sent
    a termination signal and the time when the processes are forcibly halted with a kill signal.
    Set this value longer than the expected cleanup time for your process.
    If this value is nil, the pod's terminationGracePeriodSeconds will be used. Otherwise, this
    value overrides the value provided by the pod spec.
    Value must be non-negative integer. The value zero indicates stop immediately via
    the kill signal (no opportunity to shut down).
    This is a beta field and requires enabling ProbeTerminationGracePeriod feature gate.
    Minimum value is 1. spec.terminationGracePeriodSeconds is used if unset.
    """
    timeout_seconds: Annotated[Optional[int], Field(alias="timeoutSeconds")] = None
    """
    Number of seconds after which the probe times out.
    Defaults to 1 second. Minimum value is 1.
    More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes
    """


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

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

        def container_port(self, value: int, /) -> Self:
            """
            Number of port to expose on the pod's IP address.
            This must be a valid port number, 0 < x < 65536.
            """
            return self._set("container_port", value)

        def host_ip(self, value: Optional[str], /) -> Self:
            """
            What host IP to bind the external port to.
            """
            return self._set("host_ip", value)

        def host_port(self, value: Optional[int], /) -> Self:
            """
            Number of port to expose on the host.
            If specified, this must be a valid port number, 0 < x < 65536.
            If HostNetwork is specified, this must match ContainerPort.
            Most containers do not need this.
            """
            return self._set("host_port", value)

        def name(self, value: Optional[str], /) -> Self:
            """
            If specified, this must be an IANA_SVC_NAME and unique within the pod. Each
            named port in a pod must have a unique name. Name for the port that can be
            referred to by services.
            """
            return self._set("name", value)

        def protocol(self, value: Optional[str], /) -> Self:
            """
            Protocol for port. Must be UDP, TCP, or SCTP.
            Defaults to "TCP".
            """
            return self._set("protocol", value)

    class BuilderContext(BuilderContextBase["Port.Builder"]):
        def model_post_init(self, __context) -> None:
            self._builder = Port.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 Port."""
        return cls.BuilderContext()

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

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

    container_port: Annotated[int, Field(alias="containerPort")]
    """
    Number of port to expose on the pod's IP address.
    This must be a valid port number, 0 < x < 65536.
    """
    host_ip: Annotated[Optional[str], Field(alias="hostIP")] = None
    """
    What host IP to bind the external port to.
    """
    host_port: Annotated[Optional[int], Field(alias="hostPort")] = None
    """
    Number of port to expose on the host.
    If specified, this must be a valid port number, 0 < x < 65536.
    If HostNetwork is specified, this must match ContainerPort.
    Most containers do not need this.
    """
    name: Optional[str] = None
    """
    If specified, this must be an IANA_SVC_NAME and unique within the pod. Each
    named port in a pod must have a unique name. Name for the port that can be
    referred to by services.
    """
    protocol: Optional[str] = "TCP"
    """
    Protocol for port. Must be UDP, TCP, or SCTP.
    Defaults to "TCP".
    """


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

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

        @overload
        def exec(self, value_or_callback: Optional[Exec], /) -> "ReadinessProbe.Builder": ...

        @overload
        def exec(
            self, value_or_callback: Callable[[Exec.Builder], Exec.Builder | Exec], /
        ) -> "ReadinessProbe.Builder": ...

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

        def exec(self, value_or_callback=None, /):
            """
            Exec specifies the action to take.
            """
            if self._in_context and value_or_callback is None:
                context = Exec.BuilderContext()
                context._parent_builder = self
                context._field_name = "exec"
                return context

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

        def failure_threshold(self, value: Optional[int], /) -> Self:
            """
            Minimum consecutive failures for the probe to be considered failed after having succeeded.
            Defaults to 3. Minimum value is 1.
            """
            return self._set("failure_threshold", value)

        @overload
        def grpc(self, value_or_callback: Optional[Grpc], /) -> "ReadinessProbe.Builder": ...

        @overload
        def grpc(
            self, value_or_callback: Callable[[Grpc.Builder], Grpc.Builder | Grpc], /
        ) -> "ReadinessProbe.Builder": ...

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

        def grpc(self, value_or_callback=None, /):
            """
            GRPC specifies an action involving a GRPC port.
            """
            if self._in_context and value_or_callback is None:
                context = Grpc.BuilderContext()
                context._parent_builder = self
                context._field_name = "grpc"
                return context

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

        @overload
        def http_get(self, value_or_callback: Optional[HttpGet], /) -> "ReadinessProbe.Builder": ...

        @overload
        def http_get(
            self,
            value_or_callback: Callable[[HttpGet.Builder], HttpGet.Builder | HttpGet],
            /,
        ) -> "ReadinessProbe.Builder": ...

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

        def http_get(self, value_or_callback=None, /):
            """
            HTTPGet specifies the http request to perform.
            """
            if self._in_context and value_or_callback is None:
                context = HttpGet.BuilderContext()
                context._parent_builder = self
                context._field_name = "http_get"
                return context

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

        def initial_delay_seconds(self, value: Optional[int], /) -> Self:
            """
            Number of seconds after the container has started before liveness probes are initiated.
            More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes
            """
            return self._set("initial_delay_seconds", value)

        def period_seconds(self, value: Optional[int], /) -> Self:
            """
            How often (in seconds) to perform the probe.
            Default to 10 seconds. Minimum value is 1.
            """
            return self._set("period_seconds", value)

        def success_threshold(self, value: Optional[int], /) -> Self:
            """
            Minimum consecutive successes for the probe to be considered successful after having failed.
            Defaults to 1. Must be 1 for liveness and startup. Minimum value is 1.
            """
            return self._set("success_threshold", value)

        @overload
        def tcp_socket(
            self, value_or_callback: Optional[TcpSocket], /
        ) -> "ReadinessProbe.Builder": ...

        @overload
        def tcp_socket(
            self,
            value_or_callback: Callable[[TcpSocket.Builder], TcpSocket.Builder | TcpSocket],
            /,
        ) -> "ReadinessProbe.Builder": ...

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

        def tcp_socket(self, value_or_callback=None, /):
            """
            TCPSocket specifies an action involving a TCP port.
            """
            if self._in_context and value_or_callback is None:
                context = TcpSocket.BuilderContext()
                context._parent_builder = self
                context._field_name = "tcp_socket"
                return context

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

        def termination_grace_period_seconds(self, value: Optional[int], /) -> Self:
            """
            Optional duration in seconds the pod needs to terminate gracefully upon probe failure.
            The grace period is the duration in seconds after the processes running in the pod are sent
            a termination signal and the time when the processes are forcibly halted with a kill signal.
            Set this value longer than the expected cleanup time for your process.
            If this value is nil, the pod's terminationGracePeriodSeconds will be used. Otherwise, this
            value overrides the value provided by the pod spec.
            Value must be non-negative integer. The value zero indicates stop immediately via
            the kill signal (no opportunity to shut down).
            This is a beta field and requires enabling ProbeTerminationGracePeriod feature gate.
            Minimum value is 1. spec.terminationGracePeriodSeconds is used if unset.
            """
            return self._set("termination_grace_period_seconds", value)

        def timeout_seconds(self, value: Optional[int], /) -> Self:
            """
            Number of seconds after which the probe times out.
            Defaults to 1 second. Minimum value is 1.
            More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes
            """
            return self._set("timeout_seconds", value)

    class BuilderContext(BuilderContextBase["ReadinessProbe.Builder"]):
        def model_post_init(self, __context) -> None:
            self._builder = ReadinessProbe.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 ReadinessProbe."""
        return cls.BuilderContext()

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

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

    exec: Optional[Exec] = None
    """
    Exec specifies the action to take.
    """
    failure_threshold: Annotated[Optional[int], Field(alias="failureThreshold")] = None
    """
    Minimum consecutive failures for the probe to be considered failed after having succeeded.
    Defaults to 3. Minimum value is 1.
    """
    grpc: Optional[Grpc] = None
    """
    GRPC specifies an action involving a GRPC port.
    """
    http_get: Annotated[Optional[HttpGet], Field(alias="httpGet")] = None
    """
    HTTPGet specifies the http request to perform.
    """
    initial_delay_seconds: Annotated[Optional[int], Field(alias="initialDelaySeconds")] = None
    """
    Number of seconds after the container has started before liveness probes are initiated.
    More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes
    """
    period_seconds: Annotated[Optional[int], Field(alias="periodSeconds")] = None
    """
    How often (in seconds) to perform the probe.
    Default to 10 seconds. Minimum value is 1.
    """
    success_threshold: Annotated[Optional[int], Field(alias="successThreshold")] = None
    """
    Minimum consecutive successes for the probe to be considered successful after having failed.
    Defaults to 1. Must be 1 for liveness and startup. Minimum value is 1.
    """
    tcp_socket: Annotated[Optional[TcpSocket], Field(alias="tcpSocket")] = None
    """
    TCPSocket specifies an action involving a TCP port.
    """
    termination_grace_period_seconds: Annotated[
        Optional[int], Field(alias="terminationGracePeriodSeconds")
    ] = None
    """
    Optional duration in seconds the pod needs to terminate gracefully upon probe failure.
    The grace period is the duration in seconds after the processes running in the pod are sent
    a termination signal and the time when the processes are forcibly halted with a kill signal.
    Set this value longer than the expected cleanup time for your process.
    If this value is nil, the pod's terminationGracePeriodSeconds will be used. Otherwise, this
    value overrides the value provided by the pod spec.
    Value must be non-negative integer. The value zero indicates stop immediately via
    the kill signal (no opportunity to shut down).
    This is a beta field and requires enabling ProbeTerminationGracePeriod feature gate.
    Minimum value is 1. spec.terminationGracePeriodSeconds is used if unset.
    """
    timeout_seconds: Annotated[Optional[int], Field(alias="timeoutSeconds")] = None
    """
    Number of seconds after which the probe times out.
    Defaults to 1 second. Minimum value is 1.
    More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes
    """


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

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

        def resource_name(self, value: str, /) -> Self:
            """
            Name of the resource to which this resource resize policy applies.
            Supported values: cpu, memory.
            """
            return self._set("resource_name", value)

        def restart_policy(self, value: str, /) -> Self:
            """
            Restart policy to apply when specified resource is resized.
            If not specified, it defaults to NotRequired.
            """
            return self._set("restart_policy", value)

    class BuilderContext(BuilderContextBase["ResizePolicy.Builder"]):
        def model_post_init(self, __context) -> None:
            self._builder = ResizePolicy.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 ResizePolicy."""
        return cls.BuilderContext()

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

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

    resource_name: Annotated[str, Field(alias="resourceName")]
    """
    Name of the resource to which this resource resize policy applies.
    Supported values: cpu, memory.
    """
    restart_policy: Annotated[str, Field(alias="restartPolicy")]
    """
    Restart policy to apply when specified resource is resized.
    If not specified, it defaults to NotRequired.
    """


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

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

        def name(self, value: str, /) -> Self:
            """
            Name must match the name of one entry in pod.spec.resourceClaims of
            the Pod where this field is used. It makes that resource available
            inside a container.
            """
            return self._set("name", value)

        def request(self, value: Optional[str], /) -> Self:
            """
            Request is the name chosen for a request in the referenced claim.
            If empty, everything from the claim is made available, otherwise
            only the result of this request.
            """
            return self._set("request", value)

    class BuilderContext(BuilderContextBase["Claim.Builder"]):
        def model_post_init(self, __context) -> None:
            self._builder = Claim.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 Claim."""
        return cls.BuilderContext()

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

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

    name: str
    """
    Name must match the name of one entry in pod.spec.resourceClaims of
    the Pod where this field is used. It makes that resource available
    inside a container.
    """
    request: Optional[str] = None
    """
    Request is the name chosen for a request in the referenced claim.
    If empty, everything from the claim is made available, otherwise
    only the result of this request.
    """


class Limits(RootModel[int]):
    class Builder(BaseBuilder):
        _value: int | None = None

        def root(self, value: int, /) -> Self:
            self._value = value
            return self

        def __call__(self, value: int, /) -> Self:
            self._value = value
            return self

        def build(self) -> "Limits":
            value = cast(int, self._value)
            return Limits(value)

    root: Annotated[
        int,
        Field(
            pattern="^(\\+|-)?(([0-9]+(\\.[0-9]*)?)|(\\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\\+|-)?(([0-9]+(\\.[0-9]*)?)|(\\.[0-9]+))))?$"
        ),
    ]

    class BuilderContext(BuilderContextBase["Limits.Builder"]):
        def model_post_init(self, __context) -> None:
            self._builder = Limits.Builder()
            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 Limits."""
        return cls.BuilderContext()


class LimitsModel(RootModel[str]):
    class Builder(BaseBuilder):
        _value: str | None = None

        def root(self, value: str, /) -> Self:
            self._value = value
            return self

        def __call__(self, value: str, /) -> Self:
            self._value = value
            return self

        def build(self) -> "LimitsModel":
            value = cast(str, self._value)
            return LimitsModel(value)

    root: Annotated[
        str,
        Field(
            pattern="^(\\+|-)?(([0-9]+(\\.[0-9]*)?)|(\\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\\+|-)?(([0-9]+(\\.[0-9]*)?)|(\\.[0-9]+))))?$"
        ),
    ]

    class BuilderContext(BuilderContextBase["LimitsModel.Builder"]):
        def model_post_init(self, __context) -> None:
            self._builder = LimitsModel.Builder()
            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 LimitsModel."""
        return cls.BuilderContext()


class Requests(RootModel[int]):
    class Builder(BaseBuilder):
        _value: int | None = None

        def root(self, value: int, /) -> Self:
            self._value = value
            return self

        def __call__(self, value: int, /) -> Self:
            self._value = value
            return self

        def build(self) -> "Requests":
            value = cast(int, self._value)
            return Requests(value)

    root: Annotated[
        int,
        Field(
            pattern="^(\\+|-)?(([0-9]+(\\.[0-9]*)?)|(\\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\\+|-)?(([0-9]+(\\.[0-9]*)?)|(\\.[0-9]+))))?$"
        ),
    ]

    class BuilderContext(BuilderContextBase["Requests.Builder"]):
        def model_post_init(self, __context) -> None:
            self._builder = Requests.Builder()
            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 Requests."""
        return cls.BuilderContext()


class RequestsModel(RootModel[str]):
    class Builder(BaseBuilder):
        _value: str | None = None

        def root(self, value: str, /) -> Self:
            self._value = value
            return self

        def __call__(self, value: str, /) -> Self:
            self._value = value
            return self

        def build(self) -> "RequestsModel":
            value = cast(str, self._value)
            return RequestsModel(value)

    root: Annotated[
        str,
        Field(
            pattern="^(\\+|-)?(([0-9]+(\\.[0-9]*)?)|(\\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\\+|-)?(([0-9]+(\\.[0-9]*)?)|(\\.[0-9]+))))?$"
        ),
    ]

    class BuilderContext(BuilderContextBase["RequestsModel.Builder"]):
        def model_post_init(self, __context) -> None:
            self._builder = RequestsModel.Builder()
            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 RequestsModel."""
        return cls.BuilderContext()


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

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

        @overload
        def claims(self, value_or_callback: List[Claim], /) -> "Resources.Builder": ...

        @overload
        def claims(
            self,
            value_or_callback: Callable[
                [GenericListBuilder[Claim, Claim.Builder]],
                GenericListBuilder[Claim, Claim.Builder] | List[Claim],
            ],
            /,
        ) -> "Resources.Builder": ...

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

        def claims(self, value_or_callback=None, /):
            """
            Claims lists the names of resources, defined in spec.resourceClaims,
            that are used by this container.

            This is an alpha field and requires enabling the
            DynamicResourceAllocation feature gate.

            This field is immutable. It can only be set for containers.
            """
            if self._in_context and value_or_callback is None:
                context = ListBuilderContext[Claim.Builder]()
                context._parent_builder = self
                context._field_name = "claims"
                return context

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

        def limits(self, value: Optional[Dict[str, Union[Limits, LimitsModel]]], /) -> Self:
            """
            Limits describes the maximum amount of compute resources allowed.
            More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/
            """
            return self._set("limits", value)

        def requests(self, value: Optional[Dict[str, Union[Requests, RequestsModel]]], /) -> Self:
            """
            Requests describes the minimum amount of compute resources required.
            If Requests is omitted for a container, it defaults to Limits if that is explicitly specified,
            otherwise to an implementation-defined value. Requests cannot exceed Limits.
            More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/
            """
            return self._set("requests", value)

    class BuilderContext(BuilderContextBase["Resources.Builder"]):
        def model_post_init(self, __context) -> None:
            self._builder = Resources.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 Resources."""
        return cls.BuilderContext()

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

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

    claims: Optional[List[Claim]] = None
    """
    Claims lists the names of resources, defined in spec.resourceClaims,
    that are used by this container.

    This is an alpha field and requires enabling the
    DynamicResourceAllocation feature gate.

    This field is immutable. It can only be set for containers.
    """
    limits: Optional[Dict[str, Union[Limits, LimitsModel]]] = None
    """
    Limits describes the maximum amount of compute resources allowed.
    More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/
    """
    requests: Optional[Dict[str, Union[Requests, RequestsModel]]] = None
    """
    Requests describes the minimum amount of compute resources required.
    If Requests is omitted for a container, it defaults to Limits if that is explicitly specified,
    otherwise to an implementation-defined value. Requests cannot exceed Limits.
    More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/
    """


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

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

        def localhost_profile(self, value: Optional[str], /) -> Self:
            """
            localhostProfile indicates a profile loaded on the node that should be used.
            The profile must be preconfigured on the node to work.
            Must match the loaded name of the profile.
            Must be set if and only if type is "Localhost".
            """
            return self._set("localhost_profile", value)

        def type(self, value: str, /) -> Self:
            """
            type indicates which kind of AppArmor profile will be applied.
            Valid options are:
              Localhost - a profile pre-loaded on the node.
              RuntimeDefault - the container runtime's default profile.
              Unconfined - no AppArmor enforcement.
            """
            return self._set("type", value)

    class BuilderContext(BuilderContextBase["AppArmorProfile.Builder"]):
        def model_post_init(self, __context) -> None:
            self._builder = AppArmorProfile.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 AppArmorProfile."""
        return cls.BuilderContext()

    class ListBuilder(GenericListBuilder["AppArmorProfile", Builder]):
        def __init__(self):
            raise NotImplementedError(
                "This class is not meant to be instantiated. Use AppArmorProfile.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 loaded on the node that should be used.
    The profile must be preconfigured on the node to work.
    Must match the loaded name of the profile.
    Must be set if and only if type is "Localhost".
    """
    type: str
    """
    type indicates which kind of AppArmor profile will be applied.
    Valid options are:
      Localhost - a profile pre-loaded on the node.
      RuntimeDefault - the container runtime's default profile.
      Unconfined - no AppArmor enforcement.
    """


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

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

        def add(self, value: Optional[List[str]], /) -> Self:
            """
            Added capabilities
            """
            return self._set("add", value)

        def drop(self, value: Optional[List[str]], /) -> Self:
            """
            Removed capabilities
            """
            return self._set("drop", value)

    class BuilderContext(BuilderContextBase["Capabilities.Builder"]):
        def model_post_init(self, __context) -> None:
            self._builder = Capabilities.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 Capabilities."""
        return cls.BuilderContext()

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

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

    add: Optional[List[str]] = None
    """
    Added capabilities
    """
    drop: Optional[List[str]] = None
    """
    Removed capabilities
    """


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 WindowsOptions(BaseModel):
    class Builder(BaseModelBuilder):
        @property
        def cls(self) -> Type["WindowsOptions"]:
            return WindowsOptions

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

        def gmsa_credential_spec(self, value: Optional[str], /) -> Self:
            """
            GMSACredentialSpec is where the GMSA admission webhook
            (https://github.com/kubernetes-sigs/windows-gmsa) inlines the contents of the
            GMSA credential spec named by the GMSACredentialSpecName field.
            """
            return self._set("gmsa_credential_spec", value)

        def gmsa_credential_spec_name(self, value: Optional[str], /) -> Self:
            """
            GMSACredentialSpecName is the name of the GMSA credential spec to use.
            """
            return self._set("gmsa_credential_spec_name", value)

        def host_process(self, value: Optional[bool], /) -> Self:
            """
            HostProcess determines if a container should be run as a 'Host Process' container.
            All of a Pod's containers must have the same effective HostProcess value
            (it is not allowed to have a mix of HostProcess containers and non-HostProcess containers).
            In addition, if HostProcess is true then HostNetwork must also be set to true.
            """
            return self._set("host_process", value)

        def run_as_user_name(self, value: Optional[str], /) -> Self:
            """
            The UserName in Windows to run the entrypoint of the container process.
            Defaults to the user specified in image metadata if unspecified.
            May also be set in PodSecurityContext. If set in both SecurityContext and
            PodSecurityContext, the value specified in SecurityContext takes precedence.
            """
            return self._set("run_as_user_name", value)

    class BuilderContext(BuilderContextBase["WindowsOptions.Builder"]):
        def model_post_init(self, __context) -> None:
            self._builder = WindowsOptions.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 WindowsOptions."""
        return cls.BuilderContext()

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

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

    gmsa_credential_spec: Annotated[Optional[str], Field(alias="gmsaCredentialSpec")] = None
    """
    GMSACredentialSpec is where the GMSA admission webhook
    (https://github.com/kubernetes-sigs/windows-gmsa) inlines the contents of the
    GMSA credential spec named by the GMSACredentialSpecName field.
    """
    gmsa_credential_spec_name: Annotated[Optional[str], Field(alias="gmsaCredentialSpecName")] = (
        None
    )
    """
    GMSACredentialSpecName is the name of the GMSA credential spec to use.
    """
    host_process: Annotated[Optional[bool], Field(alias="hostProcess")] = None
    """
    HostProcess determines if a container should be run as a 'Host Process' container.
    All of a Pod's containers must have the same effective HostProcess value
    (it is not allowed to have a mix of HostProcess containers and non-HostProcess containers).
    In addition, if HostProcess is true then HostNetwork must also be set to true.
    """
    run_as_user_name: Annotated[Optional[str], Field(alias="runAsUserName")] = None
    """
    The UserName in Windows to run the entrypoint of the container process.
    Defaults to the user specified in image metadata if unspecified.
    May also be set in PodSecurityContext. If set in both SecurityContext and
    PodSecurityContext, the value specified in SecurityContext takes precedence.
    """


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

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

        def allow_privilege_escalation(self, value: Optional[bool], /) -> Self:
            """
            AllowPrivilegeEscalation controls whether a process can gain more
            privileges than its parent process. This bool directly controls if
            the no_new_privs flag will be set on the container process.
            AllowPrivilegeEscalation is true always when the container is:
            1) run as Privileged
            2) has CAP_SYS_ADMIN
            Note that this field cannot be set when spec.os.name is windows.
            """
            return self._set("allow_privilege_escalation", value)

        @overload
        def app_armor_profile(
            self, value_or_callback: Optional[AppArmorProfile], /
        ) -> "SecurityContext.Builder": ...

        @overload
        def app_armor_profile(
            self,
            value_or_callback: Callable[
                [AppArmorProfile.Builder], AppArmorProfile.Builder | AppArmorProfile
            ],
            /,
        ) -> "SecurityContext.Builder": ...

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

        def app_armor_profile(self, value_or_callback=None, /):
            """
            appArmorProfile is the AppArmor options to use by this container. If set, this profile
            overrides the pod's appArmorProfile.
            Note that this field cannot be set when spec.os.name is windows.
            """
            if self._in_context and value_or_callback is None:
                context = AppArmorProfile.BuilderContext()
                context._parent_builder = self
                context._field_name = "app_armor_profile"
                return context

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

        @overload
        def capabilities(
            self, value_or_callback: Optional[Capabilities], /
        ) -> "SecurityContext.Builder": ...

        @overload
        def capabilities(
            self,
            value_or_callback: Callable[
                [Capabilities.Builder], Capabilities.Builder | Capabilities
            ],
            /,
        ) -> "SecurityContext.Builder": ...

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

        def capabilities(self, value_or_callback=None, /):
            """
            The capabilities to add/drop when running containers.
            Defaults to the default set of capabilities granted by the container runtime.
            Note that this field cannot be set when spec.os.name is windows.
            """
            if self._in_context and value_or_callback is None:
                context = Capabilities.BuilderContext()
                context._parent_builder = self
                context._field_name = "capabilities"
                return context

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

        def privileged(self, value: Optional[bool], /) -> Self:
            """
            Run container in privileged mode.
            Processes in privileged containers are essentially equivalent to root on the host.
            Defaults to false.
            Note that this field cannot be set when spec.os.name is windows.
            """
            return self._set("privileged", value)

        def proc_mount(self, value: Optional[str], /) -> Self:
            """
            procMount denotes the type of proc mount to use for the containers.
            The default value is Default which uses the container runtime defaults for
            readonly paths and masked paths.
            This requires the ProcMountType feature flag to be enabled.
            Note that this field cannot be set when spec.os.name is windows.
            """
            return self._set("proc_mount", value)

        def read_only_root_filesystem(self, value: Optional[bool], /) -> Self:
            """
            Whether this container has a read-only root filesystem.
            Default is false.
            Note that this field cannot be set when spec.os.name is windows.
            """
            return self._set("read_only_root_filesystem", 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 PodSecurityContext.  If set in both SecurityContext and
            PodSecurityContext, the value specified in SecurityContext takes precedence.
            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 PodSecurityContext.  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 PodSecurityContext.  If set in both SecurityContext and
            PodSecurityContext, the value specified in SecurityContext takes precedence.
            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 the container.
            If unspecified, the container runtime will allocate a random SELinux context for each
            container.  May also be set in PodSecurityContext.  If set in both SecurityContext and
            PodSecurityContext, the value specified in SecurityContext takes precedence.
            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 this container. If seccomp options are
            provided at both the pod & container level, the container options
            override the pod options.
            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)

        @overload
        def windows_options(
            self, value_or_callback: Optional[WindowsOptions], /
        ) -> "SecurityContext.Builder": ...

        @overload
        def windows_options(
            self,
            value_or_callback: Callable[
                [WindowsOptions.Builder], WindowsOptions.Builder | WindowsOptions
            ],
            /,
        ) -> "SecurityContext.Builder": ...

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

        def windows_options(self, value_or_callback=None, /):
            """
            The Windows specific settings applied to all containers.
            If unspecified, the options from the PodSecurityContext will be used.
            If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence.
            Note that this field cannot be set when spec.os.name is linux.
            """
            if self._in_context and value_or_callback is None:
                context = WindowsOptions.BuilderContext()
                context._parent_builder = self
                context._field_name = "windows_options"
                return context

            value = value_or_callback
            if callable(value_or_callback):
                output = value_or_callback(WindowsOptions.builder())
                if isinstance(output, WindowsOptions.Builder):
                    value = output.build()
                else:
                    value = output
            return self._set("windows_options", 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

    allow_privilege_escalation: Annotated[
        Optional[bool], Field(alias="allowPrivilegeEscalation")
    ] = None
    """
    AllowPrivilegeEscalation controls whether a process can gain more
    privileges than its parent process. This bool directly controls if
    the no_new_privs flag will be set on the container process.
    AllowPrivilegeEscalation is true always when the container is:
    1) run as Privileged
    2) has CAP_SYS_ADMIN
    Note that this field cannot be set when spec.os.name is windows.
    """
    app_armor_profile: Annotated[Optional[AppArmorProfile], Field(alias="appArmorProfile")] = None
    """
    appArmorProfile is the AppArmor options to use by this container. If set, this profile
    overrides the pod's appArmorProfile.
    Note that this field cannot be set when spec.os.name is windows.
    """
    capabilities: Optional[Capabilities] = None
    """
    The capabilities to add/drop when running containers.
    Defaults to the default set of capabilities granted by the container runtime.
    Note that this field cannot be set when spec.os.name is windows.
    """
    privileged: Optional[bool] = None
    """
    Run container in privileged mode.
    Processes in privileged containers are essentially equivalent to root on the host.
    Defaults to false.
    Note that this field cannot be set when spec.os.name is windows.
    """
    proc_mount: Annotated[Optional[str], Field(alias="procMount")] = None
    """
    procMount denotes the type of proc mount to use for the containers.
    The default value is Default which uses the container runtime defaults for
    readonly paths and masked paths.
    This requires the ProcMountType feature flag to be enabled.
    Note that this field cannot be set when spec.os.name is windows.
    """
    read_only_root_filesystem: Annotated[Optional[bool], Field(alias="readOnlyRootFilesystem")] = (
        None
    )
    """
    Whether this container has a read-only root filesystem.
    Default is false.
    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 PodSecurityContext.  If set in both SecurityContext and
    PodSecurityContext, the value specified in SecurityContext takes precedence.
    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 PodSecurityContext.  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 PodSecurityContext.  If set in both SecurityContext and
    PodSecurityContext, the value specified in SecurityContext takes precedence.
    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 the container.
    If unspecified, the container runtime will allocate a random SELinux context for each
    container.  May also be set in PodSecurityContext.  If set in both SecurityContext and
    PodSecurityContext, the value specified in SecurityContext takes precedence.
    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 this container. If seccomp options are
    provided at both the pod & container level, the container options
    override the pod options.
    Note that this field cannot be set when spec.os.name is windows.
    """
    windows_options: Annotated[Optional[WindowsOptions], Field(alias="windowsOptions")] = None
    """
    The Windows specific settings applied to all containers.
    If unspecified, the options from the PodSecurityContext will be used.
    If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence.
    Note that this field cannot be set when spec.os.name is linux.
    """


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

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

        @overload
        def exec(self, value_or_callback: Optional[Exec], /) -> "StartupProbe.Builder": ...

        @overload
        def exec(
            self, value_or_callback: Callable[[Exec.Builder], Exec.Builder | Exec], /
        ) -> "StartupProbe.Builder": ...

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

        def exec(self, value_or_callback=None, /):
            """
            Exec specifies the action to take.
            """
            if self._in_context and value_or_callback is None:
                context = Exec.BuilderContext()
                context._parent_builder = self
                context._field_name = "exec"
                return context

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

        def failure_threshold(self, value: Optional[int], /) -> Self:
            """
            Minimum consecutive failures for the probe to be considered failed after having succeeded.
            Defaults to 3. Minimum value is 1.
            """
            return self._set("failure_threshold", value)

        @overload
        def grpc(self, value_or_callback: Optional[Grpc], /) -> "StartupProbe.Builder": ...

        @overload
        def grpc(
            self, value_or_callback: Callable[[Grpc.Builder], Grpc.Builder | Grpc], /
        ) -> "StartupProbe.Builder": ...

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

        def grpc(self, value_or_callback=None, /):
            """
            GRPC specifies an action involving a GRPC port.
            """
            if self._in_context and value_or_callback is None:
                context = Grpc.BuilderContext()
                context._parent_builder = self
                context._field_name = "grpc"
                return context

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

        @overload
        def http_get(self, value_or_callback: Optional[HttpGet], /) -> "StartupProbe.Builder": ...

        @overload
        def http_get(
            self,
            value_or_callback: Callable[[HttpGet.Builder], HttpGet.Builder | HttpGet],
            /,
        ) -> "StartupProbe.Builder": ...

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

        def http_get(self, value_or_callback=None, /):
            """
            HTTPGet specifies the http request to perform.
            """
            if self._in_context and value_or_callback is None:
                context = HttpGet.BuilderContext()
                context._parent_builder = self
                context._field_name = "http_get"
                return context

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

        def initial_delay_seconds(self, value: Optional[int], /) -> Self:
            """
            Number of seconds after the container has started before liveness probes are initiated.
            More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes
            """
            return self._set("initial_delay_seconds", value)

        def period_seconds(self, value: Optional[int], /) -> Self:
            """
            How often (in seconds) to perform the probe.
            Default to 10 seconds. Minimum value is 1.
            """
            return self._set("period_seconds", value)

        def success_threshold(self, value: Optional[int], /) -> Self:
            """
            Minimum consecutive successes for the probe to be considered successful after having failed.
            Defaults to 1. Must be 1 for liveness and startup. Minimum value is 1.
            """
            return self._set("success_threshold", value)

        @overload
        def tcp_socket(
            self, value_or_callback: Optional[TcpSocket], /
        ) -> "StartupProbe.Builder": ...

        @overload
        def tcp_socket(
            self,
            value_or_callback: Callable[[TcpSocket.Builder], TcpSocket.Builder | TcpSocket],
            /,
        ) -> "StartupProbe.Builder": ...

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

        def tcp_socket(self, value_or_callback=None, /):
            """
            TCPSocket specifies an action involving a TCP port.
            """
            if self._in_context and value_or_callback is None:
                context = TcpSocket.BuilderContext()
                context._parent_builder = self
                context._field_name = "tcp_socket"
                return context

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

        def termination_grace_period_seconds(self, value: Optional[int], /) -> Self:
            """
            Optional duration in seconds the pod needs to terminate gracefully upon probe failure.
            The grace period is the duration in seconds after the processes running in the pod are sent
            a termination signal and the time when the processes are forcibly halted with a kill signal.
            Set this value longer than the expected cleanup time for your process.
            If this value is nil, the pod's terminationGracePeriodSeconds will be used. Otherwise, this
            value overrides the value provided by the pod spec.
            Value must be non-negative integer. The value zero indicates stop immediately via
            the kill signal (no opportunity to shut down).
            This is a beta field and requires enabling ProbeTerminationGracePeriod feature gate.
            Minimum value is 1. spec.terminationGracePeriodSeconds is used if unset.
            """
            return self._set("termination_grace_period_seconds", value)

        def timeout_seconds(self, value: Optional[int], /) -> Self:
            """
            Number of seconds after which the probe times out.
            Defaults to 1 second. Minimum value is 1.
            More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes
            """
            return self._set("timeout_seconds", value)

    class BuilderContext(BuilderContextBase["StartupProbe.Builder"]):
        def model_post_init(self, __context) -> None:
            self._builder = StartupProbe.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 StartupProbe."""
        return cls.BuilderContext()

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

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

    exec: Optional[Exec] = None
    """
    Exec specifies the action to take.
    """
    failure_threshold: Annotated[Optional[int], Field(alias="failureThreshold")] = None
    """
    Minimum consecutive failures for the probe to be considered failed after having succeeded.
    Defaults to 3. Minimum value is 1.
    """
    grpc: Optional[Grpc] = None
    """
    GRPC specifies an action involving a GRPC port.
    """
    http_get: Annotated[Optional[HttpGet], Field(alias="httpGet")] = None
    """
    HTTPGet specifies the http request to perform.
    """
    initial_delay_seconds: Annotated[Optional[int], Field(alias="initialDelaySeconds")] = None
    """
    Number of seconds after the container has started before liveness probes are initiated.
    More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes
    """
    period_seconds: Annotated[Optional[int], Field(alias="periodSeconds")] = None
    """
    How often (in seconds) to perform the probe.
    Default to 10 seconds. Minimum value is 1.
    """
    success_threshold: Annotated[Optional[int], Field(alias="successThreshold")] = None
    """
    Minimum consecutive successes for the probe to be considered successful after having failed.
    Defaults to 1. Must be 1 for liveness and startup. Minimum value is 1.
    """
    tcp_socket: Annotated[Optional[TcpSocket], Field(alias="tcpSocket")] = None
    """
    TCPSocket specifies an action involving a TCP port.
    """
    termination_grace_period_seconds: Annotated[
        Optional[int], Field(alias="terminationGracePeriodSeconds")
    ] = None
    """
    Optional duration in seconds the pod needs to terminate gracefully upon probe failure.
    The grace period is the duration in seconds after the processes running in the pod are sent
    a termination signal and the time when the processes are forcibly halted with a kill signal.
    Set this value longer than the expected cleanup time for your process.
    If this value is nil, the pod's terminationGracePeriodSeconds will be used. Otherwise, this
    value overrides the value provided by the pod spec.
    Value must be non-negative integer. The value zero indicates stop immediately via
    the kill signal (no opportunity to shut down).
    This is a beta field and requires enabling ProbeTerminationGracePeriod feature gate.
    Minimum value is 1. spec.terminationGracePeriodSeconds is used if unset.
    """
    timeout_seconds: Annotated[Optional[int], Field(alias="timeoutSeconds")] = None
    """
    Number of seconds after which the probe times out.
    Defaults to 1 second. Minimum value is 1.
    More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes
    """


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

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

        def device_path(self, value: str, /) -> Self:
            """
            devicePath is the path inside of the container that the device will be mapped to.
            """
            return self._set("device_path", value)

        def name(self, value: str, /) -> Self:
            """
            name must match the name of a persistentVolumeClaim in the pod
            """
            return self._set("name", value)

    class BuilderContext(BuilderContextBase["VolumeDevice.Builder"]):
        def model_post_init(self, __context) -> None:
            self._builder = VolumeDevice.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 VolumeDevice."""
        return cls.BuilderContext()

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

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

    device_path: Annotated[str, Field(alias="devicePath")]
    """
    devicePath is the path inside of the container that the device will be mapped to.
    """
    name: str
    """
    name must match the name of a persistentVolumeClaim in the pod
    """


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

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

        def mount_path(self, value: str, /) -> Self:
            """
            Path within the container at which the volume should be mounted.  Must
            not contain ':'.
            """
            return self._set("mount_path", value)

        def mount_propagation(self, value: Optional[str], /) -> Self:
            """
            mountPropagation determines how mounts are propagated from the host
            to container and the other way around.
            When not set, MountPropagationNone is used.
            This field is beta in 1.10.
            When RecursiveReadOnly is set to IfPossible or to Enabled, MountPropagation must be None or unspecified
            (which defaults to None).
            """
            return self._set("mount_propagation", value)

        def name(self, value: str, /) -> Self:
            """
            This must match the Name of a Volume.
            """
            return self._set("name", value)

        def read_only(self, value: Optional[bool], /) -> Self:
            """
            Mounted read-only if true, read-write otherwise (false or unspecified).
            Defaults to false.
            """
            return self._set("read_only", value)

        def recursive_read_only(self, value: Optional[str], /) -> Self:
            """
            RecursiveReadOnly specifies whether read-only mounts should be handled
            recursively.

            If ReadOnly is false, this field has no meaning and must be unspecified.

            If ReadOnly is true, and this field is set to Disabled, the mount is not made
            recursively read-only.  If this field is set to IfPossible, the mount is made
            recursively read-only, if it is supported by the container runtime.  If this
            field is set to Enabled, the mount is made recursively read-only if it is
            supported by the container runtime, otherwise the pod will not be started and
            an error will be generated to indicate the reason.

            If this field is set to IfPossible or Enabled, MountPropagation must be set to
            None (or be unspecified, which defaults to None).

            If this field is not specified, it is treated as an equivalent of Disabled.
            """
            return self._set("recursive_read_only", value)

        def sub_path(self, value: Optional[str], /) -> Self:
            """
            Path within the volume from which the container's volume should be mounted.
            Defaults to "" (volume's root).
            """
            return self._set("sub_path", value)

        def sub_path_expr(self, value: Optional[str], /) -> Self:
            """
            Expanded path within the volume from which the container's volume should be mounted.
            Behaves similarly to SubPath but environment variable references $(VAR_NAME) are expanded using the container's environment.
            Defaults to "" (volume's root).
            SubPathExpr and SubPath are mutually exclusive.
            """
            return self._set("sub_path_expr", value)

    class BuilderContext(BuilderContextBase["VolumeMount.Builder"]):
        def model_post_init(self, __context) -> None:
            self._builder = VolumeMount.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 VolumeMount."""
        return cls.BuilderContext()

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

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

    mount_path: Annotated[str, Field(alias="mountPath")]
    """
    Path within the container at which the volume should be mounted.  Must
    not contain ':'.
    """
    mount_propagation: Annotated[Optional[str], Field(alias="mountPropagation")] = None
    """
    mountPropagation determines how mounts are propagated from the host
    to container and the other way around.
    When not set, MountPropagationNone is used.
    This field is beta in 1.10.
    When RecursiveReadOnly is set to IfPossible or to Enabled, MountPropagation must be None or unspecified
    (which defaults to None).
    """
    name: str
    """
    This must match the Name of a Volume.
    """
    read_only: Annotated[Optional[bool], Field(alias="readOnly")] = None
    """
    Mounted read-only if true, read-write otherwise (false or unspecified).
    Defaults to false.
    """
    recursive_read_only: Annotated[Optional[str], Field(alias="recursiveReadOnly")] = None
    """
    RecursiveReadOnly specifies whether read-only mounts should be handled
    recursively.

    If ReadOnly is false, this field has no meaning and must be unspecified.

    If ReadOnly is true, and this field is set to Disabled, the mount is not made
    recursively read-only.  If this field is set to IfPossible, the mount is made
    recursively read-only, if it is supported by the container runtime.  If this
    field is set to Enabled, the mount is made recursively read-only if it is
    supported by the container runtime, otherwise the pod will not be started and
    an error will be generated to indicate the reason.

    If this field is set to IfPossible or Enabled, MountPropagation must be set to
    None (or be unspecified, which defaults to None).

    If this field is not specified, it is treated as an equivalent of Disabled.
    """
    sub_path: Annotated[Optional[str], Field(alias="subPath")] = None
    """
    Path within the volume from which the container's volume should be mounted.
    Defaults to "" (volume's root).
    """
    sub_path_expr: Annotated[Optional[str], Field(alias="subPathExpr")] = None
    """
    Expanded path within the volume from which the container's volume should be mounted.
    Behaves similarly to SubPath but environment variable references $(VAR_NAME) are expanded using the container's environment.
    Defaults to "" (volume's root).
    SubPathExpr and SubPath are mutually exclusive.
    """


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

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

        def args(self, value: Optional[List[str]], /) -> Self:
            """
            Arguments to the entrypoint.
            The container image's CMD is used if this is not provided.
            Variable references $(VAR_NAME) are expanded using the container's environment. If a variable
            cannot be resolved, the reference in the input string will be unchanged. Double $$ are reduced
            to a single $, which allows for escaping the $(VAR_NAME) syntax: i.e. "$$(VAR_NAME)" will
            produce the string literal "$(VAR_NAME)". Escaped references will never be expanded, regardless
            of whether the variable exists or not. Cannot be updated.
            More info: https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell
            """
            return self._set("args", value)

        def command(self, value: Optional[List[str]], /) -> Self:
            """
            Entrypoint array. Not executed within a shell.
            The container image's ENTRYPOINT is used if this is not provided.
            Variable references $(VAR_NAME) are expanded using the container's environment. If a variable
            cannot be resolved, the reference in the input string will be unchanged. Double $$ are reduced
            to a single $, which allows for escaping the $(VAR_NAME) syntax: i.e. "$$(VAR_NAME)" will
            produce the string literal "$(VAR_NAME)". Escaped references will never be expanded, regardless
            of whether the variable exists or not. Cannot be updated.
            More info: https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell
            """
            return self._set("command", value)

        @overload
        def env(self, value_or_callback: List[EnvModel], /) -> "Container.Builder": ...

        @overload
        def env(
            self,
            value_or_callback: Callable[
                [GenericListBuilder[EnvModel, EnvModel.Builder]],
                GenericListBuilder[EnvModel, EnvModel.Builder] | List[EnvModel],
            ],
            /,
        ) -> "Container.Builder": ...

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

        def env(self, value_or_callback=None, /):
            """
            List of environment variables to set in the container.
            Cannot be updated.
            """
            if self._in_context and value_or_callback is None:
                context = ListBuilderContext[EnvModel.Builder]()
                context._parent_builder = self
                context._field_name = "env"
                return context

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

        @overload
        def env_from(self, value_or_callback: List[EnvFrom], /) -> "Container.Builder": ...

        @overload
        def env_from(
            self,
            value_or_callback: Callable[
                [GenericListBuilder[EnvFrom, EnvFrom.Builder]],
                GenericListBuilder[EnvFrom, EnvFrom.Builder] | List[EnvFrom],
            ],
            /,
        ) -> "Container.Builder": ...

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

        def env_from(self, value_or_callback=None, /):
            """
            List of sources to populate environment variables in the container.
            The keys defined within a source must be a C_IDENTIFIER. All invalid keys
            will be reported as an event when the container is starting. When a key exists in multiple
            sources, the value associated with the last source will take precedence.
            Values defined by an Env with a duplicate key will take precedence.
            Cannot be updated.
            """
            if self._in_context and value_or_callback is None:
                context = ListBuilderContext[EnvFrom.Builder]()
                context._parent_builder = self
                context._field_name = "env_from"
                return context

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

        def image(self, value: Optional[str], /) -> Self:
            """
            Container image name.
            More info: https://kubernetes.io/docs/concepts/containers/images
            This field is optional to allow higher level config management to default or override
            container images in workload controllers like Deployments and StatefulSets.
            """
            return self._set("image", value)

        def image_pull_policy(self, value: Optional[str], /) -> Self:
            """
            Image pull policy.
            One of Always, Never, IfNotPresent.
            Defaults to Always if :latest tag is specified, or IfNotPresent otherwise.
            Cannot be updated.
            More info: https://kubernetes.io/docs/concepts/containers/images#updating-images
            """
            return self._set("image_pull_policy", value)

        @overload
        def lifecycle(self, value_or_callback: Optional[Lifecycle], /) -> "Container.Builder": ...

        @overload
        def lifecycle(
            self,
            value_or_callback: Callable[[Lifecycle.Builder], Lifecycle.Builder | Lifecycle],
            /,
        ) -> "Container.Builder": ...

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

        def lifecycle(self, value_or_callback=None, /):
            """
            Actions that the management system should take in response to container lifecycle events.
            Cannot be updated.
            """
            if self._in_context and value_or_callback is None:
                context = Lifecycle.BuilderContext()
                context._parent_builder = self
                context._field_name = "lifecycle"
                return context

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

        @overload
        def liveness_probe(
            self, value_or_callback: Optional[LivenessProbe], /
        ) -> "Container.Builder": ...

        @overload
        def liveness_probe(
            self,
            value_or_callback: Callable[
                [LivenessProbe.Builder], LivenessProbe.Builder | LivenessProbe
            ],
            /,
        ) -> "Container.Builder": ...

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

        def liveness_probe(self, value_or_callback=None, /):
            """
            Periodic probe of container liveness.
            Container will be restarted if the probe fails.
            Cannot be updated.
            More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes
            """
            if self._in_context and value_or_callback is None:
                context = LivenessProbe.BuilderContext()
                context._parent_builder = self
                context._field_name = "liveness_probe"
                return context

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

        def name(self, value: str, /) -> Self:
            """
            Name of the container specified as a DNS_LABEL.
            Each container in a pod must have a unique name (DNS_LABEL).
            Cannot be updated.
            """
            return self._set("name", value)

        @overload
        def ports(self, value_or_callback: List[Port], /) -> "Container.Builder": ...

        @overload
        def ports(
            self,
            value_or_callback: Callable[
                [GenericListBuilder[Port, Port.Builder]],
                GenericListBuilder[Port, Port.Builder] | List[Port],
            ],
            /,
        ) -> "Container.Builder": ...

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

        def ports(self, value_or_callback=None, /):
            """
            List of ports to expose from the container. Not specifying a port here
            DOES NOT prevent that port from being exposed. Any port which is
            listening on the default "0.0.0.0" address inside a container will be
            accessible from the network.
            Modifying this array with strategic merge patch may corrupt the data.
            For more information See https://github.com/kubernetes/kubernetes/issues/108255.
            Cannot be updated.
            """
            if self._in_context and value_or_callback is None:
                context = ListBuilderContext[Port.Builder]()
                context._parent_builder = self
                context._field_name = "ports"
                return context

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

        @overload
        def readiness_probe(
            self, value_or_callback: Optional[ReadinessProbe], /
        ) -> "Container.Builder": ...

        @overload
        def readiness_probe(
            self,
            value_or_callback: Callable[
                [ReadinessProbe.Builder], ReadinessProbe.Builder | ReadinessProbe
            ],
            /,
        ) -> "Container.Builder": ...

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

        def readiness_probe(self, value_or_callback=None, /):
            """
            Periodic probe of container service readiness.
            Container will be removed from service endpoints if the probe fails.
            Cannot be updated.
            More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes
            """
            if self._in_context and value_or_callback is None:
                context = ReadinessProbe.BuilderContext()
                context._parent_builder = self
                context._field_name = "readiness_probe"
                return context

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

        @overload
        def resize_policy(
            self, value_or_callback: List[ResizePolicy], /
        ) -> "Container.Builder": ...

        @overload
        def resize_policy(
            self,
            value_or_callback: Callable[
                [GenericListBuilder[ResizePolicy, ResizePolicy.Builder]],
                GenericListBuilder[ResizePolicy, ResizePolicy.Builder] | List[ResizePolicy],
            ],
            /,
        ) -> "Container.Builder": ...

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

        def resize_policy(self, value_or_callback=None, /):
            """
            Resources resize policy for the container.
            """
            if self._in_context and value_or_callback is None:
                context = ListBuilderContext[ResizePolicy.Builder]()
                context._parent_builder = self
                context._field_name = "resize_policy"
                return context

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

        @overload
        def resources(self, value_or_callback: Optional[Resources], /) -> "Container.Builder": ...

        @overload
        def resources(
            self,
            value_or_callback: Callable[[Resources.Builder], Resources.Builder | Resources],
            /,
        ) -> "Container.Builder": ...

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

        def resources(self, value_or_callback=None, /):
            """
            Compute Resources required by this container.
            Cannot be updated.
            More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/
            """
            if self._in_context and value_or_callback is None:
                context = Resources.BuilderContext()
                context._parent_builder = self
                context._field_name = "resources"
                return context

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

        def restart_policy(self, value: Optional[str], /) -> Self:
            """
            RestartPolicy defines the restart behavior of individual containers in a pod.
            This field may only be set for init containers, and the only allowed value is "Always".
            For non-init containers or when this field is not specified,
            the restart behavior is defined by the Pod's restart policy and the container type.
            Setting the RestartPolicy as "Always" for the init container will have the following effect:
            this init container will be continually restarted on
            exit until all regular containers have terminated. Once all regular
            containers have completed, all init containers with restartPolicy "Always"
            will be shut down. This lifecycle differs from normal init containers and
            is often referred to as a "sidecar" container. Although this init
            container still starts in the init container sequence, it does not wait
            for the container to complete before proceeding to the next init
            container. Instead, the next init container starts immediately after this
            init container is started, or after any startupProbe has successfully
            completed.
            """
            return self._set("restart_policy", value)

        @overload
        def security_context(
            self, value_or_callback: Optional[SecurityContext], /
        ) -> "Container.Builder": ...

        @overload
        def security_context(
            self,
            value_or_callback: Callable[
                [SecurityContext.Builder], SecurityContext.Builder | SecurityContext
            ],
            /,
        ) -> "Container.Builder": ...

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

        def security_context(self, value_or_callback=None, /):
            """
            SecurityContext defines the security options the container should be run with.
            If set, the fields of SecurityContext override the equivalent fields of PodSecurityContext.
            More info: https://kubernetes.io/docs/tasks/configure-pod-container/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)

        @overload
        def startup_probe(
            self, value_or_callback: Optional[StartupProbe], /
        ) -> "Container.Builder": ...

        @overload
        def startup_probe(
            self,
            value_or_callback: Callable[
                [StartupProbe.Builder], StartupProbe.Builder | StartupProbe
            ],
            /,
        ) -> "Container.Builder": ...

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

        def startup_probe(self, value_or_callback=None, /):
            """
            StartupProbe indicates that the Pod has successfully initialized.
            If specified, no other probes are executed until this completes successfully.
            If this probe fails, the Pod will be restarted, just as if the livenessProbe failed.
            This can be used to provide different probe parameters at the beginning of a Pod's lifecycle,
            when it might take a long time to load data or warm a cache, than during steady-state operation.
            This cannot be updated.
            More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes
            """
            if self._in_context and value_or_callback is None:
                context = StartupProbe.BuilderContext()
                context._parent_builder = self
                context._field_name = "startup_probe"
                return context

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

        def stdin(self, value: Optional[bool], /) -> Self:
            """
            Whether this container should allocate a buffer for stdin in the container runtime. If this
            is not set, reads from stdin in the container will always result in EOF.
            Default is false.
            """
            return self._set("stdin", value)

        def stdin_once(self, value: Optional[bool], /) -> Self:
            """
            Whether the container runtime should close the stdin channel after it has been opened by
            a single attach. When stdin is true the stdin stream will remain open across multiple attach
            sessions. If stdinOnce is set to true, stdin is opened on container start, is empty until the
            first client attaches to stdin, and then remains open and accepts data until the client disconnects,
            at which time stdin is closed and remains closed until the container is restarted. If this
            flag is false, a container processes that reads from stdin will never receive an EOF.
            Default is false
            """
            return self._set("stdin_once", value)

        def termination_message_path(self, value: Optional[str], /) -> Self:
            """
            Optional: Path at which the file to which the container's termination message
            will be written is mounted into the container's filesystem.
            Message written is intended to be brief final status, such as an assertion failure message.
            Will be truncated by the node if greater than 4096 bytes. The total message length across
            all containers will be limited to 12kb.
            Defaults to /dev/termination-log.
            Cannot be updated.
            """
            return self._set("termination_message_path", value)

        def termination_message_policy(self, value: Optional[str], /) -> Self:
            """
            Indicate how the termination message should be populated. File will use the contents of
            terminationMessagePath to populate the container status message on both success and failure.
            FallbackToLogsOnError will use the last chunk of container log output if the termination
            message file is empty and the container exited with an error.
            The log output is limited to 2048 bytes or 80 lines, whichever is smaller.
            Defaults to File.
            Cannot be updated.
            """
            return self._set("termination_message_policy", value)

        def tty(self, value: Optional[bool], /) -> Self:
            """
            Whether this container should allocate a TTY for itself, also requires 'stdin' to be true.
            Default is false.
            """
            return self._set("tty", value)

        @overload
        def volume_devices(
            self, value_or_callback: List[VolumeDevice], /
        ) -> "Container.Builder": ...

        @overload
        def volume_devices(
            self,
            value_or_callback: Callable[
                [GenericListBuilder[VolumeDevice, VolumeDevice.Builder]],
                GenericListBuilder[VolumeDevice, VolumeDevice.Builder] | List[VolumeDevice],
            ],
            /,
        ) -> "Container.Builder": ...

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

        def volume_devices(self, value_or_callback=None, /):
            """
            volumeDevices is the list of block devices to be used by the container.
            """
            if self._in_context and value_or_callback is None:
                context = ListBuilderContext[VolumeDevice.Builder]()
                context._parent_builder = self
                context._field_name = "volume_devices"
                return context

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

        @overload
        def volume_mounts(self, value_or_callback: List[VolumeMount], /) -> "Container.Builder": ...

        @overload
        def volume_mounts(
            self,
            value_or_callback: Callable[
                [GenericListBuilder[VolumeMount, VolumeMount.Builder]],
                GenericListBuilder[VolumeMount, VolumeMount.Builder] | List[VolumeMount],
            ],
            /,
        ) -> "Container.Builder": ...

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

        def volume_mounts(self, value_or_callback=None, /):
            """
            Pod volumes to mount into the container's filesystem.
            Cannot be updated.
            """
            if self._in_context and value_or_callback is None:
                context = ListBuilderContext[VolumeMount.Builder]()
                context._parent_builder = self
                context._field_name = "volume_mounts"
                return context

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

        def working_dir(self, value: Optional[str], /) -> Self:
            """
            Container's working directory.
            If not specified, the container runtime's default will be used, which
            might be configured in the container image.
            Cannot be updated.
            """
            return self._set("working_dir", value)

    class BuilderContext(BuilderContextBase["Container.Builder"]):
        def model_post_init(self, __context) -> None:
            self._builder = Container.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 Container."""
        return cls.BuilderContext()

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

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

    args: Optional[List[str]] = None
    """
    Arguments to the entrypoint.
    The container image's CMD is used if this is not provided.
    Variable references $(VAR_NAME) are expanded using the container's environment. If a variable
    cannot be resolved, the reference in the input string will be unchanged. Double $$ are reduced
    to a single $, which allows for escaping the $(VAR_NAME) syntax: i.e. "$$(VAR_NAME)" will
    produce the string literal "$(VAR_NAME)". Escaped references will never be expanded, regardless
    of whether the variable exists or not. Cannot be updated.
    More info: https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell
    """
    command: Optional[List[str]] = None
    """
    Entrypoint array. Not executed within a shell.
    The container image's ENTRYPOINT is used if this is not provided.
    Variable references $(VAR_NAME) are expanded using the container's environment. If a variable
    cannot be resolved, the reference in the input string will be unchanged. Double $$ are reduced
    to a single $, which allows for escaping the $(VAR_NAME) syntax: i.e. "$$(VAR_NAME)" will
    produce the string literal "$(VAR_NAME)". Escaped references will never be expanded, regardless
    of whether the variable exists or not. Cannot be updated.
    More info: https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell
    """
    env: Optional[List[EnvModel]] = None
    """
    List of environment variables to set in the container.
    Cannot be updated.
    """
    env_from: Annotated[Optional[List[EnvFrom]], Field(alias="envFrom")] = None
    """
    List of sources to populate environment variables in the container.
    The keys defined within a source must be a C_IDENTIFIER. All invalid keys
    will be reported as an event when the container is starting. When a key exists in multiple
    sources, the value associated with the last source will take precedence.
    Values defined by an Env with a duplicate key will take precedence.
    Cannot be updated.
    """
    image: Optional[str] = None
    """
    Container image name.
    More info: https://kubernetes.io/docs/concepts/containers/images
    This field is optional to allow higher level config management to default or override
    container images in workload controllers like Deployments and StatefulSets.
    """
    image_pull_policy: Annotated[Optional[str], Field(alias="imagePullPolicy")] = None
    """
    Image pull policy.
    One of Always, Never, IfNotPresent.
    Defaults to Always if :latest tag is specified, or IfNotPresent otherwise.
    Cannot be updated.
    More info: https://kubernetes.io/docs/concepts/containers/images#updating-images
    """
    lifecycle: Optional[Lifecycle] = None
    """
    Actions that the management system should take in response to container lifecycle events.
    Cannot be updated.
    """
    liveness_probe: Annotated[Optional[LivenessProbe], Field(alias="livenessProbe")] = None
    """
    Periodic probe of container liveness.
    Container will be restarted if the probe fails.
    Cannot be updated.
    More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes
    """
    name: str
    """
    Name of the container specified as a DNS_LABEL.
    Each container in a pod must have a unique name (DNS_LABEL).
    Cannot be updated.
    """
    ports: Optional[List[Port]] = None
    """
    List of ports to expose from the container. Not specifying a port here
    DOES NOT prevent that port from being exposed. Any port which is
    listening on the default "0.0.0.0" address inside a container will be
    accessible from the network.
    Modifying this array with strategic merge patch may corrupt the data.
    For more information See https://github.com/kubernetes/kubernetes/issues/108255.
    Cannot be updated.
    """
    readiness_probe: Annotated[Optional[ReadinessProbe], Field(alias="readinessProbe")] = None
    """
    Periodic probe of container service readiness.
    Container will be removed from service endpoints if the probe fails.
    Cannot be updated.
    More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes
    """
    resize_policy: Annotated[Optional[List[ResizePolicy]], Field(alias="resizePolicy")] = None
    """
    Resources resize policy for the container.
    """
    resources: Optional[Resources] = None
    """
    Compute Resources required by this container.
    Cannot be updated.
    More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/
    """
    restart_policy: Annotated[Optional[str], Field(alias="restartPolicy")] = None
    """
    RestartPolicy defines the restart behavior of individual containers in a pod.
    This field may only be set for init containers, and the only allowed value is "Always".
    For non-init containers or when this field is not specified,
    the restart behavior is defined by the Pod's restart policy and the container type.
    Setting the RestartPolicy as "Always" for the init container will have the following effect:
    this init container will be continually restarted on
    exit until all regular containers have terminated. Once all regular
    containers have completed, all init containers with restartPolicy "Always"
    will be shut down. This lifecycle differs from normal init containers and
    is often referred to as a "sidecar" container. Although this init
    container still starts in the init container sequence, it does not wait
    for the container to complete before proceeding to the next init
    container. Instead, the next init container starts immediately after this
    init container is started, or after any startupProbe has successfully
    completed.
    """
    security_context: Annotated[Optional[SecurityContext], Field(alias="securityContext")] = None
    """
    SecurityContext defines the security options the container should be run with.
    If set, the fields of SecurityContext override the equivalent fields of PodSecurityContext.
    More info: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/
    """
    startup_probe: Annotated[Optional[StartupProbe], Field(alias="startupProbe")] = None
    """
    StartupProbe indicates that the Pod has successfully initialized.
    If specified, no other probes are executed until this completes successfully.
    If this probe fails, the Pod will be restarted, just as if the livenessProbe failed.
    This can be used to provide different probe parameters at the beginning of a Pod's lifecycle,
    when it might take a long time to load data or warm a cache, than during steady-state operation.
    This cannot be updated.
    More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes
    """
    stdin: Optional[bool] = None
    """
    Whether this container should allocate a buffer for stdin in the container runtime. If this
    is not set, reads from stdin in the container will always result in EOF.
    Default is false.
    """
    stdin_once: Annotated[Optional[bool], Field(alias="stdinOnce")] = None
    """
    Whether the container runtime should close the stdin channel after it has been opened by
    a single attach. When stdin is true the stdin stream will remain open across multiple attach
    sessions. If stdinOnce is set to true, stdin is opened on container start, is empty until the
    first client attaches to stdin, and then remains open and accepts data until the client disconnects,
    at which time stdin is closed and remains closed until the container is restarted. If this
    flag is false, a container processes that reads from stdin will never receive an EOF.
    Default is false
    """
    termination_message_path: Annotated[Optional[str], Field(alias="terminationMessagePath")] = None
    """
    Optional: Path at which the file to which the container's termination message
    will be written is mounted into the container's filesystem.
    Message written is intended to be brief final status, such as an assertion failure message.
    Will be truncated by the node if greater than 4096 bytes. The total message length across
    all containers will be limited to 12kb.
    Defaults to /dev/termination-log.
    Cannot be updated.
    """
    termination_message_policy: Annotated[
        Optional[str], Field(alias="terminationMessagePolicy")
    ] = None
    """
    Indicate how the termination message should be populated. File will use the contents of
    terminationMessagePath to populate the container status message on both success and failure.
    FallbackToLogsOnError will use the last chunk of container log output if the termination
    message file is empty and the container exited with an error.
    The log output is limited to 2048 bytes or 80 lines, whichever is smaller.
    Defaults to File.
    Cannot be updated.
    """
    tty: Optional[bool] = None
    """
    Whether this container should allocate a TTY for itself, also requires 'stdin' to be true.
    Default is false.
    """
    volume_devices: Annotated[Optional[List[VolumeDevice]], Field(alias="volumeDevices")] = None
    """
    volumeDevices is the list of block devices to be used by the container.
    """
    volume_mounts: Annotated[Optional[List[VolumeMount]], Field(alias="volumeMounts")] = None
    """
    Pod volumes to mount into the container's filesystem.
    Cannot be updated.
    """
    working_dir: Annotated[Optional[str], Field(alias="workingDir")] = None
    """
    Container's working directory.
    If not specified, the container runtime's default will be used, which
    might be configured in the container image.
    Cannot be updated.
    """


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

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

        def name(self, value: Optional[str], /) -> Self:
            """
            Required.
            """
            return self._set("name", value)

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

    class BuilderContext(BuilderContextBase["Option.Builder"]):
        def model_post_init(self, __context) -> None:
            self._builder = Option.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 Option."""
        return cls.BuilderContext()

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

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

    name: Optional[str] = None
    """
    Required.
    """
    value: Optional[str] = None


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

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

        def nameservers(self, value: Optional[List[str]], /) -> Self:
            """
            A list of DNS name server IP addresses.
            This will be appended to the base nameservers generated from DNSPolicy.
            Duplicated nameservers will be removed.
            """
            return self._set("nameservers", value)

        @overload
        def options(self, value_or_callback: List[Option], /) -> "DnsConfig.Builder": ...

        @overload
        def options(
            self,
            value_or_callback: Callable[
                [GenericListBuilder[Option, Option.Builder]],
                GenericListBuilder[Option, Option.Builder] | List[Option],
            ],
            /,
        ) -> "DnsConfig.Builder": ...

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

        def options(self, value_or_callback=None, /):
            """
            A list of DNS resolver options.
            This will be merged with the base options generated from DNSPolicy.
            Duplicated entries will be removed. Resolution options given in Options
            will override those that appear in the base DNSPolicy.
            """
            if self._in_context and value_or_callback is None:
                context = ListBuilderContext[Option.Builder]()
                context._parent_builder = self
                context._field_name = "options"
                return context

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

        def searches(self, value: Optional[List[str]], /) -> Self:
            """
            A list of DNS search domains for host-name lookup.
            This will be appended to the base search paths generated from DNSPolicy.
            Duplicated search paths will be removed.
            """
            return self._set("searches", value)

    class BuilderContext(BuilderContextBase["DnsConfig.Builder"]):
        def model_post_init(self, __context) -> None:
            self._builder = DnsConfig.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 DnsConfig."""
        return cls.BuilderContext()

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

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

    nameservers: Optional[List[str]] = None
    """
    A list of DNS name server IP addresses.
    This will be appended to the base nameservers generated from DNSPolicy.
    Duplicated nameservers will be removed.
    """
    options: Optional[List[Option]] = None
    """
    A list of DNS resolver options.
    This will be merged with the base options generated from DNSPolicy.
    Duplicated entries will be removed. Resolution options given in Options
    will override those that appear in the base DNSPolicy.
    """
    searches: Optional[List[str]] = None
    """
    A list of DNS search domains for host-name lookup.
    This will be appended to the base search paths generated from DNSPolicy.
    Duplicated search paths will be removed.
    """


class DivisorModel1(RootModel[int]):
    class Builder(BaseBuilder):
        _value: int | None = None

        def root(self, value: int, /) -> Self:
            """
            Specifies the output format of the exposed resources, defaults to "1"
            """
            self._value = value
            return self

        def __call__(self, value: int, /) -> Self:
            """
            Specifies the output format of the exposed resources, defaults to "1"
            """
            self._value = value
            return self

        def build(self) -> "DivisorModel1":
            value = cast(int, self._value)
            return DivisorModel1(value)

    root: Annotated[
        int,
        Field(
            pattern="^(\\+|-)?(([0-9]+(\\.[0-9]*)?)|(\\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\\+|-)?(([0-9]+(\\.[0-9]*)?)|(\\.[0-9]+))))?$"
        ),
    ]
    """
    Specifies the output format of the exposed resources, defaults to "1"
    """

    class BuilderContext(BuilderContextBase["DivisorModel1.Builder"]):
        def model_post_init(self, __context) -> None:
            self._builder = DivisorModel1.Builder()
            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 DivisorModel1."""
        return cls.BuilderContext()


class DivisorModel2(RootModel[str]):
    class Builder(BaseBuilder):
        _value: str | None = None

        def root(self, value: str, /) -> Self:
            """
            Specifies the output format of the exposed resources, defaults to "1"
            """
            self._value = value
            return self

        def __call__(self, value: str, /) -> Self:
            """
            Specifies the output format of the exposed resources, defaults to "1"
            """
            self._value = value
            return self

        def build(self) -> "DivisorModel2":
            value = cast(str, self._value)
            return DivisorModel2(value)

    root: Annotated[
        str,
        Field(
            pattern="^(\\+|-)?(([0-9]+(\\.[0-9]*)?)|(\\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\\+|-)?(([0-9]+(\\.[0-9]*)?)|(\\.[0-9]+))))?$"
        ),
    ]
    """
    Specifies the output format of the exposed resources, defaults to "1"
    """

    class BuilderContext(BuilderContextBase["DivisorModel2.Builder"]):
        def model_post_init(self, __context) -> None:
            self._builder = DivisorModel2.Builder()
            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 DivisorModel2."""
        return cls.BuilderContext()


class LimitsModel1(RootModel[int]):
    class Builder(BaseBuilder):
        _value: int | None = None

        def root(self, value: int, /) -> Self:
            self._value = value
            return self

        def __call__(self, value: int, /) -> Self:
            self._value = value
            return self

        def build(self) -> "LimitsModel1":
            value = cast(int, self._value)
            return LimitsModel1(value)

    root: Annotated[
        int,
        Field(
            pattern="^(\\+|-)?(([0-9]+(\\.[0-9]*)?)|(\\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\\+|-)?(([0-9]+(\\.[0-9]*)?)|(\\.[0-9]+))))?$"
        ),
    ]

    class BuilderContext(BuilderContextBase["LimitsModel1.Builder"]):
        def model_post_init(self, __context) -> None:
            self._builder = LimitsModel1.Builder()
            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 LimitsModel1."""
        return cls.BuilderContext()


class LimitsModel2(RootModel[str]):
    class Builder(BaseBuilder):
        _value: str | None = None

        def root(self, value: str, /) -> Self:
            self._value = value
            return self

        def __call__(self, value: str, /) -> Self:
            self._value = value
            return self

        def build(self) -> "LimitsModel2":
            value = cast(str, self._value)
            return LimitsModel2(value)

    root: Annotated[
        str,
        Field(
            pattern="^(\\+|-)?(([0-9]+(\\.[0-9]*)?)|(\\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\\+|-)?(([0-9]+(\\.[0-9]*)?)|(\\.[0-9]+))))?$"
        ),
    ]

    class BuilderContext(BuilderContextBase["LimitsModel2.Builder"]):
        def model_post_init(self, __context) -> None:
            self._builder = LimitsModel2.Builder()
            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 LimitsModel2."""
        return cls.BuilderContext()


class RequestsModel1(RootModel[int]):
    class Builder(BaseBuilder):
        _value: int | None = None

        def root(self, value: int, /) -> Self:
            self._value = value
            return self

        def __call__(self, value: int, /) -> Self:
            self._value = value
            return self

        def build(self) -> "RequestsModel1":
            value = cast(int, self._value)
            return RequestsModel1(value)

    root: Annotated[
        int,
        Field(
            pattern="^(\\+|-)?(([0-9]+(\\.[0-9]*)?)|(\\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\\+|-)?(([0-9]+(\\.[0-9]*)?)|(\\.[0-9]+))))?$"
        ),
    ]

    class BuilderContext(BuilderContextBase["RequestsModel1.Builder"]):
        def model_post_init(self, __context) -> None:
            self._builder = RequestsModel1.Builder()
            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 RequestsModel1."""
        return cls.BuilderContext()


class RequestsModel2(RootModel[str]):
    class Builder(BaseBuilder):
        _value: str | None = None

        def root(self, value: str, /) -> Self:
            self._value = value
            return self

        def __call__(self, value: str, /) -> Self:
            self._value = value
            return self

        def build(self) -> "RequestsModel2":
            value = cast(str, self._value)
            return RequestsModel2(value)

    root: Annotated[
        str,
        Field(
            pattern="^(\\+|-)?(([0-9]+(\\.[0-9]*)?)|(\\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\\+|-)?(([0-9]+(\\.[0-9]*)?)|(\\.[0-9]+))))?$"
        ),
    ]

    class BuilderContext(BuilderContextBase["RequestsModel2.Builder"]):
        def model_post_init(self, __context) -> None:
            self._builder = RequestsModel2.Builder()
            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 RequestsModel2."""
        return cls.BuilderContext()


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

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

        def args(self, value: Optional[List[str]], /) -> Self:
            """
            Arguments to the entrypoint.
            The image's CMD is used if this is not provided.
            Variable references $(VAR_NAME) are expanded using the container's environment. If a variable
            cannot be resolved, the reference in the input string will be unchanged. Double $$ are reduced
            to a single $, which allows for escaping the $(VAR_NAME) syntax: i.e. "$$(VAR_NAME)" will
            produce the string literal "$(VAR_NAME)". Escaped references will never be expanded, regardless
            of whether the variable exists or not. Cannot be updated.
            More info: https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell
            """
            return self._set("args", value)

        def command(self, value: Optional[List[str]], /) -> Self:
            """
            Entrypoint array. Not executed within a shell.
            The image's ENTRYPOINT is used if this is not provided.
            Variable references $(VAR_NAME) are expanded using the container's environment. If a variable
            cannot be resolved, the reference in the input string will be unchanged. Double $$ are reduced
            to a single $, which allows for escaping the $(VAR_NAME) syntax: i.e. "$$(VAR_NAME)" will
            produce the string literal "$(VAR_NAME)". Escaped references will never be expanded, regardless
            of whether the variable exists or not. Cannot be updated.
            More info: https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell
            """
            return self._set("command", value)

        @overload
        def env(self, value_or_callback: List[EnvModel], /) -> "EphemeralContainer.Builder": ...

        @overload
        def env(
            self,
            value_or_callback: Callable[
                [GenericListBuilder[EnvModel, EnvModel.Builder]],
                GenericListBuilder[EnvModel, EnvModel.Builder] | List[EnvModel],
            ],
            /,
        ) -> "EphemeralContainer.Builder": ...

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

        def env(self, value_or_callback=None, /):
            """
            List of environment variables to set in the container.
            Cannot be updated.
            """
            if self._in_context and value_or_callback is None:
                context = ListBuilderContext[EnvModel.Builder]()
                context._parent_builder = self
                context._field_name = "env"
                return context

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

        @overload
        def env_from(self, value_or_callback: List[EnvFrom], /) -> "EphemeralContainer.Builder": ...

        @overload
        def env_from(
            self,
            value_or_callback: Callable[
                [GenericListBuilder[EnvFrom, EnvFrom.Builder]],
                GenericListBuilder[EnvFrom, EnvFrom.Builder] | List[EnvFrom],
            ],
            /,
        ) -> "EphemeralContainer.Builder": ...

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

        def env_from(self, value_or_callback=None, /):
            """
            List of sources to populate environment variables in the container.
            The keys defined within a source must be a C_IDENTIFIER. All invalid keys
            will be reported as an event when the container is starting. When a key exists in multiple
            sources, the value associated with the last source will take precedence.
            Values defined by an Env with a duplicate key will take precedence.
            Cannot be updated.
            """
            if self._in_context and value_or_callback is None:
                context = ListBuilderContext[EnvFrom.Builder]()
                context._parent_builder = self
                context._field_name = "env_from"
                return context

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

        def image(self, value: Optional[str], /) -> Self:
            """
            Container image name.
            More info: https://kubernetes.io/docs/concepts/containers/images
            """
            return self._set("image", value)

        def image_pull_policy(self, value: Optional[str], /) -> Self:
            """
            Image pull policy.
            One of Always, Never, IfNotPresent.
            Defaults to Always if :latest tag is specified, or IfNotPresent otherwise.
            Cannot be updated.
            More info: https://kubernetes.io/docs/concepts/containers/images#updating-images
            """
            return self._set("image_pull_policy", value)

        @overload
        def lifecycle(
            self, value_or_callback: Optional[Lifecycle], /
        ) -> "EphemeralContainer.Builder": ...

        @overload
        def lifecycle(
            self,
            value_or_callback: Callable[[Lifecycle.Builder], Lifecycle.Builder | Lifecycle],
            /,
        ) -> "EphemeralContainer.Builder": ...

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

        def lifecycle(self, value_or_callback=None, /):
            """
            Lifecycle is not allowed for ephemeral containers.
            """
            if self._in_context and value_or_callback is None:
                context = Lifecycle.BuilderContext()
                context._parent_builder = self
                context._field_name = "lifecycle"
                return context

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

        @overload
        def liveness_probe(
            self, value_or_callback: Optional[LivenessProbe], /
        ) -> "EphemeralContainer.Builder": ...

        @overload
        def liveness_probe(
            self,
            value_or_callback: Callable[
                [LivenessProbe.Builder], LivenessProbe.Builder | LivenessProbe
            ],
            /,
        ) -> "EphemeralContainer.Builder": ...

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

        def liveness_probe(self, value_or_callback=None, /):
            """
            Probes are not allowed for ephemeral containers.
            """
            if self._in_context and value_or_callback is None:
                context = LivenessProbe.BuilderContext()
                context._parent_builder = self
                context._field_name = "liveness_probe"
                return context

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

        def name(self, value: str, /) -> Self:
            """
            Name of the ephemeral container specified as a DNS_LABEL.
            This name must be unique among all containers, init containers and ephemeral containers.
            """
            return self._set("name", value)

        @overload
        def ports(self, value_or_callback: List[Port], /) -> "EphemeralContainer.Builder": ...

        @overload
        def ports(
            self,
            value_or_callback: Callable[
                [GenericListBuilder[Port, Port.Builder]],
                GenericListBuilder[Port, Port.Builder] | List[Port],
            ],
            /,
        ) -> "EphemeralContainer.Builder": ...

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

        def ports(self, value_or_callback=None, /):
            """
            Ports are not allowed for ephemeral containers.
            """
            if self._in_context and value_or_callback is None:
                context = ListBuilderContext[Port.Builder]()
                context._parent_builder = self
                context._field_name = "ports"
                return context

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

        @overload
        def readiness_probe(
            self, value_or_callback: Optional[ReadinessProbe], /
        ) -> "EphemeralContainer.Builder": ...

        @overload
        def readiness_probe(
            self,
            value_or_callback: Callable[
                [ReadinessProbe.Builder], ReadinessProbe.Builder | ReadinessProbe
            ],
            /,
        ) -> "EphemeralContainer.Builder": ...

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

        def readiness_probe(self, value_or_callback=None, /):
            """
            Probes are not allowed for ephemeral containers.
            """
            if self._in_context and value_or_callback is None:
                context = ReadinessProbe.BuilderContext()
                context._parent_builder = self
                context._field_name = "readiness_probe"
                return context

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

        @overload
        def resize_policy(
            self, value_or_callback: List[ResizePolicy], /
        ) -> "EphemeralContainer.Builder": ...

        @overload
        def resize_policy(
            self,
            value_or_callback: Callable[
                [GenericListBuilder[ResizePolicy, ResizePolicy.Builder]],
                GenericListBuilder[ResizePolicy, ResizePolicy.Builder] | List[ResizePolicy],
            ],
            /,
        ) -> "EphemeralContainer.Builder": ...

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

        def resize_policy(self, value_or_callback=None, /):
            """
            Resources resize policy for the container.
            """
            if self._in_context and value_or_callback is None:
                context = ListBuilderContext[ResizePolicy.Builder]()
                context._parent_builder = self
                context._field_name = "resize_policy"
                return context

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

        @overload
        def resources(
            self, value_or_callback: Optional[Resources], /
        ) -> "EphemeralContainer.Builder": ...

        @overload
        def resources(
            self,
            value_or_callback: Callable[[Resources.Builder], Resources.Builder | Resources],
            /,
        ) -> "EphemeralContainer.Builder": ...

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

        def resources(self, value_or_callback=None, /):
            """
            Resources are not allowed for ephemeral containers. Ephemeral containers use spare resources
            already allocated to the pod.
            """
            if self._in_context and value_or_callback is None:
                context = Resources.BuilderContext()
                context._parent_builder = self
                context._field_name = "resources"
                return context

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

        def restart_policy(self, value: Optional[str], /) -> Self:
            """
            Restart policy for the container to manage the restart behavior of each
            container within a pod.
            This may only be set for init containers. You cannot set this field on
            ephemeral containers.
            """
            return self._set("restart_policy", value)

        @overload
        def security_context(
            self, value_or_callback: Optional[SecurityContext], /
        ) -> "EphemeralContainer.Builder": ...

        @overload
        def security_context(
            self,
            value_or_callback: Callable[
                [SecurityContext.Builder], SecurityContext.Builder | SecurityContext
            ],
            /,
        ) -> "EphemeralContainer.Builder": ...

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

        def security_context(self, value_or_callback=None, /):
            """
            Optional: SecurityContext defines the security options the ephemeral container should be run with.
            If set, the fields of SecurityContext override the equivalent fields of PodSecurityContext.
            """
            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)

        @overload
        def startup_probe(
            self, value_or_callback: Optional[StartupProbe], /
        ) -> "EphemeralContainer.Builder": ...

        @overload
        def startup_probe(
            self,
            value_or_callback: Callable[
                [StartupProbe.Builder], StartupProbe.Builder | StartupProbe
            ],
            /,
        ) -> "EphemeralContainer.Builder": ...

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

        def startup_probe(self, value_or_callback=None, /):
            """
            Probes are not allowed for ephemeral containers.
            """
            if self._in_context and value_or_callback is None:
                context = StartupProbe.BuilderContext()
                context._parent_builder = self
                context._field_name = "startup_probe"
                return context

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

        def stdin(self, value: Optional[bool], /) -> Self:
            """
            Whether this container should allocate a buffer for stdin in the container runtime. If this
            is not set, reads from stdin in the container will always result in EOF.
            Default is false.
            """
            return self._set("stdin", value)

        def stdin_once(self, value: Optional[bool], /) -> Self:
            """
            Whether the container runtime should close the stdin channel after it has been opened by
            a single attach. When stdin is true the stdin stream will remain open across multiple attach
            sessions. If stdinOnce is set to true, stdin is opened on container start, is empty until the
            first client attaches to stdin, and then remains open and accepts data until the client disconnects,
            at which time stdin is closed and remains closed until the container is restarted. If this
            flag is false, a container processes that reads from stdin will never receive an EOF.
            Default is false
            """
            return self._set("stdin_once", value)

        def target_container_name(self, value: Optional[str], /) -> Self:
            """
            If set, the name of the container from PodSpec that this ephemeral container targets.
            The ephemeral container will be run in the namespaces (IPC, PID, etc) of this container.
            If not set then the ephemeral container uses the namespaces configured in the Pod spec.

            The container runtime must implement support for this feature. If the runtime does not
            support namespace targeting then the result of setting this field is undefined.
            """
            return self._set("target_container_name", value)

        def termination_message_path(self, value: Optional[str], /) -> Self:
            """
            Optional: Path at which the file to which the container's termination message
            will be written is mounted into the container's filesystem.
            Message written is intended to be brief final status, such as an assertion failure message.
            Will be truncated by the node if greater than 4096 bytes. The total message length across
            all containers will be limited to 12kb.
            Defaults to /dev/termination-log.
            Cannot be updated.
            """
            return self._set("termination_message_path", value)

        def termination_message_policy(self, value: Optional[str], /) -> Self:
            """
            Indicate how the termination message should be populated. File will use the contents of
            terminationMessagePath to populate the container status message on both success and failure.
            FallbackToLogsOnError will use the last chunk of container log output if the termination
            message file is empty and the container exited with an error.
            The log output is limited to 2048 bytes or 80 lines, whichever is smaller.
            Defaults to File.
            Cannot be updated.
            """
            return self._set("termination_message_policy", value)

        def tty(self, value: Optional[bool], /) -> Self:
            """
            Whether this container should allocate a TTY for itself, also requires 'stdin' to be true.
            Default is false.
            """
            return self._set("tty", value)

        @overload
        def volume_devices(
            self, value_or_callback: List[VolumeDevice], /
        ) -> "EphemeralContainer.Builder": ...

        @overload
        def volume_devices(
            self,
            value_or_callback: Callable[
                [GenericListBuilder[VolumeDevice, VolumeDevice.Builder]],
                GenericListBuilder[VolumeDevice, VolumeDevice.Builder] | List[VolumeDevice],
            ],
            /,
        ) -> "EphemeralContainer.Builder": ...

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

        def volume_devices(self, value_or_callback=None, /):
            """
            volumeDevices is the list of block devices to be used by the container.
            """
            if self._in_context and value_or_callback is None:
                context = ListBuilderContext[VolumeDevice.Builder]()
                context._parent_builder = self
                context._field_name = "volume_devices"
                return context

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

        @overload
        def volume_mounts(
            self, value_or_callback: List[VolumeMount], /
        ) -> "EphemeralContainer.Builder": ...

        @overload
        def volume_mounts(
            self,
            value_or_callback: Callable[
                [GenericListBuilder[VolumeMount, VolumeMount.Builder]],
                GenericListBuilder[VolumeMount, VolumeMount.Builder] | List[VolumeMount],
            ],
            /,
        ) -> "EphemeralContainer.Builder": ...

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

        def volume_mounts(self, value_or_callback=None, /):
            """
            Pod volumes to mount into the container's filesystem. Subpath mounts are not allowed for ephemeral containers.
            Cannot be updated.
            """
            if self._in_context and value_or_callback is None:
                context = ListBuilderContext[VolumeMount.Builder]()
                context._parent_builder = self
                context._field_name = "volume_mounts"
                return context

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

        def working_dir(self, value: Optional[str], /) -> Self:
            """
            Container's working directory.
            If not specified, the container runtime's default will be used, which
            might be configured in the container image.
            Cannot be updated.
            """
            return self._set("working_dir", value)

    class BuilderContext(BuilderContextBase["EphemeralContainer.Builder"]):
        def model_post_init(self, __context) -> None:
            self._builder = EphemeralContainer.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 EphemeralContainer."""
        return cls.BuilderContext()

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

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

    args: Optional[List[str]] = None
    """
    Arguments to the entrypoint.
    The image's CMD is used if this is not provided.
    Variable references $(VAR_NAME) are expanded using the container's environment. If a variable
    cannot be resolved, the reference in the input string will be unchanged. Double $$ are reduced
    to a single $, which allows for escaping the $(VAR_NAME) syntax: i.e. "$$(VAR_NAME)" will
    produce the string literal "$(VAR_NAME)". Escaped references will never be expanded, regardless
    of whether the variable exists or not. Cannot be updated.
    More info: https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell
    """
    command: Optional[List[str]] = None
    """
    Entrypoint array. Not executed within a shell.
    The image's ENTRYPOINT is used if this is not provided.
    Variable references $(VAR_NAME) are expanded using the container's environment. If a variable
    cannot be resolved, the reference in the input string will be unchanged. Double $$ are reduced
    to a single $, which allows for escaping the $(VAR_NAME) syntax: i.e. "$$(VAR_NAME)" will
    produce the string literal "$(VAR_NAME)". Escaped references will never be expanded, regardless
    of whether the variable exists or not. Cannot be updated.
    More info: https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell
    """
    env: Optional[List[EnvModel]] = None
    """
    List of environment variables to set in the container.
    Cannot be updated.
    """
    env_from: Annotated[Optional[List[EnvFrom]], Field(alias="envFrom")] = None
    """
    List of sources to populate environment variables in the container.
    The keys defined within a source must be a C_IDENTIFIER. All invalid keys
    will be reported as an event when the container is starting. When a key exists in multiple
    sources, the value associated with the last source will take precedence.
    Values defined by an Env with a duplicate key will take precedence.
    Cannot be updated.
    """
    image: Optional[str] = None
    """
    Container image name.
    More info: https://kubernetes.io/docs/concepts/containers/images
    """
    image_pull_policy: Annotated[Optional[str], Field(alias="imagePullPolicy")] = None
    """
    Image pull policy.
    One of Always, Never, IfNotPresent.
    Defaults to Always if :latest tag is specified, or IfNotPresent otherwise.
    Cannot be updated.
    More info: https://kubernetes.io/docs/concepts/containers/images#updating-images
    """
    lifecycle: Optional[Lifecycle] = None
    """
    Lifecycle is not allowed for ephemeral containers.
    """
    liveness_probe: Annotated[Optional[LivenessProbe], Field(alias="livenessProbe")] = None
    """
    Probes are not allowed for ephemeral containers.
    """
    name: str
    """
    Name of the ephemeral container specified as a DNS_LABEL.
    This name must be unique among all containers, init containers and ephemeral containers.
    """
    ports: Optional[List[Port]] = None
    """
    Ports are not allowed for ephemeral containers.
    """
    readiness_probe: Annotated[Optional[ReadinessProbe], Field(alias="readinessProbe")] = None
    """
    Probes are not allowed for ephemeral containers.
    """
    resize_policy: Annotated[Optional[List[ResizePolicy]], Field(alias="resizePolicy")] = None
    """
    Resources resize policy for the container.
    """
    resources: Optional[Resources] = None
    """
    Resources are not allowed for ephemeral containers. Ephemeral containers use spare resources
    already allocated to the pod.
    """
    restart_policy: Annotated[Optional[str], Field(alias="restartPolicy")] = None
    """
    Restart policy for the container to manage the restart behavior of each
    container within a pod.
    This may only be set for init containers. You cannot set this field on
    ephemeral containers.
    """
    security_context: Annotated[Optional[SecurityContext], Field(alias="securityContext")] = None
    """
    Optional: SecurityContext defines the security options the ephemeral container should be run with.
    If set, the fields of SecurityContext override the equivalent fields of PodSecurityContext.
    """
    startup_probe: Annotated[Optional[StartupProbe], Field(alias="startupProbe")] = None
    """
    Probes are not allowed for ephemeral containers.
    """
    stdin: Optional[bool] = None
    """
    Whether this container should allocate a buffer for stdin in the container runtime. If this
    is not set, reads from stdin in the container will always result in EOF.
    Default is false.
    """
    stdin_once: Annotated[Optional[bool], Field(alias="stdinOnce")] = None
    """
    Whether the container runtime should close the stdin channel after it has been opened by
    a single attach. When stdin is true the stdin stream will remain open across multiple attach
    sessions. If stdinOnce is set to true, stdin is opened on container start, is empty until the
    first client attaches to stdin, and then remains open and accepts data until the client disconnects,
    at which time stdin is closed and remains closed until the container is restarted. If this
    flag is false, a container processes that reads from stdin will never receive an EOF.
    Default is false
    """
    target_container_name: Annotated[Optional[str], Field(alias="targetContainerName")] = None
    """
    If set, the name of the container from PodSpec that this ephemeral container targets.
    The ephemeral container will be run in the namespaces (IPC, PID, etc) of this container.
    If not set then the ephemeral container uses the namespaces configured in the Pod spec.

    The container runtime must implement support for this feature. If the runtime does not
    support namespace targeting then the result of setting this field is undefined.
    """
    termination_message_path: Annotated[Optional[str], Field(alias="terminationMessagePath")] = None
    """
    Optional: Path at which the file to which the container's termination message
    will be written is mounted into the container's filesystem.
    Message written is intended to be brief final status, such as an assertion failure message.
    Will be truncated by the node if greater than 4096 bytes. The total message length across
    all containers will be limited to 12kb.
    Defaults to /dev/termination-log.
    Cannot be updated.
    """
    termination_message_policy: Annotated[
        Optional[str], Field(alias="terminationMessagePolicy")
    ] = None
    """
    Indicate how the termination message should be populated. File will use the contents of
    terminationMessagePath to populate the container status message on both success and failure.
    FallbackToLogsOnError will use the last chunk of container log output if the termination
    message file is empty and the container exited with an error.
    The log output is limited to 2048 bytes or 80 lines, whichever is smaller.
    Defaults to File.
    Cannot be updated.
    """
    tty: Optional[bool] = None
    """
    Whether this container should allocate a TTY for itself, also requires 'stdin' to be true.
    Default is false.
    """
    volume_devices: Annotated[Optional[List[VolumeDevice]], Field(alias="volumeDevices")] = None
    """
    volumeDevices is the list of block devices to be used by the container.
    """
    volume_mounts: Annotated[Optional[List[VolumeMount]], Field(alias="volumeMounts")] = None
    """
    Pod volumes to mount into the container's filesystem. Subpath mounts are not allowed for ephemeral containers.
    Cannot be updated.
    """
    working_dir: Annotated[Optional[str], Field(alias="workingDir")] = None
    """
    Container's working directory.
    If not specified, the container runtime's default will be used, which
    might be configured in the container image.
    Cannot be updated.
    """


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

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

        def hostnames(self, value: Optional[List[str]], /) -> Self:
            """
            Hostnames for the above IP address.
            """
            return self._set("hostnames", value)

        def ip(self, value: str, /) -> Self:
            """
            IP address of the host file entry.
            """
            return self._set("ip", value)

    class BuilderContext(BuilderContextBase["HostAliase.Builder"]):
        def model_post_init(self, __context) -> None:
            self._builder = HostAliase.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 HostAliase."""
        return cls.BuilderContext()

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

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

    hostnames: Optional[List[str]] = None
    """
    Hostnames for the above IP address.
    """
    ip: str
    """
    IP address of the host file entry.
    """


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 DivisorModel3(RootModel[int]):
    class Builder(BaseBuilder):
        _value: int | None = None

        def root(self, value: int, /) -> Self:
            """
            Specifies the output format of the exposed resources, defaults to "1"
            """
            self._value = value
            return self

        def __call__(self, value: int, /) -> Self:
            """
            Specifies the output format of the exposed resources, defaults to "1"
            """
            self._value = value
            return self

        def build(self) -> "DivisorModel3":
            value = cast(int, self._value)
            return DivisorModel3(value)

    root: Annotated[
        int,
        Field(
            pattern="^(\\+|-)?(([0-9]+(\\.[0-9]*)?)|(\\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\\+|-)?(([0-9]+(\\.[0-9]*)?)|(\\.[0-9]+))))?$"
        ),
    ]
    """
    Specifies the output format of the exposed resources, defaults to "1"
    """

    class BuilderContext(BuilderContextBase["DivisorModel3.Builder"]):
        def model_post_init(self, __context) -> None:
            self._builder = DivisorModel3.Builder()
            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 DivisorModel3."""
        return cls.BuilderContext()


class DivisorModel4(RootModel[str]):
    class Builder(BaseBuilder):
        _value: str | None = None

        def root(self, value: str, /) -> Self:
            """
            Specifies the output format of the exposed resources, defaults to "1"
            """
            self._value = value
            return self

        def __call__(self, value: str, /) -> Self:
            """
            Specifies the output format of the exposed resources, defaults to "1"
            """
            self._value = value
            return self

        def build(self) -> "DivisorModel4":
            value = cast(str, self._value)
            return DivisorModel4(value)

    root: Annotated[
        str,
        Field(
            pattern="^(\\+|-)?(([0-9]+(\\.[0-9]*)?)|(\\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\\+|-)?(([0-9]+(\\.[0-9]*)?)|(\\.[0-9]+))))?$"
        ),
    ]
    """
    Specifies the output format of the exposed resources, defaults to "1"
    """

    class BuilderContext(BuilderContextBase["DivisorModel4.Builder"]):
        def model_post_init(self, __context) -> None:
            self._builder = DivisorModel4.Builder()
            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 DivisorModel4."""
        return cls.BuilderContext()


class LimitsModel3(RootModel[int]):
    class Builder(BaseBuilder):
        _value: int | None = None

        def root(self, value: int, /) -> Self:
            self._value = value
            return self

        def __call__(self, value: int, /) -> Self:
            self._value = value
            return self

        def build(self) -> "LimitsModel3":
            value = cast(int, self._value)
            return LimitsModel3(value)

    root: Annotated[
        int,
        Field(
            pattern="^(\\+|-)?(([0-9]+(\\.[0-9]*)?)|(\\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\\+|-)?(([0-9]+(\\.[0-9]*)?)|(\\.[0-9]+))))?$"
        ),
    ]

    class BuilderContext(BuilderContextBase["LimitsModel3.Builder"]):
        def model_post_init(self, __context) -> None:
            self._builder = LimitsModel3.Builder()
            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 LimitsModel3."""
        return cls.BuilderContext()


class LimitsModel4(RootModel[str]):
    class Builder(BaseBuilder):
        _value: str | None = None

        def root(self, value: str, /) -> Self:
            self._value = value
            return self

        def __call__(self, value: str, /) -> Self:
            self._value = value
            return self

        def build(self) -> "LimitsModel4":
            value = cast(str, self._value)
            return LimitsModel4(value)

    root: Annotated[
        str,
        Field(
            pattern="^(\\+|-)?(([0-9]+(\\.[0-9]*)?)|(\\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\\+|-)?(([0-9]+(\\.[0-9]*)?)|(\\.[0-9]+))))?$"
        ),
    ]

    class BuilderContext(BuilderContextBase["LimitsModel4.Builder"]):
        def model_post_init(self, __context) -> None:
            self._builder = LimitsModel4.Builder()
            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 LimitsModel4."""
        return cls.BuilderContext()


class RequestsModel3(RootModel[int]):
    class Builder(BaseBuilder):
        _value: int | None = None

        def root(self, value: int, /) -> Self:
            self._value = value
            return self

        def __call__(self, value: int, /) -> Self:
            self._value = value
            return self

        def build(self) -> "RequestsModel3":
            value = cast(int, self._value)
            return RequestsModel3(value)

    root: Annotated[
        int,
        Field(
            pattern="^(\\+|-)?(([0-9]+(\\.[0-9]*)?)|(\\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\\+|-)?(([0-9]+(\\.[0-9]*)?)|(\\.[0-9]+))))?$"
        ),
    ]

    class BuilderContext(BuilderContextBase["RequestsModel3.Builder"]):
        def model_post_init(self, __context) -> None:
            self._builder = RequestsModel3.Builder()
            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 RequestsModel3."""
        return cls.BuilderContext()


class RequestsModel4(RootModel[str]):
    class Builder(BaseBuilder):
        _value: str | None = None

        def root(self, value: str, /) -> Self:
            self._value = value
            return self

        def __call__(self, value: str, /) -> Self:
            self._value = value
            return self

        def build(self) -> "RequestsModel4":
            value = cast(str, self._value)
            return RequestsModel4(value)

    root: Annotated[
        str,
        Field(
            pattern="^(\\+|-)?(([0-9]+(\\.[0-9]*)?)|(\\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\\+|-)?(([0-9]+(\\.[0-9]*)?)|(\\.[0-9]+))))?$"
        ),
    ]

    class BuilderContext(BuilderContextBase["RequestsModel4.Builder"]):
        def model_post_init(self, __context) -> None:
            self._builder = RequestsModel4.Builder()
            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 RequestsModel4."""
        return cls.BuilderContext()


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

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

        def args(self, value: Optional[List[str]], /) -> Self:
            """
            Arguments to the entrypoint.
            The container image's CMD is used if this is not provided.
            Variable references $(VAR_NAME) are expanded using the container's environment. If a variable
            cannot be resolved, the reference in the input string will be unchanged. Double $$ are reduced
            to a single $, which allows for escaping the $(VAR_NAME) syntax: i.e. "$$(VAR_NAME)" will
            produce the string literal "$(VAR_NAME)". Escaped references will never be expanded, regardless
            of whether the variable exists or not. Cannot be updated.
            More info: https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell
            """
            return self._set("args", value)

        def command(self, value: Optional[List[str]], /) -> Self:
            """
            Entrypoint array. Not executed within a shell.
            The container image's ENTRYPOINT is used if this is not provided.
            Variable references $(VAR_NAME) are expanded using the container's environment. If a variable
            cannot be resolved, the reference in the input string will be unchanged. Double $$ are reduced
            to a single $, which allows for escaping the $(VAR_NAME) syntax: i.e. "$$(VAR_NAME)" will
            produce the string literal "$(VAR_NAME)". Escaped references will never be expanded, regardless
            of whether the variable exists or not. Cannot be updated.
            More info: https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell
            """
            return self._set("command", value)

        @overload
        def env(self, value_or_callback: List[EnvModel], /) -> "InitContainer.Builder": ...

        @overload
        def env(
            self,
            value_or_callback: Callable[
                [GenericListBuilder[EnvModel, EnvModel.Builder]],
                GenericListBuilder[EnvModel, EnvModel.Builder] | List[EnvModel],
            ],
            /,
        ) -> "InitContainer.Builder": ...

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

        def env(self, value_or_callback=None, /):
            """
            List of environment variables to set in the container.
            Cannot be updated.
            """
            if self._in_context and value_or_callback is None:
                context = ListBuilderContext[EnvModel.Builder]()
                context._parent_builder = self
                context._field_name = "env"
                return context

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

        @overload
        def env_from(self, value_or_callback: List[EnvFrom], /) -> "InitContainer.Builder": ...

        @overload
        def env_from(
            self,
            value_or_callback: Callable[
                [GenericListBuilder[EnvFrom, EnvFrom.Builder]],
                GenericListBuilder[EnvFrom, EnvFrom.Builder] | List[EnvFrom],
            ],
            /,
        ) -> "InitContainer.Builder": ...

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

        def env_from(self, value_or_callback=None, /):
            """
            List of sources to populate environment variables in the container.
            The keys defined within a source must be a C_IDENTIFIER. All invalid keys
            will be reported as an event when the container is starting. When a key exists in multiple
            sources, the value associated with the last source will take precedence.
            Values defined by an Env with a duplicate key will take precedence.
            Cannot be updated.
            """
            if self._in_context and value_or_callback is None:
                context = ListBuilderContext[EnvFrom.Builder]()
                context._parent_builder = self
                context._field_name = "env_from"
                return context

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

        def image(self, value: Optional[str], /) -> Self:
            """
            Container image name.
            More info: https://kubernetes.io/docs/concepts/containers/images
            This field is optional to allow higher level config management to default or override
            container images in workload controllers like Deployments and StatefulSets.
            """
            return self._set("image", value)

        def image_pull_policy(self, value: Optional[str], /) -> Self:
            """
            Image pull policy.
            One of Always, Never, IfNotPresent.
            Defaults to Always if :latest tag is specified, or IfNotPresent otherwise.
            Cannot be updated.
            More info: https://kubernetes.io/docs/concepts/containers/images#updating-images
            """
            return self._set("image_pull_policy", value)

        @overload
        def lifecycle(
            self, value_or_callback: Optional[Lifecycle], /
        ) -> "InitContainer.Builder": ...

        @overload
        def lifecycle(
            self,
            value_or_callback: Callable[[Lifecycle.Builder], Lifecycle.Builder | Lifecycle],
            /,
        ) -> "InitContainer.Builder": ...

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

        def lifecycle(self, value_or_callback=None, /):
            """
            Actions that the management system should take in response to container lifecycle events.
            Cannot be updated.
            """
            if self._in_context and value_or_callback is None:
                context = Lifecycle.BuilderContext()
                context._parent_builder = self
                context._field_name = "lifecycle"
                return context

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

        @overload
        def liveness_probe(
            self, value_or_callback: Optional[LivenessProbe], /
        ) -> "InitContainer.Builder": ...

        @overload
        def liveness_probe(
            self,
            value_or_callback: Callable[
                [LivenessProbe.Builder], LivenessProbe.Builder | LivenessProbe
            ],
            /,
        ) -> "InitContainer.Builder": ...

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

        def liveness_probe(self, value_or_callback=None, /):
            """
            Periodic probe of container liveness.
            Container will be restarted if the probe fails.
            Cannot be updated.
            More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes
            """
            if self._in_context and value_or_callback is None:
                context = LivenessProbe.BuilderContext()
                context._parent_builder = self
                context._field_name = "liveness_probe"
                return context

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

        def name(self, value: str, /) -> Self:
            """
            Name of the container specified as a DNS_LABEL.
            Each container in a pod must have a unique name (DNS_LABEL).
            Cannot be updated.
            """
            return self._set("name", value)

        @overload
        def ports(self, value_or_callback: List[Port], /) -> "InitContainer.Builder": ...

        @overload
        def ports(
            self,
            value_or_callback: Callable[
                [GenericListBuilder[Port, Port.Builder]],
                GenericListBuilder[Port, Port.Builder] | List[Port],
            ],
            /,
        ) -> "InitContainer.Builder": ...

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

        def ports(self, value_or_callback=None, /):
            """
            List of ports to expose from the container. Not specifying a port here
            DOES NOT prevent that port from being exposed. Any port which is
            listening on the default "0.0.0.0" address inside a container will be
            accessible from the network.
            Modifying this array with strategic merge patch may corrupt the data.
            For more information See https://github.com/kubernetes/kubernetes/issues/108255.
            Cannot be updated.
            """
            if self._in_context and value_or_callback is None:
                context = ListBuilderContext[Port.Builder]()
                context._parent_builder = self
                context._field_name = "ports"
                return context

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

        @overload
        def readiness_probe(
            self, value_or_callback: Optional[ReadinessProbe], /
        ) -> "InitContainer.Builder": ...

        @overload
        def readiness_probe(
            self,
            value_or_callback: Callable[
                [ReadinessProbe.Builder], ReadinessProbe.Builder | ReadinessProbe
            ],
            /,
        ) -> "InitContainer.Builder": ...

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

        def readiness_probe(self, value_or_callback=None, /):
            """
            Periodic probe of container service readiness.
            Container will be removed from service endpoints if the probe fails.
            Cannot be updated.
            More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes
            """
            if self._in_context and value_or_callback is None:
                context = ReadinessProbe.BuilderContext()
                context._parent_builder = self
                context._field_name = "readiness_probe"
                return context

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

        @overload
        def resize_policy(
            self, value_or_callback: List[ResizePolicy], /
        ) -> "InitContainer.Builder": ...

        @overload
        def resize_policy(
            self,
            value_or_callback: Callable[
                [GenericListBuilder[ResizePolicy, ResizePolicy.Builder]],
                GenericListBuilder[ResizePolicy, ResizePolicy.Builder] | List[ResizePolicy],
            ],
            /,
        ) -> "InitContainer.Builder": ...

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

        def resize_policy(self, value_or_callback=None, /):
            """
            Resources resize policy for the container.
            """
            if self._in_context and value_or_callback is None:
                context = ListBuilderContext[ResizePolicy.Builder]()
                context._parent_builder = self
                context._field_name = "resize_policy"
                return context

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

        @overload
        def resources(
            self, value_or_callback: Optional[Resources], /
        ) -> "InitContainer.Builder": ...

        @overload
        def resources(
            self,
            value_or_callback: Callable[[Resources.Builder], Resources.Builder | Resources],
            /,
        ) -> "InitContainer.Builder": ...

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

        def resources(self, value_or_callback=None, /):
            """
            Compute Resources required by this container.
            Cannot be updated.
            More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/
            """
            if self._in_context and value_or_callback is None:
                context = Resources.BuilderContext()
                context._parent_builder = self
                context._field_name = "resources"
                return context

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

        def restart_policy(self, value: Optional[str], /) -> Self:
            """
            RestartPolicy defines the restart behavior of individual containers in a pod.
            This field may only be set for init containers, and the only allowed value is "Always".
            For non-init containers or when this field is not specified,
            the restart behavior is defined by the Pod's restart policy and the container type.
            Setting the RestartPolicy as "Always" for the init container will have the following effect:
            this init container will be continually restarted on
            exit until all regular containers have terminated. Once all regular
            containers have completed, all init containers with restartPolicy "Always"
            will be shut down. This lifecycle differs from normal init containers and
            is often referred to as a "sidecar" container. Although this init
            container still starts in the init container sequence, it does not wait
            for the container to complete before proceeding to the next init
            container. Instead, the next init container starts immediately after this
            init container is started, or after any startupProbe has successfully
            completed.
            """
            return self._set("restart_policy", value)

        @overload
        def security_context(
            self, value_or_callback: Optional[SecurityContext], /
        ) -> "InitContainer.Builder": ...

        @overload
        def security_context(
            self,
            value_or_callback: Callable[
                [SecurityContext.Builder], SecurityContext.Builder | SecurityContext
            ],
            /,
        ) -> "InitContainer.Builder": ...

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

        def security_context(self, value_or_callback=None, /):
            """
            SecurityContext defines the security options the container should be run with.
            If set, the fields of SecurityContext override the equivalent fields of PodSecurityContext.
            More info: https://kubernetes.io/docs/tasks/configure-pod-container/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)

        @overload
        def startup_probe(
            self, value_or_callback: Optional[StartupProbe], /
        ) -> "InitContainer.Builder": ...

        @overload
        def startup_probe(
            self,
            value_or_callback: Callable[
                [StartupProbe.Builder], StartupProbe.Builder | StartupProbe
            ],
            /,
        ) -> "InitContainer.Builder": ...

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

        def startup_probe(self, value_or_callback=None, /):
            """
            StartupProbe indicates that the Pod has successfully initialized.
            If specified, no other probes are executed until this completes successfully.
            If this probe fails, the Pod will be restarted, just as if the livenessProbe failed.
            This can be used to provide different probe parameters at the beginning of a Pod's lifecycle,
            when it might take a long time to load data or warm a cache, than during steady-state operation.
            This cannot be updated.
            More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes
            """
            if self._in_context and value_or_callback is None:
                context = StartupProbe.BuilderContext()
                context._parent_builder = self
                context._field_name = "startup_probe"
                return context

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

        def stdin(self, value: Optional[bool], /) -> Self:
            """
            Whether this container should allocate a buffer for stdin in the container runtime. If this
            is not set, reads from stdin in the container will always result in EOF.
            Default is false.
            """
            return self._set("stdin", value)

        def stdin_once(self, value: Optional[bool], /) -> Self:
            """
            Whether the container runtime should close the stdin channel after it has been opened by
            a single attach. When stdin is true the stdin stream will remain open across multiple attach
            sessions. If stdinOnce is set to true, stdin is opened on container start, is empty until the
            first client attaches to stdin, and then remains open and accepts data until the client disconnects,
            at which time stdin is closed and remains closed until the container is restarted. If this
            flag is false, a container processes that reads from stdin will never receive an EOF.
            Default is false
            """
            return self._set("stdin_once", value)

        def termination_message_path(self, value: Optional[str], /) -> Self:
            """
            Optional: Path at which the file to which the container's termination message
            will be written is mounted into the container's filesystem.
            Message written is intended to be brief final status, such as an assertion failure message.
            Will be truncated by the node if greater than 4096 bytes. The total message length across
            all containers will be limited to 12kb.
            Defaults to /dev/termination-log.
            Cannot be updated.
            """
            return self._set("termination_message_path", value)

        def termination_message_policy(self, value: Optional[str], /) -> Self:
            """
            Indicate how the termination message should be populated. File will use the contents of
            terminationMessagePath to populate the container status message on both success and failure.
            FallbackToLogsOnError will use the last chunk of container log output if the termination
            message file is empty and the container exited with an error.
            The log output is limited to 2048 bytes or 80 lines, whichever is smaller.
            Defaults to File.
            Cannot be updated.
            """
            return self._set("termination_message_policy", value)

        def tty(self, value: Optional[bool], /) -> Self:
            """
            Whether this container should allocate a TTY for itself, also requires 'stdin' to be true.
            Default is false.
            """
            return self._set("tty", value)

        @overload
        def volume_devices(
            self, value_or_callback: List[VolumeDevice], /
        ) -> "InitContainer.Builder": ...

        @overload
        def volume_devices(
            self,
            value_or_callback: Callable[
                [GenericListBuilder[VolumeDevice, VolumeDevice.Builder]],
                GenericListBuilder[VolumeDevice, VolumeDevice.Builder] | List[VolumeDevice],
            ],
            /,
        ) -> "InitContainer.Builder": ...

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

        def volume_devices(self, value_or_callback=None, /):
            """
            volumeDevices is the list of block devices to be used by the container.
            """
            if self._in_context and value_or_callback is None:
                context = ListBuilderContext[VolumeDevice.Builder]()
                context._parent_builder = self
                context._field_name = "volume_devices"
                return context

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

        @overload
        def volume_mounts(
            self, value_or_callback: List[VolumeMount], /
        ) -> "InitContainer.Builder": ...

        @overload
        def volume_mounts(
            self,
            value_or_callback: Callable[
                [GenericListBuilder[VolumeMount, VolumeMount.Builder]],
                GenericListBuilder[VolumeMount, VolumeMount.Builder] | List[VolumeMount],
            ],
            /,
        ) -> "InitContainer.Builder": ...

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

        def volume_mounts(self, value_or_callback=None, /):
            """
            Pod volumes to mount into the container's filesystem.
            Cannot be updated.
            """
            if self._in_context and value_or_callback is None:
                context = ListBuilderContext[VolumeMount.Builder]()
                context._parent_builder = self
                context._field_name = "volume_mounts"
                return context

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

        def working_dir(self, value: Optional[str], /) -> Self:
            """
            Container's working directory.
            If not specified, the container runtime's default will be used, which
            might be configured in the container image.
            Cannot be updated.
            """
            return self._set("working_dir", value)

    class BuilderContext(BuilderContextBase["InitContainer.Builder"]):
        def model_post_init(self, __context) -> None:
            self._builder = InitContainer.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 InitContainer."""
        return cls.BuilderContext()

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

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

    args: Optional[List[str]] = None
    """
    Arguments to the entrypoint.
    The container image's CMD is used if this is not provided.
    Variable references $(VAR_NAME) are expanded using the container's environment. If a variable
    cannot be resolved, the reference in the input string will be unchanged. Double $$ are reduced
    to a single $, which allows for escaping the $(VAR_NAME) syntax: i.e. "$$(VAR_NAME)" will
    produce the string literal "$(VAR_NAME)". Escaped references will never be expanded, regardless
    of whether the variable exists or not. Cannot be updated.
    More info: https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell
    """
    command: Optional[List[str]] = None
    """
    Entrypoint array. Not executed within a shell.
    The container image's ENTRYPOINT is used if this is not provided.
    Variable references $(VAR_NAME) are expanded using the container's environment. If a variable
    cannot be resolved, the reference in the input string will be unchanged. Double $$ are reduced
    to a single $, which allows for escaping the $(VAR_NAME) syntax: i.e. "$$(VAR_NAME)" will
    produce the string literal "$(VAR_NAME)". Escaped references will never be expanded, regardless
    of whether the variable exists or not. Cannot be updated.
    More info: https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell
    """
    env: Optional[List[EnvModel]] = None
    """
    List of environment variables to set in the container.
    Cannot be updated.
    """
    env_from: Annotated[Optional[List[EnvFrom]], Field(alias="envFrom")] = None
    """
    List of sources to populate environment variables in the container.
    The keys defined within a source must be a C_IDENTIFIER. All invalid keys
    will be reported as an event when the container is starting. When a key exists in multiple
    sources, the value associated with the last source will take precedence.
    Values defined by an Env with a duplicate key will take precedence.
    Cannot be updated.
    """
    image: Optional[str] = None
    """
    Container image name.
    More info: https://kubernetes.io/docs/concepts/containers/images
    This field is optional to allow higher level config management to default or override
    container images in workload controllers like Deployments and StatefulSets.
    """
    image_pull_policy: Annotated[Optional[str], Field(alias="imagePullPolicy")] = None
    """
    Image pull policy.
    One of Always, Never, IfNotPresent.
    Defaults to Always if :latest tag is specified, or IfNotPresent otherwise.
    Cannot be updated.
    More info: https://kubernetes.io/docs/concepts/containers/images#updating-images
    """
    lifecycle: Optional[Lifecycle] = None
    """
    Actions that the management system should take in response to container lifecycle events.
    Cannot be updated.
    """
    liveness_probe: Annotated[Optional[LivenessProbe], Field(alias="livenessProbe")] = None
    """
    Periodic probe of container liveness.
    Container will be restarted if the probe fails.
    Cannot be updated.
    More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes
    """
    name: str
    """
    Name of the container specified as a DNS_LABEL.
    Each container in a pod must have a unique name (DNS_LABEL).
    Cannot be updated.
    """
    ports: Optional[List[Port]] = None
    """
    List of ports to expose from the container. Not specifying a port here
    DOES NOT prevent that port from being exposed. Any port which is
    listening on the default "0.0.0.0" address inside a container will be
    accessible from the network.
    Modifying this array with strategic merge patch may corrupt the data.
    For more information See https://github.com/kubernetes/kubernetes/issues/108255.
    Cannot be updated.
    """
    readiness_probe: Annotated[Optional[ReadinessProbe], Field(alias="readinessProbe")] = None
    """
    Periodic probe of container service readiness.
    Container will be removed from service endpoints if the probe fails.
    Cannot be updated.
    More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes
    """
    resize_policy: Annotated[Optional[List[ResizePolicy]], Field(alias="resizePolicy")] = None
    """
    Resources resize policy for the container.
    """
    resources: Optional[Resources] = None
    """
    Compute Resources required by this container.
    Cannot be updated.
    More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/
    """
    restart_policy: Annotated[Optional[str], Field(alias="restartPolicy")] = None
    """
    RestartPolicy defines the restart behavior of individual containers in a pod.
    This field may only be set for init containers, and the only allowed value is "Always".
    For non-init containers or when this field is not specified,
    the restart behavior is defined by the Pod's restart policy and the container type.
    Setting the RestartPolicy as "Always" for the init container will have the following effect:
    this init container will be continually restarted on
    exit until all regular containers have terminated. Once all regular
    containers have completed, all init containers with restartPolicy "Always"
    will be shut down. This lifecycle differs from normal init containers and
    is often referred to as a "sidecar" container. Although this init
    container still starts in the init container sequence, it does not wait
    for the container to complete before proceeding to the next init
    container. Instead, the next init container starts immediately after this
    init container is started, or after any startupProbe has successfully
    completed.
    """
    security_context: Annotated[Optional[SecurityContext], Field(alias="securityContext")] = None
    """
    SecurityContext defines the security options the container should be run with.
    If set, the fields of SecurityContext override the equivalent fields of PodSecurityContext.
    More info: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/
    """
    startup_probe: Annotated[Optional[StartupProbe], Field(alias="startupProbe")] = None
    """
    StartupProbe indicates that the Pod has successfully initialized.
    If specified, no other probes are executed until this completes successfully.
    If this probe fails, the Pod will be restarted, just as if the livenessProbe failed.
    This can be used to provide different probe parameters at the beginning of a Pod's lifecycle,
    when it might take a long time to load data or warm a cache, than during steady-state operation.
    This cannot be updated.
    More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes
    """
    stdin: Optional[bool] = None
    """
    Whether this container should allocate a buffer for stdin in the container runtime. If this
    is not set, reads from stdin in the container will always result in EOF.
    Default is false.
    """
    stdin_once: Annotated[Optional[bool], Field(alias="stdinOnce")] = None
    """
    Whether the container runtime should close the stdin channel after it has been opened by
    a single attach. When stdin is true the stdin stream will remain open across multiple attach
    sessions. If stdinOnce is set to true, stdin is opened on container start, is empty until the
    first client attaches to stdin, and then remains open and accepts data until the client disconnects,
    at which time stdin is closed and remains closed until the container is restarted. If this
    flag is false, a container processes that reads from stdin will never receive an EOF.
    Default is false
    """
    termination_message_path: Annotated[Optional[str], Field(alias="terminationMessagePath")] = None
    """
    Optional: Path at which the file to which the container's termination message
    will be written is mounted into the container's filesystem.
    Message written is intended to be brief final status, such as an assertion failure message.
    Will be truncated by the node if greater than 4096 bytes. The total message length across
    all containers will be limited to 12kb.
    Defaults to /dev/termination-log.
    Cannot be updated.
    """
    termination_message_policy: Annotated[
        Optional[str], Field(alias="terminationMessagePolicy")
    ] = None
    """
    Indicate how the termination message should be populated. File will use the contents of
    terminationMessagePath to populate the container status message on both success and failure.
    FallbackToLogsOnError will use the last chunk of container log output if the termination
    message file is empty and the container exited with an error.
    The log output is limited to 2048 bytes or 80 lines, whichever is smaller.
    Defaults to File.
    Cannot be updated.
    """
    tty: Optional[bool] = None
    """
    Whether this container should allocate a TTY for itself, also requires 'stdin' to be true.
    Default is false.
    """
    volume_devices: Annotated[Optional[List[VolumeDevice]], Field(alias="volumeDevices")] = None
    """
    volumeDevices is the list of block devices to be used by the container.
    """
    volume_mounts: Annotated[Optional[List[VolumeMount]], Field(alias="volumeMounts")] = None
    """
    Pod volumes to mount into the container's filesystem.
    Cannot be updated.
    """
    working_dir: Annotated[Optional[str], Field(alias="workingDir")] = None
    """
    Container's working directory.
    If not specified, the container runtime's default will be used, which
    might be configured in the container image.
    Cannot be updated.
    """


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

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

        def name(self, value: str, /) -> Self:
            """
            Name is the name of the operating system. The currently supported values are linux and windows.
            Additional value may be defined in future and can be one of:
            https://github.com/opencontainers/runtime-spec/blob/master/config.md#platform-specific-configuration
            Clients should expect to handle additional values and treat unrecognized values in this field as os: null
            """
            return self._set("name", value)

    class BuilderContext(BuilderContextBase["Os.Builder"]):
        def model_post_init(self, __context) -> None:
            self._builder = Os.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 Os."""
        return cls.BuilderContext()

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

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

    name: str
    """
    Name is the name of the operating system. The currently supported values are linux and windows.
    Additional value may be defined in future and can be one of:
    https://github.com/opencontainers/runtime-spec/blob/master/config.md#platform-specific-configuration
    Clients should expect to handle additional values and treat unrecognized values in this field as os: null
    """


class Overhead(RootModel[int]):
    class Builder(BaseBuilder):
        _value: int | None = None

        def root(self, value: int, /) -> Self:
            self._value = value
            return self

        def __call__(self, value: int, /) -> Self:
            self._value = value
            return self

        def build(self) -> "Overhead":
            value = cast(int, self._value)
            return Overhead(value)

    root: Annotated[
        int,
        Field(
            pattern="^(\\+|-)?(([0-9]+(\\.[0-9]*)?)|(\\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\\+|-)?(([0-9]+(\\.[0-9]*)?)|(\\.[0-9]+))))?$"
        ),
    ]

    class BuilderContext(BuilderContextBase["Overhead.Builder"]):
        def model_post_init(self, __context) -> None:
            self._builder = Overhead.Builder()
            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 Overhead."""
        return cls.BuilderContext()


class OverheadModel(RootModel[str]):
    class Builder(BaseBuilder):
        _value: str | None = None

        def root(self, value: str, /) -> Self:
            self._value = value
            return self

        def __call__(self, value: str, /) -> Self:
            self._value = value
            return self

        def build(self) -> "OverheadModel":
            value = cast(str, self._value)
            return OverheadModel(value)

    root: Annotated[
        str,
        Field(
            pattern="^(\\+|-)?(([0-9]+(\\.[0-9]*)?)|(\\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\\+|-)?(([0-9]+(\\.[0-9]*)?)|(\\.[0-9]+))))?$"
        ),
    ]

    class BuilderContext(BuilderContextBase["OverheadModel.Builder"]):
        def model_post_init(self, __context) -> None:
            self._builder = OverheadModel.Builder()
            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 OverheadModel."""
        return cls.BuilderContext()


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

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

        def condition_type(self, value: str, /) -> Self:
            """
            ConditionType refers to a condition in the pod's condition list with matching type.
            """
            return self._set("condition_type", value)

    class BuilderContext(BuilderContextBase["ReadinessGate.Builder"]):
        def model_post_init(self, __context) -> None:
            self._builder = ReadinessGate.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 ReadinessGate."""
        return cls.BuilderContext()

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

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

    condition_type: Annotated[str, Field(alias="conditionType")]
    """
    ConditionType refers to a condition in the pod's condition list with matching type.
    """


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

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

        def name(self, value: str, /) -> Self:
            """
            Name uniquely identifies this resource claim inside the pod.
            This must be a DNS_LABEL.
            """
            return self._set("name", value)

        def resource_claim_name(self, value: Optional[str], /) -> Self:
            """
            ResourceClaimName is the name of a ResourceClaim object in the same
            namespace as this pod.

            Exactly one of ResourceClaimName and ResourceClaimTemplateName must
            be set.
            """
            return self._set("resource_claim_name", value)

        def resource_claim_template_name(self, value: Optional[str], /) -> Self:
            """
            ResourceClaimTemplateName is the name of a ResourceClaimTemplate
            object in the same namespace as this pod.

            The template will be used to create a new ResourceClaim, which will
            be bound to this pod. When this pod is deleted, the ResourceClaim
            will also be deleted. The pod name and resource name, along with a
            generated component, will be used to form a unique name for the
            ResourceClaim, which will be recorded in pod.status.resourceClaimStatuses.

            This field is immutable and no changes will be made to the
            corresponding ResourceClaim by the control plane after creating the
            ResourceClaim.

            Exactly one of ResourceClaimName and ResourceClaimTemplateName must
            be set.
            """
            return self._set("resource_claim_template_name", value)

    class BuilderContext(BuilderContextBase["ResourceClaim.Builder"]):
        def model_post_init(self, __context) -> None:
            self._builder = ResourceClaim.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 ResourceClaim."""
        return cls.BuilderContext()

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

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

    name: str
    """
    Name uniquely identifies this resource claim inside the pod.
    This must be a DNS_LABEL.
    """
    resource_claim_name: Annotated[Optional[str], Field(alias="resourceClaimName")] = None
    """
    ResourceClaimName is the name of a ResourceClaim object in the same
    namespace as this pod.

    Exactly one of ResourceClaimName and ResourceClaimTemplateName must
    be set.
    """
    resource_claim_template_name: Annotated[
        Optional[str], Field(alias="resourceClaimTemplateName")
    ] = None
    """
    ResourceClaimTemplateName is the name of a ResourceClaimTemplate
    object in the same namespace as this pod.

    The template will be used to create a new ResourceClaim, which will
    be bound to this pod. When this pod is deleted, the ResourceClaim
    will also be deleted. The pod name and resource name, along with a
    generated component, will be used to form a unique name for the
    ResourceClaim, which will be recorded in pod.status.resourceClaimStatuses.

    This field is immutable and no changes will be made to the
    corresponding ResourceClaim by the control plane after creating the
    ResourceClaim.

    Exactly one of ResourceClaimName and ResourceClaimTemplateName must
    be set.
    """


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

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

        def name(self, value: str, /) -> Self:
            """
            Name of the scheduling gate.
            Each scheduling gate must have a unique name field.
            """
            return self._set("name", value)

    class BuilderContext(BuilderContextBase["SchedulingGate.Builder"]):
        def model_post_init(self, __context) -> None:
            self._builder = SchedulingGate.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 SchedulingGate."""
        return cls.BuilderContext()

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

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

    name: str
    """
    Name of the scheduling gate.
    Each scheduling gate must have a unique name field.
    """


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 SecurityContextModel(BaseModel):
    class Builder(BaseModelBuilder):
        @property
        def cls(self) -> Type["SecurityContextModel"]:
            return SecurityContextModel

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

        @overload
        def app_armor_profile(
            self, value_or_callback: Optional[AppArmorProfile], /
        ) -> "SecurityContextModel.Builder": ...

        @overload
        def app_armor_profile(
            self,
            value_or_callback: Callable[
                [AppArmorProfile.Builder], AppArmorProfile.Builder | AppArmorProfile
            ],
            /,
        ) -> "SecurityContextModel.Builder": ...

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

        def app_armor_profile(self, value_or_callback=None, /):
            """
            appArmorProfile is the AppArmor 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 = AppArmorProfile.BuilderContext()
                context._parent_builder = self
                context._field_name = "app_armor_profile"
                return context

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

        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], /
        ) -> "SecurityContextModel.Builder": ...

        @overload
        def se_linux_options(
            self,
            value_or_callback: Callable[
                [SeLinuxOptions.Builder], SeLinuxOptions.Builder | SeLinuxOptions
            ],
            /,
        ) -> "SecurityContextModel.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], /
        ) -> "SecurityContextModel.Builder": ...

        @overload
        def seccomp_profile(
            self,
            value_or_callback: Callable[
                [SeccompProfile.Builder], SeccompProfile.Builder | SeccompProfile
            ],
            /,
        ) -> "SecurityContextModel.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 and fsGroup (if specified).  If
            the SupplementalGroupsPolicy feature is enabled, the
            supplementalGroupsPolicy field determines whether these are in addition
            to or instead of any group memberships defined in the container image.
            If unspecified, no additional groups are added, though group memberships
            defined in the container image may still be used, depending on the
            supplementalGroupsPolicy field.
            Note that this field cannot be set when spec.os.name is windows.
            """
            return self._set("supplemental_groups", value)

        def supplemental_groups_policy(self, value: Optional[str], /) -> Self:
            """
            Defines how supplemental groups of the first container processes are calculated.
            Valid values are "Merge" and "Strict". If not specified, "Merge" is used.
            (Alpha) Using the field requires the SupplementalGroupsPolicy feature gate to be enabled
            and the container runtime must implement support for this feature.
            Note that this field cannot be set when spec.os.name is windows.
            """
            return self._set("supplemental_groups_policy", value)

        @overload
        def sysctls(self, value_or_callback: List[Sysctl], /) -> "SecurityContextModel.Builder": ...

        @overload
        def sysctls(
            self,
            value_or_callback: Callable[
                [GenericListBuilder[Sysctl, Sysctl.Builder]],
                GenericListBuilder[Sysctl, Sysctl.Builder] | List[Sysctl],
            ],
            /,
        ) -> "SecurityContextModel.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)

        @overload
        def windows_options(
            self, value_or_callback: Optional[WindowsOptions], /
        ) -> "SecurityContextModel.Builder": ...

        @overload
        def windows_options(
            self,
            value_or_callback: Callable[
                [WindowsOptions.Builder], WindowsOptions.Builder | WindowsOptions
            ],
            /,
        ) -> "SecurityContextModel.Builder": ...

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

        def windows_options(self, value_or_callback=None, /):
            """
            The Windows specific settings applied to all containers.
            If unspecified, the options within a container's SecurityContext will be used.
            If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence.
            Note that this field cannot be set when spec.os.name is linux.
            """
            if self._in_context and value_or_callback is None:
                context = WindowsOptions.BuilderContext()
                context._parent_builder = self
                context._field_name = "windows_options"
                return context

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

    class BuilderContext(BuilderContextBase["SecurityContextModel.Builder"]):
        def model_post_init(self, __context) -> None:
            self._builder = SecurityContextModel.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 SecurityContextModel."""
        return cls.BuilderContext()

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

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

    app_armor_profile: Annotated[Optional[AppArmorProfile], Field(alias="appArmorProfile")] = None
    """
    appArmorProfile is the AppArmor options to use by the containers in this pod.
    Note that this field cannot be set when spec.os.name is windows.
    """
    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 and fsGroup (if specified).  If
    the SupplementalGroupsPolicy feature is enabled, the
    supplementalGroupsPolicy field determines whether these are in addition
    to or instead of any group memberships defined in the container image.
    If unspecified, no additional groups are added, though group memberships
    defined in the container image may still be used, depending on the
    supplementalGroupsPolicy field.
    Note that this field cannot be set when spec.os.name is windows.
    """
    supplemental_groups_policy: Annotated[
        Optional[str], Field(alias="supplementalGroupsPolicy")
    ] = None
    """
    Defines how supplemental groups of the first container processes are calculated.
    Valid values are "Merge" and "Strict". If not specified, "Merge" is used.
    (Alpha) Using the field requires the SupplementalGroupsPolicy feature gate to be enabled
    and the container runtime must implement support for this feature.
    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.
    """
    windows_options: Annotated[Optional[WindowsOptions], Field(alias="windowsOptions")] = None
    """
    The Windows specific settings applied to all containers.
    If unspecified, the options within a container's SecurityContext will be used.
    If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence.
    Note that this field cannot be set when spec.os.name is linux.
    """


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 TopologySpreadConstraint(BaseModel):
    class Builder(BaseModelBuilder):
        @property
        def cls(self) -> Type["TopologySpreadConstraint"]:
            return TopologySpreadConstraint

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

        @overload
        def label_selector(
            self, value_or_callback: Optional[LabelSelector], /
        ) -> "TopologySpreadConstraint.Builder": ...

        @overload
        def label_selector(
            self,
            value_or_callback: Callable[
                [LabelSelector.Builder], LabelSelector.Builder | LabelSelector
            ],
            /,
        ) -> "TopologySpreadConstraint.Builder": ...

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

        def label_selector(self, value_or_callback=None, /):
            """
            LabelSelector is used to find matching pods.
            Pods that match this label selector are counted to determine the number of pods
            in their corresponding topology domain.
            """
            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 the pods over which
            spreading will be calculated. The keys are used to lookup values from the
            incoming pod labels, those key-value labels are ANDed with labelSelector
            to select the group of existing pods over which spreading will be calculated
            for the incoming pod. The same key is forbidden to exist in both MatchLabelKeys and LabelSelector.
            MatchLabelKeys cannot be set when LabelSelector isn't set.
            Keys that don't exist in the incoming pod labels will
            be ignored. A null or empty list means only match against labelSelector.

            This is a beta field and requires the MatchLabelKeysInPodTopologySpread feature gate to be enabled (enabled by default).
            """
            return self._set("match_label_keys", value)

        def max_skew(self, value: int, /) -> Self:
            """
            MaxSkew describes the degree to which pods may be unevenly distributed.
            When `whenUnsatisfiable=DoNotSchedule`, it is the maximum permitted difference
            between the number of matching pods in the target topology and the global minimum.
            The global minimum is the minimum number of matching pods in an eligible domain
            or zero if the number of eligible domains is less than MinDomains.
            For example, in a 3-zone cluster, MaxSkew is set to 1, and pods with the same
            labelSelector spread as 2/2/1:
            In this case, the global minimum is 1.
            | zone1 | zone2 | zone3 |
            |  P P  |  P P  |   P   |
            - if MaxSkew is 1, incoming pod can only be scheduled to zone3 to become 2/2/2;
            scheduling it onto zone1(zone2) would make the ActualSkew(3-1) on zone1(zone2)
            violate MaxSkew(1).
            - if MaxSkew is 2, incoming pod can be scheduled onto any zone.
            When `whenUnsatisfiable=ScheduleAnyway`, it is used to give higher precedence
            to topologies that satisfy it.
            It's a required field. Default value is 1 and 0 is not allowed.
            """
            return self._set("max_skew", value)

        def min_domains(self, value: Optional[int], /) -> Self:
            """
            MinDomains indicates a minimum number of eligible domains.
            When the number of eligible domains with matching topology keys is less than minDomains,
            Pod Topology Spread treats "global minimum" as 0, and then the calculation of Skew is performed.
            And when the number of eligible domains with matching topology keys equals or greater than minDomains,
            this value has no effect on scheduling.
            As a result, when the number of eligible domains is less than minDomains,
            scheduler won't schedule more than maxSkew Pods to those domains.
            If value is nil, the constraint behaves as if MinDomains is equal to 1.
            Valid values are integers greater than 0.
            When value is not nil, WhenUnsatisfiable must be DoNotSchedule.

            For example, in a 3-zone cluster, MaxSkew is set to 2, MinDomains is set to 5 and pods with the same
            labelSelector spread as 2/2/2:
            | zone1 | zone2 | zone3 |
            |  P P  |  P P  |  P P  |
            The number of domains is less than 5(MinDomains), so "global minimum" is treated as 0.
            In this situation, new pod with the same labelSelector cannot be scheduled,
            because computed skew will be 3(3 - 0) if new Pod is scheduled to any of the three zones,
            it will violate MaxSkew.
            """
            return self._set("min_domains", value)

        def node_affinity_policy(self, value: Optional[str], /) -> Self:
            """
            NodeAffinityPolicy indicates how we will treat Pod's nodeAffinity/nodeSelector
            when calculating pod topology spread skew. Options are:
            - Honor: only nodes matching nodeAffinity/nodeSelector are included in the calculations.
            - Ignore: nodeAffinity/nodeSelector are ignored. All nodes are included in the calculations.

            If this value is nil, the behavior is equivalent to the Honor policy.
            This is a beta-level feature default enabled by the NodeInclusionPolicyInPodTopologySpread feature flag.
            """
            return self._set("node_affinity_policy", value)

        def node_taints_policy(self, value: Optional[str], /) -> Self:
            """
            NodeTaintsPolicy indicates how we will treat node taints when calculating
            pod topology spread skew. Options are:
            - Honor: nodes without taints, along with tainted nodes for which the incoming pod
            has a toleration, are included.
            - Ignore: node taints are ignored. All nodes are included.

            If this value is nil, the behavior is equivalent to the Ignore policy.
            This is a beta-level feature default enabled by the NodeInclusionPolicyInPodTopologySpread feature flag.
            """
            return self._set("node_taints_policy", value)

        def topology_key(self, value: str, /) -> Self:
            """
            TopologyKey is the key of node labels. Nodes that have a label with this key
            and identical values are considered to be in the same topology.
            We consider each <key, value> as a "bucket", and try to put balanced number
            of pods into each bucket.
            We define a domain as a particular instance of a topology.
            Also, we define an eligible domain as a domain whose nodes meet the requirements of
            nodeAffinityPolicy and nodeTaintsPolicy.
            e.g. If TopologyKey is "kubernetes.io/hostname", each Node is a domain of that topology.
            And, if TopologyKey is "topology.kubernetes.io/zone", each zone is a domain of that topology.
            It's a required field.
            """
            return self._set("topology_key", value)

        def when_unsatisfiable(self, value: str, /) -> Self:
            """
            WhenUnsatisfiable indicates how to deal with a pod if it doesn't satisfy
            the spread constraint.
            - DoNotSchedule (default) tells the scheduler not to schedule it.
            - ScheduleAnyway tells the scheduler to schedule the pod in any location,
              but giving higher precedence to topologies that would help reduce the
              skew.
            A constraint is considered "Unsatisfiable" for an incoming pod
            if and only if every possible node assignment for that pod would violate
            "MaxSkew" on some topology.
            For example, in a 3-zone cluster, MaxSkew is set to 1, and pods with the same
            labelSelector spread as 3/1/1:
            | zone1 | zone2 | zone3 |
            | P P P |   P   |   P   |
            If WhenUnsatisfiable is set to DoNotSchedule, incoming pod can only be scheduled
            to zone2(zone3) to become 3/2/1(3/1/2) as ActualSkew(2-1) on zone2(zone3) satisfies
            MaxSkew(1). In other words, the cluster can still be imbalanced, but scheduler
            won't make it *more* imbalanced.
            It's a required field.
            """
            return self._set("when_unsatisfiable", value)

    class BuilderContext(BuilderContextBase["TopologySpreadConstraint.Builder"]):
        def model_post_init(self, __context) -> None:
            self._builder = TopologySpreadConstraint.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 TopologySpreadConstraint."""
        return cls.BuilderContext()

    class ListBuilder(GenericListBuilder["TopologySpreadConstraint", Builder]):
        def __init__(self):
            raise NotImplementedError(
                "This class is not meant to be instantiated. Use TopologySpreadConstraint.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
    """
    LabelSelector is used to find matching pods.
    Pods that match this label selector are counted to determine the number of pods
    in their corresponding topology domain.
    """
    match_label_keys: Annotated[Optional[List[str]], Field(alias="matchLabelKeys")] = None
    """
    MatchLabelKeys is a set of pod label keys to select the pods over which
    spreading will be calculated. The keys are used to lookup values from the
    incoming pod labels, those key-value labels are ANDed with labelSelector
    to select the group of existing pods over which spreading will be calculated
    for the incoming pod. The same key is forbidden to exist in both MatchLabelKeys and LabelSelector.
    MatchLabelKeys cannot be set when LabelSelector isn't set.
    Keys that don't exist in the incoming pod labels will
    be ignored. A null or empty list means only match against labelSelector.

    This is a beta field and requires the MatchLabelKeysInPodTopologySpread feature gate to be enabled (enabled by default).
    """
    max_skew: Annotated[int, Field(alias="maxSkew")]
    """
    MaxSkew describes the degree to which pods may be unevenly distributed.
    When `whenUnsatisfiable=DoNotSchedule`, it is the maximum permitted difference
    between the number of matching pods in the target topology and the global minimum.
    The global minimum is the minimum number of matching pods in an eligible domain
    or zero if the number of eligible domains is less than MinDomains.
    For example, in a 3-zone cluster, MaxSkew is set to 1, and pods with the same
    labelSelector spread as 2/2/1:
    In this case, the global minimum is 1.
    | zone1 | zone2 | zone3 |
    |  P P  |  P P  |   P   |
    - if MaxSkew is 1, incoming pod can only be scheduled to zone3 to become 2/2/2;
    scheduling it onto zone1(zone2) would make the ActualSkew(3-1) on zone1(zone2)
    violate MaxSkew(1).
    - if MaxSkew is 2, incoming pod can be scheduled onto any zone.
    When `whenUnsatisfiable=ScheduleAnyway`, it is used to give higher precedence
    to topologies that satisfy it.
    It's a required field. Default value is 1 and 0 is not allowed.
    """
    min_domains: Annotated[Optional[int], Field(alias="minDomains")] = None
    """
    MinDomains indicates a minimum number of eligible domains.
    When the number of eligible domains with matching topology keys is less than minDomains,
    Pod Topology Spread treats "global minimum" as 0, and then the calculation of Skew is performed.
    And when the number of eligible domains with matching topology keys equals or greater than minDomains,
    this value has no effect on scheduling.
    As a result, when the number of eligible domains is less than minDomains,
    scheduler won't schedule more than maxSkew Pods to those domains.
    If value is nil, the constraint behaves as if MinDomains is equal to 1.
    Valid values are integers greater than 0.
    When value is not nil, WhenUnsatisfiable must be DoNotSchedule.

    For example, in a 3-zone cluster, MaxSkew is set to 2, MinDomains is set to 5 and pods with the same
    labelSelector spread as 2/2/2:
    | zone1 | zone2 | zone3 |
    |  P P  |  P P  |  P P  |
    The number of domains is less than 5(MinDomains), so "global minimum" is treated as 0.
    In this situation, new pod with the same labelSelector cannot be scheduled,
    because computed skew will be 3(3 - 0) if new Pod is scheduled to any of the three zones,
    it will violate MaxSkew.
    """
    node_affinity_policy: Annotated[Optional[str], Field(alias="nodeAffinityPolicy")] = None
    """
    NodeAffinityPolicy indicates how we will treat Pod's nodeAffinity/nodeSelector
    when calculating pod topology spread skew. Options are:
    - Honor: only nodes matching nodeAffinity/nodeSelector are included in the calculations.
    - Ignore: nodeAffinity/nodeSelector are ignored. All nodes are included in the calculations.

    If this value is nil, the behavior is equivalent to the Honor policy.
    This is a beta-level feature default enabled by the NodeInclusionPolicyInPodTopologySpread feature flag.
    """
    node_taints_policy: Annotated[Optional[str], Field(alias="nodeTaintsPolicy")] = None
    """
    NodeTaintsPolicy indicates how we will treat node taints when calculating
    pod topology spread skew. Options are:
    - Honor: nodes without taints, along with tainted nodes for which the incoming pod
    has a toleration, are included.
    - Ignore: node taints are ignored. All nodes are included.

    If this value is nil, the behavior is equivalent to the Ignore policy.
    This is a beta-level feature default enabled by the NodeInclusionPolicyInPodTopologySpread feature flag.
    """
    topology_key: Annotated[str, Field(alias="topologyKey")]
    """
    TopologyKey is the key of node labels. Nodes that have a label with this key
    and identical values are considered to be in the same topology.
    We consider each <key, value> as a "bucket", and try to put balanced number
    of pods into each bucket.
    We define a domain as a particular instance of a topology.
    Also, we define an eligible domain as a domain whose nodes meet the requirements of
    nodeAffinityPolicy and nodeTaintsPolicy.
    e.g. If TopologyKey is "kubernetes.io/hostname", each Node is a domain of that topology.
    And, if TopologyKey is "topology.kubernetes.io/zone", each zone is a domain of that topology.
    It's a required field.
    """
    when_unsatisfiable: Annotated[str, Field(alias="whenUnsatisfiable")]
    """
    WhenUnsatisfiable indicates how to deal with a pod if it doesn't satisfy
    the spread constraint.
    - DoNotSchedule (default) tells the scheduler not to schedule it.
    - ScheduleAnyway tells the scheduler to schedule the pod in any location,
      but giving higher precedence to topologies that would help reduce the
      skew.
    A constraint is considered "Unsatisfiable" for an incoming pod
    if and only if every possible node assignment for that pod would violate
    "MaxSkew" on some topology.
    For example, in a 3-zone cluster, MaxSkew is set to 1, and pods with the same
    labelSelector spread as 3/1/1:
    | zone1 | zone2 | zone3 |
    | P P P |   P   |   P   |
    If WhenUnsatisfiable is set to DoNotSchedule, incoming pod can only be scheduled
    to zone2(zone3) to become 3/2/1(3/1/2) as ActualSkew(2-1) on zone2(zone3) satisfies
    MaxSkew(1). In other words, the cluster can still be imbalanced, but scheduler
    won't make it *more* imbalanced.
    It's a required field.
    """


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

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

        def fs_type(self, value: Optional[str], /) -> Self:
            """
            fsType is the filesystem type of the volume that you want to mount.
            Tip: Ensure that the filesystem type is supported by the host operating system.
            Examples: "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified.
            More info: https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore
            """
            return self._set("fs_type", value)

        def partition(self, value: Optional[int], /) -> Self:
            """
            partition is the partition in the volume that you want to mount.
            If omitted, the default is to mount by volume name.
            Examples: For volume /dev/sda1, you specify the partition as "1".
            Similarly, the volume partition for /dev/sda is "0" (or you can leave the property empty).
            """
            return self._set("partition", value)

        def read_only(self, value: Optional[bool], /) -> Self:
            """
            readOnly value true will force the readOnly setting in VolumeMounts.
            More info: https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore
            """
            return self._set("read_only", value)

        def volume_id(self, value: str, /) -> Self:
            """
            volumeID is unique ID of the persistent disk resource in AWS (Amazon EBS volume).
            More info: https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore
            """
            return self._set("volume_id", value)

    class BuilderContext(BuilderContextBase["AwsElasticBlockStore.Builder"]):
        def model_post_init(self, __context) -> None:
            self._builder = AwsElasticBlockStore.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 AwsElasticBlockStore."""
        return cls.BuilderContext()

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

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

    fs_type: Annotated[Optional[str], Field(alias="fsType")] = None
    """
    fsType is the filesystem type of the volume that you want to mount.
    Tip: Ensure that the filesystem type is supported by the host operating system.
    Examples: "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified.
    More info: https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore
    """
    partition: Optional[int] = None
    """
    partition is the partition in the volume that you want to mount.
    If omitted, the default is to mount by volume name.
    Examples: For volume /dev/sda1, you specify the partition as "1".
    Similarly, the volume partition for /dev/sda is "0" (or you can leave the property empty).
    """
    read_only: Annotated[Optional[bool], Field(alias="readOnly")] = None
    """
    readOnly value true will force the readOnly setting in VolumeMounts.
    More info: https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore
    """
    volume_id: Annotated[str, Field(alias="volumeID")]
    """
    volumeID is unique ID of the persistent disk resource in AWS (Amazon EBS volume).
    More info: https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore
    """


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

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

        def caching_mode(self, value: Optional[str], /) -> Self:
            """
            cachingMode is the Host Caching mode: None, Read Only, Read Write.
            """
            return self._set("caching_mode", value)

        def disk_name(self, value: str, /) -> Self:
            """
            diskName is the Name of the data disk in the blob storage
            """
            return self._set("disk_name", value)

        def disk_uri(self, value: str, /) -> Self:
            """
            diskURI is the URI of data disk in the blob storage
            """
            return self._set("disk_uri", value)

        def fs_type(self, value: Optional[str], /) -> Self:
            """
            fsType is Filesystem type to mount.
            Must be a filesystem type supported by the host operating system.
            Ex. "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified.
            """
            return self._set("fs_type", value)

        def kind(self, value: Optional[str], /) -> Self:
            """
            kind expected values are Shared: multiple blob disks per storage account  Dedicated: single blob disk per storage account  Managed: azure managed data disk (only in managed availability set). defaults to shared
            """
            return self._set("kind", value)

        def read_only(self, value: Optional[bool], /) -> Self:
            """
            readOnly Defaults to false (read/write). ReadOnly here will force
            the ReadOnly setting in VolumeMounts.
            """
            return self._set("read_only", value)

    class BuilderContext(BuilderContextBase["AzureDisk.Builder"]):
        def model_post_init(self, __context) -> None:
            self._builder = AzureDisk.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 AzureDisk."""
        return cls.BuilderContext()

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

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

    caching_mode: Annotated[Optional[str], Field(alias="cachingMode")] = None
    """
    cachingMode is the Host Caching mode: None, Read Only, Read Write.
    """
    disk_name: Annotated[str, Field(alias="diskName")]
    """
    diskName is the Name of the data disk in the blob storage
    """
    disk_uri: Annotated[str, Field(alias="diskURI")]
    """
    diskURI is the URI of data disk in the blob storage
    """
    fs_type: Annotated[Optional[str], Field(alias="fsType")] = "ext4"
    """
    fsType is Filesystem type to mount.
    Must be a filesystem type supported by the host operating system.
    Ex. "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified.
    """
    kind: Optional[str] = None
    """
    kind expected values are Shared: multiple blob disks per storage account  Dedicated: single blob disk per storage account  Managed: azure managed data disk (only in managed availability set). defaults to shared
    """
    read_only: Annotated[Optional[bool], Field(alias="readOnly")] = False
    """
    readOnly Defaults to false (read/write). ReadOnly here will force
    the ReadOnly setting in VolumeMounts.
    """


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

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

        def read_only(self, value: Optional[bool], /) -> Self:
            """
            readOnly defaults to false (read/write). ReadOnly here will force
            the ReadOnly setting in VolumeMounts.
            """
            return self._set("read_only", value)

        def secret_name(self, value: str, /) -> Self:
            """
            secretName is the  name of secret that contains Azure Storage Account Name and Key
            """
            return self._set("secret_name", value)

        def share_name(self, value: str, /) -> Self:
            """
            shareName is the azure share Name
            """
            return self._set("share_name", value)

    class BuilderContext(BuilderContextBase["AzureFile.Builder"]):
        def model_post_init(self, __context) -> None:
            self._builder = AzureFile.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 AzureFile."""
        return cls.BuilderContext()

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

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

    read_only: Annotated[Optional[bool], Field(alias="readOnly")] = None
    """
    readOnly defaults to false (read/write). ReadOnly here will force
    the ReadOnly setting in VolumeMounts.
    """
    secret_name: Annotated[str, Field(alias="secretName")]
    """
    secretName is the  name of secret that contains Azure Storage Account Name and Key
    """
    share_name: Annotated[str, Field(alias="shareName")]
    """
    shareName is the azure share Name
    """


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

        def build(self) -> "SecretRefModel":
            return SecretRefModel(**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["SecretRefModel.Builder"]):
        def model_post_init(self, __context) -> None:
            self._builder = SecretRefModel.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 SecretRefModel."""
        return cls.BuilderContext()

    class ListBuilder(GenericListBuilder["SecretRefModel", Builder]):
        def __init__(self):
            raise NotImplementedError(
                "This class is not meant to be instantiated. Use SecretRefModel.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 Cephfs(BaseModel):
    class Builder(BaseModelBuilder):
        @property
        def cls(self) -> Type["Cephfs"]:
            return Cephfs

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

        def monitors(self, value: List[str], /) -> Self:
            """
            monitors is Required: Monitors is a collection of Ceph monitors
            More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it
            """
            return self._set("monitors", value)

        def path(self, value: Optional[str], /) -> Self:
            """
            path is Optional: Used as the mounted root, rather than the full Ceph tree, default is /
            """
            return self._set("path", value)

        def read_only(self, value: Optional[bool], /) -> Self:
            """
            readOnly is Optional: Defaults to false (read/write). ReadOnly here will force
            the ReadOnly setting in VolumeMounts.
            More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it
            """
            return self._set("read_only", value)

        def secret_file(self, value: Optional[str], /) -> Self:
            """
            secretFile is Optional: SecretFile is the path to key ring for User, default is /etc/ceph/user.secret
            More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it
            """
            return self._set("secret_file", value)

        @overload
        def secret_ref(
            self, value_or_callback: Optional[SecretRefModel], /
        ) -> "Cephfs.Builder": ...

        @overload
        def secret_ref(
            self,
            value_or_callback: Callable[
                [SecretRefModel.Builder], SecretRefModel.Builder | SecretRefModel
            ],
            /,
        ) -> "Cephfs.Builder": ...

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

        def secret_ref(self, value_or_callback=None, /):
            """
            secretRef is Optional: SecretRef is reference to the authentication secret for User, default is empty.
            More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it
            """
            if self._in_context and value_or_callback is None:
                context = SecretRefModel.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(SecretRefModel.builder())
                if isinstance(output, SecretRefModel.Builder):
                    value = output.build()
                else:
                    value = output
            return self._set("secret_ref", value)

        def user(self, value: Optional[str], /) -> Self:
            """
            user is optional: User is the rados user name, default is admin
            More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it
            """
            return self._set("user", value)

    class BuilderContext(BuilderContextBase["Cephfs.Builder"]):
        def model_post_init(self, __context) -> None:
            self._builder = Cephfs.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 Cephfs."""
        return cls.BuilderContext()

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

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

    monitors: List[str]
    """
    monitors is Required: Monitors is a collection of Ceph monitors
    More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it
    """
    path: Optional[str] = None
    """
    path is Optional: Used as the mounted root, rather than the full Ceph tree, default is /
    """
    read_only: Annotated[Optional[bool], Field(alias="readOnly")] = None
    """
    readOnly is Optional: Defaults to false (read/write). ReadOnly here will force
    the ReadOnly setting in VolumeMounts.
    More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it
    """
    secret_file: Annotated[Optional[str], Field(alias="secretFile")] = None
    """
    secretFile is Optional: SecretFile is the path to key ring for User, default is /etc/ceph/user.secret
    More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it
    """
    secret_ref: Annotated[Optional[SecretRefModel], Field(alias="secretRef")] = None
    """
    secretRef is Optional: SecretRef is reference to the authentication secret for User, default is empty.
    More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it
    """
    user: Optional[str] = None
    """
    user is optional: User is the rados user name, default is admin
    More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it
    """


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

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

        def fs_type(self, value: Optional[str], /) -> Self:
            """
            fsType is the filesystem type to mount.
            Must be a filesystem type supported by the host operating system.
            Examples: "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified.
            More info: https://examples.k8s.io/mysql-cinder-pd/README.md
            """
            return self._set("fs_type", value)

        def read_only(self, value: Optional[bool], /) -> Self:
            """
            readOnly defaults to false (read/write). ReadOnly here will force
            the ReadOnly setting in VolumeMounts.
            More info: https://examples.k8s.io/mysql-cinder-pd/README.md
            """
            return self._set("read_only", value)

        @overload
        def secret_ref(
            self, value_or_callback: Optional[SecretRefModel], /
        ) -> "Cinder.Builder": ...

        @overload
        def secret_ref(
            self,
            value_or_callback: Callable[
                [SecretRefModel.Builder], SecretRefModel.Builder | SecretRefModel
            ],
            /,
        ) -> "Cinder.Builder": ...

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

        def secret_ref(self, value_or_callback=None, /):
            """
            secretRef is optional: points to a secret object containing parameters used to connect
            to OpenStack.
            """
            if self._in_context and value_or_callback is None:
                context = SecretRefModel.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(SecretRefModel.builder())
                if isinstance(output, SecretRefModel.Builder):
                    value = output.build()
                else:
                    value = output
            return self._set("secret_ref", value)

        def volume_id(self, value: str, /) -> Self:
            """
            volumeID used to identify the volume in cinder.
            More info: https://examples.k8s.io/mysql-cinder-pd/README.md
            """
            return self._set("volume_id", value)

    class BuilderContext(BuilderContextBase["Cinder.Builder"]):
        def model_post_init(self, __context) -> None:
            self._builder = Cinder.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 Cinder."""
        return cls.BuilderContext()

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

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

    fs_type: Annotated[Optional[str], Field(alias="fsType")] = None
    """
    fsType is the filesystem type to mount.
    Must be a filesystem type supported by the host operating system.
    Examples: "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified.
    More info: https://examples.k8s.io/mysql-cinder-pd/README.md
    """
    read_only: Annotated[Optional[bool], Field(alias="readOnly")] = None
    """
    readOnly defaults to false (read/write). ReadOnly here will force
    the ReadOnly setting in VolumeMounts.
    More info: https://examples.k8s.io/mysql-cinder-pd/README.md
    """
    secret_ref: Annotated[Optional[SecretRefModel], Field(alias="secretRef")] = None
    """
    secretRef is optional: points to a secret object containing parameters used to connect
    to OpenStack.
    """
    volume_id: Annotated[str, Field(alias="volumeID")]
    """
    volumeID used to identify the volume in cinder.
    More info: https://examples.k8s.io/mysql-cinder-pd/README.md
    """


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

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

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

        def mode(self, value: Optional[int], /) -> Self:
            """
            mode is Optional: mode bits used to set permissions on this file.
            Must be an octal value between 0000 and 0777 or a decimal value between 0 and 511.
            YAML accepts both octal and decimal values, JSON requires decimal values for mode bits.
            If not specified, the volume defaultMode will be used.
            This might be in conflict with other options that affect the file
            mode, like fsGroup, and the result can be other mode bits set.
            """
            return self._set("mode", value)

        def path(self, value: str, /) -> Self:
            """
            path is the relative path of the file to map the key to.
            May not be an absolute path.
            May not contain the path element '..'.
            May not start with the string '..'.
            """
            return self._set("path", value)

    class BuilderContext(BuilderContextBase["Item.Builder"]):
        def model_post_init(self, __context) -> None:
            self._builder = Item.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 Item."""
        return cls.BuilderContext()

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

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

    key: str
    """
    key is the key to project.
    """
    mode: Optional[int] = None
    """
    mode is Optional: mode bits used to set permissions on this file.
    Must be an octal value between 0000 and 0777 or a decimal value between 0 and 511.
    YAML accepts both octal and decimal values, JSON requires decimal values for mode bits.
    If not specified, the volume defaultMode will be used.
    This might be in conflict with other options that affect the file
    mode, like fsGroup, and the result can be other mode bits set.
    """
    path: str
    """
    path is the relative path of the file to map the key to.
    May not be an absolute path.
    May not contain the path element '..'.
    May not start with the string '..'.
    """


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

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

        def default_mode(self, value: Optional[int], /) -> Self:
            """
            defaultMode is optional: mode bits used to set permissions on created files by default.
            Must be an octal value between 0000 and 0777 or a decimal value between 0 and 511.
            YAML accepts both octal and decimal values, JSON requires decimal values for mode bits.
            Defaults to 0644.
            Directories within the path are not affected by this setting.
            This might be in conflict with other options that affect the file
            mode, like fsGroup, and the result can be other mode bits set.
            """
            return self._set("default_mode", value)

        @overload
        def items(self, value_or_callback: List[Item], /) -> "ConfigMap.Builder": ...

        @overload
        def items(
            self,
            value_or_callback: Callable[
                [GenericListBuilder[Item, Item.Builder]],
                GenericListBuilder[Item, Item.Builder] | List[Item],
            ],
            /,
        ) -> "ConfigMap.Builder": ...

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

        def items(self, value_or_callback=None, /):
            """
            items if unspecified, each key-value pair in the Data field of the referenced
            ConfigMap will be projected into the volume as a file whose name is the
            key and content is the value. If specified, the listed keys will be
            projected into the specified paths, and unlisted keys will not be
            present. If a key is specified which is not present in the ConfigMap,
            the volume setup will error unless it is marked optional. Paths must be
            relative and may not contain the '..' path or start with '..'.
            """
            if self._in_context and value_or_callback is None:
                context = ListBuilderContext[Item.Builder]()
                context._parent_builder = self
                context._field_name = "items"
                return context

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

        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)

        def optional(self, value: Optional[bool], /) -> Self:
            """
            optional specify whether the ConfigMap or its keys must be defined
            """
            return self._set("optional", value)

    class BuilderContext(BuilderContextBase["ConfigMap.Builder"]):
        def model_post_init(self, __context) -> None:
            self._builder = ConfigMap.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 ConfigMap."""
        return cls.BuilderContext()

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

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

    default_mode: Annotated[Optional[int], Field(alias="defaultMode")] = None
    """
    defaultMode is optional: mode bits used to set permissions on created files by default.
    Must be an octal value between 0000 and 0777 or a decimal value between 0 and 511.
    YAML accepts both octal and decimal values, JSON requires decimal values for mode bits.
    Defaults to 0644.
    Directories within the path are not affected by this setting.
    This might be in conflict with other options that affect the file
    mode, like fsGroup, and the result can be other mode bits set.
    """
    items: Optional[List[Item]] = None
    """
    items if unspecified, each key-value pair in the Data field of the referenced
    ConfigMap will be projected into the volume as a file whose name is the
    key and content is the value. If specified, the listed keys will be
    projected into the specified paths, and unlisted keys will not be
    present. If a key is specified which is not present in the ConfigMap,
    the volume setup will error unless it is marked optional. Paths must be
    relative and may not contain the '..' path or start with '..'.
    """
    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
    """
    optional: Optional[bool] = None
    """
    optional specify whether the ConfigMap or its keys must be defined
    """


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

        def build(self) -> "NodePublishSecretRef":
            return NodePublishSecretRef(**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["NodePublishSecretRef.Builder"]):
        def model_post_init(self, __context) -> None:
            self._builder = NodePublishSecretRef.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 NodePublishSecretRef."""
        return cls.BuilderContext()

    class ListBuilder(GenericListBuilder["NodePublishSecretRef", Builder]):
        def __init__(self):
            raise NotImplementedError(
                "This class is not meant to be instantiated. Use NodePublishSecretRef.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 Csi(BaseModel):
    class Builder(BaseModelBuilder):
        @property
        def cls(self) -> Type["Csi"]:
            return Csi

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

        def driver(self, value: str, /) -> Self:
            """
            driver is the name of the CSI driver that handles this volume.
            Consult with your admin for the correct name as registered in the cluster.
            """
            return self._set("driver", value)

        def fs_type(self, value: Optional[str], /) -> Self:
            """
            fsType to mount. Ex. "ext4", "xfs", "ntfs".
            If not provided, the empty value is passed to the associated CSI driver
            which will determine the default filesystem to apply.
            """
            return self._set("fs_type", value)

        @overload
        def node_publish_secret_ref(
            self, value_or_callback: Optional[NodePublishSecretRef], /
        ) -> "Csi.Builder": ...

        @overload
        def node_publish_secret_ref(
            self,
            value_or_callback: Callable[
                [NodePublishSecretRef.Builder],
                NodePublishSecretRef.Builder | NodePublishSecretRef,
            ],
            /,
        ) -> "Csi.Builder": ...

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

        def node_publish_secret_ref(self, value_or_callback=None, /):
            """
            nodePublishSecretRef is a reference to the secret object containing
            sensitive information to pass to the CSI driver to complete the CSI
            NodePublishVolume and NodeUnpublishVolume calls.
            This field is optional, and  may be empty if no secret is required. If the
            secret object contains more than one secret, all secret references are passed.
            """
            if self._in_context and value_or_callback is None:
                context = NodePublishSecretRef.BuilderContext()
                context._parent_builder = self
                context._field_name = "node_publish_secret_ref"
                return context

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

        def read_only(self, value: Optional[bool], /) -> Self:
            """
            readOnly specifies a read-only configuration for the volume.
            Defaults to false (read/write).
            """
            return self._set("read_only", value)

        def volume_attributes(self, value: Optional[Dict[str, str]], /) -> Self:
            """
            volumeAttributes stores driver-specific properties that are passed to the CSI
            driver. Consult your driver's documentation for supported values.
            """
            return self._set("volume_attributes", value)

    class BuilderContext(BuilderContextBase["Csi.Builder"]):
        def model_post_init(self, __context) -> None:
            self._builder = Csi.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 Csi."""
        return cls.BuilderContext()

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

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

    driver: str
    """
    driver is the name of the CSI driver that handles this volume.
    Consult with your admin for the correct name as registered in the cluster.
    """
    fs_type: Annotated[Optional[str], Field(alias="fsType")] = None
    """
    fsType to mount. Ex. "ext4", "xfs", "ntfs".
    If not provided, the empty value is passed to the associated CSI driver
    which will determine the default filesystem to apply.
    """
    node_publish_secret_ref: Annotated[
        Optional[NodePublishSecretRef], Field(alias="nodePublishSecretRef")
    ] = None
    """
    nodePublishSecretRef is a reference to the secret object containing
    sensitive information to pass to the CSI driver to complete the CSI
    NodePublishVolume and NodeUnpublishVolume calls.
    This field is optional, and  may be empty if no secret is required. If the
    secret object contains more than one secret, all secret references are passed.
    """
    read_only: Annotated[Optional[bool], Field(alias="readOnly")] = None
    """
    readOnly specifies a read-only configuration for the volume.
    Defaults to false (read/write).
    """
    volume_attributes: Annotated[Optional[Dict[str, str]], Field(alias="volumeAttributes")] = None
    """
    volumeAttributes stores driver-specific properties that are passed to the CSI
    driver. Consult your driver's documentation for supported values.
    """


class DivisorModel5(RootModel[int]):
    class Builder(BaseBuilder):
        _value: int | None = None

        def root(self, value: int, /) -> Self:
            """
            Specifies the output format of the exposed resources, defaults to "1"
            """
            self._value = value
            return self

        def __call__(self, value: int, /) -> Self:
            """
            Specifies the output format of the exposed resources, defaults to "1"
            """
            self._value = value
            return self

        def build(self) -> "DivisorModel5":
            value = cast(int, self._value)
            return DivisorModel5(value)

    root: Annotated[
        int,
        Field(
            pattern="^(\\+|-)?(([0-9]+(\\.[0-9]*)?)|(\\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\\+|-)?(([0-9]+(\\.[0-9]*)?)|(\\.[0-9]+))))?$"
        ),
    ]
    """
    Specifies the output format of the exposed resources, defaults to "1"
    """

    class BuilderContext(BuilderContextBase["DivisorModel5.Builder"]):
        def model_post_init(self, __context) -> None:
            self._builder = DivisorModel5.Builder()
            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 DivisorModel5."""
        return cls.BuilderContext()


class DivisorModel6(RootModel[str]):
    class Builder(BaseBuilder):
        _value: str | None = None

        def root(self, value: str, /) -> Self:
            """
            Specifies the output format of the exposed resources, defaults to "1"
            """
            self._value = value
            return self

        def __call__(self, value: str, /) -> Self:
            """
            Specifies the output format of the exposed resources, defaults to "1"
            """
            self._value = value
            return self

        def build(self) -> "DivisorModel6":
            value = cast(str, self._value)
            return DivisorModel6(value)

    root: Annotated[
        str,
        Field(
            pattern="^(\\+|-)?(([0-9]+(\\.[0-9]*)?)|(\\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\\+|-)?(([0-9]+(\\.[0-9]*)?)|(\\.[0-9]+))))?$"
        ),
    ]
    """
    Specifies the output format of the exposed resources, defaults to "1"
    """

    class BuilderContext(BuilderContextBase["DivisorModel6.Builder"]):
        def model_post_init(self, __context) -> None:
            self._builder = DivisorModel6.Builder()
            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 DivisorModel6."""
        return cls.BuilderContext()


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

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

        @overload
        def field_ref(self, value_or_callback: Optional[FieldRef], /) -> "ItemModel.Builder": ...

        @overload
        def field_ref(
            self,
            value_or_callback: Callable[[FieldRef.Builder], FieldRef.Builder | FieldRef],
            /,
        ) -> "ItemModel.Builder": ...

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

        def field_ref(self, value_or_callback=None, /):
            """
            Required: Selects a field of the pod: only annotations, labels, name, namespace and uid are supported.
            """
            if self._in_context and value_or_callback is None:
                context = FieldRef.BuilderContext()
                context._parent_builder = self
                context._field_name = "field_ref"
                return context

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

        def mode(self, value: Optional[int], /) -> Self:
            """
            Optional: mode bits used to set permissions on this file, must be an octal value
            between 0000 and 0777 or a decimal value between 0 and 511.
            YAML accepts both octal and decimal values, JSON requires decimal values for mode bits.
            If not specified, the volume defaultMode will be used.
            This might be in conflict with other options that affect the file
            mode, like fsGroup, and the result can be other mode bits set.
            """
            return self._set("mode", value)

        def path(self, value: str, /) -> Self:
            """
            Required: Path is  the relative path name of the file to be created. Must not be absolute or contain the '..' path. Must be utf-8 encoded. The first item of the relative path must not start with '..'
            """
            return self._set("path", value)

        @overload
        def resource_field_ref(
            self, value_or_callback: Optional[ResourceFieldRef], /
        ) -> "ItemModel.Builder": ...

        @overload
        def resource_field_ref(
            self,
            value_or_callback: Callable[
                [ResourceFieldRef.Builder], ResourceFieldRef.Builder | ResourceFieldRef
            ],
            /,
        ) -> "ItemModel.Builder": ...

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

        def resource_field_ref(self, value_or_callback=None, /):
            """
            Selects a resource of the container: only resources limits and requests
            (limits.cpu, limits.memory, requests.cpu and requests.memory) are currently supported.
            """
            if self._in_context and value_or_callback is None:
                context = ResourceFieldRef.BuilderContext()
                context._parent_builder = self
                context._field_name = "resource_field_ref"
                return context

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

    class BuilderContext(BuilderContextBase["ItemModel.Builder"]):
        def model_post_init(self, __context) -> None:
            self._builder = ItemModel.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 ItemModel."""
        return cls.BuilderContext()

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

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

    field_ref: Annotated[Optional[FieldRef], Field(alias="fieldRef")] = None
    """
    Required: Selects a field of the pod: only annotations, labels, name, namespace and uid are supported.
    """
    mode: Optional[int] = None
    """
    Optional: mode bits used to set permissions on this file, must be an octal value
    between 0000 and 0777 or a decimal value between 0 and 511.
    YAML accepts both octal and decimal values, JSON requires decimal values for mode bits.
    If not specified, the volume defaultMode will be used.
    This might be in conflict with other options that affect the file
    mode, like fsGroup, and the result can be other mode bits set.
    """
    path: str
    """
    Required: Path is  the relative path name of the file to be created. Must not be absolute or contain the '..' path. Must be utf-8 encoded. The first item of the relative path must not start with '..'
    """
    resource_field_ref: Annotated[Optional[ResourceFieldRef], Field(alias="resourceFieldRef")] = (
        None
    )
    """
    Selects a resource of the container: only resources limits and requests
    (limits.cpu, limits.memory, requests.cpu and requests.memory) are currently supported.
    """


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

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

        def default_mode(self, value: Optional[int], /) -> Self:
            """
            Optional: mode bits to use on created files by default. Must be a
            Optional: mode bits used to set permissions on created files by default.
            Must be an octal value between 0000 and 0777 or a decimal value between 0 and 511.
            YAML accepts both octal and decimal values, JSON requires decimal values for mode bits.
            Defaults to 0644.
            Directories within the path are not affected by this setting.
            This might be in conflict with other options that affect the file
            mode, like fsGroup, and the result can be other mode bits set.
            """
            return self._set("default_mode", value)

        @overload
        def items(self, value_or_callback: List[ItemModel], /) -> "DownwardApi.Builder": ...

        @overload
        def items(
            self,
            value_or_callback: Callable[
                [GenericListBuilder[ItemModel, ItemModel.Builder]],
                GenericListBuilder[ItemModel, ItemModel.Builder] | List[ItemModel],
            ],
            /,
        ) -> "DownwardApi.Builder": ...

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

        def items(self, value_or_callback=None, /):
            """
            Items is a list of downward API volume file
            """
            if self._in_context and value_or_callback is None:
                context = ListBuilderContext[ItemModel.Builder]()
                context._parent_builder = self
                context._field_name = "items"
                return context

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

    class BuilderContext(BuilderContextBase["DownwardApi.Builder"]):
        def model_post_init(self, __context) -> None:
            self._builder = DownwardApi.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 DownwardApi."""
        return cls.BuilderContext()

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

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

    default_mode: Annotated[Optional[int], Field(alias="defaultMode")] = None
    """
    Optional: mode bits to use on created files by default. Must be a
    Optional: mode bits used to set permissions on created files by default.
    Must be an octal value between 0000 and 0777 or a decimal value between 0 and 511.
    YAML accepts both octal and decimal values, JSON requires decimal values for mode bits.
    Defaults to 0644.
    Directories within the path are not affected by this setting.
    This might be in conflict with other options that affect the file
    mode, like fsGroup, and the result can be other mode bits set.
    """
    items: Optional[List[ItemModel]] = None
    """
    Items is a list of downward API volume file
    """


class SizeLimit(RootModel[int]):
    class Builder(BaseBuilder):
        _value: int | None = None

        def root(self, value: int, /) -> Self:
            """
            sizeLimit is the total amount of local storage required for this EmptyDir volume.
            The size limit is also applicable for memory medium.
            The maximum usage on memory medium EmptyDir would be the minimum value between
            the SizeLimit specified here and the sum of memory limits of all containers in a pod.
            The default is nil which means that the limit is undefined.
            More info: https://kubernetes.io/docs/concepts/storage/volumes#emptydir
            """
            self._value = value
            return self

        def __call__(self, value: int, /) -> Self:
            """
            sizeLimit is the total amount of local storage required for this EmptyDir volume.
            The size limit is also applicable for memory medium.
            The maximum usage on memory medium EmptyDir would be the minimum value between
            the SizeLimit specified here and the sum of memory limits of all containers in a pod.
            The default is nil which means that the limit is undefined.
            More info: https://kubernetes.io/docs/concepts/storage/volumes#emptydir
            """
            self._value = value
            return self

        def build(self) -> "SizeLimit":
            value = cast(int, self._value)
            return SizeLimit(value)

    root: Annotated[
        int,
        Field(
            pattern="^(\\+|-)?(([0-9]+(\\.[0-9]*)?)|(\\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\\+|-)?(([0-9]+(\\.[0-9]*)?)|(\\.[0-9]+))))?$"
        ),
    ]
    """
    sizeLimit is the total amount of local storage required for this EmptyDir volume.
    The size limit is also applicable for memory medium.
    The maximum usage on memory medium EmptyDir would be the minimum value between
    the SizeLimit specified here and the sum of memory limits of all containers in a pod.
    The default is nil which means that the limit is undefined.
    More info: https://kubernetes.io/docs/concepts/storage/volumes#emptydir
    """

    class BuilderContext(BuilderContextBase["SizeLimit.Builder"]):
        def model_post_init(self, __context) -> None:
            self._builder = SizeLimit.Builder()
            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 SizeLimit."""
        return cls.BuilderContext()


class SizeLimitModel(RootModel[str]):
    class Builder(BaseBuilder):
        _value: str | None = None

        def root(self, value: str, /) -> Self:
            """
            sizeLimit is the total amount of local storage required for this EmptyDir volume.
            The size limit is also applicable for memory medium.
            The maximum usage on memory medium EmptyDir would be the minimum value between
            the SizeLimit specified here and the sum of memory limits of all containers in a pod.
            The default is nil which means that the limit is undefined.
            More info: https://kubernetes.io/docs/concepts/storage/volumes#emptydir
            """
            self._value = value
            return self

        def __call__(self, value: str, /) -> Self:
            """
            sizeLimit is the total amount of local storage required for this EmptyDir volume.
            The size limit is also applicable for memory medium.
            The maximum usage on memory medium EmptyDir would be the minimum value between
            the SizeLimit specified here and the sum of memory limits of all containers in a pod.
            The default is nil which means that the limit is undefined.
            More info: https://kubernetes.io/docs/concepts/storage/volumes#emptydir
            """
            self._value = value
            return self

        def build(self) -> "SizeLimitModel":
            value = cast(str, self._value)
            return SizeLimitModel(value)

    root: Annotated[
        str,
        Field(
            pattern="^(\\+|-)?(([0-9]+(\\.[0-9]*)?)|(\\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\\+|-)?(([0-9]+(\\.[0-9]*)?)|(\\.[0-9]+))))?$"
        ),
    ]
    """
    sizeLimit is the total amount of local storage required for this EmptyDir volume.
    The size limit is also applicable for memory medium.
    The maximum usage on memory medium EmptyDir would be the minimum value between
    the SizeLimit specified here and the sum of memory limits of all containers in a pod.
    The default is nil which means that the limit is undefined.
    More info: https://kubernetes.io/docs/concepts/storage/volumes#emptydir
    """

    class BuilderContext(BuilderContextBase["SizeLimitModel.Builder"]):
        def model_post_init(self, __context) -> None:
            self._builder = SizeLimitModel.Builder()
            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 SizeLimitModel."""
        return cls.BuilderContext()


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

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

        def medium(self, value: Optional[str], /) -> Self:
            """
            medium represents what type of storage medium should back this directory.
            The default is "" which means to use the node's default medium.
            Must be an empty string (default) or Memory.
            More info: https://kubernetes.io/docs/concepts/storage/volumes#emptydir
            """
            return self._set("medium", value)

        def size_limit(self, value: Optional[Union[SizeLimit, SizeLimitModel]], /) -> Self:
            """
            sizeLimit is the total amount of local storage required for this EmptyDir volume.
            The size limit is also applicable for memory medium.
            The maximum usage on memory medium EmptyDir would be the minimum value between
            the SizeLimit specified here and the sum of memory limits of all containers in a pod.
            The default is nil which means that the limit is undefined.
            More info: https://kubernetes.io/docs/concepts/storage/volumes#emptydir
            """
            return self._set("size_limit", value)

    class BuilderContext(BuilderContextBase["EmptyDir.Builder"]):
        def model_post_init(self, __context) -> None:
            self._builder = EmptyDir.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 EmptyDir."""
        return cls.BuilderContext()

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

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

    medium: Optional[str] = None
    """
    medium represents what type of storage medium should back this directory.
    The default is "" which means to use the node's default medium.
    Must be an empty string (default) or Memory.
    More info: https://kubernetes.io/docs/concepts/storage/volumes#emptydir
    """
    size_limit: Annotated[Optional[Union[SizeLimit, SizeLimitModel]], Field(alias="sizeLimit")] = (
        None
    )
    """
    sizeLimit is the total amount of local storage required for this EmptyDir volume.
    The size limit is also applicable for memory medium.
    The maximum usage on memory medium EmptyDir would be the minimum value between
    the SizeLimit specified here and the sum of memory limits of all containers in a pod.
    The default is nil which means that the limit is undefined.
    More info: https://kubernetes.io/docs/concepts/storage/volumes#emptydir
    """


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

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

        def api_group(self, value: Optional[str], /) -> Self:
            """
            APIGroup is the group for the resource being referenced.
            If APIGroup is not specified, the specified Kind must be in the core API group.
            For any other third-party types, APIGroup is required.
            """
            return self._set("api_group", value)

        def kind(self, value: str, /) -> Self:
            """
            Kind is the type of resource being referenced
            """
            return self._set("kind", value)

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

    class BuilderContext(BuilderContextBase["DataSource.Builder"]):
        def model_post_init(self, __context) -> None:
            self._builder = DataSource.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 DataSource."""
        return cls.BuilderContext()

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

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

    api_group: Annotated[Optional[str], Field(alias="apiGroup")] = None
    """
    APIGroup is the group for the resource being referenced.
    If APIGroup is not specified, the specified Kind must be in the core API group.
    For any other third-party types, APIGroup is required.
    """
    kind: str
    """
    Kind is the type of resource being referenced
    """
    name: str
    """
    Name is the name of resource being referenced
    """


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

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

        def api_group(self, value: Optional[str], /) -> Self:
            """
            APIGroup is the group for the resource being referenced.
            If APIGroup is not specified, the specified Kind must be in the core API group.
            For any other third-party types, APIGroup is required.
            """
            return self._set("api_group", value)

        def kind(self, value: str, /) -> Self:
            """
            Kind is the type of resource being referenced
            """
            return self._set("kind", value)

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

        def namespace(self, value: Optional[str], /) -> Self:
            """
            Namespace is the namespace of resource being referenced
            Note that when a namespace is specified, a gateway.networking.k8s.io/ReferenceGrant object is required in the referent namespace to allow that namespace's owner to accept the reference. See the ReferenceGrant documentation for details.
            (Alpha) This field requires the CrossNamespaceVolumeDataSource feature gate to be enabled.
            """
            return self._set("namespace", value)

    class BuilderContext(BuilderContextBase["DataSourceRef.Builder"]):
        def model_post_init(self, __context) -> None:
            self._builder = DataSourceRef.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 DataSourceRef."""
        return cls.BuilderContext()

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

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

    api_group: Annotated[Optional[str], Field(alias="apiGroup")] = None
    """
    APIGroup is the group for the resource being referenced.
    If APIGroup is not specified, the specified Kind must be in the core API group.
    For any other third-party types, APIGroup is required.
    """
    kind: str
    """
    Kind is the type of resource being referenced
    """
    name: str
    """
    Name is the name of resource being referenced
    """
    namespace: Optional[str] = None
    """
    Namespace is the namespace of resource being referenced
    Note that when a namespace is specified, a gateway.networking.k8s.io/ReferenceGrant object is required in the referent namespace to allow that namespace's owner to accept the reference. See the ReferenceGrant documentation for details.
    (Alpha) This field requires the CrossNamespaceVolumeDataSource feature gate to be enabled.
    """


class LimitsModel5(RootModel[int]):
    class Builder(BaseBuilder):
        _value: int | None = None

        def root(self, value: int, /) -> Self:
            self._value = value
            return self

        def __call__(self, value: int, /) -> Self:
            self._value = value
            return self

        def build(self) -> "LimitsModel5":
            value = cast(int, self._value)
            return LimitsModel5(value)

    root: Annotated[
        int,
        Field(
            pattern="^(\\+|-)?(([0-9]+(\\.[0-9]*)?)|(\\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\\+|-)?(([0-9]+(\\.[0-9]*)?)|(\\.[0-9]+))))?$"
        ),
    ]

    class BuilderContext(BuilderContextBase["LimitsModel5.Builder"]):
        def model_post_init(self, __context) -> None:
            self._builder = LimitsModel5.Builder()
            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 LimitsModel5."""
        return cls.BuilderContext()


class LimitsModel6(RootModel[str]):
    class Builder(BaseBuilder):
        _value: str | None = None

        def root(self, value: str, /) -> Self:
            self._value = value
            return self

        def __call__(self, value: str, /) -> Self:
            self._value = value
            return self

        def build(self) -> "LimitsModel6":
            value = cast(str, self._value)
            return LimitsModel6(value)

    root: Annotated[
        str,
        Field(
            pattern="^(\\+|-)?(([0-9]+(\\.[0-9]*)?)|(\\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\\+|-)?(([0-9]+(\\.[0-9]*)?)|(\\.[0-9]+))))?$"
        ),
    ]

    class BuilderContext(BuilderContextBase["LimitsModel6.Builder"]):
        def model_post_init(self, __context) -> None:
            self._builder = LimitsModel6.Builder()
            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 LimitsModel6."""
        return cls.BuilderContext()


class RequestsModel5(RootModel[int]):
    class Builder(BaseBuilder):
        _value: int | None = None

        def root(self, value: int, /) -> Self:
            self._value = value
            return self

        def __call__(self, value: int, /) -> Self:
            self._value = value
            return self

        def build(self) -> "RequestsModel5":
            value = cast(int, self._value)
            return RequestsModel5(value)

    root: Annotated[
        int,
        Field(
            pattern="^(\\+|-)?(([0-9]+(\\.[0-9]*)?)|(\\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\\+|-)?(([0-9]+(\\.[0-9]*)?)|(\\.[0-9]+))))?$"
        ),
    ]

    class BuilderContext(BuilderContextBase["RequestsModel5.Builder"]):
        def model_post_init(self, __context) -> None:
            self._builder = RequestsModel5.Builder()
            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 RequestsModel5."""
        return cls.BuilderContext()


class RequestsModel6(RootModel[str]):
    class Builder(BaseBuilder):
        _value: str | None = None

        def root(self, value: str, /) -> Self:
            self._value = value
            return self

        def __call__(self, value: str, /) -> Self:
            self._value = value
            return self

        def build(self) -> "RequestsModel6":
            value = cast(str, self._value)
            return RequestsModel6(value)

    root: Annotated[
        str,
        Field(
            pattern="^(\\+|-)?(([0-9]+(\\.[0-9]*)?)|(\\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\\+|-)?(([0-9]+(\\.[0-9]*)?)|(\\.[0-9]+))))?$"
        ),
    ]

    class BuilderContext(BuilderContextBase["RequestsModel6.Builder"]):
        def model_post_init(self, __context) -> None:
            self._builder = RequestsModel6.Builder()
            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 RequestsModel6."""
        return cls.BuilderContext()


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

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

        def limits(self, value: Optional[Dict[str, Union[LimitsModel5, LimitsModel6]]], /) -> Self:
            """
            Limits describes the maximum amount of compute resources allowed.
            More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/
            """
            return self._set("limits", value)

        def requests(
            self, value: Optional[Dict[str, Union[RequestsModel5, RequestsModel6]]], /
        ) -> Self:
            """
            Requests describes the minimum amount of compute resources required.
            If Requests is omitted for a container, it defaults to Limits if that is explicitly specified,
            otherwise to an implementation-defined value. Requests cannot exceed Limits.
            More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/
            """
            return self._set("requests", value)

    class BuilderContext(BuilderContextBase["ResourcesModel.Builder"]):
        def model_post_init(self, __context) -> None:
            self._builder = ResourcesModel.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 ResourcesModel."""
        return cls.BuilderContext()

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

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

    limits: Optional[Dict[str, Union[LimitsModel5, LimitsModel6]]] = None
    """
    Limits describes the maximum amount of compute resources allowed.
    More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/
    """
    requests: Optional[Dict[str, Union[RequestsModel5, RequestsModel6]]] = None
    """
    Requests describes the minimum amount of compute resources required.
    If Requests is omitted for a container, it defaults to Limits if that is explicitly specified,
    otherwise to an implementation-defined value. Requests cannot exceed Limits.
    More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/
    """


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

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

        def access_modes(self, value: Optional[List[str]], /) -> Self:
            """
            accessModes contains the desired access modes the volume should have.
            More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#access-modes-1
            """
            return self._set("access_modes", value)

        @overload
        def data_source(self, value_or_callback: Optional[DataSource], /) -> "Spec.Builder": ...

        @overload
        def data_source(
            self,
            value_or_callback: Callable[[DataSource.Builder], DataSource.Builder | DataSource],
            /,
        ) -> "Spec.Builder": ...

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

        def data_source(self, value_or_callback=None, /):
            """
            dataSource field can be used to specify either:
            * An existing VolumeSnapshot object (snapshot.storage.k8s.io/VolumeSnapshot)
            * An existing PVC (PersistentVolumeClaim)
            If the provisioner or an external controller can support the specified data source,
            it will create a new volume based on the contents of the specified data source.
            When the AnyVolumeDataSource feature gate is enabled, dataSource contents will be copied to dataSourceRef,
            and dataSourceRef contents will be copied to dataSource when dataSourceRef.namespace is not specified.
            If the namespace is specified, then dataSourceRef will not be copied to dataSource.
            """
            if self._in_context and value_or_callback is None:
                context = DataSource.BuilderContext()
                context._parent_builder = self
                context._field_name = "data_source"
                return context

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

        @overload
        def data_source_ref(
            self, value_or_callback: Optional[DataSourceRef], /
        ) -> "Spec.Builder": ...

        @overload
        def data_source_ref(
            self,
            value_or_callback: Callable[
                [DataSourceRef.Builder], DataSourceRef.Builder | DataSourceRef
            ],
            /,
        ) -> "Spec.Builder": ...

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

        def data_source_ref(self, value_or_callback=None, /):
            """
            dataSourceRef specifies the object from which to populate the volume with data, if a non-empty
            volume is desired. This may be any object from a non-empty API group (non
            core object) or a PersistentVolumeClaim object.
            When this field is specified, volume binding will only succeed if the type of
            the specified object matches some installed volume populator or dynamic
            provisioner.
            This field will replace the functionality of the dataSource field and as such
            if both fields are non-empty, they must have the same value. For backwards
            compatibility, when namespace isn't specified in dataSourceRef,
            both fields (dataSource and dataSourceRef) will be set to the same
            value automatically if one of them is empty and the other is non-empty.
            When namespace is specified in dataSourceRef,
            dataSource isn't set to the same value and must be empty.
            There are three important differences between dataSource and dataSourceRef:
            * While dataSource only allows two specific types of objects, dataSourceRef
              allows any non-core object, as well as PersistentVolumeClaim objects.
            * While dataSource ignores disallowed values (dropping them), dataSourceRef
              preserves all values, and generates an error if a disallowed value is
              specified.
            * While dataSource only allows local objects, dataSourceRef allows objects
              in any namespaces.
            (Beta) Using this field requires the AnyVolumeDataSource feature gate to be enabled.
            (Alpha) Using the namespace field of dataSourceRef requires the CrossNamespaceVolumeDataSource feature gate to be enabled.
            """
            if self._in_context and value_or_callback is None:
                context = DataSourceRef.BuilderContext()
                context._parent_builder = self
                context._field_name = "data_source_ref"
                return context

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

        @overload
        def resources(self, value_or_callback: Optional[ResourcesModel], /) -> "Spec.Builder": ...

        @overload
        def resources(
            self,
            value_or_callback: Callable[
                [ResourcesModel.Builder], ResourcesModel.Builder | ResourcesModel
            ],
            /,
        ) -> "Spec.Builder": ...

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

        def resources(self, value_or_callback=None, /):
            """
            resources represents the minimum resources the volume should have.
            If RecoverVolumeExpansionFailure feature is enabled users are allowed to specify resource requirements
            that are lower than previous value but must still be higher than capacity recorded in the
            status field of the claim.
            More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#resources
            """
            if self._in_context and value_or_callback is None:
                context = ResourcesModel.BuilderContext()
                context._parent_builder = self
                context._field_name = "resources"
                return context

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

        @overload
        def selector(self, value_or_callback: Optional[Selector], /) -> "Spec.Builder": ...

        @overload
        def selector(
            self,
            value_or_callback: Callable[[Selector.Builder], Selector.Builder | Selector],
            /,
        ) -> "Spec.Builder": ...

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

        def selector(self, value_or_callback=None, /):
            """
            selector is a label query over volumes to consider for binding.
            """
            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)

        def storage_class_name(self, value: Optional[str], /) -> Self:
            """
            storageClassName is the name of the StorageClass required by the claim.
            More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#class-1
            """
            return self._set("storage_class_name", value)

        def volume_attributes_class_name(self, value: Optional[str], /) -> Self:
            """
            volumeAttributesClassName may be used to set the VolumeAttributesClass used by this claim.
            If specified, the CSI driver will create or update the volume with the attributes defined
            in the corresponding VolumeAttributesClass. This has a different purpose than storageClassName,
            it can be changed after the claim is created. An empty string value means that no VolumeAttributesClass
            will be applied to the claim but it's not allowed to reset this field to empty string once it is set.
            If unspecified and the PersistentVolumeClaim is unbound, the default VolumeAttributesClass
            will be set by the persistentvolume controller if it exists.
            If the resource referred to by volumeAttributesClass does not exist, this PersistentVolumeClaim will be
            set to a Pending state, as reflected by the modifyVolumeStatus field, until such as a resource
            exists.
            More info: https://kubernetes.io/docs/concepts/storage/volume-attributes-classes/
            (Beta) Using this field requires the VolumeAttributesClass feature gate to be enabled (off by default).
            """
            return self._set("volume_attributes_class_name", value)

        def volume_mode(self, value: Optional[str], /) -> Self:
            """
            volumeMode defines what type of volume is required by the claim.
            Value of Filesystem is implied when not included in claim spec.
            """
            return self._set("volume_mode", value)

        def volume_name(self, value: Optional[str], /) -> Self:
            """
            volumeName is the binding reference to the PersistentVolume backing this claim.
            """
            return self._set("volume_name", 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

    access_modes: Annotated[Optional[List[str]], Field(alias="accessModes")] = None
    """
    accessModes contains the desired access modes the volume should have.
    More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#access-modes-1
    """
    data_source: Annotated[Optional[DataSource], Field(alias="dataSource")] = None
    """
    dataSource field can be used to specify either:
    * An existing VolumeSnapshot object (snapshot.storage.k8s.io/VolumeSnapshot)
    * An existing PVC (PersistentVolumeClaim)
    If the provisioner or an external controller can support the specified data source,
    it will create a new volume based on the contents of the specified data source.
    When the AnyVolumeDataSource feature gate is enabled, dataSource contents will be copied to dataSourceRef,
    and dataSourceRef contents will be copied to dataSource when dataSourceRef.namespace is not specified.
    If the namespace is specified, then dataSourceRef will not be copied to dataSource.
    """
    data_source_ref: Annotated[Optional[DataSourceRef], Field(alias="dataSourceRef")] = None
    """
    dataSourceRef specifies the object from which to populate the volume with data, if a non-empty
    volume is desired. This may be any object from a non-empty API group (non
    core object) or a PersistentVolumeClaim object.
    When this field is specified, volume binding will only succeed if the type of
    the specified object matches some installed volume populator or dynamic
    provisioner.
    This field will replace the functionality of the dataSource field and as such
    if both fields are non-empty, they must have the same value. For backwards
    compatibility, when namespace isn't specified in dataSourceRef,
    both fields (dataSource and dataSourceRef) will be set to the same
    value automatically if one of them is empty and the other is non-empty.
    When namespace is specified in dataSourceRef,
    dataSource isn't set to the same value and must be empty.
    There are three important differences between dataSource and dataSourceRef:
    * While dataSource only allows two specific types of objects, dataSourceRef
      allows any non-core object, as well as PersistentVolumeClaim objects.
    * While dataSource ignores disallowed values (dropping them), dataSourceRef
      preserves all values, and generates an error if a disallowed value is
      specified.
    * While dataSource only allows local objects, dataSourceRef allows objects
      in any namespaces.
    (Beta) Using this field requires the AnyVolumeDataSource feature gate to be enabled.
    (Alpha) Using the namespace field of dataSourceRef requires the CrossNamespaceVolumeDataSource feature gate to be enabled.
    """
    resources: Optional[ResourcesModel] = None
    """
    resources represents the minimum resources the volume should have.
    If RecoverVolumeExpansionFailure feature is enabled users are allowed to specify resource requirements
    that are lower than previous value but must still be higher than capacity recorded in the
    status field of the claim.
    More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#resources
    """
    selector: Optional[Selector] = None
    """
    selector is a label query over volumes to consider for binding.
    """
    storage_class_name: Annotated[Optional[str], Field(alias="storageClassName")] = None
    """
    storageClassName is the name of the StorageClass required by the claim.
    More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#class-1
    """
    volume_attributes_class_name: Annotated[
        Optional[str], Field(alias="volumeAttributesClassName")
    ] = None
    """
    volumeAttributesClassName may be used to set the VolumeAttributesClass used by this claim.
    If specified, the CSI driver will create or update the volume with the attributes defined
    in the corresponding VolumeAttributesClass. This has a different purpose than storageClassName,
    it can be changed after the claim is created. An empty string value means that no VolumeAttributesClass
    will be applied to the claim but it's not allowed to reset this field to empty string once it is set.
    If unspecified and the PersistentVolumeClaim is unbound, the default VolumeAttributesClass
    will be set by the persistentvolume controller if it exists.
    If the resource referred to by volumeAttributesClass does not exist, this PersistentVolumeClaim will be
    set to a Pending state, as reflected by the modifyVolumeStatus field, until such as a resource
    exists.
    More info: https://kubernetes.io/docs/concepts/storage/volume-attributes-classes/
    (Beta) Using this field requires the VolumeAttributesClass feature gate to be enabled (off by default).
    """
    volume_mode: Annotated[Optional[str], Field(alias="volumeMode")] = None
    """
    volumeMode defines what type of volume is required by the claim.
    Value of Filesystem is implied when not included in claim spec.
    """
    volume_name: Annotated[Optional[str], Field(alias="volumeName")] = None
    """
    volumeName is the binding reference to the PersistentVolume backing this claim.
    """


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

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

        @overload
        def metadata(
            self, value_or_callback: Optional[Metadata], /
        ) -> "VolumeClaimTemplate.Builder": ...

        @overload
        def metadata(
            self,
            value_or_callback: Callable[[Metadata.Builder], Metadata.Builder | Metadata],
            /,
        ) -> "VolumeClaimTemplate.Builder": ...

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

        def metadata(self, value_or_callback=None, /):
            """
            May contain labels and annotations that will be copied into the PVC
            when creating it. No other fields are allowed and will be rejected during
            validation.
            """
            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: Spec, /) -> "VolumeClaimTemplate.Builder": ...

        @overload
        def spec(
            self, value_or_callback: Callable[[Spec.Builder], Spec.Builder | Spec], /
        ) -> "VolumeClaimTemplate.Builder": ...

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

        def spec(self, value_or_callback=None, /):
            """
            The specification for the PersistentVolumeClaim. The entire content is
            copied unchanged into the PVC that gets created from this
            template. The same fields as in a PersistentVolumeClaim
            are also valid here.
            """
            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["VolumeClaimTemplate.Builder"]):
        def model_post_init(self, __context) -> None:
            self._builder = VolumeClaimTemplate.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 VolumeClaimTemplate."""
        return cls.BuilderContext()

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

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

    metadata: Optional[Metadata] = None
    """
    May contain labels and annotations that will be copied into the PVC
    when creating it. No other fields are allowed and will be rejected during
    validation.
    """
    spec: Spec
    """
    The specification for the PersistentVolumeClaim. The entire content is
    copied unchanged into the PVC that gets created from this
    template. The same fields as in a PersistentVolumeClaim
    are also valid here.
    """


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

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

        @overload
        def volume_claim_template(
            self, value_or_callback: Optional[VolumeClaimTemplate], /
        ) -> "Ephemeral.Builder": ...

        @overload
        def volume_claim_template(
            self,
            value_or_callback: Callable[
                [VolumeClaimTemplate.Builder],
                VolumeClaimTemplate.Builder | VolumeClaimTemplate,
            ],
            /,
        ) -> "Ephemeral.Builder": ...

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

        def volume_claim_template(self, value_or_callback=None, /):
            """
            Will be used to create a stand-alone PVC to provision the volume.
            The pod in which this EphemeralVolumeSource is embedded will be the
            owner of the PVC, i.e. the PVC will be deleted together with the
            pod.  The name of the PVC will be `<pod name>-<volume name>` where
            `<volume name>` is the name from the `PodSpec.Volumes` array
            entry. Pod validation will reject the pod if the concatenated name
            is not valid for a PVC (for example, too long).

            An existing PVC with that name that is not owned by the pod
            will *not* be used for the pod to avoid using an unrelated
            volume by mistake. Starting the pod is then blocked until
            the unrelated PVC is removed. If such a pre-created PVC is
            meant to be used by the pod, the PVC has to updated with an
            owner reference to the pod once the pod exists. Normally
            this should not be necessary, but it may be useful when
            manually reconstructing a broken cluster.

            This field is read-only and no changes will be made by Kubernetes
            to the PVC after it has been created.

            Required, must not be nil.
            """
            if self._in_context and value_or_callback is None:
                context = VolumeClaimTemplate.BuilderContext()
                context._parent_builder = self
                context._field_name = "volume_claim_template"
                return context

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

    class BuilderContext(BuilderContextBase["Ephemeral.Builder"]):
        def model_post_init(self, __context) -> None:
            self._builder = Ephemeral.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 Ephemeral."""
        return cls.BuilderContext()

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

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

    volume_claim_template: Annotated[
        Optional[VolumeClaimTemplate], Field(alias="volumeClaimTemplate")
    ] = None
    """
    Will be used to create a stand-alone PVC to provision the volume.
    The pod in which this EphemeralVolumeSource is embedded will be the
    owner of the PVC, i.e. the PVC will be deleted together with the
    pod.  The name of the PVC will be `<pod name>-<volume name>` where
    `<volume name>` is the name from the `PodSpec.Volumes` array
    entry. Pod validation will reject the pod if the concatenated name
    is not valid for a PVC (for example, too long).

    An existing PVC with that name that is not owned by the pod
    will *not* be used for the pod to avoid using an unrelated
    volume by mistake. Starting the pod is then blocked until
    the unrelated PVC is removed. If such a pre-created PVC is
    meant to be used by the pod, the PVC has to updated with an
    owner reference to the pod once the pod exists. Normally
    this should not be necessary, but it may be useful when
    manually reconstructing a broken cluster.

    This field is read-only and no changes will be made by Kubernetes
    to the PVC after it has been created.

    Required, must not be nil.
    """


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

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

        def fs_type(self, value: Optional[str], /) -> Self:
            """
            fsType is the filesystem type to mount.
            Must be a filesystem type supported by the host operating system.
            Ex. "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified.
            """
            return self._set("fs_type", value)

        def lun(self, value: Optional[int], /) -> Self:
            """
            lun is Optional: FC target lun number
            """
            return self._set("lun", value)

        def read_only(self, value: Optional[bool], /) -> Self:
            """
            readOnly is Optional: Defaults to false (read/write). ReadOnly here will force
            the ReadOnly setting in VolumeMounts.
            """
            return self._set("read_only", value)

        def target_ww_ns(self, value: Optional[List[str]], /) -> Self:
            """
            targetWWNs is Optional: FC target worldwide names (WWNs)
            """
            return self._set("target_ww_ns", value)

        def wwids(self, value: Optional[List[str]], /) -> Self:
            """
            wwids Optional: FC volume world wide identifiers (wwids)
            Either wwids or combination of targetWWNs and lun must be set, but not both simultaneously.
            """
            return self._set("wwids", value)

    class BuilderContext(BuilderContextBase["Fc.Builder"]):
        def model_post_init(self, __context) -> None:
            self._builder = Fc.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 Fc."""
        return cls.BuilderContext()

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

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

    fs_type: Annotated[Optional[str], Field(alias="fsType")] = None
    """
    fsType is the filesystem type to mount.
    Must be a filesystem type supported by the host operating system.
    Ex. "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified.
    """
    lun: Optional[int] = None
    """
    lun is Optional: FC target lun number
    """
    read_only: Annotated[Optional[bool], Field(alias="readOnly")] = None
    """
    readOnly is Optional: Defaults to false (read/write). ReadOnly here will force
    the ReadOnly setting in VolumeMounts.
    """
    target_ww_ns: Annotated[Optional[List[str]], Field(alias="targetWWNs")] = None
    """
    targetWWNs is Optional: FC target worldwide names (WWNs)
    """
    wwids: Optional[List[str]] = None
    """
    wwids Optional: FC volume world wide identifiers (wwids)
    Either wwids or combination of targetWWNs and lun must be set, but not both simultaneously.
    """


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

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

        def driver(self, value: str, /) -> Self:
            """
            driver is the name of the driver to use for this volume.
            """
            return self._set("driver", value)

        def fs_type(self, value: Optional[str], /) -> Self:
            """
            fsType is the filesystem type to mount.
            Must be a filesystem type supported by the host operating system.
            Ex. "ext4", "xfs", "ntfs". The default filesystem depends on FlexVolume script.
            """
            return self._set("fs_type", value)

        def options(self, value: Optional[Dict[str, str]], /) -> Self:
            """
            options is Optional: this field holds extra command options if any.
            """
            return self._set("options", value)

        def read_only(self, value: Optional[bool], /) -> Self:
            """
            readOnly is Optional: defaults to false (read/write). ReadOnly here will force
            the ReadOnly setting in VolumeMounts.
            """
            return self._set("read_only", value)

        @overload
        def secret_ref(
            self, value_or_callback: Optional[SecretRefModel], /
        ) -> "FlexVolume.Builder": ...

        @overload
        def secret_ref(
            self,
            value_or_callback: Callable[
                [SecretRefModel.Builder], SecretRefModel.Builder | SecretRefModel
            ],
            /,
        ) -> "FlexVolume.Builder": ...

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

        def secret_ref(self, value_or_callback=None, /):
            """
            secretRef is Optional: secretRef is reference to the secret object containing
            sensitive information to pass to the plugin scripts. This may be
            empty if no secret object is specified. If the secret object
            contains more than one secret, all secrets are passed to the plugin
            scripts.
            """
            if self._in_context and value_or_callback is None:
                context = SecretRefModel.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(SecretRefModel.builder())
                if isinstance(output, SecretRefModel.Builder):
                    value = output.build()
                else:
                    value = output
            return self._set("secret_ref", value)

    class BuilderContext(BuilderContextBase["FlexVolume.Builder"]):
        def model_post_init(self, __context) -> None:
            self._builder = FlexVolume.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 FlexVolume."""
        return cls.BuilderContext()

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

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

    driver: str
    """
    driver is the name of the driver to use for this volume.
    """
    fs_type: Annotated[Optional[str], Field(alias="fsType")] = None
    """
    fsType is the filesystem type to mount.
    Must be a filesystem type supported by the host operating system.
    Ex. "ext4", "xfs", "ntfs". The default filesystem depends on FlexVolume script.
    """
    options: Optional[Dict[str, str]] = None
    """
    options is Optional: this field holds extra command options if any.
    """
    read_only: Annotated[Optional[bool], Field(alias="readOnly")] = None
    """
    readOnly is Optional: defaults to false (read/write). ReadOnly here will force
    the ReadOnly setting in VolumeMounts.
    """
    secret_ref: Annotated[Optional[SecretRefModel], Field(alias="secretRef")] = None
    """
    secretRef is Optional: secretRef is reference to the secret object containing
    sensitive information to pass to the plugin scripts. This may be
    empty if no secret object is specified. If the secret object
    contains more than one secret, all secrets are passed to the plugin
    scripts.
    """


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

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

        def dataset_name(self, value: Optional[str], /) -> Self:
            """
            datasetName is Name of the dataset stored as metadata -> name on the dataset for Flocker
            should be considered as deprecated
            """
            return self._set("dataset_name", value)

        def dataset_uuid(self, value: Optional[str], /) -> Self:
            """
            datasetUUID is the UUID of the dataset. This is unique identifier of a Flocker dataset
            """
            return self._set("dataset_uuid", value)

    class BuilderContext(BuilderContextBase["Flocker.Builder"]):
        def model_post_init(self, __context) -> None:
            self._builder = Flocker.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 Flocker."""
        return cls.BuilderContext()

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

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

    dataset_name: Annotated[Optional[str], Field(alias="datasetName")] = None
    """
    datasetName is Name of the dataset stored as metadata -> name on the dataset for Flocker
    should be considered as deprecated
    """
    dataset_uuid: Annotated[Optional[str], Field(alias="datasetUUID")] = None
    """
    datasetUUID is the UUID of the dataset. This is unique identifier of a Flocker dataset
    """


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

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

        def fs_type(self, value: Optional[str], /) -> Self:
            """
            fsType is filesystem type of the volume that you want to mount.
            Tip: Ensure that the filesystem type is supported by the host operating system.
            Examples: "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified.
            More info: https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk
            """
            return self._set("fs_type", value)

        def partition(self, value: Optional[int], /) -> Self:
            """
            partition is the partition in the volume that you want to mount.
            If omitted, the default is to mount by volume name.
            Examples: For volume /dev/sda1, you specify the partition as "1".
            Similarly, the volume partition for /dev/sda is "0" (or you can leave the property empty).
            More info: https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk
            """
            return self._set("partition", value)

        def pd_name(self, value: str, /) -> Self:
            """
            pdName is unique name of the PD resource in GCE. Used to identify the disk in GCE.
            More info: https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk
            """
            return self._set("pd_name", value)

        def read_only(self, value: Optional[bool], /) -> Self:
            """
            readOnly here will force the ReadOnly setting in VolumeMounts.
            Defaults to false.
            More info: https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk
            """
            return self._set("read_only", value)

    class BuilderContext(BuilderContextBase["GcePersistentDisk.Builder"]):
        def model_post_init(self, __context) -> None:
            self._builder = GcePersistentDisk.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 GcePersistentDisk."""
        return cls.BuilderContext()

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

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

    fs_type: Annotated[Optional[str], Field(alias="fsType")] = None
    """
    fsType is filesystem type of the volume that you want to mount.
    Tip: Ensure that the filesystem type is supported by the host operating system.
    Examples: "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified.
    More info: https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk
    """
    partition: Optional[int] = None
    """
    partition is the partition in the volume that you want to mount.
    If omitted, the default is to mount by volume name.
    Examples: For volume /dev/sda1, you specify the partition as "1".
    Similarly, the volume partition for /dev/sda is "0" (or you can leave the property empty).
    More info: https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk
    """
    pd_name: Annotated[str, Field(alias="pdName")]
    """
    pdName is unique name of the PD resource in GCE. Used to identify the disk in GCE.
    More info: https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk
    """
    read_only: Annotated[Optional[bool], Field(alias="readOnly")] = None
    """
    readOnly here will force the ReadOnly setting in VolumeMounts.
    Defaults to false.
    More info: https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk
    """


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

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

        def directory(self, value: Optional[str], /) -> Self:
            """
            directory is the target directory name.
            Must not contain or start with '..'.  If '.' is supplied, the volume directory will be the
            git repository.  Otherwise, if specified, the volume will contain the git repository in
            the subdirectory with the given name.
            """
            return self._set("directory", value)

        def repository(self, value: str, /) -> Self:
            """
            repository is the URL
            """
            return self._set("repository", value)

        def revision(self, value: Optional[str], /) -> Self:
            """
            revision is the commit hash for the specified revision.
            """
            return self._set("revision", value)

    class BuilderContext(BuilderContextBase["GitRepo.Builder"]):
        def model_post_init(self, __context) -> None:
            self._builder = GitRepo.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 GitRepo."""
        return cls.BuilderContext()

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

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

    directory: Optional[str] = None
    """
    directory is the target directory name.
    Must not contain or start with '..'.  If '.' is supplied, the volume directory will be the
    git repository.  Otherwise, if specified, the volume will contain the git repository in
    the subdirectory with the given name.
    """
    repository: str
    """
    repository is the URL
    """
    revision: Optional[str] = None
    """
    revision is the commit hash for the specified revision.
    """


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

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

        def endpoints(self, value: str, /) -> Self:
            """
            endpoints is the endpoint name that details Glusterfs topology.
            More info: https://examples.k8s.io/volumes/glusterfs/README.md#create-a-pod
            """
            return self._set("endpoints", value)

        def path(self, value: str, /) -> Self:
            """
            path is the Glusterfs volume path.
            More info: https://examples.k8s.io/volumes/glusterfs/README.md#create-a-pod
            """
            return self._set("path", value)

        def read_only(self, value: Optional[bool], /) -> Self:
            """
            readOnly here will force the Glusterfs volume to be mounted with read-only permissions.
            Defaults to false.
            More info: https://examples.k8s.io/volumes/glusterfs/README.md#create-a-pod
            """
            return self._set("read_only", value)

    class BuilderContext(BuilderContextBase["Glusterfs.Builder"]):
        def model_post_init(self, __context) -> None:
            self._builder = Glusterfs.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 Glusterfs."""
        return cls.BuilderContext()

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

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

    endpoints: str
    """
    endpoints is the endpoint name that details Glusterfs topology.
    More info: https://examples.k8s.io/volumes/glusterfs/README.md#create-a-pod
    """
    path: str
    """
    path is the Glusterfs volume path.
    More info: https://examples.k8s.io/volumes/glusterfs/README.md#create-a-pod
    """
    read_only: Annotated[Optional[bool], Field(alias="readOnly")] = None
    """
    readOnly here will force the Glusterfs volume to be mounted with read-only permissions.
    Defaults to false.
    More info: https://examples.k8s.io/volumes/glusterfs/README.md#create-a-pod
    """


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

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

        def path(self, value: str, /) -> Self:
            """
            path of the directory on the host.
            If the path is a symlink, it will follow the link to the real path.
            More info: https://kubernetes.io/docs/concepts/storage/volumes#hostpath
            """
            return self._set("path", value)

        def type(self, value: Optional[str], /) -> Self:
            """
            type for HostPath Volume
            Defaults to ""
            More info: https://kubernetes.io/docs/concepts/storage/volumes#hostpath
            """
            return self._set("type", value)

    class BuilderContext(BuilderContextBase["HostPath.Builder"]):
        def model_post_init(self, __context) -> None:
            self._builder = HostPath.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 HostPath."""
        return cls.BuilderContext()

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

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

    path: str
    """
    path of the directory on the host.
    If the path is a symlink, it will follow the link to the real path.
    More info: https://kubernetes.io/docs/concepts/storage/volumes#hostpath
    """
    type: Optional[str] = None
    """
    type for HostPath Volume
    Defaults to ""
    More info: https://kubernetes.io/docs/concepts/storage/volumes#hostpath
    """


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

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

        def pull_policy(self, value: Optional[str], /) -> Self:
            """
            Policy for pulling OCI objects. Possible values are:
            Always: the kubelet always attempts to pull the reference. Container creation will fail If the pull fails.
            Never: the kubelet never pulls the reference and only uses a local image or artifact. Container creation will fail if the reference isn't present.
            IfNotPresent: the kubelet pulls if the reference isn't already present on disk. Container creation will fail if the reference isn't present and the pull fails.
            Defaults to Always if :latest tag is specified, or IfNotPresent otherwise.
            """
            return self._set("pull_policy", value)

        def reference(self, value: Optional[str], /) -> Self:
            """
            Required: Image or artifact reference to be used.
            Behaves in the same way as pod.spec.containers[*].image.
            Pull secrets will be assembled in the same way as for the container image by looking up node credentials, SA image pull secrets, and pod spec image pull secrets.
            More info: https://kubernetes.io/docs/concepts/containers/images
            This field is optional to allow higher level config management to default or override
            container images in workload controllers like Deployments and StatefulSets.
            """
            return self._set("reference", value)

    class BuilderContext(BuilderContextBase["Image.Builder"]):
        def model_post_init(self, __context) -> None:
            self._builder = Image.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 Image."""
        return cls.BuilderContext()

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

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

    pull_policy: Annotated[Optional[str], Field(alias="pullPolicy")] = None
    """
    Policy for pulling OCI objects. Possible values are:
    Always: the kubelet always attempts to pull the reference. Container creation will fail If the pull fails.
    Never: the kubelet never pulls the reference and only uses a local image or artifact. Container creation will fail if the reference isn't present.
    IfNotPresent: the kubelet pulls if the reference isn't already present on disk. Container creation will fail if the reference isn't present and the pull fails.
    Defaults to Always if :latest tag is specified, or IfNotPresent otherwise.
    """
    reference: Optional[str] = None
    """
    Required: Image or artifact reference to be used.
    Behaves in the same way as pod.spec.containers[*].image.
    Pull secrets will be assembled in the same way as for the container image by looking up node credentials, SA image pull secrets, and pod spec image pull secrets.
    More info: https://kubernetes.io/docs/concepts/containers/images
    This field is optional to allow higher level config management to default or override
    container images in workload controllers like Deployments and StatefulSets.
    """


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

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

        def chap_auth_discovery(self, value: Optional[bool], /) -> Self:
            """
            chapAuthDiscovery defines whether support iSCSI Discovery CHAP authentication
            """
            return self._set("chap_auth_discovery", value)

        def chap_auth_session(self, value: Optional[bool], /) -> Self:
            """
            chapAuthSession defines whether support iSCSI Session CHAP authentication
            """
            return self._set("chap_auth_session", value)

        def fs_type(self, value: Optional[str], /) -> Self:
            """
            fsType is the filesystem type of the volume that you want to mount.
            Tip: Ensure that the filesystem type is supported by the host operating system.
            Examples: "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified.
            More info: https://kubernetes.io/docs/concepts/storage/volumes#iscsi
            """
            return self._set("fs_type", value)

        def initiator_name(self, value: Optional[str], /) -> Self:
            """
            initiatorName is the custom iSCSI Initiator Name.
            If initiatorName is specified with iscsiInterface simultaneously, new iSCSI interface
            <target portal>:<volume name> will be created for the connection.
            """
            return self._set("initiator_name", value)

        def iqn(self, value: str, /) -> Self:
            """
            iqn is the target iSCSI Qualified Name.
            """
            return self._set("iqn", value)

        def iscsi_interface(self, value: Optional[str], /) -> Self:
            """
            iscsiInterface is the interface Name that uses an iSCSI transport.
            Defaults to 'default' (tcp).
            """
            return self._set("iscsi_interface", value)

        def lun(self, value: int, /) -> Self:
            """
            lun represents iSCSI Target Lun number.
            """
            return self._set("lun", value)

        def portals(self, value: Optional[List[str]], /) -> Self:
            """
            portals is the iSCSI Target Portal List. The portal is either an IP or ip_addr:port if the port
            is other than default (typically TCP ports 860 and 3260).
            """
            return self._set("portals", value)

        def read_only(self, value: Optional[bool], /) -> Self:
            """
            readOnly here will force the ReadOnly setting in VolumeMounts.
            Defaults to false.
            """
            return self._set("read_only", value)

        @overload
        def secret_ref(self, value_or_callback: Optional[SecretRefModel], /) -> "Iscsi.Builder": ...

        @overload
        def secret_ref(
            self,
            value_or_callback: Callable[
                [SecretRefModel.Builder], SecretRefModel.Builder | SecretRefModel
            ],
            /,
        ) -> "Iscsi.Builder": ...

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

        def secret_ref(self, value_or_callback=None, /):
            """
            secretRef is the CHAP Secret for iSCSI target and initiator authentication
            """
            if self._in_context and value_or_callback is None:
                context = SecretRefModel.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(SecretRefModel.builder())
                if isinstance(output, SecretRefModel.Builder):
                    value = output.build()
                else:
                    value = output
            return self._set("secret_ref", value)

        def target_portal(self, value: str, /) -> Self:
            """
            targetPortal is iSCSI Target Portal. The Portal is either an IP or ip_addr:port if the port
            is other than default (typically TCP ports 860 and 3260).
            """
            return self._set("target_portal", value)

    class BuilderContext(BuilderContextBase["Iscsi.Builder"]):
        def model_post_init(self, __context) -> None:
            self._builder = Iscsi.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 Iscsi."""
        return cls.BuilderContext()

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

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

    chap_auth_discovery: Annotated[Optional[bool], Field(alias="chapAuthDiscovery")] = None
    """
    chapAuthDiscovery defines whether support iSCSI Discovery CHAP authentication
    """
    chap_auth_session: Annotated[Optional[bool], Field(alias="chapAuthSession")] = None
    """
    chapAuthSession defines whether support iSCSI Session CHAP authentication
    """
    fs_type: Annotated[Optional[str], Field(alias="fsType")] = None
    """
    fsType is the filesystem type of the volume that you want to mount.
    Tip: Ensure that the filesystem type is supported by the host operating system.
    Examples: "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified.
    More info: https://kubernetes.io/docs/concepts/storage/volumes#iscsi
    """
    initiator_name: Annotated[Optional[str], Field(alias="initiatorName")] = None
    """
    initiatorName is the custom iSCSI Initiator Name.
    If initiatorName is specified with iscsiInterface simultaneously, new iSCSI interface
    <target portal>:<volume name> will be created for the connection.
    """
    iqn: str
    """
    iqn is the target iSCSI Qualified Name.
    """
    iscsi_interface: Annotated[Optional[str], Field(alias="iscsiInterface")] = "default"
    """
    iscsiInterface is the interface Name that uses an iSCSI transport.
    Defaults to 'default' (tcp).
    """
    lun: int
    """
    lun represents iSCSI Target Lun number.
    """
    portals: Optional[List[str]] = None
    """
    portals is the iSCSI Target Portal List. The portal is either an IP or ip_addr:port if the port
    is other than default (typically TCP ports 860 and 3260).
    """
    read_only: Annotated[Optional[bool], Field(alias="readOnly")] = None
    """
    readOnly here will force the ReadOnly setting in VolumeMounts.
    Defaults to false.
    """
    secret_ref: Annotated[Optional[SecretRefModel], Field(alias="secretRef")] = None
    """
    secretRef is the CHAP Secret for iSCSI target and initiator authentication
    """
    target_portal: Annotated[str, Field(alias="targetPortal")]
    """
    targetPortal is iSCSI Target Portal. The Portal is either an IP or ip_addr:port if the port
    is other than default (typically TCP ports 860 and 3260).
    """


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

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

        def path(self, value: str, /) -> Self:
            """
            path that is exported by the NFS server.
            More info: https://kubernetes.io/docs/concepts/storage/volumes#nfs
            """
            return self._set("path", value)

        def read_only(self, value: Optional[bool], /) -> Self:
            """
            readOnly here will force the NFS export to be mounted with read-only permissions.
            Defaults to false.
            More info: https://kubernetes.io/docs/concepts/storage/volumes#nfs
            """
            return self._set("read_only", value)

        def server(self, value: str, /) -> Self:
            """
            server is the hostname or IP address of the NFS server.
            More info: https://kubernetes.io/docs/concepts/storage/volumes#nfs
            """
            return self._set("server", value)

    class BuilderContext(BuilderContextBase["Nfs.Builder"]):
        def model_post_init(self, __context) -> None:
            self._builder = Nfs.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 Nfs."""
        return cls.BuilderContext()

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

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

    path: str
    """
    path that is exported by the NFS server.
    More info: https://kubernetes.io/docs/concepts/storage/volumes#nfs
    """
    read_only: Annotated[Optional[bool], Field(alias="readOnly")] = None
    """
    readOnly here will force the NFS export to be mounted with read-only permissions.
    Defaults to false.
    More info: https://kubernetes.io/docs/concepts/storage/volumes#nfs
    """
    server: str
    """
    server is the hostname or IP address of the NFS server.
    More info: https://kubernetes.io/docs/concepts/storage/volumes#nfs
    """


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

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

        def claim_name(self, value: str, /) -> Self:
            """
            claimName is the name of a PersistentVolumeClaim in the same namespace as the pod using this volume.
            More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#persistentvolumeclaims
            """
            return self._set("claim_name", value)

        def read_only(self, value: Optional[bool], /) -> Self:
            """
            readOnly Will force the ReadOnly setting in VolumeMounts.
            Default false.
            """
            return self._set("read_only", value)

    class BuilderContext(BuilderContextBase["PersistentVolumeClaim.Builder"]):
        def model_post_init(self, __context) -> None:
            self._builder = PersistentVolumeClaim.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 PersistentVolumeClaim."""
        return cls.BuilderContext()

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

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

    claim_name: Annotated[str, Field(alias="claimName")]
    """
    claimName is the name of a PersistentVolumeClaim in the same namespace as the pod using this volume.
    More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#persistentvolumeclaims
    """
    read_only: Annotated[Optional[bool], Field(alias="readOnly")] = None
    """
    readOnly Will force the ReadOnly setting in VolumeMounts.
    Default false.
    """


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

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

        def fs_type(self, value: Optional[str], /) -> Self:
            """
            fsType is the filesystem type to mount.
            Must be a filesystem type supported by the host operating system.
            Ex. "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified.
            """
            return self._set("fs_type", value)

        def pd_id(self, value: str, /) -> Self:
            """
            pdID is the ID that identifies Photon Controller persistent disk
            """
            return self._set("pd_id", value)

    class BuilderContext(BuilderContextBase["PhotonPersistentDisk.Builder"]):
        def model_post_init(self, __context) -> None:
            self._builder = PhotonPersistentDisk.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 PhotonPersistentDisk."""
        return cls.BuilderContext()

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

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

    fs_type: Annotated[Optional[str], Field(alias="fsType")] = None
    """
    fsType is the filesystem type to mount.
    Must be a filesystem type supported by the host operating system.
    Ex. "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified.
    """
    pd_id: Annotated[str, Field(alias="pdID")]
    """
    pdID is the ID that identifies Photon Controller persistent disk
    """


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

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

        def fs_type(self, value: Optional[str], /) -> Self:
            """
            fSType represents the filesystem type to mount
            Must be a filesystem type supported by the host operating system.
            Ex. "ext4", "xfs". Implicitly inferred to be "ext4" if unspecified.
            """
            return self._set("fs_type", value)

        def read_only(self, value: Optional[bool], /) -> Self:
            """
            readOnly defaults to false (read/write). ReadOnly here will force
            the ReadOnly setting in VolumeMounts.
            """
            return self._set("read_only", value)

        def volume_id(self, value: str, /) -> Self:
            """
            volumeID uniquely identifies a Portworx volume
            """
            return self._set("volume_id", value)

    class BuilderContext(BuilderContextBase["PortworxVolume.Builder"]):
        def model_post_init(self, __context) -> None:
            self._builder = PortworxVolume.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 PortworxVolume."""
        return cls.BuilderContext()

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

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

    fs_type: Annotated[Optional[str], Field(alias="fsType")] = None
    """
    fSType represents the filesystem type to mount
    Must be a filesystem type supported by the host operating system.
    Ex. "ext4", "xfs". Implicitly inferred to be "ext4" if unspecified.
    """
    read_only: Annotated[Optional[bool], Field(alias="readOnly")] = None
    """
    readOnly defaults to false (read/write). ReadOnly here will force
    the ReadOnly setting in VolumeMounts.
    """
    volume_id: Annotated[str, Field(alias="volumeID")]
    """
    volumeID uniquely identifies a Portworx volume
    """


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

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

        @overload
        def label_selector(
            self, value_or_callback: Optional[LabelSelector], /
        ) -> "ClusterTrustBundle.Builder": ...

        @overload
        def label_selector(
            self,
            value_or_callback: Callable[
                [LabelSelector.Builder], LabelSelector.Builder | LabelSelector
            ],
            /,
        ) -> "ClusterTrustBundle.Builder": ...

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

        def label_selector(self, value_or_callback=None, /):
            """
            Select all ClusterTrustBundles that match this label selector.  Only has
            effect if signerName is set.  Mutually-exclusive with name.  If unset,
            interpreted as "match nothing".  If set but empty, interpreted as "match
            everything".
            """
            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 name(self, value: Optional[str], /) -> Self:
            """
            Select a single ClusterTrustBundle by object name.  Mutually-exclusive
            with signerName and labelSelector.
            """
            return self._set("name", value)

        def optional(self, value: Optional[bool], /) -> Self:
            """
            If true, don't block pod startup if the referenced ClusterTrustBundle(s)
            aren't available.  If using name, then the named ClusterTrustBundle is
            allowed not to exist.  If using signerName, then the combination of
            signerName and labelSelector is allowed to match zero
            ClusterTrustBundles.
            """
            return self._set("optional", value)

        def path(self, value: str, /) -> Self:
            """
            Relative path from the volume root to write the bundle.
            """
            return self._set("path", value)

        def signer_name(self, value: Optional[str], /) -> Self:
            """
            Select all ClusterTrustBundles that match this signer name.
            Mutually-exclusive with name.  The contents of all selected
            ClusterTrustBundles will be unified and deduplicated.
            """
            return self._set("signer_name", value)

    class BuilderContext(BuilderContextBase["ClusterTrustBundle.Builder"]):
        def model_post_init(self, __context) -> None:
            self._builder = ClusterTrustBundle.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 ClusterTrustBundle."""
        return cls.BuilderContext()

    class ListBuilder(GenericListBuilder["ClusterTrustBundle", Builder]):
        def __init__(self):
            raise NotImplementedError(
                "This class is not meant to be instantiated. Use ClusterTrustBundle.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
    """
    Select all ClusterTrustBundles that match this label selector.  Only has
    effect if signerName is set.  Mutually-exclusive with name.  If unset,
    interpreted as "match nothing".  If set but empty, interpreted as "match
    everything".
    """
    name: Optional[str] = None
    """
    Select a single ClusterTrustBundle by object name.  Mutually-exclusive
    with signerName and labelSelector.
    """
    optional: Optional[bool] = None
    """
    If true, don't block pod startup if the referenced ClusterTrustBundle(s)
    aren't available.  If using name, then the named ClusterTrustBundle is
    allowed not to exist.  If using signerName, then the combination of
    signerName and labelSelector is allowed to match zero
    ClusterTrustBundles.
    """
    path: str
    """
    Relative path from the volume root to write the bundle.
    """
    signer_name: Annotated[Optional[str], Field(alias="signerName")] = None
    """
    Select all ClusterTrustBundles that match this signer name.
    Mutually-exclusive with name.  The contents of all selected
    ClusterTrustBundles will be unified and deduplicated.
    """


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

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

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

        def mode(self, value: Optional[int], /) -> Self:
            """
            mode is Optional: mode bits used to set permissions on this file.
            Must be an octal value between 0000 and 0777 or a decimal value between 0 and 511.
            YAML accepts both octal and decimal values, JSON requires decimal values for mode bits.
            If not specified, the volume defaultMode will be used.
            This might be in conflict with other options that affect the file
            mode, like fsGroup, and the result can be other mode bits set.
            """
            return self._set("mode", value)

        def path(self, value: str, /) -> Self:
            """
            path is the relative path of the file to map the key to.
            May not be an absolute path.
            May not contain the path element '..'.
            May not start with the string '..'.
            """
            return self._set("path", value)

    class BuilderContext(BuilderContextBase["ItemModel1.Builder"]):
        def model_post_init(self, __context) -> None:
            self._builder = ItemModel1.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 ItemModel1."""
        return cls.BuilderContext()

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

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

    key: str
    """
    key is the key to project.
    """
    mode: Optional[int] = None
    """
    mode is Optional: mode bits used to set permissions on this file.
    Must be an octal value between 0000 and 0777 or a decimal value between 0 and 511.
    YAML accepts both octal and decimal values, JSON requires decimal values for mode bits.
    If not specified, the volume defaultMode will be used.
    This might be in conflict with other options that affect the file
    mode, like fsGroup, and the result can be other mode bits set.
    """
    path: str
    """
    path is the relative path of the file to map the key to.
    May not be an absolute path.
    May not contain the path element '..'.
    May not start with the string '..'.
    """


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

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

        @overload
        def items(self, value_or_callback: List[ItemModel1], /) -> "ConfigMapModel.Builder": ...

        @overload
        def items(
            self,
            value_or_callback: Callable[
                [GenericListBuilder[ItemModel1, ItemModel1.Builder]],
                GenericListBuilder[ItemModel1, ItemModel1.Builder] | List[ItemModel1],
            ],
            /,
        ) -> "ConfigMapModel.Builder": ...

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

        def items(self, value_or_callback=None, /):
            """
            items if unspecified, each key-value pair in the Data field of the referenced
            ConfigMap will be projected into the volume as a file whose name is the
            key and content is the value. If specified, the listed keys will be
            projected into the specified paths, and unlisted keys will not be
            present. If a key is specified which is not present in the ConfigMap,
            the volume setup will error unless it is marked optional. Paths must be
            relative and may not contain the '..' path or start with '..'.
            """
            if self._in_context and value_or_callback is None:
                context = ListBuilderContext[ItemModel1.Builder]()
                context._parent_builder = self
                context._field_name = "items"
                return context

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

        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)

        def optional(self, value: Optional[bool], /) -> Self:
            """
            optional specify whether the ConfigMap or its keys must be defined
            """
            return self._set("optional", value)

    class BuilderContext(BuilderContextBase["ConfigMapModel.Builder"]):
        def model_post_init(self, __context) -> None:
            self._builder = ConfigMapModel.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 ConfigMapModel."""
        return cls.BuilderContext()

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

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

    items: Optional[List[ItemModel1]] = None
    """
    items if unspecified, each key-value pair in the Data field of the referenced
    ConfigMap will be projected into the volume as a file whose name is the
    key and content is the value. If specified, the listed keys will be
    projected into the specified paths, and unlisted keys will not be
    present. If a key is specified which is not present in the ConfigMap,
    the volume setup will error unless it is marked optional. Paths must be
    relative and may not contain the '..' path or start with '..'.
    """
    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
    """
    optional: Optional[bool] = None
    """
    optional specify whether the ConfigMap or its keys must be defined
    """


class DivisorModel7(RootModel[int]):
    class Builder(BaseBuilder):
        _value: int | None = None

        def root(self, value: int, /) -> Self:
            """
            Specifies the output format of the exposed resources, defaults to "1"
            """
            self._value = value
            return self

        def __call__(self, value: int, /) -> Self:
            """
            Specifies the output format of the exposed resources, defaults to "1"
            """
            self._value = value
            return self

        def build(self) -> "DivisorModel7":
            value = cast(int, self._value)
            return DivisorModel7(value)

    root: Annotated[
        int,
        Field(
            pattern="^(\\+|-)?(([0-9]+(\\.[0-9]*)?)|(\\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\\+|-)?(([0-9]+(\\.[0-9]*)?)|(\\.[0-9]+))))?$"
        ),
    ]
    """
    Specifies the output format of the exposed resources, defaults to "1"
    """

    class BuilderContext(BuilderContextBase["DivisorModel7.Builder"]):
        def model_post_init(self, __context) -> None:
            self._builder = DivisorModel7.Builder()
            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 DivisorModel7."""
        return cls.BuilderContext()


class DivisorModel8(RootModel[str]):
    class Builder(BaseBuilder):
        _value: str | None = None

        def root(self, value: str, /) -> Self:
            """
            Specifies the output format of the exposed resources, defaults to "1"
            """
            self._value = value
            return self

        def __call__(self, value: str, /) -> Self:
            """
            Specifies the output format of the exposed resources, defaults to "1"
            """
            self._value = value
            return self

        def build(self) -> "DivisorModel8":
            value = cast(str, self._value)
            return DivisorModel8(value)

    root: Annotated[
        str,
        Field(
            pattern="^(\\+|-)?(([0-9]+(\\.[0-9]*)?)|(\\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\\+|-)?(([0-9]+(\\.[0-9]*)?)|(\\.[0-9]+))))?$"
        ),
    ]
    """
    Specifies the output format of the exposed resources, defaults to "1"
    """

    class BuilderContext(BuilderContextBase["DivisorModel8.Builder"]):
        def model_post_init(self, __context) -> None:
            self._builder = DivisorModel8.Builder()
            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 DivisorModel8."""
        return cls.BuilderContext()


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

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

        @overload
        def field_ref(self, value_or_callback: Optional[FieldRef], /) -> "ItemModel2.Builder": ...

        @overload
        def field_ref(
            self,
            value_or_callback: Callable[[FieldRef.Builder], FieldRef.Builder | FieldRef],
            /,
        ) -> "ItemModel2.Builder": ...

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

        def field_ref(self, value_or_callback=None, /):
            """
            Required: Selects a field of the pod: only annotations, labels, name, namespace and uid are supported.
            """
            if self._in_context and value_or_callback is None:
                context = FieldRef.BuilderContext()
                context._parent_builder = self
                context._field_name = "field_ref"
                return context

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

        def mode(self, value: Optional[int], /) -> Self:
            """
            Optional: mode bits used to set permissions on this file, must be an octal value
            between 0000 and 0777 or a decimal value between 0 and 511.
            YAML accepts both octal and decimal values, JSON requires decimal values for mode bits.
            If not specified, the volume defaultMode will be used.
            This might be in conflict with other options that affect the file
            mode, like fsGroup, and the result can be other mode bits set.
            """
            return self._set("mode", value)

        def path(self, value: str, /) -> Self:
            """
            Required: Path is  the relative path name of the file to be created. Must not be absolute or contain the '..' path. Must be utf-8 encoded. The first item of the relative path must not start with '..'
            """
            return self._set("path", value)

        @overload
        def resource_field_ref(
            self, value_or_callback: Optional[ResourceFieldRef], /
        ) -> "ItemModel2.Builder": ...

        @overload
        def resource_field_ref(
            self,
            value_or_callback: Callable[
                [ResourceFieldRef.Builder], ResourceFieldRef.Builder | ResourceFieldRef
            ],
            /,
        ) -> "ItemModel2.Builder": ...

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

        def resource_field_ref(self, value_or_callback=None, /):
            """
            Selects a resource of the container: only resources limits and requests
            (limits.cpu, limits.memory, requests.cpu and requests.memory) are currently supported.
            """
            if self._in_context and value_or_callback is None:
                context = ResourceFieldRef.BuilderContext()
                context._parent_builder = self
                context._field_name = "resource_field_ref"
                return context

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

    class BuilderContext(BuilderContextBase["ItemModel2.Builder"]):
        def model_post_init(self, __context) -> None:
            self._builder = ItemModel2.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 ItemModel2."""
        return cls.BuilderContext()

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

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

    field_ref: Annotated[Optional[FieldRef], Field(alias="fieldRef")] = None
    """
    Required: Selects a field of the pod: only annotations, labels, name, namespace and uid are supported.
    """
    mode: Optional[int] = None
    """
    Optional: mode bits used to set permissions on this file, must be an octal value
    between 0000 and 0777 or a decimal value between 0 and 511.
    YAML accepts both octal and decimal values, JSON requires decimal values for mode bits.
    If not specified, the volume defaultMode will be used.
    This might be in conflict with other options that affect the file
    mode, like fsGroup, and the result can be other mode bits set.
    """
    path: str
    """
    Required: Path is  the relative path name of the file to be created. Must not be absolute or contain the '..' path. Must be utf-8 encoded. The first item of the relative path must not start with '..'
    """
    resource_field_ref: Annotated[Optional[ResourceFieldRef], Field(alias="resourceFieldRef")] = (
        None
    )
    """
    Selects a resource of the container: only resources limits and requests
    (limits.cpu, limits.memory, requests.cpu and requests.memory) are currently supported.
    """


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

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

        @overload
        def items(self, value_or_callback: List[ItemModel2], /) -> "DownwardApiModel.Builder": ...

        @overload
        def items(
            self,
            value_or_callback: Callable[
                [GenericListBuilder[ItemModel2, ItemModel2.Builder]],
                GenericListBuilder[ItemModel2, ItemModel2.Builder] | List[ItemModel2],
            ],
            /,
        ) -> "DownwardApiModel.Builder": ...

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

        def items(self, value_or_callback=None, /):
            """
            Items is a list of DownwardAPIVolume file
            """
            if self._in_context and value_or_callback is None:
                context = ListBuilderContext[ItemModel2.Builder]()
                context._parent_builder = self
                context._field_name = "items"
                return context

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

    class BuilderContext(BuilderContextBase["DownwardApiModel.Builder"]):
        def model_post_init(self, __context) -> None:
            self._builder = DownwardApiModel.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 DownwardApiModel."""
        return cls.BuilderContext()

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

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

    items: Optional[List[ItemModel2]] = None
    """
    Items is a list of DownwardAPIVolume file
    """


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

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

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

        def mode(self, value: Optional[int], /) -> Self:
            """
            mode is Optional: mode bits used to set permissions on this file.
            Must be an octal value between 0000 and 0777 or a decimal value between 0 and 511.
            YAML accepts both octal and decimal values, JSON requires decimal values for mode bits.
            If not specified, the volume defaultMode will be used.
            This might be in conflict with other options that affect the file
            mode, like fsGroup, and the result can be other mode bits set.
            """
            return self._set("mode", value)

        def path(self, value: str, /) -> Self:
            """
            path is the relative path of the file to map the key to.
            May not be an absolute path.
            May not contain the path element '..'.
            May not start with the string '..'.
            """
            return self._set("path", value)

    class BuilderContext(BuilderContextBase["ItemModel3.Builder"]):
        def model_post_init(self, __context) -> None:
            self._builder = ItemModel3.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 ItemModel3."""
        return cls.BuilderContext()

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

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

    key: str
    """
    key is the key to project.
    """
    mode: Optional[int] = None
    """
    mode is Optional: mode bits used to set permissions on this file.
    Must be an octal value between 0000 and 0777 or a decimal value between 0 and 511.
    YAML accepts both octal and decimal values, JSON requires decimal values for mode bits.
    If not specified, the volume defaultMode will be used.
    This might be in conflict with other options that affect the file
    mode, like fsGroup, and the result can be other mode bits set.
    """
    path: str
    """
    path is the relative path of the file to map the key to.
    May not be an absolute path.
    May not contain the path element '..'.
    May not start with the string '..'.
    """


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

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

        @overload
        def items(self, value_or_callback: List[ItemModel3], /) -> "SecretModel3.Builder": ...

        @overload
        def items(
            self,
            value_or_callback: Callable[
                [GenericListBuilder[ItemModel3, ItemModel3.Builder]],
                GenericListBuilder[ItemModel3, ItemModel3.Builder] | List[ItemModel3],
            ],
            /,
        ) -> "SecretModel3.Builder": ...

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

        def items(self, value_or_callback=None, /):
            """
            items if unspecified, each key-value pair in the Data field of the referenced
            Secret will be projected into the volume as a file whose name is the
            key and content is the value. If specified, the listed keys will be
            projected into the specified paths, and unlisted keys will not be
            present. If a key is specified which is not present in the Secret,
            the volume setup will error unless it is marked optional. Paths must be
            relative and may not contain the '..' path or start with '..'.
            """
            if self._in_context and value_or_callback is None:
                context = ListBuilderContext[ItemModel3.Builder]()
                context._parent_builder = self
                context._field_name = "items"
                return context

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

        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)

        def optional(self, value: Optional[bool], /) -> Self:
            """
            optional field specify whether the Secret or its key must be defined
            """
            return self._set("optional", value)

    class BuilderContext(BuilderContextBase["SecretModel3.Builder"]):
        def model_post_init(self, __context) -> None:
            self._builder = SecretModel3.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 SecretModel3."""
        return cls.BuilderContext()

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

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

    items: Optional[List[ItemModel3]] = None
    """
    items if unspecified, each key-value pair in the Data field of the referenced
    Secret will be projected into the volume as a file whose name is the
    key and content is the value. If specified, the listed keys will be
    projected into the specified paths, and unlisted keys will not be
    present. If a key is specified which is not present in the Secret,
    the volume setup will error unless it is marked optional. Paths must be
    relative and may not contain the '..' path or start with '..'.
    """
    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
    """
    optional: Optional[bool] = None
    """
    optional field specify whether the Secret or its key must be defined
    """


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

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

        def audience(self, value: Optional[str], /) -> Self:
            """
            audience is the intended audience of the token. A recipient of a token
            must identify itself with an identifier specified in the audience of the
            token, and otherwise should reject the token. The audience defaults to the
            identifier of the apiserver.
            """
            return self._set("audience", value)

        def expiration_seconds(self, value: Optional[int], /) -> Self:
            """
            expirationSeconds is the requested duration of validity of the service
            account token. As the token approaches expiration, the kubelet volume
            plugin will proactively rotate the service account token. The kubelet will
            start trying to rotate the token if the token is older than 80 percent of
            its time to live or if the token is older than 24 hours.Defaults to 1 hour
            and must be at least 10 minutes.
            """
            return self._set("expiration_seconds", value)

        def path(self, value: str, /) -> Self:
            """
            path is the path relative to the mount point of the file to project the
            token into.
            """
            return self._set("path", value)

    class BuilderContext(BuilderContextBase["ServiceAccountToken.Builder"]):
        def model_post_init(self, __context) -> None:
            self._builder = ServiceAccountToken.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 ServiceAccountToken."""
        return cls.BuilderContext()

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

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

    audience: Optional[str] = None
    """
    audience is the intended audience of the token. A recipient of a token
    must identify itself with an identifier specified in the audience of the
    token, and otherwise should reject the token. The audience defaults to the
    identifier of the apiserver.
    """
    expiration_seconds: Annotated[Optional[int], Field(alias="expirationSeconds")] = None
    """
    expirationSeconds is the requested duration of validity of the service
    account token. As the token approaches expiration, the kubelet volume
    plugin will proactively rotate the service account token. The kubelet will
    start trying to rotate the token if the token is older than 80 percent of
    its time to live or if the token is older than 24 hours.Defaults to 1 hour
    and must be at least 10 minutes.
    """
    path: str
    """
    path is the path relative to the mount point of the file to project the
    token into.
    """


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

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

        @overload
        def cluster_trust_bundle(
            self, value_or_callback: Optional[ClusterTrustBundle], /
        ) -> "Source.Builder": ...

        @overload
        def cluster_trust_bundle(
            self,
            value_or_callback: Callable[
                [ClusterTrustBundle.Builder],
                ClusterTrustBundle.Builder | ClusterTrustBundle,
            ],
            /,
        ) -> "Source.Builder": ...

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

        def cluster_trust_bundle(self, value_or_callback=None, /):
            """
            ClusterTrustBundle allows a pod to access the `.spec.trustBundle` field
            of ClusterTrustBundle objects in an auto-updating file.

            Alpha, gated by the ClusterTrustBundleProjection feature gate.

            ClusterTrustBundle objects can either be selected by name, or by the
            combination of signer name and a label selector.

            Kubelet performs aggressive normalization of the PEM contents written
            into the pod filesystem.  Esoteric PEM features such as inter-block
            comments and block headers are stripped.  Certificates are deduplicated.
            The ordering of certificates within the file is arbitrary, and Kubelet
            may change the order over time.
            """
            if self._in_context and value_or_callback is None:
                context = ClusterTrustBundle.BuilderContext()
                context._parent_builder = self
                context._field_name = "cluster_trust_bundle"
                return context

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

        @overload
        def config_map(
            self, value_or_callback: Optional[ConfigMapModel], /
        ) -> "Source.Builder": ...

        @overload
        def config_map(
            self,
            value_or_callback: Callable[
                [ConfigMapModel.Builder], ConfigMapModel.Builder | ConfigMapModel
            ],
            /,
        ) -> "Source.Builder": ...

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

        def config_map(self, value_or_callback=None, /):
            """
            configMap information about the configMap data to project
            """
            if self._in_context and value_or_callback is None:
                context = ConfigMapModel.BuilderContext()
                context._parent_builder = self
                context._field_name = "config_map"
                return context

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

        @overload
        def downward_api(
            self, value_or_callback: Optional[DownwardApiModel], /
        ) -> "Source.Builder": ...

        @overload
        def downward_api(
            self,
            value_or_callback: Callable[
                [DownwardApiModel.Builder], DownwardApiModel.Builder | DownwardApiModel
            ],
            /,
        ) -> "Source.Builder": ...

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

        def downward_api(self, value_or_callback=None, /):
            """
            downwardAPI information about the downwardAPI data to project
            """
            if self._in_context and value_or_callback is None:
                context = DownwardApiModel.BuilderContext()
                context._parent_builder = self
                context._field_name = "downward_api"
                return context

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

        @overload
        def secret(self, value_or_callback: Optional[SecretModel3], /) -> "Source.Builder": ...

        @overload
        def secret(
            self,
            value_or_callback: Callable[
                [SecretModel3.Builder], SecretModel3.Builder | SecretModel3
            ],
            /,
        ) -> "Source.Builder": ...

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

        def secret(self, value_or_callback=None, /):
            """
            secret information about the secret data to project
            """
            if self._in_context and value_or_callback is None:
                context = SecretModel3.BuilderContext()
                context._parent_builder = self
                context._field_name = "secret"
                return context

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

        @overload
        def service_account_token(
            self, value_or_callback: Optional[ServiceAccountToken], /
        ) -> "Source.Builder": ...

        @overload
        def service_account_token(
            self,
            value_or_callback: Callable[
                [ServiceAccountToken.Builder],
                ServiceAccountToken.Builder | ServiceAccountToken,
            ],
            /,
        ) -> "Source.Builder": ...

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

        def service_account_token(self, value_or_callback=None, /):
            """
            serviceAccountToken is information about the serviceAccountToken data to project
            """
            if self._in_context and value_or_callback is None:
                context = ServiceAccountToken.BuilderContext()
                context._parent_builder = self
                context._field_name = "service_account_token"
                return context

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

    class BuilderContext(BuilderContextBase["Source.Builder"]):
        def model_post_init(self, __context) -> None:
            self._builder = Source.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 Source."""
        return cls.BuilderContext()

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

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

    cluster_trust_bundle: Annotated[
        Optional[ClusterTrustBundle], Field(alias="clusterTrustBundle")
    ] = None
    """
    ClusterTrustBundle allows a pod to access the `.spec.trustBundle` field
    of ClusterTrustBundle objects in an auto-updating file.

    Alpha, gated by the ClusterTrustBundleProjection feature gate.

    ClusterTrustBundle objects can either be selected by name, or by the
    combination of signer name and a label selector.

    Kubelet performs aggressive normalization of the PEM contents written
    into the pod filesystem.  Esoteric PEM features such as inter-block
    comments and block headers are stripped.  Certificates are deduplicated.
    The ordering of certificates within the file is arbitrary, and Kubelet
    may change the order over time.
    """
    config_map: Annotated[Optional[ConfigMapModel], Field(alias="configMap")] = None
    """
    configMap information about the configMap data to project
    """
    downward_api: Annotated[Optional[DownwardApiModel], Field(alias="downwardAPI")] = None
    """
    downwardAPI information about the downwardAPI data to project
    """
    secret: Optional[SecretModel3] = None
    """
    secret information about the secret data to project
    """
    service_account_token: Annotated[
        Optional[ServiceAccountToken], Field(alias="serviceAccountToken")
    ] = None
    """
    serviceAccountToken is information about the serviceAccountToken data to project
    """


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

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

        def default_mode(self, value: Optional[int], /) -> Self:
            """
            defaultMode are the mode bits used to set permissions on created files by default.
            Must be an octal value between 0000 and 0777 or a decimal value between 0 and 511.
            YAML accepts both octal and decimal values, JSON requires decimal values for mode bits.
            Directories within the path are not affected by this setting.
            This might be in conflict with other options that affect the file
            mode, like fsGroup, and the result can be other mode bits set.
            """
            return self._set("default_mode", value)

        @overload
        def sources(self, value_or_callback: List[Source], /) -> "Projected.Builder": ...

        @overload
        def sources(
            self,
            value_or_callback: Callable[
                [GenericListBuilder[Source, Source.Builder]],
                GenericListBuilder[Source, Source.Builder] | List[Source],
            ],
            /,
        ) -> "Projected.Builder": ...

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

        def sources(self, value_or_callback=None, /):
            """
            sources is the list of volume projections. Each entry in this list
            handles one source.
            """
            if self._in_context and value_or_callback is None:
                context = ListBuilderContext[Source.Builder]()
                context._parent_builder = self
                context._field_name = "sources"
                return context

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

    class BuilderContext(BuilderContextBase["Projected.Builder"]):
        def model_post_init(self, __context) -> None:
            self._builder = Projected.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 Projected."""
        return cls.BuilderContext()

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

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

    default_mode: Annotated[Optional[int], Field(alias="defaultMode")] = None
    """
    defaultMode are the mode bits used to set permissions on created files by default.
    Must be an octal value between 0000 and 0777 or a decimal value between 0 and 511.
    YAML accepts both octal and decimal values, JSON requires decimal values for mode bits.
    Directories within the path are not affected by this setting.
    This might be in conflict with other options that affect the file
    mode, like fsGroup, and the result can be other mode bits set.
    """
    sources: Optional[List[Source]] = None
    """
    sources is the list of volume projections. Each entry in this list
    handles one source.
    """


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

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

        def group(self, value: Optional[str], /) -> Self:
            """
            group to map volume access to
            Default is no group
            """
            return self._set("group", value)

        def read_only(self, value: Optional[bool], /) -> Self:
            """
            readOnly here will force the Quobyte volume to be mounted with read-only permissions.
            Defaults to false.
            """
            return self._set("read_only", value)

        def registry(self, value: str, /) -> Self:
            """
            registry represents a single or multiple Quobyte Registry services
            specified as a string as host:port pair (multiple entries are separated with commas)
            which acts as the central registry for volumes
            """
            return self._set("registry", value)

        def tenant(self, value: Optional[str], /) -> Self:
            """
            tenant owning the given Quobyte volume in the Backend
            Used with dynamically provisioned Quobyte volumes, value is set by the plugin
            """
            return self._set("tenant", value)

        def user(self, value: Optional[str], /) -> Self:
            """
            user to map volume access to
            Defaults to serivceaccount user
            """
            return self._set("user", value)

        def volume(self, value: str, /) -> Self:
            """
            volume is a string that references an already created Quobyte volume by name.
            """
            return self._set("volume", value)

    class BuilderContext(BuilderContextBase["Quobyte.Builder"]):
        def model_post_init(self, __context) -> None:
            self._builder = Quobyte.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 Quobyte."""
        return cls.BuilderContext()

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

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

    group: Optional[str] = None
    """
    group to map volume access to
    Default is no group
    """
    read_only: Annotated[Optional[bool], Field(alias="readOnly")] = None
    """
    readOnly here will force the Quobyte volume to be mounted with read-only permissions.
    Defaults to false.
    """
    registry: str
    """
    registry represents a single or multiple Quobyte Registry services
    specified as a string as host:port pair (multiple entries are separated with commas)
    which acts as the central registry for volumes
    """
    tenant: Optional[str] = None
    """
    tenant owning the given Quobyte volume in the Backend
    Used with dynamically provisioned Quobyte volumes, value is set by the plugin
    """
    user: Optional[str] = None
    """
    user to map volume access to
    Defaults to serivceaccount user
    """
    volume: str
    """
    volume is a string that references an already created Quobyte volume by name.
    """


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

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

        def fs_type(self, value: Optional[str], /) -> Self:
            """
            fsType is the filesystem type of the volume that you want to mount.
            Tip: Ensure that the filesystem type is supported by the host operating system.
            Examples: "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified.
            More info: https://kubernetes.io/docs/concepts/storage/volumes#rbd
            """
            return self._set("fs_type", value)

        def image(self, value: str, /) -> Self:
            """
            image is the rados image name.
            More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it
            """
            return self._set("image", value)

        def keyring(self, value: Optional[str], /) -> Self:
            """
            keyring is the path to key ring for RBDUser.
            Default is /etc/ceph/keyring.
            More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it
            """
            return self._set("keyring", value)

        def monitors(self, value: List[str], /) -> Self:
            """
            monitors is a collection of Ceph monitors.
            More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it
            """
            return self._set("monitors", value)

        def pool(self, value: Optional[str], /) -> Self:
            """
            pool is the rados pool name.
            Default is rbd.
            More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it
            """
            return self._set("pool", value)

        def read_only(self, value: Optional[bool], /) -> Self:
            """
            readOnly here will force the ReadOnly setting in VolumeMounts.
            Defaults to false.
            More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it
            """
            return self._set("read_only", value)

        @overload
        def secret_ref(self, value_or_callback: Optional[SecretRefModel], /) -> "Rbd.Builder": ...

        @overload
        def secret_ref(
            self,
            value_or_callback: Callable[
                [SecretRefModel.Builder], SecretRefModel.Builder | SecretRefModel
            ],
            /,
        ) -> "Rbd.Builder": ...

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

        def secret_ref(self, value_or_callback=None, /):
            """
            secretRef is name of the authentication secret for RBDUser. If provided
            overrides keyring.
            Default is nil.
            More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it
            """
            if self._in_context and value_or_callback is None:
                context = SecretRefModel.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(SecretRefModel.builder())
                if isinstance(output, SecretRefModel.Builder):
                    value = output.build()
                else:
                    value = output
            return self._set("secret_ref", value)

        def user(self, value: Optional[str], /) -> Self:
            """
            user is the rados user name.
            Default is admin.
            More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it
            """
            return self._set("user", value)

    class BuilderContext(BuilderContextBase["Rbd.Builder"]):
        def model_post_init(self, __context) -> None:
            self._builder = Rbd.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 Rbd."""
        return cls.BuilderContext()

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

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

    fs_type: Annotated[Optional[str], Field(alias="fsType")] = None
    """
    fsType is the filesystem type of the volume that you want to mount.
    Tip: Ensure that the filesystem type is supported by the host operating system.
    Examples: "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified.
    More info: https://kubernetes.io/docs/concepts/storage/volumes#rbd
    """
    image: str
    """
    image is the rados image name.
    More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it
    """
    keyring: Optional[str] = "/etc/ceph/keyring"
    """
    keyring is the path to key ring for RBDUser.
    Default is /etc/ceph/keyring.
    More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it
    """
    monitors: List[str]
    """
    monitors is a collection of Ceph monitors.
    More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it
    """
    pool: Optional[str] = "rbd"
    """
    pool is the rados pool name.
    Default is rbd.
    More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it
    """
    read_only: Annotated[Optional[bool], Field(alias="readOnly")] = None
    """
    readOnly here will force the ReadOnly setting in VolumeMounts.
    Defaults to false.
    More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it
    """
    secret_ref: Annotated[Optional[SecretRefModel], Field(alias="secretRef")] = None
    """
    secretRef is name of the authentication secret for RBDUser. If provided
    overrides keyring.
    Default is nil.
    More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it
    """
    user: Optional[str] = "admin"
    """
    user is the rados user name.
    Default is admin.
    More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it
    """


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

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

        def fs_type(self, value: Optional[str], /) -> Self:
            """
            fsType is the filesystem type to mount.
            Must be a filesystem type supported by the host operating system.
            Ex. "ext4", "xfs", "ntfs".
            Default is "xfs".
            """
            return self._set("fs_type", value)

        def gateway(self, value: str, /) -> Self:
            """
            gateway is the host address of the ScaleIO API Gateway.
            """
            return self._set("gateway", value)

        def protection_domain(self, value: Optional[str], /) -> Self:
            """
            protectionDomain is the name of the ScaleIO Protection Domain for the configured storage.
            """
            return self._set("protection_domain", value)

        def read_only(self, value: Optional[bool], /) -> Self:
            """
            readOnly Defaults to false (read/write). ReadOnly here will force
            the ReadOnly setting in VolumeMounts.
            """
            return self._set("read_only", value)

        @overload
        def secret_ref(self, value_or_callback: SecretRefModel, /) -> "ScaleIo.Builder": ...

        @overload
        def secret_ref(
            self,
            value_or_callback: Callable[
                [SecretRefModel.Builder], SecretRefModel.Builder | SecretRefModel
            ],
            /,
        ) -> "ScaleIo.Builder": ...

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

        def secret_ref(self, value_or_callback=None, /):
            """
            secretRef references to the secret for ScaleIO user and other
            sensitive information. If this is not provided, Login operation will fail.
            """
            if self._in_context and value_or_callback is None:
                context = SecretRefModel.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(SecretRefModel.builder())
                if isinstance(output, SecretRefModel.Builder):
                    value = output.build()
                else:
                    value = output
            return self._set("secret_ref", value)

        def ssl_enabled(self, value: Optional[bool], /) -> Self:
            """
            sslEnabled Flag enable/disable SSL communication with Gateway, default false
            """
            return self._set("ssl_enabled", value)

        def storage_mode(self, value: Optional[str], /) -> Self:
            """
            storageMode indicates whether the storage for a volume should be ThickProvisioned or ThinProvisioned.
            Default is ThinProvisioned.
            """
            return self._set("storage_mode", value)

        def storage_pool(self, value: Optional[str], /) -> Self:
            """
            storagePool is the ScaleIO Storage Pool associated with the protection domain.
            """
            return self._set("storage_pool", value)

        def system(self, value: str, /) -> Self:
            """
            system is the name of the storage system as configured in ScaleIO.
            """
            return self._set("system", value)

        def volume_name(self, value: Optional[str], /) -> Self:
            """
            volumeName is the name of a volume already created in the ScaleIO system
            that is associated with this volume source.
            """
            return self._set("volume_name", value)

    class BuilderContext(BuilderContextBase["ScaleIo.Builder"]):
        def model_post_init(self, __context) -> None:
            self._builder = ScaleIo.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 ScaleIo."""
        return cls.BuilderContext()

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

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

    fs_type: Annotated[Optional[str], Field(alias="fsType")] = "xfs"
    """
    fsType is the filesystem type to mount.
    Must be a filesystem type supported by the host operating system.
    Ex. "ext4", "xfs", "ntfs".
    Default is "xfs".
    """
    gateway: str
    """
    gateway is the host address of the ScaleIO API Gateway.
    """
    protection_domain: Annotated[Optional[str], Field(alias="protectionDomain")] = None
    """
    protectionDomain is the name of the ScaleIO Protection Domain for the configured storage.
    """
    read_only: Annotated[Optional[bool], Field(alias="readOnly")] = None
    """
    readOnly Defaults to false (read/write). ReadOnly here will force
    the ReadOnly setting in VolumeMounts.
    """
    secret_ref: Annotated[SecretRefModel, Field(alias="secretRef")]
    """
    secretRef references to the secret for ScaleIO user and other
    sensitive information. If this is not provided, Login operation will fail.
    """
    ssl_enabled: Annotated[Optional[bool], Field(alias="sslEnabled")] = None
    """
    sslEnabled Flag enable/disable SSL communication with Gateway, default false
    """
    storage_mode: Annotated[Optional[str], Field(alias="storageMode")] = "ThinProvisioned"
    """
    storageMode indicates whether the storage for a volume should be ThickProvisioned or ThinProvisioned.
    Default is ThinProvisioned.
    """
    storage_pool: Annotated[Optional[str], Field(alias="storagePool")] = None
    """
    storagePool is the ScaleIO Storage Pool associated with the protection domain.
    """
    system: str
    """
    system is the name of the storage system as configured in ScaleIO.
    """
    volume_name: Annotated[Optional[str], Field(alias="volumeName")] = None
    """
    volumeName is the name of a volume already created in the ScaleIO system
    that is associated with this volume source.
    """


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

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

        def default_mode(self, value: Optional[int], /) -> Self:
            """
            defaultMode is Optional: mode bits used to set permissions on created files by default.
            Must be an octal value between 0000 and 0777 or a decimal value between 0 and 511.
            YAML accepts both octal and decimal values, JSON requires decimal values
            for mode bits. Defaults to 0644.
            Directories within the path are not affected by this setting.
            This might be in conflict with other options that affect the file
            mode, like fsGroup, and the result can be other mode bits set.
            """
            return self._set("default_mode", value)

        @overload
        def items(self, value_or_callback: List[ItemModel3], /) -> "SecretModel4.Builder": ...

        @overload
        def items(
            self,
            value_or_callback: Callable[
                [GenericListBuilder[ItemModel3, ItemModel3.Builder]],
                GenericListBuilder[ItemModel3, ItemModel3.Builder] | List[ItemModel3],
            ],
            /,
        ) -> "SecretModel4.Builder": ...

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

        def items(self, value_or_callback=None, /):
            """
            items If unspecified, each key-value pair in the Data field of the referenced
            Secret will be projected into the volume as a file whose name is the
            key and content is the value. If specified, the listed keys will be
            projected into the specified paths, and unlisted keys will not be
            present. If a key is specified which is not present in the Secret,
            the volume setup will error unless it is marked optional. Paths must be
            relative and may not contain the '..' path or start with '..'.
            """
            if self._in_context and value_or_callback is None:
                context = ListBuilderContext[ItemModel3.Builder]()
                context._parent_builder = self
                context._field_name = "items"
                return context

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

        def optional(self, value: Optional[bool], /) -> Self:
            """
            optional field specify whether the Secret or its keys must be defined
            """
            return self._set("optional", value)

        def secret_name(self, value: Optional[str], /) -> Self:
            """
            secretName is the name of the secret in the pod's namespace to use.
            More info: https://kubernetes.io/docs/concepts/storage/volumes#secret
            """
            return self._set("secret_name", value)

    class BuilderContext(BuilderContextBase["SecretModel4.Builder"]):
        def model_post_init(self, __context) -> None:
            self._builder = SecretModel4.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 SecretModel4."""
        return cls.BuilderContext()

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

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

    default_mode: Annotated[Optional[int], Field(alias="defaultMode")] = None
    """
    defaultMode is Optional: mode bits used to set permissions on created files by default.
    Must be an octal value between 0000 and 0777 or a decimal value between 0 and 511.
    YAML accepts both octal and decimal values, JSON requires decimal values
    for mode bits. Defaults to 0644.
    Directories within the path are not affected by this setting.
    This might be in conflict with other options that affect the file
    mode, like fsGroup, and the result can be other mode bits set.
    """
    items: Optional[List[ItemModel3]] = None
    """
    items If unspecified, each key-value pair in the Data field of the referenced
    Secret will be projected into the volume as a file whose name is the
    key and content is the value. If specified, the listed keys will be
    projected into the specified paths, and unlisted keys will not be
    present. If a key is specified which is not present in the Secret,
    the volume setup will error unless it is marked optional. Paths must be
    relative and may not contain the '..' path or start with '..'.
    """
    optional: Optional[bool] = None
    """
    optional field specify whether the Secret or its keys must be defined
    """
    secret_name: Annotated[Optional[str], Field(alias="secretName")] = None
    """
    secretName is the name of the secret in the pod's namespace to use.
    More info: https://kubernetes.io/docs/concepts/storage/volumes#secret
    """


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

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

        def fs_type(self, value: Optional[str], /) -> Self:
            """
            fsType is the filesystem type to mount.
            Must be a filesystem type supported by the host operating system.
            Ex. "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified.
            """
            return self._set("fs_type", value)

        def read_only(self, value: Optional[bool], /) -> Self:
            """
            readOnly defaults to false (read/write). ReadOnly here will force
            the ReadOnly setting in VolumeMounts.
            """
            return self._set("read_only", value)

        @overload
        def secret_ref(
            self, value_or_callback: Optional[SecretRefModel], /
        ) -> "Storageos.Builder": ...

        @overload
        def secret_ref(
            self,
            value_or_callback: Callable[
                [SecretRefModel.Builder], SecretRefModel.Builder | SecretRefModel
            ],
            /,
        ) -> "Storageos.Builder": ...

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

        def secret_ref(self, value_or_callback=None, /):
            """
            secretRef specifies the secret to use for obtaining the StorageOS API
            credentials.  If not specified, default values will be attempted.
            """
            if self._in_context and value_or_callback is None:
                context = SecretRefModel.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(SecretRefModel.builder())
                if isinstance(output, SecretRefModel.Builder):
                    value = output.build()
                else:
                    value = output
            return self._set("secret_ref", value)

        def volume_name(self, value: Optional[str], /) -> Self:
            """
            volumeName is the human-readable name of the StorageOS volume.  Volume
            names are only unique within a namespace.
            """
            return self._set("volume_name", value)

        def volume_namespace(self, value: Optional[str], /) -> Self:
            """
            volumeNamespace specifies the scope of the volume within StorageOS.  If no
            namespace is specified then the Pod's namespace will be used.  This allows the
            Kubernetes name scoping to be mirrored within StorageOS for tighter integration.
            Set VolumeName to any name to override the default behaviour.
            Set to "default" if you are not using namespaces within StorageOS.
            Namespaces that do not pre-exist within StorageOS will be created.
            """
            return self._set("volume_namespace", value)

    class BuilderContext(BuilderContextBase["Storageos.Builder"]):
        def model_post_init(self, __context) -> None:
            self._builder = Storageos.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 Storageos."""
        return cls.BuilderContext()

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

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

    fs_type: Annotated[Optional[str], Field(alias="fsType")] = None
    """
    fsType is the filesystem type to mount.
    Must be a filesystem type supported by the host operating system.
    Ex. "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified.
    """
    read_only: Annotated[Optional[bool], Field(alias="readOnly")] = None
    """
    readOnly defaults to false (read/write). ReadOnly here will force
    the ReadOnly setting in VolumeMounts.
    """
    secret_ref: Annotated[Optional[SecretRefModel], Field(alias="secretRef")] = None
    """
    secretRef specifies the secret to use for obtaining the StorageOS API
    credentials.  If not specified, default values will be attempted.
    """
    volume_name: Annotated[Optional[str], Field(alias="volumeName")] = None
    """
    volumeName is the human-readable name of the StorageOS volume.  Volume
    names are only unique within a namespace.
    """
    volume_namespace: Annotated[Optional[str], Field(alias="volumeNamespace")] = None
    """
    volumeNamespace specifies the scope of the volume within StorageOS.  If no
    namespace is specified then the Pod's namespace will be used.  This allows the
    Kubernetes name scoping to be mirrored within StorageOS for tighter integration.
    Set VolumeName to any name to override the default behaviour.
    Set to "default" if you are not using namespaces within StorageOS.
    Namespaces that do not pre-exist within StorageOS will be created.
    """


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

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

        def fs_type(self, value: Optional[str], /) -> Self:
            """
            fsType is filesystem type to mount.
            Must be a filesystem type supported by the host operating system.
            Ex. "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified.
            """
            return self._set("fs_type", value)

        def storage_policy_id(self, value: Optional[str], /) -> Self:
            """
            storagePolicyID is the storage Policy Based Management (SPBM) profile ID associated with the StoragePolicyName.
            """
            return self._set("storage_policy_id", value)

        def storage_policy_name(self, value: Optional[str], /) -> Self:
            """
            storagePolicyName is the storage Policy Based Management (SPBM) profile name.
            """
            return self._set("storage_policy_name", value)

        def volume_path(self, value: str, /) -> Self:
            """
            volumePath is the path that identifies vSphere volume vmdk
            """
            return self._set("volume_path", value)

    class BuilderContext(BuilderContextBase["VsphereVolume.Builder"]):
        def model_post_init(self, __context) -> None:
            self._builder = VsphereVolume.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 VsphereVolume."""
        return cls.BuilderContext()

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

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

    fs_type: Annotated[Optional[str], Field(alias="fsType")] = None
    """
    fsType is filesystem type to mount.
    Must be a filesystem type supported by the host operating system.
    Ex. "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified.
    """
    storage_policy_id: Annotated[Optional[str], Field(alias="storagePolicyID")] = None
    """
    storagePolicyID is the storage Policy Based Management (SPBM) profile ID associated with the StoragePolicyName.
    """
    storage_policy_name: Annotated[Optional[str], Field(alias="storagePolicyName")] = None
    """
    storagePolicyName is the storage Policy Based Management (SPBM) profile name.
    """
    volume_path: Annotated[str, Field(alias="volumePath")]
    """
    volumePath is the path that identifies vSphere volume vmdk
    """


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

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

        @overload
        def aws_elastic_block_store(
            self, value_or_callback: Optional[AwsElasticBlockStore], /
        ) -> "Volume.Builder": ...

        @overload
        def aws_elastic_block_store(
            self,
            value_or_callback: Callable[
                [AwsElasticBlockStore.Builder],
                AwsElasticBlockStore.Builder | AwsElasticBlockStore,
            ],
            /,
        ) -> "Volume.Builder": ...

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

        def aws_elastic_block_store(self, value_or_callback=None, /):
            """
            awsElasticBlockStore represents an AWS Disk resource that is attached to a
            kubelet's host machine and then exposed to the pod.
            More info: https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore
            """
            if self._in_context and value_or_callback is None:
                context = AwsElasticBlockStore.BuilderContext()
                context._parent_builder = self
                context._field_name = "aws_elastic_block_store"
                return context

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

        @overload
        def azure_disk(self, value_or_callback: Optional[AzureDisk], /) -> "Volume.Builder": ...

        @overload
        def azure_disk(
            self,
            value_or_callback: Callable[[AzureDisk.Builder], AzureDisk.Builder | AzureDisk],
            /,
        ) -> "Volume.Builder": ...

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

        def azure_disk(self, value_or_callback=None, /):
            """
            azureDisk represents an Azure Data Disk mount on the host and bind mount to the pod.
            """
            if self._in_context and value_or_callback is None:
                context = AzureDisk.BuilderContext()
                context._parent_builder = self
                context._field_name = "azure_disk"
                return context

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

        @overload
        def azure_file(self, value_or_callback: Optional[AzureFile], /) -> "Volume.Builder": ...

        @overload
        def azure_file(
            self,
            value_or_callback: Callable[[AzureFile.Builder], AzureFile.Builder | AzureFile],
            /,
        ) -> "Volume.Builder": ...

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

        def azure_file(self, value_or_callback=None, /):
            """
            azureFile represents an Azure File Service mount on the host and bind mount to the pod.
            """
            if self._in_context and value_or_callback is None:
                context = AzureFile.BuilderContext()
                context._parent_builder = self
                context._field_name = "azure_file"
                return context

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

        @overload
        def cephfs(self, value_or_callback: Optional[Cephfs], /) -> "Volume.Builder": ...

        @overload
        def cephfs(
            self,
            value_or_callback: Callable[[Cephfs.Builder], Cephfs.Builder | Cephfs],
            /,
        ) -> "Volume.Builder": ...

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

        def cephfs(self, value_or_callback=None, /):
            """
            cephFS represents a Ceph FS mount on the host that shares a pod's lifetime
            """
            if self._in_context and value_or_callback is None:
                context = Cephfs.BuilderContext()
                context._parent_builder = self
                context._field_name = "cephfs"
                return context

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

        @overload
        def cinder(self, value_or_callback: Optional[Cinder], /) -> "Volume.Builder": ...

        @overload
        def cinder(
            self,
            value_or_callback: Callable[[Cinder.Builder], Cinder.Builder | Cinder],
            /,
        ) -> "Volume.Builder": ...

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

        def cinder(self, value_or_callback=None, /):
            """
            cinder represents a cinder volume attached and mounted on kubelets host machine.
            More info: https://examples.k8s.io/mysql-cinder-pd/README.md
            """
            if self._in_context and value_or_callback is None:
                context = Cinder.BuilderContext()
                context._parent_builder = self
                context._field_name = "cinder"
                return context

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

        @overload
        def config_map(self, value_or_callback: Optional[ConfigMap], /) -> "Volume.Builder": ...

        @overload
        def config_map(
            self,
            value_or_callback: Callable[[ConfigMap.Builder], ConfigMap.Builder | ConfigMap],
            /,
        ) -> "Volume.Builder": ...

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

        def config_map(self, value_or_callback=None, /):
            """
            configMap represents a configMap that should populate this volume
            """
            if self._in_context and value_or_callback is None:
                context = ConfigMap.BuilderContext()
                context._parent_builder = self
                context._field_name = "config_map"
                return context

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

        @overload
        def csi(self, value_or_callback: Optional[Csi], /) -> "Volume.Builder": ...

        @overload
        def csi(
            self, value_or_callback: Callable[[Csi.Builder], Csi.Builder | Csi], /
        ) -> "Volume.Builder": ...

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

        def csi(self, value_or_callback=None, /):
            """
            csi (Container Storage Interface) represents ephemeral storage that is handled by certain external CSI drivers (Beta feature).
            """
            if self._in_context and value_or_callback is None:
                context = Csi.BuilderContext()
                context._parent_builder = self
                context._field_name = "csi"
                return context

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

        @overload
        def downward_api(self, value_or_callback: Optional[DownwardApi], /) -> "Volume.Builder": ...

        @overload
        def downward_api(
            self,
            value_or_callback: Callable[[DownwardApi.Builder], DownwardApi.Builder | DownwardApi],
            /,
        ) -> "Volume.Builder": ...

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

        def downward_api(self, value_or_callback=None, /):
            """
            downwardAPI represents downward API about the pod that should populate this volume
            """
            if self._in_context and value_or_callback is None:
                context = DownwardApi.BuilderContext()
                context._parent_builder = self
                context._field_name = "downward_api"
                return context

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

        @overload
        def empty_dir(self, value_or_callback: Optional[EmptyDir], /) -> "Volume.Builder": ...

        @overload
        def empty_dir(
            self,
            value_or_callback: Callable[[EmptyDir.Builder], EmptyDir.Builder | EmptyDir],
            /,
        ) -> "Volume.Builder": ...

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

        def empty_dir(self, value_or_callback=None, /):
            """
            emptyDir represents a temporary directory that shares a pod's lifetime.
            More info: https://kubernetes.io/docs/concepts/storage/volumes#emptydir
            """
            if self._in_context and value_or_callback is None:
                context = EmptyDir.BuilderContext()
                context._parent_builder = self
                context._field_name = "empty_dir"
                return context

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

        @overload
        def ephemeral(self, value_or_callback: Optional[Ephemeral], /) -> "Volume.Builder": ...

        @overload
        def ephemeral(
            self,
            value_or_callback: Callable[[Ephemeral.Builder], Ephemeral.Builder | Ephemeral],
            /,
        ) -> "Volume.Builder": ...

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

        def ephemeral(self, value_or_callback=None, /):
            """
            ephemeral represents a volume that is handled by a cluster storage driver.
            The volume's lifecycle is tied to the pod that defines it - it will be created before the pod starts,
            and deleted when the pod is removed.

            Use this if:
            a) the volume is only needed while the pod runs,
            b) features of normal volumes like restoring from snapshot or capacity
               tracking are needed,
            c) the storage driver is specified through a storage class, and
            d) the storage driver supports dynamic volume provisioning through
               a PersistentVolumeClaim (see EphemeralVolumeSource for more
               information on the connection between this volume type
               and PersistentVolumeClaim).

            Use PersistentVolumeClaim or one of the vendor-specific
            APIs for volumes that persist for longer than the lifecycle
            of an individual pod.

            Use CSI for light-weight local ephemeral volumes if the CSI driver is meant to
            be used that way - see the documentation of the driver for
            more information.

            A pod can use both types of ephemeral volumes and
            persistent volumes at the same time.
            """
            if self._in_context and value_or_callback is None:
                context = Ephemeral.BuilderContext()
                context._parent_builder = self
                context._field_name = "ephemeral"
                return context

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

        @overload
        def fc(self, value_or_callback: Optional[Fc], /) -> "Volume.Builder": ...

        @overload
        def fc(
            self, value_or_callback: Callable[[Fc.Builder], Fc.Builder | Fc], /
        ) -> "Volume.Builder": ...

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

        def fc(self, value_or_callback=None, /):
            """
            fc represents a Fibre Channel resource that is attached to a kubelet's host machine and then exposed to the pod.
            """
            if self._in_context and value_or_callback is None:
                context = Fc.BuilderContext()
                context._parent_builder = self
                context._field_name = "fc"
                return context

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

        @overload
        def flex_volume(self, value_or_callback: Optional[FlexVolume], /) -> "Volume.Builder": ...

        @overload
        def flex_volume(
            self,
            value_or_callback: Callable[[FlexVolume.Builder], FlexVolume.Builder | FlexVolume],
            /,
        ) -> "Volume.Builder": ...

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

        def flex_volume(self, value_or_callback=None, /):
            """
            flexVolume represents a generic volume resource that is
            provisioned/attached using an exec based plugin.
            """
            if self._in_context and value_or_callback is None:
                context = FlexVolume.BuilderContext()
                context._parent_builder = self
                context._field_name = "flex_volume"
                return context

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

        @overload
        def flocker(self, value_or_callback: Optional[Flocker], /) -> "Volume.Builder": ...

        @overload
        def flocker(
            self,
            value_or_callback: Callable[[Flocker.Builder], Flocker.Builder | Flocker],
            /,
        ) -> "Volume.Builder": ...

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

        def flocker(self, value_or_callback=None, /):
            """
            flocker represents a Flocker volume attached to a kubelet's host machine. This depends on the Flocker control service being running
            """
            if self._in_context and value_or_callback is None:
                context = Flocker.BuilderContext()
                context._parent_builder = self
                context._field_name = "flocker"
                return context

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

        @overload
        def gce_persistent_disk(
            self, value_or_callback: Optional[GcePersistentDisk], /
        ) -> "Volume.Builder": ...

        @overload
        def gce_persistent_disk(
            self,
            value_or_callback: Callable[
                [GcePersistentDisk.Builder],
                GcePersistentDisk.Builder | GcePersistentDisk,
            ],
            /,
        ) -> "Volume.Builder": ...

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

        def gce_persistent_disk(self, value_or_callback=None, /):
            """
            gcePersistentDisk represents a GCE Disk resource that is attached to a
            kubelet's host machine and then exposed to the pod.
            More info: https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk
            """
            if self._in_context and value_or_callback is None:
                context = GcePersistentDisk.BuilderContext()
                context._parent_builder = self
                context._field_name = "gce_persistent_disk"
                return context

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

        @overload
        def git_repo(self, value_or_callback: Optional[GitRepo], /) -> "Volume.Builder": ...

        @overload
        def git_repo(
            self,
            value_or_callback: Callable[[GitRepo.Builder], GitRepo.Builder | GitRepo],
            /,
        ) -> "Volume.Builder": ...

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

        def git_repo(self, value_or_callback=None, /):
            """
            gitRepo represents a git repository at a particular revision.
            DEPRECATED: GitRepo is deprecated. To provision a container with a git repo, mount an
            EmptyDir into an InitContainer that clones the repo using git, then mount the EmptyDir
            into the Pod's container.
            """
            if self._in_context and value_or_callback is None:
                context = GitRepo.BuilderContext()
                context._parent_builder = self
                context._field_name = "git_repo"
                return context

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

        @overload
        def glusterfs(self, value_or_callback: Optional[Glusterfs], /) -> "Volume.Builder": ...

        @overload
        def glusterfs(
            self,
            value_or_callback: Callable[[Glusterfs.Builder], Glusterfs.Builder | Glusterfs],
            /,
        ) -> "Volume.Builder": ...

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

        def glusterfs(self, value_or_callback=None, /):
            """
            glusterfs represents a Glusterfs mount on the host that shares a pod's lifetime.
            More info: https://examples.k8s.io/volumes/glusterfs/README.md
            """
            if self._in_context and value_or_callback is None:
                context = Glusterfs.BuilderContext()
                context._parent_builder = self
                context._field_name = "glusterfs"
                return context

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

        @overload
        def host_path(self, value_or_callback: Optional[HostPath], /) -> "Volume.Builder": ...

        @overload
        def host_path(
            self,
            value_or_callback: Callable[[HostPath.Builder], HostPath.Builder | HostPath],
            /,
        ) -> "Volume.Builder": ...

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

        def host_path(self, value_or_callback=None, /):
            """
            hostPath represents a pre-existing file or directory on the host
            machine that is directly exposed to the container. This is generally
            used for system agents or other privileged things that are allowed
            to see the host machine. Most containers will NOT need this.
            More info: https://kubernetes.io/docs/concepts/storage/volumes#hostpath
            """
            if self._in_context and value_or_callback is None:
                context = HostPath.BuilderContext()
                context._parent_builder = self
                context._field_name = "host_path"
                return context

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

        @overload
        def image(self, value_or_callback: Optional[Image], /) -> "Volume.Builder": ...

        @overload
        def image(
            self, value_or_callback: Callable[[Image.Builder], Image.Builder | Image], /
        ) -> "Volume.Builder": ...

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

        def image(self, value_or_callback=None, /):
            """
            image represents an OCI object (a container image or artifact) pulled and mounted on the kubelet's host machine.
            The volume is resolved at pod startup depending on which PullPolicy value is provided:

            - Always: the kubelet always attempts to pull the reference. Container creation will fail If the pull fails.
            - Never: the kubelet never pulls the reference and only uses a local image or artifact. Container creation will fail if the reference isn't present.
            - IfNotPresent: the kubelet pulls if the reference isn't already present on disk. Container creation will fail if the reference isn't present and the pull fails.

            The volume gets re-resolved if the pod gets deleted and recreated, which means that new remote content will become available on pod recreation.
            A failure to resolve or pull the image during pod startup will block containers from starting and may add significant latency. Failures will be retried using normal volume backoff and will be reported on the pod reason and message.
            The types of objects that may be mounted by this volume are defined by the container runtime implementation on a host machine and at minimum must include all valid types supported by the container image field.
            The OCI object gets mounted in a single directory (spec.containers[*].volumeMounts.mountPath) by merging the manifest layers in the same way as for container images.
            The volume will be mounted read-only (ro) and non-executable files (noexec).
            Sub path mounts for containers are not supported (spec.containers[*].volumeMounts.subpath).
            The field spec.securityContext.fsGroupChangePolicy has no effect on this volume type.
            """
            if self._in_context and value_or_callback is None:
                context = Image.BuilderContext()
                context._parent_builder = self
                context._field_name = "image"
                return context

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

        @overload
        def iscsi(self, value_or_callback: Optional[Iscsi], /) -> "Volume.Builder": ...

        @overload
        def iscsi(
            self, value_or_callback: Callable[[Iscsi.Builder], Iscsi.Builder | Iscsi], /
        ) -> "Volume.Builder": ...

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

        def iscsi(self, value_or_callback=None, /):
            """
            iscsi represents an ISCSI Disk resource that is attached to a
            kubelet's host machine and then exposed to the pod.
            More info: https://examples.k8s.io/volumes/iscsi/README.md
            """
            if self._in_context and value_or_callback is None:
                context = Iscsi.BuilderContext()
                context._parent_builder = self
                context._field_name = "iscsi"
                return context

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

        def name(self, value: str, /) -> Self:
            """
            name of the volume.
            Must be a DNS_LABEL and unique within the pod.
            More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
            """
            return self._set("name", value)

        @overload
        def nfs(self, value_or_callback: Optional[Nfs], /) -> "Volume.Builder": ...

        @overload
        def nfs(
            self, value_or_callback: Callable[[Nfs.Builder], Nfs.Builder | Nfs], /
        ) -> "Volume.Builder": ...

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

        def nfs(self, value_or_callback=None, /):
            """
            nfs represents an NFS mount on the host that shares a pod's lifetime
            More info: https://kubernetes.io/docs/concepts/storage/volumes#nfs
            """
            if self._in_context and value_or_callback is None:
                context = Nfs.BuilderContext()
                context._parent_builder = self
                context._field_name = "nfs"
                return context

            value = value_or_callback
            if callable(value_or_callback):
                output = value_or_callback(Nfs.builder())
                if isinstance(output, Nfs.Builder):
                    value = output.build()
                else:
                    value = output
            return self._set("nfs", value)

        @overload
        def persistent_volume_claim(
            self, value_or_callback: Optional[PersistentVolumeClaim], /
        ) -> "Volume.Builder": ...

        @overload
        def persistent_volume_claim(
            self,
            value_or_callback: Callable[
                [PersistentVolumeClaim.Builder],
                PersistentVolumeClaim.Builder | PersistentVolumeClaim,
            ],
            /,
        ) -> "Volume.Builder": ...

        @overload
        def persistent_volume_claim(
            self, value_or_callback: Never = ...
        ) -> "PersistentVolumeClaim.BuilderContext": ...

        def persistent_volume_claim(self, value_or_callback=None, /):
            """
            persistentVolumeClaimVolumeSource represents a reference to a
            PersistentVolumeClaim in the same namespace.
            More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#persistentvolumeclaims
            """
            if self._in_context and value_or_callback is None:
                context = PersistentVolumeClaim.BuilderContext()
                context._parent_builder = self
                context._field_name = "persistent_volume_claim"
                return context

            value = value_or_callback
            if callable(value_or_callback):
                output = value_or_callback(PersistentVolumeClaim.builder())
                if isinstance(output, PersistentVolumeClaim.Builder):
                    value = output.build()
                else:
                    value = output
            return self._set("persistent_volume_claim", value)

        @overload
        def photon_persistent_disk(
            self, value_or_callback: Optional[PhotonPersistentDisk], /
        ) -> "Volume.Builder": ...

        @overload
        def photon_persistent_disk(
            self,
            value_or_callback: Callable[
                [PhotonPersistentDisk.Builder],
                PhotonPersistentDisk.Builder | PhotonPersistentDisk,
            ],
            /,
        ) -> "Volume.Builder": ...

        @overload
        def photon_persistent_disk(
            self, value_or_callback: Never = ...
        ) -> "PhotonPersistentDisk.BuilderContext": ...

        def photon_persistent_disk(self, value_or_callback=None, /):
            """
            photonPersistentDisk represents a PhotonController persistent disk attached and mounted on kubelets host machine
            """
            if self._in_context and value_or_callback is None:
                context = PhotonPersistentDisk.BuilderContext()
                context._parent_builder = self
                context._field_name = "photon_persistent_disk"
                return context

            value = value_or_callback
            if callable(value_or_callback):
                output = value_or_callback(PhotonPersistentDisk.builder())
                if isinstance(output, PhotonPersistentDisk.Builder):
                    value = output.build()
                else:
                    value = output
            return self._set("photon_persistent_disk", value)

        @overload
        def portworx_volume(
            self, value_or_callback: Optional[PortworxVolume], /
        ) -> "Volume.Builder": ...

        @overload
        def portworx_volume(
            self,
            value_or_callback: Callable[
                [PortworxVolume.Builder], PortworxVolume.Builder | PortworxVolume
            ],
            /,
        ) -> "Volume.Builder": ...

        @overload
        def portworx_volume(
            self, value_or_callback: Never = ...
        ) -> "PortworxVolume.BuilderContext": ...

        def portworx_volume(self, value_or_callback=None, /):
            """
            portworxVolume represents a portworx volume attached and mounted on kubelets host machine
            """
            if self._in_context and value_or_callback is None:
                context = PortworxVolume.BuilderContext()
                context._parent_builder = self
                context._field_name = "portworx_volume"
                return context

            value = value_or_callback
            if callable(value_or_callback):
                output = value_or_callback(PortworxVolume.builder())
                if isinstance(output, PortworxVolume.Builder):
                    value = output.build()
                else:
                    value = output
            return self._set("portworx_volume", value)

        @overload
        def projected(self, value_or_callback: Optional[Projected], /) -> "Volume.Builder": ...

        @overload
        def projected(
            self,
            value_or_callback: Callable[[Projected.Builder], Projected.Builder | Projected],
            /,
        ) -> "Volume.Builder": ...

        @overload
        def projected(self, value_or_callback: Never = ...) -> "Projected.BuilderContext": ...

        def projected(self, value_or_callback=None, /):
            """
            projected items for all in one resources secrets, configmaps, and downward API
            """
            if self._in_context and value_or_callback is None:
                context = Projected.BuilderContext()
                context._parent_builder = self
                context._field_name = "projected"
                return context

            value = value_or_callback
            if callable(value_or_callback):
                output = value_or_callback(Projected.builder())
                if isinstance(output, Projected.Builder):
                    value = output.build()
                else:
                    value = output
            return self._set("projected", value)

        @overload
        def quobyte(self, value_or_callback: Optional[Quobyte], /) -> "Volume.Builder": ...

        @overload
        def quobyte(
            self,
            value_or_callback: Callable[[Quobyte.Builder], Quobyte.Builder | Quobyte],
            /,
        ) -> "Volume.Builder": ...

        @overload
        def quobyte(self, value_or_callback: Never = ...) -> "Quobyte.BuilderContext": ...

        def quobyte(self, value_or_callback=None, /):
            """
            quobyte represents a Quobyte mount on the host that shares a pod's lifetime
            """
            if self._in_context and value_or_callback is None:
                context = Quobyte.BuilderContext()
                context._parent_builder = self
                context._field_name = "quobyte"
                return context

            value = value_or_callback
            if callable(value_or_callback):
                output = value_or_callback(Quobyte.builder())
                if isinstance(output, Quobyte.Builder):
                    value = output.build()
                else:
                    value = output
            return self._set("quobyte", value)

        @overload
        def rbd(self, value_or_callback: Optional[Rbd], /) -> "Volume.Builder": ...

        @overload
        def rbd(
            self, value_or_callback: Callable[[Rbd.Builder], Rbd.Builder | Rbd], /
        ) -> "Volume.Builder": ...

        @overload
        def rbd(self, value_or_callback: Never = ...) -> "Rbd.BuilderContext": ...

        def rbd(self, value_or_callback=None, /):
            """
            rbd represents a Rados Block Device mount on the host that shares a pod's lifetime.
            More info: https://examples.k8s.io/volumes/rbd/README.md
            """
            if self._in_context and value_or_callback is None:
                context = Rbd.BuilderContext()
                context._parent_builder = self
                context._field_name = "rbd"
                return context

            value = value_or_callback
            if callable(value_or_callback):
                output = value_or_callback(Rbd.builder())
                if isinstance(output, Rbd.Builder):
                    value = output.build()
                else:
                    value = output
            return self._set("rbd", value)

        @overload
        def scale_io(self, value_or_callback: Optional[ScaleIo], /) -> "Volume.Builder": ...

        @overload
        def scale_io(
            self,
            value_or_callback: Callable[[ScaleIo.Builder], ScaleIo.Builder | ScaleIo],
            /,
        ) -> "Volume.Builder": ...

        @overload
        def scale_io(self, value_or_callback: Never = ...) -> "ScaleIo.BuilderContext": ...

        def scale_io(self, value_or_callback=None, /):
            """
            scaleIO represents a ScaleIO persistent volume attached and mounted on Kubernetes nodes.
            """
            if self._in_context and value_or_callback is None:
                context = ScaleIo.BuilderContext()
                context._parent_builder = self
                context._field_name = "scale_io"
                return context

            value = value_or_callback
            if callable(value_or_callback):
                output = value_or_callback(ScaleIo.builder())
                if isinstance(output, ScaleIo.Builder):
                    value = output.build()
                else:
                    value = output
            return self._set("scale_io", value)

        @overload
        def secret(self, value_or_callback: Optional[SecretModel4], /) -> "Volume.Builder": ...

        @overload
        def secret(
            self,
            value_or_callback: Callable[
                [SecretModel4.Builder], SecretModel4.Builder | SecretModel4
            ],
            /,
        ) -> "Volume.Builder": ...

        @overload
        def secret(self, value_or_callback: Never = ...) -> "SecretModel4.BuilderContext": ...

        def secret(self, value_or_callback=None, /):
            """
            secret represents a secret that should populate this volume.
            More info: https://kubernetes.io/docs/concepts/storage/volumes#secret
            """
            if self._in_context and value_or_callback is None:
                context = SecretModel4.BuilderContext()
                context._parent_builder = self
                context._field_name = "secret"
                return context

            value = value_or_callback
            if callable(value_or_callback):
                output = value_or_callback(SecretModel4.builder())
                if isinstance(output, SecretModel4.Builder):
                    value = output.build()
                else:
                    value = output
            return self._set("secret", value)

        @overload
        def storageos(self, value_or_callback: Optional[Storageos], /) -> "Volume.Builder": ...

        @overload
        def storageos(
            self,
            value_or_callback: Callable[[Storageos.Builder], Storageos.Builder | Storageos],
            /,
        ) -> "Volume.Builder": ...

        @overload
        def storageos(self, value_or_callback: Never = ...) -> "Storageos.BuilderContext": ...

        def storageos(self, value_or_callback=None, /):
            """
            storageOS represents a StorageOS volume attached and mounted on Kubernetes nodes.
            """
            if self._in_context and value_or_callback is None:
                context = Storageos.BuilderContext()
                context._parent_builder = self
                context._field_name = "storageos"
                return context

            value = value_or_callback
            if callable(value_or_callback):
                output = value_or_callback(Storageos.builder())
                if isinstance(output, Storageos.Builder):
                    value = output.build()
                else:
                    value = output
            return self._set("storageos", value)

        @overload
        def vsphere_volume(
            self, value_or_callback: Optional[VsphereVolume], /
        ) -> "Volume.Builder": ...

        @overload
        def vsphere_volume(
            self,
            value_or_callback: Callable[
                [VsphereVolume.Builder], VsphereVolume.Builder | VsphereVolume
            ],
            /,
        ) -> "Volume.Builder": ...

        @overload
        def vsphere_volume(
            self, value_or_callback: Never = ...
        ) -> "VsphereVolume.BuilderContext": ...

        def vsphere_volume(self, value_or_callback=None, /):
            """
            vsphereVolume represents a vSphere volume attached and mounted on kubelets host machine
            """
            if self._in_context and value_or_callback is None:
                context = VsphereVolume.BuilderContext()
                context._parent_builder = self
                context._field_name = "vsphere_volume"
                return context

            value = value_or_callback
            if callable(value_or_callback):
                output = value_or_callback(VsphereVolume.builder())
                if isinstance(output, VsphereVolume.Builder):
                    value = output.build()
                else:
                    value = output
            return self._set("vsphere_volume", value)

    class BuilderContext(BuilderContextBase["Volume.Builder"]):
        def model_post_init(self, __context) -> None:
            self._builder = Volume.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 Volume."""
        return cls.BuilderContext()

    class ListBuilder(GenericListBuilder["Volume", Builder]):
        def __init__(self):
            raise NotImplementedError(
                "This class is not meant to be instantiated. Use Volume.list_builder() instead."
            )

    @classmethod
    def list_builder(cls) -> ListBuilder:
        return GenericListBuilder[cls, cls.Builder]()  # type: ignore

    aws_elastic_block_store: Annotated[
        Optional[AwsElasticBlockStore], Field(alias="awsElasticBlockStore")
    ] = None
    """
    awsElasticBlockStore represents an AWS Disk resource that is attached to a
    kubelet's host machine and then exposed to the pod.
    More info: https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore
    """
    azure_disk: Annotated[Optional[AzureDisk], Field(alias="azureDisk")] = None
    """
    azureDisk represents an Azure Data Disk mount on the host and bind mount to the pod.
    """
    azure_file: Annotated[Optional[AzureFile], Field(alias="azureFile")] = None
    """
    azureFile represents an Azure File Service mount on the host and bind mount to the pod.
    """
    cephfs: Optional[Cephfs] = None
    """
    cephFS represents a Ceph FS mount on the host that shares a pod's lifetime
    """
    cinder: Optional[Cinder] = None
    """
    cinder represents a cinder volume attached and mounted on kubelets host machine.
    More info: https://examples.k8s.io/mysql-cinder-pd/README.md
    """
    config_map: Annotated[Optional[ConfigMap], Field(alias="configMap")] = None
    """
    configMap represents a configMap that should populate this volume
    """
    csi: Optional[Csi] = None
    """
    csi (Container Storage Interface) represents ephemeral storage that is handled by certain external CSI drivers (Beta feature).
    """
    downward_api: Annotated[Optional[DownwardApi], Field(alias="downwardAPI")] = None
    """
    downwardAPI represents downward API about the pod that should populate this volume
    """
    empty_dir: Annotated[Optional[EmptyDir], Field(alias="emptyDir")] = None
    """
    emptyDir represents a temporary directory that shares a pod's lifetime.
    More info: https://kubernetes.io/docs/concepts/storage/volumes#emptydir
    """
    ephemeral: Optional[Ephemeral] = None
    """
    ephemeral represents a volume that is handled by a cluster storage driver.
    The volume's lifecycle is tied to the pod that defines it - it will be created before the pod starts,
    and deleted when the pod is removed.

    Use this if:
    a) the volume is only needed while the pod runs,
    b) features of normal volumes like restoring from snapshot or capacity
       tracking are needed,
    c) the storage driver is specified through a storage class, and
    d) the storage driver supports dynamic volume provisioning through
       a PersistentVolumeClaim (see EphemeralVolumeSource for more
       information on the connection between this volume type
       and PersistentVolumeClaim).

    Use PersistentVolumeClaim or one of the vendor-specific
    APIs for volumes that persist for longer than the lifecycle
    of an individual pod.

    Use CSI for light-weight local ephemeral volumes if the CSI driver is meant to
    be used that way - see the documentation of the driver for
    more information.

    A pod can use both types of ephemeral volumes and
    persistent volumes at the same time.
    """
    fc: Optional[Fc] = None
    """
    fc represents a Fibre Channel resource that is attached to a kubelet's host machine and then exposed to the pod.
    """
    flex_volume: Annotated[Optional[FlexVolume], Field(alias="flexVolume")] = None
    """
    flexVolume represents a generic volume resource that is
    provisioned/attached using an exec based plugin.
    """
    flocker: Optional[Flocker] = None
    """
    flocker represents a Flocker volume attached to a kubelet's host machine. This depends on the Flocker control service being running
    """
    gce_persistent_disk: Annotated[
        Optional[GcePersistentDisk], Field(alias="gcePersistentDisk")
    ] = None
    """
    gcePersistentDisk represents a GCE Disk resource that is attached to a
    kubelet's host machine and then exposed to the pod.
    More info: https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk
    """
    git_repo: Annotated[Optional[GitRepo], Field(alias="gitRepo")] = None
    """
    gitRepo represents a git repository at a particular revision.
    DEPRECATED: GitRepo is deprecated. To provision a container with a git repo, mount an
    EmptyDir into an InitContainer that clones the repo using git, then mount the EmptyDir
    into the Pod's container.
    """
    glusterfs: Optional[Glusterfs] = None
    """
    glusterfs represents a Glusterfs mount on the host that shares a pod's lifetime.
    More info: https://examples.k8s.io/volumes/glusterfs/README.md
    """
    host_path: Annotated[Optional[HostPath], Field(alias="hostPath")] = None
    """
    hostPath represents a pre-existing file or directory on the host
    machine that is directly exposed to the container. This is generally
    used for system agents or other privileged things that are allowed
    to see the host machine. Most containers will NOT need this.
    More info: https://kubernetes.io/docs/concepts/storage/volumes#hostpath
    """
    image: Optional[Image] = None
    """
    image represents an OCI object (a container image or artifact) pulled and mounted on the kubelet's host machine.
    The volume is resolved at pod startup depending on which PullPolicy value is provided:

    - Always: the kubelet always attempts to pull the reference. Container creation will fail If the pull fails.
    - Never: the kubelet never pulls the reference and only uses a local image or artifact. Container creation will fail if the reference isn't present.
    - IfNotPresent: the kubelet pulls if the reference isn't already present on disk. Container creation will fail if the reference isn't present and the pull fails.

    The volume gets re-resolved if the pod gets deleted and recreated, which means that new remote content will become available on pod recreation.
    A failure to resolve or pull the image during pod startup will block containers from starting and may add significant latency. Failures will be retried using normal volume backoff and will be reported on the pod reason and message.
    The types of objects that may be mounted by this volume are defined by the container runtime implementation on a host machine and at minimum must include all valid types supported by the container image field.
    The OCI object gets mounted in a single directory (spec.containers[*].volumeMounts.mountPath) by merging the manifest layers in the same way as for container images.
    The volume will be mounted read-only (ro) and non-executable files (noexec).
    Sub path mounts for containers are not supported (spec.containers[*].volumeMounts.subpath).
    The field spec.securityContext.fsGroupChangePolicy has no effect on this volume type.
    """
    iscsi: Optional[Iscsi] = None
    """
    iscsi represents an ISCSI Disk resource that is attached to a
    kubelet's host machine and then exposed to the pod.
    More info: https://examples.k8s.io/volumes/iscsi/README.md
    """
    name: str
    """
    name of the volume.
    Must be a DNS_LABEL and unique within the pod.
    More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
    """
    nfs: Optional[Nfs] = None
    """
    nfs represents an NFS mount on the host that shares a pod's lifetime
    More info: https://kubernetes.io/docs/concepts/storage/volumes#nfs
    """
    persistent_volume_claim: Annotated[
        Optional[PersistentVolumeClaim], Field(alias="persistentVolumeClaim")
    ] = None
    """
    persistentVolumeClaimVolumeSource represents a reference to a
    PersistentVolumeClaim in the same namespace.
    More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#persistentvolumeclaims
    """
    photon_persistent_disk: Annotated[
        Optional[PhotonPersistentDisk], Field(alias="photonPersistentDisk")
    ] = None
    """
    photonPersistentDisk represents a PhotonController persistent disk attached and mounted on kubelets host machine
    """
    portworx_volume: Annotated[Optional[PortworxVolume], Field(alias="portworxVolume")] = None
    """
    portworxVolume represents a portworx volume attached and mounted on kubelets host machine
    """
    projected: Optional[Projected] = None
    """
    projected items for all in one resources secrets, configmaps, and downward API
    """
    quobyte: Optional[Quobyte] = None
    """
    quobyte represents a Quobyte mount on the host that shares a pod's lifetime
    """
    rbd: Optional[Rbd] = None
    """
    rbd represents a Rados Block Device mount on the host that shares a pod's lifetime.
    More info: https://examples.k8s.io/volumes/rbd/README.md
    """
    scale_io: Annotated[Optional[ScaleIo], Field(alias="scaleIO")] = None
    """
    scaleIO represents a ScaleIO persistent volume attached and mounted on Kubernetes nodes.
    """
    secret: Optional[SecretModel4] = None
    """
    secret represents a secret that should populate this volume.
    More info: https://kubernetes.io/docs/concepts/storage/volumes#secret
    """
    storageos: Optional[Storageos] = None
    """
    storageOS represents a StorageOS volume attached and mounted on Kubernetes nodes.
    """
    vsphere_volume: Annotated[Optional[VsphereVolume], Field(alias="vsphereVolume")] = None
    """
    vsphereVolume represents a vSphere volume attached and mounted on kubelets host machine
    """


class SpecModel(BaseModel):
    class Builder(BaseModelBuilder):
        @property
        def cls(self) -> Type["SpecModel"]:
            return SpecModel

        def build(self) -> "SpecModel":
            return SpecModel(**self._attrs)

        def active_deadline_seconds(self, value: Optional[int], /) -> Self:
            """
            Optional duration in seconds the pod may be active on the node relative to
            StartTime before the system will actively try to mark it failed and kill associated containers.
            Value must be a positive integer.
            """
            return self._set("active_deadline_seconds", value)

        @overload
        def affinity(self, value_or_callback: Optional[Affinity], /) -> "SpecModel.Builder": ...

        @overload
        def affinity(
            self,
            value_or_callback: Callable[[Affinity.Builder], Affinity.Builder | Affinity],
            /,
        ) -> "SpecModel.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)

        def automount_service_account_token(self, value: Optional[bool], /) -> Self:
            """
            AutomountServiceAccountToken indicates whether a service account token should be automatically mounted.
            """
            return self._set("automount_service_account_token", value)

        @overload
        def containers(self, value_or_callback: List[Container], /) -> "SpecModel.Builder": ...

        @overload
        def containers(
            self,
            value_or_callback: Callable[
                [GenericListBuilder[Container, Container.Builder]],
                GenericListBuilder[Container, Container.Builder] | List[Container],
            ],
            /,
        ) -> "SpecModel.Builder": ...

        @overload
        def containers(
            self, value_or_callback: Never = ...
        ) -> ListBuilderContext[Container.Builder]: ...

        def containers(self, value_or_callback=None, /):
            """
            List of containers belonging to the pod.
            Containers cannot currently be added or removed.
            There must be at least one container in a Pod.
            Cannot be updated.
            """
            if self._in_context and value_or_callback is None:
                context = ListBuilderContext[Container.Builder]()
                context._parent_builder = self
                context._field_name = "containers"
                return context

            value = value_or_callback
            if callable(value_or_callback):
                output = value_or_callback(Container.list_builder())
                if isinstance(output, GenericListBuilder):
                    value = output.build()
                else:
                    value = output
            return self._set("containers", value)

        @overload
        def dns_config(self, value_or_callback: Optional[DnsConfig], /) -> "SpecModel.Builder": ...

        @overload
        def dns_config(
            self,
            value_or_callback: Callable[[DnsConfig.Builder], DnsConfig.Builder | DnsConfig],
            /,
        ) -> "SpecModel.Builder": ...

        @overload
        def dns_config(self, value_or_callback: Never = ...) -> "DnsConfig.BuilderContext": ...

        def dns_config(self, value_or_callback=None, /):
            """
            Specifies the DNS parameters of a pod.
            Parameters specified here will be merged to the generated DNS
            configuration based on DNSPolicy.
            """
            if self._in_context and value_or_callback is None:
                context = DnsConfig.BuilderContext()
                context._parent_builder = self
                context._field_name = "dns_config"
                return context

            value = value_or_callback
            if callable(value_or_callback):
                output = value_or_callback(DnsConfig.builder())
                if isinstance(output, DnsConfig.Builder):
                    value = output.build()
                else:
                    value = output
            return self._set("dns_config", value)

        def dns_policy(self, value: Optional[str], /) -> Self:
            """
            Set DNS policy for the pod.
            Defaults to "ClusterFirst".
            Valid values are 'ClusterFirstWithHostNet', 'ClusterFirst', 'Default' or 'None'.
            DNS parameters given in DNSConfig will be merged with the policy selected with DNSPolicy.
            To have DNS options set along with hostNetwork, you have to specify DNS policy
            explicitly to 'ClusterFirstWithHostNet'.
            """
            return self._set("dns_policy", value)

        def enable_service_links(self, value: Optional[bool], /) -> Self:
            """
            EnableServiceLinks indicates whether information about services should be injected into pod's
            environment variables, matching the syntax of Docker links.
            Optional: Defaults to true.
            """
            return self._set("enable_service_links", value)

        @overload
        def ephemeral_containers(
            self, value_or_callback: List[EphemeralContainer], /
        ) -> "SpecModel.Builder": ...

        @overload
        def ephemeral_containers(
            self,
            value_or_callback: Callable[
                [GenericListBuilder[EphemeralContainer, EphemeralContainer.Builder]],
                GenericListBuilder[EphemeralContainer, EphemeralContainer.Builder]
                | List[EphemeralContainer],
            ],
            /,
        ) -> "SpecModel.Builder": ...

        @overload
        def ephemeral_containers(
            self, value_or_callback: Never = ...
        ) -> ListBuilderContext[EphemeralContainer.Builder]: ...

        def ephemeral_containers(self, value_or_callback=None, /):
            """
            List of ephemeral containers run in this pod. Ephemeral containers may be run in an existing
            pod to perform user-initiated actions such as debugging. This list cannot be specified when
            creating a pod, and it cannot be modified by updating the pod spec. In order to add an
            ephemeral container to an existing pod, use the pod's ephemeralcontainers subresource.
            """
            if self._in_context and value_or_callback is None:
                context = ListBuilderContext[EphemeralContainer.Builder]()
                context._parent_builder = self
                context._field_name = "ephemeral_containers"
                return context

            value = value_or_callback
            if callable(value_or_callback):
                output = value_or_callback(EphemeralContainer.list_builder())
                if isinstance(output, GenericListBuilder):
                    value = output.build()
                else:
                    value = output
            return self._set("ephemeral_containers", value)

        @overload
        def host_aliases(self, value_or_callback: List[HostAliase], /) -> "SpecModel.Builder": ...

        @overload
        def host_aliases(
            self,
            value_or_callback: Callable[
                [GenericListBuilder[HostAliase, HostAliase.Builder]],
                GenericListBuilder[HostAliase, HostAliase.Builder] | List[HostAliase],
            ],
            /,
        ) -> "SpecModel.Builder": ...

        @overload
        def host_aliases(
            self, value_or_callback: Never = ...
        ) -> ListBuilderContext[HostAliase.Builder]: ...

        def host_aliases(self, value_or_callback=None, /):
            """
            HostAliases is an optional list of hosts and IPs that will be injected into the pod's hosts
            file if specified.
            """
            if self._in_context and value_or_callback is None:
                context = ListBuilderContext[HostAliase.Builder]()
                context._parent_builder = self
                context._field_name = "host_aliases"
                return context

            value = value_or_callback
            if callable(value_or_callback):
                output = value_or_callback(HostAliase.list_builder())
                if isinstance(output, GenericListBuilder):
                    value = output.build()
                else:
                    value = output
            return self._set("host_aliases", value)

        def host_ipc(self, value: Optional[bool], /) -> Self:
            """
            Use the host's ipc namespace.
            Optional: Default to false.
            """
            return self._set("host_ipc", value)

        def host_network(self, value: Optional[bool], /) -> Self:
            """
            Host networking requested for this pod. Use the host's network namespace.
            If this option is set, the ports that will be used must be specified.
            Default to false.
            """
            return self._set("host_network", value)

        def host_pid(self, value: Optional[bool], /) -> Self:
            """
            Use the host's pid namespace.
            Optional: Default to false.
            """
            return self._set("host_pid", value)

        def host_users(self, value: Optional[bool], /) -> Self:
            """
            Use the host's user namespace.
            Optional: Default to true.
            If set to true or not present, the pod will be run in the host user namespace, useful
            for when the pod needs a feature only available to the host user namespace, such as
            loading a kernel module with CAP_SYS_MODULE.
            When set to false, a new userns is created for the pod. Setting false is useful for
            mitigating container breakout vulnerabilities even allowing users to run their
            containers as root without actually having root privileges on the host.
            This field is alpha-level and is only honored by servers that enable the UserNamespacesSupport feature.
            """
            return self._set("host_users", value)

        def hostname(self, value: Optional[str], /) -> Self:
            """
            Specifies the hostname of the Pod
            If not specified, the pod's hostname will be set to a system-defined value.
            """
            return self._set("hostname", value)

        @overload
        def image_pull_secrets(
            self, value_or_callback: List[ImagePullSecret], /
        ) -> "SpecModel.Builder": ...

        @overload
        def image_pull_secrets(
            self,
            value_or_callback: Callable[
                [GenericListBuilder[ImagePullSecret, ImagePullSecret.Builder]],
                GenericListBuilder[ImagePullSecret, ImagePullSecret.Builder]
                | List[ImagePullSecret],
            ],
            /,
        ) -> "SpecModel.Builder": ...

        @overload
        def image_pull_secrets(
            self, value_or_callback: Never = ...
        ) -> ListBuilderContext[ImagePullSecret.Builder]: ...

        def image_pull_secrets(self, value_or_callback=None, /):
            """
            ImagePullSecrets is an optional list of references to secrets in the same namespace to use for pulling any of the images used by this PodSpec.
            If specified, these secrets will be passed to individual puller implementations for them to use.
            More info: https://kubernetes.io/docs/concepts/containers/images#specifying-imagepullsecrets-on-a-pod
            """
            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)

        @overload
        def init_containers(
            self, value_or_callback: List[InitContainer], /
        ) -> "SpecModel.Builder": ...

        @overload
        def init_containers(
            self,
            value_or_callback: Callable[
                [GenericListBuilder[InitContainer, InitContainer.Builder]],
                GenericListBuilder[InitContainer, InitContainer.Builder] | List[InitContainer],
            ],
            /,
        ) -> "SpecModel.Builder": ...

        @overload
        def init_containers(
            self, value_or_callback: Never = ...
        ) -> ListBuilderContext[InitContainer.Builder]: ...

        def init_containers(self, value_or_callback=None, /):
            """
            List of initialization containers belonging to the pod.
            Init containers are executed in order prior to containers being started. If any
            init container fails, the pod is considered to have failed and is handled according
            to its restartPolicy. The name for an init container or normal container must be
            unique among all containers.
            Init containers may not have Lifecycle actions, Readiness probes, Liveness probes, or Startup probes.
            The resourceRequirements of an init container are taken into account during scheduling
            by finding the highest request/limit for each resource type, and then using the max of
            of that value or the sum of the normal containers. Limits are applied to init containers
            in a similar fashion.
            Init containers cannot currently be added or removed.
            Cannot be updated.
            More info: https://kubernetes.io/docs/concepts/workloads/pods/init-containers/
            """
            if self._in_context and value_or_callback is None:
                context = ListBuilderContext[InitContainer.Builder]()
                context._parent_builder = self
                context._field_name = "init_containers"
                return context

            value = value_or_callback
            if callable(value_or_callback):
                output = value_or_callback(InitContainer.list_builder())
                if isinstance(output, GenericListBuilder):
                    value = output.build()
                else:
                    value = output
            return self._set("init_containers", value)

        def node_name(self, value: Optional[str], /) -> Self:
            """
            NodeName indicates in which node this pod is scheduled.
            If empty, this pod is a candidate for scheduling by the scheduler defined in schedulerName.
            Once this field is set, the kubelet for this node becomes responsible for the lifecycle of this pod.
            This field should not be used to express a desire for the pod to be scheduled on a specific node.
            https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#nodename
            """
            return self._set("node_name", 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)

        @overload
        def os(self, value_or_callback: Optional[Os], /) -> "SpecModel.Builder": ...

        @overload
        def os(
            self, value_or_callback: Callable[[Os.Builder], Os.Builder | Os], /
        ) -> "SpecModel.Builder": ...

        @overload
        def os(self, value_or_callback: Never = ...) -> "Os.BuilderContext": ...

        def os(self, value_or_callback=None, /):
            """
            Specifies the OS of the containers in the pod.
            Some pod and container fields are restricted if this is set.

            If the OS field is set to linux, the following fields must be unset:
            -securityContext.windowsOptions

            If the OS field is set to windows, following fields must be unset:
            - spec.hostPID
            - spec.hostIPC
            - spec.hostUsers
            - spec.securityContext.appArmorProfile
            - spec.securityContext.seLinuxOptions
            - spec.securityContext.seccompProfile
            - spec.securityContext.fsGroup
            - spec.securityContext.fsGroupChangePolicy
            - spec.securityContext.sysctls
            - spec.shareProcessNamespace
            - spec.securityContext.runAsUser
            - spec.securityContext.runAsGroup
            - spec.securityContext.supplementalGroups
            - spec.securityContext.supplementalGroupsPolicy
            - spec.containers[*].securityContext.appArmorProfile
            - spec.containers[*].securityContext.seLinuxOptions
            - spec.containers[*].securityContext.seccompProfile
            - spec.containers[*].securityContext.capabilities
            - spec.containers[*].securityContext.readOnlyRootFilesystem
            - spec.containers[*].securityContext.privileged
            - spec.containers[*].securityContext.allowPrivilegeEscalation
            - spec.containers[*].securityContext.procMount
            - spec.containers[*].securityContext.runAsUser
            - spec.containers[*].securityContext.runAsGroup
            """
            if self._in_context and value_or_callback is None:
                context = Os.BuilderContext()
                context._parent_builder = self
                context._field_name = "os"
                return context

            value = value_or_callback
            if callable(value_or_callback):
                output = value_or_callback(Os.builder())
                if isinstance(output, Os.Builder):
                    value = output.build()
                else:
                    value = output
            return self._set("os", value)

        def overhead(self, value: Optional[Dict[str, Union[Overhead, OverheadModel]]], /) -> Self:
            """
            Overhead represents the resource overhead associated with running a pod for a given RuntimeClass.
            This field will be autopopulated at admission time by the RuntimeClass admission controller. If
            the RuntimeClass admission controller is enabled, overhead must not be set in Pod create requests.
            The RuntimeClass admission controller will reject Pod create requests which have the overhead already
            set. If RuntimeClass is configured and selected in the PodSpec, Overhead will be set to the value
            defined in the corresponding RuntimeClass, otherwise it will remain unset and treated as zero.
            More info: https://git.k8s.io/enhancements/keps/sig-node/688-pod-overhead/README.md
            """
            return self._set("overhead", value)

        def preemption_policy(self, value: Optional[str], /) -> Self:
            """
            PreemptionPolicy is the Policy for preempting pods with lower priority.
            One of Never, PreemptLowerPriority.
            Defaults to PreemptLowerPriority if unset.
            """
            return self._set("preemption_policy", value)

        def priority(self, value: Optional[int], /) -> Self:
            """
            The priority value. Various system components use this field to find the
            priority of the pod. When Priority Admission Controller is enabled, it
            prevents users from setting this field. The admission controller populates
            this field from PriorityClassName.
            The higher the value, the higher the priority.
            """
            return self._set("priority", value)

        def priority_class_name(self, value: Optional[str], /) -> Self:
            """
            If specified, indicates the pod's priority. "system-node-critical" and
            "system-cluster-critical" are two special keywords which indicate the
            highest priorities with the former being the highest priority. Any other
            name must be defined by creating a PriorityClass object with that name.
            If not specified, the pod priority will be default or zero if there is no
            default.
            """
            return self._set("priority_class_name", value)

        @overload
        def readiness_gates(
            self, value_or_callback: List[ReadinessGate], /
        ) -> "SpecModel.Builder": ...

        @overload
        def readiness_gates(
            self,
            value_or_callback: Callable[
                [GenericListBuilder[ReadinessGate, ReadinessGate.Builder]],
                GenericListBuilder[ReadinessGate, ReadinessGate.Builder] | List[ReadinessGate],
            ],
            /,
        ) -> "SpecModel.Builder": ...

        @overload
        def readiness_gates(
            self, value_or_callback: Never = ...
        ) -> ListBuilderContext[ReadinessGate.Builder]: ...

        def readiness_gates(self, value_or_callback=None, /):
            """
            If specified, all readiness gates will be evaluated for pod readiness.
            A pod is ready when all its containers are ready AND
            all conditions specified in the readiness gates have status equal to "True"
            More info: https://git.k8s.io/enhancements/keps/sig-network/580-pod-readiness-gates
            """
            if self._in_context and value_or_callback is None:
                context = ListBuilderContext[ReadinessGate.Builder]()
                context._parent_builder = self
                context._field_name = "readiness_gates"
                return context

            value = value_or_callback
            if callable(value_or_callback):
                output = value_or_callback(ReadinessGate.list_builder())
                if isinstance(output, GenericListBuilder):
                    value = output.build()
                else:
                    value = output
            return self._set("readiness_gates", value)

        @overload
        def resource_claims(
            self, value_or_callback: List[ResourceClaim], /
        ) -> "SpecModel.Builder": ...

        @overload
        def resource_claims(
            self,
            value_or_callback: Callable[
                [GenericListBuilder[ResourceClaim, ResourceClaim.Builder]],
                GenericListBuilder[ResourceClaim, ResourceClaim.Builder] | List[ResourceClaim],
            ],
            /,
        ) -> "SpecModel.Builder": ...

        @overload
        def resource_claims(
            self, value_or_callback: Never = ...
        ) -> ListBuilderContext[ResourceClaim.Builder]: ...

        def resource_claims(self, value_or_callback=None, /):
            """
            ResourceClaims defines which ResourceClaims must be allocated
            and reserved before the Pod is allowed to start. The resources
            will be made available to those containers which consume them
            by name.

            This is an alpha field and requires enabling the
            DynamicResourceAllocation feature gate.

            This field is immutable.
            """
            if self._in_context and value_or_callback is None:
                context = ListBuilderContext[ResourceClaim.Builder]()
                context._parent_builder = self
                context._field_name = "resource_claims"
                return context

            value = value_or_callback
            if callable(value_or_callback):
                output = value_or_callback(ResourceClaim.list_builder())
                if isinstance(output, GenericListBuilder):
                    value = output.build()
                else:
                    value = output
            return self._set("resource_claims", value)

        def restart_policy(self, value: Optional[str], /) -> Self:
            """
            Restart policy for all containers within the pod.
            One of Always, OnFailure, Never. In some contexts, only a subset of those values may be permitted.
            Default to Always.
            More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#restart-policy
            """
            return self._set("restart_policy", value)

        def runtime_class_name(self, value: Optional[str], /) -> Self:
            """
            RuntimeClassName refers to a RuntimeClass object in the node.k8s.io group, which should be used
            to run this pod.  If no RuntimeClass resource matches the named class, the pod will not be run.
            If unset or empty, the "legacy" RuntimeClass will be used, which is an implicit class with an
            empty definition that uses the default runtime handler.
            More info: https://git.k8s.io/enhancements/keps/sig-node/585-runtime-class
            """
            return self._set("runtime_class_name", value)

        def scheduler_name(self, value: Optional[str], /) -> Self:
            """
            If specified, the pod will be dispatched by specified scheduler.
            If not specified, the pod will be dispatched by default scheduler.
            """
            return self._set("scheduler_name", value)

        @overload
        def scheduling_gates(
            self, value_or_callback: List[SchedulingGate], /
        ) -> "SpecModel.Builder": ...

        @overload
        def scheduling_gates(
            self,
            value_or_callback: Callable[
                [GenericListBuilder[SchedulingGate, SchedulingGate.Builder]],
                GenericListBuilder[SchedulingGate, SchedulingGate.Builder] | List[SchedulingGate],
            ],
            /,
        ) -> "SpecModel.Builder": ...

        @overload
        def scheduling_gates(
            self, value_or_callback: Never = ...
        ) -> ListBuilderContext[SchedulingGate.Builder]: ...

        def scheduling_gates(self, value_or_callback=None, /):
            """
            SchedulingGates is an opaque list of values that if specified will block scheduling the pod.
            If schedulingGates is not empty, the pod will stay in the SchedulingGated state and the
            scheduler will not attempt to schedule the pod.

            SchedulingGates can only be set at pod creation time, and be removed only afterwards.
            """
            if self._in_context and value_or_callback is None:
                context = ListBuilderContext[SchedulingGate.Builder]()
                context._parent_builder = self
                context._field_name = "scheduling_gates"
                return context

            value = value_or_callback
            if callable(value_or_callback):
                output = value_or_callback(SchedulingGate.list_builder())
                if isinstance(output, GenericListBuilder):
                    value = output.build()
                else:
                    value = output
            return self._set("scheduling_gates", value)

        @overload
        def security_context(
            self, value_or_callback: Optional[SecurityContextModel], /
        ) -> "SpecModel.Builder": ...

        @overload
        def security_context(
            self,
            value_or_callback: Callable[
                [SecurityContextModel.Builder],
                SecurityContextModel.Builder | SecurityContextModel,
            ],
            /,
        ) -> "SpecModel.Builder": ...

        @overload
        def security_context(
            self, value_or_callback: Never = ...
        ) -> "SecurityContextModel.BuilderContext": ...

        def security_context(self, value_or_callback=None, /):
            """
            SecurityContext holds pod-level security attributes and common container settings.
            Optional: Defaults to empty.  See type description for default values of each field.
            """
            if self._in_context and value_or_callback is None:
                context = SecurityContextModel.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(SecurityContextModel.builder())
                if isinstance(output, SecurityContextModel.Builder):
                    value = output.build()
                else:
                    value = output
            return self._set("security_context", value)

        def service_account(self, value: Optional[str], /) -> Self:
            """
            DeprecatedServiceAccount is a deprecated alias for ServiceAccountName.
            Deprecated: Use serviceAccountName instead.
            """
            return self._set("service_account", value)

        def service_account_name(self, value: Optional[str], /) -> Self:
            """
            ServiceAccountName is the name of the ServiceAccount to use to run this pod.
            More info: https://kubernetes.io/docs/tasks/configure-pod-container/configure-service-account/
            """
            return self._set("service_account_name", value)

        def set_hostname_as_fqdn(self, value: Optional[bool], /) -> Self:
            """
            If true the pod's hostname will be configured as the pod's FQDN, rather than the leaf name (the default).
            In Linux containers, this means setting the FQDN in the hostname field of the kernel (the nodename field of struct utsname).
            In Windows containers, this means setting the registry value of hostname for the registry key HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Services\\Tcpip\\Parameters to FQDN.
            If a pod does not have FQDN, this has no effect.
            Default to false.
            """
            return self._set("set_hostname_as_fqdn", value)

        def share_process_namespace(self, value: Optional[bool], /) -> Self:
            """
            Share a single process namespace between all of the containers in a pod.
            When this is set containers will be able to view and signal processes from other containers
            in the same pod, and the first process in each container will not be assigned PID 1.
            HostPID and ShareProcessNamespace cannot both be set.
            Optional: Default to false.
            """
            return self._set("share_process_namespace", value)

        def subdomain(self, value: Optional[str], /) -> Self:
            """
            If specified, the fully qualified Pod hostname will be "<hostname>.<subdomain>.<pod namespace>.svc.<cluster domain>".
            If not specified, the pod will not have a domainname at all.
            """
            return self._set("subdomain", value)

        def termination_grace_period_seconds(self, value: Optional[int], /) -> Self:
            """
            Optional duration in seconds the pod needs to terminate gracefully. May be decreased in delete request.
            Value must be non-negative integer. The value zero indicates stop immediately via
            the kill signal (no opportunity to shut down).
            If this value is nil, the default grace period will be used instead.
            The grace period is the duration in seconds after the processes running in the pod are sent
            a termination signal and the time when the processes are forcibly halted with a kill signal.
            Set this value longer than the expected cleanup time for your process.
            Defaults to 30 seconds.
            """
            return self._set("termination_grace_period_seconds", value)

        @overload
        def tolerations(self, value_or_callback: List[Toleration], /) -> "SpecModel.Builder": ...

        @overload
        def tolerations(
            self,
            value_or_callback: Callable[
                [GenericListBuilder[Toleration, Toleration.Builder]],
                GenericListBuilder[Toleration, Toleration.Builder] | List[Toleration],
            ],
            /,
        ) -> "SpecModel.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)

        @overload
        def topology_spread_constraints(
            self, value_or_callback: List[TopologySpreadConstraint], /
        ) -> "SpecModel.Builder": ...

        @overload
        def topology_spread_constraints(
            self,
            value_or_callback: Callable[
                [GenericListBuilder[TopologySpreadConstraint, TopologySpreadConstraint.Builder]],
                GenericListBuilder[TopologySpreadConstraint, TopologySpreadConstraint.Builder]
                | List[TopologySpreadConstraint],
            ],
            /,
        ) -> "SpecModel.Builder": ...

        @overload
        def topology_spread_constraints(
            self, value_or_callback: Never = ...
        ) -> ListBuilderContext[TopologySpreadConstraint.Builder]: ...

        def topology_spread_constraints(self, value_or_callback=None, /):
            """
            TopologySpreadConstraints describes how a group of pods ought to spread across topology
            domains. Scheduler will schedule pods in a way which abides by the constraints.
            All topologySpreadConstraints are ANDed.
            """
            if self._in_context and value_or_callback is None:
                context = ListBuilderContext[TopologySpreadConstraint.Builder]()
                context._parent_builder = self
                context._field_name = "topology_spread_constraints"
                return context

            value = value_or_callback
            if callable(value_or_callback):
                output = value_or_callback(TopologySpreadConstraint.list_builder())
                if isinstance(output, GenericListBuilder):
                    value = output.build()
                else:
                    value = output
            return self._set("topology_spread_constraints", value)

        @overload
        def volumes(self, value_or_callback: List[Volume], /) -> "SpecModel.Builder": ...

        @overload
        def volumes(
            self,
            value_or_callback: Callable[
                [GenericListBuilder[Volume, Volume.Builder]],
                GenericListBuilder[Volume, Volume.Builder] | List[Volume],
            ],
            /,
        ) -> "SpecModel.Builder": ...

        @overload
        def volumes(self, value_or_callback: Never = ...) -> ListBuilderContext[Volume.Builder]: ...

        def volumes(self, value_or_callback=None, /):
            """
            List of volumes that can be mounted by containers belonging to the pod.
            More info: https://kubernetes.io/docs/concepts/storage/volumes
            """
            if self._in_context and value_or_callback is None:
                context = ListBuilderContext[Volume.Builder]()
                context._parent_builder = self
                context._field_name = "volumes"
                return context

            value = value_or_callback
            if callable(value_or_callback):
                output = value_or_callback(Volume.list_builder())
                if isinstance(output, GenericListBuilder):
                    value = output.build()
                else:
                    value = output
            return self._set("volumes", value)

    class BuilderContext(BuilderContextBase["SpecModel.Builder"]):
        def model_post_init(self, __context) -> None:
            self._builder = SpecModel.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 SpecModel."""
        return cls.BuilderContext()

    class ListBuilder(GenericListBuilder["SpecModel", Builder]):
        def __init__(self):
            raise NotImplementedError(
                "This class is not meant to be instantiated. Use SpecModel.list_builder() instead."
            )

    @classmethod
    def list_builder(cls) -> ListBuilder:
        return GenericListBuilder[cls, cls.Builder]()  # type: ignore

    active_deadline_seconds: Annotated[Optional[int], Field(alias="activeDeadlineSeconds")] = None
    """
    Optional duration in seconds the pod may be active on the node relative to
    StartTime before the system will actively try to mark it failed and kill associated containers.
    Value must be a positive integer.
    """
    affinity: Optional[Affinity] = None
    """
    If specified, the pod's scheduling constraints
    """
    automount_service_account_token: Annotated[
        Optional[bool], Field(alias="automountServiceAccountToken")
    ] = None
    """
    AutomountServiceAccountToken indicates whether a service account token should be automatically mounted.
    """
    containers: List[Container]
    """
    List of containers belonging to the pod.
    Containers cannot currently be added or removed.
    There must be at least one container in a Pod.
    Cannot be updated.
    """
    dns_config: Annotated[Optional[DnsConfig], Field(alias="dnsConfig")] = None
    """
    Specifies the DNS parameters of a pod.
    Parameters specified here will be merged to the generated DNS
    configuration based on DNSPolicy.
    """
    dns_policy: Annotated[Optional[str], Field(alias="dnsPolicy")] = None
    """
    Set DNS policy for the pod.
    Defaults to "ClusterFirst".
    Valid values are 'ClusterFirstWithHostNet', 'ClusterFirst', 'Default' or 'None'.
    DNS parameters given in DNSConfig will be merged with the policy selected with DNSPolicy.
    To have DNS options set along with hostNetwork, you have to specify DNS policy
    explicitly to 'ClusterFirstWithHostNet'.
    """
    enable_service_links: Annotated[Optional[bool], Field(alias="enableServiceLinks")] = None
    """
    EnableServiceLinks indicates whether information about services should be injected into pod's
    environment variables, matching the syntax of Docker links.
    Optional: Defaults to true.
    """
    ephemeral_containers: Annotated[
        Optional[List[EphemeralContainer]], Field(alias="ephemeralContainers")
    ] = None
    """
    List of ephemeral containers run in this pod. Ephemeral containers may be run in an existing
    pod to perform user-initiated actions such as debugging. This list cannot be specified when
    creating a pod, and it cannot be modified by updating the pod spec. In order to add an
    ephemeral container to an existing pod, use the pod's ephemeralcontainers subresource.
    """
    host_aliases: Annotated[Optional[List[HostAliase]], Field(alias="hostAliases")] = None
    """
    HostAliases is an optional list of hosts and IPs that will be injected into the pod's hosts
    file if specified.
    """
    host_ipc: Annotated[Optional[bool], Field(alias="hostIPC")] = None
    """
    Use the host's ipc namespace.
    Optional: Default to false.
    """
    host_network: Annotated[Optional[bool], Field(alias="hostNetwork")] = None
    """
    Host networking requested for this pod. Use the host's network namespace.
    If this option is set, the ports that will be used must be specified.
    Default to false.
    """
    host_pid: Annotated[Optional[bool], Field(alias="hostPID")] = None
    """
    Use the host's pid namespace.
    Optional: Default to false.
    """
    host_users: Annotated[Optional[bool], Field(alias="hostUsers")] = None
    """
    Use the host's user namespace.
    Optional: Default to true.
    If set to true or not present, the pod will be run in the host user namespace, useful
    for when the pod needs a feature only available to the host user namespace, such as
    loading a kernel module with CAP_SYS_MODULE.
    When set to false, a new userns is created for the pod. Setting false is useful for
    mitigating container breakout vulnerabilities even allowing users to run their
    containers as root without actually having root privileges on the host.
    This field is alpha-level and is only honored by servers that enable the UserNamespacesSupport feature.
    """
    hostname: Optional[str] = None
    """
    Specifies the hostname of the Pod
    If not specified, the pod's hostname will be set to a system-defined value.
    """
    image_pull_secrets: Annotated[
        Optional[List[ImagePullSecret]], Field(alias="imagePullSecrets")
    ] = None
    """
    ImagePullSecrets is an optional list of references to secrets in the same namespace to use for pulling any of the images used by this PodSpec.
    If specified, these secrets will be passed to individual puller implementations for them to use.
    More info: https://kubernetes.io/docs/concepts/containers/images#specifying-imagepullsecrets-on-a-pod
    """
    init_containers: Annotated[Optional[List[InitContainer]], Field(alias="initContainers")] = None
    """
    List of initialization containers belonging to the pod.
    Init containers are executed in order prior to containers being started. If any
    init container fails, the pod is considered to have failed and is handled according
    to its restartPolicy. The name for an init container or normal container must be
    unique among all containers.
    Init containers may not have Lifecycle actions, Readiness probes, Liveness probes, or Startup probes.
    The resourceRequirements of an init container are taken into account during scheduling
    by finding the highest request/limit for each resource type, and then using the max of
    of that value or the sum of the normal containers. Limits are applied to init containers
    in a similar fashion.
    Init containers cannot currently be added or removed.
    Cannot be updated.
    More info: https://kubernetes.io/docs/concepts/workloads/pods/init-containers/
    """
    node_name: Annotated[Optional[str], Field(alias="nodeName")] = None
    """
    NodeName indicates in which node this pod is scheduled.
    If empty, this pod is a candidate for scheduling by the scheduler defined in schedulerName.
    Once this field is set, the kubelet for this node becomes responsible for the lifecycle of this pod.
    This field should not be used to express a desire for the pod to be scheduled on a specific node.
    https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#nodename
    """
    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/
    """
    os: Optional[Os] = None
    """
    Specifies the OS of the containers in the pod.
    Some pod and container fields are restricted if this is set.

    If the OS field is set to linux, the following fields must be unset:
    -securityContext.windowsOptions

    If the OS field is set to windows, following fields must be unset:
    - spec.hostPID
    - spec.hostIPC
    - spec.hostUsers
    - spec.securityContext.appArmorProfile
    - spec.securityContext.seLinuxOptions
    - spec.securityContext.seccompProfile
    - spec.securityContext.fsGroup
    - spec.securityContext.fsGroupChangePolicy
    - spec.securityContext.sysctls
    - spec.shareProcessNamespace
    - spec.securityContext.runAsUser
    - spec.securityContext.runAsGroup
    - spec.securityContext.supplementalGroups
    - spec.securityContext.supplementalGroupsPolicy
    - spec.containers[*].securityContext.appArmorProfile
    - spec.containers[*].securityContext.seLinuxOptions
    - spec.containers[*].securityContext.seccompProfile
    - spec.containers[*].securityContext.capabilities
    - spec.containers[*].securityContext.readOnlyRootFilesystem
    - spec.containers[*].securityContext.privileged
    - spec.containers[*].securityContext.allowPrivilegeEscalation
    - spec.containers[*].securityContext.procMount
    - spec.containers[*].securityContext.runAsUser
    - spec.containers[*].securityContext.runAsGroup
    """
    overhead: Optional[Dict[str, Union[Overhead, OverheadModel]]] = None
    """
    Overhead represents the resource overhead associated with running a pod for a given RuntimeClass.
    This field will be autopopulated at admission time by the RuntimeClass admission controller. If
    the RuntimeClass admission controller is enabled, overhead must not be set in Pod create requests.
    The RuntimeClass admission controller will reject Pod create requests which have the overhead already
    set. If RuntimeClass is configured and selected in the PodSpec, Overhead will be set to the value
    defined in the corresponding RuntimeClass, otherwise it will remain unset and treated as zero.
    More info: https://git.k8s.io/enhancements/keps/sig-node/688-pod-overhead/README.md
    """
    preemption_policy: Annotated[Optional[str], Field(alias="preemptionPolicy")] = None
    """
    PreemptionPolicy is the Policy for preempting pods with lower priority.
    One of Never, PreemptLowerPriority.
    Defaults to PreemptLowerPriority if unset.
    """
    priority: Optional[int] = None
    """
    The priority value. Various system components use this field to find the
    priority of the pod. When Priority Admission Controller is enabled, it
    prevents users from setting this field. The admission controller populates
    this field from PriorityClassName.
    The higher the value, the higher the priority.
    """
    priority_class_name: Annotated[Optional[str], Field(alias="priorityClassName")] = None
    """
    If specified, indicates the pod's priority. "system-node-critical" and
    "system-cluster-critical" are two special keywords which indicate the
    highest priorities with the former being the highest priority. Any other
    name must be defined by creating a PriorityClass object with that name.
    If not specified, the pod priority will be default or zero if there is no
    default.
    """
    readiness_gates: Annotated[Optional[List[ReadinessGate]], Field(alias="readinessGates")] = None
    """
    If specified, all readiness gates will be evaluated for pod readiness.
    A pod is ready when all its containers are ready AND
    all conditions specified in the readiness gates have status equal to "True"
    More info: https://git.k8s.io/enhancements/keps/sig-network/580-pod-readiness-gates
    """
    resource_claims: Annotated[Optional[List[ResourceClaim]], Field(alias="resourceClaims")] = None
    """
    ResourceClaims defines which ResourceClaims must be allocated
    and reserved before the Pod is allowed to start. The resources
    will be made available to those containers which consume them
    by name.

    This is an alpha field and requires enabling the
    DynamicResourceAllocation feature gate.

    This field is immutable.
    """
    restart_policy: Annotated[Optional[str], Field(alias="restartPolicy")] = None
    """
    Restart policy for all containers within the pod.
    One of Always, OnFailure, Never. In some contexts, only a subset of those values may be permitted.
    Default to Always.
    More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#restart-policy
    """
    runtime_class_name: Annotated[Optional[str], Field(alias="runtimeClassName")] = None
    """
    RuntimeClassName refers to a RuntimeClass object in the node.k8s.io group, which should be used
    to run this pod.  If no RuntimeClass resource matches the named class, the pod will not be run.
    If unset or empty, the "legacy" RuntimeClass will be used, which is an implicit class with an
    empty definition that uses the default runtime handler.
    More info: https://git.k8s.io/enhancements/keps/sig-node/585-runtime-class
    """
    scheduler_name: Annotated[Optional[str], Field(alias="schedulerName")] = None
    """
    If specified, the pod will be dispatched by specified scheduler.
    If not specified, the pod will be dispatched by default scheduler.
    """
    scheduling_gates: Annotated[Optional[List[SchedulingGate]], Field(alias="schedulingGates")] = (
        None
    )
    """
    SchedulingGates is an opaque list of values that if specified will block scheduling the pod.
    If schedulingGates is not empty, the pod will stay in the SchedulingGated state and the
    scheduler will not attempt to schedule the pod.

    SchedulingGates can only be set at pod creation time, and be removed only afterwards.
    """
    security_context: Annotated[Optional[SecurityContextModel], Field(alias="securityContext")] = (
        None
    )
    """
    SecurityContext holds pod-level security attributes and common container settings.
    Optional: Defaults to empty.  See type description for default values of each field.
    """
    service_account: Annotated[Optional[str], Field(alias="serviceAccount")] = None
    """
    DeprecatedServiceAccount is a deprecated alias for ServiceAccountName.
    Deprecated: Use serviceAccountName instead.
    """
    service_account_name: Annotated[Optional[str], Field(alias="serviceAccountName")] = None
    """
    ServiceAccountName is the name of the ServiceAccount to use to run this pod.
    More info: https://kubernetes.io/docs/tasks/configure-pod-container/configure-service-account/
    """
    set_hostname_as_fqdn: Annotated[Optional[bool], Field(alias="setHostnameAsFQDN")] = None
    """
    If true the pod's hostname will be configured as the pod's FQDN, rather than the leaf name (the default).
    In Linux containers, this means setting the FQDN in the hostname field of the kernel (the nodename field of struct utsname).
    In Windows containers, this means setting the registry value of hostname for the registry key HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Services\\Tcpip\\Parameters to FQDN.
    If a pod does not have FQDN, this has no effect.
    Default to false.
    """
    share_process_namespace: Annotated[Optional[bool], Field(alias="shareProcessNamespace")] = None
    """
    Share a single process namespace between all of the containers in a pod.
    When this is set containers will be able to view and signal processes from other containers
    in the same pod, and the first process in each container will not be assigned PID 1.
    HostPID and ShareProcessNamespace cannot both be set.
    Optional: Default to false.
    """
    subdomain: Optional[str] = None
    """
    If specified, the fully qualified Pod hostname will be "<hostname>.<subdomain>.<pod namespace>.svc.<cluster domain>".
    If not specified, the pod will not have a domainname at all.
    """
    termination_grace_period_seconds: Annotated[
        Optional[int], Field(alias="terminationGracePeriodSeconds")
    ] = None
    """
    Optional duration in seconds the pod needs to terminate gracefully. May be decreased in delete request.
    Value must be non-negative integer. The value zero indicates stop immediately via
    the kill signal (no opportunity to shut down).
    If this value is nil, the default grace period will be used instead.
    The grace period is the duration in seconds after the processes running in the pod are sent
    a termination signal and the time when the processes are forcibly halted with a kill signal.
    Set this value longer than the expected cleanup time for your process.
    Defaults to 30 seconds.
    """
    tolerations: Optional[List[Toleration]] = None
    """
    If specified, the pod's tolerations.
    """
    topology_spread_constraints: Annotated[
        Optional[List[TopologySpreadConstraint]],
        Field(alias="topologySpreadConstraints"),
    ] = None
    """
    TopologySpreadConstraints describes how a group of pods ought to spread across topology
    domains. Scheduler will schedule pods in a way which abides by the constraints.
    All topologySpreadConstraints are ANDed.
    """
    volumes: Optional[List[Volume]] = None
    """
    List of volumes that can be mounted by containers belonging to the pod.
    More info: https://kubernetes.io/docs/concepts/storage/volumes
    """


class Template(BaseModel):
    class Builder(BaseModelBuilder):
        @property
        def cls(self) -> Type["Template"]:
            return Template

        def build(self) -> "Template":
            return Template(**self._attrs)

        @overload
        def metadata(self, value_or_callback: Optional[Metadata], /) -> "Template.Builder": ...

        @overload
        def metadata(
            self,
            value_or_callback: Callable[[Metadata.Builder], Metadata.Builder | Metadata],
            /,
        ) -> "Template.Builder": ...

        @overload
        def metadata(self, value_or_callback: Never = ...) -> "Metadata.BuilderContext": ...

        def metadata(self, value_or_callback=None, /):
            """
            Standard object's metadata.
            More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
            """
            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[SpecModel], /) -> "Template.Builder": ...

        @overload
        def spec(
            self,
            value_or_callback: Callable[[SpecModel.Builder], SpecModel.Builder | SpecModel],
            /,
        ) -> "Template.Builder": ...

        @overload
        def spec(self, value_or_callback: Never = ...) -> "SpecModel.BuilderContext": ...

        def spec(self, value_or_callback=None, /):
            """
            Specification of the desired behavior of the pod.
            More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status
            """
            if self._in_context and value_or_callback is None:
                context = SpecModel.BuilderContext()
                context._parent_builder = self
                context._field_name = "spec"
                return context

            value = value_or_callback
            if callable(value_or_callback):
                output = value_or_callback(SpecModel.builder())
                if isinstance(output, SpecModel.Builder):
                    value = output.build()
                else:
                    value = output
            return self._set("spec", value)

    class BuilderContext(BuilderContextBase["Template.Builder"]):
        def model_post_init(self, __context) -> None:
            self._builder = Template.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 Template."""
        return cls.BuilderContext()

    class ListBuilder(GenericListBuilder["Template", Builder]):
        def __init__(self):
            raise NotImplementedError(
                "This class is not meant to be instantiated. Use Template.list_builder() instead."
            )

    @classmethod
    def list_builder(cls) -> ListBuilder:
        return GenericListBuilder[cls, cls.Builder]()  # type: ignore

    metadata: Optional[Metadata] = None
    """
    Standard object's metadata.
    More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
    """
    spec: Optional[SpecModel] = None
    """
    Specification of the desired behavior of the pod.
    More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status
    """


class JobTargetRef(BaseModel):
    class Builder(BaseModelBuilder):
        @property
        def cls(self) -> Type["JobTargetRef"]:
            return JobTargetRef

        def build(self) -> "JobTargetRef":
            return JobTargetRef(**self._attrs)

        def active_deadline_seconds(self, value: Optional[int], /) -> Self:
            """
            Specifies the duration in seconds relative to the startTime that the job
            may be continuously active before the system tries to terminate it; value
            must be positive integer. If a Job is suspended (at creation or through an
            update), this timer will effectively be stopped and reset when the Job is
            resumed again.
            """
            return self._set("active_deadline_seconds", value)

        def backoff_limit(self, value: Optional[int], /) -> Self:
            """
            Specifies the number of retries before marking this job failed.
            Defaults to 6
            """
            return self._set("backoff_limit", value)

        def backoff_limit_per_index(self, value: Optional[int], /) -> Self:
            """
            Specifies the limit for the number of retries within an
            index before marking this index as failed. When enabled the number of
            failures per index is kept in the pod's
            batch.kubernetes.io/job-index-failure-count annotation. It can only
            be set when Job's completionMode=Indexed, and the Pod's restart
            policy is Never. The field is immutable.
            This field is beta-level. It can be used when the `JobBackoffLimitPerIndex`
            feature gate is enabled (enabled by default).
            """
            return self._set("backoff_limit_per_index", value)

        def completion_mode(self, value: Optional[str], /) -> Self:
            """
            completionMode specifies how Pod completions are tracked. It can be
            `NonIndexed` (default) or `Indexed`.

            `NonIndexed` means that the Job is considered complete when there have
            been .spec.completions successfully completed Pods. Each Pod completion is
            homologous to each other.

            `Indexed` means that the Pods of a
            Job get an associated completion index from 0 to (.spec.completions - 1),
            available in the annotation batch.kubernetes.io/job-completion-index.
            The Job is considered complete when there is one successfully completed Pod
            for each index.
            When value is `Indexed`, .spec.completions must be specified and
            `.spec.parallelism` must be less than or equal to 10^5.
            In addition, The Pod name takes the form
            `$(job-name)-$(index)-$(random-string)`,
            the Pod hostname takes the form `$(job-name)-$(index)`.

            More completion modes can be added in the future.
            If the Job controller observes a mode that it doesn't recognize, which
            is possible during upgrades due to version skew, the controller
            skips updates for the Job.
            """
            return self._set("completion_mode", value)

        def completions(self, value: Optional[int], /) -> Self:
            """
            Specifies the desired number of successfully finished pods the
            job should be run with.  Setting to null means that the success of any
            pod signals the success of all pods, and allows parallelism to have any positive
            value.  Setting to 1 means that parallelism is limited to 1 and the success of that
            pod signals the success of the job.
            More info: https://kubernetes.io/docs/concepts/workloads/controllers/jobs-run-to-completion/
            """
            return self._set("completions", value)

        def managed_by(self, value: Optional[str], /) -> Self:
            """
            ManagedBy field indicates the controller that manages a Job. The k8s Job
            controller reconciles jobs which don't have this field at all or the field
            value is the reserved string `kubernetes.io/job-controller`, but skips
            reconciling Jobs with a custom value for this field.
            The value must be a valid domain-prefixed path (e.g. acme.io/foo) -
            all characters before the first "/" must be a valid subdomain as defined
            by RFC 1123. All characters trailing the first "/" must be valid HTTP Path
            characters as defined by RFC 3986. The value cannot exceed 63 characters.
            This field is immutable.

            This field is alpha-level. The job controller accepts setting the field
            when the feature gate JobManagedBy is enabled (disabled by default).
            """
            return self._set("managed_by", value)

        def manual_selector(self, value: Optional[bool], /) -> Self:
            """
            manualSelector controls generation of pod labels and pod selectors.
            Leave `manualSelector` unset unless you are certain what you are doing.
            When false or unset, the system pick labels unique to this job
            and appends those labels to the pod template.  When true,
            the user is responsible for picking unique labels and specifying
            the selector.  Failure to pick a unique label may cause this
            and other jobs to not function correctly.  However, You may see
            `manualSelector=true` in jobs that were created with the old `extensions/v1beta1`
            API.
            More info: https://kubernetes.io/docs/concepts/workloads/controllers/jobs-run-to-completion/#specifying-your-own-pod-selector
            """
            return self._set("manual_selector", value)

        def max_failed_indexes(self, value: Optional[int], /) -> Self:
            """
            Specifies the maximal number of failed indexes before marking the Job as
            failed, when backoffLimitPerIndex is set. Once the number of failed
            indexes exceeds this number the entire Job is marked as Failed and its
            execution is terminated. When left as null the job continues execution of
            all of its indexes and is marked with the `Complete` Job condition.
            It can only be specified when backoffLimitPerIndex is set.
            It can be null or up to completions. It is required and must be
            less than or equal to 10^4 when is completions greater than 10^5.
            This field is beta-level. It can be used when the `JobBackoffLimitPerIndex`
            feature gate is enabled (enabled by default).
            """
            return self._set("max_failed_indexes", value)

        def parallelism(self, value: Optional[int], /) -> Self:
            """
            Specifies the maximum desired number of pods the job should
            run at any given time. The actual number of pods running in steady state will
            be less than this number when ((.spec.completions - .status.successful) < .spec.parallelism),
            i.e. when the work left to do is less than max parallelism.
            More info: https://kubernetes.io/docs/concepts/workloads/controllers/jobs-run-to-completion/
            """
            return self._set("parallelism", value)

        @overload
        def pod_failure_policy(
            self, value_or_callback: Optional[PodFailurePolicy], /
        ) -> "JobTargetRef.Builder": ...

        @overload
        def pod_failure_policy(
            self,
            value_or_callback: Callable[
                [PodFailurePolicy.Builder], PodFailurePolicy.Builder | PodFailurePolicy
            ],
            /,
        ) -> "JobTargetRef.Builder": ...

        @overload
        def pod_failure_policy(
            self, value_or_callback: Never = ...
        ) -> "PodFailurePolicy.BuilderContext": ...

        def pod_failure_policy(self, value_or_callback=None, /):
            """
            Specifies the policy of handling failed pods. In particular, it allows to
            specify the set of actions and conditions which need to be
            satisfied to take the associated action.
            If empty, the default behaviour applies - the counter of failed pods,
            represented by the jobs's .status.failed field, is incremented and it is
            checked against the backoffLimit. This field cannot be used in combination
            with restartPolicy=OnFailure.
            """
            if self._in_context and value_or_callback is None:
                context = PodFailurePolicy.BuilderContext()
                context._parent_builder = self
                context._field_name = "pod_failure_policy"
                return context

            value = value_or_callback
            if callable(value_or_callback):
                output = value_or_callback(PodFailurePolicy.builder())
                if isinstance(output, PodFailurePolicy.Builder):
                    value = output.build()
                else:
                    value = output
            return self._set("pod_failure_policy", value)

        def pod_replacement_policy(self, value: Optional[str], /) -> Self:
            """
            podReplacementPolicy specifies when to create replacement Pods.
            Possible values are:
            - TerminatingOrFailed means that we recreate pods
              when they are terminating (has a metadata.deletionTimestamp) or failed.
            - Failed means to wait until a previously created Pod is fully terminated (has phase
              Failed or Succeeded) before creating a replacement Pod.

            When using podFailurePolicy, Failed is the the only allowed value.
            TerminatingOrFailed and Failed are allowed values when podFailurePolicy is not in use.
            This is an beta field. To use this, enable the JobPodReplacementPolicy feature toggle.
            This is on by default.
            """
            return self._set("pod_replacement_policy", value)

        @overload
        def selector(self, value_or_callback: Optional[Selector], /) -> "JobTargetRef.Builder": ...

        @overload
        def selector(
            self,
            value_or_callback: Callable[[Selector.Builder], Selector.Builder | Selector],
            /,
        ) -> "JobTargetRef.Builder": ...

        @overload
        def selector(self, value_or_callback: Never = ...) -> "Selector.BuilderContext": ...

        def selector(self, value_or_callback=None, /):
            """
            A label query over pods that should match the pod count.
            Normally, the system sets this field for you.
            More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#label-selectors
            """
            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)

        @overload
        def success_policy(
            self, value_or_callback: Optional[SuccessPolicy], /
        ) -> "JobTargetRef.Builder": ...

        @overload
        def success_policy(
            self,
            value_or_callback: Callable[
                [SuccessPolicy.Builder], SuccessPolicy.Builder | SuccessPolicy
            ],
            /,
        ) -> "JobTargetRef.Builder": ...

        @overload
        def success_policy(
            self, value_or_callback: Never = ...
        ) -> "SuccessPolicy.BuilderContext": ...

        def success_policy(self, value_or_callback=None, /):
            """
            successPolicy specifies the policy when the Job can be declared as succeeded.
            If empty, the default behavior applies - the Job is declared as succeeded
            only when the number of succeeded pods equals to the completions.
            When the field is specified, it must be immutable and works only for the Indexed Jobs.
            Once the Job meets the SuccessPolicy, the lingering pods are terminated.

            This field is beta-level. To use this field, you must enable the
            `JobSuccessPolicy` feature gate (enabled by default).
            """
            if self._in_context and value_or_callback is None:
                context = SuccessPolicy.BuilderContext()
                context._parent_builder = self
                context._field_name = "success_policy"
                return context

            value = value_or_callback
            if callable(value_or_callback):
                output = value_or_callback(SuccessPolicy.builder())
                if isinstance(output, SuccessPolicy.Builder):
                    value = output.build()
                else:
                    value = output
            return self._set("success_policy", value)

        def suspend(self, value: Optional[bool], /) -> Self:
            """
            suspend specifies whether the Job controller should create Pods or not. If
            a Job is created with suspend set to true, no Pods are created by the Job
            controller. If a Job is suspended after creation (i.e. the flag goes from
            false to true), the Job controller will delete all active Pods associated
            with this Job. Users must design their workload to gracefully handle this.
            Suspending a Job will reset the StartTime field of the Job, effectively
            resetting the ActiveDeadlineSeconds timer too. Defaults to false.
            """
            return self._set("suspend", value)

        @overload
        def template(self, value_or_callback: Template, /) -> "JobTargetRef.Builder": ...

        @overload
        def template(
            self,
            value_or_callback: Callable[[Template.Builder], Template.Builder | Template],
            /,
        ) -> "JobTargetRef.Builder": ...

        @overload
        def template(self, value_or_callback: Never = ...) -> "Template.BuilderContext": ...

        def template(self, value_or_callback=None, /):
            """
            Describes the pod that will be created when executing a job.
            The only allowed template.spec.restartPolicy values are "Never" or "OnFailure".
            More info: https://kubernetes.io/docs/concepts/workloads/controllers/jobs-run-to-completion/
            """
            if self._in_context and value_or_callback is None:
                context = Template.BuilderContext()
                context._parent_builder = self
                context._field_name = "template"
                return context

            value = value_or_callback
            if callable(value_or_callback):
                output = value_or_callback(Template.builder())
                if isinstance(output, Template.Builder):
                    value = output.build()
                else:
                    value = output
            return self._set("template", value)

        def ttl_seconds_after_finished(self, value: Optional[int], /) -> Self:
            """
            ttlSecondsAfterFinished limits the lifetime of a Job that has finished
            execution (either Complete or Failed). If this field is set,
            ttlSecondsAfterFinished after the Job finishes, it is eligible to be
            automatically deleted. When the Job is being deleted, its lifecycle
            guarantees (e.g. finalizers) will be honored. If this field is unset,
            the Job won't be automatically deleted. If this field is set to zero,
            the Job becomes eligible to be deleted immediately after it finishes.
            """
            return self._set("ttl_seconds_after_finished", value)

    class BuilderContext(BuilderContextBase["JobTargetRef.Builder"]):
        def model_post_init(self, __context) -> None:
            self._builder = JobTargetRef.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 JobTargetRef."""
        return cls.BuilderContext()

    class ListBuilder(GenericListBuilder["JobTargetRef", Builder]):
        def __init__(self):
            raise NotImplementedError(
                "This class is not meant to be instantiated. Use JobTargetRef.list_builder() instead."
            )

    @classmethod
    def list_builder(cls) -> ListBuilder:
        return GenericListBuilder[cls, cls.Builder]()  # type: ignore

    active_deadline_seconds: Annotated[Optional[int], Field(alias="activeDeadlineSeconds")] = None
    """
    Specifies the duration in seconds relative to the startTime that the job
    may be continuously active before the system tries to terminate it; value
    must be positive integer. If a Job is suspended (at creation or through an
    update), this timer will effectively be stopped and reset when the Job is
    resumed again.
    """
    backoff_limit: Annotated[Optional[int], Field(alias="backoffLimit")] = None
    """
    Specifies the number of retries before marking this job failed.
    Defaults to 6
    """
    backoff_limit_per_index: Annotated[Optional[int], Field(alias="backoffLimitPerIndex")] = None
    """
    Specifies the limit for the number of retries within an
    index before marking this index as failed. When enabled the number of
    failures per index is kept in the pod's
    batch.kubernetes.io/job-index-failure-count annotation. It can only
    be set when Job's completionMode=Indexed, and the Pod's restart
    policy is Never. The field is immutable.
    This field is beta-level. It can be used when the `JobBackoffLimitPerIndex`
    feature gate is enabled (enabled by default).
    """
    completion_mode: Annotated[Optional[str], Field(alias="completionMode")] = None
    """
    completionMode specifies how Pod completions are tracked. It can be
    `NonIndexed` (default) or `Indexed`.

    `NonIndexed` means that the Job is considered complete when there have
    been .spec.completions successfully completed Pods. Each Pod completion is
    homologous to each other.

    `Indexed` means that the Pods of a
    Job get an associated completion index from 0 to (.spec.completions - 1),
    available in the annotation batch.kubernetes.io/job-completion-index.
    The Job is considered complete when there is one successfully completed Pod
    for each index.
    When value is `Indexed`, .spec.completions must be specified and
    `.spec.parallelism` must be less than or equal to 10^5.
    In addition, The Pod name takes the form
    `$(job-name)-$(index)-$(random-string)`,
    the Pod hostname takes the form `$(job-name)-$(index)`.

    More completion modes can be added in the future.
    If the Job controller observes a mode that it doesn't recognize, which
    is possible during upgrades due to version skew, the controller
    skips updates for the Job.
    """
    completions: Optional[int] = None
    """
    Specifies the desired number of successfully finished pods the
    job should be run with.  Setting to null means that the success of any
    pod signals the success of all pods, and allows parallelism to have any positive
    value.  Setting to 1 means that parallelism is limited to 1 and the success of that
    pod signals the success of the job.
    More info: https://kubernetes.io/docs/concepts/workloads/controllers/jobs-run-to-completion/
    """
    managed_by: Annotated[Optional[str], Field(alias="managedBy")] = None
    """
    ManagedBy field indicates the controller that manages a Job. The k8s Job
    controller reconciles jobs which don't have this field at all or the field
    value is the reserved string `kubernetes.io/job-controller`, but skips
    reconciling Jobs with a custom value for this field.
    The value must be a valid domain-prefixed path (e.g. acme.io/foo) -
    all characters before the first "/" must be a valid subdomain as defined
    by RFC 1123. All characters trailing the first "/" must be valid HTTP Path
    characters as defined by RFC 3986. The value cannot exceed 63 characters.
    This field is immutable.

    This field is alpha-level. The job controller accepts setting the field
    when the feature gate JobManagedBy is enabled (disabled by default).
    """
    manual_selector: Annotated[Optional[bool], Field(alias="manualSelector")] = None
    """
    manualSelector controls generation of pod labels and pod selectors.
    Leave `manualSelector` unset unless you are certain what you are doing.
    When false or unset, the system pick labels unique to this job
    and appends those labels to the pod template.  When true,
    the user is responsible for picking unique labels and specifying
    the selector.  Failure to pick a unique label may cause this
    and other jobs to not function correctly.  However, You may see
    `manualSelector=true` in jobs that were created with the old `extensions/v1beta1`
    API.
    More info: https://kubernetes.io/docs/concepts/workloads/controllers/jobs-run-to-completion/#specifying-your-own-pod-selector
    """
    max_failed_indexes: Annotated[Optional[int], Field(alias="maxFailedIndexes")] = None
    """
    Specifies the maximal number of failed indexes before marking the Job as
    failed, when backoffLimitPerIndex is set. Once the number of failed
    indexes exceeds this number the entire Job is marked as Failed and its
    execution is terminated. When left as null the job continues execution of
    all of its indexes and is marked with the `Complete` Job condition.
    It can only be specified when backoffLimitPerIndex is set.
    It can be null or up to completions. It is required and must be
    less than or equal to 10^4 when is completions greater than 10^5.
    This field is beta-level. It can be used when the `JobBackoffLimitPerIndex`
    feature gate is enabled (enabled by default).
    """
    parallelism: Optional[int] = None
    """
    Specifies the maximum desired number of pods the job should
    run at any given time. The actual number of pods running in steady state will
    be less than this number when ((.spec.completions - .status.successful) < .spec.parallelism),
    i.e. when the work left to do is less than max parallelism.
    More info: https://kubernetes.io/docs/concepts/workloads/controllers/jobs-run-to-completion/
    """
    pod_failure_policy: Annotated[Optional[PodFailurePolicy], Field(alias="podFailurePolicy")] = (
        None
    )
    """
    Specifies the policy of handling failed pods. In particular, it allows to
    specify the set of actions and conditions which need to be
    satisfied to take the associated action.
    If empty, the default behaviour applies - the counter of failed pods,
    represented by the jobs's .status.failed field, is incremented and it is
    checked against the backoffLimit. This field cannot be used in combination
    with restartPolicy=OnFailure.
    """
    pod_replacement_policy: Annotated[Optional[str], Field(alias="podReplacementPolicy")] = None
    """
    podReplacementPolicy specifies when to create replacement Pods.
    Possible values are:
    - TerminatingOrFailed means that we recreate pods
      when they are terminating (has a metadata.deletionTimestamp) or failed.
    - Failed means to wait until a previously created Pod is fully terminated (has phase
      Failed or Succeeded) before creating a replacement Pod.

    When using podFailurePolicy, Failed is the the only allowed value.
    TerminatingOrFailed and Failed are allowed values when podFailurePolicy is not in use.
    This is an beta field. To use this, enable the JobPodReplacementPolicy feature toggle.
    This is on by default.
    """
    selector: Optional[Selector] = None
    """
    A label query over pods that should match the pod count.
    Normally, the system sets this field for you.
    More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#label-selectors
    """
    success_policy: Annotated[Optional[SuccessPolicy], Field(alias="successPolicy")] = None
    """
    successPolicy specifies the policy when the Job can be declared as succeeded.
    If empty, the default behavior applies - the Job is declared as succeeded
    only when the number of succeeded pods equals to the completions.
    When the field is specified, it must be immutable and works only for the Indexed Jobs.
    Once the Job meets the SuccessPolicy, the lingering pods are terminated.

    This field is beta-level. To use this field, you must enable the
    `JobSuccessPolicy` feature gate (enabled by default).
    """
    suspend: Optional[bool] = None
    """
    suspend specifies whether the Job controller should create Pods or not. If
    a Job is created with suspend set to true, no Pods are created by the Job
    controller. If a Job is suspended after creation (i.e. the flag goes from
    false to true), the Job controller will delete all active Pods associated
    with this Job. Users must design their workload to gracefully handle this.
    Suspending a Job will reset the StartTime field of the Job, effectively
    resetting the ActiveDeadlineSeconds timer too. Defaults to false.
    """
    template: Template
    """
    Describes the pod that will be created when executing a job.
    The only allowed template.spec.restartPolicy values are "Never" or "OnFailure".
    More info: https://kubernetes.io/docs/concepts/workloads/controllers/jobs-run-to-completion/
    """
    ttl_seconds_after_finished: Annotated[Optional[int], Field(alias="ttlSecondsAfterFinished")] = (
        None
    )
    """
    ttlSecondsAfterFinished limits the lifetime of a Job that has finished
    execution (either Complete or Failed). If this field is set,
    ttlSecondsAfterFinished after the Job finishes, it is eligible to be
    automatically deleted. When the Job is being deleted, its lifecycle
    guarantees (e.g. finalizers) will be honored. If this field is unset,
    the Job won't be automatically deleted. If this field is set to zero,
    the Job becomes eligible to be deleted immediately after it finishes.
    """


class Rollout(BaseModel):
    class Builder(BaseModelBuilder):
        @property
        def cls(self) -> Type["Rollout"]:
            return Rollout

        def build(self) -> "Rollout":
            return Rollout(**self._attrs)

        def propagation_policy(self, value: Optional[str], /) -> Self:
            return self._set("propagation_policy", value)

        def strategy(self, value: Optional[str], /) -> Self:
            return self._set("strategy", value)

    class BuilderContext(BuilderContextBase["Rollout.Builder"]):
        def model_post_init(self, __context) -> None:
            self._builder = Rollout.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 Rollout."""
        return cls.BuilderContext()

    class ListBuilder(GenericListBuilder["Rollout", Builder]):
        def __init__(self):
            raise NotImplementedError(
                "This class is not meant to be instantiated. Use Rollout.list_builder() instead."
            )

    @classmethod
    def list_builder(cls) -> ListBuilder:
        return GenericListBuilder[cls, cls.Builder]()  # type: ignore

    propagation_policy: Annotated[Optional[str], Field(alias="propagationPolicy")] = None
    strategy: Optional[str] = None


class ScalingStrategy(BaseModel):
    class Builder(BaseModelBuilder):
        @property
        def cls(self) -> Type["ScalingStrategy"]:
            return ScalingStrategy

        def build(self) -> "ScalingStrategy":
            return ScalingStrategy(**self._attrs)

        def custom_scaling_queue_length_deduction(self, value: Optional[int], /) -> Self:
            return self._set("custom_scaling_queue_length_deduction", value)

        def custom_scaling_running_job_percentage(self, value: Optional[str], /) -> Self:
            return self._set("custom_scaling_running_job_percentage", value)

        def multiple_scalers_calculation(self, value: Optional[str], /) -> Self:
            return self._set("multiple_scalers_calculation", value)

        def pending_pod_conditions(self, value: Optional[List[str]], /) -> Self:
            return self._set("pending_pod_conditions", value)

        def strategy(self, value: Optional[str], /) -> Self:
            return self._set("strategy", value)

    class BuilderContext(BuilderContextBase["ScalingStrategy.Builder"]):
        def model_post_init(self, __context) -> None:
            self._builder = ScalingStrategy.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 ScalingStrategy."""
        return cls.BuilderContext()

    class ListBuilder(GenericListBuilder["ScalingStrategy", Builder]):
        def __init__(self):
            raise NotImplementedError(
                "This class is not meant to be instantiated. Use ScalingStrategy.list_builder() instead."
            )

    @classmethod
    def list_builder(cls) -> ListBuilder:
        return GenericListBuilder[cls, cls.Builder]()  # type: ignore

    custom_scaling_queue_length_deduction: Annotated[
        Optional[int], Field(alias="customScalingQueueLengthDeduction")
    ] = None
    custom_scaling_running_job_percentage: Annotated[
        Optional[str], Field(alias="customScalingRunningJobPercentage")
    ] = None
    multiple_scalers_calculation: Annotated[
        Optional[str], Field(alias="multipleScalersCalculation")
    ] = None
    pending_pod_conditions: Annotated[Optional[List[str]], Field(alias="pendingPodConditions")] = (
        None
    )
    strategy: Optional[str] = None


class AuthenticationRef(BaseModel):
    class Builder(BaseModelBuilder):
        @property
        def cls(self) -> Type["AuthenticationRef"]:
            return AuthenticationRef

        def build(self) -> "AuthenticationRef":
            return AuthenticationRef(**self._attrs)

        def kind(self, value: Optional[str], /) -> Self:
            """
            Kind of the resource being referred to. Defaults to TriggerAuthentication.
            """
            return self._set("kind", value)

        def name(self, value: str, /) -> Self:
            return self._set("name", value)

    class BuilderContext(BuilderContextBase["AuthenticationRef.Builder"]):
        def model_post_init(self, __context) -> None:
            self._builder = AuthenticationRef.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 AuthenticationRef."""
        return cls.BuilderContext()

    class ListBuilder(GenericListBuilder["AuthenticationRef", Builder]):
        def __init__(self):
            raise NotImplementedError(
                "This class is not meant to be instantiated. Use AuthenticationRef.list_builder() instead."
            )

    @classmethod
    def list_builder(cls) -> ListBuilder:
        return GenericListBuilder[cls, cls.Builder]()  # type: ignore

    kind: Optional[str] = None
    """
    Kind of the resource being referred to. Defaults to TriggerAuthentication.
    """
    name: str


class Trigger(BaseModel):
    class Builder(BaseModelBuilder):
        @property
        def cls(self) -> Type["Trigger"]:
            return Trigger

        def build(self) -> "Trigger":
            return Trigger(**self._attrs)

        @overload
        def authentication_ref(
            self, value_or_callback: Optional[AuthenticationRef], /
        ) -> "Trigger.Builder": ...

        @overload
        def authentication_ref(
            self,
            value_or_callback: Callable[
                [AuthenticationRef.Builder],
                AuthenticationRef.Builder | AuthenticationRef,
            ],
            /,
        ) -> "Trigger.Builder": ...

        @overload
        def authentication_ref(
            self, value_or_callback: Never = ...
        ) -> "AuthenticationRef.BuilderContext": ...

        def authentication_ref(self, value_or_callback=None, /):
            """
            AuthenticationRef points to the TriggerAuthentication or ClusterTriggerAuthentication object that
            is used to authenticate the scaler with the environment
            """
            if self._in_context and value_or_callback is None:
                context = AuthenticationRef.BuilderContext()
                context._parent_builder = self
                context._field_name = "authentication_ref"
                return context

            value = value_or_callback
            if callable(value_or_callback):
                output = value_or_callback(AuthenticationRef.builder())
                if isinstance(output, AuthenticationRef.Builder):
                    value = output.build()
                else:
                    value = output
            return self._set("authentication_ref", value)

        def metadata(self, value: Dict[str, str], /) -> Self:
            return self._set("metadata", value)

        def name(self, value: Optional[str], /) -> Self:
            return self._set("name", value)

        def type(self, value: str, /) -> Self:
            return self._set("type", value)

        def use_cached_metrics(self, value: Optional[bool], /) -> Self:
            return self._set("use_cached_metrics", value)

    class BuilderContext(BuilderContextBase["Trigger.Builder"]):
        def model_post_init(self, __context) -> None:
            self._builder = Trigger.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 Trigger."""
        return cls.BuilderContext()

    class ListBuilder(GenericListBuilder["Trigger", Builder]):
        def __init__(self):
            raise NotImplementedError(
                "This class is not meant to be instantiated. Use Trigger.list_builder() instead."
            )

    @classmethod
    def list_builder(cls) -> ListBuilder:
        return GenericListBuilder[cls, cls.Builder]()  # type: ignore

    authentication_ref: Annotated[Optional[AuthenticationRef], Field(alias="authenticationRef")] = (
        None
    )
    """
    AuthenticationRef points to the TriggerAuthentication or ClusterTriggerAuthentication object that
    is used to authenticate the scaler with the environment
    """
    metadata: Dict[str, str]
    name: Optional[str] = None
    type: str
    use_cached_metrics: Annotated[Optional[bool], Field(alias="useCachedMetrics")] = None


class ScaledJobSpec(BaseModel):
    class Builder(BaseModelBuilder):
        @property
        def cls(self) -> Type["ScaledJobSpec"]:
            return ScaledJobSpec

        def build(self) -> "ScaledJobSpec":
            return ScaledJobSpec(**self._attrs)

        def env_source_container_name(self, value: Optional[str], /) -> Self:
            return self._set("env_source_container_name", value)

        def failed_jobs_history_limit(self, value: Optional[int], /) -> Self:
            return self._set("failed_jobs_history_limit", value)

        @overload
        def job_target_ref(self, value_or_callback: JobTargetRef, /) -> "ScaledJobSpec.Builder": ...

        @overload
        def job_target_ref(
            self,
            value_or_callback: Callable[
                [JobTargetRef.Builder], JobTargetRef.Builder | JobTargetRef
            ],
            /,
        ) -> "ScaledJobSpec.Builder": ...

        @overload
        def job_target_ref(
            self, value_or_callback: Never = ...
        ) -> "JobTargetRef.BuilderContext": ...

        def job_target_ref(self, value_or_callback=None, /):
            """
            JobSpec describes how the job execution will look like.
            """
            if self._in_context and value_or_callback is None:
                context = JobTargetRef.BuilderContext()
                context._parent_builder = self
                context._field_name = "job_target_ref"
                return context

            value = value_or_callback
            if callable(value_or_callback):
                output = value_or_callback(JobTargetRef.builder())
                if isinstance(output, JobTargetRef.Builder):
                    value = output.build()
                else:
                    value = output
            return self._set("job_target_ref", value)

        def max_replica_count(self, value: Optional[int], /) -> Self:
            return self._set("max_replica_count", value)

        def min_replica_count(self, value: Optional[int], /) -> Self:
            return self._set("min_replica_count", value)

        def polling_interval(self, value: Optional[int], /) -> Self:
            return self._set("polling_interval", value)

        @overload
        def rollout(self, value_or_callback: Optional[Rollout], /) -> "ScaledJobSpec.Builder": ...

        @overload
        def rollout(
            self,
            value_or_callback: Callable[[Rollout.Builder], Rollout.Builder | Rollout],
            /,
        ) -> "ScaledJobSpec.Builder": ...

        @overload
        def rollout(self, value_or_callback: Never = ...) -> "Rollout.BuilderContext": ...

        def rollout(self, value_or_callback=None, /):
            """
            Rollout defines the strategy for job rollouts
            """
            if self._in_context and value_or_callback is None:
                context = Rollout.BuilderContext()
                context._parent_builder = self
                context._field_name = "rollout"
                return context

            value = value_or_callback
            if callable(value_or_callback):
                output = value_or_callback(Rollout.builder())
                if isinstance(output, Rollout.Builder):
                    value = output.build()
                else:
                    value = output
            return self._set("rollout", value)

        def rollout_strategy(self, value: Optional[str], /) -> Self:
            return self._set("rollout_strategy", value)

        @overload
        def scaling_strategy(
            self, value_or_callback: Optional[ScalingStrategy], /
        ) -> "ScaledJobSpec.Builder": ...

        @overload
        def scaling_strategy(
            self,
            value_or_callback: Callable[
                [ScalingStrategy.Builder], ScalingStrategy.Builder | ScalingStrategy
            ],
            /,
        ) -> "ScaledJobSpec.Builder": ...

        @overload
        def scaling_strategy(
            self, value_or_callback: Never = ...
        ) -> "ScalingStrategy.BuilderContext": ...

        def scaling_strategy(self, value_or_callback=None, /):
            """
            ScalingStrategy defines the strategy of Scaling
            """
            if self._in_context and value_or_callback is None:
                context = ScalingStrategy.BuilderContext()
                context._parent_builder = self
                context._field_name = "scaling_strategy"
                return context

            value = value_or_callback
            if callable(value_or_callback):
                output = value_or_callback(ScalingStrategy.builder())
                if isinstance(output, ScalingStrategy.Builder):
                    value = output.build()
                else:
                    value = output
            return self._set("scaling_strategy", value)

        def successful_jobs_history_limit(self, value: Optional[int], /) -> Self:
            return self._set("successful_jobs_history_limit", value)

        @overload
        def triggers(self, value_or_callback: List[Trigger], /) -> "ScaledJobSpec.Builder": ...

        @overload
        def triggers(
            self,
            value_or_callback: Callable[
                [GenericListBuilder[Trigger, Trigger.Builder]],
                GenericListBuilder[Trigger, Trigger.Builder] | List[Trigger],
            ],
            /,
        ) -> "ScaledJobSpec.Builder": ...

        @overload
        def triggers(
            self, value_or_callback: Never = ...
        ) -> ListBuilderContext[Trigger.Builder]: ...

        def triggers(self, value_or_callback=None, /):
            if self._in_context and value_or_callback is None:
                context = ListBuilderContext[Trigger.Builder]()
                context._parent_builder = self
                context._field_name = "triggers"
                return context

            value = value_or_callback
            if callable(value_or_callback):
                output = value_or_callback(Trigger.list_builder())
                if isinstance(output, GenericListBuilder):
                    value = output.build()
                else:
                    value = output
            return self._set("triggers", value)

    class BuilderContext(BuilderContextBase["ScaledJobSpec.Builder"]):
        def model_post_init(self, __context) -> None:
            self._builder = ScaledJobSpec.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 ScaledJobSpec."""
        return cls.BuilderContext()

    class ListBuilder(GenericListBuilder["ScaledJobSpec", Builder]):
        def __init__(self):
            raise NotImplementedError(
                "This class is not meant to be instantiated. Use ScaledJobSpec.list_builder() instead."
            )

    @classmethod
    def list_builder(cls) -> ListBuilder:
        return GenericListBuilder[cls, cls.Builder]()  # type: ignore

    env_source_container_name: Annotated[Optional[str], Field(alias="envSourceContainerName")] = (
        None
    )
    failed_jobs_history_limit: Annotated[Optional[int], Field(alias="failedJobsHistoryLimit")] = (
        None
    )
    job_target_ref: Annotated[JobTargetRef, Field(alias="jobTargetRef")]
    """
    JobSpec describes how the job execution will look like.
    """
    max_replica_count: Annotated[Optional[int], Field(alias="maxReplicaCount")] = None
    min_replica_count: Annotated[Optional[int], Field(alias="minReplicaCount")] = None
    polling_interval: Annotated[Optional[int], Field(alias="pollingInterval")] = None
    rollout: Optional[Rollout] = None
    """
    Rollout defines the strategy for job rollouts
    """
    rollout_strategy: Annotated[Optional[str], Field(alias="rolloutStrategy")] = None
    scaling_strategy: Annotated[Optional[ScalingStrategy], Field(alias="scalingStrategy")] = None
    """
    ScalingStrategy defines the strategy of Scaling
    """
    successful_jobs_history_limit: Annotated[
        Optional[int], Field(alias="successfulJobsHistoryLimit")
    ] = None
    triggers: List[Trigger]


class Condition(BaseModel):
    class Builder(BaseModelBuilder):
        @property
        def cls(self) -> Type["Condition"]:
            return Condition

        def build(self) -> "Condition":
            return Condition(**self._attrs)

        def message(self, value: Optional[str], /) -> Self:
            """
            A human readable message indicating details about the transition.
            """
            return self._set("message", value)

        def reason(self, value: Optional[str], /) -> Self:
            """
            The reason for the condition's last transition.
            """
            return self._set("reason", value)

        def status(self, value: str, /) -> Self:
            """
            Status of the condition, one of True, False, Unknown.
            """
            return self._set("status", value)

        def type(self, value: str, /) -> Self:
            """
            Type of condition
            """
            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

    message: Optional[str] = None
    """
    A human readable message indicating details about the transition.
    """
    reason: Optional[str] = None
    """
    The reason for the condition's last transition.
    """
    status: str
    """
    Status of the condition, one of True, False, Unknown.
    """
    type: str
    """
    Type of condition
    """


class ScaledJobStatus(BaseModel):
    class Builder(BaseModelBuilder):
        @property
        def cls(self) -> Type["ScaledJobStatus"]:
            return ScaledJobStatus

        def build(self) -> "ScaledJobStatus":
            return ScaledJobStatus(**self._attrs)

        def paused(self, value: Optional[str], /) -> Self:
            return self._set("paused", value)

        def authentications_types(self, value: Optional[str], /) -> Self:
            return self._set("authentications_types", value)

        @overload
        def conditions(
            self, value_or_callback: List[Condition], /
        ) -> "ScaledJobStatus.Builder": ...

        @overload
        def conditions(
            self,
            value_or_callback: Callable[
                [GenericListBuilder[Condition, Condition.Builder]],
                GenericListBuilder[Condition, Condition.Builder] | List[Condition],
            ],
            /,
        ) -> "ScaledJobStatus.Builder": ...

        @overload
        def conditions(
            self, value_or_callback: Never = ...
        ) -> ListBuilderContext[Condition.Builder]: ...

        def conditions(self, value_or_callback=None, /):
            """
            Conditions an array representation to store multiple Conditions
            """
            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 last_active_time(self, value: Optional[datetime], /) -> Self:
            return self._set("last_active_time", value)

        def triggers_types(self, value: Optional[str], /) -> Self:
            return self._set("triggers_types", value)

    class BuilderContext(BuilderContextBase["ScaledJobStatus.Builder"]):
        def model_post_init(self, __context) -> None:
            self._builder = ScaledJobStatus.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 ScaledJobStatus."""
        return cls.BuilderContext()

    class ListBuilder(GenericListBuilder["ScaledJobStatus", Builder]):
        def __init__(self):
            raise NotImplementedError(
                "This class is not meant to be instantiated. Use ScaledJobStatus.list_builder() instead."
            )

    @classmethod
    def list_builder(cls) -> ListBuilder:
        return GenericListBuilder[cls, cls.Builder]()  # type: ignore

    paused: Annotated[Optional[str], Field(alias="Paused")] = None
    authentications_types: Annotated[Optional[str], Field(alias="authenticationsTypes")] = None
    conditions: Optional[List[Condition]] = None
    """
    Conditions an array representation to store multiple Conditions
    """
    last_active_time: Annotated[Optional[datetime], Field(alias="lastActiveTime")] = None
    triggers_types: Annotated[Optional[str], Field(alias="triggersTypes")] = None


class Policy(BaseModel):
    class Builder(BaseModelBuilder):
        @property
        def cls(self) -> Type["Policy"]:
            return Policy

        def build(self) -> "Policy":
            return Policy(**self._attrs)

        def period_seconds(self, value: int, /) -> Self:
            """
            periodSeconds specifies the window of time for which the policy should hold true.
            PeriodSeconds must be greater than zero and less than or equal to 1800 (30 min).
            """
            return self._set("period_seconds", value)

        def type(self, value: str, /) -> Self:
            """
            type is used to specify the scaling policy.
            """
            return self._set("type", value)

        def value(self, value: int, /) -> Self:
            """
            value contains the amount of change which is permitted by the policy.
            It must be greater than zero
            """
            return self._set("value", value)

    class BuilderContext(BuilderContextBase["Policy.Builder"]):
        def model_post_init(self, __context) -> None:
            self._builder = Policy.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 Policy."""
        return cls.BuilderContext()

    class ListBuilder(GenericListBuilder["Policy", Builder]):
        def __init__(self):
            raise NotImplementedError(
                "This class is not meant to be instantiated. Use Policy.list_builder() instead."
            )

    @classmethod
    def list_builder(cls) -> ListBuilder:
        return GenericListBuilder[cls, cls.Builder]()  # type: ignore

    period_seconds: Annotated[int, Field(alias="periodSeconds")]
    """
    periodSeconds specifies the window of time for which the policy should hold true.
    PeriodSeconds must be greater than zero and less than or equal to 1800 (30 min).
    """
    type: str
    """
    type is used to specify the scaling policy.
    """
    value: int
    """
    value contains the amount of change which is permitted by the policy.
    It must be greater than zero
    """


class ScaleDown(BaseModel):
    class Builder(BaseModelBuilder):
        @property
        def cls(self) -> Type["ScaleDown"]:
            return ScaleDown

        def build(self) -> "ScaleDown":
            return ScaleDown(**self._attrs)

        @overload
        def policies(self, value_or_callback: List[Policy], /) -> "ScaleDown.Builder": ...

        @overload
        def policies(
            self,
            value_or_callback: Callable[
                [GenericListBuilder[Policy, Policy.Builder]],
                GenericListBuilder[Policy, Policy.Builder] | List[Policy],
            ],
            /,
        ) -> "ScaleDown.Builder": ...

        @overload
        def policies(
            self, value_or_callback: Never = ...
        ) -> ListBuilderContext[Policy.Builder]: ...

        def policies(self, value_or_callback=None, /):
            """
            policies is a list of potential scaling polices which can be used during scaling.
            At least one policy must be specified, otherwise the HPAScalingRules will be discarded as invalid
            """
            if self._in_context and value_or_callback is None:
                context = ListBuilderContext[Policy.Builder]()
                context._parent_builder = self
                context._field_name = "policies"
                return context

            value = value_or_callback
            if callable(value_or_callback):
                output = value_or_callback(Policy.list_builder())
                if isinstance(output, GenericListBuilder):
                    value = output.build()
                else:
                    value = output
            return self._set("policies", value)

        def select_policy(self, value: Optional[str], /) -> Self:
            """
            selectPolicy is used to specify which policy should be used.
            If not set, the default value Max is used.
            """
            return self._set("select_policy", value)

        def stabilization_window_seconds(self, value: Optional[int], /) -> Self:
            """
            stabilizationWindowSeconds is the number of seconds for which past recommendations should be
            considered while scaling up or scaling down.
            StabilizationWindowSeconds must be greater than or equal to zero and less than or equal to 3600 (one hour).
            If not set, use the default values:
            - For scale up: 0 (i.e. no stabilization is done).
            - For scale down: 300 (i.e. the stabilization window is 300 seconds long).
            """
            return self._set("stabilization_window_seconds", value)

    class BuilderContext(BuilderContextBase["ScaleDown.Builder"]):
        def model_post_init(self, __context) -> None:
            self._builder = ScaleDown.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 ScaleDown."""
        return cls.BuilderContext()

    class ListBuilder(GenericListBuilder["ScaleDown", Builder]):
        def __init__(self):
            raise NotImplementedError(
                "This class is not meant to be instantiated. Use ScaleDown.list_builder() instead."
            )

    @classmethod
    def list_builder(cls) -> ListBuilder:
        return GenericListBuilder[cls, cls.Builder]()  # type: ignore

    policies: Optional[List[Policy]] = None
    """
    policies is a list of potential scaling polices which can be used during scaling.
    At least one policy must be specified, otherwise the HPAScalingRules will be discarded as invalid
    """
    select_policy: Annotated[Optional[str], Field(alias="selectPolicy")] = None
    """
    selectPolicy is used to specify which policy should be used.
    If not set, the default value Max is used.
    """
    stabilization_window_seconds: Annotated[
        Optional[int], Field(alias="stabilizationWindowSeconds", ge=0, le=3600)
    ] = None
    """
    stabilizationWindowSeconds is the number of seconds for which past recommendations should be
    considered while scaling up or scaling down.
    StabilizationWindowSeconds must be greater than or equal to zero and less than or equal to 3600 (one hour).
    If not set, use the default values:
    - For scale up: 0 (i.e. no stabilization is done).
    - For scale down: 300 (i.e. the stabilization window is 300 seconds long).
    """


class ScaleUp(BaseModel):
    class Builder(BaseModelBuilder):
        @property
        def cls(self) -> Type["ScaleUp"]:
            return ScaleUp

        def build(self) -> "ScaleUp":
            return ScaleUp(**self._attrs)

        @overload
        def policies(self, value_or_callback: List[Policy], /) -> "ScaleUp.Builder": ...

        @overload
        def policies(
            self,
            value_or_callback: Callable[
                [GenericListBuilder[Policy, Policy.Builder]],
                GenericListBuilder[Policy, Policy.Builder] | List[Policy],
            ],
            /,
        ) -> "ScaleUp.Builder": ...

        @overload
        def policies(
            self, value_or_callback: Never = ...
        ) -> ListBuilderContext[Policy.Builder]: ...

        def policies(self, value_or_callback=None, /):
            """
            policies is a list of potential scaling polices which can be used during scaling.
            At least one policy must be specified, otherwise the HPAScalingRules will be discarded as invalid
            """
            if self._in_context and value_or_callback is None:
                context = ListBuilderContext[Policy.Builder]()
                context._parent_builder = self
                context._field_name = "policies"
                return context

            value = value_or_callback
            if callable(value_or_callback):
                output = value_or_callback(Policy.list_builder())
                if isinstance(output, GenericListBuilder):
                    value = output.build()
                else:
                    value = output
            return self._set("policies", value)

        def select_policy(self, value: Optional[str], /) -> Self:
            """
            selectPolicy is used to specify which policy should be used.
            If not set, the default value Max is used.
            """
            return self._set("select_policy", value)

        def stabilization_window_seconds(self, value: Optional[int], /) -> Self:
            """
            stabilizationWindowSeconds is the number of seconds for which past recommendations should be
            considered while scaling up or scaling down.
            StabilizationWindowSeconds must be greater than or equal to zero and less than or equal to 3600 (one hour).
            If not set, use the default values:
            - For scale up: 0 (i.e. no stabilization is done).
            - For scale down: 300 (i.e. the stabilization window is 300 seconds long).
            """
            return self._set("stabilization_window_seconds", value)

    class BuilderContext(BuilderContextBase["ScaleUp.Builder"]):
        def model_post_init(self, __context) -> None:
            self._builder = ScaleUp.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 ScaleUp."""
        return cls.BuilderContext()

    class ListBuilder(GenericListBuilder["ScaleUp", Builder]):
        def __init__(self):
            raise NotImplementedError(
                "This class is not meant to be instantiated. Use ScaleUp.list_builder() instead."
            )

    @classmethod
    def list_builder(cls) -> ListBuilder:
        return GenericListBuilder[cls, cls.Builder]()  # type: ignore

    policies: Optional[List[Policy]] = None
    """
    policies is a list of potential scaling polices which can be used during scaling.
    At least one policy must be specified, otherwise the HPAScalingRules will be discarded as invalid
    """
    select_policy: Annotated[Optional[str], Field(alias="selectPolicy")] = None
    """
    selectPolicy is used to specify which policy should be used.
    If not set, the default value Max is used.
    """
    stabilization_window_seconds: Annotated[
        Optional[int], Field(alias="stabilizationWindowSeconds", ge=0, le=3600)
    ] = None
    """
    stabilizationWindowSeconds is the number of seconds for which past recommendations should be
    considered while scaling up or scaling down.
    StabilizationWindowSeconds must be greater than or equal to zero and less than or equal to 3600 (one hour).
    If not set, use the default values:
    - For scale up: 0 (i.e. no stabilization is done).
    - For scale down: 300 (i.e. the stabilization window is 300 seconds long).
    """


class Behavior(BaseModel):
    class Builder(BaseModelBuilder):
        @property
        def cls(self) -> Type["Behavior"]:
            return Behavior

        def build(self) -> "Behavior":
            return Behavior(**self._attrs)

        @overload
        def scale_down(self, value_or_callback: Optional[ScaleDown], /) -> "Behavior.Builder": ...

        @overload
        def scale_down(
            self,
            value_or_callback: Callable[[ScaleDown.Builder], ScaleDown.Builder | ScaleDown],
            /,
        ) -> "Behavior.Builder": ...

        @overload
        def scale_down(self, value_or_callback: Never = ...) -> "ScaleDown.BuilderContext": ...

        def scale_down(self, value_or_callback=None, /):
            """
            scaleDown is scaling policy for scaling Down.
            If not set, the default value is to allow to scale down to minReplicas pods, with a
            300 second stabilization window (i.e., the highest recommendation for
            the last 300sec is used).
            """
            if self._in_context and value_or_callback is None:
                context = ScaleDown.BuilderContext()
                context._parent_builder = self
                context._field_name = "scale_down"
                return context

            value = value_or_callback
            if callable(value_or_callback):
                output = value_or_callback(ScaleDown.builder())
                if isinstance(output, ScaleDown.Builder):
                    value = output.build()
                else:
                    value = output
            return self._set("scale_down", value)

        @overload
        def scale_up(self, value_or_callback: Optional[ScaleUp], /) -> "Behavior.Builder": ...

        @overload
        def scale_up(
            self,
            value_or_callback: Callable[[ScaleUp.Builder], ScaleUp.Builder | ScaleUp],
            /,
        ) -> "Behavior.Builder": ...

        @overload
        def scale_up(self, value_or_callback: Never = ...) -> "ScaleUp.BuilderContext": ...

        def scale_up(self, value_or_callback=None, /):
            """
            scaleUp is scaling policy for scaling Up.
            If not set, the default value is the higher of:
              * increase no more than 4 pods per 60 seconds
              * double the number of pods per 60 seconds
            No stabilization is used.
            """
            if self._in_context and value_or_callback is None:
                context = ScaleUp.BuilderContext()
                context._parent_builder = self
                context._field_name = "scale_up"
                return context

            value = value_or_callback
            if callable(value_or_callback):
                output = value_or_callback(ScaleUp.builder())
                if isinstance(output, ScaleUp.Builder):
                    value = output.build()
                else:
                    value = output
            return self._set("scale_up", value)

    class BuilderContext(BuilderContextBase["Behavior.Builder"]):
        def model_post_init(self, __context) -> None:
            self._builder = Behavior.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 Behavior."""
        return cls.BuilderContext()

    class ListBuilder(GenericListBuilder["Behavior", Builder]):
        def __init__(self):
            raise NotImplementedError(
                "This class is not meant to be instantiated. Use Behavior.list_builder() instead."
            )

    @classmethod
    def list_builder(cls) -> ListBuilder:
        return GenericListBuilder[cls, cls.Builder]()  # type: ignore

    scale_down: Annotated[Optional[ScaleDown], Field(alias="scaleDown")] = None
    """
    scaleDown is scaling policy for scaling Down.
    If not set, the default value is to allow to scale down to minReplicas pods, with a
    300 second stabilization window (i.e., the highest recommendation for
    the last 300sec is used).
    """
    scale_up: Annotated[Optional[ScaleUp], Field(alias="scaleUp")] = None
    """
    scaleUp is scaling policy for scaling Up.
    If not set, the default value is the higher of:
      * increase no more than 4 pods per 60 seconds
      * double the number of pods per 60 seconds
    No stabilization is used.
    """


class HorizontalPodAutoscalerConfig(BaseModel):
    class Builder(BaseModelBuilder):
        @property
        def cls(self) -> Type["HorizontalPodAutoscalerConfig"]:
            return HorizontalPodAutoscalerConfig

        def build(self) -> "HorizontalPodAutoscalerConfig":
            return HorizontalPodAutoscalerConfig(**self._attrs)

        @overload
        def behavior(
            self, value_or_callback: Optional[Behavior], /
        ) -> "HorizontalPodAutoscalerConfig.Builder": ...

        @overload
        def behavior(
            self,
            value_or_callback: Callable[[Behavior.Builder], Behavior.Builder | Behavior],
            /,
        ) -> "HorizontalPodAutoscalerConfig.Builder": ...

        @overload
        def behavior(self, value_or_callback: Never = ...) -> "Behavior.BuilderContext": ...

        def behavior(self, value_or_callback=None, /):
            """
            HorizontalPodAutoscalerBehavior configures the scaling behavior of the target
            in both Up and Down directions (scaleUp and scaleDown fields respectively).
            """
            if self._in_context and value_or_callback is None:
                context = Behavior.BuilderContext()
                context._parent_builder = self
                context._field_name = "behavior"
                return context

            value = value_or_callback
            if callable(value_or_callback):
                output = value_or_callback(Behavior.builder())
                if isinstance(output, Behavior.Builder):
                    value = output.build()
                else:
                    value = output
            return self._set("behavior", value)

        def name(self, value: Optional[str], /) -> Self:
            return self._set("name", value)

    class BuilderContext(BuilderContextBase["HorizontalPodAutoscalerConfig.Builder"]):
        def model_post_init(self, __context) -> None:
            self._builder = HorizontalPodAutoscalerConfig.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 HorizontalPodAutoscalerConfig."""
        return cls.BuilderContext()

    class ListBuilder(GenericListBuilder["HorizontalPodAutoscalerConfig", Builder]):
        def __init__(self):
            raise NotImplementedError(
                "This class is not meant to be instantiated. Use HorizontalPodAutoscalerConfig.list_builder() instead."
            )

    @classmethod
    def list_builder(cls) -> ListBuilder:
        return GenericListBuilder[cls, cls.Builder]()  # type: ignore

    behavior: Optional[Behavior] = None
    """
    HorizontalPodAutoscalerBehavior configures the scaling behavior of the target
    in both Up and Down directions (scaleUp and scaleDown fields respectively).
    """
    name: Optional[str] = None


class ScalingModifiers(BaseModel):
    class Builder(BaseModelBuilder):
        @property
        def cls(self) -> Type["ScalingModifiers"]:
            return ScalingModifiers

        def build(self) -> "ScalingModifiers":
            return ScalingModifiers(**self._attrs)

        def activation_target(self, value: Optional[str], /) -> Self:
            return self._set("activation_target", value)

        def formula(self, value: Optional[str], /) -> Self:
            return self._set("formula", value)

        def metric_type(self, value: Optional[str], /) -> Self:
            """
            MetricTargetType specifies the type of metric being targeted, and should be either
            "Value", "AverageValue", or "Utilization"
            """
            return self._set("metric_type", value)

        def target(self, value: Optional[str], /) -> Self:
            return self._set("target", value)

    class BuilderContext(BuilderContextBase["ScalingModifiers.Builder"]):
        def model_post_init(self, __context) -> None:
            self._builder = ScalingModifiers.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 ScalingModifiers."""
        return cls.BuilderContext()

    class ListBuilder(GenericListBuilder["ScalingModifiers", Builder]):
        def __init__(self):
            raise NotImplementedError(
                "This class is not meant to be instantiated. Use ScalingModifiers.list_builder() instead."
            )

    @classmethod
    def list_builder(cls) -> ListBuilder:
        return GenericListBuilder[cls, cls.Builder]()  # type: ignore

    activation_target: Annotated[Optional[str], Field(alias="activationTarget")] = None
    formula: Optional[str] = None
    metric_type: Annotated[Optional[str], Field(alias="metricType")] = None
    """
    MetricTargetType specifies the type of metric being targeted, and should be either
    "Value", "AverageValue", or "Utilization"
    """
    target: Optional[str] = None


class Advanced(BaseModel):
    class Builder(BaseModelBuilder):
        @property
        def cls(self) -> Type["Advanced"]:
            return Advanced

        def build(self) -> "Advanced":
            return Advanced(**self._attrs)

        @overload
        def horizontal_pod_autoscaler_config(
            self, value_or_callback: Optional[HorizontalPodAutoscalerConfig], /
        ) -> "Advanced.Builder": ...

        @overload
        def horizontal_pod_autoscaler_config(
            self,
            value_or_callback: Callable[
                [HorizontalPodAutoscalerConfig.Builder],
                HorizontalPodAutoscalerConfig.Builder | HorizontalPodAutoscalerConfig,
            ],
            /,
        ) -> "Advanced.Builder": ...

        @overload
        def horizontal_pod_autoscaler_config(
            self, value_or_callback: Never = ...
        ) -> "HorizontalPodAutoscalerConfig.BuilderContext": ...

        def horizontal_pod_autoscaler_config(self, value_or_callback=None, /):
            """
            HorizontalPodAutoscalerConfig specifies horizontal scale config
            """
            if self._in_context and value_or_callback is None:
                context = HorizontalPodAutoscalerConfig.BuilderContext()
                context._parent_builder = self
                context._field_name = "horizontal_pod_autoscaler_config"
                return context

            value = value_or_callback
            if callable(value_or_callback):
                output = value_or_callback(HorizontalPodAutoscalerConfig.builder())
                if isinstance(output, HorizontalPodAutoscalerConfig.Builder):
                    value = output.build()
                else:
                    value = output
            return self._set("horizontal_pod_autoscaler_config", value)

        def restore_to_original_replica_count(self, value: Optional[bool], /) -> Self:
            return self._set("restore_to_original_replica_count", value)

        @overload
        def scaling_modifiers(
            self, value_or_callback: Optional[ScalingModifiers], /
        ) -> "Advanced.Builder": ...

        @overload
        def scaling_modifiers(
            self,
            value_or_callback: Callable[
                [ScalingModifiers.Builder], ScalingModifiers.Builder | ScalingModifiers
            ],
            /,
        ) -> "Advanced.Builder": ...

        @overload
        def scaling_modifiers(
            self, value_or_callback: Never = ...
        ) -> "ScalingModifiers.BuilderContext": ...

        def scaling_modifiers(self, value_or_callback=None, /):
            """
            ScalingModifiers describes advanced scaling logic options like formula
            """
            if self._in_context and value_or_callback is None:
                context = ScalingModifiers.BuilderContext()
                context._parent_builder = self
                context._field_name = "scaling_modifiers"
                return context

            value = value_or_callback
            if callable(value_or_callback):
                output = value_or_callback(ScalingModifiers.builder())
                if isinstance(output, ScalingModifiers.Builder):
                    value = output.build()
                else:
                    value = output
            return self._set("scaling_modifiers", value)

    class BuilderContext(BuilderContextBase["Advanced.Builder"]):
        def model_post_init(self, __context) -> None:
            self._builder = Advanced.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 Advanced."""
        return cls.BuilderContext()

    class ListBuilder(GenericListBuilder["Advanced", Builder]):
        def __init__(self):
            raise NotImplementedError(
                "This class is not meant to be instantiated. Use Advanced.list_builder() instead."
            )

    @classmethod
    def list_builder(cls) -> ListBuilder:
        return GenericListBuilder[cls, cls.Builder]()  # type: ignore

    horizontal_pod_autoscaler_config: Annotated[
        Optional[HorizontalPodAutoscalerConfig],
        Field(alias="horizontalPodAutoscalerConfig"),
    ] = None
    """
    HorizontalPodAutoscalerConfig specifies horizontal scale config
    """
    restore_to_original_replica_count: Annotated[
        Optional[bool], Field(alias="restoreToOriginalReplicaCount")
    ] = None
    scaling_modifiers: Annotated[Optional[ScalingModifiers], Field(alias="scalingModifiers")] = None
    """
    ScalingModifiers describes advanced scaling logic options like formula
    """


class Fallback(BaseModel):
    class Builder(BaseModelBuilder):
        @property
        def cls(self) -> Type["Fallback"]:
            return Fallback

        def build(self) -> "Fallback":
            return Fallback(**self._attrs)

        def failure_threshold(self, value: int, /) -> Self:
            return self._set("failure_threshold", value)

        def replicas(self, value: int, /) -> Self:
            return self._set("replicas", value)

    class BuilderContext(BuilderContextBase["Fallback.Builder"]):
        def model_post_init(self, __context) -> None:
            self._builder = Fallback.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 Fallback."""
        return cls.BuilderContext()

    class ListBuilder(GenericListBuilder["Fallback", Builder]):
        def __init__(self):
            raise NotImplementedError(
                "This class is not meant to be instantiated. Use Fallback.list_builder() instead."
            )

    @classmethod
    def list_builder(cls) -> ListBuilder:
        return GenericListBuilder[cls, cls.Builder]()  # type: ignore

    failure_threshold: Annotated[int, Field(alias="failureThreshold")]
    replicas: int


class ScaleTargetRef(BaseModel):
    class Builder(BaseModelBuilder):
        @property
        def cls(self) -> Type["ScaleTargetRef"]:
            return ScaleTargetRef

        def build(self) -> "ScaleTargetRef":
            return ScaleTargetRef(**self._attrs)

        def api_version(self, value: Optional[str], /) -> Self:
            return self._set("api_version", value)

        def env_source_container_name(self, value: Optional[str], /) -> Self:
            return self._set("env_source_container_name", value)

        def kind(self, value: Optional[str], /) -> Self:
            return self._set("kind", value)

        def name(self, value: str, /) -> Self:
            return self._set("name", value)

    class BuilderContext(BuilderContextBase["ScaleTargetRef.Builder"]):
        def model_post_init(self, __context) -> None:
            self._builder = ScaleTargetRef.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 ScaleTargetRef."""
        return cls.BuilderContext()

    class ListBuilder(GenericListBuilder["ScaleTargetRef", Builder]):
        def __init__(self):
            raise NotImplementedError(
                "This class is not meant to be instantiated. Use ScaleTargetRef.list_builder() instead."
            )

    @classmethod
    def list_builder(cls) -> ListBuilder:
        return GenericListBuilder[cls, cls.Builder]()  # type: ignore

    api_version: Annotated[Optional[str], Field(alias="apiVersion")] = None
    env_source_container_name: Annotated[Optional[str], Field(alias="envSourceContainerName")] = (
        None
    )
    kind: Optional[str] = None
    name: str


class TriggerModel(BaseModel):
    class Builder(BaseModelBuilder):
        @property
        def cls(self) -> Type["TriggerModel"]:
            return TriggerModel

        def build(self) -> "TriggerModel":
            return TriggerModel(**self._attrs)

        @overload
        def authentication_ref(
            self, value_or_callback: Optional[AuthenticationRef], /
        ) -> "TriggerModel.Builder": ...

        @overload
        def authentication_ref(
            self,
            value_or_callback: Callable[
                [AuthenticationRef.Builder],
                AuthenticationRef.Builder | AuthenticationRef,
            ],
            /,
        ) -> "TriggerModel.Builder": ...

        @overload
        def authentication_ref(
            self, value_or_callback: Never = ...
        ) -> "AuthenticationRef.BuilderContext": ...

        def authentication_ref(self, value_or_callback=None, /):
            """
            AuthenticationRef points to the TriggerAuthentication or ClusterTriggerAuthentication object that
            is used to authenticate the scaler with the environment
            """
            if self._in_context and value_or_callback is None:
                context = AuthenticationRef.BuilderContext()
                context._parent_builder = self
                context._field_name = "authentication_ref"
                return context

            value = value_or_callback
            if callable(value_or_callback):
                output = value_or_callback(AuthenticationRef.builder())
                if isinstance(output, AuthenticationRef.Builder):
                    value = output.build()
                else:
                    value = output
            return self._set("authentication_ref", value)

        def metadata(self, value: Dict[str, str], /) -> Self:
            return self._set("metadata", value)

        def metric_type(self, value: Optional[str], /) -> Self:
            """
            MetricTargetType specifies the type of metric being targeted, and should be either
            "Value", "AverageValue", or "Utilization"
            """
            return self._set("metric_type", value)

        def name(self, value: Optional[str], /) -> Self:
            return self._set("name", value)

        def type(self, value: str, /) -> Self:
            return self._set("type", value)

        def use_cached_metrics(self, value: Optional[bool], /) -> Self:
            return self._set("use_cached_metrics", value)

    class BuilderContext(BuilderContextBase["TriggerModel.Builder"]):
        def model_post_init(self, __context) -> None:
            self._builder = TriggerModel.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 TriggerModel."""
        return cls.BuilderContext()

    class ListBuilder(GenericListBuilder["TriggerModel", Builder]):
        def __init__(self):
            raise NotImplementedError(
                "This class is not meant to be instantiated. Use TriggerModel.list_builder() instead."
            )

    @classmethod
    def list_builder(cls) -> ListBuilder:
        return GenericListBuilder[cls, cls.Builder]()  # type: ignore

    authentication_ref: Annotated[Optional[AuthenticationRef], Field(alias="authenticationRef")] = (
        None
    )
    """
    AuthenticationRef points to the TriggerAuthentication or ClusterTriggerAuthentication object that
    is used to authenticate the scaler with the environment
    """
    metadata: Dict[str, str]
    metric_type: Annotated[Optional[str], Field(alias="metricType")] = None
    """
    MetricTargetType specifies the type of metric being targeted, and should be either
    "Value", "AverageValue", or "Utilization"
    """
    name: Optional[str] = None
    type: str
    use_cached_metrics: Annotated[Optional[bool], Field(alias="useCachedMetrics")] = None


class ScaledObjectSpec(BaseModel):
    class Builder(BaseModelBuilder):
        @property
        def cls(self) -> Type["ScaledObjectSpec"]:
            return ScaledObjectSpec

        def build(self) -> "ScaledObjectSpec":
            return ScaledObjectSpec(**self._attrs)

        @overload
        def advanced(
            self, value_or_callback: Optional[Advanced], /
        ) -> "ScaledObjectSpec.Builder": ...

        @overload
        def advanced(
            self,
            value_or_callback: Callable[[Advanced.Builder], Advanced.Builder | Advanced],
            /,
        ) -> "ScaledObjectSpec.Builder": ...

        @overload
        def advanced(self, value_or_callback: Never = ...) -> "Advanced.BuilderContext": ...

        def advanced(self, value_or_callback=None, /):
            """
            AdvancedConfig specifies advance scaling options
            """
            if self._in_context and value_or_callback is None:
                context = Advanced.BuilderContext()
                context._parent_builder = self
                context._field_name = "advanced"
                return context

            value = value_or_callback
            if callable(value_or_callback):
                output = value_or_callback(Advanced.builder())
                if isinstance(output, Advanced.Builder):
                    value = output.build()
                else:
                    value = output
            return self._set("advanced", value)

        def cooldown_period(self, value: Optional[int], /) -> Self:
            return self._set("cooldown_period", value)

        @overload
        def fallback(
            self, value_or_callback: Optional[Fallback], /
        ) -> "ScaledObjectSpec.Builder": ...

        @overload
        def fallback(
            self,
            value_or_callback: Callable[[Fallback.Builder], Fallback.Builder | Fallback],
            /,
        ) -> "ScaledObjectSpec.Builder": ...

        @overload
        def fallback(self, value_or_callback: Never = ...) -> "Fallback.BuilderContext": ...

        def fallback(self, value_or_callback=None, /):
            """
            Fallback is the spec for fallback options
            """
            if self._in_context and value_or_callback is None:
                context = Fallback.BuilderContext()
                context._parent_builder = self
                context._field_name = "fallback"
                return context

            value = value_or_callback
            if callable(value_or_callback):
                output = value_or_callback(Fallback.builder())
                if isinstance(output, Fallback.Builder):
                    value = output.build()
                else:
                    value = output
            return self._set("fallback", value)

        def idle_replica_count(self, value: Optional[int], /) -> Self:
            return self._set("idle_replica_count", value)

        def initial_cooldown_period(self, value: Optional[int], /) -> Self:
            return self._set("initial_cooldown_period", value)

        def max_replica_count(self, value: Optional[int], /) -> Self:
            return self._set("max_replica_count", value)

        def min_replica_count(self, value: Optional[int], /) -> Self:
            return self._set("min_replica_count", value)

        def polling_interval(self, value: Optional[int], /) -> Self:
            return self._set("polling_interval", value)

        @overload
        def scale_target_ref(
            self, value_or_callback: ScaleTargetRef, /
        ) -> "ScaledObjectSpec.Builder": ...

        @overload
        def scale_target_ref(
            self,
            value_or_callback: Callable[
                [ScaleTargetRef.Builder], ScaleTargetRef.Builder | ScaleTargetRef
            ],
            /,
        ) -> "ScaledObjectSpec.Builder": ...

        @overload
        def scale_target_ref(
            self, value_or_callback: Never = ...
        ) -> "ScaleTargetRef.BuilderContext": ...

        def scale_target_ref(self, value_or_callback=None, /):
            """
            ScaleTarget holds the reference to the scale target Object
            """
            if self._in_context and value_or_callback is None:
                context = ScaleTargetRef.BuilderContext()
                context._parent_builder = self
                context._field_name = "scale_target_ref"
                return context

            value = value_or_callback
            if callable(value_or_callback):
                output = value_or_callback(ScaleTargetRef.builder())
                if isinstance(output, ScaleTargetRef.Builder):
                    value = output.build()
                else:
                    value = output
            return self._set("scale_target_ref", value)

        @overload
        def triggers(
            self, value_or_callback: List[TriggerModel], /
        ) -> "ScaledObjectSpec.Builder": ...

        @overload
        def triggers(
            self,
            value_or_callback: Callable[
                [GenericListBuilder[TriggerModel, TriggerModel.Builder]],
                GenericListBuilder[TriggerModel, TriggerModel.Builder] | List[TriggerModel],
            ],
            /,
        ) -> "ScaledObjectSpec.Builder": ...

        @overload
        def triggers(
            self, value_or_callback: Never = ...
        ) -> ListBuilderContext[TriggerModel.Builder]: ...

        def triggers(self, value_or_callback=None, /):
            if self._in_context and value_or_callback is None:
                context = ListBuilderContext[TriggerModel.Builder]()
                context._parent_builder = self
                context._field_name = "triggers"
                return context

            value = value_or_callback
            if callable(value_or_callback):
                output = value_or_callback(TriggerModel.list_builder())
                if isinstance(output, GenericListBuilder):
                    value = output.build()
                else:
                    value = output
            return self._set("triggers", value)

    class BuilderContext(BuilderContextBase["ScaledObjectSpec.Builder"]):
        def model_post_init(self, __context) -> None:
            self._builder = ScaledObjectSpec.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 ScaledObjectSpec."""
        return cls.BuilderContext()

    class ListBuilder(GenericListBuilder["ScaledObjectSpec", Builder]):
        def __init__(self):
            raise NotImplementedError(
                "This class is not meant to be instantiated. Use ScaledObjectSpec.list_builder() instead."
            )

    @classmethod
    def list_builder(cls) -> ListBuilder:
        return GenericListBuilder[cls, cls.Builder]()  # type: ignore

    advanced: Optional[Advanced] = None
    """
    AdvancedConfig specifies advance scaling options
    """
    cooldown_period: Annotated[Optional[int], Field(alias="cooldownPeriod")] = None
    fallback: Optional[Fallback] = None
    """
    Fallback is the spec for fallback options
    """
    idle_replica_count: Annotated[Optional[int], Field(alias="idleReplicaCount")] = None
    initial_cooldown_period: Annotated[Optional[int], Field(alias="initialCooldownPeriod")] = None
    max_replica_count: Annotated[Optional[int], Field(alias="maxReplicaCount")] = None
    min_replica_count: Annotated[Optional[int], Field(alias="minReplicaCount")] = None
    polling_interval: Annotated[Optional[int], Field(alias="pollingInterval")] = None
    scale_target_ref: Annotated[ScaleTargetRef, Field(alias="scaleTargetRef")]
    """
    ScaleTarget holds the reference to the scale target Object
    """
    triggers: List[TriggerModel]


class Health(BaseModel):
    class Builder(BaseModelBuilder):
        @property
        def cls(self) -> Type["Health"]:
            return Health

        def build(self) -> "Health":
            return Health(**self._attrs)

        def number_of_failures(self, value: Optional[int], /) -> Self:
            return self._set("number_of_failures", value)

        def status(self, value: Optional[str], /) -> Self:
            """
            HealthStatusType is an indication of whether the health status is happy or failing
            """
            return self._set("status", value)

    class BuilderContext(BuilderContextBase["Health.Builder"]):
        def model_post_init(self, __context) -> None:
            self._builder = Health.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 Health."""
        return cls.BuilderContext()

    class ListBuilder(GenericListBuilder["Health", Builder]):
        def __init__(self):
            raise NotImplementedError(
                "This class is not meant to be instantiated. Use Health.list_builder() instead."
            )

    @classmethod
    def list_builder(cls) -> ListBuilder:
        return GenericListBuilder[cls, cls.Builder]()  # type: ignore

    number_of_failures: Annotated[Optional[int], Field(alias="numberOfFailures")] = None
    status: Optional[str] = None
    """
    HealthStatusType is an indication of whether the health status is happy or failing
    """


class ScaleTargetGvkr(BaseModel):
    class Builder(BaseModelBuilder):
        @property
        def cls(self) -> Type["ScaleTargetGvkr"]:
            return ScaleTargetGvkr

        def build(self) -> "ScaleTargetGvkr":
            return ScaleTargetGvkr(**self._attrs)

        def group(self, value: str, /) -> Self:
            return self._set("group", value)

        def kind(self, value: str, /) -> Self:
            return self._set("kind", value)

        def resource(self, value: str, /) -> Self:
            return self._set("resource", value)

        def version(self, value: str, /) -> Self:
            return self._set("version", value)

    class BuilderContext(BuilderContextBase["ScaleTargetGvkr.Builder"]):
        def model_post_init(self, __context) -> None:
            self._builder = ScaleTargetGvkr.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 ScaleTargetGvkr."""
        return cls.BuilderContext()

    class ListBuilder(GenericListBuilder["ScaleTargetGvkr", Builder]):
        def __init__(self):
            raise NotImplementedError(
                "This class is not meant to be instantiated. Use ScaleTargetGvkr.list_builder() instead."
            )

    @classmethod
    def list_builder(cls) -> ListBuilder:
        return GenericListBuilder[cls, cls.Builder]()  # type: ignore

    group: str
    kind: str
    resource: str
    version: str


class ScaledObjectStatus(BaseModel):
    class Builder(BaseModelBuilder):
        @property
        def cls(self) -> Type["ScaledObjectStatus"]:
            return ScaledObjectStatus

        def build(self) -> "ScaledObjectStatus":
            return ScaledObjectStatus(**self._attrs)

        def authentications_types(self, value: Optional[str], /) -> Self:
            return self._set("authentications_types", value)

        def composite_scaler_name(self, value: Optional[str], /) -> Self:
            return self._set("composite_scaler_name", value)

        @overload
        def conditions(
            self, value_or_callback: List[Condition], /
        ) -> "ScaledObjectStatus.Builder": ...

        @overload
        def conditions(
            self,
            value_or_callback: Callable[
                [GenericListBuilder[Condition, Condition.Builder]],
                GenericListBuilder[Condition, Condition.Builder] | List[Condition],
            ],
            /,
        ) -> "ScaledObjectStatus.Builder": ...

        @overload
        def conditions(
            self, value_or_callback: Never = ...
        ) -> ListBuilderContext[Condition.Builder]: ...

        def conditions(self, value_or_callback=None, /):
            """
            Conditions an array representation to store multiple Conditions
            """
            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 external_metric_names(self, value: Optional[List[str]], /) -> Self:
            return self._set("external_metric_names", value)

        def health(self, value: Optional[Dict[str, Health]], /) -> Self:
            return self._set("health", value)

        def hpa_name(self, value: Optional[str], /) -> Self:
            return self._set("hpa_name", value)

        def last_active_time(self, value: Optional[datetime], /) -> Self:
            return self._set("last_active_time", value)

        def original_replica_count(self, value: Optional[int], /) -> Self:
            return self._set("original_replica_count", value)

        def paused_replica_count(self, value: Optional[int], /) -> Self:
            return self._set("paused_replica_count", value)

        def resource_metric_names(self, value: Optional[List[str]], /) -> Self:
            return self._set("resource_metric_names", value)

        @overload
        def scale_target_gvkr(
            self, value_or_callback: Optional[ScaleTargetGvkr], /
        ) -> "ScaledObjectStatus.Builder": ...

        @overload
        def scale_target_gvkr(
            self,
            value_or_callback: Callable[
                [ScaleTargetGvkr.Builder], ScaleTargetGvkr.Builder | ScaleTargetGvkr
            ],
            /,
        ) -> "ScaledObjectStatus.Builder": ...

        @overload
        def scale_target_gvkr(
            self, value_or_callback: Never = ...
        ) -> "ScaleTargetGvkr.BuilderContext": ...

        def scale_target_gvkr(self, value_or_callback=None, /):
            """
            GroupVersionKindResource provides unified structure for schema.GroupVersionKind and Resource
            """
            if self._in_context and value_or_callback is None:
                context = ScaleTargetGvkr.BuilderContext()
                context._parent_builder = self
                context._field_name = "scale_target_gvkr"
                return context

            value = value_or_callback
            if callable(value_or_callback):
                output = value_or_callback(ScaleTargetGvkr.builder())
                if isinstance(output, ScaleTargetGvkr.Builder):
                    value = output.build()
                else:
                    value = output
            return self._set("scale_target_gvkr", value)

        def scale_target_kind(self, value: Optional[str], /) -> Self:
            return self._set("scale_target_kind", value)

        def triggers_types(self, value: Optional[str], /) -> Self:
            return self._set("triggers_types", value)

    class BuilderContext(BuilderContextBase["ScaledObjectStatus.Builder"]):
        def model_post_init(self, __context) -> None:
            self._builder = ScaledObjectStatus.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 ScaledObjectStatus."""
        return cls.BuilderContext()

    class ListBuilder(GenericListBuilder["ScaledObjectStatus", Builder]):
        def __init__(self):
            raise NotImplementedError(
                "This class is not meant to be instantiated. Use ScaledObjectStatus.list_builder() instead."
            )

    @classmethod
    def list_builder(cls) -> ListBuilder:
        return GenericListBuilder[cls, cls.Builder]()  # type: ignore

    authentications_types: Annotated[Optional[str], Field(alias="authenticationsTypes")] = None
    composite_scaler_name: Annotated[Optional[str], Field(alias="compositeScalerName")] = None
    conditions: Optional[List[Condition]] = None
    """
    Conditions an array representation to store multiple Conditions
    """
    external_metric_names: Annotated[Optional[List[str]], Field(alias="externalMetricNames")] = None
    health: Optional[Dict[str, Health]] = None
    hpa_name: Annotated[Optional[str], Field(alias="hpaName")] = None
    last_active_time: Annotated[Optional[datetime], Field(alias="lastActiveTime")] = None
    original_replica_count: Annotated[Optional[int], Field(alias="originalReplicaCount")] = None
    paused_replica_count: Annotated[Optional[int], Field(alias="pausedReplicaCount")] = None
    resource_metric_names: Annotated[Optional[List[str]], Field(alias="resourceMetricNames")] = None
    scale_target_gvkr: Annotated[Optional[ScaleTargetGvkr], Field(alias="scaleTargetGVKR")] = None
    """
    GroupVersionKindResource provides unified structure for schema.GroupVersionKind and Resource
    """
    scale_target_kind: Annotated[Optional[str], Field(alias="scaleTargetKind")] = None
    triggers_types: Annotated[Optional[str], Field(alias="triggersTypes")] = None


class SecretKeyRefModel1(BaseModel):
    class Builder(BaseModelBuilder):
        @property
        def cls(self) -> Type["SecretKeyRefModel1"]:
            return SecretKeyRefModel1

        def build(self) -> "SecretKeyRefModel1":
            return SecretKeyRefModel1(**self._attrs)

        def key(self, value: str, /) -> Self:
            return self._set("key", value)

        def name(self, value: str, /) -> Self:
            return self._set("name", value)

    class BuilderContext(BuilderContextBase["SecretKeyRefModel1.Builder"]):
        def model_post_init(self, __context) -> None:
            self._builder = SecretKeyRefModel1.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 SecretKeyRefModel1."""
        return cls.BuilderContext()

    class ListBuilder(GenericListBuilder["SecretKeyRefModel1", Builder]):
        def __init__(self):
            raise NotImplementedError(
                "This class is not meant to be instantiated. Use SecretKeyRefModel1.list_builder() instead."
            )

    @classmethod
    def list_builder(cls) -> ListBuilder:
        return GenericListBuilder[cls, cls.Builder]()  # type: ignore

    key: str
    name: str


class ValueFromModel1(BaseModel):
    class Builder(BaseModelBuilder):
        @property
        def cls(self) -> Type["ValueFromModel1"]:
            return ValueFromModel1

        def build(self) -> "ValueFromModel1":
            return ValueFromModel1(**self._attrs)

        @overload
        def secret_key_ref(
            self, value_or_callback: SecretKeyRefModel1, /
        ) -> "ValueFromModel1.Builder": ...

        @overload
        def secret_key_ref(
            self,
            value_or_callback: Callable[
                [SecretKeyRefModel1.Builder],
                SecretKeyRefModel1.Builder | SecretKeyRefModel1,
            ],
            /,
        ) -> "ValueFromModel1.Builder": ...

        @overload
        def secret_key_ref(
            self, value_or_callback: Never = ...
        ) -> "SecretKeyRefModel1.BuilderContext": ...

        def secret_key_ref(self, value_or_callback=None, /):
            if self._in_context and value_or_callback is None:
                context = SecretKeyRefModel1.BuilderContext()
                context._parent_builder = self
                context._field_name = "secret_key_ref"
                return context

            value = value_or_callback
            if callable(value_or_callback):
                output = value_or_callback(SecretKeyRefModel1.builder())
                if isinstance(output, SecretKeyRefModel1.Builder):
                    value = output.build()
                else:
                    value = output
            return self._set("secret_key_ref", value)

    class BuilderContext(BuilderContextBase["ValueFromModel1.Builder"]):
        def model_post_init(self, __context) -> None:
            self._builder = ValueFromModel1.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 ValueFromModel1."""
        return cls.BuilderContext()

    class ListBuilder(GenericListBuilder["ValueFromModel1", Builder]):
        def __init__(self):
            raise NotImplementedError(
                "This class is not meant to be instantiated. Use ValueFromModel1.list_builder() instead."
            )

    @classmethod
    def list_builder(cls) -> ListBuilder:
        return GenericListBuilder[cls, cls.Builder]()  # type: ignore

    secret_key_ref: Annotated[SecretKeyRefModel1, Field(alias="secretKeyRef")]


class CredentialsModel2(BaseModel):
    class Builder(BaseModelBuilder):
        @property
        def cls(self) -> Type["CredentialsModel2"]:
            return CredentialsModel2

        def build(self) -> "CredentialsModel2":
            return CredentialsModel2(**self._attrs)

        @overload
        def access_key(self, value_or_callback: AccessKey, /) -> "CredentialsModel2.Builder": ...

        @overload
        def access_key(
            self,
            value_or_callback: Callable[[AccessKey.Builder], AccessKey.Builder | AccessKey],
            /,
        ) -> "CredentialsModel2.Builder": ...

        @overload
        def access_key(self, value_or_callback: Never = ...) -> "AccessKey.BuilderContext": ...

        def access_key(self, value_or_callback=None, /):
            if self._in_context and value_or_callback is None:
                context = AccessKey.BuilderContext()
                context._parent_builder = self
                context._field_name = "access_key"
                return context

            value = value_or_callback
            if callable(value_or_callback):
                output = value_or_callback(AccessKey.builder())
                if isinstance(output, AccessKey.Builder):
                    value = output.build()
                else:
                    value = output
            return self._set("access_key", value)

        @overload
        def access_secret_key(
            self, value_or_callback: AccessSecretKey, /
        ) -> "CredentialsModel2.Builder": ...

        @overload
        def access_secret_key(
            self,
            value_or_callback: Callable[
                [AccessSecretKey.Builder], AccessSecretKey.Builder | AccessSecretKey
            ],
            /,
        ) -> "CredentialsModel2.Builder": ...

        @overload
        def access_secret_key(
            self, value_or_callback: Never = ...
        ) -> "AccessSecretKey.BuilderContext": ...

        def access_secret_key(self, value_or_callback=None, /):
            if self._in_context and value_or_callback is None:
                context = AccessSecretKey.BuilderContext()
                context._parent_builder = self
                context._field_name = "access_secret_key"
                return context

            value = value_or_callback
            if callable(value_or_callback):
                output = value_or_callback(AccessSecretKey.builder())
                if isinstance(output, AccessSecretKey.Builder):
                    value = output.build()
                else:
                    value = output
            return self._set("access_secret_key", value)

        @overload
        def access_token(
            self, value_or_callback: Optional[AccessToken], /
        ) -> "CredentialsModel2.Builder": ...

        @overload
        def access_token(
            self,
            value_or_callback: Callable[[AccessToken.Builder], AccessToken.Builder | AccessToken],
            /,
        ) -> "CredentialsModel2.Builder": ...

        @overload
        def access_token(self, value_or_callback: Never = ...) -> "AccessToken.BuilderContext": ...

        def access_token(self, value_or_callback=None, /):
            if self._in_context and value_or_callback is None:
                context = AccessToken.BuilderContext()
                context._parent_builder = self
                context._field_name = "access_token"
                return context

            value = value_or_callback
            if callable(value_or_callback):
                output = value_or_callback(AccessToken.builder())
                if isinstance(output, AccessToken.Builder):
                    value = output.build()
                else:
                    value = output
            return self._set("access_token", value)

    class BuilderContext(BuilderContextBase["CredentialsModel2.Builder"]):
        def model_post_init(self, __context) -> None:
            self._builder = CredentialsModel2.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 CredentialsModel2."""
        return cls.BuilderContext()

    class ListBuilder(GenericListBuilder["CredentialsModel2", Builder]):
        def __init__(self):
            raise NotImplementedError(
                "This class is not meant to be instantiated. Use CredentialsModel2.list_builder() instead."
            )

    @classmethod
    def list_builder(cls) -> ListBuilder:
        return GenericListBuilder[cls, cls.Builder]()  # type: ignore

    access_key: Annotated[AccessKey, Field(alias="accessKey")]
    access_secret_key: Annotated[AccessSecretKey, Field(alias="accessSecretKey")]
    access_token: Annotated[Optional[AccessToken], Field(alias="accessToken")] = None


class SecretModel5(BaseModel):
    class Builder(BaseModelBuilder):
        @property
        def cls(self) -> Type["SecretModel5"]:
            return SecretModel5

        def build(self) -> "SecretModel5":
            return SecretModel5(**self._attrs)

        def name(self, value: str, /) -> Self:
            return self._set("name", value)

        def parameter(self, value: str, /) -> Self:
            return self._set("parameter", value)

        def version_id(self, value: Optional[str], /) -> Self:
            return self._set("version_id", value)

        def version_stage(self, value: Optional[str], /) -> Self:
            return self._set("version_stage", value)

    class BuilderContext(BuilderContextBase["SecretModel5.Builder"]):
        def model_post_init(self, __context) -> None:
            self._builder = SecretModel5.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 SecretModel5."""
        return cls.BuilderContext()

    class ListBuilder(GenericListBuilder["SecretModel5", Builder]):
        def __init__(self):
            raise NotImplementedError(
                "This class is not meant to be instantiated. Use SecretModel5.list_builder() instead."
            )

    @classmethod
    def list_builder(cls) -> ListBuilder:
        return GenericListBuilder[cls, cls.Builder]()  # type: ignore

    name: str
    parameter: str
    version_id: Annotated[Optional[str], Field(alias="versionId")] = None
    version_stage: Annotated[Optional[str], Field(alias="versionStage")] = None


class CredentialsModel3(BaseModel):
    class Builder(BaseModelBuilder):
        @property
        def cls(self) -> Type["CredentialsModel3"]:
            return CredentialsModel3

        def build(self) -> "CredentialsModel3":
            return CredentialsModel3(**self._attrs)

        def client_id(self, value: str, /) -> Self:
            return self._set("client_id", value)

        @overload
        def client_secret(
            self, value_or_callback: ClientSecret, /
        ) -> "CredentialsModel3.Builder": ...

        @overload
        def client_secret(
            self,
            value_or_callback: Callable[
                [ClientSecret.Builder], ClientSecret.Builder | ClientSecret
            ],
            /,
        ) -> "CredentialsModel3.Builder": ...

        @overload
        def client_secret(
            self, value_or_callback: Never = ...
        ) -> "ClientSecret.BuilderContext": ...

        def client_secret(self, value_or_callback=None, /):
            if self._in_context and value_or_callback is None:
                context = ClientSecret.BuilderContext()
                context._parent_builder = self
                context._field_name = "client_secret"
                return context

            value = value_or_callback
            if callable(value_or_callback):
                output = value_or_callback(ClientSecret.builder())
                if isinstance(output, ClientSecret.Builder):
                    value = output.build()
                else:
                    value = output
            return self._set("client_secret", value)

        def tenant_id(self, value: str, /) -> Self:
            return self._set("tenant_id", value)

    class BuilderContext(BuilderContextBase["CredentialsModel3.Builder"]):
        def model_post_init(self, __context) -> None:
            self._builder = CredentialsModel3.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 CredentialsModel3."""
        return cls.BuilderContext()

    class ListBuilder(GenericListBuilder["CredentialsModel3", Builder]):
        def __init__(self):
            raise NotImplementedError(
                "This class is not meant to be instantiated. Use CredentialsModel3.list_builder() instead."
            )

    @classmethod
    def list_builder(cls) -> ListBuilder:
        return GenericListBuilder[cls, cls.Builder]()  # type: ignore

    client_id: Annotated[str, Field(alias="clientId")]
    client_secret: Annotated[ClientSecret, Field(alias="clientSecret")]
    tenant_id: Annotated[str, Field(alias="tenantId")]


class SecretModel6(BaseModel):
    class Builder(BaseModelBuilder):
        @property
        def cls(self) -> Type["SecretModel6"]:
            return SecretModel6

        def build(self) -> "SecretModel6":
            return SecretModel6(**self._attrs)

        def name(self, value: str, /) -> Self:
            return self._set("name", value)

        def parameter(self, value: str, /) -> Self:
            return self._set("parameter", value)

        def version(self, value: Optional[str], /) -> Self:
            return self._set("version", value)

    class BuilderContext(BuilderContextBase["SecretModel6.Builder"]):
        def model_post_init(self, __context) -> None:
            self._builder = SecretModel6.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 SecretModel6."""
        return cls.BuilderContext()

    class ListBuilder(GenericListBuilder["SecretModel6", Builder]):
        def __init__(self):
            raise NotImplementedError(
                "This class is not meant to be instantiated. Use SecretModel6.list_builder() instead."
            )

    @classmethod
    def list_builder(cls) -> ListBuilder:
        return GenericListBuilder[cls, cls.Builder]()  # type: ignore

    name: str
    parameter: str
    version: Optional[str] = None


class EnvModel1(BaseModel):
    class Builder(BaseModelBuilder):
        @property
        def cls(self) -> Type["EnvModel1"]:
            return EnvModel1

        def build(self) -> "EnvModel1":
            return EnvModel1(**self._attrs)

        def container_name(self, value: Optional[str], /) -> Self:
            return self._set("container_name", value)

        def name(self, value: str, /) -> Self:
            return self._set("name", value)

        def parameter(self, value: str, /) -> Self:
            return self._set("parameter", value)

    class BuilderContext(BuilderContextBase["EnvModel1.Builder"]):
        def model_post_init(self, __context) -> None:
            self._builder = EnvModel1.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 EnvModel1."""
        return cls.BuilderContext()

    class ListBuilder(GenericListBuilder["EnvModel1", Builder]):
        def __init__(self):
            raise NotImplementedError(
                "This class is not meant to be instantiated. Use EnvModel1.list_builder() instead."
            )

    @classmethod
    def list_builder(cls) -> ListBuilder:
        return GenericListBuilder[cls, cls.Builder]()  # type: ignore

    container_name: Annotated[Optional[str], Field(alias="containerName")] = None
    name: str
    parameter: str


class CredentialsModel4(BaseModel):
    class Builder(BaseModelBuilder):
        @property
        def cls(self) -> Type["CredentialsModel4"]:
            return CredentialsModel4

        def build(self) -> "CredentialsModel4":
            return CredentialsModel4(**self._attrs)

        @overload
        def client_secret(
            self, value_or_callback: ClientSecret, /
        ) -> "CredentialsModel4.Builder": ...

        @overload
        def client_secret(
            self,
            value_or_callback: Callable[
                [ClientSecret.Builder], ClientSecret.Builder | ClientSecret
            ],
            /,
        ) -> "CredentialsModel4.Builder": ...

        @overload
        def client_secret(
            self, value_or_callback: Never = ...
        ) -> "ClientSecret.BuilderContext": ...

        def client_secret(self, value_or_callback=None, /):
            if self._in_context and value_or_callback is None:
                context = ClientSecret.BuilderContext()
                context._parent_builder = self
                context._field_name = "client_secret"
                return context

            value = value_or_callback
            if callable(value_or_callback):
                output = value_or_callback(ClientSecret.builder())
                if isinstance(output, ClientSecret.Builder):
                    value = output.build()
                else:
                    value = output
            return self._set("client_secret", value)

    class BuilderContext(BuilderContextBase["CredentialsModel4.Builder"]):
        def model_post_init(self, __context) -> None:
            self._builder = CredentialsModel4.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 CredentialsModel4."""
        return cls.BuilderContext()

    class ListBuilder(GenericListBuilder["CredentialsModel4", Builder]):
        def __init__(self):
            raise NotImplementedError(
                "This class is not meant to be instantiated. Use CredentialsModel4.list_builder() instead."
            )

    @classmethod
    def list_builder(cls) -> ListBuilder:
        return GenericListBuilder[cls, cls.Builder]()  # type: ignore

    client_secret: Annotated[ClientSecret, Field(alias="clientSecret")]


class SecretModel7(BaseModel):
    class Builder(BaseModelBuilder):
        @property
        def cls(self) -> Type["SecretModel7"]:
            return SecretModel7

        def build(self) -> "SecretModel7":
            return SecretModel7(**self._attrs)

        def id(self, value: str, /) -> Self:
            return self._set("id", value)

        def parameter(self, value: str, /) -> Self:
            return self._set("parameter", value)

        def version(self, value: Optional[str], /) -> Self:
            return self._set("version", value)

    class BuilderContext(BuilderContextBase["SecretModel7.Builder"]):
        def model_post_init(self, __context) -> None:
            self._builder = SecretModel7.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 SecretModel7."""
        return cls.BuilderContext()

    class ListBuilder(GenericListBuilder["SecretModel7", Builder]):
        def __init__(self):
            raise NotImplementedError(
                "This class is not meant to be instantiated. Use SecretModel7.list_builder() instead."
            )

    @classmethod
    def list_builder(cls) -> ListBuilder:
        return GenericListBuilder[cls, cls.Builder]()  # type: ignore

    id: str
    parameter: str
    version: Optional[str] = None


class SecretModel8(BaseModel):
    class Builder(BaseModelBuilder):
        @property
        def cls(self) -> Type["SecretModel8"]:
            return SecretModel8

        def build(self) -> "SecretModel8":
            return SecretModel8(**self._attrs)

        def key(self, value: str, /) -> Self:
            return self._set("key", value)

        def parameter(self, value: str, /) -> Self:
            return self._set("parameter", value)

        def path(self, value: str, /) -> Self:
            return self._set("path", value)

        @overload
        def pki_data(self, value_or_callback: Optional[PkiData], /) -> "SecretModel8.Builder": ...

        @overload
        def pki_data(
            self,
            value_or_callback: Callable[[PkiData.Builder], PkiData.Builder | PkiData],
            /,
        ) -> "SecretModel8.Builder": ...

        @overload
        def pki_data(self, value_or_callback: Never = ...) -> "PkiData.BuilderContext": ...

        def pki_data(self, value_or_callback=None, /):
            if self._in_context and value_or_callback is None:
                context = PkiData.BuilderContext()
                context._parent_builder = self
                context._field_name = "pki_data"
                return context

            value = value_or_callback
            if callable(value_or_callback):
                output = value_or_callback(PkiData.builder())
                if isinstance(output, PkiData.Builder):
                    value = output.build()
                else:
                    value = output
            return self._set("pki_data", value)

        def type(self, value: Optional[str], /) -> Self:
            """
            VaultSecretType defines the type of vault secret
            """
            return self._set("type", value)

    class BuilderContext(BuilderContextBase["SecretModel8.Builder"]):
        def model_post_init(self, __context) -> None:
            self._builder = SecretModel8.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 SecretModel8."""
        return cls.BuilderContext()

    class ListBuilder(GenericListBuilder["SecretModel8", Builder]):
        def __init__(self):
            raise NotImplementedError(
                "This class is not meant to be instantiated. Use SecretModel8.list_builder() instead."
            )

    @classmethod
    def list_builder(cls) -> ListBuilder:
        return GenericListBuilder[cls, cls.Builder]()  # type: ignore

    key: str
    parameter: str
    path: str
    pki_data: Annotated[Optional[PkiData], Field(alias="pkiData")] = None
    type: Optional[str] = None
    """
    VaultSecretType defines the type of vault secret
    """


class TriggerAuthenticationSpec(BaseModel):
    class Builder(BaseModelBuilder):
        @property
        def cls(self) -> Type["TriggerAuthenticationSpec"]:
            return TriggerAuthenticationSpec

        def build(self) -> "TriggerAuthenticationSpec":
            return TriggerAuthenticationSpec(**self._attrs)

        @overload
        def aws_secret_manager(
            self, value_or_callback: Optional[AwsSecretManager], /
        ) -> "TriggerAuthenticationSpec.Builder": ...

        @overload
        def aws_secret_manager(
            self,
            value_or_callback: Callable[
                [AwsSecretManager.Builder], AwsSecretManager.Builder | AwsSecretManager
            ],
            /,
        ) -> "TriggerAuthenticationSpec.Builder": ...

        @overload
        def aws_secret_manager(
            self, value_or_callback: Never = ...
        ) -> "AwsSecretManager.BuilderContext": ...

        def aws_secret_manager(self, value_or_callback=None, /):
            """
            AwsSecretManager is used to authenticate using AwsSecretManager
            """
            if self._in_context and value_or_callback is None:
                context = AwsSecretManager.BuilderContext()
                context._parent_builder = self
                context._field_name = "aws_secret_manager"
                return context

            value = value_or_callback
            if callable(value_or_callback):
                output = value_or_callback(AwsSecretManager.builder())
                if isinstance(output, AwsSecretManager.Builder):
                    value = output.build()
                else:
                    value = output
            return self._set("aws_secret_manager", value)

        @overload
        def azure_key_vault(
            self, value_or_callback: Optional[AzureKeyVault], /
        ) -> "TriggerAuthenticationSpec.Builder": ...

        @overload
        def azure_key_vault(
            self,
            value_or_callback: Callable[
                [AzureKeyVault.Builder], AzureKeyVault.Builder | AzureKeyVault
            ],
            /,
        ) -> "TriggerAuthenticationSpec.Builder": ...

        @overload
        def azure_key_vault(
            self, value_or_callback: Never = ...
        ) -> "AzureKeyVault.BuilderContext": ...

        def azure_key_vault(self, value_or_callback=None, /):
            """
            AzureKeyVault is used to authenticate using Azure Key Vault
            """
            if self._in_context and value_or_callback is None:
                context = AzureKeyVault.BuilderContext()
                context._parent_builder = self
                context._field_name = "azure_key_vault"
                return context

            value = value_or_callback
            if callable(value_or_callback):
                output = value_or_callback(AzureKeyVault.builder())
                if isinstance(output, AzureKeyVault.Builder):
                    value = output.build()
                else:
                    value = output
            return self._set("azure_key_vault", value)

        @overload
        def config_map_target_ref(
            self, value_or_callback: List[ConfigMapTargetRef], /
        ) -> "TriggerAuthenticationSpec.Builder": ...

        @overload
        def config_map_target_ref(
            self,
            value_or_callback: Callable[
                [GenericListBuilder[ConfigMapTargetRef, ConfigMapTargetRef.Builder]],
                GenericListBuilder[ConfigMapTargetRef, ConfigMapTargetRef.Builder]
                | List[ConfigMapTargetRef],
            ],
            /,
        ) -> "TriggerAuthenticationSpec.Builder": ...

        @overload
        def config_map_target_ref(
            self, value_or_callback: Never = ...
        ) -> ListBuilderContext[ConfigMapTargetRef.Builder]: ...

        def config_map_target_ref(self, value_or_callback=None, /):
            if self._in_context and value_or_callback is None:
                context = ListBuilderContext[ConfigMapTargetRef.Builder]()
                context._parent_builder = self
                context._field_name = "config_map_target_ref"
                return context

            value = value_or_callback
            if callable(value_or_callback):
                output = value_or_callback(ConfigMapTargetRef.list_builder())
                if isinstance(output, GenericListBuilder):
                    value = output.build()
                else:
                    value = output
            return self._set("config_map_target_ref", value)

        @overload
        def env(
            self, value_or_callback: List[EnvModel1], /
        ) -> "TriggerAuthenticationSpec.Builder": ...

        @overload
        def env(
            self,
            value_or_callback: Callable[
                [GenericListBuilder[EnvModel1, EnvModel1.Builder]],
                GenericListBuilder[EnvModel1, EnvModel1.Builder] | List[EnvModel1],
            ],
            /,
        ) -> "TriggerAuthenticationSpec.Builder": ...

        @overload
        def env(self, value_or_callback: Never = ...) -> ListBuilderContext[EnvModel1.Builder]: ...

        def env(self, value_or_callback=None, /):
            if self._in_context and value_or_callback is None:
                context = ListBuilderContext[EnvModel1.Builder]()
                context._parent_builder = self
                context._field_name = "env"
                return context

            value = value_or_callback
            if callable(value_or_callback):
                output = value_or_callback(EnvModel1.list_builder())
                if isinstance(output, GenericListBuilder):
                    value = output.build()
                else:
                    value = output
            return self._set("env", value)

        @overload
        def gcp_secret_manager(
            self, value_or_callback: Optional[GcpSecretManager], /
        ) -> "TriggerAuthenticationSpec.Builder": ...

        @overload
        def gcp_secret_manager(
            self,
            value_or_callback: Callable[
                [GcpSecretManager.Builder], GcpSecretManager.Builder | GcpSecretManager
            ],
            /,
        ) -> "TriggerAuthenticationSpec.Builder": ...

        @overload
        def gcp_secret_manager(
            self, value_or_callback: Never = ...
        ) -> "GcpSecretManager.BuilderContext": ...

        def gcp_secret_manager(self, value_or_callback=None, /):
            if self._in_context and value_or_callback is None:
                context = GcpSecretManager.BuilderContext()
                context._parent_builder = self
                context._field_name = "gcp_secret_manager"
                return context

            value = value_or_callback
            if callable(value_or_callback):
                output = value_or_callback(GcpSecretManager.builder())
                if isinstance(output, GcpSecretManager.Builder):
                    value = output.build()
                else:
                    value = output
            return self._set("gcp_secret_manager", value)

        @overload
        def hashi_corp_vault(
            self, value_or_callback: Optional[HashiCorpVault], /
        ) -> "TriggerAuthenticationSpec.Builder": ...

        @overload
        def hashi_corp_vault(
            self,
            value_or_callback: Callable[
                [HashiCorpVault.Builder], HashiCorpVault.Builder | HashiCorpVault
            ],
            /,
        ) -> "TriggerAuthenticationSpec.Builder": ...

        @overload
        def hashi_corp_vault(
            self, value_or_callback: Never = ...
        ) -> "HashiCorpVault.BuilderContext": ...

        def hashi_corp_vault(self, value_or_callback=None, /):
            """
            HashiCorpVault is used to authenticate using Hashicorp Vault
            """
            if self._in_context and value_or_callback is None:
                context = HashiCorpVault.BuilderContext()
                context._parent_builder = self
                context._field_name = "hashi_corp_vault"
                return context

            value = value_or_callback
            if callable(value_or_callback):
                output = value_or_callback(HashiCorpVault.builder())
                if isinstance(output, HashiCorpVault.Builder):
                    value = output.build()
                else:
                    value = output
            return self._set("hashi_corp_vault", value)

        @overload
        def pod_identity(
            self, value_or_callback: Optional[PodIdentity], /
        ) -> "TriggerAuthenticationSpec.Builder": ...

        @overload
        def pod_identity(
            self,
            value_or_callback: Callable[[PodIdentity.Builder], PodIdentity.Builder | PodIdentity],
            /,
        ) -> "TriggerAuthenticationSpec.Builder": ...

        @overload
        def pod_identity(self, value_or_callback: Never = ...) -> "PodIdentity.BuilderContext": ...

        def pod_identity(self, value_or_callback=None, /):
            """
            AuthPodIdentity allows users to select the platform native identity
            mechanism
            """
            if self._in_context and value_or_callback is None:
                context = PodIdentity.BuilderContext()
                context._parent_builder = self
                context._field_name = "pod_identity"
                return context

            value = value_or_callback
            if callable(value_or_callback):
                output = value_or_callback(PodIdentity.builder())
                if isinstance(output, PodIdentity.Builder):
                    value = output.build()
                else:
                    value = output
            return self._set("pod_identity", value)

        @overload
        def secret_target_ref(
            self, value_or_callback: List[SecretTargetRef], /
        ) -> "TriggerAuthenticationSpec.Builder": ...

        @overload
        def secret_target_ref(
            self,
            value_or_callback: Callable[
                [GenericListBuilder[SecretTargetRef, SecretTargetRef.Builder]],
                GenericListBuilder[SecretTargetRef, SecretTargetRef.Builder]
                | List[SecretTargetRef],
            ],
            /,
        ) -> "TriggerAuthenticationSpec.Builder": ...

        @overload
        def secret_target_ref(
            self, value_or_callback: Never = ...
        ) -> ListBuilderContext[SecretTargetRef.Builder]: ...

        def secret_target_ref(self, value_or_callback=None, /):
            if self._in_context and value_or_callback is None:
                context = ListBuilderContext[SecretTargetRef.Builder]()
                context._parent_builder = self
                context._field_name = "secret_target_ref"
                return context

            value = value_or_callback
            if callable(value_or_callback):
                output = value_or_callback(SecretTargetRef.list_builder())
                if isinstance(output, GenericListBuilder):
                    value = output.build()
                else:
                    value = output
            return self._set("secret_target_ref", value)

    class BuilderContext(BuilderContextBase["TriggerAuthenticationSpec.Builder"]):
        def model_post_init(self, __context) -> None:
            self._builder = TriggerAuthenticationSpec.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 TriggerAuthenticationSpec."""
        return cls.BuilderContext()

    class ListBuilder(GenericListBuilder["TriggerAuthenticationSpec", Builder]):
        def __init__(self):
            raise NotImplementedError(
                "This class is not meant to be instantiated. Use TriggerAuthenticationSpec.list_builder() instead."
            )

    @classmethod
    def list_builder(cls) -> ListBuilder:
        return GenericListBuilder[cls, cls.Builder]()  # type: ignore

    aws_secret_manager: Annotated[Optional[AwsSecretManager], Field(alias="awsSecretManager")] = (
        None
    )
    """
    AwsSecretManager is used to authenticate using AwsSecretManager
    """
    azure_key_vault: Annotated[Optional[AzureKeyVault], Field(alias="azureKeyVault")] = None
    """
    AzureKeyVault is used to authenticate using Azure Key Vault
    """
    config_map_target_ref: Annotated[
        Optional[List[ConfigMapTargetRef]], Field(alias="configMapTargetRef")
    ] = None
    env: Optional[List[EnvModel1]] = None
    gcp_secret_manager: Annotated[Optional[GcpSecretManager], Field(alias="gcpSecretManager")] = (
        None
    )
    hashi_corp_vault: Annotated[Optional[HashiCorpVault], Field(alias="hashiCorpVault")] = None
    """
    HashiCorpVault is used to authenticate using Hashicorp Vault
    """
    pod_identity: Annotated[Optional[PodIdentity], Field(alias="podIdentity")] = None
    """
    AuthPodIdentity allows users to select the platform native identity
    mechanism
    """
    secret_target_ref: Annotated[
        Optional[List[SecretTargetRef]], Field(alias="secretTargetRef")
    ] = None


class TriggerAuthenticationStatus(BaseModel):
    class Builder(BaseModelBuilder):
        @property
        def cls(self) -> Type["TriggerAuthenticationStatus"]:
            return TriggerAuthenticationStatus

        def build(self) -> "TriggerAuthenticationStatus":
            return TriggerAuthenticationStatus(**self._attrs)

        def scaledjobs(self, value: Optional[str], /) -> Self:
            return self._set("scaledjobs", value)

        def scaledobjects(self, value: Optional[str], /) -> Self:
            return self._set("scaledobjects", value)

    class BuilderContext(BuilderContextBase["TriggerAuthenticationStatus.Builder"]):
        def model_post_init(self, __context) -> None:
            self._builder = TriggerAuthenticationStatus.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 TriggerAuthenticationStatus."""
        return cls.BuilderContext()

    class ListBuilder(GenericListBuilder["TriggerAuthenticationStatus", Builder]):
        def __init__(self):
            raise NotImplementedError(
                "This class is not meant to be instantiated. Use TriggerAuthenticationStatus.list_builder() instead."
            )

    @classmethod
    def list_builder(cls) -> ListBuilder:
        return GenericListBuilder[cls, cls.Builder]()  # type: ignore

    scaledjobs: Optional[str] = None
    scaledobjects: Optional[str] = None


class ClusterTriggerAuthentication(Resource):
    class Builder(BaseModelBuilder):
        @property
        def cls(self) -> Type["ClusterTriggerAuthentication"]:
            return ClusterTriggerAuthentication

        def build(self) -> "ClusterTriggerAuthentication":
            return ClusterTriggerAuthentication(**self._attrs)

        def api_version(self, value: Optional[Literal["keda.sh/v1alpha1"]], /) -> 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["ClusterTriggerAuthentication"]], /) -> 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], /
        ) -> "ClusterTriggerAuthentication.Builder": ...

        @overload
        def metadata(
            self,
            value_or_callback: Callable[
                [apimachinery.ObjectMeta.Builder],
                apimachinery.ObjectMeta.Builder | apimachinery.ObjectMeta,
            ],
            /,
        ) -> "ClusterTriggerAuthentication.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: ClusterTriggerAuthenticationSpec, /
        ) -> "ClusterTriggerAuthentication.Builder": ...

        @overload
        def spec(
            self,
            value_or_callback: Callable[
                [ClusterTriggerAuthenticationSpec.Builder],
                ClusterTriggerAuthenticationSpec.Builder | ClusterTriggerAuthenticationSpec,
            ],
            /,
        ) -> "ClusterTriggerAuthentication.Builder": ...

        @overload
        def spec(
            self, value_or_callback: Never = ...
        ) -> "ClusterTriggerAuthenticationSpec.BuilderContext": ...

        def spec(self, value_or_callback=None, /):
            if self._in_context and value_or_callback is None:
                context = ClusterTriggerAuthenticationSpec.BuilderContext()
                context._parent_builder = self
                context._field_name = "spec"
                return context

            value = value_or_callback
            if callable(value_or_callback):
                output = value_or_callback(ClusterTriggerAuthenticationSpec.builder())
                if isinstance(output, ClusterTriggerAuthenticationSpec.Builder):
                    value = output.build()
                else:
                    value = output
            return self._set("spec", value)

        @overload
        def status(
            self, value_or_callback: Optional[ClusterTriggerAuthenticationStatus], /
        ) -> "ClusterTriggerAuthentication.Builder": ...

        @overload
        def status(
            self,
            value_or_callback: Callable[
                [ClusterTriggerAuthenticationStatus.Builder],
                ClusterTriggerAuthenticationStatus.Builder | ClusterTriggerAuthenticationStatus,
            ],
            /,
        ) -> "ClusterTriggerAuthentication.Builder": ...

        @overload
        def status(
            self, value_or_callback: Never = ...
        ) -> "ClusterTriggerAuthenticationStatus.BuilderContext": ...

        def status(self, value_or_callback=None, /):
            if self._in_context and value_or_callback is None:
                context = ClusterTriggerAuthenticationStatus.BuilderContext()
                context._parent_builder = self
                context._field_name = "status"
                return context

            value = value_or_callback
            if callable(value_or_callback):
                output = value_or_callback(ClusterTriggerAuthenticationStatus.builder())
                if isinstance(output, ClusterTriggerAuthenticationStatus.Builder):
                    value = output.build()
                else:
                    value = output
            return self._set("status", value)

    class BuilderContext(BuilderContextBase["ClusterTriggerAuthentication.Builder"]):
        def model_post_init(self, __context) -> None:
            self._builder = ClusterTriggerAuthentication.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 ClusterTriggerAuthentication."""
        return cls.BuilderContext()

    class ListBuilder(GenericListBuilder["ClusterTriggerAuthentication", Builder]):
        def __init__(self):
            raise NotImplementedError(
                "This class is not meant to be instantiated. Use ClusterTriggerAuthentication.list_builder() instead."
            )

    @classmethod
    def list_builder(cls) -> ListBuilder:
        return GenericListBuilder[cls, cls.Builder]()  # type: ignore

    api_version: Annotated[Optional[Literal["keda.sh/v1alpha1"]], Field(alias="apiVersion")] = (
        "keda.sh/v1alpha1"
    )
    """
    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["ClusterTriggerAuthentication"]] = "ClusterTriggerAuthentication"
    """
    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: ClusterTriggerAuthenticationSpec
    status: Optional[ClusterTriggerAuthenticationStatus] = None


class ScaledJob(Resource):
    class Builder(BaseModelBuilder):
        @property
        def cls(self) -> Type["ScaledJob"]:
            return ScaledJob

        def build(self) -> "ScaledJob":
            return ScaledJob(**self._attrs)

        def api_version(self, value: Optional[Literal["keda.sh/v1alpha1"]], /) -> 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["ScaledJob"]], /) -> 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], /
        ) -> "ScaledJob.Builder": ...

        @overload
        def metadata(
            self,
            value_or_callback: Callable[
                [apimachinery.ObjectMeta.Builder],
                apimachinery.ObjectMeta.Builder | apimachinery.ObjectMeta,
            ],
            /,
        ) -> "ScaledJob.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[ScaledJobSpec], /) -> "ScaledJob.Builder": ...

        @overload
        def spec(
            self,
            value_or_callback: Callable[
                [ScaledJobSpec.Builder], ScaledJobSpec.Builder | ScaledJobSpec
            ],
            /,
        ) -> "ScaledJob.Builder": ...

        @overload
        def spec(self, value_or_callback: Never = ...) -> "ScaledJobSpec.BuilderContext": ...

        def spec(self, value_or_callback=None, /):
            if self._in_context and value_or_callback is None:
                context = ScaledJobSpec.BuilderContext()
                context._parent_builder = self
                context._field_name = "spec"
                return context

            value = value_or_callback
            if callable(value_or_callback):
                output = value_or_callback(ScaledJobSpec.builder())
                if isinstance(output, ScaledJobSpec.Builder):
                    value = output.build()
                else:
                    value = output
            return self._set("spec", value)

        @overload
        def status(
            self, value_or_callback: Optional[ScaledJobStatus], /
        ) -> "ScaledJob.Builder": ...

        @overload
        def status(
            self,
            value_or_callback: Callable[
                [ScaledJobStatus.Builder], ScaledJobStatus.Builder | ScaledJobStatus
            ],
            /,
        ) -> "ScaledJob.Builder": ...

        @overload
        def status(self, value_or_callback: Never = ...) -> "ScaledJobStatus.BuilderContext": ...

        def status(self, value_or_callback=None, /):
            if self._in_context and value_or_callback is None:
                context = ScaledJobStatus.BuilderContext()
                context._parent_builder = self
                context._field_name = "status"
                return context

            value = value_or_callback
            if callable(value_or_callback):
                output = value_or_callback(ScaledJobStatus.builder())
                if isinstance(output, ScaledJobStatus.Builder):
                    value = output.build()
                else:
                    value = output
            return self._set("status", value)

    class BuilderContext(BuilderContextBase["ScaledJob.Builder"]):
        def model_post_init(self, __context) -> None:
            self._builder = ScaledJob.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 ScaledJob."""
        return cls.BuilderContext()

    class ListBuilder(GenericListBuilder["ScaledJob", Builder]):
        def __init__(self):
            raise NotImplementedError(
                "This class is not meant to be instantiated. Use ScaledJob.list_builder() instead."
            )

    @classmethod
    def list_builder(cls) -> ListBuilder:
        return GenericListBuilder[cls, cls.Builder]()  # type: ignore

    api_version: Annotated[Optional[Literal["keda.sh/v1alpha1"]], Field(alias="apiVersion")] = (
        "keda.sh/v1alpha1"
    )
    """
    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["ScaledJob"]] = "ScaledJob"
    """
    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[ScaledJobSpec] = None
    status: Optional[ScaledJobStatus] = None


class ScaledObject(Resource):
    class Builder(BaseModelBuilder):
        @property
        def cls(self) -> Type["ScaledObject"]:
            return ScaledObject

        def build(self) -> "ScaledObject":
            return ScaledObject(**self._attrs)

        def api_version(self, value: Optional[Literal["keda.sh/v1alpha1"]], /) -> 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["ScaledObject"]], /) -> 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], /
        ) -> "ScaledObject.Builder": ...

        @overload
        def metadata(
            self,
            value_or_callback: Callable[
                [apimachinery.ObjectMeta.Builder],
                apimachinery.ObjectMeta.Builder | apimachinery.ObjectMeta,
            ],
            /,
        ) -> "ScaledObject.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: ScaledObjectSpec, /) -> "ScaledObject.Builder": ...

        @overload
        def spec(
            self,
            value_or_callback: Callable[
                [ScaledObjectSpec.Builder], ScaledObjectSpec.Builder | ScaledObjectSpec
            ],
            /,
        ) -> "ScaledObject.Builder": ...

        @overload
        def spec(self, value_or_callback: Never = ...) -> "ScaledObjectSpec.BuilderContext": ...

        def spec(self, value_or_callback=None, /):
            if self._in_context and value_or_callback is None:
                context = ScaledObjectSpec.BuilderContext()
                context._parent_builder = self
                context._field_name = "spec"
                return context

            value = value_or_callback
            if callable(value_or_callback):
                output = value_or_callback(ScaledObjectSpec.builder())
                if isinstance(output, ScaledObjectSpec.Builder):
                    value = output.build()
                else:
                    value = output
            return self._set("spec", value)

        @overload
        def status(
            self, value_or_callback: Optional[ScaledObjectStatus], /
        ) -> "ScaledObject.Builder": ...

        @overload
        def status(
            self,
            value_or_callback: Callable[
                [ScaledObjectStatus.Builder],
                ScaledObjectStatus.Builder | ScaledObjectStatus,
            ],
            /,
        ) -> "ScaledObject.Builder": ...

        @overload
        def status(self, value_or_callback: Never = ...) -> "ScaledObjectStatus.BuilderContext": ...

        def status(self, value_or_callback=None, /):
            if self._in_context and value_or_callback is None:
                context = ScaledObjectStatus.BuilderContext()
                context._parent_builder = self
                context._field_name = "status"
                return context

            value = value_or_callback
            if callable(value_or_callback):
                output = value_or_callback(ScaledObjectStatus.builder())
                if isinstance(output, ScaledObjectStatus.Builder):
                    value = output.build()
                else:
                    value = output
            return self._set("status", value)

    class BuilderContext(BuilderContextBase["ScaledObject.Builder"]):
        def model_post_init(self, __context) -> None:
            self._builder = ScaledObject.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 ScaledObject."""
        return cls.BuilderContext()

    class ListBuilder(GenericListBuilder["ScaledObject", Builder]):
        def __init__(self):
            raise NotImplementedError(
                "This class is not meant to be instantiated. Use ScaledObject.list_builder() instead."
            )

    @classmethod
    def list_builder(cls) -> ListBuilder:
        return GenericListBuilder[cls, cls.Builder]()  # type: ignore

    api_version: Annotated[Optional[Literal["keda.sh/v1alpha1"]], Field(alias="apiVersion")] = (
        "keda.sh/v1alpha1"
    )
    """
    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["ScaledObject"]] = "ScaledObject"
    """
    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: ScaledObjectSpec
    status: Optional[ScaledObjectStatus] = None


class TriggerAuthentication(Resource):
    class Builder(BaseModelBuilder):
        @property
        def cls(self) -> Type["TriggerAuthentication"]:
            return TriggerAuthentication

        def build(self) -> "TriggerAuthentication":
            return TriggerAuthentication(**self._attrs)

        def api_version(self, value: Optional[Literal["keda.sh/v1alpha1"]], /) -> 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["TriggerAuthentication"]], /) -> 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], /
        ) -> "TriggerAuthentication.Builder": ...

        @overload
        def metadata(
            self,
            value_or_callback: Callable[
                [apimachinery.ObjectMeta.Builder],
                apimachinery.ObjectMeta.Builder | apimachinery.ObjectMeta,
            ],
            /,
        ) -> "TriggerAuthentication.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: TriggerAuthenticationSpec, /
        ) -> "TriggerAuthentication.Builder": ...

        @overload
        def spec(
            self,
            value_or_callback: Callable[
                [TriggerAuthenticationSpec.Builder],
                TriggerAuthenticationSpec.Builder | TriggerAuthenticationSpec,
            ],
            /,
        ) -> "TriggerAuthentication.Builder": ...

        @overload
        def spec(
            self, value_or_callback: Never = ...
        ) -> "TriggerAuthenticationSpec.BuilderContext": ...

        def spec(self, value_or_callback=None, /):
            if self._in_context and value_or_callback is None:
                context = TriggerAuthenticationSpec.BuilderContext()
                context._parent_builder = self
                context._field_name = "spec"
                return context

            value = value_or_callback
            if callable(value_or_callback):
                output = value_or_callback(TriggerAuthenticationSpec.builder())
                if isinstance(output, TriggerAuthenticationSpec.Builder):
                    value = output.build()
                else:
                    value = output
            return self._set("spec", value)

        @overload
        def status(
            self, value_or_callback: Optional[TriggerAuthenticationStatus], /
        ) -> "TriggerAuthentication.Builder": ...

        @overload
        def status(
            self,
            value_or_callback: Callable[
                [TriggerAuthenticationStatus.Builder],
                TriggerAuthenticationStatus.Builder | TriggerAuthenticationStatus,
            ],
            /,
        ) -> "TriggerAuthentication.Builder": ...

        @overload
        def status(
            self, value_or_callback: Never = ...
        ) -> "TriggerAuthenticationStatus.BuilderContext": ...

        def status(self, value_or_callback=None, /):
            if self._in_context and value_or_callback is None:
                context = TriggerAuthenticationStatus.BuilderContext()
                context._parent_builder = self
                context._field_name = "status"
                return context

            value = value_or_callback
            if callable(value_or_callback):
                output = value_or_callback(TriggerAuthenticationStatus.builder())
                if isinstance(output, TriggerAuthenticationStatus.Builder):
                    value = output.build()
                else:
                    value = output
            return self._set("status", value)

    class BuilderContext(BuilderContextBase["TriggerAuthentication.Builder"]):
        def model_post_init(self, __context) -> None:
            self._builder = TriggerAuthentication.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 TriggerAuthentication."""
        return cls.BuilderContext()

    class ListBuilder(GenericListBuilder["TriggerAuthentication", Builder]):
        def __init__(self):
            raise NotImplementedError(
                "This class is not meant to be instantiated. Use TriggerAuthentication.list_builder() instead."
            )

    @classmethod
    def list_builder(cls) -> ListBuilder:
        return GenericListBuilder[cls, cls.Builder]()  # type: ignore

    api_version: Annotated[Optional[Literal["keda.sh/v1alpha1"]], Field(alias="apiVersion")] = (
        "keda.sh/v1alpha1"
    )
    """
    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["TriggerAuthentication"]] = "TriggerAuthentication"
    """
    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: TriggerAuthenticationSpec
    status: Optional[TriggerAuthenticationStatus] = None
