codekingpro/portable-devtools
114k
1# coding: utf-82 3"""4 Kubernetes5 6 No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E5017 8 The version of the OpenAPI document: release-1.359 Generated by: https://openapi-generator.tech10"""11 12 13import pprint14import re # noqa: F40115 16import six17 18from kubernetes.client.configuration import Configuration19 20 21class V1PolicyRule(object):22 """NOTE: This class is auto generated by OpenAPI Generator.23 Ref: https://openapi-generator.tech24 25 Do not edit the class manually.26 """27 28 """29 Attributes:30 openapi_types (dict): The key is attribute name31 and the value is attribute type.32 attribute_map (dict): The key is attribute name33 and the value is json key in definition.34 """35 openapi_types = {36 'api_groups': 'list[str]',37 'non_resource_ur_ls': 'list[str]',38 'resource_names': 'list[str]',39 'resources': 'list[str]',40 'verbs': 'list[str]'41 }42 43 attribute_map = {44 'api_groups': 'apiGroups',45 'non_resource_ur_ls': 'nonResourceURLs',46 'resource_names': 'resourceNames',47 'resources': 'resources',48 'verbs': 'verbs'49 }50 51 def __init__(self, api_groups=None, non_resource_ur_ls=None, resource_names=None, resources=None, verbs=None, local_vars_configuration=None): # noqa: E50152 """V1PolicyRule - a model defined in OpenAPI""" # noqa: E50153 if local_vars_configuration is None:54 local_vars_configuration = Configuration()55 self.local_vars_configuration = local_vars_configuration56 57 self._api_groups = None58 self._non_resource_ur_ls = None59 self._resource_names = None60 self._resources = None61 self._verbs = None62 self.discriminator = None63 64 if api_groups is not None:65 self.api_groups = api_groups66 if non_resource_ur_ls is not None:67 self.non_resource_ur_ls = non_resource_ur_ls68 if resource_names is not None:69 self.resource_names = resource_names70 if resources is not None:71 self.resources = resources72 self.verbs = verbs73 74 @property75 def api_groups(self):76 """Gets the api_groups of this V1PolicyRule. # noqa: E50177 78 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. \"\" represents the core API group and \"*\" represents all API groups. # noqa: E50179 80 :return: The api_groups of this V1PolicyRule. # noqa: E50181 :rtype: list[str]82 """83 return self._api_groups84 85 @api_groups.setter86 def api_groups(self, api_groups):87 """Sets the api_groups of this V1PolicyRule.88 89 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. \"\" represents the core API group and \"*\" represents all API groups. # noqa: E50190 91 :param api_groups: The api_groups of this V1PolicyRule. # noqa: E50192 :type: list[str]93 """94 95 self._api_groups = api_groups96 97 @property98 def non_resource_ur_ls(self):99 """Gets the non_resource_ur_ls of this V1PolicyRule. # noqa: E501100 101 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. # noqa: E501102 103 :return: The non_resource_ur_ls of this V1PolicyRule. # noqa: E501104 :rtype: list[str]105 """106 return self._non_resource_ur_ls107 108 @non_resource_ur_ls.setter109 def non_resource_ur_ls(self, non_resource_ur_ls):110 """Sets the non_resource_ur_ls of this V1PolicyRule.111 112 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. # noqa: E501113 114 :param non_resource_ur_ls: The non_resource_ur_ls of this V1PolicyRule. # noqa: E501115 :type: list[str]116 """117 118 self._non_resource_ur_ls = non_resource_ur_ls119 120 @property121 def resource_names(self):122 """Gets the resource_names of this V1PolicyRule. # noqa: E501123 124 ResourceNames is an optional white list of names that the rule applies to. An empty set means that everything is allowed. # noqa: E501125 126 :return: The resource_names of this V1PolicyRule. # noqa: E501127 :rtype: list[str]128 """129 return self._resource_names130 131 @resource_names.setter132 def resource_names(self, resource_names):133 """Sets the resource_names of this V1PolicyRule.134 135 ResourceNames is an optional white list of names that the rule applies to. An empty set means that everything is allowed. # noqa: E501136 137 :param resource_names: The resource_names of this V1PolicyRule. # noqa: E501138 :type: list[str]139 """140 141 self._resource_names = resource_names142 143 @property144 def resources(self):145 """Gets the resources of this V1PolicyRule. # noqa: E501146 147 Resources is a list of resources this rule applies to. '*' represents all resources. # noqa: E501148 149 :return: The resources of this V1PolicyRule. # noqa: E501150 :rtype: list[str]151 """152 return self._resources153 154 @resources.setter155 def resources(self, resources):156 """Sets the resources of this V1PolicyRule.157 158 Resources is a list of resources this rule applies to. '*' represents all resources. # noqa: E501159 160 :param resources: The resources of this V1PolicyRule. # noqa: E501161 :type: list[str]162 """163 164 self._resources = resources165 166 @property167 def verbs(self):168 """Gets the verbs of this V1PolicyRule. # noqa: E501169 170 Verbs is a list of Verbs that apply to ALL the ResourceKinds contained in this rule. '*' represents all verbs. # noqa: E501171 172 :return: The verbs of this V1PolicyRule. # noqa: E501173 :rtype: list[str]174 """175 return self._verbs176 177 @verbs.setter178 def verbs(self, verbs):179 """Sets the verbs of this V1PolicyRule.180 181 Verbs is a list of Verbs that apply to ALL the ResourceKinds contained in this rule. '*' represents all verbs. # noqa: E501182 183 :param verbs: The verbs of this V1PolicyRule. # noqa: E501184 :type: list[str]185 """186 if self.local_vars_configuration.client_side_validation and verbs is None: # noqa: E501187 raise ValueError("Invalid value for `verbs`, must not be `None`") # noqa: E501188 189 self._verbs = verbs190 191 def to_dict(self):192 """Returns the model properties as a dict"""193 result = {}194 195 for attr, _ in six.iteritems(self.openapi_types):196 value = getattr(self, attr)197 if isinstance(value, list):198 result[attr] = list(map(199 lambda x: x.to_dict() if hasattr(x, "to_dict") else x,200 value201 ))202 elif hasattr(value, "to_dict"):203 result[attr] = value.to_dict()204 elif isinstance(value, dict):205 result[attr] = dict(map(206 lambda item: (item[0], item[1].to_dict())207 if hasattr(item[1], "to_dict") else item,208 value.items()209 ))210 else:211 result[attr] = value212 213 return result214 215 def to_str(self):216 """Returns the string representation of the model"""217 return pprint.pformat(self.to_dict())218 219 def __repr__(self):220 """For `print` and `pprint`"""221 return self.to_str()222 223 def __eq__(self, other):224 """Returns true if both objects are equal"""225 if not isinstance(other, V1PolicyRule):226 return False227 228 return self.to_dict() == other.to_dict()229 230 def __ne__(self, other):231 """Returns true if both objects are not equal"""232 if not isinstance(other, V1PolicyRule):233 return True234 235 return self.to_dict() != other.to_dict()236 