# generated by https://github.com/puzl-cloud/kubesdk
#   filename:  apis__resource.k8s.io__v1alpha2_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.api.resource import Quantity
from ...apimachinery.pkg.apis.meta.v1 import ListMeta, ObjectMeta
from ...apimachinery.pkg.runtime import RawExtension
from ..core.v1 import NodeSelector


@dataclass(slots=True, kw_only=True, frozen=True)
class NamedResourcesAllocationResult(LazyLoadModel):
    name: str


@dataclass(slots=True, kw_only=True, frozen=True)
class NamedResourcesFilter(LazyLoadModel):
    selector: str


@dataclass(slots=True, kw_only=True, frozen=True)
class NamedResourcesIntSlice(LazyLoadModel):
    ints: List[int]


@dataclass(slots=True, kw_only=True, frozen=True)
class NamedResourcesRequest(LazyLoadModel):
    selector: str


@dataclass(slots=True, kw_only=True, frozen=True)
class NamedResourcesStringSlice(LazyLoadModel):
    strings: List[str]


@dataclass(slots=True, kw_only=True, frozen=True)
class PodSchedulingContextSpec(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 ResourceFilter(LazyLoadModel):
    driverName: str | None = None
    namedResources: NamedResourcesFilter | None = None


@dataclass(slots=True, kw_only=True, frozen=True)
class DriverAllocationResult(LazyLoadModel):
    namedResources: NamedResourcesAllocationResult | None = None
    vendorRequestParameters: RawExtension | None = None


@dataclass(slots=True, kw_only=True, frozen=True)
class NamedResourcesAttribute(LazyLoadModel):
    name: str
    bool: bool | None = None
    int: int | None = None
    intSlice: NamedResourcesIntSlice | None = None
    quantity: Quantity | None = None
    string: str | None = None
    stringSlice: NamedResourcesStringSlice | None = None
    version: str | None = None


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


@dataclass(slots=True, kw_only=True, frozen=True)
class NamedResourcesResources(LazyLoadModel):
    instances: List[NamedResourcesInstance]


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


@dataclass(slots=True, kw_only=True, frozen=True)
class ResourceRequest(LazyLoadModel):
    namedResources: NamedResourcesRequest | None = None
    vendorParameters: RawExtension | None = None


@dataclass(slots=True, kw_only=True, frozen=True)
class StructuredResourceHandle(LazyLoadModel):
    results: List[DriverAllocationResult]
    nodeName: str | None = None
    vendorClaimParameters: RawExtension | None = None
    vendorClassParameters: RawExtension | None = None


@dataclass(slots=True, kw_only=True, frozen=True)
class VendorParameters(LazyLoadModel):
    driverName: str | None = None
    parameters: RawExtension | None = None


@dataclass(slots=True, kw_only=True, frozen=True)
class DriverRequests(LazyLoadModel):
    driverName: str | None = None
    requests: List[ResourceRequest] | None = None
    vendorParameters: RawExtension | None = None


@dataclass(slots=True, kw_only=True, frozen=True)
class PodSchedulingContext(K8sResource):
    spec: PodSchedulingContextSpec
    apiVersion: ClassVar[str] = 'resource.k8s.io/v1alpha2'
    kind: ClassVar[str] = 'PodSchedulingContext'
    metadata: ObjectMeta = field(default_factory=ObjectMeta)
    status: PodSchedulingContextStatus | None = None
    api_path_: ClassVar[str] = (
        'apis/resource.k8s.io/v1alpha2/namespaces/{namespace}/podschedulingcontexts'
    )
    plural_: ClassVar[str] = 'podschedulingcontexts'
    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 PodSchedulingContextList(LazyLoadModel):
    items: List[PodSchedulingContext]
    apiVersion: str = 'resource.k8s.io/v1alpha2'
    kind: str = 'PodSchedulingContextList'
    metadata: ListMeta = field(default_factory=ObjectMeta)


@dataclass(slots=True, kw_only=True, frozen=True)
class ResourceClaimParameters(K8sResource):
    apiVersion: ClassVar[str] = 'resource.k8s.io/v1alpha2'
    driverRequests: List[DriverRequests] | None = None
    generatedFrom: ResourceClaimParametersReference | None = None
    kind: ClassVar[str] = 'ResourceClaimParameters'
    metadata: ObjectMeta = field(default_factory=ObjectMeta)
    shareable: bool | None = None
    api_path_: ClassVar[str] = (
        'apis/resource.k8s.io/v1alpha2/namespaces/{namespace}/resourceclaimparameters'
    )
    plural_: ClassVar[str] = 'resourceclaimparameters'
    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 ResourceClaimParametersList(LazyLoadModel):
    items: List[ResourceClaimParameters]
    apiVersion: str = 'resource.k8s.io/v1alpha2'
    kind: str = 'ResourceClaimParametersList'
    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/v1alpha2'
    kind: ClassVar[str] = 'ResourceClass'
    metadata: ObjectMeta = field(default_factory=ObjectMeta)
    parametersRef: ResourceClassParametersReference | None = None
    structuredParameters: bool | None = None
    suitableNodes: NodeSelector | None = None
    api_path_: ClassVar[str] = 'apis/resource.k8s.io/v1alpha2/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/v1alpha2'
    kind: str = 'ResourceClassList'
    metadata: ListMeta = field(default_factory=ObjectMeta)


@dataclass(slots=True, kw_only=True, frozen=True)
class ResourceClassParameters(K8sResource):
    apiVersion: ClassVar[str] = 'resource.k8s.io/v1alpha2'
    filters: List[ResourceFilter] | None = None
    generatedFrom: ResourceClassParametersReference | None = None
    kind: ClassVar[str] = 'ResourceClassParameters'
    metadata: ObjectMeta = field(default_factory=ObjectMeta)
    vendorParameters: List[VendorParameters] | None = None
    api_path_: ClassVar[str] = (
        'apis/resource.k8s.io/v1alpha2/namespaces/{namespace}/resourceclassparameters'
    )
    plural_: ClassVar[str] = 'resourceclassparameters'
    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 ResourceClassParametersList(LazyLoadModel):
    items: List[ResourceClassParameters]
    apiVersion: str = 'resource.k8s.io/v1alpha2'
    kind: str = 'ResourceClassParametersList'
    metadata: ListMeta = field(default_factory=ObjectMeta)


@dataclass(slots=True, kw_only=True, frozen=True)
class ResourceHandle(LazyLoadModel):
    data: str | None = None
    driverName: str | None = None
    structuredData: StructuredResourceHandle | None = None


@dataclass(slots=True, kw_only=True, frozen=True)
class ResourceSlice(K8sResource):
    driverName: str
    apiVersion: ClassVar[str] = 'resource.k8s.io/v1alpha2'
    kind: ClassVar[str] = 'ResourceSlice'
    metadata: ObjectMeta = field(default_factory=ObjectMeta)
    namedResources: NamedResourcesResources | None = None
    nodeName: str | None = None
    api_path_: ClassVar[str] = 'apis/resource.k8s.io/v1alpha2/resourceslices'
    plural_: ClassVar[str] = 'resourceslices'
    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 ResourceSliceList(LazyLoadModel):
    items: List[ResourceSlice]
    apiVersion: str = 'resource.k8s.io/v1alpha2'
    kind: str = 'ResourceSliceList'
    metadata: ListMeta = field(default_factory=ObjectMeta)


@dataclass(slots=True, kw_only=True, frozen=True)
class AllocationResult(LazyLoadModel):
    availableOnNodes: NodeSelector | None = None
    resourceHandles: List[ResourceHandle] | None = None
    shareable: bool | 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] = field(
        default_factory=list,
        metadata={
            'x-kubernetes-patch-strategy': 'merge',
            'x-kubernetes-patch-merge-key': 'uid',
        },
    )


@dataclass(slots=True, kw_only=True, frozen=True)
class ResourceClaimTemplate(K8sResource):
    spec: ResourceClaimTemplateSpec
    apiVersion: ClassVar[str] = 'resource.k8s.io/v1alpha2'
    kind: ClassVar[str] = 'ResourceClaimTemplate'
    metadata: ObjectMeta = field(default_factory=ObjectMeta)
    api_path_: ClassVar[str] = (
        'apis/resource.k8s.io/v1alpha2/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/v1alpha2'
    kind: str = 'ResourceClaimTemplateList'
    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/v1alpha2'
    kind: ClassVar[str] = 'ResourceClaim'
    metadata: ObjectMeta = field(default_factory=ObjectMeta)
    status: ResourceClaimStatus | None = None
    api_path_: ClassVar[str] = (
        'apis/resource.k8s.io/v1alpha2/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/v1alpha2'
    kind: str = 'ResourceClaimList'
    metadata: ListMeta = field(default_factory=ObjectMeta)
