github.com/treeverse/lakefs@v1.24.1-0.20240520134607-95648127bfb0/clients/python-legacy/lakefs_client/model/login_config.py (about) 1 """ 2 lakeFS API 3 4 lakeFS HTTP API # noqa: E501 5 6 The version of the OpenAPI document: 1.0.0 7 Contact: services@treeverse.io 8 Generated by: https://openapi-generator.tech 9 """ 10 11 12 import re # noqa: F401 13 import sys # noqa: F401 14 15 from lakefs_client.model_utils import ( # noqa: F401 16 ApiTypeError, 17 ModelComposed, 18 ModelNormal, 19 ModelSimple, 20 cached_property, 21 change_keys_js_to_python, 22 convert_js_args_to_python_args, 23 date, 24 datetime, 25 file_type, 26 none_type, 27 validate_get_composed_info, 28 ) 29 from ..model_utils import OpenApiModel 30 from lakefs_client.exceptions import ApiAttributeError 31 32 33 34 class LoginConfig(ModelNormal): 35 """NOTE: This class is auto generated by OpenAPI Generator. 36 Ref: https://openapi-generator.tech 37 38 Do not edit the class manually. 39 40 Attributes: 41 allowed_values (dict): The key is the tuple path to the attribute 42 and the for var_name this is (var_name,). The value is a dict 43 with a capitalized key describing the allowed value and an allowed 44 value. These dicts store the allowed enum values. 45 attribute_map (dict): The key is attribute name 46 and the value is json key in definition. 47 discriminator_value_class_map (dict): A dict to go from the discriminator 48 variable value to the discriminator class name. 49 validations (dict): The key is the tuple path to the attribute 50 and the for var_name this is (var_name,). The value is a dict 51 that stores validations for max_length, min_length, max_items, 52 min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, 53 inclusive_minimum, and regex. 54 additional_properties_type (tuple): A tuple of classes accepted 55 as additional properties values. 56 """ 57 58 allowed_values = { 59 ('rbac',): { 60 'SIMPLIFIED': "simplified", 61 'EXTERNAL': "external", 62 }, 63 } 64 65 validations = { 66 } 67 68 @cached_property 69 def additional_properties_type(): 70 """ 71 This must be a method because a model may have properties that are 72 of type self, this must run after the class is loaded 73 """ 74 return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 75 76 _nullable = False 77 78 @cached_property 79 def openapi_types(): 80 """ 81 This must be a method because a model may have properties that are 82 of type self, this must run after the class is loaded 83 84 Returns 85 openapi_types (dict): The key is attribute name 86 and the value is attribute type. 87 """ 88 return { 89 'login_url': (str,), # noqa: E501 90 'login_cookie_names': ([str],), # noqa: E501 91 'logout_url': (str,), # noqa: E501 92 'rbac': (str,), # noqa: E501 93 'login_failed_message': (str,), # noqa: E501 94 'fallback_login_url': (str,), # noqa: E501 95 'fallback_login_label': (str,), # noqa: E501 96 } 97 98 @cached_property 99 def discriminator(): 100 return None 101 102 103 attribute_map = { 104 'login_url': 'login_url', # noqa: E501 105 'login_cookie_names': 'login_cookie_names', # noqa: E501 106 'logout_url': 'logout_url', # noqa: E501 107 'rbac': 'RBAC', # noqa: E501 108 'login_failed_message': 'login_failed_message', # noqa: E501 109 'fallback_login_url': 'fallback_login_url', # noqa: E501 110 'fallback_login_label': 'fallback_login_label', # noqa: E501 111 } 112 113 read_only_vars = { 114 } 115 116 _composed_schemas = {} 117 118 @classmethod 119 @convert_js_args_to_python_args 120 def _from_openapi_data(cls, login_url, login_cookie_names, logout_url, *args, **kwargs): # noqa: E501 121 """LoginConfig - a model defined in OpenAPI 122 123 Args: 124 login_url (str): primary URL to use for login. 125 login_cookie_names ([str]): cookie names used to store JWT 126 logout_url (str): URL to use for logging out. 127 128 Keyword Args: 129 _check_type (bool): if True, values for parameters in openapi_types 130 will be type checked and a TypeError will be 131 raised if the wrong type is input. 132 Defaults to True 133 _path_to_item (tuple/list): This is a list of keys or values to 134 drill down to the model in received_data 135 when deserializing a response 136 _spec_property_naming (bool): True if the variable names in the input data 137 are serialized names, as specified in the OpenAPI document. 138 False if the variable names in the input data 139 are pythonic names, e.g. snake case (default) 140 _configuration (Configuration): the instance to use when 141 deserializing a file_type parameter. 142 If passed, type conversion is attempted 143 If omitted no type conversion is done. 144 _visited_composed_classes (tuple): This stores a tuple of 145 classes that we have traveled through so that 146 if we see that class again we will not use its 147 discriminator again. 148 When traveling through a discriminator, the 149 composed schema that is 150 is traveled through is added to this set. 151 For example if Animal has a discriminator 152 petType and we pass in "Dog", and the class Dog 153 allOf includes Animal, we move through Animal 154 once using the discriminator, and pick Dog. 155 Then in Dog, we will make an instance of the 156 Animal class but this time we won't travel 157 through its discriminator because we passed in 158 _visited_composed_classes = (Animal,) 159 rbac (str): RBAC will remain enabled on GUI if \"external\". That only works with an external auth service. . [optional] # noqa: E501 160 login_failed_message (str): message to display to users who fail to login; a full sentence that is rendered in HTML and may contain a link to a secondary login method . [optional] # noqa: E501 161 fallback_login_url (str): secondary URL to offer users to use for login.. [optional] # noqa: E501 162 fallback_login_label (str): label to place on fallback_login_url.. [optional] # noqa: E501 163 """ 164 165 _check_type = kwargs.pop('_check_type', True) 166 _spec_property_naming = kwargs.pop('_spec_property_naming', False) 167 _path_to_item = kwargs.pop('_path_to_item', ()) 168 _configuration = kwargs.pop('_configuration', None) 169 _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) 170 171 self = super(OpenApiModel, cls).__new__(cls) 172 173 if args: 174 raise ApiTypeError( 175 "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( 176 args, 177 self.__class__.__name__, 178 ), 179 path_to_item=_path_to_item, 180 valid_classes=(self.__class__,), 181 ) 182 183 self._data_store = {} 184 self._check_type = _check_type 185 self._spec_property_naming = _spec_property_naming 186 self._path_to_item = _path_to_item 187 self._configuration = _configuration 188 self._visited_composed_classes = _visited_composed_classes + (self.__class__,) 189 190 self.login_url = login_url 191 self.login_cookie_names = login_cookie_names 192 self.logout_url = logout_url 193 for var_name, var_value in kwargs.items(): 194 if var_name not in self.attribute_map and \ 195 self._configuration is not None and \ 196 self._configuration.discard_unknown_keys and \ 197 self.additional_properties_type is None: 198 # discard variable. 199 continue 200 setattr(self, var_name, var_value) 201 return self 202 203 required_properties = set([ 204 '_data_store', 205 '_check_type', 206 '_spec_property_naming', 207 '_path_to_item', 208 '_configuration', 209 '_visited_composed_classes', 210 ]) 211 212 @convert_js_args_to_python_args 213 def __init__(self, login_url, login_cookie_names, logout_url, *args, **kwargs): # noqa: E501 214 """LoginConfig - a model defined in OpenAPI 215 216 Args: 217 login_url (str): primary URL to use for login. 218 login_cookie_names ([str]): cookie names used to store JWT 219 logout_url (str): URL to use for logging out. 220 221 Keyword Args: 222 _check_type (bool): if True, values for parameters in openapi_types 223 will be type checked and a TypeError will be 224 raised if the wrong type is input. 225 Defaults to True 226 _path_to_item (tuple/list): This is a list of keys or values to 227 drill down to the model in received_data 228 when deserializing a response 229 _spec_property_naming (bool): True if the variable names in the input data 230 are serialized names, as specified in the OpenAPI document. 231 False if the variable names in the input data 232 are pythonic names, e.g. snake case (default) 233 _configuration (Configuration): the instance to use when 234 deserializing a file_type parameter. 235 If passed, type conversion is attempted 236 If omitted no type conversion is done. 237 _visited_composed_classes (tuple): This stores a tuple of 238 classes that we have traveled through so that 239 if we see that class again we will not use its 240 discriminator again. 241 When traveling through a discriminator, the 242 composed schema that is 243 is traveled through is added to this set. 244 For example if Animal has a discriminator 245 petType and we pass in "Dog", and the class Dog 246 allOf includes Animal, we move through Animal 247 once using the discriminator, and pick Dog. 248 Then in Dog, we will make an instance of the 249 Animal class but this time we won't travel 250 through its discriminator because we passed in 251 _visited_composed_classes = (Animal,) 252 rbac (str): RBAC will remain enabled on GUI if \"external\". That only works with an external auth service. . [optional] # noqa: E501 253 login_failed_message (str): message to display to users who fail to login; a full sentence that is rendered in HTML and may contain a link to a secondary login method . [optional] # noqa: E501 254 fallback_login_url (str): secondary URL to offer users to use for login.. [optional] # noqa: E501 255 fallback_login_label (str): label to place on fallback_login_url.. [optional] # noqa: E501 256 """ 257 258 _check_type = kwargs.pop('_check_type', True) 259 _spec_property_naming = kwargs.pop('_spec_property_naming', False) 260 _path_to_item = kwargs.pop('_path_to_item', ()) 261 _configuration = kwargs.pop('_configuration', None) 262 _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) 263 264 if args: 265 raise ApiTypeError( 266 "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( 267 args, 268 self.__class__.__name__, 269 ), 270 path_to_item=_path_to_item, 271 valid_classes=(self.__class__,), 272 ) 273 274 self._data_store = {} 275 self._check_type = _check_type 276 self._spec_property_naming = _spec_property_naming 277 self._path_to_item = _path_to_item 278 self._configuration = _configuration 279 self._visited_composed_classes = _visited_composed_classes + (self.__class__,) 280 281 self.login_url = login_url 282 self.login_cookie_names = login_cookie_names 283 self.logout_url = logout_url 284 for var_name, var_value in kwargs.items(): 285 if var_name not in self.attribute_map and \ 286 self._configuration is not None and \ 287 self._configuration.discard_unknown_keys and \ 288 self.additional_properties_type is None: 289 # discard variable. 290 continue 291 setattr(self, var_name, var_value) 292 if var_name in self.read_only_vars: 293 raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " 294 f"class with read only attributes.")