# generated by https://github.com/puzl-cloud/kubesdk
#   filename:  apis__coordination.k8s.io__v1beta1_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, MicroTime, ObjectMeta


@dataclass(slots=True, kw_only=True, frozen=True)
class LeaseCandidateSpec(Loadable):
    binaryVersion: str
    leaseName: str
    strategy: str
    emulationVersion: str | None = None
    pingTime: MicroTime | None = None
    renewTime: MicroTime | None = None


@dataclass(slots=True, kw_only=True, frozen=True)
class LeaseCandidate(K8sResource):
    apiVersion: ClassVar[str] = 'coordination.k8s.io/v1beta1'
    kind: ClassVar[str] = 'LeaseCandidate'
    metadata: ObjectMeta = field(default_factory=ObjectMeta)
    spec: LeaseCandidateSpec | None = None
    plural_: ClassVar[str] = 'leasecandidates'
    is_namespaced_: ClassVar[bool] = True
    group_: ClassVar[Optional[str]] = 'coordination.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 LeaseCandidateList(Loadable):
    items: List[LeaseCandidate]
    apiVersion: str = 'coordination.k8s.io/v1beta1'
    kind: str = 'LeaseCandidateList'
    metadata: ListMeta = field(default_factory=ObjectMeta)
