# generated by https://github.com/puzl-cloud/kubesdk
#   filename:  apis__resource.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 LazyLoadModel
from kube_models.resource import *

from ...apimachinery.pkg.apis.meta.v1 import ListMeta, ObjectMeta
from ..core.v1 import NodeSelector


@dataclass(slots=True, kw_only=True, frozen=True)
class PodSchedulingSpec(LazyLoadModel):
    potentialNodes: List[str] | None = None
    selectedNode: str | None = None


@dataclass(slots=True, kw_only=True, frozen=True)
class ResourceClaimConsumerReference(LazyLoadModel):
    name: str
    resource: str
    uid: str
    apiGroup: str | None = None


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


@dataclass(slots=True, kw_only=True, frozen=True)
class ResourceClaimSchedulingStatus(LazyLoadModel):
    name: str | None = None
    unsuitableNodes: List[str] | None = None


@dataclass(slots=True, kw_only=True, frozen=True)
class ResourceClaimSpec(LazyLoadModel):
    resourceClassName: str
    allocationMode: str | None = None
    parametersRef: ResourceClaimParametersReference | None = None


@dataclass(slots=True, kw_only=True, frozen=True)
class ResourceClassParametersReference(LazyLoadModel):
    kind: str
    name: str
    apiGroup: str | None = None
    namespace: str | None = None


@dataclass(slots=True, kw_only=True, frozen=True)
class AllocationResult(LazyLoadModel):
    availableOnNodes: NodeSelector | None = None
    resourceHandle: str | None = None
    shareable: bool | None = None


@dataclass(slots=True, kw_only=True, frozen=True)
class PodSchedulingStatus(LazyLoadModel):
    resourceClaims: List[ResourceClaimSchedulingStatus] | None = None


@dataclass(slots=True, kw_only=True, frozen=True)
class ResourceClaimStatus(LazyLoadModel):
    allocation: AllocationResult | None = None
    deallocationRequested: bool | None = None
    driverName: str | None = None
    reservedFor: List[ResourceClaimConsumerReference] | None = None


@dataclass(slots=True, kw_only=True, frozen=True)
class PodScheduling(K8sResource):
    spec: PodSchedulingSpec
    apiVersion: ClassVar[str] = 'resource.k8s.io/v1alpha1'
    kind: ClassVar[str] = 'PodScheduling'
    metadata: ObjectMeta = field(default_factory=ObjectMeta)
    status: PodSchedulingStatus | None = None
    api_path_: ClassVar[str] = (
        'apis/resource.k8s.io/v1alpha1/namespaces/{namespace}/podschedulings'
    )
    plural_: ClassVar[str] = 'podschedulings'
    is_namespaced_: ClassVar[bool] = False
    group_: ClassVar[Optional[str]] = 'resource.k8s.io'
    patch_strategies_: ClassVar[set[PatchRequestType]] = {
        '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 PodSchedulingList(LazyLoadModel):
    items: List[PodScheduling]
    apiVersion: str = 'resource.k8s.io/v1alpha1'
    kind: str = 'PodSchedulingList'
    metadata: ListMeta = field(default_factory=ObjectMeta)


@dataclass(slots=True, kw_only=True, frozen=True)
class ResourceClaim(K8sResource):
    spec: ResourceClaimSpec
    apiVersion: ClassVar[str] = 'resource.k8s.io/v1alpha1'
    kind: ClassVar[str] = 'ResourceClaim'
    metadata: ObjectMeta = field(default_factory=ObjectMeta)
    status: ResourceClaimStatus | None = None
    api_path_: ClassVar[str] = (
        'apis/resource.k8s.io/v1alpha1/namespaces/{namespace}/resourceclaims'
    )
    plural_: ClassVar[str] = 'resourceclaims'
    is_namespaced_: ClassVar[bool] = False
    group_: ClassVar[Optional[str]] = 'resource.k8s.io'
    patch_strategies_: ClassVar[set[PatchRequestType]] = {
        '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 ResourceClaimList(LazyLoadModel):
    items: List[ResourceClaim]
    apiVersion: str = 'resource.k8s.io/v1alpha1'
    kind: str = 'ResourceClaimList'
    metadata: ListMeta = field(default_factory=ObjectMeta)


@dataclass(slots=True, kw_only=True, frozen=True)
class ResourceClaimTemplateSpec(LazyLoadModel):
    spec: ResourceClaimSpec
    metadata: ObjectMeta | None = None


@dataclass(slots=True, kw_only=True, frozen=True)
class ResourceClass(K8sResource):
    driverName: str
    apiVersion: ClassVar[str] = 'resource.k8s.io/v1alpha1'
    kind: ClassVar[str] = 'ResourceClass'
    metadata: ObjectMeta = field(default_factory=ObjectMeta)
    parametersRef: ResourceClassParametersReference | None = None
    suitableNodes: NodeSelector | None = None
    api_path_: ClassVar[str] = 'apis/resource.k8s.io/v1alpha1/resourceclasses'
    plural_: ClassVar[str] = 'resourceclasses'
    is_namespaced_: ClassVar[bool] = False
    group_: ClassVar[Optional[str]] = 'resource.k8s.io'
    patch_strategies_: ClassVar[set[PatchRequestType]] = {
        '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 ResourceClassList(LazyLoadModel):
    items: List[ResourceClass]
    apiVersion: str = 'resource.k8s.io/v1alpha1'
    kind: str = 'ResourceClassList'
    metadata: ListMeta = field(default_factory=ObjectMeta)


@dataclass(slots=True, kw_only=True, frozen=True)
class ResourceClaimTemplate(K8sResource):
    spec: ResourceClaimTemplateSpec
    apiVersion: ClassVar[str] = 'resource.k8s.io/v1alpha1'
    kind: ClassVar[str] = 'ResourceClaimTemplate'
    metadata: ObjectMeta = field(default_factory=ObjectMeta)
    api_path_: ClassVar[str] = (
        'apis/resource.k8s.io/v1alpha1/namespaces/{namespace}/resourceclaimtemplates'
    )
    plural_: ClassVar[str] = 'resourceclaimtemplates'
    is_namespaced_: ClassVar[bool] = False
    group_: ClassVar[Optional[str]] = 'resource.k8s.io'
    patch_strategies_: ClassVar[set[PatchRequestType]] = {
        '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 ResourceClaimTemplateList(LazyLoadModel):
    items: List[ResourceClaimTemplate]
    apiVersion: str = 'resource.k8s.io/v1alpha1'
    kind: str = 'ResourceClaimTemplateList'
    metadata: ListMeta = field(default_factory=ObjectMeta)
