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 V1ResourcePolicyRule(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 'cluster_scope': 'bool',38 'namespaces': 'list[str]',39 'resources': 'list[str]',40 'verbs': 'list[str]'41 }42 43 attribute_map = {44 'api_groups': 'apiGroups',45 'cluster_scope': 'clusterScope',46 'namespaces': 'namespaces',47 'resources': 'resources',48 'verbs': 'verbs'49 }50 51 def __init__(self, api_groups=None, cluster_scope=None, namespaces=None, resources=None, verbs=None, local_vars_configuration=None): # noqa: E50152 """V1ResourcePolicyRule - 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._cluster_scope = None59 self._namespaces = None60 self._resources = None61 self._verbs = None62 self.discriminator = None63 64 self.api_groups = api_groups65 if cluster_scope is not None:66 self.cluster_scope = cluster_scope67 if namespaces is not None:68 self.namespaces = namespaces69 self.resources = resources70 self.verbs = verbs71 72 @property73 def api_groups(self):74 """Gets the api_groups of this V1ResourcePolicyRule. # noqa: E50175 76 `apiGroups` is a list of matching API groups and may not be empty. \"*\" matches all API groups and, if present, must be the only entry. Required. # noqa: E50177 78 :return: The api_groups of this V1ResourcePolicyRule. # noqa: E50179 :rtype: list[str]80 """81 return self._api_groups82 83 @api_groups.setter84 def api_groups(self, api_groups):85 """Sets the api_groups of this V1ResourcePolicyRule.86 87 `apiGroups` is a list of matching API groups and may not be empty. \"*\" matches all API groups and, if present, must be the only entry. Required. # noqa: E50188 89 :param api_groups: The api_groups of this V1ResourcePolicyRule. # noqa: E50190 :type: list[str]91 """92 if self.local_vars_configuration.client_side_validation and api_groups is None: # noqa: E50193 raise ValueError("Invalid value for `api_groups`, must not be `None`") # noqa: E50194 95 self._api_groups = api_groups96 97 @property98 def cluster_scope(self):99 """Gets the cluster_scope of this V1ResourcePolicyRule. # noqa: E501100 101 `clusterScope` indicates whether to match requests that do not specify a namespace (which happens either because the resource is not namespaced or the request targets all namespaces). If this field is omitted or false then the `namespaces` field must contain a non-empty list. # noqa: E501102 103 :return: The cluster_scope of this V1ResourcePolicyRule. # noqa: E501104 :rtype: bool105 """106 return self._cluster_scope107 108 @cluster_scope.setter109 def cluster_scope(self, cluster_scope):110 """Sets the cluster_scope of this V1ResourcePolicyRule.111 112 `clusterScope` indicates whether to match requests that do not specify a namespace (which happens either because the resource is not namespaced or the request targets all namespaces). If this field is omitted or false then the `namespaces` field must contain a non-empty list. # noqa: E501113 114 :param cluster_scope: The cluster_scope of this V1ResourcePolicyRule. # noqa: E501115 :type: bool116 """117 118 self._cluster_scope = cluster_scope119 120 @property121 def namespaces(self):122 """Gets the namespaces of this V1ResourcePolicyRule. # noqa: E501123 124 `namespaces` is a list of target namespaces that restricts matches. A request that specifies a target namespace matches only if either (a) this list contains that target namespace or (b) this list contains \"*\". Note that \"*\" matches any specified namespace but does not match a request that _does not specify_ a namespace (see the `clusterScope` field for that). This list may be empty, but only if `clusterScope` is true. # noqa: E501125 126 :return: The namespaces of this V1ResourcePolicyRule. # noqa: E501127 :rtype: list[str]128 """129 return self._namespaces130 131 @namespaces.setter132 def namespaces(self, namespaces):133 """Sets the namespaces of this V1ResourcePolicyRule.134 135 `namespaces` is a list of target namespaces that restricts matches. A request that specifies a target namespace matches only if either (a) this list contains that target namespace or (b) this list contains \"*\". Note that \"*\" matches any specified namespace but does not match a request that _does not specify_ a namespace (see the `clusterScope` field for that). This list may be empty, but only if `clusterScope` is true. # noqa: E501136 137 :param namespaces: The namespaces of this V1ResourcePolicyRule. # noqa: E501138 :type: list[str]139 """140 141 self._namespaces = namespaces142 143 @property144 def resources(self):145 """Gets the resources of this V1ResourcePolicyRule. # noqa: E501146 147 `resources` is a list of matching resources (i.e., lowercase and plural) with, if desired, subresource. For example, [ \"services\", \"nodes/status\" ]. This list may not be empty. \"*\" matches all resources and, if present, must be the only entry. Required. # noqa: E501148 149 :return: The resources of this V1ResourcePolicyRule. # noqa: E501150 :rtype: list[str]151 """152 return self._resources153 154 @resources.setter155 def resources(self, resources):156 """Sets the resources of this V1ResourcePolicyRule.157 158 `resources` is a list of matching resources (i.e., lowercase and plural) with, if desired, subresource. For example, [ \"services\", \"nodes/status\" ]. This list may not be empty. \"*\" matches all resources and, if present, must be the only entry. Required. # noqa: E501159 160 :param resources: The resources of this V1ResourcePolicyRule. # noqa: E501161 :type: list[str]162 """163 if self.local_vars_configuration.client_side_validation and resources is None: # noqa: E501164 raise ValueError("Invalid value for `resources`, must not be `None`") # noqa: E501165 166 self._resources = resources167 168 @property169 def verbs(self):170 """Gets the verbs of this V1ResourcePolicyRule. # noqa: E501171 172 `verbs` is a list of matching verbs and may not be empty. \"*\" matches all verbs and, if present, must be the only entry. Required. # noqa: E501173 174 :return: The verbs of this V1ResourcePolicyRule. # noqa: E501175 :rtype: list[str]176 """177 return self._verbs178 179 @verbs.setter180 def verbs(self, verbs):181 """Sets the verbs of this V1ResourcePolicyRule.182 183 `verbs` is a list of matching verbs and may not be empty. \"*\" matches all verbs and, if present, must be the only entry. Required. # noqa: E501184 185 :param verbs: The verbs of this V1ResourcePolicyRule. # noqa: E501186 :type: list[str]187 """188 if self.local_vars_configuration.client_side_validation and verbs is None: # noqa: E501189 raise ValueError("Invalid value for `verbs`, must not be `None`") # noqa: E501190 191 self._verbs = verbs192 193 def to_dict(self):194 """Returns the model properties as a dict"""195 result = {}196 197 for attr, _ in six.iteritems(self.openapi_types):198 value = getattr(self, attr)199 if isinstance(value, list):200 result[attr] = list(map(201 lambda x: x.to_dict() if hasattr(x, "to_dict") else x,202 value203 ))204 elif hasattr(value, "to_dict"):205 result[attr] = value.to_dict()206 elif isinstance(value, dict):207 result[attr] = dict(map(208 lambda item: (item[0], item[1].to_dict())209 if hasattr(item[1], "to_dict") else item,210 value.items()211 ))212 else:213 result[attr] = value214 215 return result216 217 def to_str(self):218 """Returns the string representation of the model"""219 return pprint.pformat(self.to_dict())220 221 def __repr__(self):222 """For `print` and `pprint`"""223 return self.to_str()224 225 def __eq__(self, other):226 """Returns true if both objects are equal"""227 if not isinstance(other, V1ResourcePolicyRule):228 return False229 230 return self.to_dict() == other.to_dict()231 232 def __ne__(self, other):233 """Returns true if both objects are not equal"""234 if not isinstance(other, V1ResourcePolicyRule):235 return True236 237 return self.to_dict() != other.to_dict()238 