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 V1ResourceRule(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 'resource_names': 'list[str]',38 'resources': 'list[str]',39 'verbs': 'list[str]'40 }41 42 attribute_map = {43 'api_groups': 'apiGroups',44 'resource_names': 'resourceNames',45 'resources': 'resources',46 'verbs': 'verbs'47 }48 49 def __init__(self, api_groups=None, resource_names=None, resources=None, verbs=None, local_vars_configuration=None): # noqa: E50150 """V1ResourceRule - a model defined in OpenAPI""" # noqa: E50151 if local_vars_configuration is None:52 local_vars_configuration = Configuration()53 self.local_vars_configuration = local_vars_configuration54 55 self._api_groups = None56 self._resource_names = None57 self._resources = None58 self._verbs = None59 self.discriminator = None60 61 if api_groups is not None:62 self.api_groups = api_groups63 if resource_names is not None:64 self.resource_names = resource_names65 if resources is not None:66 self.resources = resources67 self.verbs = verbs68 69 @property70 def api_groups(self):71 """Gets the api_groups of this V1ResourceRule. # noqa: E50172 73 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. \"*\" means all. # noqa: E50174 75 :return: The api_groups of this V1ResourceRule. # noqa: E50176 :rtype: list[str]77 """78 return self._api_groups79 80 @api_groups.setter81 def api_groups(self, api_groups):82 """Sets the api_groups of this V1ResourceRule.83 84 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. \"*\" means all. # noqa: E50185 86 :param api_groups: The api_groups of this V1ResourceRule. # noqa: E50187 :type: list[str]88 """89 90 self._api_groups = api_groups91 92 @property93 def resource_names(self):94 """Gets the resource_names of this V1ResourceRule. # noqa: E50195 96 ResourceNames is an optional white list of names that the rule applies to. An empty set means that everything is allowed. \"*\" means all. # noqa: E50197 98 :return: The resource_names of this V1ResourceRule. # noqa: E50199 :rtype: list[str]100 """101 return self._resource_names102 103 @resource_names.setter104 def resource_names(self, resource_names):105 """Sets the resource_names of this V1ResourceRule.106 107 ResourceNames is an optional white list of names that the rule applies to. An empty set means that everything is allowed. \"*\" means all. # noqa: E501108 109 :param resource_names: The resource_names of this V1ResourceRule. # noqa: E501110 :type: list[str]111 """112 113 self._resource_names = resource_names114 115 @property116 def resources(self):117 """Gets the resources of this V1ResourceRule. # noqa: E501118 119 Resources is a list of resources this rule applies to. \"*\" means all in the specified apiGroups. \"*/foo\" represents the subresource 'foo' for all resources in the specified apiGroups. # noqa: E501120 121 :return: The resources of this V1ResourceRule. # noqa: E501122 :rtype: list[str]123 """124 return self._resources125 126 @resources.setter127 def resources(self, resources):128 """Sets the resources of this V1ResourceRule.129 130 Resources is a list of resources this rule applies to. \"*\" means all in the specified apiGroups. \"*/foo\" represents the subresource 'foo' for all resources in the specified apiGroups. # noqa: E501131 132 :param resources: The resources of this V1ResourceRule. # noqa: E501133 :type: list[str]134 """135 136 self._resources = resources137 138 @property139 def verbs(self):140 """Gets the verbs of this V1ResourceRule. # noqa: E501141 142 Verb is a list of kubernetes resource API verbs, like: get, list, watch, create, update, delete, proxy. \"*\" means all. # noqa: E501143 144 :return: The verbs of this V1ResourceRule. # noqa: E501145 :rtype: list[str]146 """147 return self._verbs148 149 @verbs.setter150 def verbs(self, verbs):151 """Sets the verbs of this V1ResourceRule.152 153 Verb is a list of kubernetes resource API verbs, like: get, list, watch, create, update, delete, proxy. \"*\" means all. # noqa: E501154 155 :param verbs: The verbs of this V1ResourceRule. # noqa: E501156 :type: list[str]157 """158 if self.local_vars_configuration.client_side_validation and verbs is None: # noqa: E501159 raise ValueError("Invalid value for `verbs`, must not be `None`") # noqa: E501160 161 self._verbs = verbs162 163 def to_dict(self):164 """Returns the model properties as a dict"""165 result = {}166 167 for attr, _ in six.iteritems(self.openapi_types):168 value = getattr(self, attr)169 if isinstance(value, list):170 result[attr] = list(map(171 lambda x: x.to_dict() if hasattr(x, "to_dict") else x,172 value173 ))174 elif hasattr(value, "to_dict"):175 result[attr] = value.to_dict()176 elif isinstance(value, dict):177 result[attr] = dict(map(178 lambda item: (item[0], item[1].to_dict())179 if hasattr(item[1], "to_dict") else item,180 value.items()181 ))182 else:183 result[attr] = value184 185 return result186 187 def to_str(self):188 """Returns the string representation of the model"""189 return pprint.pformat(self.to_dict())190 191 def __repr__(self):192 """For `print` and `pprint`"""193 return self.to_str()194 195 def __eq__(self, other):196 """Returns true if both objects are equal"""197 if not isinstance(other, V1ResourceRule):198 return False199 200 return self.to_dict() == other.to_dict()201 202 def __ne__(self, other):203 """Returns true if both objects are not equal"""204 if not isinstance(other, V1ResourceRule):205 return True206 207 return self.to_dict() != other.to_dict()208 