|
| 1 | +""" |
| 2 | + Groundlight API |
| 3 | +
|
| 4 | + Groundlight makes it simple to understand images. You can easily create computer vision detectors just by describing what you want to know using natural language. # noqa: E501 |
| 5 | +
|
| 6 | + The version of the OpenAPI document: 0.18.2 |
| 7 | + |
| 8 | + Generated by: https://openapi-generator.tech |
| 9 | +""" |
| 10 | + |
| 11 | +import re # noqa: F401 |
| 12 | +import sys # noqa: F401 |
| 13 | + |
| 14 | +from groundlight_openapi_client.model_utils import ( # noqa: F401 |
| 15 | + ApiTypeError, |
| 16 | + ModelComposed, |
| 17 | + ModelNormal, |
| 18 | + ModelSimple, |
| 19 | + cached_property, |
| 20 | + change_keys_js_to_python, |
| 21 | + convert_js_args_to_python_args, |
| 22 | + date, |
| 23 | + datetime, |
| 24 | + file_type, |
| 25 | + none_type, |
| 26 | + validate_get_composed_info, |
| 27 | + OpenApiModel, |
| 28 | +) |
| 29 | +from groundlight_openapi_client.exceptions import ApiAttributeError |
| 30 | + |
| 31 | + |
| 32 | +class BoundingBoxLabelEnum(ModelSimple): |
| 33 | + """NOTE: This class is auto generated by OpenAPI Generator. |
| 34 | + Ref: https://openapi-generator.tech |
| 35 | +
|
| 36 | + Do not edit the class manually. |
| 37 | +
|
| 38 | + Attributes: |
| 39 | + allowed_values (dict): The key is the tuple path to the attribute |
| 40 | + and the for var_name this is (var_name,). The value is a dict |
| 41 | + with a capitalized key describing the allowed value and an allowed |
| 42 | + value. These dicts store the allowed enum values. |
| 43 | + validations (dict): The key is the tuple path to the attribute |
| 44 | + and the for var_name this is (var_name,). The value is a dict |
| 45 | + that stores validations for max_length, min_length, max_items, |
| 46 | + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, |
| 47 | + inclusive_minimum, and regex. |
| 48 | + additional_properties_type (tuple): A tuple of classes accepted |
| 49 | + as additional properties values. |
| 50 | + """ |
| 51 | + |
| 52 | + allowed_values = { |
| 53 | + ("value",): { |
| 54 | + "NO_OBJECTS": "NO_OBJECTS", |
| 55 | + "BOUNDING_BOX": "BOUNDING_BOX", |
| 56 | + "GREATER_THAN_MAX": "GREATER_THAN_MAX", |
| 57 | + "UNCLEAR": "UNCLEAR", |
| 58 | + }, |
| 59 | + } |
| 60 | + |
| 61 | + validations = {} |
| 62 | + |
| 63 | + additional_properties_type = None |
| 64 | + |
| 65 | + _nullable = False |
| 66 | + |
| 67 | + @cached_property |
| 68 | + def openapi_types(): |
| 69 | + """ |
| 70 | + This must be a method because a model may have properties that are |
| 71 | + of type self, this must run after the class is loaded |
| 72 | +
|
| 73 | + Returns |
| 74 | + openapi_types (dict): The key is attribute name |
| 75 | + and the value is attribute type. |
| 76 | + """ |
| 77 | + return { |
| 78 | + "value": (str,), |
| 79 | + } |
| 80 | + |
| 81 | + @cached_property |
| 82 | + def discriminator(): |
| 83 | + return None |
| 84 | + |
| 85 | + attribute_map = {} |
| 86 | + |
| 87 | + read_only_vars = set() |
| 88 | + |
| 89 | + _composed_schemas = None |
| 90 | + |
| 91 | + required_properties = set([ |
| 92 | + "_data_store", |
| 93 | + "_check_type", |
| 94 | + "_spec_property_naming", |
| 95 | + "_path_to_item", |
| 96 | + "_configuration", |
| 97 | + "_visited_composed_classes", |
| 98 | + ]) |
| 99 | + |
| 100 | + @convert_js_args_to_python_args |
| 101 | + def __init__(self, *args, **kwargs): |
| 102 | + """BoundingBoxLabelEnum - a model defined in OpenAPI |
| 103 | +
|
| 104 | + Note that value can be passed either in args or in kwargs, but not in both. |
| 105 | +
|
| 106 | + Args: |
| 107 | + args[0] (str):, must be one of ["NO_OBJECTS", "BOUNDING_BOX", "GREATER_THAN_MAX", "UNCLEAR", ] # noqa: E501 |
| 108 | +
|
| 109 | + Keyword Args: |
| 110 | + value (str):, must be one of ["NO_OBJECTS", "BOUNDING_BOX", "GREATER_THAN_MAX", "UNCLEAR", ] # noqa: E501 |
| 111 | + _check_type (bool): if True, values for parameters in openapi_types |
| 112 | + will be type checked and a TypeError will be |
| 113 | + raised if the wrong type is input. |
| 114 | + Defaults to True |
| 115 | + _path_to_item (tuple/list): This is a list of keys or values to |
| 116 | + drill down to the model in received_data |
| 117 | + when deserializing a response |
| 118 | + _spec_property_naming (bool): True if the variable names in the input data |
| 119 | + are serialized names, as specified in the OpenAPI document. |
| 120 | + False if the variable names in the input data |
| 121 | + are pythonic names, e.g. snake case (default) |
| 122 | + _configuration (Configuration): the instance to use when |
| 123 | + deserializing a file_type parameter. |
| 124 | + If passed, type conversion is attempted |
| 125 | + If omitted no type conversion is done. |
| 126 | + _visited_composed_classes (tuple): This stores a tuple of |
| 127 | + classes that we have traveled through so that |
| 128 | + if we see that class again we will not use its |
| 129 | + discriminator again. |
| 130 | + When traveling through a discriminator, the |
| 131 | + composed schema that is |
| 132 | + is traveled through is added to this set. |
| 133 | + For example if Animal has a discriminator |
| 134 | + petType and we pass in "Dog", and the class Dog |
| 135 | + allOf includes Animal, we move through Animal |
| 136 | + once using the discriminator, and pick Dog. |
| 137 | + Then in Dog, we will make an instance of the |
| 138 | + Animal class but this time we won't travel |
| 139 | + through its discriminator because we passed in |
| 140 | + _visited_composed_classes = (Animal,) |
| 141 | + """ |
| 142 | + # required up here when default value is not given |
| 143 | + _path_to_item = kwargs.pop("_path_to_item", ()) |
| 144 | + |
| 145 | + if "value" in kwargs: |
| 146 | + value = kwargs.pop("value") |
| 147 | + elif args: |
| 148 | + args = list(args) |
| 149 | + value = args.pop(0) |
| 150 | + else: |
| 151 | + raise ApiTypeError( |
| 152 | + "value is required, but not passed in args or kwargs and doesn't have default", |
| 153 | + path_to_item=_path_to_item, |
| 154 | + valid_classes=(self.__class__,), |
| 155 | + ) |
| 156 | + |
| 157 | + _check_type = kwargs.pop("_check_type", True) |
| 158 | + _spec_property_naming = kwargs.pop("_spec_property_naming", False) |
| 159 | + _configuration = kwargs.pop("_configuration", None) |
| 160 | + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) |
| 161 | + |
| 162 | + if args: |
| 163 | + raise ApiTypeError( |
| 164 | + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." |
| 165 | + % ( |
| 166 | + args, |
| 167 | + self.__class__.__name__, |
| 168 | + ), |
| 169 | + path_to_item=_path_to_item, |
| 170 | + valid_classes=(self.__class__,), |
| 171 | + ) |
| 172 | + |
| 173 | + self._data_store = {} |
| 174 | + self._check_type = _check_type |
| 175 | + self._spec_property_naming = _spec_property_naming |
| 176 | + self._path_to_item = _path_to_item |
| 177 | + self._configuration = _configuration |
| 178 | + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) |
| 179 | + self.value = value |
| 180 | + if kwargs: |
| 181 | + raise ApiTypeError( |
| 182 | + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." |
| 183 | + % ( |
| 184 | + kwargs, |
| 185 | + self.__class__.__name__, |
| 186 | + ), |
| 187 | + path_to_item=_path_to_item, |
| 188 | + valid_classes=(self.__class__,), |
| 189 | + ) |
| 190 | + |
| 191 | + @classmethod |
| 192 | + @convert_js_args_to_python_args |
| 193 | + def _from_openapi_data(cls, *args, **kwargs): |
| 194 | + """BoundingBoxLabelEnum - a model defined in OpenAPI |
| 195 | +
|
| 196 | + Note that value can be passed either in args or in kwargs, but not in both. |
| 197 | +
|
| 198 | + Args: |
| 199 | + args[0] (str):, must be one of ["NO_OBJECTS", "BOUNDING_BOX", "GREATER_THAN_MAX", "UNCLEAR", ] # noqa: E501 |
| 200 | +
|
| 201 | + Keyword Args: |
| 202 | + value (str):, must be one of ["NO_OBJECTS", "BOUNDING_BOX", "GREATER_THAN_MAX", "UNCLEAR", ] # noqa: E501 |
| 203 | + _check_type (bool): if True, values for parameters in openapi_types |
| 204 | + will be type checked and a TypeError will be |
| 205 | + raised if the wrong type is input. |
| 206 | + Defaults to True |
| 207 | + _path_to_item (tuple/list): This is a list of keys or values to |
| 208 | + drill down to the model in received_data |
| 209 | + when deserializing a response |
| 210 | + _spec_property_naming (bool): True if the variable names in the input data |
| 211 | + are serialized names, as specified in the OpenAPI document. |
| 212 | + False if the variable names in the input data |
| 213 | + are pythonic names, e.g. snake case (default) |
| 214 | + _configuration (Configuration): the instance to use when |
| 215 | + deserializing a file_type parameter. |
| 216 | + If passed, type conversion is attempted |
| 217 | + If omitted no type conversion is done. |
| 218 | + _visited_composed_classes (tuple): This stores a tuple of |
| 219 | + classes that we have traveled through so that |
| 220 | + if we see that class again we will not use its |
| 221 | + discriminator again. |
| 222 | + When traveling through a discriminator, the |
| 223 | + composed schema that is |
| 224 | + is traveled through is added to this set. |
| 225 | + For example if Animal has a discriminator |
| 226 | + petType and we pass in "Dog", and the class Dog |
| 227 | + allOf includes Animal, we move through Animal |
| 228 | + once using the discriminator, and pick Dog. |
| 229 | + Then in Dog, we will make an instance of the |
| 230 | + Animal class but this time we won't travel |
| 231 | + through its discriminator because we passed in |
| 232 | + _visited_composed_classes = (Animal,) |
| 233 | + """ |
| 234 | + # required up here when default value is not given |
| 235 | + _path_to_item = kwargs.pop("_path_to_item", ()) |
| 236 | + |
| 237 | + self = super(OpenApiModel, cls).__new__(cls) |
| 238 | + |
| 239 | + if "value" in kwargs: |
| 240 | + value = kwargs.pop("value") |
| 241 | + elif args: |
| 242 | + args = list(args) |
| 243 | + value = args.pop(0) |
| 244 | + else: |
| 245 | + raise ApiTypeError( |
| 246 | + "value is required, but not passed in args or kwargs and doesn't have default", |
| 247 | + path_to_item=_path_to_item, |
| 248 | + valid_classes=(self.__class__,), |
| 249 | + ) |
| 250 | + |
| 251 | + _check_type = kwargs.pop("_check_type", True) |
| 252 | + _spec_property_naming = kwargs.pop("_spec_property_naming", False) |
| 253 | + _configuration = kwargs.pop("_configuration", None) |
| 254 | + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) |
| 255 | + |
| 256 | + if args: |
| 257 | + raise ApiTypeError( |
| 258 | + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." |
| 259 | + % ( |
| 260 | + args, |
| 261 | + self.__class__.__name__, |
| 262 | + ), |
| 263 | + path_to_item=_path_to_item, |
| 264 | + valid_classes=(self.__class__,), |
| 265 | + ) |
| 266 | + |
| 267 | + self._data_store = {} |
| 268 | + self._check_type = _check_type |
| 269 | + self._spec_property_naming = _spec_property_naming |
| 270 | + self._path_to_item = _path_to_item |
| 271 | + self._configuration = _configuration |
| 272 | + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) |
| 273 | + self.value = value |
| 274 | + if kwargs: |
| 275 | + raise ApiTypeError( |
| 276 | + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." |
| 277 | + % ( |
| 278 | + kwargs, |
| 279 | + self.__class__.__name__, |
| 280 | + ), |
| 281 | + path_to_item=_path_to_item, |
| 282 | + valid_classes=(self.__class__,), |
| 283 | + ) |
| 284 | + |
| 285 | + return self |
0 commit comments