diff --git a/generated/.openapi-generator/FILES b/generated/.openapi-generator/FILES index c6bdc7b8..07eb726b 100644 --- a/generated/.openapi-generator/FILES +++ b/generated/.openapi-generator/FILES @@ -36,6 +36,7 @@ docs/InlineResponse2001EvaluationResults.md docs/InlineResponse2002.md docs/InlineResponse200Summary.md docs/InlineResponse200SummaryClassCounts.md +docs/Label.md docs/LabelValue.md docs/LabelValueRequest.md docs/LabelsApi.md @@ -57,6 +58,7 @@ docs/ResultTypeEnum.md docs/Rule.md docs/RuleRequest.md docs/SnoozeTimeUnitEnum.md +docs/Source.md docs/SourceEnum.md docs/StatusEnum.md docs/TextModeConfiguration.md @@ -112,6 +114,7 @@ groundlight_openapi_client/model/inline_response2001_evaluation_results.py groundlight_openapi_client/model/inline_response2002.py groundlight_openapi_client/model/inline_response200_summary.py groundlight_openapi_client/model/inline_response200_summary_class_counts.py +groundlight_openapi_client/model/label.py groundlight_openapi_client/model/label_value.py groundlight_openapi_client/model/label_value_request.py groundlight_openapi_client/model/mode_enum.py @@ -131,6 +134,7 @@ groundlight_openapi_client/model/roi_request.py groundlight_openapi_client/model/rule.py groundlight_openapi_client/model/rule_request.py groundlight_openapi_client/model/snooze_time_unit_enum.py +groundlight_openapi_client/model/source.py groundlight_openapi_client/model/source_enum.py groundlight_openapi_client/model/status_enum.py groundlight_openapi_client/model/text_mode_configuration.py @@ -146,4 +150,6 @@ setup.cfg setup.py test-requirements.txt test/__init__.py +test/test_label.py +test/test_source.py tox.ini diff --git a/generated/README.md b/generated/README.md index 086d2c24..f82c9211 100644 --- a/generated/README.md +++ b/generated/README.md @@ -174,6 +174,7 @@ Class | Method | HTTP request | Description - [InlineResponse2002](docs/InlineResponse2002.md) - [InlineResponse200Summary](docs/InlineResponse200Summary.md) - [InlineResponse200SummaryClassCounts](docs/InlineResponse200SummaryClassCounts.md) + - [Label](docs/Label.md) - [LabelValue](docs/LabelValue.md) - [LabelValueRequest](docs/LabelValueRequest.md) - [ModeEnum](docs/ModeEnum.md) @@ -193,6 +194,7 @@ Class | Method | HTTP request | Description - [Rule](docs/Rule.md) - [RuleRequest](docs/RuleRequest.md) - [SnoozeTimeUnitEnum](docs/SnoozeTimeUnitEnum.md) + - [Source](docs/Source.md) - [SourceEnum](docs/SourceEnum.md) - [StatusEnum](docs/StatusEnum.md) - [TextModeConfiguration](docs/TextModeConfiguration.md) diff --git a/generated/docs/BinaryClassificationResult.md b/generated/docs/BinaryClassificationResult.md index 0ddc4f9e..a98a3b70 100644 --- a/generated/docs/BinaryClassificationResult.md +++ b/generated/docs/BinaryClassificationResult.md @@ -7,7 +7,7 @@ Name | Type | Description | Notes **label** | **str** | | **confidence** | **float, none_type** | | [optional] **source** | **str** | | [optional] -**result_type** | **str** | | [optional] +**result_type** | **str** | | [optional] if omitted the server will use the default value of "binary_classification" **from_edge** | **bool** | | [optional] **any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] diff --git a/generated/docs/BoundingBoxResult.md b/generated/docs/BoundingBoxResult.md index aab5d925..7a089d95 100644 --- a/generated/docs/BoundingBoxResult.md +++ b/generated/docs/BoundingBoxResult.md @@ -7,7 +7,7 @@ Name | Type | Description | Notes **label** | **str** | | **confidence** | **float, none_type** | | [optional] **source** | **str** | | [optional] -**result_type** | **str** | | [optional] +**result_type** | **str** | | [optional] if omitted the server will use the default value of "bounding_box" **from_edge** | **bool** | | [optional] **any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] diff --git a/generated/docs/CountingResult.md b/generated/docs/CountingResult.md index deb8cbe6..f9db3d5d 100644 --- a/generated/docs/CountingResult.md +++ b/generated/docs/CountingResult.md @@ -7,7 +7,7 @@ Name | Type | Description | Notes **count** | **int, none_type** | | **confidence** | **float, none_type** | | [optional] **source** | **str** | | [optional] -**result_type** | **str** | | [optional] +**result_type** | **str** | | [optional] if omitted the server will use the default value of "counting" **from_edge** | **bool** | | [optional] **greater_than_max** | **bool** | | [optional] **any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] diff --git a/generated/docs/Label.md b/generated/docs/Label.md new file mode 100644 index 00000000..8e75ee67 --- /dev/null +++ b/generated/docs/Label.md @@ -0,0 +1,11 @@ +# Label + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**value** | **str** | | must be one of ["YES", "NO", "UNCLEAR", ] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/generated/docs/MultiClassificationResult.md b/generated/docs/MultiClassificationResult.md index 04aad82f..d048a5da 100644 --- a/generated/docs/MultiClassificationResult.md +++ b/generated/docs/MultiClassificationResult.md @@ -7,7 +7,7 @@ Name | Type | Description | Notes **label** | **str** | | **confidence** | **float, none_type** | | [optional] **source** | **str** | | [optional] -**result_type** | **str** | | [optional] +**result_type** | **str** | | [optional] if omitted the server will use the default value of "multi_classification" **from_edge** | **bool** | | [optional] **any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] diff --git a/generated/docs/Source.md b/generated/docs/Source.md new file mode 100644 index 00000000..fa6f1066 --- /dev/null +++ b/generated/docs/Source.md @@ -0,0 +1,11 @@ +# Source + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**value** | **str** | | must be one of ["STILL_PROCESSING", "CLOUD", "USER", "CLOUD_ENSEMBLE", "ALGORITHM", "EDGE", ] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/generated/docs/TextRecognitionResult.md b/generated/docs/TextRecognitionResult.md index 736bec34..f518a26b 100644 --- a/generated/docs/TextRecognitionResult.md +++ b/generated/docs/TextRecognitionResult.md @@ -8,7 +8,7 @@ Name | Type | Description | Notes **truncated** | **bool** | | **confidence** | **float, none_type** | | [optional] **source** | **str** | | [optional] -**result_type** | **str** | | [optional] +**result_type** | **str** | | [optional] if omitted the server will use the default value of "text_recognition" **from_edge** | **bool** | | [optional] **any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] diff --git a/generated/groundlight_openapi_client/model/binary_classification_result.py b/generated/groundlight_openapi_client/model/binary_classification_result.py index 605685dc..018a6f3e 100644 --- a/generated/groundlight_openapi_client/model/binary_classification_result.py +++ b/generated/groundlight_openapi_client/model/binary_classification_result.py @@ -53,7 +53,11 @@ class BinaryClassificationResult(ModelNormal): as additional properties values. """ - allowed_values = {} + allowed_values = { + ("result_type",): { + "BINARY_CLASSIFICATION": "binary_classification", + }, + } validations = { ("confidence",): { @@ -160,7 +164,7 @@ def _from_openapi_data(cls, label, *args, **kwargs): # noqa: E501 _visited_composed_classes = (Animal,) confidence (float, none_type): [optional] # noqa: E501 source (str): [optional] # noqa: E501 - result_type (str): [optional] # noqa: E501 + result_type (str): [optional] if omitted the server will use the default value of "binary_classification" # noqa: E501 from_edge (bool): [optional] # noqa: E501 """ @@ -252,7 +256,7 @@ def __init__(self, label, *args, **kwargs): # noqa: E501 _visited_composed_classes = (Animal,) confidence (float, none_type): [optional] # noqa: E501 source (str): [optional] # noqa: E501 - result_type (str): [optional] # noqa: E501 + result_type (str): [optional] if omitted the server will use the default value of "binary_classification" # noqa: E501 from_edge (bool): [optional] # noqa: E501 """ diff --git a/generated/groundlight_openapi_client/model/bounding_box_result.py b/generated/groundlight_openapi_client/model/bounding_box_result.py index be4daaba..8fc4c417 100644 --- a/generated/groundlight_openapi_client/model/bounding_box_result.py +++ b/generated/groundlight_openapi_client/model/bounding_box_result.py @@ -53,7 +53,11 @@ class BoundingBoxResult(ModelNormal): as additional properties values. """ - allowed_values = {} + allowed_values = { + ("result_type",): { + "BOUNDING_BOX": "bounding_box", + }, + } validations = { ("confidence",): { @@ -160,7 +164,7 @@ def _from_openapi_data(cls, label, *args, **kwargs): # noqa: E501 _visited_composed_classes = (Animal,) confidence (float, none_type): [optional] # noqa: E501 source (str): [optional] # noqa: E501 - result_type (str): [optional] # noqa: E501 + result_type (str): [optional] if omitted the server will use the default value of "bounding_box" # noqa: E501 from_edge (bool): [optional] # noqa: E501 """ @@ -252,7 +256,7 @@ def __init__(self, label, *args, **kwargs): # noqa: E501 _visited_composed_classes = (Animal,) confidence (float, none_type): [optional] # noqa: E501 source (str): [optional] # noqa: E501 - result_type (str): [optional] # noqa: E501 + result_type (str): [optional] if omitted the server will use the default value of "bounding_box" # noqa: E501 from_edge (bool): [optional] # noqa: E501 """ diff --git a/generated/groundlight_openapi_client/model/counting_result.py b/generated/groundlight_openapi_client/model/counting_result.py index 08d2f6db..85e692e5 100644 --- a/generated/groundlight_openapi_client/model/counting_result.py +++ b/generated/groundlight_openapi_client/model/counting_result.py @@ -53,7 +53,11 @@ class CountingResult(ModelNormal): as additional properties values. """ - allowed_values = {} + allowed_values = { + ("result_type",): { + "COUNTING": "counting", + }, + } validations = { ("count",): { @@ -168,7 +172,7 @@ def _from_openapi_data(cls, count, *args, **kwargs): # noqa: E501 _visited_composed_classes = (Animal,) confidence (float, none_type): [optional] # noqa: E501 source (str): [optional] # noqa: E501 - result_type (str): [optional] # noqa: E501 + result_type (str): [optional] if omitted the server will use the default value of "counting" # noqa: E501 from_edge (bool): [optional] # noqa: E501 greater_than_max (bool): [optional] # noqa: E501 """ @@ -261,7 +265,7 @@ def __init__(self, count, *args, **kwargs): # noqa: E501 _visited_composed_classes = (Animal,) confidence (float, none_type): [optional] # noqa: E501 source (str): [optional] # noqa: E501 - result_type (str): [optional] # noqa: E501 + result_type (str): [optional] if omitted the server will use the default value of "counting" # noqa: E501 from_edge (bool): [optional] # noqa: E501 greater_than_max (bool): [optional] # noqa: E501 """ diff --git a/generated/groundlight_openapi_client/model/label.py b/generated/groundlight_openapi_client/model/label.py new file mode 100644 index 00000000..810b9e2e --- /dev/null +++ b/generated/groundlight_openapi_client/model/label.py @@ -0,0 +1,284 @@ +""" + Groundlight API + + 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 + + The version of the OpenAPI document: 0.18.2 + Contact: support@groundlight.ai + Generated by: https://openapi-generator.tech +""" + +import re # noqa: F401 +import sys # noqa: F401 + +from groundlight_openapi_client.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel, +) +from groundlight_openapi_client.exceptions import ApiAttributeError + + +class Label(ModelSimple): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + ("value",): { + "YES": "YES", + "NO": "NO", + "UNCLEAR": "UNCLEAR", + }, + } + + validations = {} + + additional_properties_type = None + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + "value": (str,), + } + + @cached_property + def discriminator(): + return None + + attribute_map = {} + + read_only_vars = set() + + _composed_schemas = None + + required_properties = set([ + "_data_store", + "_check_type", + "_spec_property_naming", + "_path_to_item", + "_configuration", + "_visited_composed_classes", + ]) + + @convert_js_args_to_python_args + def __init__(self, *args, **kwargs): + """Label - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (str):, must be one of ["YES", "NO", "UNCLEAR", ] # noqa: E501 + + Keyword Args: + value (str):, must be one of ["YES", "NO", "UNCLEAR", ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop("_path_to_item", ()) + + if "value" in kwargs: + value = kwargs.pop("value") + elif args: + args = list(args) + value = args.pop(0) + else: + raise ApiTypeError( + "value is required, but not passed in args or kwargs and doesn't have default", + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." + % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): + """Label - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (str):, must be one of ["YES", "NO", "UNCLEAR", ] # noqa: E501 + + Keyword Args: + value (str):, must be one of ["YES", "NO", "UNCLEAR", ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop("_path_to_item", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if "value" in kwargs: + value = kwargs.pop("value") + elif args: + args = list(args) + value = args.pop(0) + else: + raise ApiTypeError( + "value is required, but not passed in args or kwargs and doesn't have default", + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." + % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + return self diff --git a/generated/groundlight_openapi_client/model/multi_classification_result.py b/generated/groundlight_openapi_client/model/multi_classification_result.py index 798c1615..bfc778c5 100644 --- a/generated/groundlight_openapi_client/model/multi_classification_result.py +++ b/generated/groundlight_openapi_client/model/multi_classification_result.py @@ -53,7 +53,11 @@ class MultiClassificationResult(ModelNormal): as additional properties values. """ - allowed_values = {} + allowed_values = { + ("result_type",): { + "MULTI_CLASSIFICATION": "multi_classification", + }, + } validations = { ("confidence",): { @@ -160,7 +164,7 @@ def _from_openapi_data(cls, label, *args, **kwargs): # noqa: E501 _visited_composed_classes = (Animal,) confidence (float, none_type): [optional] # noqa: E501 source (str): [optional] # noqa: E501 - result_type (str): [optional] # noqa: E501 + result_type (str): [optional] if omitted the server will use the default value of "multi_classification" # noqa: E501 from_edge (bool): [optional] # noqa: E501 """ @@ -252,7 +256,7 @@ def __init__(self, label, *args, **kwargs): # noqa: E501 _visited_composed_classes = (Animal,) confidence (float, none_type): [optional] # noqa: E501 source (str): [optional] # noqa: E501 - result_type (str): [optional] # noqa: E501 + result_type (str): [optional] if omitted the server will use the default value of "multi_classification" # noqa: E501 from_edge (bool): [optional] # noqa: E501 """ diff --git a/generated/groundlight_openapi_client/model/source.py b/generated/groundlight_openapi_client/model/source.py new file mode 100644 index 00000000..7e3e832a --- /dev/null +++ b/generated/groundlight_openapi_client/model/source.py @@ -0,0 +1,287 @@ +""" + Groundlight API + + 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 + + The version of the OpenAPI document: 0.18.2 + Contact: support@groundlight.ai + Generated by: https://openapi-generator.tech +""" + +import re # noqa: F401 +import sys # noqa: F401 + +from groundlight_openapi_client.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel, +) +from groundlight_openapi_client.exceptions import ApiAttributeError + + +class Source(ModelSimple): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + ("value",): { + "STILL_PROCESSING": "STILL_PROCESSING", + "CLOUD": "CLOUD", + "USER": "USER", + "CLOUD_ENSEMBLE": "CLOUD_ENSEMBLE", + "ALGORITHM": "ALGORITHM", + "EDGE": "EDGE", + }, + } + + validations = {} + + additional_properties_type = None + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + "value": (str,), + } + + @cached_property + def discriminator(): + return None + + attribute_map = {} + + read_only_vars = set() + + _composed_schemas = None + + required_properties = set([ + "_data_store", + "_check_type", + "_spec_property_naming", + "_path_to_item", + "_configuration", + "_visited_composed_classes", + ]) + + @convert_js_args_to_python_args + def __init__(self, *args, **kwargs): + """Source - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (str):, must be one of ["STILL_PROCESSING", "CLOUD", "USER", "CLOUD_ENSEMBLE", "ALGORITHM", "EDGE", ] # noqa: E501 + + Keyword Args: + value (str):, must be one of ["STILL_PROCESSING", "CLOUD", "USER", "CLOUD_ENSEMBLE", "ALGORITHM", "EDGE", ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop("_path_to_item", ()) + + if "value" in kwargs: + value = kwargs.pop("value") + elif args: + args = list(args) + value = args.pop(0) + else: + raise ApiTypeError( + "value is required, but not passed in args or kwargs and doesn't have default", + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." + % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): + """Source - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (str):, must be one of ["STILL_PROCESSING", "CLOUD", "USER", "CLOUD_ENSEMBLE", "ALGORITHM", "EDGE", ] # noqa: E501 + + Keyword Args: + value (str):, must be one of ["STILL_PROCESSING", "CLOUD", "USER", "CLOUD_ENSEMBLE", "ALGORITHM", "EDGE", ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop("_path_to_item", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if "value" in kwargs: + value = kwargs.pop("value") + elif args: + args = list(args) + value = args.pop(0) + else: + raise ApiTypeError( + "value is required, but not passed in args or kwargs and doesn't have default", + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." + % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + return self diff --git a/generated/groundlight_openapi_client/model/text_recognition_result.py b/generated/groundlight_openapi_client/model/text_recognition_result.py index e0937650..0e769567 100644 --- a/generated/groundlight_openapi_client/model/text_recognition_result.py +++ b/generated/groundlight_openapi_client/model/text_recognition_result.py @@ -53,7 +53,11 @@ class TextRecognitionResult(ModelNormal): as additional properties values. """ - allowed_values = {} + allowed_values = { + ("result_type",): { + "TEXT_RECOGNITION": "text_recognition", + }, + } validations = { ("confidence",): { @@ -166,7 +170,7 @@ def _from_openapi_data(cls, text, truncated, *args, **kwargs): # noqa: E501 _visited_composed_classes = (Animal,) confidence (float, none_type): [optional] # noqa: E501 source (str): [optional] # noqa: E501 - result_type (str): [optional] # noqa: E501 + result_type (str): [optional] if omitted the server will use the default value of "text_recognition" # noqa: E501 from_edge (bool): [optional] # noqa: E501 """ @@ -260,7 +264,7 @@ def __init__(self, text, truncated, *args, **kwargs): # noqa: E501 _visited_composed_classes = (Animal,) confidence (float, none_type): [optional] # noqa: E501 source (str): [optional] # noqa: E501 - result_type (str): [optional] # noqa: E501 + result_type (str): [optional] if omitted the server will use the default value of "text_recognition" # noqa: E501 from_edge (bool): [optional] # noqa: E501 """ diff --git a/generated/groundlight_openapi_client/models/__init__.py b/generated/groundlight_openapi_client/models/__init__.py index 705cc1c0..16412577 100644 --- a/generated/groundlight_openapi_client/models/__init__.py +++ b/generated/groundlight_openapi_client/models/__init__.py @@ -39,6 +39,7 @@ from groundlight_openapi_client.model.inline_response2002 import InlineResponse2002 from groundlight_openapi_client.model.inline_response200_summary import InlineResponse200Summary from groundlight_openapi_client.model.inline_response200_summary_class_counts import InlineResponse200SummaryClassCounts +from groundlight_openapi_client.model.label import Label from groundlight_openapi_client.model.label_value import LabelValue from groundlight_openapi_client.model.label_value_request import LabelValueRequest from groundlight_openapi_client.model.mode_enum import ModeEnum @@ -58,6 +59,7 @@ from groundlight_openapi_client.model.rule import Rule from groundlight_openapi_client.model.rule_request import RuleRequest from groundlight_openapi_client.model.snooze_time_unit_enum import SnoozeTimeUnitEnum +from groundlight_openapi_client.model.source import Source from groundlight_openapi_client.model.source_enum import SourceEnum from groundlight_openapi_client.model.status_enum import StatusEnum from groundlight_openapi_client.model.text_mode_configuration import TextModeConfiguration diff --git a/generated/model.py b/generated/model.py index 8050326e..dc6348b8 100644 --- a/generated/model.py +++ b/generated/model.py @@ -1,6 +1,6 @@ # generated by datamodel-codegen: # filename: public-api.yaml -# timestamp: 2025-04-28T16:12:43+00:00 +# timestamp: 2025-05-06T17:51:03+00:00 from __future__ import annotations @@ -179,44 +179,64 @@ class WebhookActionRequest(BaseModel): last_failed_at: Optional[datetime] = None +class ResultType(Enum): + binary_classification = "binary_classification" + + class BinaryClassificationResult(BaseModel): confidence: Optional[confloat(ge=0.0, le=1.0)] = None source: Optional[str] = None - result_type: Optional[str] = None + result_type: Optional[ResultType] = None from_edge: Optional[bool] = None label: str +class ResultType2(Enum): + counting = "counting" + + class CountingResult(BaseModel): confidence: Optional[confloat(ge=0.0, le=1.0)] = None source: Optional[str] = None - result_type: Optional[str] = None + result_type: Optional[ResultType2] = None from_edge: Optional[bool] = None count: Optional[conint(ge=0)] = Field(...) greater_than_max: Optional[bool] = None +class ResultType3(Enum): + multi_classification = "multi_classification" + + class MultiClassificationResult(BaseModel): confidence: Optional[confloat(ge=0.0, le=1.0)] = None source: Optional[str] = None - result_type: Optional[str] = None + result_type: Optional[ResultType3] = None from_edge: Optional[bool] = None label: str +class ResultType4(Enum): + text_recognition = "text_recognition" + + class TextRecognitionResult(BaseModel): confidence: Optional[confloat(ge=0.0, le=1.0)] = None source: Optional[str] = None - result_type: Optional[str] = None + result_type: Optional[ResultType4] = None from_edge: Optional[bool] = None text: Optional[str] = Field(...) truncated: bool +class ResultType5(Enum): + bounding_box = "bounding_box" + + class BoundingBoxResult(BaseModel): confidence: Optional[confloat(ge=0.0, le=1.0)] = None source: Optional[str] = None - result_type: Optional[str] = None + result_type: Optional[ResultType5] = None from_edge: Optional[bool] = None label: str @@ -284,6 +304,21 @@ class VerbEnum(str, Enum): NO_QUERIES = "NO_QUERIES" +class Source(str, Enum): + STILL_PROCESSING = "STILL_PROCESSING" + CLOUD = "CLOUD" + USER = "USER" + CLOUD_ENSEMBLE = "CLOUD_ENSEMBLE" + ALGORITHM = "ALGORITHM" + EDGE = "EDGE" + + +class Label(str, Enum): + YES = "YES" + NO = "NO" + UNCLEAR = "UNCLEAR" + + class AllNotes(BaseModel): """ Serializes all notes for a given detector, grouped by type as listed in UserProfile.NoteCategoryChoices diff --git a/generated/test/test_label.py b/generated/test/test_label.py new file mode 100644 index 00000000..84d4be3d --- /dev/null +++ b/generated/test/test_label.py @@ -0,0 +1,35 @@ +""" + Groundlight API + + 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 + + The version of the OpenAPI document: 0.18.2 + Contact: support@groundlight.ai + Generated by: https://openapi-generator.tech +""" + +import sys +import unittest + +import groundlight_openapi_client +from groundlight_openapi_client.model.label import Label + + +class TestLabel(unittest.TestCase): + """Label unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testLabel(self): + """Test Label""" + # FIXME: construct object with mandatory attributes with example values + # model = Label() # noqa: E501 + pass + + +if __name__ == "__main__": + unittest.main() diff --git a/generated/test/test_source.py b/generated/test/test_source.py new file mode 100644 index 00000000..d20fd740 --- /dev/null +++ b/generated/test/test_source.py @@ -0,0 +1,35 @@ +""" + Groundlight API + + 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 + + The version of the OpenAPI document: 0.18.2 + Contact: support@groundlight.ai + Generated by: https://openapi-generator.tech +""" + +import sys +import unittest + +import groundlight_openapi_client +from groundlight_openapi_client.model.source import Source + + +class TestSource(unittest.TestCase): + """Source unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testSource(self): + """Test Source""" + # FIXME: construct object with mandatory attributes with example values + # model = Source() # noqa: E501 + pass + + +if __name__ == "__main__": + unittest.main() diff --git a/pyproject.toml b/pyproject.toml index bc36ab71..54ea3ef6 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -9,7 +9,7 @@ packages = [ {include = "**/*.py", from = "src"}, ] readme = "README.md" -version = "0.22.5" +version = "0.22.6" [tool.poetry.dependencies] # For certifi, use ">=" instead of "^" since it upgrades its "major version" every year, not really following semver diff --git a/spec/public-api.yaml b/spec/public-api.yaml index ef97fc5c..d6f899c9 100644 --- a/spec/public-api.yaml +++ b/spec/public-api.yaml @@ -1606,7 +1606,8 @@ components: source: type: string result_type: - type: string + enum: + - binary_classification from_edge: type: boolean label: @@ -1625,7 +1626,8 @@ components: source: type: string result_type: - type: string + enum: + - counting from_edge: type: boolean count: @@ -1648,7 +1650,8 @@ components: source: type: string result_type: - type: string + enum: + - multi_classification from_edge: type: boolean label: @@ -1668,7 +1671,8 @@ components: source: type: string result_type: - type: string + enum: + - text_recognition from_edge: type: boolean text: @@ -1691,7 +1695,8 @@ components: source: type: string result_type: - type: string + enum: + - bounding_box from_edge: type: boolean label: @@ -1796,6 +1801,21 @@ components: - CHANGED_TO - NO_CHANGE - NO_QUERIES + Source: + type: string + enum: + - STILL_PROCESSING + - CLOUD + - USER + - CLOUD_ENSEMBLE + - ALGORITHM + - EDGE + Label: + type: string + enum: + - 'YES' + - 'NO' + - UNCLEAR securitySchemes: ApiToken: name: x-api-token