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

from ...apimachinery.pkg.apis.meta.v1 import ListMeta, ObjectMeta, Time


@dataclass(slots=True, kw_only=True, frozen=True)
class CertificateSigningRequestSpec(Loadable):
    request: str
    signerName: str
    expirationSeconds: int | None = None
    extra: Dict[str, List[str]] | None = None
    groups: List[str] | None = None
    uid: str | None = None
    usages: List[str] | None = None
    username: str | None = None


@dataclass(slots=True, kw_only=True, frozen=True)
class CertificateSigningRequestCondition(Loadable):
    status: str
    type: str
    lastTransitionTime: Time | None = None
    lastUpdateTime: Time | None = None
    message: str | None = None
    reason: str | None = None


@dataclass(slots=True, kw_only=True, frozen=True)
class CertificateSigningRequestStatus(Loadable):
    certificate: str | None = None
    conditions: List[CertificateSigningRequestCondition] | None = None


@dataclass(slots=True, kw_only=True, frozen=True)
class CertificateSigningRequest(K8sResource):
    spec: CertificateSigningRequestSpec
    apiVersion: ClassVar[str] = 'certificates.k8s.io/v1'
    kind: ClassVar[str] = 'CertificateSigningRequest'
    metadata: ObjectMeta = field(default_factory=ObjectMeta)
    status: CertificateSigningRequestStatus | None = None
    plural_: ClassVar[str] = 'certificatesigningrequests'
    is_namespaced_: ClassVar[bool] = False
    group_: ClassVar[Optional[str]] = 'certificates.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 CertificateSigningRequestList(Loadable):
    items: List[CertificateSigningRequest]
    apiVersion: str = 'certificates.k8s.io/v1'
    kind: str = 'CertificateSigningRequestList'
    metadata: ListMeta = field(default_factory=ObjectMeta)
