# generated by https://github.com/puzl-cloud/kubesdk
#   filename:  apis__internal.apiserver.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, Time


@dataclass(slots=True, kw_only=True, frozen=True)
class ServerStorageVersion(LazyLoadModel):
    apiServerID: str | None = None
    decodableVersions: List[str] | None = None
    encodingVersion: str | None = None
    servedVersions: List[str] | None = None


@dataclass(slots=True, kw_only=True, frozen=True)
class StorageVersionSpec(LazyLoadModel):
    pass


@dataclass(slots=True, kw_only=True, frozen=True)
class StorageVersionCondition(LazyLoadModel):
    message: str
    reason: str
    status: str
    type: str
    lastTransitionTime: Time | None = None
    observedGeneration: int | None = None


@dataclass(slots=True, kw_only=True, frozen=True)
class StorageVersionStatus(LazyLoadModel):
    commonEncodingVersion: str | None = None
    conditions: List[StorageVersionCondition] | None = None
    storageVersions: List[ServerStorageVersion] | None = None


@dataclass(slots=True, kw_only=True, frozen=True)
class StorageVersion(K8sResource):
    spec: StorageVersionSpec
    status: StorageVersionStatus
    apiVersion: ClassVar[str] = 'internal.apiserver.k8s.io/v1alpha1'
    kind: ClassVar[str] = 'StorageVersion'
    metadata: ObjectMeta = field(default_factory=ObjectMeta)
    api_path_: ClassVar[str] = 'apis/internal.apiserver.k8s.io/v1alpha1/storageversions'
    plural_: ClassVar[str] = 'storageversions'
    is_namespaced_: ClassVar[bool] = False
    group_: ClassVar[Optional[str]] = 'internal.apiserver.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 StorageVersionList(LazyLoadModel):
    items: List[StorageVersion]
    apiVersion: str = 'internal.apiserver.k8s.io/v1alpha1'
    kind: str = 'StorageVersionList'
    metadata: ListMeta = field(default_factory=ObjectMeta)
