# generated by https://github.com/puzl-cloud/kubesdk
#   filename:  apis__networking.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 Condition, ListMeta, ObjectMeta


@dataclass(slots=True, kw_only=True, frozen=True)
class ParentReference(LazyLoadModel):
    name: str
    resource: str
    group: str | None = None
    namespace: str | None = None


@dataclass(slots=True, kw_only=True, frozen=True)
class ServiceCIDRSpec(LazyLoadModel):
    cidrs: List[str] | None = None


@dataclass(slots=True, kw_only=True, frozen=True)
class IPAddressSpec(LazyLoadModel):
    parentRef: ParentReference


@dataclass(slots=True, kw_only=True, frozen=True)
class IPAddress(K8sResource):
    apiVersion: ClassVar[str] = 'networking.k8s.io/v1alpha1'
    kind: ClassVar[str] = 'IPAddress'
    metadata: ObjectMeta = field(default_factory=ObjectMeta)
    spec: IPAddressSpec | None = None
    api_path_: ClassVar[str] = 'apis/networking.k8s.io/v1alpha1/ipaddresses'
    plural_: ClassVar[str] = 'ipaddresses'
    is_namespaced_: ClassVar[bool] = False
    group_: ClassVar[Optional[str]] = 'networking.k8s.io'
    patch_strategies_: ClassVar[set[PatchRequestType]] = {
        '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 IPAddressList(LazyLoadModel):
    items: List[IPAddress]
    apiVersion: str = 'networking.k8s.io/v1alpha1'
    kind: str = 'IPAddressList'
    metadata: ListMeta = field(default_factory=ObjectMeta)


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


@dataclass(slots=True, kw_only=True, frozen=True)
class ServiceCIDR(K8sResource):
    apiVersion: ClassVar[str] = 'networking.k8s.io/v1alpha1'
    kind: ClassVar[str] = 'ServiceCIDR'
    metadata: ObjectMeta = field(default_factory=ObjectMeta)
    spec: ServiceCIDRSpec | None = None
    status: ServiceCIDRStatus | None = None
    api_path_: ClassVar[str] = 'apis/networking.k8s.io/v1alpha1/servicecidrs'
    plural_: ClassVar[str] = 'servicecidrs'
    is_namespaced_: ClassVar[bool] = False
    group_: ClassVar[Optional[str]] = 'networking.k8s.io'
    patch_strategies_: ClassVar[set[PatchRequestType]] = {
        '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 ServiceCIDRList(LazyLoadModel):
    items: List[ServiceCIDR]
    apiVersion: str = 'networking.k8s.io/v1alpha1'
    kind: str = 'ServiceCIDRList'
    metadata: ListMeta = field(default_factory=ObjectMeta)
