# autogenerated module
from typing import List, Optional

from ._schema import dataclass, field, DictMixin

from . import meta_v1


@dataclass
class AuditSink(DictMixin):
    """AuditSink represents a cluster level audit sink

      **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[AuditSinkSpec]`` - Spec defines the audit configuration spec
    """
    apiVersion: 'Optional[str]' = None
    kind: 'Optional[str]' = None
    metadata: 'Optional[meta_v1.ObjectMeta]' = None
    spec: 'Optional[AuditSinkSpec]' = None


@dataclass
class AuditSinkList(DictMixin):
    """AuditSinkList is a list of AuditSink items.

      **parameters**

      * **items** ``List[AuditSink]`` - List of audit configurations.
      * **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[AuditSink]'
    apiVersion: 'Optional[str]' = None
    kind: 'Optional[str]' = None
    metadata: 'Optional[meta_v1.ListMeta]' = None


@dataclass
class AuditSinkSpec(DictMixin):
    """AuditSinkSpec holds the spec for the audit sink

      **parameters**

      * **policy** ``Policy`` - Policy defines the policy for selecting which events should be sent to the
        webhook required
      * **webhook** ``Webhook`` - Webhook to send events required
    """
    policy: 'Policy'
    webhook: 'Webhook'


@dataclass
class Policy(DictMixin):
    """Policy defines the configuration of how audit events are logged

      **parameters**

      * **level** ``str`` - The Level that all requests are recorded at. available options: None,
        Metadata, Request, RequestResponse required
      * **stages** ``Optional[List[str]]`` - Stages is a list of stages for which events are created.
    """
    level: 'str'
    stages: 'Optional[List[str]]' = None


@dataclass
class ServiceReference(DictMixin):
    """ServiceReference holds a reference to Service.legacy.k8s.io

      **parameters**

      * **name** ``str`` - `name` is the name of the service. Required
      * **namespace** ``str`` - `namespace` is the namespace of the service. Required
      * **path** ``Optional[str]`` - `path` is an optional URL path which will be sent in any request to this
        service.
      * **port** ``Optional[int]`` - If specified, the port on the service that hosting webhook. Default to 443 for
        backward compatibility. `port` should be a valid port number (1-65535,
        inclusive).
    """
    name: 'str'
    namespace: 'str'
    path: 'Optional[str]' = None
    port: 'Optional[int]' = None


@dataclass
class Webhook(DictMixin):
    """Webhook holds the configuration of the webhook

      **parameters**

      * **clientConfig** ``WebhookClientConfig`` - ClientConfig holds the connection parameters for the webhook required
      * **throttle** ``Optional[WebhookThrottleConfig]`` - Throttle holds the options for throttling the webhook
    """
    clientConfig: 'WebhookClientConfig'
    throttle: 'Optional[WebhookThrottleConfig]' = None


@dataclass
class WebhookClientConfig(DictMixin):
    """WebhookClientConfig contains the information to make a connection with the
      webhook

      **parameters**

      * **caBundle** ``Optional[str]`` - `caBundle` is a PEM encoded CA bundle which will be used to validate the
        webhook's server certificate. If unspecified, system trust roots on the
        apiserver are used.
      * **service** ``Optional[ServiceReference]`` - `service` is a reference to the service for this webhook. Either `service` or
        `url` must be specified.
        If the webhook is running within the cluster, then you should use `service`.
      * **url** ``Optional[str]`` - `url` gives the location of the webhook, in standard URL form
        (`scheme://host:port/path`). Exactly one of `url` or `service` must be
        specified.
        The `host` should not refer to a service running in the cluster; use the
        `service` field instead. The host might be resolved via external DNS in some
        apiservers (e.g., `kube-apiserver` cannot resolve in-cluster DNS as that would
        be a layering violation). `host` may also be an IP address.
        Please note that using `localhost` or `127.0.0.1` as a `host` is risky unless
        you take great care to run this webhook on all hosts which run an apiserver
        which might need to make calls to this webhook. Such installs are likely to be
        non-portable, i.e., not easy to turn up in a new cluster.
        The scheme must be "https"; the URL must begin with "https://".
        A path is optional, and if present may be any string permissible in a URL. You
        may use the path to pass an arbitrary string to the webhook, for example, a
        cluster identifier.
        Attempting to use a user or basic auth e.g. "user:password@" is not allowed.
        Fragments ("#...") and query parameters ("?...") are not allowed, either.
    """
    caBundle: 'Optional[str]' = None
    service: 'Optional[ServiceReference]' = None
    url: 'Optional[str]' = None


@dataclass
class WebhookThrottleConfig(DictMixin):
    """WebhookThrottleConfig holds the configuration for throttling events

      **parameters**

      * **burst** ``Optional[int]`` - ThrottleBurst is the maximum number of events sent at the same moment default
        15 QPS
      * **qps** ``Optional[int]`` - ThrottleQPS maximum number of batches per second default 10 QPS
    """
    burst: 'Optional[int]' = None
    qps: 'Optional[int]' = None


