# generated by https://github.com/puzl-cloud/kubesdk
#   filename:  apis__storagemigration.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 GroupVersionResource(LazyLoadModel):
    group: str | None = None
    resource: str | None = None
    version: str | None = None


@dataclass(slots=True, kw_only=True, frozen=True)
class StorageVersionMigrationSpec(LazyLoadModel):
    resource: GroupVersionResource
    continueToken: str | None = None


@dataclass(slots=True, kw_only=True, frozen=True)
class MigrationCondition(LazyLoadModel):
    status: str
    type: str
    lastUpdateTime: Time | None = None
    message: str | None = None
    reason: str | None = None


@dataclass(slots=True, kw_only=True, frozen=True)
class StorageVersionMigrationStatus(LazyLoadModel):
    conditions: List[MigrationCondition] = field(
        default_factory=list,
        metadata={
            'x-kubernetes-patch-strategy': 'merge',
            'x-kubernetes-patch-merge-key': 'type',
        },
    )
    resourceVersion: str | None = None


@dataclass(slots=True, kw_only=True, frozen=True)
class StorageVersionMigration(K8sResource):
    apiVersion: ClassVar[str] = 'storagemigration.k8s.io/v1alpha1'
    kind: ClassVar[str] = 'StorageVersionMigration'
    metadata: ObjectMeta = field(default_factory=ObjectMeta)
    spec: StorageVersionMigrationSpec | None = None
    status: StorageVersionMigrationStatus | None = None
    api_path_: ClassVar[str] = (
        'apis/storagemigration.k8s.io/v1alpha1/storageversionmigrations'
    )
    plural_: ClassVar[str] = 'storageversionmigrations'
    is_namespaced_: ClassVar[bool] = False
    group_: ClassVar[Optional[str]] = 'storagemigration.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 StorageVersionMigrationList(LazyLoadModel):
    apiVersion: str = 'storagemigration.k8s.io/v1alpha1'
    items: List[StorageVersionMigration] = field(
        metadata={
            'x-kubernetes-patch-strategy': 'merge',
            'x-kubernetes-patch-merge-key': 'type',
        }
    )
    kind: str = 'StorageVersionMigrationList'
    metadata: ListMeta = field(default_factory=ObjectMeta)
