# generated by https://github.com/puzl-cloud/kubesdk
#   filename:  apis__discovery.k8s.io__v1_openapi.json

from __future__ import annotations

from dataclasses import dataclass, field
from datetime import datetime, timezone
from typing import ClassVar, Dict, 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
from ..core.v1 import ObjectReference


@dataclass(slots=True, kw_only=True, frozen=True)
class EndpointConditions(LazyLoadModel):
    ready: bool | None = None
    serving: bool | None = None
    terminating: bool | None = None


@dataclass(slots=True, kw_only=True, frozen=True)
class EndpointPort(LazyLoadModel):
    appProtocol: str | None = None
    name: str | None = None
    port: int | None = None
    protocol: str | None = None


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


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


@dataclass(slots=True, kw_only=True, frozen=True)
class EndpointHints(LazyLoadModel):
    forNodes: List[ForNode] | None = None
    forZones: List[ForZone] | None = None


@dataclass(slots=True, kw_only=True, frozen=True)
class Endpoint(LazyLoadModel):
    addresses: List[str]
    conditions: EndpointConditions | None = None
    deprecatedTopology: Dict[str, str] | None = None
    hints: EndpointHints | None = None
    hostname: str | None = None
    nodeName: str | None = None
    targetRef: ObjectReference | None = None
    zone: str | None = None


@dataclass(slots=True, kw_only=True, frozen=True)
class EndpointSlice(K8sResource):
    addressType: str
    endpoints: List[Endpoint]
    apiVersion: ClassVar[str] = 'discovery.k8s.io/v1'
    kind: ClassVar[str] = 'EndpointSlice'
    metadata: ObjectMeta = field(default_factory=ObjectMeta)
    ports: List[EndpointPort] | None = None
    api_path_: ClassVar[str] = (
        'apis/discovery.k8s.io/v1/namespaces/{namespace}/endpointslices'
    )
    plural_: ClassVar[str] = 'endpointslices'
    is_namespaced_: ClassVar[bool] = False
    group_: ClassVar[Optional[str]] = 'discovery.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 EndpointSliceList(LazyLoadModel):
    items: List[EndpointSlice]
    apiVersion: str = 'discovery.k8s.io/v1'
    kind: str = 'EndpointSliceList'
    metadata: ListMeta = field(default_factory=ObjectMeta)
