|
| 1 | +""" |
| 2 | + BIMData API |
| 3 | +
|
| 4 | + BIMData API is a tool to interact with your models stored on BIMData’s servers. Through the API, you can manage your projects, the clouds, upload your IFC files and manage them through endpoints. # noqa: E501 |
| 5 | +
|
| 6 | + The version of the OpenAPI document: v1 (v1) |
| 7 | + Contact: support@bimdata.io |
| 8 | + Generated by: https://openapi-generator.tech |
| 9 | +""" |
| 10 | + |
| 11 | + |
| 12 | +import re # noqa: F401 |
| 13 | +import sys # noqa: F401 |
| 14 | + |
| 15 | +from bimdata_api_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 | + OpenApiModel |
| 29 | +) |
| 30 | +from bimdata_api_client.exceptions import ApiAttributeError |
| 31 | + |
| 32 | + |
| 33 | +def lazy_import(): |
| 34 | + from bimdata_api_client.model.user import User |
| 35 | + globals()['User'] = User |
| 36 | + |
| 37 | + |
| 38 | +class UserInvitation(ModelNormal): |
| 39 | + """NOTE: This class is auto generated by OpenAPI Generator. |
| 40 | + Ref: https://openapi-generator.tech |
| 41 | +
|
| 42 | + Do not edit the class manually. |
| 43 | +
|
| 44 | + Attributes: |
| 45 | + allowed_values (dict): The key is the tuple path to the attribute |
| 46 | + and the for var_name this is (var_name,). The value is a dict |
| 47 | + with a capitalized key describing the allowed value and an allowed |
| 48 | + value. These dicts store the allowed enum values. |
| 49 | + attribute_map (dict): The key is attribute name |
| 50 | + and the value is json key in definition. |
| 51 | + discriminator_value_class_map (dict): A dict to go from the discriminator |
| 52 | + variable value to the discriminator class name. |
| 53 | + validations (dict): The key is the tuple path to the attribute |
| 54 | + and the for var_name this is (var_name,). The value is a dict |
| 55 | + that stores validations for max_length, min_length, max_items, |
| 56 | + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, |
| 57 | + inclusive_minimum, and regex. |
| 58 | + additional_properties_type (tuple): A tuple of classes accepted |
| 59 | + as additional properties values. |
| 60 | + """ |
| 61 | + |
| 62 | + allowed_values = { |
| 63 | + ('status',): { |
| 64 | + 'A': "A", |
| 65 | + 'D': "D", |
| 66 | + 'P': "P", |
| 67 | + }, |
| 68 | + } |
| 69 | + |
| 70 | + validations = { |
| 71 | + ('redirect_uri',): { |
| 72 | + 'max_length': 512, |
| 73 | + }, |
| 74 | + } |
| 75 | + |
| 76 | + @cached_property |
| 77 | + def additional_properties_type(): |
| 78 | + """ |
| 79 | + This must be a method because a model may have properties that are |
| 80 | + of type self, this must run after the class is loaded |
| 81 | + """ |
| 82 | + lazy_import() |
| 83 | + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 |
| 84 | + |
| 85 | + _nullable = False |
| 86 | + |
| 87 | + @cached_property |
| 88 | + def openapi_types(): |
| 89 | + """ |
| 90 | + This must be a method because a model may have properties that are |
| 91 | + of type self, this must run after the class is loaded |
| 92 | +
|
| 93 | + Returns |
| 94 | + openapi_types (dict): The key is attribute name |
| 95 | + and the value is attribute type. |
| 96 | + """ |
| 97 | + lazy_import() |
| 98 | + return { |
| 99 | + 'id': (int,), # noqa: E501 |
| 100 | + 'redirect_uri': (str,), # noqa: E501 |
| 101 | + 'cloud_name': (str,), # noqa: E501 |
| 102 | + 'sender': (User,), # noqa: E501 |
| 103 | + 'project_name': (str,), # noqa: E501 |
| 104 | + 'status': (str,), # noqa: E501 |
| 105 | + } |
| 106 | + |
| 107 | + @cached_property |
| 108 | + def discriminator(): |
| 109 | + return None |
| 110 | + |
| 111 | + |
| 112 | + attribute_map = { |
| 113 | + 'id': 'id', # noqa: E501 |
| 114 | + 'redirect_uri': 'redirect_uri', # noqa: E501 |
| 115 | + 'cloud_name': 'cloud_name', # noqa: E501 |
| 116 | + 'sender': 'sender', # noqa: E501 |
| 117 | + 'project_name': 'project_name', # noqa: E501 |
| 118 | + 'status': 'status', # noqa: E501 |
| 119 | + } |
| 120 | + |
| 121 | + read_only_vars = { |
| 122 | + 'id', # noqa: E501 |
| 123 | + } |
| 124 | + |
| 125 | + _composed_schemas = {} |
| 126 | + |
| 127 | + @classmethod |
| 128 | + @convert_js_args_to_python_args |
| 129 | + def _from_openapi_data(cls, id, redirect_uri, cloud_name, sender, *args, **kwargs): # noqa: E501 |
| 130 | + """UserInvitation - a model defined in OpenAPI |
| 131 | +
|
| 132 | + Args: |
| 133 | + id (int): |
| 134 | + redirect_uri (str): User will be redirected to this uri when they accept the invitation |
| 135 | + cloud_name (str): |
| 136 | + sender (User): |
| 137 | +
|
| 138 | + Keyword Args: |
| 139 | + _check_type (bool): if True, values for parameters in openapi_types |
| 140 | + will be type checked and a TypeError will be |
| 141 | + raised if the wrong type is input. |
| 142 | + Defaults to True |
| 143 | + _path_to_item (tuple/list): This is a list of keys or values to |
| 144 | + drill down to the model in received_data |
| 145 | + when deserializing a response |
| 146 | + _spec_property_naming (bool): True if the variable names in the input data |
| 147 | + are serialized names, as specified in the OpenAPI document. |
| 148 | + False if the variable names in the input data |
| 149 | + are pythonic names, e.g. snake case (default) |
| 150 | + _configuration (Configuration): the instance to use when |
| 151 | + deserializing a file_type parameter. |
| 152 | + If passed, type conversion is attempted |
| 153 | + If omitted no type conversion is done. |
| 154 | + _visited_composed_classes (tuple): This stores a tuple of |
| 155 | + classes that we have traveled through so that |
| 156 | + if we see that class again we will not use its |
| 157 | + discriminator again. |
| 158 | + When traveling through a discriminator, the |
| 159 | + composed schema that is |
| 160 | + is traveled through is added to this set. |
| 161 | + For example if Animal has a discriminator |
| 162 | + petType and we pass in "Dog", and the class Dog |
| 163 | + allOf includes Animal, we move through Animal |
| 164 | + once using the discriminator, and pick Dog. |
| 165 | + Then in Dog, we will make an instance of the |
| 166 | + Animal class but this time we won't travel |
| 167 | + through its discriminator because we passed in |
| 168 | + _visited_composed_classes = (Animal,) |
| 169 | + project_name (str): [optional] # noqa: E501 |
| 170 | + status (str): A: Accepted D: Denied P: Pending . [optional] # noqa: E501 |
| 171 | + """ |
| 172 | + |
| 173 | + _check_type = kwargs.pop('_check_type', True) |
| 174 | + _spec_property_naming = kwargs.pop('_spec_property_naming', False) |
| 175 | + _path_to_item = kwargs.pop('_path_to_item', ()) |
| 176 | + _configuration = kwargs.pop('_configuration', None) |
| 177 | + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) |
| 178 | + |
| 179 | + self = super(OpenApiModel, cls).__new__(cls) |
| 180 | + |
| 181 | + if args: |
| 182 | + raise ApiTypeError( |
| 183 | + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( |
| 184 | + args, |
| 185 | + self.__class__.__name__, |
| 186 | + ), |
| 187 | + path_to_item=_path_to_item, |
| 188 | + valid_classes=(self.__class__,), |
| 189 | + ) |
| 190 | + |
| 191 | + self._data_store = {} |
| 192 | + self._check_type = _check_type |
| 193 | + self._spec_property_naming = _spec_property_naming |
| 194 | + self._path_to_item = _path_to_item |
| 195 | + self._configuration = _configuration |
| 196 | + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) |
| 197 | + |
| 198 | + self.id = id |
| 199 | + self.redirect_uri = redirect_uri |
| 200 | + self.cloud_name = cloud_name |
| 201 | + self.sender = sender |
| 202 | + for var_name, var_value in kwargs.items(): |
| 203 | + if var_name not in self.attribute_map and \ |
| 204 | + self._configuration is not None and \ |
| 205 | + self._configuration.discard_unknown_keys and \ |
| 206 | + self.additional_properties_type is None: |
| 207 | + # discard variable. |
| 208 | + continue |
| 209 | + setattr(self, var_name, var_value) |
| 210 | + return self |
| 211 | + |
| 212 | + required_properties = set([ |
| 213 | + '_data_store', |
| 214 | + '_check_type', |
| 215 | + '_spec_property_naming', |
| 216 | + '_path_to_item', |
| 217 | + '_configuration', |
| 218 | + '_visited_composed_classes', |
| 219 | + ]) |
| 220 | + |
| 221 | + @convert_js_args_to_python_args |
| 222 | + def __init__(self, redirect_uri, cloud_name, sender, *args, **kwargs): # noqa: E501 |
| 223 | + """UserInvitation - a model defined in OpenAPI |
| 224 | +
|
| 225 | + redirect_uri (str): User will be redirected to this uri when they accept the invitation |
| 226 | + cloud_name (str): |
| 227 | + sender (User): |
| 228 | +
|
| 229 | + Keyword Args: |
| 230 | + _check_type (bool): if True, values for parameters in openapi_types |
| 231 | + will be type checked and a TypeError will be |
| 232 | + raised if the wrong type is input. |
| 233 | + Defaults to True |
| 234 | + _path_to_item (tuple/list): This is a list of keys or values to |
| 235 | + drill down to the model in received_data |
| 236 | + when deserializing a response |
| 237 | + _spec_property_naming (bool): True if the variable names in the input data |
| 238 | + are serialized names, as specified in the OpenAPI document. |
| 239 | + False if the variable names in the input data |
| 240 | + are pythonic names, e.g. snake case (default) |
| 241 | + _configuration (Configuration): the instance to use when |
| 242 | + deserializing a file_type parameter. |
| 243 | + If passed, type conversion is attempted |
| 244 | + If omitted no type conversion is done. |
| 245 | + _visited_composed_classes (tuple): This stores a tuple of |
| 246 | + classes that we have traveled through so that |
| 247 | + if we see that class again we will not use its |
| 248 | + discriminator again. |
| 249 | + When traveling through a discriminator, the |
| 250 | + composed schema that is |
| 251 | + is traveled through is added to this set. |
| 252 | + For example if Animal has a discriminator |
| 253 | + petType and we pass in "Dog", and the class Dog |
| 254 | + allOf includes Animal, we move through Animal |
| 255 | + once using the discriminator, and pick Dog. |
| 256 | + Then in Dog, we will make an instance of the |
| 257 | + Animal class but this time we won't travel |
| 258 | + through its discriminator because we passed in |
| 259 | + _visited_composed_classes = (Animal,) |
| 260 | + project_name (str): [optional] # noqa: E501 |
| 261 | + status (str): A: Accepted D: Denied P: Pending . [optional] # noqa: E501 |
| 262 | + """ |
| 263 | + |
| 264 | + _check_type = kwargs.pop('_check_type', True) |
| 265 | + _spec_property_naming = kwargs.pop('_spec_property_naming', False) |
| 266 | + _path_to_item = kwargs.pop('_path_to_item', ()) |
| 267 | + _configuration = kwargs.pop('_configuration', None) |
| 268 | + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) |
| 269 | + |
| 270 | + if args: |
| 271 | + raise ApiTypeError( |
| 272 | + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( |
| 273 | + args, |
| 274 | + self.__class__.__name__, |
| 275 | + ), |
| 276 | + path_to_item=_path_to_item, |
| 277 | + valid_classes=(self.__class__,), |
| 278 | + ) |
| 279 | + |
| 280 | + self._data_store = {} |
| 281 | + self._check_type = _check_type |
| 282 | + self._spec_property_naming = _spec_property_naming |
| 283 | + self._path_to_item = _path_to_item |
| 284 | + self._configuration = _configuration |
| 285 | + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) |
| 286 | + |
| 287 | + self.redirect_uri = redirect_uri |
| 288 | + self.cloud_name = cloud_name |
| 289 | + self.sender = sender |
| 290 | + for var_name, var_value in kwargs.items(): |
| 291 | + if var_name not in self.attribute_map and \ |
| 292 | + self._configuration is not None and \ |
| 293 | + self._configuration.discard_unknown_keys and \ |
| 294 | + self.additional_properties_type is None: |
| 295 | + # discard variable. |
| 296 | + continue |
| 297 | + setattr(self, var_name, var_value) |
| 298 | + if var_name in self.read_only_vars: |
| 299 | + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " |
| 300 | + f"class with read only attributes.") |
0 commit comments