# autogenerated module
from typing import List, Optional

from ._schema import dataclass, field, DictMixin

from . import meta_v1


@dataclass
class AggregationRule(DictMixin):
    """AggregationRule describes how to locate ClusterRoles to aggregate into the
      ClusterRole

      **parameters**

      * **clusterRoleSelectors** ``Optional[List[meta_v1.LabelSelector]]`` - ClusterRoleSelectors holds a list of selectors which will be used to find
        ClusterRoles and create the rules. If any of the selectors match, then the
        ClusterRole's permissions will be added
    """
    clusterRoleSelectors: 'Optional[List[meta_v1.LabelSelector]]' = None


@dataclass
class ClusterRole(DictMixin):
    """ClusterRole is a cluster level, logical grouping of PolicyRules that can be
      referenced as a unit by a RoleBinding or ClusterRoleBinding. Deprecated in
      v1.17 in favor of rbac.authorization.k8s.io/v1 ClusterRole, and will no longer
      be served in v1.20.

      **parameters**

      * **aggregationRule** ``Optional[AggregationRule]`` - AggregationRule is an optional field that describes how to build the Rules for
        this ClusterRole. If AggregationRule is set, then the Rules are controller
        managed and direct changes to Rules will be stomped by the controller.
      * **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]`` - Standard object's metadata.
      * **rules** ``Optional[List[PolicyRule]]`` - Rules holds all the PolicyRules for this ClusterRole
    """
    aggregationRule: 'Optional[AggregationRule]' = None
    apiVersion: 'Optional[str]' = None
    kind: 'Optional[str]' = None
    metadata: 'Optional[meta_v1.ObjectMeta]' = None
    rules: 'Optional[List[PolicyRule]]' = None


@dataclass
class ClusterRoleBinding(DictMixin):
    """ClusterRoleBinding references a ClusterRole, but not contain it.  It can
      reference a ClusterRole in the global namespace, and adds who information via
      Subject. Deprecated in v1.17 in favor of rbac.authorization.k8s.io/v1
      ClusterRoleBinding, and will no longer be served in v1.20.

      **parameters**

      * **roleRef** ``RoleRef`` - RoleRef can only reference a ClusterRole in the global namespace. If the
        RoleRef cannot be resolved, the Authorizer must return an error.
      * **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]`` - Standard object's metadata.
      * **subjects** ``Optional[List[Subject]]`` - Subjects holds references to the objects the role applies to.
    """
    roleRef: 'RoleRef'
    apiVersion: 'Optional[str]' = None
    kind: 'Optional[str]' = None
    metadata: 'Optional[meta_v1.ObjectMeta]' = None
    subjects: 'Optional[List[Subject]]' = None


@dataclass
class ClusterRoleBindingList(DictMixin):
    """ClusterRoleBindingList is a collection of ClusterRoleBindings. Deprecated in
      v1.17 in favor of rbac.authorization.k8s.io/v1 ClusterRoleBindings, and will
      no longer be served in v1.20.

      **parameters**

      * **items** ``List[ClusterRoleBinding]`` - Items is a list of ClusterRoleBindings
      * **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]`` - Standard object's metadata.
    """
    items: 'List[ClusterRoleBinding]'
    apiVersion: 'Optional[str]' = None
    kind: 'Optional[str]' = None
    metadata: 'Optional[meta_v1.ListMeta]' = None


@dataclass
class ClusterRoleList(DictMixin):
    """ClusterRoleList is a collection of ClusterRoles. Deprecated in v1.17 in favor
      of rbac.authorization.k8s.io/v1 ClusterRoles, and will no longer be served in
      v1.20.

      **parameters**

      * **items** ``List[ClusterRole]`` - Items is a list of ClusterRoles
      * **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]`` - Standard object's metadata.
    """
    items: 'List[ClusterRole]'
    apiVersion: 'Optional[str]' = None
    kind: 'Optional[str]' = None
    metadata: 'Optional[meta_v1.ListMeta]' = None


@dataclass
class PolicyRule(DictMixin):
    """PolicyRule holds information that describes a policy rule, but does not
      contain information about who the rule applies to or which namespace the rule
      applies to.

      **parameters**

      * **verbs** ``List[str]`` - Verbs is a list of Verbs that apply to ALL the ResourceKinds and
        AttributeRestrictions contained in this rule.  VerbAll represents all kinds.
      * **apiGroups** ``Optional[List[str]]`` - APIGroups is the name of the APIGroup that contains the resources.  If
        multiple API groups are specified, any action requested against one of the
        enumerated resources in any API group will be allowed.
      * **nonResourceURLs** ``Optional[List[str]]`` - NonResourceURLs is a set of partial urls that a user should have access to.
        *s are allowed, but only as the full, final step in the path Since
        non-resource URLs are not namespaced, this field is only applicable for
        ClusterRoles referenced from a ClusterRoleBinding. Rules can either apply to
        API resources (such as "pods" or "secrets") or non-resource URL paths (such as
        "/api"),  but not both.
      * **resourceNames** ``Optional[List[str]]`` - ResourceNames is an optional white list of names that the rule applies to.  An
        empty set means that everything is allowed.
      * **resources** ``Optional[List[str]]`` - Resources is a list of resources this rule applies to.  ResourceAll represents
        all resources.
    """
    verbs: 'List[str]'
    apiGroups: 'Optional[List[str]]' = None
    nonResourceURLs: 'Optional[List[str]]' = None
    resourceNames: 'Optional[List[str]]' = None
    resources: 'Optional[List[str]]' = None


@dataclass
class Role(DictMixin):
    """Role is a namespaced, logical grouping of PolicyRules that can be referenced
      as a unit by a RoleBinding. Deprecated in v1.17 in favor of
      rbac.authorization.k8s.io/v1 Role, and will no longer be served in v1.20.

      **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]`` - Standard object's metadata.
      * **rules** ``Optional[List[PolicyRule]]`` - Rules holds all the PolicyRules for this Role
    """
    apiVersion: 'Optional[str]' = None
    kind: 'Optional[str]' = None
    metadata: 'Optional[meta_v1.ObjectMeta]' = None
    rules: 'Optional[List[PolicyRule]]' = None


@dataclass
class RoleBinding(DictMixin):
    """RoleBinding references a role, but does not contain it.  It can reference a
      Role in the same namespace or a ClusterRole in the global namespace. It adds
      who information via Subjects and namespace information by which namespace it
      exists in.  RoleBindings in a given namespace only have effect in that
      namespace. Deprecated in v1.17 in favor of rbac.authorization.k8s.io/v1
      RoleBinding, and will no longer be served in v1.20.

      **parameters**

      * **roleRef** ``RoleRef`` - RoleRef can reference a Role in the current namespace or a ClusterRole in the
        global namespace. If the RoleRef cannot be resolved, the Authorizer must
        return an error.
      * **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]`` - Standard object's metadata.
      * **subjects** ``Optional[List[Subject]]`` - Subjects holds references to the objects the role applies to.
    """
    roleRef: 'RoleRef'
    apiVersion: 'Optional[str]' = None
    kind: 'Optional[str]' = None
    metadata: 'Optional[meta_v1.ObjectMeta]' = None
    subjects: 'Optional[List[Subject]]' = None


@dataclass
class RoleBindingList(DictMixin):
    """RoleBindingList is a collection of RoleBindings Deprecated in v1.17 in favor
      of rbac.authorization.k8s.io/v1 RoleBindingList, and will no longer be served
      in v1.20.

      **parameters**

      * **items** ``List[RoleBinding]`` - Items is a list of RoleBindings
      * **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]`` - Standard object's metadata.
    """
    items: 'List[RoleBinding]'
    apiVersion: 'Optional[str]' = None
    kind: 'Optional[str]' = None
    metadata: 'Optional[meta_v1.ListMeta]' = None


@dataclass
class RoleList(DictMixin):
    """RoleList is a collection of Roles. Deprecated in v1.17 in favor of
      rbac.authorization.k8s.io/v1 RoleList, and will no longer be served in v1.20.

      **parameters**

      * **items** ``List[Role]`` - Items is a list of Roles
      * **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]`` - Standard object's metadata.
    """
    items: 'List[Role]'
    apiVersion: 'Optional[str]' = None
    kind: 'Optional[str]' = None
    metadata: 'Optional[meta_v1.ListMeta]' = None


@dataclass
class RoleRef(DictMixin):
    """RoleRef contains information that points to the role being used

      **parameters**

      * **apiGroup** ``str`` - APIGroup is the group for the resource being referenced
      * **kind** ``str`` - Kind is the type of resource being referenced
      * **name** ``str`` - Name is the name of resource being referenced
    """
    apiGroup: 'str'
    kind: 'str'
    name: 'str'


@dataclass
class Subject(DictMixin):
    """Subject contains a reference to the object or user identities a role binding
      applies to.  This can either hold a direct API object reference, or a value
      for non-objects such as user and group names.

      **parameters**

      * **kind** ``str`` - Kind of object being referenced. Values defined by this API group are "User",
        "Group", and "ServiceAccount". If the Authorizer does not recognized the kind
        value, the Authorizer should report an error.
      * **name** ``str`` - Name of the object being referenced.
      * **apiVersion** ``Optional[str]`` - APIVersion holds the API group and version of the referenced subject. Defaults
        to "v1" for ServiceAccount subjects. Defaults to
        "rbac.authorization.k8s.io/v1alpha1" for User and Group subjects.
      * **namespace** ``Optional[str]`` - Namespace of the referenced object.  If the object kind is non-namespace, such
        as "User" or "Group", and this value is not empty the Authorizer should report
        an error.
    """
    kind: 'str'
    name: 'str'
    apiVersion: 'Optional[str]' = None
    namespace: 'Optional[str]' = None


