1# coding: utf-8 2""" 3 Kubernetes 4 5 No description provided (generated by Swagger Codegen 6 https://github.com/swagger-api/swagger-codegen) 7 8 OpenAPI spec version: v1.14.4 9 10 Generated by: https://github.com/swagger-api/swagger-codegen.git 11""" 12 13from pprint import pformat 14from six import iteritems 15import re 16 17 18class V1alpha1PolicyRule(object): 19 """ 20 NOTE: This class is auto generated by the swagger code generator program. 21 Do not edit the class manually. 22 """ 23 """ 24 Attributes: 25 swagger_types (dict): The key is attribute name and the value is attribute 26 type. 27 attribute_map (dict): The key is attribute name and the value is json key 28 in definition. 29 """ 30 swagger_types = { 31 'api_groups': 'list[str]', 32 'non_resource_ur_ls': 'list[str]', 33 'resource_names': 'list[str]', 34 'resources': 'list[str]', 35 'verbs': 'list[str]' 36 } 37 38 attribute_map = { 39 'api_groups': 'apiGroups', 40 'non_resource_ur_ls': 'nonResourceURLs', 41 'resource_names': 'resourceNames', 42 'resources': 'resources', 43 'verbs': 'verbs' 44 } 45 46 def __init__(self, 47 api_groups=None, 48 non_resource_ur_ls=None, 49 resource_names=None, 50 resources=None, 51 verbs=None): 52 """ 53 V1alpha1PolicyRule - a model defined in Swagger 54 """ 55 56 self._api_groups = None 57 self._non_resource_ur_ls = None 58 self._resource_names = None 59 self._resources = None 60 self._verbs = None 61 self.discriminator = None 62 63 if api_groups is not None: 64 self.api_groups = api_groups 65 if non_resource_ur_ls is not None: 66 self.non_resource_ur_ls = non_resource_ur_ls 67 if resource_names is not None: 68 self.resource_names = resource_names 69 if resources is not None: 70 self.resources = resources 71 self.verbs = verbs 72 73 @property 74 def api_groups(self): 75 """ 76 Gets the api_groups of this V1alpha1PolicyRule. 77 APIGroups is the name of the APIGroup that contains the resources. If 78 multiple API groups are specified, any action requested against one of 79 the enumerated resources in any API group will be allowed. 80 81 :return: The api_groups of this V1alpha1PolicyRule. 82 :rtype: list[str] 83 """ 84 return self._api_groups 85 86 @api_groups.setter 87 def api_groups(self, api_groups): 88 """ 89 Sets the api_groups of this V1alpha1PolicyRule. 90 APIGroups is the name of the APIGroup that contains the resources. If 91 multiple API groups are specified, any action requested against one of 92 the enumerated resources in any API group will be allowed. 93 94 :param api_groups: The api_groups of this V1alpha1PolicyRule. 95 :type: list[str] 96 """ 97 98 self._api_groups = api_groups 99 100 @property 101 def non_resource_ur_ls(self): 102 """ 103 Gets the non_resource_ur_ls of this V1alpha1PolicyRule. 104 NonResourceURLs is a set of partial urls that a user should have access 105 to. *s are allowed, but only as the full, final step in the path This 106 name is intentionally different than the internal type so that the 107 DefaultConvert works nicely and because the ordering may be different. 108 Since non-resource URLs are not namespaced, this field is only 109 applicable for ClusterRoles referenced from a ClusterRoleBinding. Rules 110 can either apply to API resources (such as \"pods\" or \"secrets\") or 111 non-resource URL paths (such as \"/api\"), but not both. 112 113 :return: The non_resource_ur_ls of this V1alpha1PolicyRule. 114 :rtype: list[str] 115 """ 116 return self._non_resource_ur_ls 117 118 @non_resource_ur_ls.setter 119 def non_resource_ur_ls(self, non_resource_ur_ls): 120 """ 121 Sets the non_resource_ur_ls of this V1alpha1PolicyRule. 122 NonResourceURLs is a set of partial urls that a user should have access 123 to. *s are allowed, but only as the full, final step in the path This 124 name is intentionally different than the internal type so that the 125 DefaultConvert works nicely and because the ordering may be different. 126 Since non-resource URLs are not namespaced, this field is only 127 applicable for ClusterRoles referenced from a ClusterRoleBinding. Rules 128 can either apply to API resources (such as \"pods\" or \"secrets\") or 129 non-resource URL paths (such as \"/api\"), but not both. 130 131 :param non_resource_ur_ls: The non_resource_ur_ls of this 132 V1alpha1PolicyRule. 133 :type: list[str] 134 """ 135 136 self._non_resource_ur_ls = non_resource_ur_ls 137 138 @property 139 def resource_names(self): 140 """ 141 Gets the resource_names of this V1alpha1PolicyRule. 142 ResourceNames is an optional white list of names that the rule applies 143 to. An empty set means that everything is allowed. 144 145 :return: The resource_names of this V1alpha1PolicyRule. 146 :rtype: list[str] 147 """ 148 return self._resource_names 149 150 @resource_names.setter 151 def resource_names(self, resource_names): 152 """ 153 Sets the resource_names of this V1alpha1PolicyRule. 154 ResourceNames is an optional white list of names that the rule applies 155 to. An empty set means that everything is allowed. 156 157 :param resource_names: The resource_names of this V1alpha1PolicyRule. 158 :type: list[str] 159 """ 160 161 self._resource_names = resource_names 162 163 @property 164 def resources(self): 165 """ 166 Gets the resources of this V1alpha1PolicyRule. 167 Resources is a list of resources this rule applies to. ResourceAll 168 represents all resources. 169 170 :return: The resources of this V1alpha1PolicyRule. 171 :rtype: list[str] 172 """ 173 return self._resources 174 175 @resources.setter 176 def resources(self, resources): 177 """ 178 Sets the resources of this V1alpha1PolicyRule. 179 Resources is a list of resources this rule applies to. ResourceAll 180 represents all resources. 181 182 :param resources: The resources of this V1alpha1PolicyRule. 183 :type: list[str] 184 """ 185 186 self._resources = resources 187 188 @property 189 def verbs(self): 190 """ 191 Gets the verbs of this V1alpha1PolicyRule. 192 Verbs is a list of Verbs that apply to ALL the ResourceKinds and 193 AttributeRestrictions contained in this rule. VerbAll represents all 194 kinds. 195 196 :return: The verbs of this V1alpha1PolicyRule. 197 :rtype: list[str] 198 """ 199 return self._verbs 200 201 @verbs.setter 202 def verbs(self, verbs): 203 """ 204 Sets the verbs of this V1alpha1PolicyRule. 205 Verbs is a list of Verbs that apply to ALL the ResourceKinds and 206 AttributeRestrictions contained in this rule. VerbAll represents all 207 kinds. 208 209 :param verbs: The verbs of this V1alpha1PolicyRule. 210 :type: list[str] 211 """ 212 if verbs is None: 213 raise ValueError('Invalid value for `verbs`, must not be `None`') 214 215 self._verbs = verbs 216 217 def to_dict(self): 218 """ 219 Returns the model properties as a dict 220 """ 221 result = {} 222 223 for attr, _ in iteritems(self.swagger_types): 224 value = getattr(self, attr) 225 if isinstance(value, list): 226 result[attr] = list( 227 map(lambda x: x.to_dict() if hasattr(x, 'to_dict') else x, value)) 228 elif hasattr(value, 'to_dict'): 229 result[attr] = value.to_dict() 230 elif isinstance(value, dict): 231 result[attr] = dict( 232 map( 233 lambda item: (item[0], item[1].to_dict()) 234 if hasattr(item[1], 'to_dict') else item, value.items())) 235 else: 236 result[attr] = value 237 238 return result 239 240 def to_str(self): 241 """ 242 Returns the string representation of the model 243 """ 244 return pformat(self.to_dict()) 245 246 def __repr__(self): 247 """ 248 For `print` and `pprint` 249 """ 250 return self.to_str() 251 252 def __eq__(self, other): 253 """ 254 Returns true if both objects are equal 255 """ 256 if not isinstance(other, V1alpha1PolicyRule): 257 return False 258 259 return self.__dict__ == other.__dict__ 260 261 def __ne__(self, other): 262 """ 263 Returns true if both objects are not equal 264 """ 265 return not self == other 266