# generated by https://github.com/puzl-cloud/kubesdk
#   filename:  apis__coordination.k8s.io__v1_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 LeaseSpec(Loadable):
    acquireTime: MicroTime | None = None
    holderIdentity: str | None = None
    leaseDurationSeconds: int | None = None
    leaseTransitions: int | None = None
    preferredHolder: str | None = None
    renewTime: MicroTime | None = None
    strategy: str | None = None


@dataclass(slots=True, kw_only=True, frozen=True)
class Lease(K8sResource):
    apiVersion: ClassVar[str] = 'coordination.k8s.io/v1'
    kind: ClassVar[str] = 'Lease'
    metadata: ObjectMeta = field(default_factory=ObjectMeta)
    spec: LeaseSpec | None = None
    plural_: ClassVar[str] = 'leases'
    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 LeaseList(Loadable):
    items: List[Lease]
    apiVersion: str = 'coordination.k8s.io/v1'
    kind: str = 'LeaseList'
    metadata: ListMeta = field(default_factory=ObjectMeta)
