# generated by https://github.com/puzl-cloud/kubesdk
#   filename:  apis__resource.k8s.io__v1alpha3_openapi.json

from __future__ import annotations

from dataclasses import dataclass, field
from datetime import datetime, timezone
from typing import ClassVar, List, Set

from kube_models.const import *
from kube_models.loader import *
from kube_models.loader import Loadable
from kube_models.resource import *

from ...apimachinery.pkg.apis.meta.v1 import ListMeta, ObjectMeta, Time


@dataclass(slots=True, kw_only=True, frozen=True)
class CELDeviceSelector(Loadable):
    expression: str


@dataclass(slots=True, kw_only=True, frozen=True)
class DeviceSelector(Loadable):
    cel: CELDeviceSelector | None = None


@dataclass(slots=True, kw_only=True, frozen=True)
class DeviceTaintSelector(Loadable):
    device: str | None = None
    deviceClassName: str | None = None
    driver: str | None = None
    pool: str | None = None
    selectors: List[DeviceSelector] | None = None


@dataclass(slots=True, kw_only=True, frozen=True)
class DeviceTaint(Loadable):
    effect: str
    key: str
    timeAdded: Time | None = None
    value: str | None = None


@dataclass(slots=True, kw_only=True, frozen=True)
class DeviceTaintRuleSpec(Loadable):
    taint: DeviceTaint
    deviceSelector: DeviceTaintSelector | None = None


@dataclass(slots=True, kw_only=True, frozen=True)
class DeviceTaintRule(K8sResource):
    spec: DeviceTaintRuleSpec
    apiVersion: ClassVar[str] = 'resource.k8s.io/v1alpha3'
    kind: ClassVar[str] = 'DeviceTaintRule'
    metadata: ObjectMeta = field(default_factory=ObjectMeta)
    plural_: ClassVar[str] = 'devicetaintrules'
    is_namespaced_: ClassVar[bool] = False
    group_: ClassVar[Optional[str]] = 'resource.k8s.io'
    patch_strategies_: ClassVar[set[PatchRequestType]] = {
        'application/apply-patch+cbor',
        'application/apply-patch+yaml',
        'application/json-patch+json',
        'application/merge-patch+json',
        'application/strategic-merge-patch+json',
    }


@dataclass(slots=True, kw_only=True, frozen=True)
class DeviceTaintRuleList(Loadable):
    items: List[DeviceTaintRule]
    apiVersion: str = 'resource.k8s.io/v1alpha3'
    kind: str = 'DeviceTaintRuleList'
    metadata: ListMeta = field(default_factory=ObjectMeta)
