# generated by https://github.com/puzl-cloud/kubesdk
#   filename:  apis__scheduling.k8s.io__v1alpha1_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


@dataclass(slots=True, kw_only=True, frozen=True)
class BasicSchedulingPolicy(Loadable):
    pass


@dataclass(slots=True, kw_only=True, frozen=True)
class GangSchedulingPolicy(Loadable):
    minCount: int


@dataclass(slots=True, kw_only=True, frozen=True)
class PodGroupPolicy(Loadable):
    basic: BasicSchedulingPolicy | None = None
    gang: GangSchedulingPolicy | None = None


@dataclass(slots=True, kw_only=True, frozen=True)
class TypedLocalObjectReference(Loadable):
    kind: str
    name: str
    apiGroup: str | None = None


@dataclass(slots=True, kw_only=True, frozen=True)
class PodGroup(Loadable):
    name: str
    policy: PodGroupPolicy


@dataclass(slots=True, kw_only=True, frozen=True)
class WorkloadSpec(Loadable):
    podGroups: List[PodGroup]
    controllerRef: TypedLocalObjectReference | None = None


@dataclass(slots=True, kw_only=True, frozen=True)
class Workload(K8sResource):
    spec: WorkloadSpec
    apiVersion: ClassVar[str] = 'scheduling.k8s.io/v1alpha1'
    kind: ClassVar[str] = 'Workload'
    metadata: ObjectMeta = field(default_factory=ObjectMeta)
    plural_: ClassVar[str] = 'workloads'
    is_namespaced_: ClassVar[bool] = True
    group_: ClassVar[Optional[str]] = 'scheduling.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 WorkloadList(Loadable):
    items: List[Workload]
    apiVersion: str = 'scheduling.k8s.io/v1alpha1'
    kind: str = 'WorkloadList'
    metadata: ListMeta = field(default_factory=ObjectMeta)
