From 6909bebbad1d7ef5cc86094d360c45554b6b9afe Mon Sep 17 00:00:00 2001 From: brandon Date: Tue, 11 Mar 2025 10:33:31 -0700 Subject: [PATCH 1/2] generating client code with done_processing included --- generated/docs/ImageQuery.md | 1 + .../model/image_query.py | 9 ++ .../model/patched_detector_request.py | 151 +++++++++++------- generated/model.py | 5 +- spec/public-api.yaml | 10 +- 5 files changed, 116 insertions(+), 60 deletions(-) diff --git a/generated/docs/ImageQuery.md b/generated/docs/ImageQuery.md index f7999986..a4a3fddc 100644 --- a/generated/docs/ImageQuery.md +++ b/generated/docs/ImageQuery.md @@ -17,6 +17,7 @@ Name | Type | Description | Notes **confidence_threshold** | **float** | Min confidence needed to accept the response of the image query. | [readonly] **rois** | [**[ROI], none_type**](ROI.md) | An array of regions of interest (bounding boxes) collected on image | [readonly] **text** | **str, none_type** | A text field on image query. | [readonly] +**done_processing** | **bool, none_type** | EDGE ONLY - Whether the image query has completed escalating and will receive no new results. | [readonly] defaults to False **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] [[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/groundlight_openapi_client/model/image_query.py b/generated/groundlight_openapi_client/model/image_query.py index fda15e77..8e312308 100644 --- a/generated/groundlight_openapi_client/model/image_query.py +++ b/generated/groundlight_openapi_client/model/image_query.py @@ -159,6 +159,10 @@ def openapi_types(): str, none_type, ), # noqa: E501 + "done_processing": ( + bool, + none_type, + ), # noqa: E501 } @cached_property @@ -178,6 +182,7 @@ def discriminator(): "confidence_threshold": "confidence_threshold", # noqa: E501 "rois": "rois", # noqa: E501 "text": "text", # noqa: E501 + "done_processing": "done_processing", # noqa: E501 } read_only_vars = { @@ -192,6 +197,7 @@ def discriminator(): "confidence_threshold", # noqa: E501 "rois", # noqa: E501 "text", # noqa: E501 + "done_processing", # noqa: E501 } _composed_schemas = {} @@ -232,6 +238,7 @@ def _from_openapi_data( text (str, none_type): A text field on image query. Keyword Args: + done_processing (bool, none_type): EDGE ONLY - Whether the image query has completed escalating and will receive no new results.. defaults to False # 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. @@ -264,6 +271,7 @@ def _from_openapi_data( _visited_composed_classes = (Animal,) """ + done_processing = kwargs.get("done_processing", False) _check_type = kwargs.pop("_check_type", True) _spec_property_naming = kwargs.pop("_spec_property_naming", False) _path_to_item = kwargs.pop("_path_to_item", ()) @@ -302,6 +310,7 @@ def _from_openapi_data( self.confidence_threshold = confidence_threshold self.rois = rois self.text = text + self.done_processing = done_processing for var_name, var_value in kwargs.items(): if ( var_name not in self.attribute_map diff --git a/generated/groundlight_openapi_client/model/patched_detector_request.py b/generated/groundlight_openapi_client/model/patched_detector_request.py index 64534047..251cb75d 100644 --- a/generated/groundlight_openapi_client/model/patched_detector_request.py +++ b/generated/groundlight_openapi_client/model/patched_detector_request.py @@ -8,7 +8,6 @@ Generated by: https://openapi-generator.tech """ - import re # noqa: F401 import sys # noqa: F401 @@ -25,7 +24,7 @@ file_type, none_type, validate_get_composed_info, - OpenApiModel + OpenApiModel, ) from groundlight_openapi_client.exceptions import ApiAttributeError @@ -34,9 +33,10 @@ def lazy_import(): from groundlight_openapi_client.model.blank_enum import BlankEnum from groundlight_openapi_client.model.escalation_type_enum import EscalationTypeEnum from groundlight_openapi_client.model.status_enum import StatusEnum - globals()['BlankEnum'] = BlankEnum - globals()['EscalationTypeEnum'] = EscalationTypeEnum - globals()['StatusEnum'] = StatusEnum + + globals()["BlankEnum"] = BlankEnum + globals()["EscalationTypeEnum"] = EscalationTypeEnum + globals()["StatusEnum"] = StatusEnum class PatchedDetectorRequest(ModelNormal): @@ -63,21 +63,20 @@ class PatchedDetectorRequest(ModelNormal): as additional properties values. """ - allowed_values = { - } + allowed_values = {} validations = { - ('name',): { - 'max_length': 200, - 'min_length': 1, + ("name",): { + "max_length": 200, + "min_length": 1, }, - ('confidence_threshold',): { - 'inclusive_maximum': 1.0, - 'inclusive_minimum': 0.0, + ("confidence_threshold",): { + "inclusive_maximum": 1.0, + "inclusive_minimum": 0.0, }, - ('patience_time',): { - 'inclusive_maximum': 3600, - 'inclusive_minimum': 0, + ("patience_time",): { + "inclusive_maximum": 3600, + "inclusive_minimum": 0, }, } @@ -88,7 +87,17 @@ def additional_properties_type(): of type self, this must run after the class is loaded """ lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -104,28 +113,46 @@ def openapi_types(): """ lazy_import() return { - 'name': (str,), # noqa: E501 - 'confidence_threshold': (float,), # noqa: E501 - 'patience_time': (float,), # noqa: E501 - 'status': (bool, date, datetime, dict, float, int, list, str, none_type,), # noqa: E501 - 'escalation_type': (bool, date, datetime, dict, float, int, list, str, none_type,), # noqa: E501 + "name": (str,), # noqa: E501 + "confidence_threshold": (float,), # noqa: E501 + "patience_time": (float,), # noqa: E501 + "status": ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ), # noqa: E501 + "escalation_type": ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ), # noqa: E501 } @cached_property def discriminator(): return None - attribute_map = { - 'name': 'name', # noqa: E501 - 'confidence_threshold': 'confidence_threshold', # noqa: E501 - 'patience_time': 'patience_time', # noqa: E501 - 'status': 'status', # noqa: E501 - 'escalation_type': 'escalation_type', # noqa: E501 + "name": "name", # noqa: E501 + "confidence_threshold": "confidence_threshold", # noqa: E501 + "patience_time": "patience_time", # noqa: E501 + "status": "status", # noqa: E501 + "escalation_type": "escalation_type", # noqa: E501 } - read_only_vars = { - } + read_only_vars = {} _composed_schemas = {} @@ -172,17 +199,18 @@ def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 escalation_type (bool, date, datetime, dict, float, int, list, str, none_type): Category that define internal proccess for labeling image queries * `STANDARD` - STANDARD * `NO_HUMAN_LABELING` - NO_HUMAN_LABELING. [optional] # noqa: E501 """ - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) self = super(OpenApiModel, cls).__new__(cls) if args: raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( args, self.__class__.__name__, ), @@ -198,22 +226,24 @@ def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 self._visited_composed_classes = _visited_composed_classes + (self.__class__,) for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): # discard variable. continue setattr(self, var_name, var_value) return self required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', + "_data_store", + "_check_type", + "_spec_property_naming", + "_path_to_item", + "_configuration", + "_visited_composed_classes", ]) @convert_js_args_to_python_args @@ -258,15 +288,16 @@ def __init__(self, *args, **kwargs): # noqa: E501 escalation_type (bool, date, datetime, dict, float, int, list, str, none_type): Category that define internal proccess for labeling image queries * `STANDARD` - STANDARD * `NO_HUMAN_LABELING` - NO_HUMAN_LABELING. [optional] # noqa: E501 """ - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _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." % ( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( args, self.__class__.__name__, ), @@ -282,13 +313,17 @@ def __init__(self, *args, **kwargs): # noqa: E501 self._visited_composed_classes = _visited_composed_classes + (self.__class__,) for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): # discard variable. continue setattr(self, var_name, var_value) if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + "class with read only attributes." + ) diff --git a/generated/model.py b/generated/model.py index d2df2890..2f5b8747 100644 --- a/generated/model.py +++ b/generated/model.py @@ -1,6 +1,6 @@ # generated by datamodel-codegen: # filename: public-api.yaml -# timestamp: 2025-03-05T22:46:43+00:00 +# timestamp: 2025-03-11T17:29:10+00:00 from __future__ import annotations @@ -430,6 +430,9 @@ class ImageQuery(BaseModel): ..., description="An array of regions of interest (bounding boxes) collected on image" ) text: Optional[str] = Field(..., description="A text field on image query.") + done_processing: Optional[bool] = Field( + ..., description="EDGE ONLY - Whether the image query has completed escalating and will receive no new results." + ) class LabelValue(BaseModel): diff --git a/spec/public-api.yaml b/spec/public-api.yaml index 94785eb9..c8f7ee5d 100644 --- a/spec/public-api.yaml +++ b/spec/public-api.yaml @@ -1100,10 +1100,18 @@ components: nullable: true readOnly: true description: A text field on image query. + done_processing: + type: boolean + nullable: true + readOnly: true + default: false + description: EDGE ONLY - Whether the image query has completed escalating + and will receive no new results. required: - confidence_threshold - created_at - detector_id + - done_processing - id - metadata - patience_time @@ -1759,4 +1767,4 @@ servers: - url: https://device.positronix.ai/device-api description: Device Prod - url: https://device.integ.positronix.ai/device-api - description: Device Integ \ No newline at end of file + description: Device Integ From 18b5cffaf93ef7349579fb74fd9060234a3ace8f Mon Sep 17 00:00:00 2001 From: brandon Date: Tue, 11 Mar 2025 11:58:16 -0700 Subject: [PATCH 2/2] correction --- generated/docs/ImageQuery.md | 2 +- .../groundlight_openapi_client/model/image_query.py | 11 +++-------- generated/model.py | 7 ++++--- spec/public-api.yaml | 3 --- 4 files changed, 8 insertions(+), 15 deletions(-) diff --git a/generated/docs/ImageQuery.md b/generated/docs/ImageQuery.md index a4a3fddc..6ed5ae92 100644 --- a/generated/docs/ImageQuery.md +++ b/generated/docs/ImageQuery.md @@ -17,7 +17,7 @@ Name | Type | Description | Notes **confidence_threshold** | **float** | Min confidence needed to accept the response of the image query. | [readonly] **rois** | [**[ROI], none_type**](ROI.md) | An array of regions of interest (bounding boxes) collected on image | [readonly] **text** | **str, none_type** | A text field on image query. | [readonly] -**done_processing** | **bool, none_type** | EDGE ONLY - Whether the image query has completed escalating and will receive no new results. | [readonly] defaults to False +**done_processing** | **bool** | EDGE ONLY - Whether the image query has completed escalating and will receive no new results. | [optional] if omitted the server will use the default value of False **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] [[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/groundlight_openapi_client/model/image_query.py b/generated/groundlight_openapi_client/model/image_query.py index 8e312308..3cb597b7 100644 --- a/generated/groundlight_openapi_client/model/image_query.py +++ b/generated/groundlight_openapi_client/model/image_query.py @@ -159,10 +159,7 @@ def openapi_types(): str, none_type, ), # noqa: E501 - "done_processing": ( - bool, - none_type, - ), # noqa: E501 + "done_processing": (bool,), # noqa: E501 } @cached_property @@ -197,7 +194,6 @@ def discriminator(): "confidence_threshold", # noqa: E501 "rois", # noqa: E501 "text", # noqa: E501 - "done_processing", # noqa: E501 } _composed_schemas = {} @@ -238,7 +234,6 @@ def _from_openapi_data( text (str, none_type): A text field on image query. Keyword Args: - done_processing (bool, none_type): EDGE ONLY - Whether the image query has completed escalating and will receive no new results.. defaults to False # 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. @@ -269,9 +264,9 @@ def _from_openapi_data( Animal class but this time we won't travel through its discriminator because we passed in _visited_composed_classes = (Animal,) + done_processing (bool): EDGE ONLY - Whether the image query has completed escalating and will receive no new results.. [optional] if omitted the server will use the default value of False # noqa: E501 """ - done_processing = kwargs.get("done_processing", False) _check_type = kwargs.pop("_check_type", True) _spec_property_naming = kwargs.pop("_spec_property_naming", False) _path_to_item = kwargs.pop("_path_to_item", ()) @@ -310,7 +305,6 @@ def _from_openapi_data( self.confidence_threshold = confidence_threshold self.rois = rois self.text = text - self.done_processing = done_processing for var_name, var_value in kwargs.items(): if ( var_name not in self.attribute_map @@ -368,6 +362,7 @@ def __init__(self, result, *args, **kwargs): # noqa: E501 Animal class but this time we won't travel through its discriminator because we passed in _visited_composed_classes = (Animal,) + done_processing (bool): EDGE ONLY - Whether the image query has completed escalating and will receive no new results.. [optional] if omitted the server will use the default value of False # noqa: E501 """ _check_type = kwargs.pop("_check_type", True) diff --git a/generated/model.py b/generated/model.py index 2f5b8747..66f5927d 100644 --- a/generated/model.py +++ b/generated/model.py @@ -1,6 +1,6 @@ # generated by datamodel-codegen: # filename: public-api.yaml -# timestamp: 2025-03-11T17:29:10+00:00 +# timestamp: 2025-03-11T18:57:57+00:00 from __future__ import annotations @@ -430,8 +430,9 @@ class ImageQuery(BaseModel): ..., description="An array of regions of interest (bounding boxes) collected on image" ) text: Optional[str] = Field(..., description="A text field on image query.") - done_processing: Optional[bool] = Field( - ..., description="EDGE ONLY - Whether the image query has completed escalating and will receive no new results." + done_processing: bool = Field( + False, + description="EDGE ONLY - Whether the image query has completed escalating and will receive no new results.", ) diff --git a/spec/public-api.yaml b/spec/public-api.yaml index c8f7ee5d..bb11e4ff 100644 --- a/spec/public-api.yaml +++ b/spec/public-api.yaml @@ -1102,8 +1102,6 @@ components: description: A text field on image query. done_processing: type: boolean - nullable: true - readOnly: true default: false description: EDGE ONLY - Whether the image query has completed escalating and will receive no new results. @@ -1111,7 +1109,6 @@ components: - confidence_threshold - created_at - detector_id - - done_processing - id - metadata - patience_time