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


@dataclass(slots=True, kw_only=True, frozen=True)
class TokenReviewSpec(LazyLoadModel):
    audiences: List[str] | None = None
    token: str | None = None


@dataclass(slots=True, kw_only=True, frozen=True)
class UserInfo(LazyLoadModel):
    extra: Dict[str, List[str]] | None = None
    groups: List[str] | None = None
    uid: str | None = None
    username: str | None = None


@dataclass(slots=True, kw_only=True, frozen=True)
class SelfSubjectReviewStatus(LazyLoadModel):
    userInfo: UserInfo | None = None


@dataclass(slots=True, kw_only=True, frozen=True)
class TokenReviewStatus(LazyLoadModel):
    audiences: List[str] | None = None
    authenticated: bool | None = None
    error: str | None = None
    user: UserInfo | None = None


@dataclass(slots=True, kw_only=True, frozen=True)
class SelfSubjectReview(K8sResource):
    apiVersion: ClassVar[str] = 'authentication.k8s.io/v1'
    kind: ClassVar[str] = 'SelfSubjectReview'
    metadata: ObjectMeta = field(default_factory=ObjectMeta)
    status: SelfSubjectReviewStatus | None = None
    api_path_: ClassVar[str] = 'apis/authentication.k8s.io/v1/selfsubjectreviews'
    plural_: ClassVar[str] = 'selfsubjectreviews'
    is_namespaced_: ClassVar[bool] = False
    group_: ClassVar[Optional[str]] = 'authentication.k8s.io'


@dataclass(slots=True, kw_only=True, frozen=True)
class TokenReview(K8sResource):
    spec: TokenReviewSpec
    apiVersion: ClassVar[str] = 'authentication.k8s.io/v1'
    kind: ClassVar[str] = 'TokenReview'
    metadata: ObjectMeta = field(default_factory=ObjectMeta)
    status: TokenReviewStatus | None = None
    api_path_: ClassVar[str] = 'apis/authentication.k8s.io/v1/tokenreviews'
    plural_: ClassVar[str] = 'tokenreviews'
    is_namespaced_: ClassVar[bool] = False
    group_: ClassVar[Optional[str]] = 'authentication.k8s.io'
