# generated by https://github.com/puzl-cloud/kubesdk
#   filename:  apis__events.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 LazyLoadModel
from kube_models.resource import *

from ...apimachinery.pkg.apis.meta.v1 import ListMeta, MicroTime, ObjectMeta, Time
from ..core.v1 import EventSource, ObjectReference


@dataclass(slots=True, kw_only=True, frozen=True)
class EventSeries(LazyLoadModel):
    count: int
    lastObservedTime: MicroTime


@dataclass(slots=True, kw_only=True, frozen=True)
class Event(K8sResource):
    eventTime: MicroTime
    action: str | None = None
    apiVersion: ClassVar[str] = 'events.k8s.io/v1'
    deprecatedCount: int | None = None
    deprecatedFirstTimestamp: Time | None = None
    deprecatedLastTimestamp: Time | None = None
    deprecatedSource: EventSource | None = None
    kind: ClassVar[str] = 'Event'
    metadata: ObjectMeta = field(default_factory=ObjectMeta)
    note: str | None = None
    reason: str | None = None
    regarding: ObjectReference | None = None
    related: ObjectReference | None = None
    reportingController: str | None = None
    reportingInstance: str | None = None
    series: EventSeries | None = None
    type: str | None = None
    api_path_: ClassVar[str] = 'apis/events.k8s.io/v1/namespaces/{namespace}/events'
    plural_: ClassVar[str] = 'events'
    is_namespaced_: ClassVar[bool] = False
    group_: ClassVar[Optional[str]] = 'events.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 EventList(LazyLoadModel):
    items: List[Event]
    apiVersion: str = 'events.k8s.io/v1'
    kind: str = 'EventList'
    metadata: ListMeta = field(default_factory=ObjectMeta)
