# autogenerated module
from typing import List, Optional

from ._schema import dataclass, field, DictMixin

from . import meta_v1


@dataclass
class CertificateSigningRequest(DictMixin):
    """Describes a certificate signing request

      **parameters**

      * **apiVersion** ``Optional[str]`` - APIVersion defines the versioned schema of this representation of an object.
        Servers should convert recognized schemas to the latest internal value, and
        may reject unrecognized values. More info:
        https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
      * **kind** ``Optional[str]`` - Kind is a string value representing the REST resource this object represents.
        Servers may infer this from the endpoint the client submits requests to.
        Cannot be updated. In CamelCase. More info:
        https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
      * **metadata** ``Optional[meta_v1.ObjectMeta]`` - 
      * **spec** ``Optional[CertificateSigningRequestSpec]`` - The certificate request itself and any additional information.
      * **status** ``Optional[CertificateSigningRequestStatus]`` - Derived information about the request.
    """
    apiVersion: 'Optional[str]' = None
    kind: 'Optional[str]' = None
    metadata: 'Optional[meta_v1.ObjectMeta]' = None
    spec: 'Optional[CertificateSigningRequestSpec]' = None
    status: 'Optional[CertificateSigningRequestStatus]' = None


@dataclass
class CertificateSigningRequestCondition(DictMixin):
    """

      **parameters**

      * **type** ``str`` - request approval state, currently Approved or Denied.
      * **lastUpdateTime** ``Optional[meta_v1.Time]`` - timestamp for the last update to this condition
      * **message** ``Optional[str]`` - human readable message with details about the request state
      * **reason** ``Optional[str]`` - brief reason for the request state
    """
    type: 'str'
    lastUpdateTime: 'Optional[meta_v1.Time]' = None
    message: 'Optional[str]' = None
    reason: 'Optional[str]' = None


@dataclass
class CertificateSigningRequestList(DictMixin):
    """

      **parameters**

      * **items** ``List[CertificateSigningRequest]`` - 
      * **apiVersion** ``Optional[str]`` - APIVersion defines the versioned schema of this representation of an object.
        Servers should convert recognized schemas to the latest internal value, and
        may reject unrecognized values. More info:
        https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
      * **kind** ``Optional[str]`` - Kind is a string value representing the REST resource this object represents.
        Servers may infer this from the endpoint the client submits requests to.
        Cannot be updated. In CamelCase. More info:
        https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
      * **metadata** ``Optional[meta_v1.ListMeta]`` - 
    """
    items: 'List[CertificateSigningRequest]'
    apiVersion: 'Optional[str]' = None
    kind: 'Optional[str]' = None
    metadata: 'Optional[meta_v1.ListMeta]' = None


@dataclass
class CertificateSigningRequestSpec(DictMixin):
    """This information is immutable after the request is created. Only the Request
      and Usages fields can be set on creation, other fields are derived by
      Kubernetes and cannot be modified by users.

      **parameters**

      * **request** ``str`` - Base64-encoded PKCS#10 CSR data
      * **extra** ``Optional[dict]`` - Extra information about the requesting user. See user.Info interface for
        details.
      * **groups** ``Optional[List[str]]`` - Group information about the requesting user. See user.Info interface for
        details.
      * **signerName** ``Optional[str]`` - Requested signer for the request. It is a qualified name in the form:
        `scope-hostname.io/name`. If empty, it will be defaulted:
         1. If it's a kubelet client certificate, it is assigned
            "kubernetes.io/kube-apiserver-client-kubelet".
         2. If it's a kubelet serving certificate, it is assigned
            "kubernetes.io/kubelet-serving".
         3. Otherwise, it is assigned "kubernetes.io/legacy-unknown".
        Distribution of trust for signers happens out of band. You can select on this
        field using `spec.signerName`.
      * **uid** ``Optional[str]`` - UID information about the requesting user. See user.Info interface for
        details.
      * **usages** ``Optional[List[str]]`` - allowedUsages specifies a set of usage contexts the key will be valid for.
        See: https://tools.ietf.org/html/rfc5280#section-4.2.1.3
             https://tools.ietf.org/html/rfc5280#section-4.2.1.12
      * **username** ``Optional[str]`` - Information about the requesting user. See user.Info interface for details.
    """
    request: 'str'
    extra: 'Optional[dict]' = None
    groups: 'Optional[List[str]]' = None
    signerName: 'Optional[str]' = None
    uid: 'Optional[str]' = None
    usages: 'Optional[List[str]]' = None
    username: 'Optional[str]' = None


@dataclass
class CertificateSigningRequestStatus(DictMixin):
    """

      **parameters**

      * **certificate** ``Optional[str]`` - If request was approved, the controller will place the issued certificate
        here.
      * **conditions** ``Optional[List[CertificateSigningRequestCondition]]`` - Conditions applied to the request, such as approval or denial.
    """
    certificate: 'Optional[str]' = None
    conditions: 'Optional[List[CertificateSigningRequestCondition]]' = None


