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


@dataclass(slots=True, kw_only=True, frozen=True)
class BoundObjectReference(LazyLoadModel):
    apiVersion: str | None = None
    kind: str | None = None
    name: str | None = None
    uid: str | None = None


@dataclass(slots=True, kw_only=True, frozen=True)
class TokenRequestSpec(LazyLoadModel):
    audiences: List[str]
    boundObjectRef: BoundObjectReference | None = None
    expirationSeconds: int | None = None


@dataclass(slots=True, kw_only=True, frozen=True)
class TokenRequestStatus(LazyLoadModel):
    expirationTimestamp: Time
    token: str


@dataclass(slots=True, kw_only=True, frozen=True)
class TokenRequest(K8sResource):
    spec: TokenRequestSpec
    apiVersion: ClassVar[str] = 'authentication.k8s.io/v1'
    kind: ClassVar[str] = 'TokenRequest'
    metadata: ObjectMeta = field(default_factory=ObjectMeta)
    status: TokenRequestStatus | None = None
    api_path_: ClassVar[str] = (
        'api/v1/namespaces/{namespace}/serviceaccounts/{name}/token'
    )
    plural_: ClassVar[str] = 'token'
    is_namespaced_: ClassVar[bool] = True
    group_: ClassVar[Optional[str]] = 'authentication.k8s.io'
